1(function(){"use strict";function initializeAddToCartButtons(container){container=container||document,container.querySelectorAll(".product-card-add-to-cart:not([data-cart-initialized])").forEach(function(button){button.setAttribute("data-cart-initialized","true"),button.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation();const variantId=button.dataset.variantId,productTitle=button.dataset.productTitle;if(!(button.dataset.variantAvailable==="true")||button.disabled||button.classList.contains("adding-to-cart"))return;const addText=button.querySelector(".add-to-cart-text"),loadingText=button.querySelector(".add-to-cart-loading");button.classList.add("adding-to-cart"),button.disabled=!0,addText&&(addText.style.display="none"),loadingText&&(loadingText.style.display="inline");const formData=new FormData;formData.append("id",variantId),formData.append("quantity","1"),fetch("/cart/add.js",{method:"POST",body:formData}).then(function(response){if(!response.ok)throw new Error("Network response was not ok");return response.json()}).then(function(data){document.dispatchEvent(new CustomEvent("ajaxProduct:added",{bubbles:!0,detail:{product:data,addToCartBtn:button,quantity:1}})),["cart:item-added","cart:updated","product:added-to-cart"].forEach(eventName=>{document.dispatchEvent(new CustomEvent(eventName,{bubbles:!0,detail:{product:data,variant:data,quantity:1,addToCartBtn:button}}))}),window.theme&&typeof window.theme.cartCount=="function"&&window.theme.cartCount(),addText&&(addText.textContent="Added!",addText.style.display="inline"),loadingText&&(loadingText.style.display="none"),setTimeout(function(){window.theme&&window.theme.CartDrawer&&typeof window.theme.CartDrawer.open=="function"&&window.theme.CartDrawer.open()},100),setTimeout(function(){addText&&(addText.textContent="Add To Cart")},1500)}).catch(function(error){console.error("Error adding to cart:",error),addText&&(addText.textContent="Error",addText.style.display="inline"),loadingText&&(loadingText.style.display="none"),setTimeout(function(){addText&&(addText.textContent="Add To Cart")},2e3)}).finally(function(){setTimeout(function(){button.classList.remove("adding-to-cart"),button.disabled=!1},1e3)})})})}function onContentChange(){initializeAddToCartButtons()}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",onContentChange):onContentChange(),document.addEventListener("shopify:section:load",onContentChange),window.addEventListener("popstate",onContentChange);const mainContent=document.querySelector("main#main-content")||document.body;new MutationObserver(function(mutations){mutations.forEach(function(mutation){mutation.type==="childList"&&mutation.addedNodes.length>0&&mutation.addedNodes.forEach(function(node){node.nodeType===Node.ELEMENT_NODE&&node.querySelector(".product-card-add-to-cart")&&initializeAddToCartButtons(node)})})}).observe(mainContent,{childList:!0,subtree:!0}),window.initializeProductCardButtons=initializeAddToCartButtons})(); 2//# sourceMappingURL=/cdn/shop/t/44/assets/add-to-cart.js.map?v=72179882703973720341788434122
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.