document.addEventListener("DOMContentLoaded",()=>{const c="active";function i(e){e.setAttribute("aria-expanded","false"),e.classList.remove(c);var t=e.nextElementSibling;t.setAttribute("aria-hidden","true"),t.style.maxHeight=null,e.querySelector('[accordion="toggle"]').classList.remove(c)}document.querySelectorAll('[accordion="group"]').forEach(o=>{const a=Array.from(o.querySelectorAll('[accordion="header"]')),n="true"===o.getAttribute("accordion-multiopen");o.addEventListener("click",e=>{const t=e.target.closest('[accordion="header"]');var r;t&&(e="true"===t.getAttribute("aria-expanded"),n||o.querySelectorAll('[accordion="header"]').forEach(e=>{e!==t&&i(e)}),e?i(t):((e=t).setAttribute("aria-expanded","true"),e.classList.add(c),(r=e.nextElementSibling).setAttribute("aria-hidden","false"),r.style.maxHeight=r.scrollHeight+"px",e.querySelector('[accordion="toggle"]').classList.add(c)))}),a.forEach((r,o)=>{r.addEventListener("keydown",e=>{let t=!1;"ArrowDown"===e.key?(a[(o+1)%a.length].focus(),t=!0):"ArrowUp"===e.key?(a[(o-1+a.length)%a.length].focus(),t=!0):"Home"===e.key?(a[0].focus(),t=!0):"End"===e.key?(a[a.length-1].focus(),t=!0):"Enter"!==e.key&&" "!==e.key||(r.click(),t=!0),t&&e.preventDefault()})})})});