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S,KAC3B,GACJ,IAGAH,EAAQO,aAAa,iBAAkB,QAEvC,MAAMC,EAAgBR,EAAQX,cAAc,sCAAsCA,cAAc,KAC5FmB,IAAeA,EAAclB,UAAY,EACjD,CAuCgBuB,CAAgBlB,GAChBH,EAAGe,aAAa,aAAczB,GAEtC,GAAE,IAIuBF,SAASC,iBAAiB,sBAElCU,SAAQuB,IACzB,IAAIC,EAAcD,EAAEzB,cAAc,kCAAkC2B,aACpEF,EAAEzB,cAAc,oCAAoCS,MAAMK,OAASY,EAAc,IAAI,G","sources":["webpack://wwwroot/./src/scripts/accordion.js"],"sourcesContent":["const accordionButtons = document.querySelectorAll(\".adm-div-accordion-button\");\r\nlet expandAriaLabel;\r\nlet collapseAriaLabel;\r\n\r\nif (accordionButtons) {\r\n expandAriaLabel = accordionButtons[0].getAttribute(\"aria-label\");\r\n collapseAriaLabel = accordionButtons[0].getAttribute(\"data-collapse-aria-label\");\r\n\r\n for (var btn of accordionButtons) {\r\n btn.removeAttribute(\"data-collapse-aria-label\");\r\n }\r\n}\r\n\r\nconst accordionLinks = document.querySelectorAll(\".adm-div-accordion-sub-block-link\");\r\n\r\nfor (var link of accordionLinks) {\r\n link.querySelector(\"a\").tabIndex = -1;\r\n}\r\n\r\nfunction collapseSection(element) {\r\n // get the height of the element's inner content, regardless of its actual size\r\n var sectionHeight = element.scrollHeight;\r\n\r\n // temporarily disable all css transitions\r\n var elementTransition = element.style.transition;\r\n element.style.transition = \"\";\r\n\r\n // on the next frame (as soon as the previous style change has taken effect),\r\n // explicitly set the element's height to its current pixel height, so we \r\n // aren't transitioning out of 'auto'\r\n requestAnimationFrame(function () {\r\n element.style.height = sectionHeight + \"px\";\r\n element.style.transition = elementTransition;\r\n element.style.opacity = 0;\r\n\r\n // on the next frame (as soon as the previous style change has taken effect),\r\n // have the element transition to height: 0\r\n requestAnimationFrame(function () {\r\n element.style.height = 0 + \"px\";\r\n });\r\n });\r\n\r\n // mark the section as \"currently collapsed\"\r\n element.setAttribute(\"data-collapsed\", \"true\");\r\n\r\n const accordionLink = element.querySelector(\".adm-div-accordion-sub-block-link\")?.querySelector(\"a\");\r\n if (accordionLink) accordionLink.tabIndex = -1;\r\n}\r\n\r\nfunction expandSection(element) {\r\n // get the height of the element's inner content, regardless of its actual size\r\n var sectionHeight = element.scrollHeight;\r\n\r\n // have the element transition to the height of its inner content\r\n element.style.height = sectionHeight + \"px\";\r\n element.style.opacity = 1;\r\n\r\n // when the next css transition finishes (which should be the one we just triggered)\r\n element.addEventListener(\"transitionend\", function removeTransitionEndEvent() {\r\n // remove this event listener so it only gets triggered once\r\n element.removeEventListener(\"transitionend\", removeTransitionEndEvent);\r\n\r\n // remove \"height\" from the element's inline styles, so it can return to its initial value\r\n element.style.height = null;\r\n });\r\n\r\n // mark the section as \"currently not collapsed\"\r\n element.setAttribute(\"data-collapsed\", \"false\");\r\n\r\n const accordionLink = element.querySelector(\".adm-div-accordion-sub-block-link\")?.querySelector(\"a\");\r\n if (accordionLink) accordionLink.tabIndex = 0;\r\n}\r\n\r\ndocument.querySelectorAll(\".adm-div-accordion-sub-block-svg button\").forEach(el => {\r\n el.addEventListener(\"click\",\r\n function (e) {\r\n var section = e.currentTarget.closest(\".adm-div-accordion-sub-block\").querySelector(\".adm-div-collapsible\");\r\n var isCollapsed = section.getAttribute(\"data-collapsed\") === \"true\";\r\n\r\n if (isCollapsed) {\r\n e.currentTarget.style.transform = \"rotate(-180deg)\";\r\n expandSection(section);\r\n section.setAttribute(\"data-collapsed\", \"false\");\r\n el.setAttribute(\"aria-label\", collapseAriaLabel);\r\n } else {\r\n e.currentTarget.style.transform = \"rotate(0deg)\";\r\n collapseSection(section);\r\n el.setAttribute(\"aria-label\", expandAriaLabel);\r\n }\r\n });\r\n});\r\n\r\nfunction fixArrowPosition() {\r\n const accordionsWithNoIcon = document.querySelectorAll(\".accordion-no-icon\");\r\n\r\n accordionsWithNoIcon.forEach(a => {\r\n var titleHeight = a.querySelector(\".adm-div-accordion-inner-title\").clientHeight;\r\n a.querySelector(\".adm-div-accordion-sub-block-svg\").style.height = titleHeight + \"px\";\r\n });\r\n}\r\n\r\nfixArrowPosition();"],"names":["accordionButtons","document","querySelectorAll","expandAriaLabel","collapseAriaLabel","btn","getAttribute","removeAttribute","accordionLinks","link","querySelector","tabIndex","forEach","el","addEventListener","e","section","currentTarget","closest","style","transform","element","sectionHeight","scrollHeight","height","opacity","removeTransitionEndEvent","removeEventListener","setAttribute","accordionLink","expandSection","elementTransition","transition","requestAnimationFrame","collapseSection","a","titleHeight","clientHeight"],"sourceRoot":""}