{"version":3,"sources":["webpack:///./node_modules/digital-guidelines-core/dist/esm/variables-6eb69894.js","webpack:///./node_modules/digital-guidelines-core/dist/esm/som-mobile-subheader.entry.js","webpack:///./node_modules/digital-guidelines-core/dist/esm/functions-e19590df.js"],"names":["breakpoints","xs","sm","md","lg","xl","xxl","KEY_CODES","TAB","ENTER","ESC","SPACE","ARROW_LEFT","ARROW_UP","ARROW_RIGHT","ARROW_DOWN","somMobileSubheaderCss","RESIZE_DEBOUNCE_TIME","preventDefault","e","SomMobileSubheader","hostRef","this","subheaderTitle","breakpoint","animation","opened","mobileMode","menuId","focusableEls","closeMobileMenu","KEY_TAB","KEY_ESC","handleBackwardTab","document","activeElement","firstFocusableEl","includes","el","contains","lastFocusableEl","handleForwardTab","keyCode","length","shiftKey","Promise","resolve","registerTransitionListeners","enableScrollOnBody","clearTimeout","timeout","setTimeout","checkMobileMode","bind","window","innerWidth","enable","body","style","overflow","Array","prototype","slice","call","querySelectorAll","closeButton","console","log","callback","elem","querySelector","transitionEvent","onTransitionCompletedCb","onTransitionCompleted","removeEventListener","afterToggle","addEventListener","elemWithAnimation","menuContent","refreshFocusableElements","toggleOverlay","toggleButtonClass","class","onClick","handleToggle","ref","color","size","overlayClass","overlayContentAnimation","nav","createHeader","overlayNav","mobileMenuShown","join","role","id","menuContainer","tabindex","focusElement","element","delay","focus","getFocusableElementList","find","items","fn","i","found","lastId","generateId","prefix","whichTransitionEvent","createElement","transitions","transition","OTransition","MozTransition","WebkitTransition","transitionKeys","Object","keys","t","undefined","whichAnimationEvent","animations","OAnimation","MozAnimation","WebkitAnimation","animationKeys","waitForCSSTransitionToFinish","evt","target","runAfterNextFrameRender","requestAnimationFrame","isDescendant","parent","child","node","parentNode"],"mappings":"kHAAA,0EAAMA,EAAc,CAClBC,GAAI,EACJC,GAAI,IACJC,GAAI,IACJC,GAAI,IACJC,GAAI,KACJC,IAAK,MAEDC,EAAY,CAChBC,IAAK,EACLC,MAAO,GACPC,IAAK,GACLC,MAAO,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IAEzBA,EAAIC,SAAW/D,IACjBA,EAAKK,oBAAoBH,EAAiBC,GAC1CJ,MAGJI,EAA0BC,EAAsBpB,KAAK/B,MACjDiD,GACFF,EAAKO,iBAAiBL,EAAiBC,GAG3C,SAAS6D,EAAwBjE,GAC/BkE,sBAAsB,KACpBnF,WAAW,KACTiB,KACC,KAIP,SAASmE,EAAaC,EAAQC,GAC5B,IAAIC,EAAOD,EAAME,WACjB,MAAgB,OAATD,EAAe,CACpB,GAAIA,IAASF,EACX,OAAO,EAETE,EAAOA,EAAKC,WAEd,OAAO","file":"js/chunk-4cdd11f3.2a62d962.js","sourcesContent":["const breakpoints = {\n xs: 0,\n sm: 576,\n md: 768,\n lg: 992,\n xl: 1200,\n xxl: 1440\n};\nconst KEY_CODES = {\n TAB: 9,\n ENTER: 13,\n ESC: 27,\n SPACE: 32,\n ARROW_LEFT: 37,\n ARROW_UP: 38,\n ARROW_RIGHT: 39,\n ARROW_DOWN: 40,\n};\n\nexport { KEY_CODES as K, breakpoints as b };\n","import { r as registerInstance, h, g as getElement } from './index-4ec8feae.js';\nimport { b as breakpoints } from './variables-6eb69894.js';\nimport { g as generateId, w as whichTransitionEvent, f as focusElement } from './functions-e19590df.js';\n\nconst somMobileSubheaderCss = \".som-header-d-none{display:none !important}.som-header-d-inline{display:inline !important}.som-header-d-inline-block{display:inline-block !important}.som-header-d-block{display:block !important}.som-header-d-flex{display:flex !important}@media (min-width: 576px){.som-header-d-sm-none{display:none !important}.som-header-d-sm-inline{display:inline !important}.som-header-d-sm-inline-block{display:inline-block !important}.som-header-d-sm-block{display:block !important}.som-header-d-sm-flex{display:flex !important}}@media (min-width: 768px){.som-header-d-md-none{display:none !important}.som-header-d-md-inline{display:inline !important}.som-header-d-md-inline-block{display:inline-block !important}.som-header-d-md-block{display:block !important}.som-header-d-md-flex{display:flex !important}}@media (min-width: 992px){.som-header-d-lg-none{display:none !important}.som-header-d-lg-inline{display:inline !important}.som-header-d-lg-inline-block{display:inline-block !important}.som-header-d-lg-block{display:block !important}.som-header-d-lg-flex{display:flex !important}}@media (min-width: 1200px){.som-header-d-xl-none{display:none !important}.som-header-d-xl-inline{display:inline !important}.som-header-d-xl-inline-block{display:inline-block !important}.som-header-d-xl-block{display:block !important}.som-header-d-xl-flex{display:flex !important}}@media (min-width: 1440px){.som-header-d-xxl-none{display:none !important}.som-header-d-xxl-inline{display:inline !important}.som-header-d-xxl-inline-block{display:inline-block !important}.som-header-d-xxl-block{display:block !important}.som-header-d-xxl-flex{display:flex !important}}.som-mobile-subheader{}.som-mobile-subheader .invisible{visibility:hidden}.som-mobile-subheader .truncate{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.som-mobile-subheader__title-bar{border:0;margin:0;width:100%;border-bottom:1px solid #d0d0d0;background:#ffffff;position:relative;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;padding:1rem;color:#142d3e}.som-mobile-subheader__title-bar__toggle-button{font-size:0;border-radius:1rem;margin-right:0.25rem;margin-left:auto !important;position:relative;padding:0.25rem 0.25rem;line-height:1;background:transparent;border:none;display:block !important;transform:rotate(0deg);-webkit-transform:rotate(0deg);-moz-transform:rotate(0deg);-o-transform:rotate(0deg);transition:transform, 250ms}.som-mobile-subheader__title-bar__toggle-button.opened{transform:rotate(180deg);-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-o-transform:rotate(180deg)}.som-mobile-subheader__overlay{position:fixed;width:100%;height:100%;z-index:3030;left:0;background:rgba(5, 17, 25, 0.815);top:5rem}@media (max-width: 1199.98px){.som-mobile-subheader__overlay{top:3.5rem}}.som-mobile-subheader__overlay.invisible{left:15000rem}.som-mobile-subheader__overlay-content{position:relative;background-color:#ffffff;left:0;overflow-y:auto;-webkit-overflow-scrolling:touch;width:100%;opacity:0;max-height:calc(100vh - 112px);transition:opacity, 250ms}.som-mobile-subheader__overlay-content.opened{opacity:1}.som-mobile-subheader__overlay-content__nav-container{position:relative;height:100%;width:100%;overflow-y:auto;display:flex !important;flex-direction:column !important}\";\n\nconst RESIZE_DEBOUNCE_TIME = 100; // milliseconds\nfunction preventDefault(e) {\n e.preventDefault();\n}\nlet SomMobileSubheader = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n /**\n * Title of mobile subheader\n */\n this.subheaderTitle = '';\n /**\n * The breakpoint where the mobile navigation should take effect.\n * Valid values are `\"sm\"`, `\"md\"`, `\"lg\"`, `\"xl\"`\n * Defaults to `\"lg\"`.\n */\n this.breakpoint = 'lg';\n this.animation = '';\n this.opened = false;\n this.mobileMode = false;\n this.menuId = generateId('som-mobile-subheader');\n this.focusableEls = [];\n }\n updateMode() {\n if (!this.mobileMode) {\n this.closeMobileMenu();\n }\n }\n _handleKeyDown(e) {\n // if the menu isn't open, return and don't process keystrokes\n if (!this.opened)\n return;\n const KEY_TAB = 9;\n const KEY_ESC = 27;\n const handleBackwardTab = () => {\n // When a click occurs on the panel window, this.el might be the activeElement.\n // Make sure to handle the backward tab not to move to the background body content.\n if (document.activeElement === this.firstFocusableEl || (!this.focusableEls.includes(document.activeElement) && this.el.contains(document.activeElement))) {\n e.preventDefault();\n focusElement(this.lastFocusableEl);\n }\n };\n const handleForwardTab = () => {\n // When a click occurs on the panel window, this.el might be the activeElement.\n // Make sure to handle the forward tab not to move to the background body content.\n if (document.activeElement === this.lastFocusableEl) {\n // || (!this.focusableEls.includes(document.activeElement) && this.el.contains(document.activeElement))) {\n e.preventDefault();\n focusElement(this.firstFocusableEl);\n }\n };\n switch (e.keyCode) {\n case KEY_TAB:\n if (this.focusableEls.length === 1 && document.activeElement === this.focusableEls[0]) {\n // There's only one element and it is focused, don't do anything\n e.preventDefault();\n break;\n }\n if (e.shiftKey) {\n handleBackwardTab();\n }\n else {\n handleForwardTab();\n }\n break;\n case KEY_ESC:\n this.closeMobileMenu();\n break;\n }\n }\n /**\n * This method will close the mobile menu if it's opened. It is useful to use it when a user clicks on a link inside the menu.\n * @returns Promise will resolve when the close animation ends.\n */\n closeMobileMenu() {\n return new Promise(resolve => {\n if (this.opened) {\n // Wait for transition to finish before resolving\n this.registerTransitionListeners(() => {\n resolve();\n });\n this.animation = 'out';\n this.enableScrollOnBody(true);\n }\n else {\n // Mobile menu is already closed\n resolve();\n }\n });\n }\n checkBreakpoint() {\n // clear the timeout\n clearTimeout(this.timeout);\n // Setup debounce so we're not constantly reading screen width\n this.timeout = setTimeout(this.checkMobileMode.bind(this), RESIZE_DEBOUNCE_TIME);\n }\n checkMobileMode() {\n if (window.innerWidth < breakpoints[this.breakpoint]) {\n // Mobile\n this.mobileMode = true;\n }\n else {\n // Desktop\n this.mobileMode = false;\n }\n }\n enableScrollOnBody(enable) {\n document.body.style.overflow = enable ? '' : 'hidden';\n }\n refreshFocusableElements() {\n this.focusableEls = [];\n // Get all focusable elements that aren't passed in through slot.\n this.focusableEls = Array.prototype.slice.call(this.el.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex=\"0\"]'));\n if (this.focusableEls.length > 0) {\n //const firstElement = this.focusableEls[0];\n this.firstFocusableEl = this.closeButton;\n this.lastFocusableEl = this.focusableEls[this.focusableEls.length - 1];\n console.log(this.firstFocusableEl);\n console.log(this.lastFocusableEl);\n }\n else {\n this.firstFocusableEl = null;\n this.lastFocusableEl = null;\n }\n }\n registerTransitionListeners(callback = () => { }) {\n const elem = this.el.querySelector('.som-mobile-subheader__overlay');\n // Listen for an animation\n const transitionEvent = whichTransitionEvent();\n let onTransitionCompletedCb;\n const onTransitionCompleted = () => {\n elem.removeEventListener(transitionEvent, onTransitionCompletedCb);\n // Transition is completed\n this.afterToggle();\n callback();\n };\n onTransitionCompletedCb = onTransitionCompleted.bind(this);\n if (transitionEvent) {\n elem.addEventListener(transitionEvent, onTransitionCompletedCb);\n }\n }\n componentDidLoad() {\n this.elemWithAnimation = this.el.querySelector('.som-mobile-subheader__overlay-content');\n this.menuContent = this.el.querySelector('.som-mobile-subheader__overlay-content__nav-container');\n this.refreshFocusableElements();\n }\n toggleOverlay() {\n this.registerTransitionListeners();\n this.animation = this.opened ? 'out' : 'in';\n this.enableScrollOnBody(this.animation === 'out');\n }\n handleToggle(e) {\n preventDefault(e);\n this.toggleOverlay();\n }\n afterToggle() {\n if (this.opened && this.animation === 'out') {\n // Menu was closed\n this.opened = false;\n this.animation = '';\n }\n else if (!this.opened && this.animation === 'in') {\n // Menu was opened\n this.opened = true;\n this.animation = '';\n focusElement(this.firstFocusableEl);\n }\n }\n createHeader() {\n let toggleButtonClass = '';\n if (this.animation === 'out') ;\n else if (this.animation === 'in' || this.opened) {\n toggleButtonClass = 'opened';\n }\n return (h(\"nav\", { \"aria-label\": \"secondary\" }, h(\"button\", { class: \"som-mobile-subheader__title-bar\", onClick: e => this.handleToggle(e), \"aria-haspopup\": \"true\", \"aria-controls\": this.menuId, ref: el => this.closeButton = el }, h(\"span\", { class: \"truncate\" }, this.subheaderTitle), h(\"span\", { class: `som-mobile-subheader__title-bar__toggle-button ${toggleButtonClass}` }, h(\"som-icon-chevron-down\", { color: \"secondary\", size: \"sm\" })))));\n }\n render() {\n // Set animations when the overlay menu is opened or closed\n let overlayClass = '';\n let overlayContentAnimation = '';\n if (this.animation === 'out') ;\n else if (this.animation === 'in' || this.opened) {\n overlayClass = 'opened';\n overlayContentAnimation = 'opened';\n }\n // We create the header menus (a regular one which will display on the page and an \"overlay\" one which will display when the mobile menu overlay is displayed)\n const nav = this.createHeader();\n const overlayNav = this.createHeader();\n /*\n When menu overlay is animating, this.animation will either be 'in' our 'out'.\n When the menu is shown (after the animation), this.opened will be set to true.\n */\n const mobileMenuShown = this.animation || this.opened;\n return (h(\"div\", { class: \"som-mobile-subheader\" }, h(\"div\", { class: `${mobileMenuShown ? 'invisible' : ''} som-header-d-${this.breakpoint}-none` }, nav), h(\"div\", { class: ['som-mobile-subheader__overlay', mobileMenuShown ? '' : ' invisible', overlayClass].join(' '), role: \"dialog\", onClick: this.closeMobileMenu.bind(this) }, h(\"div\", { class: \"som-mobile-subheader__overlay__title-bar\" }, overlayNav), h(\"div\", { class: ['som-mobile-subheader__overlay-content', overlayContentAnimation].join(' '), id: this.menuId, ref: (el) => this.menuContainer = el, tabindex: \"-1\" }, h(\"div\", { class: \"som-mobile-subheader__overlay-content__nav-container\" }, h(\"slot\", null))))));\n }\n get el() { return getElement(this); }\n static get watchers() { return {\n \"mobileMode\": [\"updateMode\"]\n }; }\n};\nSomMobileSubheader.style = somMobileSubheaderCss;\n\nexport { SomMobileSubheader as som_mobile_subheader };\n","function focusElement(element, delay = 0) {\n return new Promise((resolve) => {\n // We need to put the `element.focus()` call on top of the stack to make sure IE executes the focus after everything else. This can be done with `setTimeout`.\n setTimeout(() => {\n element.focus();\n resolve();\n }, delay);\n });\n}\nfunction getFocusableElementList() {\n return 'a[href], area[href], input:not([disabled]), input:not([hidden]), select:not([disabled]), select:not([hidden]), textarea:not([disabled]), textarea:not([hidden]), button:not([disabled]), [tabindex=\"0\"]';\n}\nfunction find(items, fn) {\n // Use default find if supported\n if (Array.prototype.find) {\n return items.find(fn);\n }\n // `find` method is not defined on `Array`, so we implement it\n let i = 0;\n let found = null;\n while (!found && i < items.length) {\n found = fn(items[i]) ? items[i] : null;\n i += 1;\n }\n return found;\n}\n// Use this function to generate an ID.\n// For example, this will ensure that each 'som-radio-button' components will have a unique ID automatically.\nlet lastId = 0;\nfunction generateId(prefix = 'id') {\n lastId += 1;\n return `${prefix}${lastId}`;\n}\nfunction whichTransitionEvent() {\n const el = document.createElement('fakeelement');\n const transitions = {\n transition: 'transitionend',\n OTransition: 'oTransitionEnd',\n MozTransition: 'transitionend',\n WebkitTransition: 'webkitTransitionEnd',\n };\n const transitionKeys = Object.keys(transitions);\n let found = false;\n let i = 0;\n while (!found && i < transitionKeys.length) {\n const t = transitionKeys[i];\n if (el.style[t] !== undefined) {\n found = true;\n }\n else {\n i += 1;\n }\n }\n if (found) {\n const t = transitionKeys[i];\n return transitions[t];\n }\n return null;\n}\nfunction whichAnimationEvent() {\n const el = document.createElement('fakeelement');\n const animations = {\n animation: 'animationend',\n OAnimation: 'oAnimationEnd',\n MozAnimation: 'animationend',\n WebkitAnimation: 'webkitAnimationEnd',\n };\n const animationKeys = Object.keys(animations);\n let found = false;\n let i = 0;\n while (!found && i < animationKeys.length) {\n const t = animationKeys[i];\n if (el.style[t] !== undefined) {\n found = true;\n }\n else {\n i += 1;\n }\n }\n if (found) {\n const t = animationKeys[i];\n return animations[t];\n }\n return null;\n}\nfunction waitForCSSTransitionToFinish(elem, callback) {\n // Listen for a transition animation animation\n const transitionEvent = whichTransitionEvent();\n let onTransitionCompletedCb;\n const onTransitionCompleted = (evt) => {\n // Make sure to wait for the proper transition event\n if (evt.target === elem) {\n elem.removeEventListener(transitionEvent, onTransitionCompletedCb);\n callback();\n }\n };\n onTransitionCompletedCb = onTransitionCompleted.bind(this);\n if (transitionEvent) {\n elem.addEventListener(transitionEvent, onTransitionCompletedCb);\n }\n}\nfunction runAfterNextFrameRender(callback) {\n requestAnimationFrame(() => {\n setTimeout(() => {\n callback();\n }, 0);\n });\n}\n// Returns true of an element is a child of another element; false otherwise\nfunction isDescendant(parent, child) {\n let node = child.parentNode;\n while (node !== null) {\n if (node === parent) {\n return true;\n }\n node = node.parentNode;\n }\n return false;\n}\n\nexport { waitForCSSTransitionToFinish as a, whichAnimationEvent as b, find as c, getFocusableElementList as d, focusElement as f, generateId as g, isDescendant as i, runAfterNextFrameRender as r, whichTransitionEvent as w };\n"],"sourceRoot":""}