PageSourceSearch

https://janelushka.nl/cdn/shop/t/159/assets/cart.js?v=47885011700822295861787500608

js janelushka.nl collected 2026-10-07 00:59:41 UTC 3,975 bytes, 2 lines download raw bytes

1function fetchConfig(type="json"){return{method:"POST",headers:{"Content-Type":"application/json",Accept:`application/${type}`}}}class CartRemoveButton extends HTMLElement{constructor(){super();this.addEventListener("click",(event=>{event.preventDefault();this.closest("cart-items").updateQuantity(this.dataset.index,0)}))}}if(!customElements.get("cart-remove-button")){customElements.define("cart-remove-button",CartRemoveButton)}class CartItems extends HTMLElement{constructor(){super();this.lineItemStatusElement=document.getElementById("shopping-cart-line-item-status");this.currentItemCount=Array.from(this.querySelectorAll('[name="updates[]"]')).reduce(((total,quantityInput)=>total+parseInt(quantityInput.value)),0);this.debouncedOnChange=debounce((event=>{this.onChange(event)}),300);this.addEventListener("change",this.debouncedOnChange.bind(this))}onChange(event){this.updateQuantity(event.target.dataset.index,event.target.value,document.activeElement.getAttribute("name"))}getSectionsToRender(){return[{id:"main-cart-items",section:document.getElementById("main-cart-items").dataset.id,selector:".js-cart-item-contents"},{id:"main-cart-footer",section:document.getElementById("main-cart-footer").dataset.id,selector:".js-cart-footer-contents"},{id:"cart-icon-bubble",section:"cart-icon-bubble",selector:"[data-cart-icon-bubble]"}]}updateQuantity(line,quantity,name){this.enableLoading(line);const body=JSON.stringify({line,quantity,sections:this.getSectionsToRender().map((section=>section.section)),sections_url:window.location.pathname});fetch(`${routes.cart_change_url}`,{...fetchConfig(),...{body}}).then((response=>response.json())).then((parsedState=>{if("errors"in parsedState){let quantityElement=document.getElementById(`Quantity-${line}`);quantityElement.value=quantityElement.getAttribute("value");throw new Error(parsedState.errors)}if("sections"in parsedState==false)return;this.classList.toggle(parsedState.sections["cart-drawer"]?"cart-drawer-is-empty":"is-empty",parsedState.item_count===0);document.getElementById("main-cart-footer")?.classList.toggle("is-empty",parsedState.item_count===0);this.getSectionsToRender().forEach((section=>{const elementToReplace=document.getElementById(section.id).querySelector(section.selector)||document.getElementById(section.id);elementToReplace.innerHTML=this.getSectionInnerHTML(parsedState.sections[section.section],section.selector)}));this.updateLiveRegions(line,parsedState.item_count);document.getElementById(`CartItem-${line}`)?.querySelector(`[name="${name}"]`)?.focus()})).catch((error=>{console.log(error);if(error.message==""){error.message=window.cartStrings.error}document.getElementById("cart-errors").textContent=error.message})).finally((()=>{document.querySelector(".loading-overlay").classList.add("hidden");this.disableLoading()}))}updateLiveRegions(line,itemCount){if(this.currentItemCount===itemCount){document.getElementById(`Line-item-error-${line}`).querySelector(".cart-item__error-text").innerHTML=window.cartStrings.quantityError.replace("[quantity]",document.getElementById(`Quantity-${line}`).value)}this.currentItemCount=itemCount;this.lineItemStatusElement.setAttribute("aria-hidden",true);const cartStatus=document.getElementById("cart-live-region-text");cartStatus.setAttribute("aria-hidden",false);setTimeout((()=>{cartStatus.setAttribute("aria-hidden",true)}),1e3)}getSectionInnerHTML(html,selector){return(new DOMParser).parseFromString(html,"text/html").querySelector(selector).innerHTML}enableLoading(line){document.getElementById("main-cart-items").classList.add("cart__items--disabled");document.querySelector(".loading-overlay").classList.remove("hidden");document.activeElement.blur();this.lineItemStatusElement.setAttribute("aria-hidden",false)}disableLoading(){document.getElementById("main-cart-items").classList.remove("cart__items--disabled")}}if(!customElements.get("cart-items")){customElements.define("cart-items",CartItems)}
2//# sourceMappingURL=cart.js.map

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.