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Q,QAASC,YAAa,KAChC,CAAED,OAAQ,OAAQC,YAAa,KAC/B,CAAED,OAAQ,OAAQC,YAAa,MAGnBN,SAAQ,EAAGK,SAAQC,kBAC/BF,EAAcA,EAAYxI,QAAQyI,EAAQC,EAAY,IAEnDF,CAAW,EA0DoBG,CAvDA,CAACC,IACvC,IAAKA,EACD,MAAO,GAEX,MAAMH,EAAS,IAAII,OAAO,GAAG7E,cAAgD,KAE7E,MAAO,IAD8B4E,EAAgBE,SAASL,IACrBM,KAAKC,GAASA,EAAK,KAAIC,KAAK,IAAI,EAgD9CC,EAvDDxD,EAuDwDF,EAAUE,UAvDpD,IAAIA,GAAWuD,KAAK,QAyDxD,IAAIE,EACJ,IACIA,EACIb,GACI9C,EAAUyC,iBAAiB,UAAUK,IACjD,CACA,MAAOc,GACHC,QAAQC,MAAM,6CAA8CF,EAChE,CACA,GAAID,GAAgBhE,OAAQ,CACxB,MAAMoE,EAA0B,IAAIJ,GAAgBhB,QAAQ3C,GAAgE,SAAlDhC,OAAOqB,iBAAiBW,GAAoB,UAClH+D,GAAyBpE,QACzB+C,EAAgBsB,OAAOnB,EAAO,KAAMkB,EAE5C,KAEGrB,CAAe,EAMHuB,GACd1B,GAAY5C,SAGjBd,EAAW,IAAI0D,GAAYgB,KAAKvD,IAAc,CAC1Cd,KAAMc,MACP,EAyBHkE,GACArC,GAAoB,EAEXsC,EAA2B,KACpCrF,EAAS0D,SAAS4B,KAClBrF,EAAWD,GAAQuF,cAAc,gBAAavI,EAC9CuG,GAAc,EAEZiC,EAAyB,IAASzC,EAAoB,KACtD0C,EAAyB,IAASlC,EAAc,KAChC,oBAAXrE,SACPwE,SAASgC,iBAAiB,mBAAoBL,GAC9CnG,OAAOwG,iBAAiB,SAAUD,GAClCvG,OAAOwG,iBAAiB,SAAUF,G","sources":["webpack://tmv2-components/webpack/universalModuleDefinition","webpack://tmv2-components/./.yarn/cache/lodash.throttle-npm-4.1.1-856641af92-129c0a28ce.zip/node_modules/lodash.throttle/index.js","webpack://tmv2-components/webpack/bootstrap","webpack://tmv2-components/webpack/runtime/compat get default export","webpack://tmv2-components/webpack/runtime/define property getters","webpack://tmv2-components/webpack/runtime/global","webpack://tmv2-components/webpack/runtime/hasOwnProperty shorthand","webpack://tmv2-components/webpack/runtime/make namespace object","webpack://tmv2-components/./src/headerThemeToggle/colorHandling.utils.ts","webpack://tmv2-components/./src/headerThemeToggle/headerThemeToggle.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"headerthemetoggle\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"headerthemetoggle\"] = factory();\n\telse\n\t\troot[\"headerthemetoggle\"] = factory();\n})(this, () => {\nreturn ","/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n result = wait - timeSinceLastCall;\n\n return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\n/**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n * Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\nfunction throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, {\n 'leading': leading,\n 'maxWait': wait,\n 'trailing': trailing\n });\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = throttle;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export const RGBToHSL = (r, g, b) => {\r\n r /= 255;\r\n g /= 255;\r\n b /= 255;\r\n const cmin = Math.min(r, g, b), cmax = Math.max(r, g, b), delta = cmax - cmin;\r\n let h = 0, s = 0, l = 0;\r\n if (delta === 0) {\r\n h = 0;\r\n }\r\n else if (cmax === r) {\r\n h = ((g - b) / delta) % 6;\r\n }\r\n else if (cmax === g) {\r\n h = (b - r) / delta + 2;\r\n }\r\n else {\r\n h = (r - g) / delta + 4;\r\n }\r\n h = Math.round(h * 60);\r\n if (h < 0) {\r\n h += 360;\r\n }\r\n l = (cmax + cmin) / 2;\r\n s = delta === 0 ? 0 : delta / (1 - Math.abs(2 * l - 1));\r\n s = +(s * 100).toFixed(1);\r\n l = +(l * 100).toFixed(1);\r\n return `hsl(${h},${s}%,${l}%)`;\r\n};\r\nexport const RGBToHSLFromString = (rgb) => {\r\n const sep = rgb.indexOf(\",\") > -1 ? \",\" : \" \";\r\n rgb = rgb.substr(4).split(\")\")[0].split(sep);\r\n for (const R in rgb) {\r\n if (!rgb.hasOwnProperty(R)) {\r\n continue;\r\n }\r\n const r = rgb[R];\r\n if (r.indexOf(\"%\") > -1) {\r\n rgb[R] = Math.round((r.substr(0, r.length - 1) / 100) * 255);\r\n }\r\n }\r\n const r = rgb[0] / 255, g = rgb[1] / 255, b = rgb[2] / 255;\r\n return RGBToHSL(r, g, b);\r\n};\r\n","import throttle from \"lodash.throttle\";\r\nimport { RGBToHSL } from \"./colorHandling.utils\";\r\nconst MAX_LEVELS_COLOR_PROBING = 20;\r\nconst DEFAULT_PAGE_SECTIONS_SELECTOR = \"body>main>*, body>footer\";\r\nconst CSS_CLASSNAME_PREFIX = \"__header-theme-toggle_\";\r\nconst CLASSNAME_CONTENT_CONTAINER_PREFIX = `${CSS_CLASSNAME_PREFIX}content-container`;\r\nconst CLASSNAME_TOGGLE_HEADER_PREFIX = `${CSS_CLASSNAME_PREFIX}change-header`;\r\nconst CLASSNAME_TOGGLE_HEADER_DARK = `${CLASSNAME_TOGGLE_HEADER_PREFIX}--dark`;\r\nconst CLASSNAME_TOGGLE_HEADER_LIGHT = `${CLASSNAME_TOGGLE_HEADER_PREFIX}--light`;\r\nconst CLASSNAME_HEADER_HEIGHT_SCROLLED = \"has-header-height-scrolled\";\r\nconst CLASSNAME_HEADER_DARK_THEME = \"has-dark-header\";\r\nconst CLASSNAME_HEADER_LIGHT_THEME = \"has-light-header\";\r\nlet intersectingSectionIndex = undefined;\r\nlet sections = undefined;\r\nlet bodyEl = undefined;\r\nlet headerEl = undefined;\r\nlet headerElBottomY = 0;\r\nconst isTransparentColor = (colorRgbValue) => {\r\n const transparentColorsValues = [\"rgba(0, 0, 0, 0)\"];\r\n if (transparentColorsValues.includes(colorRgbValue)) {\r\n return true;\r\n }\r\n return false;\r\n};\r\nconst getNodeBgColor = (node) => {\r\n const bgColor = window.getComputedStyle(node)[\"background-color\"];\r\n if (isTransparentColor(bgColor)) {\r\n return;\r\n }\r\n return bgColor;\r\n};\r\nconst getSectionBgColor = (node, recursionLevelsCounter = 1) => {\r\n if (recursionLevelsCounter === MAX_LEVELS_COLOR_PROBING) {\r\n return;\r\n }\r\n const bgColor = getNodeBgColor(node);\r\n if (bgColor) {\r\n return bgColor;\r\n }\r\n const subNodes = node.childNodes;\r\n for (let i = 0; i < subNodes.length; i++) {\r\n const subNode = subNodes[i];\r\n if (subNode.nodeType !== 1) {\r\n continue;\r\n }\r\n return getSectionBgColor(subNode, recursionLevelsCounter + 1);\r\n }\r\n return;\r\n};\r\nconst extractCSSSelectorsFromCustomString = (string) => {\r\n const replacementsMap = [\r\n { regExp: /\\\\000020/g, replacement: \" \" },\r\n { regExp: /\\\\\\./g, replacement: \".\" },\r\n { regExp: /\\\\>/g, replacement: \">\" },\r\n { regExp: /\\\\\\*/g, replacement: \"*\" },\r\n { regExp: /\\\\:/g, replacement: \":\" },\r\n { regExp: /\\\\,/g, replacement: \",\" }\r\n ];\r\n let cssSelector = string;\r\n replacementsMap.forEach(({ regExp, replacement }) => {\r\n cssSelector = cssSelector.replace(regExp, replacement);\r\n });\r\n return cssSelector;\r\n};\r\nconst getClassListAsString = (classList) => [...classList].join(\" \");\r\nconst getAnyNestedContentContainersHint = (classListString) => {\r\n if (!classListString) {\r\n return \"\";\r\n }\r\n const regExp = new RegExp(`${CLASSNAME_CONTENT_CONTAINER_PREFIX}___([^ ]+)`, \"g\");\r\n const possibleNestedContainerHints = classListString.matchAll(regExp);\r\n return [...possibleNestedContainerHints].map((hint) => hint[1]).join(\",\");\r\n};\r\nconst getMatchingHeaderTheme = (sectionBgColor) => {\r\n if (!sectionBgColor) {\r\n return \"light\";\r\n }\r\n const rgbComponents = sectionBgColor.replace(/[^\\d,.]/g, \"\").split(\",\");\r\n const hslColor = RGBToHSL(rgbComponents[0], rgbComponents[1], rgbComponents[2]);\r\n const hslComponents = hslColor.replace(/[^\\d,.]/g, \"\").split(\",\");\r\n const lightnessRate = hslComponents.length && hslComponents[2] !== undefined\r\n ? hslComponents[2]\r\n : undefined;\r\n if (!lightnessRate || Number(lightnessRate) > 50) {\r\n return \"light\";\r\n }\r\n return \"dark\";\r\n};\r\nconst checkShouldHeaderBeDark = (headerIntersectSectionIndex) => {\r\n if (!sections) {\r\n return;\r\n }\r\n const sectionEl = sections[headerIntersectSectionIndex].node;\r\n const elementCssClassList = sectionEl.classList;\r\n const shouldForceDarkHeader = elementCssClassList.contains(CLASSNAME_TOGGLE_HEADER_DARK);\r\n const shouldForceLightHeader = elementCssClassList.contains(CLASSNAME_TOGGLE_HEADER_LIGHT);\r\n return shouldForceDarkHeader || (!shouldForceLightHeader && getMatchingHeaderTheme(getSectionBgColor(sectionEl)) === \"dark\");\r\n};\r\nconst manageHeaderTheme = (headerIntersectSectionIndex, isNewIntersection = true, isHeaderHeightScrolled = false) => {\r\n if (!sections ||\r\n !headerEl ||\r\n !bodyEl) {\r\n return;\r\n }\r\n bodyEl.classList.toggle(CLASSNAME_HEADER_HEIGHT_SCROLLED, isHeaderHeightScrolled);\r\n if (!isNewIntersection) {\r\n return;\r\n }\r\n const headerShouldBeDark = checkShouldHeaderBeDark(headerIntersectSectionIndex);\r\n bodyEl.classList.toggle(CLASSNAME_HEADER_DARK_THEME, headerShouldBeDark);\r\n bodyEl.classList.toggle(CLASSNAME_HEADER_LIGHT_THEME, !headerShouldBeDark);\r\n};\r\nconst getPageSectionElements = () => {\r\n const sectionEls = document.querySelectorAll(DEFAULT_PAGE_SECTIONS_SELECTOR);\r\n if (!sectionEls?.length) {\r\n return;\r\n }\r\n const sectionElsArray = [...sectionEls].filter((sectionEl) => window.getComputedStyle(sectionEl)[\"display\"] !== \"none\");\r\n sectionElsArray.forEach((sectionEl, index) => {\r\n const containerHints = getAnyNestedContentContainersHint(getClassListAsString(sectionEl.classList));\r\n const nestedSectionsCssSelector = extractCSSSelectorsFromCustomString(containerHints);\r\n let nestedSections;\r\n try {\r\n nestedSections =\r\n nestedSectionsCssSelector &&\r\n sectionEl.querySelectorAll(`:scope ${nestedSectionsCssSelector}`);\r\n }\r\n catch (error) {\r\n console.debug(\"Error while querying for nested sections!:\", error);\r\n }\r\n if (nestedSections?.length) {\r\n const displayedNestedSections = [...nestedSections].filter((sectionEl) => window.getComputedStyle(sectionEl)[\"display\"] !== \"none\");\r\n if (displayedNestedSections?.length) {\r\n sectionElsArray.splice(index, 1, ...displayedNestedSections);\r\n }\r\n }\r\n });\r\n return sectionElsArray;\r\n};\r\nconst setSections = () => {\r\n if (!bodyEl || !headerEl) {\r\n return;\r\n }\r\n const sectionEls = getPageSectionElements();\r\n if (!sectionEls?.length) {\r\n return;\r\n }\r\n sections = [...sectionEls].map((sectionEl) => ({\r\n node: sectionEl,\r\n }));\r\n};\r\nconst handleIntersection = () => {\r\n if (!sections?.length) {\r\n return;\r\n }\r\n for (let i = 0; i < sections.length; i++) {\r\n const section = sections[i];\r\n const { top: sectionTop, bottom: sectionBottom } = section.node.getBoundingClientRect();\r\n if (sectionTop <= headerElBottomY && sectionBottom > headerElBottomY) {\r\n const isHeaderHeightScrolled = window.scrollY > headerElBottomY;\r\n const isNewIntersection = intersectingSectionIndex !== i;\r\n manageHeaderTheme(i, isNewIntersection, isHeaderHeightScrolled);\r\n intersectingSectionIndex = i;\r\n return;\r\n }\r\n }\r\n intersectingSectionIndex = undefined;\r\n};\r\nconst handleResize = () => {\r\n if (!headerEl) {\r\n return;\r\n }\r\n const { bottom: headerBottom } = headerEl.getBoundingClientRect();\r\n headerElBottomY = headerBottom;\r\n setSections();\r\n handleIntersection();\r\n};\r\nexport const setupHeaderThemeToggling = () => {\r\n bodyEl = document.body;\r\n headerEl = bodyEl?.querySelector(\"header\") || undefined;\r\n handleResize();\r\n};\r\nconst throttledScrollHandler = throttle(handleIntersection, 100);\r\nconst throttledResizeHandler = throttle(handleResize, 100);\r\nif (typeof window !== \"undefined\") {\r\n document.addEventListener(\"DOMContentLoaded\", setupHeaderThemeToggling);\r\n window.addEventListener(\"resize\", throttledResizeHandler);\r\n window.addEventListener(\"scroll\", throttledScrollHandler);\r\n}\r\n"],"names":["root","factory","exports","module","define","amd","this","FUNC_ERROR_TEXT","NAN","symbolTag","reTrim","reIsBadHex","reIsBinary","reIsOctal","freeParseInt","parseInt","freeGlobal","g","Object","freeSelf","self","Function","objectToString","prototype","toString","nativeMax","Math","max","nativeMin","min","now","Date","isObject","value","type","toNumber","isObjectLike","call","isSymbol","other","valueOf","replace","isBinary","test","slice","func","wait","options","leading","trailing","TypeError","lastArgs","lastThis","maxWait","result","timerId","lastCallTime","lastInvokeTime","maxing","invokeFunc","time","args","thisArg","undefined","apply","shouldInvoke","timeSinceLastCall","timerExpired","trailingEdge","setTimeout","remainingWait","debounced","isInvoking","arguments","leadingEdge","cancel","clearTimeout","flush","debounce","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","__webpack_modules__","n","getter","__esModule","d","a","definition","key","o","defineProperty","enumerable","get","globalThis","e","window","obj","prop","hasOwnProperty","r","Symbol","toStringTag","CSS_CLASSNAME_PREFIX","CLASSNAME_CONTENT_CONTAINER_PREFIX","CLASSNAME_TOGGLE_HEADER_PREFIX","CLASSNAME_TOGGLE_HEADER_DARK","CLASSNAME_TOGGLE_HEADER_LIGHT","intersectingSectionIndex","sections","bodyEl","headerEl","headerElBottomY","getSectionBgColor","node","recursionLevelsCounter","bgColor","getComputedStyle","includes","getNodeBgColor","subNodes","childNodes","i","length","subNode","nodeType","checkShouldHeaderBeDark","headerIntersectSectionIndex","sectionEl","elementCssClassList","classList","shouldForceDarkHeader","contains","shouldForceLightHeader","sectionBgColor","rgbComponents","split","hslComponents","b","cmin","cmax","delta","h","s","l","round","abs","toFixed","RGBToHSL","lightnessRate","Number","getMatchingHeaderTheme","manageHeaderTheme","isNewIntersection","isHeaderHeightScrolled","toggle","headerShouldBeDark","handleIntersection","section","top","sectionTop","bottom","sectionBottom","getBoundingClientRect","scrollY","handleResize","headerBottom","sectionEls","document","querySelectorAll","sectionElsArray","filter","forEach","index","nestedSectionsCssSelector","string","cssSelector","regExp","replacement","extractCSSSelectorsFromCustomString","classListString","RegExp","matchAll","map","hint","join","getAnyNestedContentContainersHint","nestedSections","error","console","debug","displayedNestedSections","splice","getPageSectionElements","setSections","setupHeaderThemeToggling","body","querySelector","throttledScrollHandler","throttledResizeHandler","addEventListener"],"sourceRoot":""}