/* Generated time: January 26, 2026 23:51 This file was created by the app developer. Feel free to contact the original developer with any questions. It was minified (compressed) by AVADA. AVADA do NOT own this script. */ class CartDrawer extends HTMLElement{constructor(){super(),this.addEventListener("keyup",e=>"Escape"===e.code&&this.close()),this.querySelector("#CartDrawer-Overlay").addEventListener("click",this.close.bind(this)),this.setHeaderCartIconAccessibility()}setHeaderCartIconAccessibility(){let t=document.querySelector("#cart-icon-bubble");t&&(t.setAttribute("role","button"),t.setAttribute("aria-haspopup","dialog"),t.addEventListener("click",e=>{e.preventDefault(),this.open(t)}),t.addEventListener("keydown",e=>{"SPACE"===e.code.toUpperCase()&&(e.preventDefault(),this.open(t))}))}open(e){e&&this.setActiveElement(e);e=this.querySelector('[id^="Details-"] summary');e&&!e.hasAttribute("role")&&this.setSummaryAccessibility(e),setTimeout(()=>{this.classList.add("animate","active");var e=this.querySelector(".drawer__inner");e&&e.classList.add("active")}),this.addEventListener("transitionend",()=>{var e=this.classList.contains("is-empty")?this.querySelector(".drawer__inner-empty"):document.getElementById("CartDrawer"),t=this.querySelector(".drawer__inner")||this.querySelector(".drawer__close");trapFocus(e,t)},{once:!0}),document.body.classList.add("overflow-hidden")}close(){this.classList.remove("active");var e=this.querySelector(".drawer__inner");e&&e.classList.remove("active"),removeTrapFocus(this.activeElement),document.body.classList.remove("overflow-hidden")}setSummaryAccessibility(e){e.setAttribute("role","button"),e.setAttribute("aria-expanded","false"),e.nextElementSibling.getAttribute("id")&&e.setAttribute("aria-controls",e.nextElementSibling.id),e.addEventListener("click",e=>{e.currentTarget.setAttribute("aria-expanded",!e.currentTarget.closest("details").hasAttribute("open"))}),e.parentElement.addEventListener("keyup",onKeyUpEscape)}renderContents(r){this.querySelector(".drawer__inner").classList.contains("is-empty")&&this.querySelector(".drawer__inner").classList.remove("is-empty"),this.productId=r.id,this.getSectionsToRender().forEach(e=>{var t=e.selector?document.querySelector(e.selector):document.getElementById(e.id);t&&(t.innerHTML=this.getSectionInnerHTML(r.sections[e.id],e.selector))}),setTimeout(()=>{this.querySelector("#CartDrawer-Overlay").addEventListener("click",this.close.bind(this)),this.open()})}getSectionInnerHTML(e,t=".shopify-section"){return(new DOMParser).parseFromString(e,"text/html").querySelector(t).innerHTML}getSectionsToRender(){return[{id:"cart-drawer",selector:"#CartDrawer"},{id:"cart-icon-bubble"}]}getSectionDOM(e,t=".shopify-section"){return(new DOMParser).parseFromString(e,"text/html").querySelector(t)}setActiveElement(e){this.activeElement=e}}customElements.define("cart-drawer",CartDrawer);class CartDrawerItems extends CartItems{getSectionsToRender(){return[{id:"CartDrawer-CartItems",section:"cart-drawer",selector:".drawer__contents"},{id:"CartDrawer",section:"cart-drawer",selector:".cart-drawer__foot_discounts"},{id:"cart-icon-bubble",section:"cart-icon-bubble",selector:".shopify-section"}]}}customElements.define("cart-drawer-items",CartDrawerItems);