1(()=>{const drawer=document.getElementById("gp-cart-drawer");if(!drawer)return;const body=drawer.querySelector("[data-gp-cart-body]");document.querySelectorAll("[data-gp-cart-open]").forEach(el=>{el.setAttribute("data-gp-drawer-open",""),el.setAttribute("aria-controls","gp-cart-drawer"),el.setAttribute("aria-expanded","false")});async function refresh(){const res=await fetch(`${window.Shopify?.routes?.root||"/"}?section_id=gp-cart-drawer`);if(!res.ok)return;const fresh=new DOMParser().parseFromString(await res.text(),"text/html").getElementById("gp-cart-drawer");if(!fresh)return;const panel=drawer.querySelector(".gp-cart-drawer__panel"),freshPanel=fresh.querySelector(".gp-cart-drawer__panel");panel&&freshPanel&&(panel.innerHTML=freshPanel.innerHTML);const count=fresh.querySelector("[data-gp-cart-count]")?.textContent?.trim();count!=null&&document.querySelectorAll("[data-gp-cart-count]").forEach(n=>n.textContent=count)}async function setQuantity(key,quantity){drawer.setAttribute("aria-busy","true");try{const res=await fetch(`${window.Shopify?.routes?.root||"/"}cart/change.js`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({id:key,quantity})});if(!res.ok)throw new Error(`cart/change ${res.status}`);await refresh()}catch(err){console.error("[gp-cart]",err),window.location.href=`${window.Shopify?.routes?.root||"/"}cart`}finally{drawer.removeAttribute("aria-busy")}}drawer.addEventListener("click",e=>{const step=e.target.closest("[data-gp-qty]");step&&(e.preventDefault(),setQuantity(step.dataset.gpKey,Number(step.dataset.gpQty)))}),document.addEventListener("submit",async e=>{const form=e.target;if(!(form instanceof HTMLFormElement)||!form.action.includes("/cart/add"))return;e.preventDefault();const button=form.querySelector('[type="submit"]');button?.setAttribute("aria-busy","true");try{if(!(await fetch(`${window.Shopify?.routes?.root||"/"}cart/add.js`,{method:"POST",headers:{Accept:"application/json"},body:new FormData(form)})).ok){form.submit();return}await refresh(),window.gpDrawer?.open(drawer,form.querySelector("[data-gp-cart-open]")||void 0)}catch(err){console.error("[gp-cart]",err),form.submit()}finally{button?.removeAttribute("aria-busy")}})})(); 2//# sourceMappingURL=/cdn/shop/t/14/assets/gp-cart.js.map?v=146555205430269956431788531109
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.