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pack://app-accordion4/webpack/bootstrap","webpack://app-accordion4/./src/ts/index.ts"],"sourcesContent":["import { hide, show, toggle } from 'slidetoggle';\r\nimport { AccordionOptions } from './lib-2sxc-accordion-options';\r\nimport { Collapse } from 'bootstrap';\r\n/*\r\n This is a shared code used in various 2sxc apps. Make sure that they are in sync, so if you improve it, improve all 2sxc apps which use this. \r\n ATM they are:\r\n - Accordion\r\n - FAQ\r\n - App School System\r\n\r\n The master with the newest / best version must always be the Accordion, the others should then get a fresh copy.\r\n Because this is shared, all parameters like DOM-IDs etc. must be provided in the Init-call that it can work across apps\r\n*/ \r\n\r\nexport function initAccordion({ domId, options } : { domId: string, options: AccordionOptions }) {\r\n // get navHight for correct scrollposition\r\n var nav = (document.getElementsByTagName(options.tagStickyHeader)[0] as HTMLElement);\r\n var navHeight = (nav != null ? nav.offsetHeight : 0);\r\n\r\n var accordionOpener = document.querySelectorAll(`.app-accordion4-item > [${options.attrParent}]`);\r\n\r\n accordionOpener.forEach((elem: HTMLElement, index) => {\r\n const hash = elem.dataset.bsTarget.replace('#', '');\r\n const hashId = elem.dataset.bsTarget.replace('app-accordion4-', '');\r\n const accordionTarget = document.getElementById(hash);\r\n\r\n accordionTarget.addEventListener('show.bs.collapse', function () {\r\n location.hash = hashId;\r\n }) \r\n })\r\n\r\n // get hash from url and open specific item\r\n if(window.location.hash){\r\n const hash = window.location.hash.replace(\"#\", \"\");\r\n const targetHashElem = document.querySelector(`[${options.attrParent}=\"#app-accordion4-${hash}\"]`);\r\n const collapseTarget = document.querySelector(`#app-accordion4-${hash}`);\r\n \r\n // if target element exists scroll to element and open it\r\n if(targetHashElem){\r\n const elemOffsetX = targetHashElem.getBoundingClientRect().top + window.scrollY - navHeight;\r\n\r\n targetHashElem.classList.add('show')\r\n collapseTarget.classList.add('show')\r\n\r\n window.scrollTo({\r\n top: elemOffsetX,\r\n left: 0,\r\n behavior: 'smooth'\r\n });\r\n }\r\n }\r\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","import { initAccordion } from './lib-2sxc-accordion';\r\n\r\nvar winAny = window as any;\r\nwinAny.appAccordion4 ??= {};\r\nwinAny.appAccordion4.init ??= initAccordion;"],"names":["options","nav","document","getElementsByTagName","tagStickyHeader","navHeight","offsetHeight","querySelectorAll","attrParent","forEach","elem","index","hash","dataset","bsTarget","replace","hashId","getElementById","addEventListener","location","window","targetHashElem","querySelector","collapseTarget","elemOffsetX","getBoundingClientRect","top","scrollY","classList","add","scrollTo","left","behavior","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","module","__webpack_modules__","winAny","appAccordion4","init","initAccordion"],"sourceRoot":""}