1const REBUY_SETTLE_MS=250,POPUP_SLIDE_MS=1e3;document.addEventListener("DOMContentLoaded",()=>{document.addEventListener("rebuy:cart.add",event=>{if(atcPopupMobileAndDesktop)Rebuy.SmartCart.skip_open=!0,setTimeout(()=>{window.Rebuy.SmartCart.hide();const cart=event.detail;updatePopUp(cart),document.querySelectorAll(".cart_count_item").forEach(item=>{item.innerText=Rebuy.Cart.itemCount()})},250);else{let windowWidth=window.innerWidth;windowWidth<=768?Rebuy.SmartCart.skip_open=!0:Rebuy.SmartCart.skip_open=!1,window.addEventListener("resize",()=>{windowWidth=window.innerWidth,windowWidth<=768?Rebuy.SmartCart.skip_open=!0:Rebuy.SmartCart.skip_open=!1}),setTimeout(()=>{if(windowWidth<=768){window.Rebuy.SmartCart.hide();const cart=event.detail;updatePopUp(cart)}document.querySelectorAll(".cart_count_item").forEach(item=>{item.innerText=Rebuy.Cart.itemCount()})},250)}})});function updatePopUp(cart){const product=cart.item,productImage=product.image,productTitle=product.product_title,productPrice=product.price,productVariant=product.variant_options,cartTotal=Rebuy.Cart.subtotal();let threshold=15e3;Shopify.currency.active==="USD"||(threshold=threshold*Shopify.currency.rate);const percentage=cartTotal/threshold*100,popUp=document.querySelector("#custom-atc-popup");popUp.querySelector("#product-title-price #title").innerText="",popUp.querySelector("#product-title-price #price").innerText="",popUp.querySelector("#attributes").innerHTML="",popUp.querySelector("#product-image img").src=productImage,popUp.querySelector("#product-image img").title=productTitle,popUp.querySelector("#product-title-price #title").innerText=productTitle,popUp.querySelector("#product-title-price #price").innerText=formatMoney(productPrice);let variantContainer=document.createElement("div");if(variantContainer.classList.add("variant-container"),productVariant.forEach(variant=>{let div=document.createElement("div");div.classList.add("variant"),div.innerText=variant,variantContainer.appendChild(div)}),popUp.querySelector("#attributes").append(variantContainer),popUp.querySelector("#shipping-threshold #percentage").style.width=percentage.toFixed(0)+"%",popUp.querySelector("#shipping-threshold #percentage").setAttribute("data-percentage",percentage.toFixed(0)),cartTotal>=threshold)popUp.querySelector("#shipping-threshold-message").innerText="You've reached free shipping!";else{let currency=Shopify.currency.active;popUp.querySelector("#shipping-threshold-message").innerText=`You're spending ${formatMoney(threshold-cartTotal)}${Shopify.currency.active=="USD"?"":" "+currency} away from free shipping!`}Shopify.customerPrivacy.getRegion().includes("US")&&(popUp.querySelector("#shipping-threshold").style.display="block",console.log("Alex: US ",Shopify.customerPrivacy.getRegion())),popUp.style.display="block",requestAnimationFrame(()=>{requestAnimationFrame(()=>{popUp.classList.add("show"),popUp.style.opacity=1})}),setTimeout(()=>{popUp.style.opacity=0,popUp.classList.remove("show"),setTimeout(()=>{popUp.style.display="none"},1300)},3e3)}function formatMoney(cents){if(window.Shopify&&typeof window.Shopify.formatMoney=="function"){const moneyFormat=window.Shopify.money_format||window.Shopify.moneyFormat;if(moneyFormat)return window.Shopify.formatMoney(cents,moneyFormat)}return"$"+((Number(cents)||0)/100).toFixed(2)} 2//# sourceMappingURL=/cdn/shop/t/283/assets/custom-rebuy-ux.js.map?v=134228870041431229291788577393
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.