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IACTC,UAAUC,UAAUC,MAAK,6BAC1B,mBAAmBP,KAAKK,UAAUC,aAAerH,OAAOuH,SAQ9CC,EAAY,WAAWT,KAAKK,UAAUC,WAEtCI,EAAgB,mBAAmBV,KAAKK,UAAUC,WAE/D,IAAIK,EAEG,MAAMC,EAAe,UACN,IAATD,IAIXA,EAAOE,KAHEF,GAOLE,EAAiB,IAIY,GAHjC/H,SACGgI,cAAc,UACdC,UAAU,cACVxG,QAAQ,mBAEAyG,EAAa,CAACC,EAAaC,EAAsB,KACxDpI,SAASyC,cAAc,eAAe0F,OACjCE,QAAQC,UAEV,IAAID,SAAQ,CAACC,EAASC,KAC3B,MAAM/H,EAASR,SAASgI,cAAc,UACtCxH,EAAOyB,IAAMkG,EACb3H,EAAOgI,OAAQ,EACXJ,IACF5H,EAAO4H,YAAcA,GAEvB5H,EAAOiI,OAASH,EAChB9H,EAAOkI,QAAUH,EACjBvI,SAAS2I,KAAKC,YAAYpI,MAIjBqI,EAAWV,GAClBnI,SAASyC,cAAc,cAAc0F,OAChCE,QAAQC,UAEV,IAAID,SAAQ,CAACC,EAASC,KAC3B,IAAIO,EAAO9I,SAAS+I,qBAAqB,QAAQ,GAC7CC,EAAOhJ,SAASgI,cAAc,QAClCgB,EAAKC,IAAM,aACXD,EAAKtC,KAAO,WACZsC,EAAKE,KAAOf,EACZa,EAAKG,MAAQ,MACbH,EAAKP,OAASH,EACdU,EAAKN,QAAUH,EACfO,EAAKF,YAAYI","sources":["scripts/src/livezilla/index.ts","scripts/src/element-ready/index.ts","node_modules/lodash.throttle/index.js","scripts/src/react/utils/browserUtils.ts"],"sourcesContent":["import $ from \"jquery\";\r\nimport { elementReady } from \"../../src/element-ready\";\r\nimport throttle from \"lodash.throttle\";\r\nimport { loadScript } from \"../react/utils/browserUtils\";\r\n\r\nexport const basketActive = (active: boolean) => {\r\n if (active) {\r\n $(\"#livezilla_wm,#lz_chat_overlay_main\").addClass(\"basket-open\");\r\n } else {\r\n $(\"#livezilla_wm,#lz_chat_overlay_main\").removeClass(\"basket-open\");\r\n }\r\n};\r\n\r\nexport const NavigationActive = (active: boolean) => {\r\n if (!!document.getElementById(\"livezilla_wm\")) {\r\n if (active) {\r\n $(\"#livezilla_wm\").addClass(\"navigation-open\");\r\n } else {\r\n $(\"#livezilla_wm\").removeClass(\"navigation-open\");\r\n }\r\n }\r\n};\r\n\r\nconst attachHandlers = () => {\r\n // changes the styles of the live chat window if the basket is open\r\n // if live chat is enabled\r\n\r\n\r\n window.addEventListener(\"load\", () => {\r\n elementReady(\r\n \"#lz_overlay_chat, .lz_chat_overlay_icon, #livezilla_wm\",\r\n () => {\r\n // apply fade in animation only if the live chat wasnt opened on previous page\r\n\r\n const script = document.getElementById('livezilla-script') as HTMLScriptElement\r\n const liveChatWM = document.getElementById('livezilla_wm')\r\n const overlayChat = document.getElementById('lz_overlay_chat');\r\n const chatWindow = document.getElementById('lz_chat_overlay_main');\r\n const slideOutWindow = document.getElementById('lz_chat_content')\r\n\r\n if (script.dataset.variation != \"\") {\r\n if (!!liveChatWM) { liveChatWM.classList.add(script.dataset.variation || \"\") }\r\n if (!!chatWindow) { chatWindow.classList.add(script.dataset.variation || \"\"); }\r\n if (!!slideOutWindow) { slideOutWindow.classList.add(script.dataset.variation || \"\"); }\r\n if (!!overlayChat) { overlayChat.setAttribute('data-color',script.dataset.variation || \"\"); }\r\n }\r\n\r\n\r\n\r\n\r\n $(\"#lz_overlay_chat, .lz_overlay_wm_button\").addClass(\r\n \"animate__animated\"\r\n );\r\n\r\n scrollEvent();\r\n\r\n //RTE link from contact us page, simulates a click in order to trigger the event tracking.\r\n $(\".js-livezilla-start\").on(\"click\", e => {\r\n e.preventDefault();\r\n $(\"#livezilla_wm\").trigger(\"click\");\r\n });\r\n\r\n // ensures livezilla icon gets its default z-index value back and appears on top.\r\n // this is set lower when civic loads on page otherwise it overlaps the accept all button.\r\n if ($(\".js-cookie-control\").length == 0) {\r\n $(\"#lz_overlay_wm\").addClass(\"high-stack\");\r\n }\r\n if (\r\n ($(\"#lz_overlay_chat\")\r\n .attr(\"style\")\r\n ?.indexOf(\"block\") as number) > 0\r\n ) {\r\n $(\"#lz_overlay_chat\").addClass(\"fadeIn active\");\r\n $(\"#livezilla_wm\").addClass(\"fadeInUp active scroll\");\r\n } else {\r\n $(\"#livezilla_wm\").addClass(\"fadeInUp\");\r\n }\r\n }\r\n );\r\n });\r\n\r\n const scrollEvent = () => {\r\n if (\r\n $(window).scrollTop()! + $(window).height()! <\r\n $(document).height()! - 100\r\n ) {\r\n $(\"#livezilla_wm\").addClass(\"scroll\");\r\n } else {\r\n $(\"#livezilla_wm\").removeClass(\"scroll\");\r\n }\r\n };\r\n const throttledScroll = throttle(scrollEvent, 100);\r\n window.addEventListener(\r\n \"scroll\",\r\n e => {\r\n throttledScroll;\r\n },\r\n { passive: true }\r\n );\r\n};\r\n\r\nexport const liveZilla = () => {\r\n if (localStorage.getItem(\"loadchat\")) {\r\n // don't load live chat on first page load\r\n const script = document.getElementById(\"livezilla-script\") as\r\n | HTMLScriptElement\r\n | undefined;\r\n\r\n if (!script) {\r\n return;\r\n }\r\n\r\n if (script.src || !script.dataset.src) {\r\n attachHandlers();\r\n return;\r\n }\r\n\r\n loadScript(script.dataset.src, \"anonymous\").then(attachHandlers);\r\n } else {\r\n localStorage.setItem(\"loadchat\", \"true\");\r\n }\r\n};\r\n","/**\r\n * Indefintely expects dom selector to exist and will repeat function until node is loaded\r\n * @param {string} selector - dom selector for pending element\r\n * @param {void} callback - the event for which should run after\r\n */\r\nexport const elementReady = (selector: string, callback: () => void) => {\r\n if (document.querySelector(selector) != null) {\r\n callback();\r\n } else {\r\n setTimeout(() => {\r\n elementReady(selector, callback);\r\n }, 30);\r\n }\r\n};\r\n","/**\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","export const isIos =\r\n !!navigator.userAgent.match(/Version\\/[\\d\\.]+.*Safari/) ||\r\n (/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream);\r\n\r\nexport const isTouchDevice = () => {\r\n return (('ontouchstart' in window) ||\r\n (navigator.maxTouchPoints > 0) ||\r\n (navigator.msMaxTouchPoints > 0));\r\n}\r\n\r\nexport const isAndroid = /Android/i.test(navigator.userAgent);\r\n\r\nexport const isIosNoSafari = /iPad|iPhone|iPod/.test(navigator.userAgent);\r\n\r\nlet webp: boolean | undefined;\r\n\r\nexport const supportsWebP = () => {\r\n if (typeof webp !== \"undefined\") {\r\n return webp;\r\n }\r\n\r\n webp = getWebPSupport();\r\n return webp;\r\n};\r\n\r\nconst getWebPSupport = () =>\r\n document\r\n .createElement(\"canvas\")\r\n .toDataURL(\"image/webp\")\r\n .indexOf(\"data:image/webp\") == 0;\r\n\r\nexport const loadScript = (url: string, crossOrigin: string = \"\") => {\r\n if (document.querySelector(`script[src='${url}']`)) {\r\n return Promise.resolve();\r\n }\r\n return new Promise((resolve, reject) => {\r\n const script = document.createElement(\"script\");\r\n script.src = url;\r\n script.async = true;\r\n if (crossOrigin) {\r\n script.crossOrigin = crossOrigin;\r\n }\r\n script.onload = resolve;\r\n script.onerror = reject;\r\n document.body.appendChild(script);\r\n });\r\n};\r\n\r\nexport const loadCss = (url: string) => {\r\n if (document.querySelector(`link[href='${url}']`)) {\r\n return Promise.resolve();\r\n }\r\n return new Promise((resolve, reject) => {\r\n var head = document.getElementsByTagName(\"head\")[0];\r\n var link = document.createElement(\"link\");\r\n link.rel = \"stylesheet\";\r\n link.type = \"text/css\";\r\n link.href = url;\r\n link.media = \"all\";\r\n link.onload = resolve;\r\n link.onerror = reject;\r\n head.appendChild(link);\r\n });\r\n};\r\n"],"names":["$4sYka","parcelRequire","$b0fee641982c488f$export$c88251ab64fe21ab","active","$parcel$interopDefault","addClass","removeClass","$b0fee641982c488f$export$bd9c46add690c26e","document","getElementById","$b0fee641982c488f$var$attachHandlers","window","addEventListener","$ckKaX","elementReady","ref","script","liveChatWM","overlayChat","chatWindow","slideOutWindow","dataset","variation","classList","add","setAttribute","scrollEvent","on","e","preventDefault","trigger","length","attr","indexOf","scrollTop","height","$leeC5","passive","$b0fee641982c488f$export$61a18442309db2cf","localStorage","getItem","src","$eOe28","loadScript","then","setItem","$2158775948cf311d$export$5a68694636710d38","selector","callback","querySelector","setTimeout","$f7463db15f187b9d$var$FUNC_ERROR_TEXT","$f7463db15f187b9d$var$reTrim","$f7463db15f187b9d$var$reIsBadHex","$f7463db15f187b9d$var$reIsBinary","$f7463db15f187b9d$var$reIsOctal","$f7463db15f187b9d$var$freeParseInt","parseInt","$f7463db15f187b9d$var$freeGlobal","$parcel$global","Object","$f7463db15f187b9d$var$freeSelf","self","$f7463db15f187b9d$var$root","Function","$f7463db15f187b9d$var$objectToString","prototype","toString","$f7463db15f187b9d$var$nativeMax","Math","max","$f7463db15f187b9d$var$nativeMin","min","$f7463db15f187b9d$var$now","Date","now","$f7463db15f187b9d$var$debounce","func","wait","options","lastArgs","lastThis","maxWait","result1","timerId","lastCallTime","lastInvokeTime","leading","maxing","trailing","TypeError","invokeFunc","time","args","thisArg","undefined","apply","leadingEdge","timerExpired","shouldInvoke","timeSinceLastCall","trailingEdge","result","remainingWait","debounced","isInvoking","arguments","this","$f7463db15f187b9d$var$toNumber","$f7463db15f187b9d$var$isObject","cancel","clearTimeout","flush","value","type","$f7463db15f187b9d$var$isObjectLike","call","$f7463db15f187b9d$var$isSymbol","other","valueOf","replace","isBinary","test","slice","module","exports","$eeb1221ea67d69d7$export$41a665f744414057","navigator","userAgent","match","MSStream","$eeb1221ea67d69d7$export$a11b0059900ceec8","$eeb1221ea67d69d7$export$b2fcdee8e6d02d24","$eeb1221ea67d69d7$var$webp","$eeb1221ea67d69d7$export$f11e265520c94ffe","$eeb1221ea67d69d7$var$getWebPSupport","createElement","toDataURL","$eeb1221ea67d69d7$export$2cb99e4be0dc4646","url","crossOrigin","Promise","resolve","reject","async","onload","onerror","body","appendChild","$eeb1221ea67d69d7$export$82219ea58a717c3f","head","getElementsByTagName","link","rel","href","media"],"version":3,"file":"livezilla.b172091b.js.map"}