1class l{modal;closeButton;releaseFocusTrap=null;constructor(e){this.modal=e,this.closeButton=this.modal.querySelector("[data-close-modal]"),this.closeButton&&this.init()}init(){localStorage.getItem("ageGateVerified")!=="true"&&(this.open(),this.closeButton?.addEventListener("click",()=>{localStorage.setItem("ageGateVerified","true"),this.close()}),this.modal.addEventListener("close",()=>this.onClose()))}open(){if(this.modal.open)return;const e=window.scrollY;this.modal.showModal(),document.body.classList.add("age-gate-active"),window.scrollTo(0,e),this.releaseFocusTrap=this.trapFocus()}close(){this.modal.open&&this.modal.close()}onClose(){document.body.classList.remove("age-gate-active"),this.releaseFocusTrap&&(this.releaseFocusTrap(),this.releaseFocusTrap=null)}trapFocus(){const e=this.modal.querySelectorAll('a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([disabled]):not([tabindex="-1"])'),o=e[0],a=e[e.length-1],i=t=>{t.key==="Tab"&&(t.shiftKey?document.activeElement===o&&(a?.focus(),t.preventDefault()):document.activeElement===a&&(o?.focus(),t.preventDefault()))};return this.modal.addEventListener("keydown",i),o?.focus(),()=>{this.modal.removeEventListener("keydown",i)}}}function n(s){s.forEach(e=>{e instanceof HTMLDialogElement&&new l(e)})}export{n as default};
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.