PageSourceSearch

https://www.cryptomaniaclothing.com/cdn/shop/t/19/assets/cart.js?v=69120679253779524331782138370

js cryptomaniaclothing.com collected 2026-10-04 02:15:57 UTC 3,816 bytes, 2 lines download raw bytes

1if(!customElements.get("theme-cart")){class ThemeCart extends HTMLElement{connectedCallback(){this._initialized||(this._initialized=!0,this.setupEventListeners())}disconnectedCallback(){document.removeEventListener("cart:refresh",this._onCartRefresh)}onChange(event){event.target.type==="number"?this.updateQuantity(event.target.dataset.index,event.target.value):event.target.id==="CartSpecialInstructions"&&this.saveNotes()}saveNotes(){fetch(`${theme.routes.cart_update_url}.js`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({note:document.getElementById("CartSpecialInstructions").value})})}setupEventListeners(){this.removeProductEvent(),this.debouncedOnChange=debounce(this.onChange.bind(this),300),this._onCartRefresh=()=>this.refresh(),document.addEventListener("cart:refresh",this._onCartRefresh),this.addEventListener("change",this.debouncedOnChange)}getSectionsToRender(){return[{id:"Cart",section:"main-cart",selector:".thb-cart-form"},{id:"cart-drawer-toggle",section:"cart-bubble",selector:".thb-item-count"}]}displayErrors(line,message){const lineItemError=document.getElementById(`Line-item-error-${line}`)||document.getElementById(`CartDrawer-LineItemError-${line}`);lineItemError&&(lineItemError.removeAttribute("hidden"),lineItemError.querySelector(".cart-item__error-text").innerHTML=message,this.querySelector(`#CartItem-${line}`).classList.remove("loading"))}getSectionInnerHTML(html,selector){return new DOMParser().parseFromString(html,"text/html").querySelector(selector).innerHTML}updateQuantity(line,quantity){this.classList.add("cart-disabled"),line&&this.querySelector(`#CartItem-${line}`).classList.add("loading");const body=JSON.stringify({line,quantity,sections:this.getSectionsToRender().map(section=>section.section),sections_url:window.location.pathname});dispatchCustomEvent("line-item:change:start",{quantity}),fetch(`${theme.routes.cart_change_url}`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body}).then(response=>response.text()).then(state=>{const parsedState=JSON.parse(state),quantityElements=document.querySelectorAll(`.qty-cart-${line}`);if(parsedState.errors){quantityElements.forEach(quantityElement=>{quantityElement.value=quantityElement.getAttribute("value")}),this.displayErrors(line,parsedState.errors),this.classList.remove("cart-disabled");return}this.renderContents(parsedState,line,!1),this.classList.remove("cart-disabled"),dispatchCustomEvent("line-item:change:end",{quantity,cart:parsedState})})}refresh(){this.classList.add("cart-disabled"),fetch(`${window.location.pathname}/?sections=main-cart`).then(response=>response.text()).then(state=>{const parsedState=JSON.parse(state);if(parsedState.errors){this.classList.remove("cart-disabled");return}this.renderContents(parsedState,!1,!0),this.classList.remove("cart-disabled")})}removeProductEvent(){this.querySelectorAll(".remove").forEach(remove=>{remove.addEventListener("click",event=>{this.updateQuantity(event.target.dataset.index,"0"),event.preventDefault()})})}renderContents(parsedState,line,refresh){this.getSectionsToRender().forEach(section=>{const elementToReplace=document.getElementById(section.id).querySelector(section.selector)||document.getElementById(section.id);refresh?parsedState[section.section]&&(elementToReplace.innerHTML=this.getSectionInnerHTML(parsedState[section.section],section.selector)):elementToReplace.innerHTML=this.getSectionInnerHTML(parsedState.sections[section.section],section.selector)}),this.removeProductEvent(),line&&this.querySelector(`#CartItem-${line}`)&&this.querySelector(`#CartItem-${line}`).classList.remove("loading")}}customElements.define("theme-cart",ThemeCart)}
2//# sourceMappingURL=/cdn/shop/t/19/assets/cart.js.map?v=69120679253779524331782138370

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.