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,2BAExC,GAAI0B,GAA0BE,GAA8BD,GAA+B3B,EAA4B,CACrH,MAAM6B,EAAahD,KAAKuC,aAClBU,EAAiCvD,OAAOwD,iBAAiB/B,GAA4BgC,iBAAiB,kBAE5G,IAAIC,EAAmBJ,EAD+C,EAA3CK,SAASJ,GAEpC,GAAIjD,KAAKuB,wBAAyB,CAChC,MAAMG,EAAe1B,KAAK0B,aAC1B,GAAIA,EAAc,CAChB,MAAM4B,EAAc5B,EAAaa,aAC3BgB,EAA8B7D,OAAOwD,iBAAiBxB,GAAcyB,iBAAiB,cAE3FC,EAAmBA,EAAmBE,EADZD,SAASE,EAErC,CACF,CAEA,MAAMC,EAAWH,SAAS3D,OAAOwD,iBAAiBL,GAAwBM,iBAAiB,cACrFM,EAAgBJ,SAAS3D,OAAOwD,iBAAiBJ,GAA6BK,iBAAiB,cAG/FO,EAAiBN,EAFFL,EAA2BY,YAG1CC,EAAkBC,KAAKC,IAAKN,EAAWE,EAAiBD,GAC9DZ,EAAuBH,MAAMc,SAAW,GAAGI,MAC3Cf,EAAuBkB,UAAUC,IAAI,kBACvC,CACF,EAIFC,eAAeC,OAAO,yBAA0B5E,qBAAsB,CAAC6E,QAAS,O","sources":["webpack://customtheme/./node_modules/@alexspirgel/children-loaded/src/index.js","webpack://customtheme/webpack/bootstrap","webpack://customtheme/../../modules/custom/esd_components/esd_custom_components/components/hero_landing/scripts/src/global.js"],"sourcesContent":["module.exports = (function () {\n\n\t// Initialize a weak map to hold promises.\n\tconst childrenLoadedPromises = new WeakMap();\n\n\t/**\n\t * Checks to see if children elements are loaded.\n\t * @param {object} element - Element to look for children within.\n\t * @return {boolean} Whether the children elements are loaded or not.\n\t */\n\n\tconst childrenLoadedSynchronous = (element) => {\n\n\t\t// Document ready states reference: https://developer.mozilla.org/en-US/docs/Web/API/Document/readyState\n\t\tif (document.readyState === 'interactive' || document.readyState === 'complete') {\n\t\t\t// Children elements are assumed to be loaded.\n\t\t\treturn true;\n\t\t}\n\n\t\t// While the element exists.\n\t\twhile (element) {\n\t\t\t// If the next sibling element exists.\n\t\t\tif (element.nextSibling) {\n\t\t\t\t// The original passed element and its children have been loaded.\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t// Set the element to the parent element.\n\t\t\telement = element.parentNode;\n\t\t}\n\n\t\t// If code execution gets here, it's assumed children elements are not loaded.\n\t\treturn false;\n\n\t};\n\n\t/**\n\t * An asynchronous wrapper for the childrenLoadedSynchronous function.\n\t * @param {object} element - Element to look for children within.\n\t * @param {boolean} [forceNewPromise=false] - Option to invalidate existing promises.\n\t * @return {*} True if children are loaded, otherwise a promise.\n\t */\n\n\tconst childrenLoaded = (element, forceNewPromise = false) => {\n\n\t\t// If children are loaded immediately.\n\t\tif (childrenLoadedSynchronous(element)) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// If an existing promise for the passed element does not exist yet or if a new promise is being forced.\n\t\telse if (!childrenLoadedPromises.get(element) || forceNewPromise) {\n\t\t\t// Create a new promise.\n\t\t\tconst childrenLoadedPromise = new Promise((resolve) => {\n\t\t\t\t// Create a new mutation observer.\n\t\t\t\tconst observer = new MutationObserver(() => {\n\t\t\t\t\t// When children are loaded.\n\t\t\t\t\tif (childrenLoadedSynchronous(element)) {\n\t\t\t\t\t\t// Disconnect the mutation observer.\n\t\t\t\t\t\tobserver.disconnect();\n\t\t\t\t\t\t// Resolve the promise.\n\t\t\t\t\t\tresolve(true);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t// Watch for child element updates.\n\t\t\t\tobserver.observe(element, {\n\t\t\t\t\tchildList: true\n\t\t\t\t});\n\t\t\t});\n\t\t\t// Set the promise weak map entry for the passed element.\n\t\t\tchildrenLoadedPromises.set(element, childrenLoadedPromise);\n\t\t}\n\n\t\t// Return the promise for the passed element.\n\t\t// Multiple asynchronous calls of childrenLoaded for the same element should return the same promise.\n\t\treturn childrenLoadedPromises.get(element);\n\n\t};\n\n\t// Attach the synchronous function to the export for optional use.\n\tchildrenLoaded.synchronous = childrenLoadedSynchronous;\n\t// Add shorthand alias for synchronous.\n\tchildrenLoaded.sync = childrenLoaded.synchronous;\n\t// Return the asynchronous function as the export.\n\treturn childrenLoaded;\n\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","const childrenLoaded = require('@alexspirgel/children-loaded');\n\nclass ComponentHeroLanding extends HTMLDivElement {\n\n static get mediaQuery() {\n\t\treturn {\n\t\t\tmedium: window.matchMedia('(max-width: 48rem)'), // 768px\n\t\t\tlarge: window.matchMedia('(max-width: 80rem)'), // 1280px\n\t\t};\n\t}\n\n\tconstructor() {\n\t\tsuper();\n\t}\n\n\tasync connectedCallback() {\n\t\tawait childrenLoaded(this);\n\t\tthis.initialize();\n\t}\n\n\tinitialize() {\n\n\t\tif (this.initialized) {\n\t\t\treturn;\n\t\t}\n\n this.mediaQueryLargeListener(this.constructor.mediaQuery.large);\n this.constructor.mediaQuery.large.addListener(this.mediaQueryLargeListener);\n this.mediaQueryMediumListener(this.constructor.mediaQuery.medium);\n this.constructor.mediaQuery.medium.addListener(this.mediaQueryMediumListener);\n\n\t\tif (this.videoElement && this.videoPlayPauseElement) {\n\t\t\tthis.videoPlayPauseElement.addEventListener('click', this.toggleVideoPlayback);\n\t\t}\n \n this.updateContentInnerHeightCSSVariable();\n this.updateAccentTextSize();\n this.windowResizeObserver = new ResizeObserver(() => {\n this.updateContentInnerHeightCSSVariable();\n this.updateAccentTextSize();\n });\n this.windowResizeObserver.observe(document.body);\n\n\t\tthis.initialized = true;\n\n\t}\n\n mediaQueryLargeListener = (mediaQuery) => {\n if (this.matchesMediaQueryLarge !== mediaQuery.matches) {\n this.matchesMediaQueryLarge = mediaQuery.matches;\n this.mediaQueryLargeChange();\n }\n\t}\n\n mediaQueryLargeChange() {\n const contentElement = this.contentElement;\n if (this.matchesMediaQueryLarge) {\n const belowBackgroundAreaElement = this.belowBackgroundAreaElement;\n if (contentElement && belowBackgroundAreaElement) {\n belowBackgroundAreaElement.prepend(contentElement);\n }\n }\n else {\n const backgroundElement = this.backgroundElement;\n if (contentElement && backgroundElement) {\n backgroundElement.append(contentElement);\n }\n }\n }\n\n mediaQueryMediumListener = (mediaQuery) => {\n if (this.matchesMediaQueryMedium !== mediaQuery.matches) {\n this.matchesMediaQueryMedium = mediaQuery.matches;\n this.mediaQueryMediumChange();\n }\n\t}\n\n mediaQueryMediumChange() {\n const accentTextElement = this.accentTextElement;\n if (this.matchesMediaQueryMedium) {\n const belowBackgroundAreaElement = this.belowBackgroundAreaElement;\n const introElement = this.introElement;\n if (accentTextElement && belowBackgroundAreaElement && introElement) {\n belowBackgroundAreaElement.insertBefore(accentTextElement, introElement);\n }\n }\n else {\n if (accentTextElement) {\n this.append(accentTextElement);\n }\n }\n }\n\n get backgroundElement() {\n return this.querySelector('.component-hero-landing__background');\n }\n\n get belowBackgroundAreaElement() {\n return this.querySelector('.component-hero-landing__below-background-area');\n }\n\n get contentElement() {\n return this.querySelector('.component-hero-landing__content');\n }\n\n get introElement() {\n return this.querySelector('.component-hero-landing__intro');\n }\n\n\tget videoElement() {\n\t\treturn this.querySelector('.component-hero-landing__video');\n\t}\n\n\tget videoPlayPauseElement() {\n\t\treturn this.querySelector('.component-hero-landing__play-pause');\n\t}\n\n\tget isVideoPlaying() {\n return (this.videoElement\n && this.videoElement.currentTime > 0\n && this.videoElement.paused == false\n && this.videoElement.ended == false);\n }\n\n\tpauseVideo() {\n if (this.videoElement) {\n this.videoElement.pause();\n this.videoPlayPauseElement.setAttribute('data-icon', 'play');\n this.videoPlayPauseElement.setAttribute('aria-label', 'play video');\n }\n }\n\n playVideo() {\n if (this.videoElement) {\n this.videoElement.play();\n this.videoPlayPauseElement.setAttribute('data-icon', 'pause');\n this.videoPlayPauseElement.setAttribute('aria-label', 'pause video');\n }\n }\n\n\ttoggleVideoPlayback = () => {\n if (this.videoElement) {\n if (this.isVideoPlaying) {\n this.pauseVideo();\n }\n else {\n this.playVideo();\n }\n }\n }\n\n get contentInnerElement() {\n return this.querySelector('.component-hero-landing__content-inner');\n }\n\n updateContentInnerHeightCSSVariable() {\n\t\tif (this.contentInnerElement && typeof this.contentInnerElement.offsetHeight === 'number') {\n\t\t\tconst height = this.contentInnerElement.offsetHeight.toString() + 'px';\n this.style.setProperty('--content-inner-height', height);\n\t\t}\n else {\n this.style.removeProperty('--content-inner-height');\n }\n }\n\n get accentTextElement() {\n return this.querySelector('.component-hero-landing__accent-text');\n }\n\n get accentTextInnerElement() {\n return this.querySelector('.component-hero-landing__accent-text-inner:not(.sizer)');\n }\n\n get accentTextInnerSizerElement() {\n return this.querySelector('.component-hero-landing__accent-text-inner.sizer');\n }\n\n updateAccentTextSize() {\n const accentTextInnerElement = this.accentTextInnerElement;\n if (!accentTextInnerElement) {\n return;\n }\n const accentTextInnerTextElement = this.accentTextInnerElement.querySelector('.text');\n const accentTextInnerSizerElement = this.accentTextInnerSizerElement;\n const belowBackgroundAreaElement = this.belowBackgroundAreaElement;\n\n if (accentTextInnerElement && accentTextInnerTextElement && accentTextInnerSizerElement && belowBackgroundAreaElement) {\n const heroHeight = this.offsetHeight;\n const heroPaddingBottomPropertyValue = window.getComputedStyle(belowBackgroundAreaElement).getPropertyValue('padding-bottom');\n const heroPaddingHeight = (parseInt(heroPaddingBottomPropertyValue) * 2);\n let usableHeroHeight = heroHeight - heroPaddingHeight;\n if (this.matchesMediaQueryMedium) {\n const introElement = this.introElement;\n if (introElement) {\n const introHeight = introElement.offsetHeight;\n const introMarginTopPropertyValue = window.getComputedStyle(introElement).getPropertyValue('margin-top');\n const introMarginHeight = parseInt(introMarginTopPropertyValue);\n usableHeroHeight = usableHeroHeight - introHeight - introMarginHeight;\n }\n }\n\n const fontSize = parseInt(window.getComputedStyle(accentTextInnerElement).getPropertyValue('font-size'));\n const sizerFontSize = parseInt(window.getComputedStyle(accentTextInnerSizerElement).getPropertyValue('font-size'));\n const accentHeight = accentTextInnerTextElement.offsetWidth; // Use offsetWidth because of the rotation.\n \n const fontDifference = usableHeroHeight / accentHeight\n const updatedFontSize = Math.min((fontSize * fontDifference), sizerFontSize);\n accentTextInnerElement.style.fontSize = `${updatedFontSize}px`;\n accentTextInnerElement.classList.add('font-resized-js');\n }\n }\n\n}\n\ncustomElements.define('component-hero-landing', ComponentHeroLanding, {extends: 'div'});"],"names":["module","exports","childrenLoadedPromises","WeakMap","childrenLoadedSynchronous","element","document","readyState","nextSibling","parentNode","childrenLoaded","forceNewPromise","get","childrenLoadedPromise","Promise","resolve","observer","MutationObserver","disconnect","observe","childList","set","sync","synchronous","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","ComponentHeroLanding","HTMLDivElement","mediaQuery","medium","window","matchMedia","large","constructor","super","connectedCallback","this","initialize","initialized","mediaQueryLargeListener","addListener","mediaQueryMediumListener","videoElement","videoPlayPauseElement","addEventListener","toggleVideoPlayback","updateContentInnerHeightCSSVariable","updateAccentTextSize","windowResizeObserver","ResizeObserver","body","matchesMediaQueryLarge","matches","mediaQueryLargeChange","contentElement","belowBackgroundAreaElement","prepend","backgroundElement","append","matchesMediaQueryMedium","mediaQueryMediumChange","accentTextElement","introElement","insertBefore","querySelector","isVideoPlaying","currentTime","paused","ended","pauseVideo","pause","setAttribute","playVideo","play","contentInnerElement","offsetHeight","height","toString","style","setProperty","removeProperty","accentTextInnerElement","accentTextInnerSizerElement","accentTextInnerTextElement","heroHeight","heroPaddingBottomPropertyValue","getComputedStyle","getPropertyValue","usableHeroHeight","parseInt","introHeight","introMarginTopPropertyValue","fontSize","sizerFontSize","fontDifference","offsetWidth","updatedFontSize","Math","min","classList","add","customElements","define","extends"],"sourceRoot":""}