PageSourceSearch

https://www.lecoqsportif.com/cdn/shop/t/16/assets/bundle-cart-20260918T094325-sh.js

js lecoqsportif.com collected 2026-09-24 21:03:16 UTC 4,192 bytes, 1 lines download raw bytes

1import{E as o,y as s,Y as l,g as c,a as p}from"./index-20260918T094325-sh.js";import{U as w}from"./bundle-critical-20260918T094325-sh.js";class h extends o{get checkoutUrl(){return this.dataset.checkoutUrl??""}handleClick=e=>{if(e.preventDefault(),!this.checkoutUrl)throw new s({message:"Missing checkout URL",element:this});window.location.assign(this.checkoutUrl)};onStart(){this.addEventListener("click",this.handleClick,{signal:this.signal})}}customElements.define("go-to-checkout",h);const v=Object.freeze(Object.defineProperty({__proto__:null,GoToCheckout:h},Symbol.toStringTag,{value:"Module"}));class d extends o{get lineKey(){return this.getAttribute("cart-line-key")}get quantity(){return Number(this.getAttribute("quantity")||"0")}async handleAction(){const e=this.lineKey;if(!e)throw new s({message:"No line key found",element:this});const t=this.quantity;await l({key:e,newQuantity:t})}onStart(){this.addEventListener("click",()=>this.handleAction(),{signal:this.signal}),this.addEventListener("keydown",e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.handleAction())},{signal:this.signal})}}customElements.define("line-item-action",d);const S=Object.freeze(Object.defineProperty({__proto__:null,LineItemAction:d},Symbol.toStringTag,{value:"Module"}));class u extends o{get lineKey(){return this.getAttribute("cart-line-key")}onStart(){const e=this.querySelector("select");if(!e)throw new s({message:"No select element found",element:this});e.addEventListener("change",async()=>{const t=this.lineKey;if(!t)throw new s({message:"No line key found",element:this});const n=Number(e.value);await l({key:t,newQuantity:n})},{signal:this.signal}),e.addEventListener("keydown",t=>{t.key==="Enter"&&(t.preventDefault(),e.click())},{signal:this.signal})}}customElements.define("line-item-select",u);const E=Object.freeze(Object.defineProperty({__proto__:null,LineItemSelect:u},Symbol.toStringTag,{value:"Module"}));class m extends o{sectionCartId=null;get autoOpen(){return this.hasAttribute("auto-open")}get closestPanel(){const e=this.closest("ui-panel");if(!(e instanceof w))throw new s({message:"No panel found",element:this});return e}async getSectionCartId(){if(this.sectionCartId)return this.sectionCartId;const e=await fetch(`${window.Shopify.routes.root}cart`).then(t=>t.text()).then(t=>new DOMParser().parseFromString(t,"text/html").querySelector("section.cart-panel-element")?.id||"");return this.sectionCartId=e.replace("shopify-section-",""),this.sectionCartId}async onStart(){this.setupEventListeners(),await this.refreshContent({})}setupEventListeners(){document.addEventListener(c.cartUpdating,this.handleCartUpdating,{signal:this.signal,passive:!0}),document.addEventListener(c.cartUpdated,this.handleCartUpdated,{signal:this.signal,passive:!0})}handleCartUpdating=e=>{e instanceof CustomEvent&&e.detail.skipEvents||this.closestPanel.classList.add("is-loading")};handleCartUpdated=async e=>{await this.refreshContent({detail:e instanceof CustomEvent?e.detail:void 0})};async refreshContent({detail:e}={}){if(e&&typeof e=="object"&&"skipEvents"in e&&e.skipEvents)throw new s({message:"Skip events",element:this,level:"info"});const t=this.closestPanel;this.autoOpen&&this.closest("website-manager")?.replaceOverlayHistory([t.id]);try{const n=await this.fetchCartContent();if(!this.updatePanelContent(t,n))throw new s({message:"Cart panel content is missing",element:this})}catch(n){console.error(n)}finally{t.classList.remove("is-loading")}}
1async fetchCartContent(){const e=await this.getSectionCartId();return await fetch(`${window.Shopify.routes.root}cart?sections=${e}`).then(t=>t.json()).then(t=>typeof t=="object"&&t!==null&&t[e]||"")}updatePanelContent(e,t){const a=new DOMParser().parseFromString(t,"text/html").querySelector("section");if(e&&a){const g=p(e,a),y=Array.from(g?.children);for(const i of Array.from(e.children))i!==this&&e.removeChild(i);for(const i of y)e.appendChild(i);return setTimeout(()=>e.classList.add("display-drawer"),10),!0}return!1}}customElements.define("panel-attach-cart",m);const b=Object.freeze(Object.defineProperty({__proto__:null,AttachCart:m},Symbol.toStringTag,{value:"Module"}));export{E as a,v as g,S as l,b as p};

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.