{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./Content/css/main.scss?e9fd","webpack:///./Content/index.ts","webpack:///./Content/js/Alerts.ts","webpack:///./Content/js/main.js","webpack:///./Content/js/modal.ts","webpack:///./Content/js/preferences.ts","webpack:///./Content/js/tabs.ts","webpack:///./node_modules/focus-visible/dist/focus-visible.js","webpack:///./Content/css/main.scss?0e91","webpack:///./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"],"names":[],"mappings":";QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;AClFA,UAAU,mBAAO,CAAC,sJAA2E;AAC7F,0BAA0B,mBAAO,CAAC,4bAAqP;;AAEvR;;AAEA;AACA,0BAA0B,QAAS;AACnC;;AAEA;;AAEA;AACA;;AAEA;;;;AAIA,sC;;;;;;;;;;;;AClBa;AACb;AACA,mBAAO,CAAC,0CAAc;AACtB,mBAAO,CAAC,gDAAiB;;;;;;;;;;;;;ACHZ;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,cAAc;AAC/C,+BAA+B,YAAY;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,YAAY;AACZ,CAAC;AACD;;;;;;;;;;;;;AChDA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAA0B;AACE;AACmC;;AAE/D,mBAAO,CAAC,yEAAe;;AAEvB;AACA;AACA;AACA;AACA,QAAQ,4CAAI;AACZ,QAAQ,6CAAK;AACb,QAAQ,sEAAiB;AACzB,QAAQ,gEAAW;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;;;;;;;;;;;;;ACtBY;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,iBAAiB,EAAE;AAC5E;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;ACjDa;AACb;AACA,4EAA4E,OAAO;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,mBAAO,CAAC,wCAAU;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B,wFAAwF;AACpH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,aAAa,GAAG,oCAAoC;AACpD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,0DAA0D,mBAAmB,EAAE;AAC/E,+DAA+D,4BAA4B,EAAE;AAC7F,iEAAiE,6BAA6B,EAAE;AAChG,uEAAuE,uDAAuD,EAAE;AAChI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,IAAI;AACb;AACA;AACA;AACA,2BAA2B,kBAAkB;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC,6BAA6B;AAC7B,yBAAyB;AACzB,qBAAqB;AACrB,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;AC5Qa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;AClBA;AACA,EAAE,KAA4D;AAC9D,EAAE,SACW;AACb,CAAC,qBAAqB;;AAEtB;AACA;AACA;AACA;AACA,aAAa,sBAAsB;AACnC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,eAAe,QAAQ;AACvB,gBAAgB;AAChB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAe,QAAQ;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,cAAc;AAC7B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA,4EAA4E;AAC5E;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,CAAC;;;;;;;;;;;;ACvTD,uC;;;;;;;;;;;;ACAa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA,uDAAuD;;AAEvD;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,CAAC;;AAED;;AAEA;AACA;;AAEA,iBAAiB,wBAAwB;AACzC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,iBAAiB,iBAAiB;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,gBAAgB,KAAwC,GAAG,sBAAiB,GAAG,SAAI;;AAEnF;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;AACA,GAAG;AACH;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;;AAED;AACA,qEAAqE,qBAAqB,aAAa;;AAEvG;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA,yDAAyD;AACzD,GAAG;;AAEH;;;AAGA;AACA;AACA,GAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA,0BAA0B;AAC1B;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,mBAAmB,4BAA4B;AAC/C;AACA;AACA;AACA;;AAEA;;AAEA,oBAAoB,6BAA6B;AACjD;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,E","file":"main.bundle.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","var api = require(\"!../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\");\n var content = require(\"!!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--5-1!../../node_modules/css-loader/dist/cjs.js??ref--5-2!../../node_modules/postcss-loader/src/index.js??ref--5-3!../../node_modules/sass-loader/dist/cjs.js??ref--5-4!./main.scss\");\n\n content = content.__esModule ? content.default : content;\n\n if (typeof content === 'string') {\n content = [[module.id, content, '']];\n }\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nmodule.exports = content.locals || {};","\"use strict\";\r\nexports.__esModule = true;\r\nrequire(\"./js/main.js\");\r\nrequire(\"./css/main.scss\");\r\n","\"use strict\";\r\nexports.__esModule = true;\r\nvar alerts = (function () {\r\n var timeout;\r\n var secondsAlertActive = 10;\r\n var alertContainer = document.querySelector('.alerts-container');\r\n //Creates new alert, stores id of alert element, and runs interval if needed\r\n var createNewAlert = function (topicId, topic) {\r\n if (topicId === void 0) { topicId = ''; }\r\n if (topic === void 0) { topic = ''; }\r\n if (timeout)\r\n cleanupAlerts();\r\n var alertCopy = topicId != '' ?\r\n \"Unchecked all \".concat(topic, \"
related products.\") :\r\n \"Your preferences have been saved!\";\r\n var alertMessage = \"\\n
\\n \\\"\\\"\\n

\").concat(alertCopy, \"

\\n \\n
\\n \");\r\n alertContainer.innerHTML += alertMessage;\r\n timeout = window.setTimeout(cleanupAlerts, secondsAlertActive * 1000);\r\n };\r\n //Cleans up any alerts on page and in array if needed\r\n var cleanupAlerts = function () {\r\n clearTimeout(timeout);\r\n timeout = undefined;\r\n alertContainer.innerHTML = '';\r\n };\r\n //Open topic dropdown and close alert\r\n var handleUncheckedAlert = function (e) {\r\n var element = e.target;\r\n if (element.classList.contains('alert-check')) {\r\n var topic = element.getAttribute('data-topic');\r\n var topicList = document.querySelector(\"[data-topic-id=\".concat(topic, \"]\")).closest('li');\r\n topicList.classList.add('active');\r\n cleanupAlerts();\r\n }\r\n };\r\n //Handle adding event listeners\r\n var handleEvents = function () {\r\n window.addEventListener('click', function (e) {\r\n handleUncheckedAlert(e);\r\n });\r\n };\r\n //Functions to run when parent is called\r\n var init = function () {\r\n handleEvents();\r\n };\r\n init();\r\n return { createNewAlert: createNewAlert };\r\n}());\r\nexports[\"default\"] = alerts;\r\n","import tabs from './tabs';\r\nimport modal from './modal';\r\nimport { preferences, renderPreferences } from './preferences';\r\n\r\nrequire('focus-visible');\r\n\r\n(function () {\r\n var pageLoadFunctions = {\r\n init: function () {\r\n if (typeof topics != 'undefined') {\r\n tabs();\r\n modal();\r\n renderPreferences();\r\n preferences();\r\n }\r\n }\r\n };\r\n document.onreadystatechange = function () {\r\n if (document.readyState === 'complete') {\r\n pageLoadFunctions.init();\r\n }\r\n };\r\n})();\r\n\r\n","\"use strict\";\r\nexports.__esModule = true;\r\nvar modal = function () {\r\n /* Variable inits */\r\n var openedModals = [];\r\n var modalSmall = document.querySelector('.modal-small');\r\n var modalContainer = document.querySelector('.modal-container');\r\n //\r\n var closeModal = function () {\r\n openedModals[0].classList.remove('open');\r\n openedModals[0].setAttribute('tabindex', '');\r\n if (openedModals.length < 2)\r\n modalContainer.classList.remove('open');\r\n openedModals.shift();\r\n if (openedModals[0])\r\n openedModals[0].focus();\r\n };\r\n //\r\n var openModal = function (modalElement) {\r\n openedModals.unshift(modalElement);\r\n modalElement.classList.add('open');\r\n modalContainer.classList.add('open');\r\n modalElement.setAttribute('tabindex', '-1');\r\n modalElement.focus();\r\n };\r\n //\r\n var modalHandler = function (e) {\r\n var target = e.target;\r\n var modalAttribute = target.getAttribute('data-modal');\r\n switch (modalAttribute) {\r\n case 'small':\r\n openModal(modalSmall);\r\n break;\r\n case 'close':\r\n closeModal();\r\n break;\r\n default:\r\n break;\r\n }\r\n };\r\n //Creates event listeners\r\n var handleEvents = function () {\r\n document.addEventListener('click', function (e) { modalHandler(e); });\r\n };\r\n var init = function () {\r\n handleEvents();\r\n };\r\n init();\r\n};\r\nexports[\"default\"] = modal;\r\n","\"use strict\";\r\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n};\r\nexports.__esModule = true;\r\nexports.renderPreferences = exports.preferences = void 0;\r\nvar Alerts_1 = require(\"./Alerts\");\r\n//Preferences toggle functionality\r\nvar preferences = function () {\r\n var selectAll = undefined;\r\n var saveButton = document.querySelector('#save');\r\n var selectAllButton = document.querySelector('#select');\r\n var deselectAllButton = document.querySelector('#deselect');\r\n var topicInputs = Array.from(document.querySelectorAll('.topic'));\r\n var permissionsAcceptButton = document.querySelector('#grant-permissions');\r\n var dropdownButtons = Array.from(document.querySelectorAll('.dropdown button'));\r\n var preferencesInputs = Array.from(document.querySelectorAll('.preferences-list input'));\r\n //Toogles all preferences based on parameter\r\n var toggleAllPreferences = function (boolean) {\r\n preferencesInputs.map(function (input) {\r\n input.checked = boolean;\r\n input.classList.remove('intermediate');\r\n });\r\n updateConsentAllNone(boolean);\r\n };\r\n //update consent, all or none buttons, and selectall variable on select all or none\r\n var updateConsentAllNone = function (value) {\r\n permissionsAcceptButton.checked = value;\r\n selectAllButton.closest('div').setAttribute('data-all', String(value));\r\n selectAll = value;\r\n };\r\n // Logic to brands and topic inputs for toggle\r\n var togglePreferenceLogic = function (input, init) {\r\n var topicsChecked = 0;\r\n var topicsIntermediate = 0;\r\n var topic = input.getAttribute('data-topic');\r\n var topicId = input.getAttribute('data-topic-id');\r\n var relatedTopicInputs = Array.from(document.querySelectorAll(\"[data-topic-id=\".concat(topicId, \"]\")));\r\n if (!init) {\r\n checkForDuplicateBrands(input);\r\n input.classList.remove('intermediate');\r\n }\r\n if (input == relatedTopicInputs[0] && !init) {\r\n relatedTopicInputs.map(function (topicInput, index) {\r\n if (index != 0) {\r\n topicInput.checked = input.checked;\r\n checkForDuplicateBrands(topicInput);\r\n topicInput.classList.remove('intermediate');\r\n }\r\n if (!permissionsAcceptButton.checked)\r\n permissionsAcceptButton.checked = true;\r\n });\r\n if (!input.checked)\r\n Alerts_1[\"default\"].createNewAlert(topicId, topic);\r\n relatedTopicInputs[0].classList.remove('intermediate');\r\n }\r\n else {\r\n relatedTopicInputs.map(function (topicInput, index) {\r\n if (index != 0) {\r\n if (topicInput.checked)\r\n topicsChecked++;\r\n if (topicInput.classList.contains('intermediate'))\r\n topicsIntermediate++;\r\n if (!permissionsAcceptButton.checked)\r\n permissionsAcceptButton.checked = true;\r\n }\r\n });\r\n setTopicLevelStatus(topicsChecked, topicsIntermediate, relatedTopicInputs);\r\n }\r\n checkIfAllOrNoPreferencesAreChecked();\r\n };\r\n //Set Topic check status checked, unchecked, or intermediate\r\n var setTopicLevelStatus = function (checked, intermediate, inputs) {\r\n if (checked == 0 && intermediate == 0) {\r\n inputs[0].checked = false;\r\n inputs[0].classList.remove('intermediate');\r\n }\r\n else if (checked == inputs.length - 1) {\r\n inputs[0].checked = true;\r\n inputs[0].classList.remove('intermediate');\r\n }\r\n else {\r\n inputs[0].checked = false;\r\n inputs[0].classList.add('intermediate');\r\n }\r\n };\r\n //Checks manually inputs for all selection, none, or inbetween\r\n var checkIfAllOrNoPreferencesAreChecked = function () {\r\n var anyIntermediate = document.querySelector('[data-brand].intermediate') ? true : false;\r\n var anyUnchecked = document.querySelector('.preferences-list input:not(:checked)') ? true : false;\r\n var anyChecked = document.querySelector('.preferences-list input:checked') || anyIntermediate ? true : false;\r\n if (anyChecked && anyUnchecked) {\r\n selectAllButton.closest('div').setAttribute('data-all', '');\r\n selectAll = undefined;\r\n }\r\n else if (!anyChecked && anyUnchecked) {\r\n updateConsentAllNone(false);\r\n }\r\n else {\r\n updateConsentAllNone(true);\r\n }\r\n };\r\n //Set checked status of topic input (checked or intermediate)\r\n var initSetTopicStatus = function () {\r\n topicInputs.map(function (item) {\r\n togglePreferenceLogic(item, true);\r\n });\r\n };\r\n //Toggles dropdown\r\n var handleDropdown = function (element) {\r\n var parent = element.parentElement.parentElement;\r\n parent.classList.toggle('active');\r\n };\r\n /*Check for duplicate brands when selecting a brand a select that brand if exists under different topic */\r\n var checkForDuplicateBrands = function (element) {\r\n var brand = element.getAttribute('data-brand-id');\r\n var duplicateBrands = brand ? Array.from(document.querySelectorAll(\"[data-brand-id=\".concat(brand, \"]\"))) : [];\r\n duplicateBrands.map(function (input) {\r\n if (input != element && input.checked != element.checked)\r\n input.click();\r\n });\r\n };\r\n //Takes DOM inputs and creates data object for post\r\n var createPostDataObject = function () {\r\n var data;\r\n var updatedInputs = Array.from(document.querySelectorAll('[data-brand-id]'));\r\n if (selectAll == true || selectAll == false) {\r\n data = {\r\n omniId: omni,\r\n emailAddress: email,\r\n response: [{ Brand: 'All Company', Topic: 'N/A', Status: selectAll ? 'true' : 'false', Consent: '' }]\r\n };\r\n }\r\n else {\r\n data = updatedInputs.reduce(function (acc, curr) {\r\n if (!acc['response'])\r\n acc['response'] = [];\r\n var status = curr.getAttribute('data-status');\r\n var determineStatus = (curr.checked && status == '2') || (!curr.checked && status == '0') || curr.classList.contains('intermediate')\r\n ? 'unchanged'\r\n : String(curr.checked);\r\n acc['response'].push({\r\n Status: determineStatus,\r\n Brand: curr.getAttribute('data-brand'),\r\n Topic: curr.getAttribute('data-topic'),\r\n Consent: curr.getAttribute('data-consent')\r\n });\r\n return acc;\r\n }, { omniId: omni, emailAddress: email });\r\n }\r\n return data;\r\n };\r\n //Handles data construction and ajax call\r\n var saveDataChanges = function () {\r\n var xhttp = new XMLHttpRequest();\r\n xhttp.onreadystatechange = function () {\r\n if (this.readyState == 4 && this.status == 200) {\r\n Alerts_1[\"default\"].createNewAlert();\r\n }\r\n };\r\n xhttp.open(\"POST\", window.location.origin + '/', true);\r\n xhttp.setRequestHeader(\"Content-Type\", \"application/json\");\r\n xhttp.send(JSON.stringify(createPostDataObject()));\r\n };\r\n //Handle adding event listeners\r\n var handleEvents = function () {\r\n preferencesInputs.map(function (input) {\r\n input.addEventListener('change', function () {\r\n togglePreferenceLogic(input, false);\r\n });\r\n });\r\n dropdownButtons.map(function (button) {\r\n button.addEventListener('click', function () {\r\n handleDropdown(button);\r\n });\r\n });\r\n saveButton.addEventListener('click', function () { saveDataChanges(); });\r\n selectAllButton.addEventListener('click', function () { toggleAllPreferences(true); });\r\n deselectAllButton.addEventListener('click', function () { toggleAllPreferences(false); });\r\n permissionsAcceptButton.addEventListener('click', function () { toggleAllPreferences(permissionsAcceptButton.checked); });\r\n };\r\n //Functions to run when parent is called\r\n var init = function () {\r\n initSetTopicStatus();\r\n handleEvents();\r\n };\r\n init();\r\n};\r\nexports.preferences = preferences;\r\n//Preferences render on load\r\nvar renderPreferences = function () {\r\n var numberOfTopicColumns = 2;\r\n var preferencesWrapper = document.querySelector('.preferences-list');\r\n /*Dynamically create and load Topics and Brands list items to make*/\r\n var initRenderToPage = function () {\r\n var newTopicsArray = topics.reduce(function (acc, curr) {\r\n var topic = curr.Topic;\r\n var category = curr.Category;\r\n if (topic == 'N/A')\r\n return acc;\r\n if (!acc[topic])\r\n acc[topic] = { noCategory: [] };\r\n if (acc[topic] && !acc[topic][category] && category != null)\r\n acc[topic][category] = [];\r\n category != null ?\r\n acc[topic][category].push(curr) :\r\n acc[topic].noCategory = __spreadArray(__spreadArray([], acc[topic].noCategory, true), [curr], false);\r\n return acc;\r\n }, {});\r\n var sliceIntoColumns = function (array) {\r\n var columns = [];\r\n var numberOfColumns = Math.round(array.length / numberOfTopicColumns);\r\n for (var i = 0; i < array.length; i += numberOfColumns) {\r\n var column = array.slice(i, i + numberOfColumns);\r\n columns.push(column);\r\n }\r\n return columns;\r\n };\r\n var slicing = 1;\r\n var Category = Object.keys(newTopicsArray[Object.keys(newTopicsArray)[slicing]]);\r\n var CategoryTitle = Category.slice(slicing, slicing + 1)[0] != 'noCategory' ? \"\".concat(Category.slice(slicing, slicing + 1), \"\") : '';\r\n var columns = sliceIntoColumns(Object.keys(newTopicsArray));\r\n var datas = createColumnTopicsContent(newTopicsArray, columns, slicing);\r\n preferencesWrapper.innerHTML = '
' + CategoryTitle + datas + '
';\r\n slicing = slicing + 1;\r\n var Categories = Object.keys(newTopicsArray[Object.keys(newTopicsArray)[slicing]]);\r\n var CategoriesTitle = Categories.slice(slicing, slicing + 1)[0] != 'noCategory' ? \"\".concat(Categories.slice(slicing, slicing + 1), \"\") : '';\r\n datas = createColumnTopicsContent(newTopicsArray, columns, slicing);\r\n preferencesWrapper.innerHTML = preferencesWrapper.innerHTML + '
' + CategoriesTitle + datas + '
';\r\n };\r\n /* Create topic lists and columns */\r\n var createColumnTopicsContent = function (array, keys, slicing) {\r\n var createTopicContent = keys.reduce(function (acc, item) {\r\n return acc + \"\\n \".concat((function () {\r\n return item.reduce(function (accTopics, topic) {\r\n var Categories = Object.keys(array[topic]);\r\n var topicId = topic.replace(/[^A-Z0-9]+/ig, '');\r\n var data_topicid = topicId + \"_\" + slicing;\r\n return accTopics + \"\");\r\n }, '');\r\n })(), \"\\n \");\r\n }, '');\r\n return createTopicContent;\r\n };\r\n //Functions to run when parent is called\r\n var init = function () {\r\n initRenderToPage();\r\n };\r\n init();\r\n};\r\nexports.renderPreferences = renderPreferences;\r\n","\"use strict\";\r\nexports.__esModule = true;\r\nvar tabs = function () {\r\n var tabContainer = document.querySelector('.tabs-container');\r\n var tabButtons = Array.from(document.querySelectorAll('.tabs li'));\r\n var handleEvents = function () {\r\n tabButtons.forEach(function (tab, index) {\r\n tab.addEventListener('click', function () {\r\n var newAttribute = (index + 1).toString();\r\n tabContainer.setAttribute('data-tabbed', newAttribute);\r\n });\r\n });\r\n };\r\n var init = function () {\r\n handleEvents();\r\n };\r\n init();\r\n};\r\nexports[\"default\"] = tabs;\r\n","(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (factory());\n}(this, (function () { 'use strict';\n\n /**\n * Applies the :focus-visible polyfill at the given scope.\n * A scope in this case is either the top-level Document or a Shadow Root.\n *\n * @param {(Document|ShadowRoot)} scope\n * @see https://github.com/WICG/focus-visible\n */\n function applyFocusVisiblePolyfill(scope) {\n var hadKeyboardEvent = true;\n var hadFocusVisibleRecently = false;\n var hadFocusVisibleRecentlyTimeout = null;\n\n var inputTypesAllowlist = {\n text: true,\n search: true,\n url: true,\n tel: true,\n email: true,\n password: true,\n number: true,\n date: true,\n month: true,\n week: true,\n time: true,\n datetime: true,\n 'datetime-local': true\n };\n\n /**\n * Helper function for legacy browsers and iframes which sometimes focus\n * elements like document, body, and non-interactive SVG.\n * @param {Element} el\n */\n function isValidFocusTarget(el) {\n if (\n el &&\n el !== document &&\n el.nodeName !== 'HTML' &&\n el.nodeName !== 'BODY' &&\n 'classList' in el &&\n 'contains' in el.classList\n ) {\n return true;\n }\n return false;\n }\n\n /**\n * Computes whether the given element should automatically trigger the\n * `focus-visible` class being added, i.e. whether it should always match\n * `:focus-visible` when focused.\n * @param {Element} el\n * @return {boolean}\n */\n function focusTriggersKeyboardModality(el) {\n var type = el.type;\n var tagName = el.tagName;\n\n if (tagName === 'INPUT' && inputTypesAllowlist[type] && !el.readOnly) {\n return true;\n }\n\n if (tagName === 'TEXTAREA' && !el.readOnly) {\n return true;\n }\n\n if (el.isContentEditable) {\n return true;\n }\n\n return false;\n }\n\n /**\n * Add the `focus-visible` class to the given element if it was not added by\n * the author.\n * @param {Element} el\n */\n function addFocusVisibleClass(el) {\n if (el.classList.contains('focus-visible')) {\n return;\n }\n el.classList.add('focus-visible');\n el.setAttribute('data-focus-visible-added', '');\n }\n\n /**\n * Remove the `focus-visible` class from the given element if it was not\n * originally added by the author.\n * @param {Element} el\n */\n function removeFocusVisibleClass(el) {\n if (!el.hasAttribute('data-focus-visible-added')) {\n return;\n }\n el.classList.remove('focus-visible');\n el.removeAttribute('data-focus-visible-added');\n }\n\n /**\n * If the most recent user interaction was via the keyboard;\n * and the key press did not include a meta, alt/option, or control key;\n * then the modality is keyboard. Otherwise, the modality is not keyboard.\n * Apply `focus-visible` to any current active element and keep track\n * of our keyboard modality state with `hadKeyboardEvent`.\n * @param {KeyboardEvent} e\n */\n function onKeyDown(e) {\n if (e.metaKey || e.altKey || e.ctrlKey) {\n return;\n }\n\n if (isValidFocusTarget(scope.activeElement)) {\n addFocusVisibleClass(scope.activeElement);\n }\n\n hadKeyboardEvent = true;\n }\n\n /**\n * If at any point a user clicks with a pointing device, ensure that we change\n * the modality away from keyboard.\n * This avoids the situation where a user presses a key on an already focused\n * element, and then clicks on a different element, focusing it with a\n * pointing device, while we still think we're in keyboard modality.\n * @param {Event} e\n */\n function onPointerDown(e) {\n hadKeyboardEvent = false;\n }\n\n /**\n * On `focus`, add the `focus-visible` class to the target if:\n * - the target received focus as a result of keyboard navigation, or\n * - the event target is an element that will likely require interaction\n * via the keyboard (e.g. a text box)\n * @param {Event} e\n */\n function onFocus(e) {\n // Prevent IE from focusing the document or HTML element.\n if (!isValidFocusTarget(e.target)) {\n return;\n }\n\n if (hadKeyboardEvent || focusTriggersKeyboardModality(e.target)) {\n addFocusVisibleClass(e.target);\n }\n }\n\n /**\n * On `blur`, remove the `focus-visible` class from the target.\n * @param {Event} e\n */\n function onBlur(e) {\n if (!isValidFocusTarget(e.target)) {\n return;\n }\n\n if (\n e.target.classList.contains('focus-visible') ||\n e.target.hasAttribute('data-focus-visible-added')\n ) {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(function() {\n hadFocusVisibleRecently = false;\n }, 100);\n removeFocusVisibleClass(e.target);\n }\n }\n\n /**\n * If the user changes tabs, keep track of whether or not the previously\n * focused element had .focus-visible.\n * @param {Event} e\n */\n function onVisibilityChange(e) {\n if (document.visibilityState === 'hidden') {\n // If the tab becomes active again, the browser will handle calling focus\n // on the element (Safari actually calls it twice).\n // If this tab change caused a blur on an element with focus-visible,\n // re-apply the class when the user switches back to the tab.\n if (hadFocusVisibleRecently) {\n hadKeyboardEvent = true;\n }\n addInitialPointerMoveListeners();\n }\n }\n\n /**\n * Add a group of listeners to detect usage of any pointing devices.\n * These listeners will be added when the polyfill first loads, and anytime\n * the window is blurred, so that they are active when the window regains\n * focus.\n */\n function addInitialPointerMoveListeners() {\n document.addEventListener('mousemove', onInitialPointerMove);\n document.addEventListener('mousedown', onInitialPointerMove);\n document.addEventListener('mouseup', onInitialPointerMove);\n document.addEventListener('pointermove', onInitialPointerMove);\n document.addEventListener('pointerdown', onInitialPointerMove);\n document.addEventListener('pointerup', onInitialPointerMove);\n document.addEventListener('touchmove', onInitialPointerMove);\n document.addEventListener('touchstart', onInitialPointerMove);\n document.addEventListener('touchend', onInitialPointerMove);\n }\n\n function removeInitialPointerMoveListeners() {\n document.removeEventListener('mousemove', onInitialPointerMove);\n document.removeEventListener('mousedown', onInitialPointerMove);\n document.removeEventListener('mouseup', onInitialPointerMove);\n document.removeEventListener('pointermove', onInitialPointerMove);\n document.removeEventListener('pointerdown', onInitialPointerMove);\n document.removeEventListener('pointerup', onInitialPointerMove);\n document.removeEventListener('touchmove', onInitialPointerMove);\n document.removeEventListener('touchstart', onInitialPointerMove);\n document.removeEventListener('touchend', onInitialPointerMove);\n }\n\n /**\n * When the polfyill first loads, assume the user is in keyboard modality.\n * If any event is received from a pointing device (e.g. mouse, pointer,\n * touch), turn off keyboard modality.\n * This accounts for situations where focus enters the page from the URL bar.\n * @param {Event} e\n */\n function onInitialPointerMove(e) {\n // Work around a Safari quirk that fires a mousemove on whenever the\n // window blurs, even if you're tabbing out of the page. ¯\\_(ツ)_/¯\n if (e.target.nodeName && e.target.nodeName.toLowerCase() === 'html') {\n return;\n }\n\n hadKeyboardEvent = false;\n removeInitialPointerMoveListeners();\n }\n\n // For some kinds of state, we are interested in changes at the global scope\n // only. For example, global pointer input, global key presses and global\n // visibility change should affect the state at every scope:\n document.addEventListener('keydown', onKeyDown, true);\n document.addEventListener('mousedown', onPointerDown, true);\n document.addEventListener('pointerdown', onPointerDown, true);\n document.addEventListener('touchstart', onPointerDown, true);\n document.addEventListener('visibilitychange', onVisibilityChange, true);\n\n addInitialPointerMoveListeners();\n\n // For focus and blur, we specifically care about state changes in the local\n // scope. This is because focus / blur events that originate from within a\n // shadow root are not re-dispatched from the host element if it was already\n // the active element in its own scope:\n scope.addEventListener('focus', onFocus, true);\n scope.addEventListener('blur', onBlur, true);\n\n // We detect that a node is a ShadowRoot by ensuring that it is a\n // DocumentFragment and also has a host property. This check covers native\n // implementation and polyfill implementation transparently. If we only cared\n // about the native implementation, we could just check if the scope was\n // an instance of a ShadowRoot.\n if (scope.nodeType === Node.DOCUMENT_FRAGMENT_NODE && scope.host) {\n // Since a ShadowRoot is a special kind of DocumentFragment, it does not\n // have a root element to add a class to. So, we add this attribute to the\n // host element instead:\n scope.host.setAttribute('data-js-focus-visible', '');\n } else if (scope.nodeType === Node.DOCUMENT_NODE) {\n document.documentElement.classList.add('js-focus-visible');\n document.documentElement.setAttribute('data-js-focus-visible', '');\n }\n }\n\n // It is important to wrap all references to global window and document in\n // these checks to support server-side rendering use cases\n // @see https://github.com/WICG/focus-visible/issues/199\n if (typeof window !== 'undefined' && typeof document !== 'undefined') {\n // Make the polyfill helper globally available. This can be used as a signal\n // to interested libraries that wish to coordinate with the polyfill for e.g.,\n // applying the polyfill to a shadow root:\n window.applyFocusVisiblePolyfill = applyFocusVisiblePolyfill;\n\n // Notify interested libraries of the polyfill's presence, in case the\n // polyfill was loaded lazily:\n var event;\n\n try {\n event = new CustomEvent('focus-visible-polyfill-ready');\n } catch (error) {\n // IE11 does not support using CustomEvent as a constructor directly:\n event = document.createEvent('CustomEvent');\n event.initCustomEvent('focus-visible-polyfill-ready', false, false, {});\n }\n\n window.dispatchEvent(event);\n }\n\n if (typeof document !== 'undefined') {\n // Apply the polyfill to the global document, so that no JavaScript\n // coordination is required to use the polyfill in the top-level document:\n applyFocusVisiblePolyfill(document);\n }\n\n})));\n","// extracted by mini-css-extract-plugin","\"use strict\";\n\nvar isOldIE = function isOldIE() {\n var memo;\n return function memorize() {\n if (typeof memo === 'undefined') {\n // Test for IE <= 9 as proposed by Browserhacks\n // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805\n // Tests for existence of standard globals is to allow style-loader\n // to operate correctly into non-standard environments\n // @see https://github.com/webpack-contrib/style-loader/issues/177\n memo = Boolean(window && document && document.all && !window.atob);\n }\n\n return memo;\n };\n}();\n\nvar getTarget = function getTarget() {\n var memo = {};\n return function memorize(target) {\n if (typeof memo[target] === 'undefined') {\n var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself\n\n if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {\n try {\n // This will throw an exception if access to iframe is blocked\n // due to cross-origin restrictions\n styleTarget = styleTarget.contentDocument.head;\n } catch (e) {\n // istanbul ignore next\n styleTarget = null;\n }\n }\n\n memo[target] = styleTarget;\n }\n\n return memo[target];\n };\n}();\n\nvar stylesInDom = [];\n\nfunction getIndexByIdentifier(identifier) {\n var result = -1;\n\n for (var i = 0; i < stylesInDom.length; i++) {\n if (stylesInDom[i].identifier === identifier) {\n result = i;\n break;\n }\n }\n\n return result;\n}\n\nfunction modulesToDom(list, options) {\n var idCountMap = {};\n var identifiers = [];\n\n for (var i = 0; i < list.length; i++) {\n var item = list[i];\n var id = options.base ? item[0] + options.base : item[0];\n var count = idCountMap[id] || 0;\n var identifier = \"\".concat(id, \" \").concat(count);\n idCountMap[id] = count + 1;\n var index = getIndexByIdentifier(identifier);\n var obj = {\n css: item[1],\n media: item[2],\n sourceMap: item[3]\n };\n\n if (index !== -1) {\n stylesInDom[index].references++;\n stylesInDom[index].updater(obj);\n } else {\n stylesInDom.push({\n identifier: identifier,\n updater: addStyle(obj, options),\n references: 1\n });\n }\n\n identifiers.push(identifier);\n }\n\n return identifiers;\n}\n\nfunction insertStyleElement(options) {\n var style = document.createElement('style');\n var attributes = options.attributes || {};\n\n if (typeof attributes.nonce === 'undefined') {\n var nonce = typeof __webpack_nonce__ !== 'undefined' ? __webpack_nonce__ : null;\n\n if (nonce) {\n attributes.nonce = nonce;\n }\n }\n\n Object.keys(attributes).forEach(function (key) {\n style.setAttribute(key, attributes[key]);\n });\n\n if (typeof options.insert === 'function') {\n options.insert(style);\n } else {\n var target = getTarget(options.insert || 'head');\n\n if (!target) {\n throw new Error(\"Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.\");\n }\n\n target.appendChild(style);\n }\n\n return style;\n}\n\nfunction removeStyleElement(style) {\n // istanbul ignore if\n if (style.parentNode === null) {\n return false;\n }\n\n style.parentNode.removeChild(style);\n}\n/* istanbul ignore next */\n\n\nvar replaceText = function replaceText() {\n var textStore = [];\n return function replace(index, replacement) {\n textStore[index] = replacement;\n return textStore.filter(Boolean).join('\\n');\n };\n}();\n\nfunction applyToSingletonTag(style, index, remove, obj) {\n var css = remove ? '' : obj.media ? \"@media \".concat(obj.media, \" {\").concat(obj.css, \"}\") : obj.css; // For old IE\n\n /* istanbul ignore if */\n\n if (style.styleSheet) {\n style.styleSheet.cssText = replaceText(index, css);\n } else {\n var cssNode = document.createTextNode(css);\n var childNodes = style.childNodes;\n\n if (childNodes[index]) {\n style.removeChild(childNodes[index]);\n }\n\n if (childNodes.length) {\n style.insertBefore(cssNode, childNodes[index]);\n } else {\n style.appendChild(cssNode);\n }\n }\n}\n\nfunction applyToTag(style, options, obj) {\n var css = obj.css;\n var media = obj.media;\n var sourceMap = obj.sourceMap;\n\n if (media) {\n style.setAttribute('media', media);\n } else {\n style.removeAttribute('media');\n }\n\n if (sourceMap && typeof btoa !== 'undefined') {\n css += \"\\n/*# sourceMappingURL=data:application/json;base64,\".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), \" */\");\n } // For old IE\n\n /* istanbul ignore if */\n\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n while (style.firstChild) {\n style.removeChild(style.firstChild);\n }\n\n style.appendChild(document.createTextNode(css));\n }\n}\n\nvar singleton = null;\nvar singletonCounter = 0;\n\nfunction addStyle(obj, options) {\n var style;\n var update;\n var remove;\n\n if (options.singleton) {\n var styleIndex = singletonCounter++;\n style = singleton || (singleton = insertStyleElement(options));\n update = applyToSingletonTag.bind(null, style, styleIndex, false);\n remove = applyToSingletonTag.bind(null, style, styleIndex, true);\n } else {\n style = insertStyleElement(options);\n update = applyToTag.bind(null, style, options);\n\n remove = function remove() {\n removeStyleElement(style);\n };\n }\n\n update(obj);\n return function updateStyle(newObj) {\n if (newObj) {\n if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {\n return;\n }\n\n update(obj = newObj);\n } else {\n remove();\n }\n };\n}\n\nmodule.exports = function (list, options) {\n options = options || {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of