1class Drawer extends HTMLElement{constructor(){super(),this.setAttribute("role","dialog"),this.setupEventListeners()}setupEventListeners(){const drawerId=this.getAttribute("data-drawer-id"),triggers=document.querySelectorAll(`[data-drawer-trigger="${drawerId}"]`);this.addEventListener("keyup",evt=>evt.code==="Escape"&&this.close());const overlay=this.querySelector("[data-drawer-overlay]");if(triggers)[...triggers].forEach(trigger=>{trigger.addEventListener("click",event=>{event.preventDefault(),this.open()}),trigger.addEventListener("keydown",event=>{(event.key==="Enter"||event.key===" ")&&(event.preventDefault(),this.open(trigger))})});else{console.error("Drawer triggers not found");return}overlay&&overlay.addEventListener("click",this.close.bind(this))}open(triggeredBy){triggeredBy&&this.setActiveElement(triggeredBy),this.classList.add("animate","active"),this.setAttribute("aria-hidden","false"),this.addEventListener("transitionend",()=>{const containerToTrapFocusOn=this.querySelector(".drawer__inner"),focusElement=this.querySelector(".drawer__inner")||this.querySelector(".drawer__close");trapFocus(containerToTrapFocusOn,focusElement)},{once:!0}),document.body.classList.add("overflow-hidden")}close(){this.classList.remove("active"),this.setAttribute("aria-hidden","true"),removeTrapFocus(this.activeElement),document.body.classList.remove("overflow-hidden")}setActiveElement(element){this.activeElement=element}} 2//# sourceMappingURL=/cdn/shop/t/106/assets/drawer.js.map?v=139806175260764517121760644850
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.