1const l=["pointer-events-none","opacity-0","translate-y-2"],d=["pointer-events-auto","opacity-100","translate-y-0"];const S=s=>{const r=s.querySelector('[data-element="language-toggle"]'),n=s.querySelector('[data-element="language-menu"]'),a=s.querySelector('[data-element="language-chevron"]'),u=s.querySelectorAll("a[href]");if(!r||!n)return;let t=!1,o=null;const c=()=>{r.setAttribute("aria-expanded",String(t)),n.setAttribute("aria-hidden",String(!t)),a==null||a.classList.toggle("rotate-180",t)},E=()=>{t||(t=!0,clearTimeout(o),n.hidden=!1,c(),requestAnimationFrame(()=>{n.classList.remove(...l),n.classList.add(...d)}))},i=({restoreFocus:e=!1}={})=>{!t&&n.hidden||(t=!1,clearTimeout(o),c(),n.classList.remove(...d),n.classList.add(...l),o=window.setTimeout(()=>{t||(n.hidden=!0)},200),e&&r.focus())},m=e=>{if(e.preventDefault(),t){i();return}E()},f=e=>{!t||s.contains(e.target)||i()},v=e=>{!t||s.contains(e.target)||i()},L=e=>{e.key==="Escape"&&t&&(e.preventDefault(),i({restoreFocus:!0}))},g=()=>{i()};return r.addEventListener("click",m),document.addEventListener("click",f,!0),document.addEventListener("focusin",v),window.addEventListener("keydown",L),u.forEach(e=>e.addEventListener("click",g)),()=>{clearTimeout(o),r.removeEventListener("click",m),document.removeEventListener("click",f,!0),document.removeEventListener("focusin",v),window.removeEventListener("keydown",L),u.forEach(e=>e.removeEventListener("click",g)),t=!1,c(),n.classList.remove(...d),n.classList.add(...l),n.hidden=!0}};export{S as init};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.