PageSourceSearch

https://slamjam.com/cdn/shop/t/493/assets/cart.min.js?v=179190242832057799511784710798

js slamjam.com collected 2026-09-24 08:50:46 UTC 7,198 bytes, 1 lines download raw bytes

1class CartRemoveButton extends HTMLElement{constructor(){super(),this.addEventListener("click",e=>{e.preventDefault(),(this.closest("cart-items")||this.closest("cart-drawer-items")).updateQuantity(this.dataset.index,0),publish(PUB_SUB_EVENTS.cartRemove,{productVariantId:this.getAttribute("data-variant-id"),productHandle:this.getAttribute("data-product-handle"),index:this.getAttribute("data-index")||1}),publish(PUB_SUB_EVENTS.cartUpdate)})}}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");var e=debounce(e=>{this.onChange(e)},ON_CHANGE_DEBOUNCE_TIMER);this.addEventListener("change",e.bind(this))}cartUpdateUnsubscriber=void 0;disconnectedCallback(){this.cartUpdateUnsubscriber&&this.cartUpdateUnsubscriber()}onChange(e){e.target.dataset.index&&this.updateQuantity(e.target.dataset.index,e.target.value,document.activeElement.getAttribute("name"))}getSectionsToRender(){return[{id:"cart-items",section:document.getElementById("cart-items").dataset.id,selector:"#cart-items"},{id:"cart-icon-bubble",section:"cart-icon-bubble",selector:".shopify-section"},{id:"cart-icon-bubble-mobile",section:"cart-icon-bubble",selector:".shopify-section"},{id:"main-cart-footer",section:document.getElementById("main-cart-footer").dataset.id,selector:"#main-cart-footer"},{id:"cart-collection",section:document.getElementById("cart-collection")?.dataset.id,selector:"#cart-collection"}]}renderContents(r){this.getSectionsToRender().forEach(e=>{var t=document.getElementById(e.id)?.querySelector(e.selector)||document.getElementById(e.id);t&&(t.innerHTML=this.getSectionInnerHTML(r.sections[e.section],e.selector))});var t=document.getElementsByClassName("trustpilot-widget");for(let e=0;e<t.length;e++)window.Trustpilot.loadFromElement(t[e])}updateQuantity(n,e,o){this.enableLoading(n);e=JSON.stringify({line:n,quantity:e,sections:this.getSectionsToRender().map(e=>e.section),sections_url:window.location.pathname});fetch(""+routes.cart_change_url,{...fetchConfig(),body:e}).then(e=>e.text()).then(t=>{var t=JSON.parse(t),r=document.getElementById("Quantity-"+n)||document.getElementById("Drawer-quantity-"+n),i=document.querySelectorAll(".cart-item");if(t.errors)r.value=r.getAttribute("value"),this.updateLiveRegions(n,t.errors);else{this.classList.toggle("is-empty",0===t.item_count);var a=document.querySelector("cart-drawer"),s=document.getElementById("main-cart-footer"),s=(s&&s.classList.toggle("is-empty",0===t.item_count),a&&a.classList.toggle("is-empty",0===t.item_count),this.renderContents(t),t.items[n-1]?t.items[n-1].quantity:void 0);let e="";i.length===t.items.length&&s!==parseInt(r.value)&&(e=void 0===s?window.cartStrings.error:window.cartStrings.quantityError.replace("[quantity]",s)),this.updateLiveRegions(n,e);i=document.getElementById("CartItem-"+n)||document.getElementById("CartDrawer-Item-"+n),r=(i&&i.querySelector(`[name="${o}"]`)?a?trapFocus(a,i.querySelector(`[name="${o}"]`)):i.querySelector(`[name="${o}"]`).focus():0===t.item_count&&a?trapFocus(a.querySelector(".drawer__inner-empty"),a.querySelector("a")):document.querySelector(".cart-item")&&a&&trapFocus(a,document.querySelector(".cart-item__name")),publish(PUB_SUB_EVENTS.cartUpdate,{source:"cart-items"}),new CustomEvent("reloadCustomSelect"));window.dispatchEvent(r)}}).catch(e=>{this.querySelectorAll(".loading-overlay").forEach(e=>e.classList.add("hidden")),(document.getElementById("cart-errors")||document.getElementById("CartDrawer-CartErrors")).textContent=window.cartStrings.error}).finally(()=>{this.disableLoading(n);var e=new CustomEvent("splide-refresh");window.dispatchEvent(e)})}updateLiveRegions(e,t){e=document.getElementById("Line-item-error-"+e)||document.getElementById("CartDrawer-LineItemError-"+e);e&&(e.querySelector(".cart-item__error-text").innerHTML=t),this.lineItemStatusElement.setAttribute("aria-hidden",!0);const r=document.getElementById("cart-live-region-text")||document.getElementById("CartDrawer-LiveRegionText");r.setAttribute("aria-hidden",!1),setTimeout(()=>{r.setAttribute("aria-hidden",!0)},1e3)}getSectionInnerHTML(e,t){return(new DOMParser).parseFromString(e,"text/html").querySelector(t).innerHTML}enableLoading(e){(document.getElementById("main-cart-items")||document.getElementById("CartDrawer-CartItems")).classList.add("cart__items--disabled");var t=this.querySelectorAll(`#CartItem-${e} .loading-overlay`),e=this.querySelectorAll(`#CartDrawer-Item-${e} .loading-overlay`);
1[...t,...e].forEach(e=>e.classList.remove("hidden")),document.activeElement.blur(),this.lineItemStatusElement.setAttribute("aria-hidden",!1)}disableLoading(e){(document.getElementById("main-cart-items")||document.getElementById("CartDrawer-CartItems")).classList.remove("cart__items--disabled");var t=this.querySelectorAll(`#CartItem-${e} .loading-overlay`),e=this.querySelectorAll(`#CartDrawer-Item-${e} .loading-overlay`);t.forEach(e=>e.classList.add("hidden")),e.forEach(e=>e.classList.add("hidden"))}}customElements.define("cart-items",CartItems),customElements.get("cart-note")||customElements.define("cart-note",class extends HTMLElement{constructor(){super(),this.addEventListener("change",debounce(e=>{e=JSON.stringify({note:e.target.value});fetch(""+routes.cart_update_url,{...fetchConfig(),body:e})},ON_CHANGE_DEBOUNCE_TIMER))}});class CartItem extends HTMLElement{constructor(){super(),new WishlistCartVariantRadios(this)}showEditVariant(){1024<window.innerWidth?(this.querySelectorAll(".cart-item__details").forEach(e=>e.classList.add("hide")),this.querySelector(".variant-change").classList.remove("hide")):(this.querySelector(".variant-drawer").classList.remove("hide"),document.body.classList.add("overflow-hidden"))}closeEditVariant(){this.querySelectorAll(".cart-item__details").forEach(e=>e.classList.remove("hide")),this.querySelector(".variant-change").classList.add("hide"),this.querySelector(".variant-drawer").classList.add("hide"),document.body.classList.remove("overflow-hidden")}}customElements.define("cart-item",CartItem);class DeliveryPopup extends HTMLElement{constructor(){super()}connectedCallback(){var e=Array.from(document.querySelectorAll("cart-items cart-item"));if(!(e<2)){const i="S02WSN";let t=!1,r=!1;e.forEach(e=>{e=e.getAttribute("data-available-locations").split(",").filter(e=>e.length);if(e.length)return e.includes(i)?t=!0:void(e.includes(i)||(r=!0))}),t&&r&&(document.body.classList.add("lock-scroll"),this.modal=this.querySelector(".modal-popup"),this.modal.classList.add("visible"))}}close(){document.body.classList.remove("lock-scroll"),this.modal.classList.remove("visible")}}customElements.define("delivery-popup",DeliveryPopup);class CartCollection extends HTMLElement{constructor(){super(),this.handleShow(),new Splide(this.querySelector(".cart-drawer-collection__splider")).mount()}handleShow(){const t=this.querySelectorAll(".splide__slide ")?.length;document.querySelectorAll(".cart-drawer-collection").forEach(e=>{t?e.classList.remove("hide"):e.classList.add("hide")})}}customElements.define("cart-drawer-collection",CartCollection);

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.