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ClD,GAA0B,mBAAfC,WAA2B,CACpC,IAAIC,EAAWF,KACfC,YAAW,WACTC,EAASxB,cACTC,EAAsBQ,EACxB,GAAG,EACL,MACEa,KAAKtB,cACLC,EAAsBQ,EAE1B,MAEEa,KAAKtB,aAET,CAGF,CA1FA,CA2FD,CAlGD,E","sources":["webpack://Kristiania.Web/./node_modules/focus-options-polyfill/index.js"],"sourcesContent":["// focus - focusOptions - preventScroll polyfill\n(function() {\n if (\n typeof window === \"undefined\" ||\n typeof document === \"undefined\" ||\n typeof HTMLElement === \"undefined\"\n ) {\n return;\n }\n\n var supportsPreventScrollOption = false;\n try {\n var focusElem = document.createElement(\"div\");\n focusElem.addEventListener(\n \"focus\",\n function(event) {\n event.preventDefault();\n event.stopPropagation();\n },\n true\n );\n focusElem.focus(\n Object.defineProperty({}, \"preventScroll\", {\n get: function() {\n // Edge v18 gives a false positive for supporting inputs\n if (\n navigator &&\n typeof navigator.userAgent !== 'undefined' &&\n navigator.userAgent &&\n navigator.userAgent.match(/Edge\\/1[7-8]/)) {\n return supportsPreventScrollOption = false\n }\n\n supportsPreventScrollOption = true;\n }\n })\n );\n } catch (e) {}\n\n if (\n HTMLElement.prototype.nativeFocus === undefined &&\n !supportsPreventScrollOption\n ) {\n HTMLElement.prototype.nativeFocus = HTMLElement.prototype.focus;\n\n var calcScrollableElements = function(element) {\n var parent = element.parentNode;\n var scrollableElements = [];\n var rootScrollingElement =\n document.scrollingElement || document.documentElement;\n\n while (parent && parent !== rootScrollingElement) {\n if (\n parent.offsetHeight < parent.scrollHeight ||\n parent.offsetWidth < parent.scrollWidth\n ) {\n scrollableElements.push([\n parent,\n parent.scrollTop,\n parent.scrollLeft\n ]);\n }\n parent = parent.parentNode;\n }\n parent = rootScrollingElement;\n scrollableElements.push([parent, parent.scrollTop, parent.scrollLeft]);\n\n return scrollableElements;\n };\n\n var restoreScrollPosition = function(scrollableElements) {\n for (var i = 0; i < scrollableElements.length; i++) {\n scrollableElements[i][0].scrollTop = scrollableElements[i][1];\n scrollableElements[i][0].scrollLeft = scrollableElements[i][2];\n }\n scrollableElements = [];\n };\n\n var patchedFocus = function(args) {\n if (args && args.preventScroll) {\n var evScrollableElements = calcScrollableElements(this);\n if (typeof setTimeout === 'function') {\n var thisElem = this;\n setTimeout(function () {\n thisElem.nativeFocus();\n restoreScrollPosition(evScrollableElements);\n }, 0);\n } else {\n this.nativeFocus();\n restoreScrollPosition(evScrollableElements);\n }\n }\n else {\n this.nativeFocus();\n }\n };\n\n HTMLElement.prototype.focus = patchedFocus;\n }\n})();\n"],"names":["window","document","HTMLElement","supportsPreventScrollOption","focusElem","createElement","addEventListener","event","preventDefault","stopPropagation","focus","Object","defineProperty","get","navigator","userAgent","match","e","undefined","prototype","nativeFocus","restoreScrollPosition","scrollableElements","i","length","scrollTop","scrollLeft","args","preventScroll","evScrollableElements","element","parent","parentNode","rootScrollingElement","scrollingElement","documentElement","offsetHeight","scrollHeight","offsetWidth","scrollWidth","push","calcScrollableElements","this","setTimeout","thisElem"],"sourceRoot":""}