1(function(){const productCard=(current_product,productIndex)=>{var addButton_sidecart_upsell=current_product.querySelector("[data-upsell-product-id]");const variantSelector=current_product.querySelector(".upsell-product-variant-selector");if(!addButton_sidecart_upsell){console.log("Add to cart button not found.");return}let selectedVariantId=variantSelector?variantSelector.options[variantSelector.selectedIndex].getAttribute("data-variant"):null,selectedVariantPrice=variantSelector?variantSelector.options[variantSelector.selectedIndex].getAttribute("data-variant-price"):null;variantSelector&&!variantSelector.dataset.eventAssigned&&(updateButtonState(),variantSelector.addEventListener("change",function(){selectedVariantId=this.options[this.selectedIndex].getAttribute("data-variant"),selectedVariantPrice=this.options[this.selectedIndex].getAttribute("data-variant-price"),updateButtonState()}),variantSelector.dataset.eventAssigned=!0);function updateButtonState(){variantSelector.options[variantSelector.selectedIndex].getAttribute("data-variant-available")==="true"?(addButton_sidecart_upsell.disabled=!1,addButton_sidecart_upsell.textContent="ADICIONAR"):(addButton_sidecart_upsell.disabled=!0,addButton_sidecart_upsell.textContent="N\xC3O DISPON\xCDVEL")}const uniqueEventKey=`upsellClick${productIndex}`;if(!addButton_sidecart_upsell.dataset[uniqueEventKey]){let handleAddToCart2=function(){variantSelector.options[variantSelector.selectedIndex].getAttribute("data-variant-available")==="true"&&selectedVariantId?addToCart(selectedVariantId,selectedVariantPrice):console.log("Please select a variant before adding to cart.")};var handleAddToCart=handleAddToCart2;addButton_sidecart_upsell.addEventListener("click",handleAddToCart2),addButton_sidecart_upsell.dataset[uniqueEventKey]=!0}};function addToCart(itemId,itemPrice){jQ.ajax({type:"POST",url:"/cart/add.js",data:{quantity:1,id:itemId},dataType:"json",success:function(data){jQ.ajax({type:"GET",dataType:"json",url:"/cart.json",success:function(cart){updateUpsellItems(),jQ(".navigation__item--cart-count").text(cart.item_count),getCart();var drawerCart=document.querySelector("#drawer-cart");drawerCart.dispatchEvent(new CustomEvent("product:addToCart",{detail:{productID:itemId,productPrice:itemPrice}})),drawerCart.dispatchEvent(new CustomEvent("product:added",{detail:{}}))}})}})}window.updateUpsellItems=function(){jQ.ajax({url:"/cart",dataType:"html",success:function(data){var newUpsellContent=jQ(data).find(".drawer_cart_upsell").html();jQ(".drawer_cart_upsell").html(newUpsellContent),productSlider();var upsellProducts=document.querySelectorAll(".drawer_cart_upsell .product-slider__item__upsell");upsellProducts.forEach(function(current_product,index){productCard(current_product,index)})},error:function(){console.error("Error al recargar el upsell.")}})},window.addEventListener("load",function(){var upsellProducts=document.querySelectorAll(".drawer_cart_upsell .product-slider__item__upsell");upsellProducts.forEach(function(current_product,index){productCard(current_product,index)})})})(); 2//# sourceMappingURL=/cdn/shop/t/41/assets/component-product-card-upsell.js.map?v=76739415968190737151776245274
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.