1class CartRemoveButton extends HTMLElement{constructor(){super(),this.addEventListener("click",t=>{t.preventDefault();(this.closest("cart-items")||this.closest("cart-drawer-items")).updateQuantity(this.dataset.index,0)})}}customElements.define("cart-remove-button",CartRemoveButton);class CartItems extends HTMLElement{constructor(){super(),this.lineItemStatusElement=document.getElementById("shopping-cart-line-item-status")||document.getElementById("CartDrawer-LineItemStatus");const t=debounce(t=>{this.onChange(t)},ON_CHANGE_DEBOUNCE_TIMER);this.addEventListener("change",t.bind(this))}cartUpdateUnsubscriber=void 0;connectedCallback(){this.cartUpdateUnsubscriber=subscribe(PUB_SUB_EVENTS.cartUpdate,t=>{"cart-items"!==t.source&&this.onCartUpdate()})}disconnectedCallback(){this.cartUpdateUnsubscriber&&this.cartUpdateUnsubscriber()}resetQuantityInput(t){const e=this.querySelector(`#Quantity-${t}`);e.value=e.getAttribute("value"),this.isEnterPressed=!1}setValidity(t,e,r){t.target.setCustomValidity(r),t.target.reportValidity(),this.resetQuantityInput(e),t.target.select()}validateQuantity(t){const e=parseInt(t.target.value),r=t.target.dataset.index;let n="";e<t.target.dataset.min?n=window.quickOrderListStrings.min_error.replace("[min]",t.target.dataset.min):e>parseInt(t.target.max)?n=window.quickOrderListStrings.max_error.replace("[max]",t.target.max):e%parseInt(t.target.step)!==0&&(n=window.quickOrderListStrings.step_error.replace("[step]",t.target.step)),n?this.setValidity(t,r,n):(t.target.setCustomValidity(""),t.target.reportValidity(),this.updateQuantity(r,e,document.activeElement.getAttribute("name"),t.target.dataset.quantityVariantId))}onChange(t){this.validateQuantity(t)}onCartUpdate(){"CART-DRAWER-ITEMS"===this.tagName?fetch(`${routes.cart_url}?section_id=cart-drawer`).then(t=>t.text()).then(t=>{const e=(new DOMParser).parseFromString(t,"text/html"),r=["cart-drawer-items",".cart-drawer__footer"];for(const t of r){const r=document.querySelector(t),n=e.querySelector(t);r&&n&&r.replaceWith(n)}}).catch(t=>{console.error(t)}):fetch(`${routes.cart_url}?section_id=main-cart-items`).then(t=>t.text()).then(t=>{const e=(new DOMParser).parseFromString(t,"text/html").querySelector("cart-items");this.innerHTML=e.innerHTML}).catch(t=>{console.error(t)})}getSectionsToRender(){return[{id:"main-cart-items",section:document.getElementById("main-cart-items").dataset.id,selector:".js-contents"},{id:"cart-icon-bubble",section:"cart-icon-bubble",selector:".shopify-section"},{id:"cart-live-region-text",section:"cart-live-region-text",selector:".shopify-section"},{id:"main-cart-footer",section:document.getElementById("main-cart-footer").dataset.id,selector:".js-contents"}]}updateQuantity(t,e,r,n){this.enableLoading(t);const a=JSON.stringify({line:t,quantity:e,sections:this.getSectionsToRender().map(t=>t.section),sections_url:window.location.pathname});fetch(`${routes.cart_change_url}`,{...fetchConfig(),body:a}).then(t=>t.text()).then(e=>{const a=JSON.parse(e),i=document.getElementById(`Quantity-${t}`)||document.getElementById(`Drawer-quantity-${t}`),s=document.querySelectorAll(".cart-item");if(a.errors)return i.value=i.getAttribute("value"),void this.updateLiveRegions(t,a.errors);this.classList.toggle("is-empty",0===a.item_count);const o=document.querySelector("cart-drawer"),c=document.getElementById("main-cart-footer");c&&c.classList.toggle("is-empty",0===a.item_count),o&&o.classList.toggle("is-empty",0===a.item_count),this.getSectionsToRender().forEach(t=>{(document.getElementById(t.id).querySelector(t.selector)||document.getElementById(t.id)).innerHTML=this.getSectionInnerHTML(a.sections[t.section],t.selector)});const d=a.items[t-1]?a.items[t-1].quantity:void 0;let l="";s.length===a.items.length&&d!==parseInt(i.value)&&(l=void 0===d?window.cartStrings.error:window.cartStrings.quantityError.replace("[quantity]",d)),this.updateLiveRegions(t,l);const m=document.getElementById(`CartItem-${t}`)||document.getElementById(`CartDrawer-Item-${t}`);m&&m.querySelector(`[name="${r}"]`)?o?trapFocus(o,m.querySelector(`[name="${r}"]`)):m.querySelector(`[name="${r}"]`).focus():0===a.item_count&&o?trapFocus(o.querySelector(".drawer__inner-empty"),o.querySelector("a")):document.querySelector(".cart-item")&&o&&trapFocus(o,document.querySelector(".cart-item__name")),publish(PUB_SUB_EVENTS.cartUpdate,{source:"cart-items",cartData:a,variantId:n})}).catch(()=>{this.querySelectorAll(".loading__spinner").forEach(t=>t.classList.add("hidden"));(document.getElementById("cart-errors")||document.getElementById("CartDrawer-CartErrors")).textContent=window.cartStrings.error}).finally(()=>{this.disableLoading(t)}
1)}updateLiveRegions(t,e){const r=document.getElementById(`Line-item-error-${t}`)||document.getElementById(`CartDrawer-LineItemError-${t}`);r&&(r.querySelector(".cart-item__error-text").textContent=e),this.lineItemStatusElement.setAttribute("aria-hidden",!0);const n=document.getElementById("cart-live-region-text")||document.getElementById("CartDrawer-LiveRegionText");n.setAttribute("aria-hidden",!1),setTimeout(()=>{n.setAttribute("aria-hidden",!0)},1e3)}getSectionInnerHTML(t,e){return(new DOMParser).parseFromString(t,"text/html").querySelector(e).innerHTML}enableLoading(t){(document.getElementById("main-cart-items")||document.getElementById("CartDrawer-CartItems")).classList.add("cart__items--disabled");[...this.querySelectorAll(`#CartItem-${t} .loading__spinner`),...this.querySelectorAll(`#CartDrawer-Item-${t} .loading__spinner`)].forEach(t=>t.classList.remove("hidden")),document.activeElement.blur(),this.lineItemStatusElement.setAttribute("aria-hidden",!1)}disableLoading(t){(document.getElementById("main-cart-items")||document.getElementById("CartDrawer-CartItems")).classList.remove("cart__items--disabled");const e=this.querySelectorAll(`#CartItem-${t} .loading__spinner`),r=this.querySelectorAll(`#CartDrawer-Item-${t} .loading__spinner`);e.forEach(t=>t.classList.add("hidden")),r.forEach(t=>t.classList.add("hidden"))}}customElements.define("cart-items",CartItems),customElements.get("cart-note")||customElements.define("cart-note",class extends HTMLElement{constructor(){super(),this.addEventListener("input",debounce(t=>{const e=JSON.stringify({note:t.target.value});fetch(`${routes.cart_update_url}`,{...fetchConfig(),body:e})},ON_CHANGE_DEBOUNCE_TIMER))}});
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.