PageSourceSearch

https://glazdjewels.com/cdn/shop/t/41/assets/cart-drawer.js?v=152978770963148611981719322233

js glazdjewels.com collected 2026-09-28 23:37:48 UTC 4,873 bytes, 2 lines download raw bytes

1class CartDrawer extends HTMLElement{constructor(){super(),this.notification=document.getElementById("cart-drawer"),this.notificationParent=document.querySelector(".cart-drawer-wrapper"),this.header=document.querySelector("sticky-header"),this.onBodyClick=this.handleBodyClick.bind(this),this.notification.addEventListener("keyup",evt=>evt.code==="Escape"&&this.close()),this.querySelectorAll('button[type="button"]').forEach(closeButton=>closeButton.addEventListener("click",this.close.bind(this)));let $this=this;document.querySelectorAll('a[href="/cart"]:not(.cart-view)').forEach(cartIconLink=>{cartIconLink.addEventListener("click",function(e){e.preventDefault(),renderDrawer($this)})}),document.getElementById("cart-icon-bubble").addEventListener("click",function(e){e.preventDefault(),renderDrawer($this)})}open(){this.notification.classList.add("animate","active"),this.notificationParent.classList.add("active"),document.querySelector("body").classList.add("cart-drawer-active"),this.notification.addEventListener("transitionend",()=>{this.notification.focus(),trapFocus(this.notification)},{once:!0}),document.body.addEventListener("click",this.onBodyClick),jQuery("#cart-drawer.active .card-free-product form .product-form__submit").click();let $this=this;this.querySelectorAll("[data-item-remove]").forEach(cartItemToRemove=>{cartItemToRemove.addEventListener("click",function(e){e.preventDefault();let itemKey=this.dataset.itemKey,data={};data[itemKey]=0,cartUpdate(data,$this)})}),this.querySelectorAll("[data-item-update]").forEach(cartItemToUpdate=>{cartItemToUpdate.addEventListener("change",function(e){e.preventDefault();let itemKey=this.dataset.itemKey,data={};data[itemKey]=parseInt(this.value,10),cartUpdate(data,$this)})}),this.querySelectorAll("[data-item-plan]").forEach(cartItemPlanToUpdate=>{cartItemPlanToUpdate.addEventListener("change",function(e){e.preventDefault();let itemKey=this.dataset.itemKey,selling_plan=parseInt(this.value,10),quantityInput=this.closest(".cart-item").querySelector(".quantity__input"),quantity=parseInt(quantityInput.value,10)||1;cartChange({id:itemKey,quantity,selling_plan:selling_plan||null},$this)})})}close(){this.notification.classList.remove("active"),this.notificationParent.classList.remove("active"),document.querySelector("body").classList.remove("cart-drawer-active"),document.body.removeEventListener("click",this.onBodyClick),removeTrapFocus(this.activeElement)}renderContents(parsedState){this.getSectionsToRender().forEach((section=>{section.class?document.querySelectorAll(section.class).forEach(item=>{item.innerHTML=this.getSectionInnerHTML(parsedState.sections[section.id],section.selector)}):document.getElementById(section.id).innerHTML=this.getSectionInnerHTML(parsedState.sections[section.id],section.selector)})),this.header&&this.header.reveal(),this.open()}getSectionsToRender(){return[{id:"cart-drawer-products",selector:".cart-drawer-products"},{id:"cart-icon-bubble",class:".cart-icon-bubble"},{id:"cart-subtotals"},{id:"cart-drawer-heading"}]}getSectionInnerHTML(html,selector=".shopify-section"){return new DOMParser().parseFromString(html,"text/html").querySelector(selector).innerHTML}handleBodyClick(evt){const target=evt.target;if(target!==this.notification&&!target.closest("cart-drawer")){const disclosure=target.closest("details-disclosure");this.activeElement=disclosure?disclosure.querySelector("summary"):null,this.close()}}setActiveElement(element){this.activeElement=element}}function renderDrawer($this){fetch(`${routes.cart_url}?sections=cart-drawer-products,cart-icon-bubble,cart-subtotals,cart-subtotals,cart-drawer-heading`).then(response=>response.json()).then(response=>{response.status||$this.renderContents({sections:response})}).catch(e=>{console.error(e)}).finally(()=>{})}function cartUpdate(data,$this){fetch(`${routes.cart_update_url}.js`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({updates:data})}).then(response=>response.json()).then(response=>{response.status||renderDrawer($this)}).catch(e=>{console.error(e)}).finally(()=>{})}
1function cartChange(data,$this){fetch(`${routes.cart_change_url}.js`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(data)}).then(response=>response.json()).then(response=>{response.status||renderDrawer($this)}).catch(e=>{console.error(e)}).finally(()=>{})}$("a.header__icon--cart").on("click",function(){$("body").addClass("cart-drawer-active"),$(".cart-drawer-wrapper.page-width").addClass("active"),$(".cart-drawer.focus-inset").addClass("animate active")}),$(".cart-drawer-overlay").on("click",function(){$("body").removeClass("cart-drawer-active"),$(".cart-drawer.focus-inset").removeClass("animate active")}),customElements.define("cart-drawer",CartDrawer);
2//# sourceMappingURL=/cdn/shop/t/41/assets/cart-drawer.js.map?v=152978770963148611981719322233

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.