PageSourceSearch

https://vimergy.eu/cdn/shop/t/200/assets/cart-drawer.js?v=132251385114878210071790351142

js vimergy.eu collected 2026-10-06 00:39:11 UTC 3,893 bytes, 1 lines download raw bytes

1class 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(){const e=document.querySelector("#cart-icon-bubble");e.setAttribute("role","button"),e.setAttribute("aria-haspopup","dialog"),e.addEventListener("click",t=>{t.preventDefault(),"/cart"!==window.location.pathname&&this.open(e)}),e.addEventListener("keydown",t=>{"SPACE"===t.code.toUpperCase()&&(t.preventDefault(),"/cart"!==window.location.pathname&&this.open(e))})}open(e){e&&this.setActiveElement(e);const t=this.querySelector('[id^="Details-"] summary');t&&!t.hasAttribute("role")&&this.setSummaryAccessibility(t),setTimeout(()=>{this.classList.add("animate","active")}),window?.zonos&&this.showFreeShippingForUS(),this.addEventListener("transitionend",()=>{const 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","hide-zonos-n-a11y"),setTimeout(()=>{window.vga4.reinit()},3e3)}close(){this.classList.remove("active"),removeTrapFocus(this.activeElement),document.body.classList.remove("overflow-hidden","hide-zonos-n-a11y")}showFreeShippingForUS(){const e=this.querySelector(".cart-drawer-free-shipping");"US"!==window.zonos?.country()?e.classList.add("hide-bar"):e.classList.remove("hide-bar")}observeZonosChanges(){document.getElementById("zonos").addEventListener("change",e=>{"countrySelect"===e.target.id&&("/cart"===window.location.pathname&&this.showFreeShippingForUS(),window.setTimeout(()=>{this.triggerCountryChangeGa4Event()},2e3))})}triggerCountryChangeGa4Event(){window.vga4&&window.vga4.triggerCustomEvent(JSON.stringify({event:"switch_country",selected_item:document.querySelector(".z-title").textContent.replace("Close","")}))}checkZonosOnWindow(){let e=0;const t=()=>{if(e>=5)console.log("Object not found after",5,"attempts. Exiting...");else{if(window?.zonos)return this.showFreeShippingForUS(),void this.observeZonosChanges();e++,console.log("Object not found. Retrying in 1 second..."),setTimeout(t,1e3)}};t()}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(e){this.querySelector(".drawer__inner").classList.contains("is-empty")&&this.querySelector(".drawer__inner").classList.remove("is-empty"),this.productId=e.id,this.getSectionsToRender().forEach(t=>{(t.selector?document.querySelector(t.selector):document.getElementById(t.id)).innerHTML=this.getSectionInnerHTML(e.sections[t.id],t.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",section:"cart-drawer",selector:".drawer__inner"},{id:"cart-icon-bubble",section:"cart-icon-bubble",selector:".shopify-section"}]}}customElements.define("cart-drawer-items",CartDrawerItems);

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.