PageSourceSearch

https://twillory.com/cdn/shop/t/1072/assets/cart-navigation-blocker.js?v=158576862865573154921771497966

js twillory.com collected 2026-10-03 19:32:24 UTC 2,426 bytes, 2 lines download raw bytes

1document.addEventListener("click",async function(e){const button=e.target.closest(".order_custom, #pre_order_custom");if(button){e.preventDefault(),e.stopImmediatePropagation();const qtyInput=document.querySelector(".quantity__input");if(!qtyInput)return;const variantId=qtyInput.getAttribute("data-quantity-variant-id"),quantity=parseInt(qtyInput.value,10);if(!variantId||isNaN(quantity))return;const buttonText=button.querySelector("span.pre-order-2-button").textContent.trim();button.disabled=!0;try{const currentCart=await(await fetch(`${FoxTheme.routes.cart_url}`,{...FoxTheme.utils.fetchConfig()})).json(),existingItemIndex=currentCart.items.findIndex(item=>item.variant_id===parseInt(variantId)),existingItem=existingItemIndex!==-1?currentCart.items[existingItemIndex]:null;let sectionsToBundle=[];document.documentElement.dispatchEvent(new CustomEvent("cart:grouped-sections",{bubbles:!0,detail:{sections:sectionsToBundle}}));let body;existingItem?body=JSON.stringify({line:existingItemIndex+1,quantity:existingItem.quantity+quantity,properties:{[buttonText]:existingItem.quantity+quantity},sections:sectionsToBundle,sections_url:window.location.pathname}):body=JSON.stringify({items:[{id:parseInt(variantId),quantity,properties:{[buttonText]:quantity}}],sections:sectionsToBundle,sections_url:window.location.pathname});const endpoint=existingItem?`${FoxTheme.routes.cart_change_url}`:`${FoxTheme.routes.cart_add_url}`,parsedState=await(await fetch(endpoint,{...FoxTheme.utils.fetchConfig("javascript"),body})).json();if(parsedState.status){console.error("Error adding to cart:",parsedState.description);return}const cartJson=await(await fetch(`${FoxTheme.routes.cart_url}`,{...FoxTheme.utils.fetchConfig()})).json();if(parsedState.sections&&(cartJson.sections=parsedState.sections),window.FoxTheme&&window.FoxTheme.pubsub)try{window.FoxTheme.pubsub.publish(window.FoxTheme.pubsub.PUB_SUB_EVENTS.cartUpdate,{cart:cartJson})}catch(error){console.warn("Cart update event error:",error)}const cartDrawer=document.querySelector("cart-drawer");cartDrawer&&cartDrawer.show(),document.documentElement.classList.add("cart-has-items"),document.dispatchEvent(new CustomEvent("product-ajax:added",{detail:{product:parsedState}}))}catch(err){console.error("Error adding to cart:",err)}finally{button.disabled=!1}}},!0);
2//# sourceMappingURL=/cdn/shop/t/1072/assets/cart-navigation-blocker.js.map?v=158576862865573154921771497966

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.