1document.addEventListener("DOMContentLoaded",()=>{const stickyContainer=document.querySelector(".custom-atc_wrapper"),atcButtons=document.querySelector(".main_atc"),customPdpWrapper=document.querySelector(".custom_pdp_wrapper"),footer=document.querySelector("footer"),isMobile=window.matchMedia("(max-width: 768px)").matches;stickyContainer.style.display="none";const hideSticky=()=>{stickyContainer.style.display="none",stickyContainer.classList.remove("sticky")},showSticky=()=>{stickyContainer.style.display="block",stickyContainer.classList.add("sticky")};let footerInView=!1;const observer=new IntersectionObserver(entries=>{entries.forEach(entry=>{footerInView=entry.isIntersecting,footerInView?hideSticky():window.scrollY>customPdpWrapper.offsetTop+customPdpWrapper.offsetHeight&&showSticky()})},{rootMargin:"0px",threshold:.1});footer&&observer.observe(footer),isMobile?window.addEventListener("scroll",()=>{customPdpWrapper.getBoundingClientRect().bottom-400<=0&&!footerInView?(atcButtons.style.display="none",showSticky()):(atcButtons.style.display="block",hideSticky())}):(atcButtons.style.display="block",window.addEventListener("scroll",()=>{customPdpWrapper.getBoundingClientRect().bottom<=0&&!footerInView?(atcButtons.style.display="none",showSticky()):(atcButtons.style.display="block",hideSticky())}))}),document.addEventListener("DOMContentLoaded",function(){const dropdownToggle=document.getElementById("dropdownToggle"),dropdown=document.querySelector(".custom-dropdown");dropdownToggle.addEventListener("click",function(){dropdown.classList.toggle("open")}),document.addEventListener("click",function(event){dropdown.contains(event.target)||dropdown.classList.remove("open")});const selectedText=document.getElementById("dropdownSelectedText"),dropdownItems=document.querySelectorAll(".custom-dropdown .dropdown-item");dropdownItems.forEach(function(item){item.addEventListener("click",function(){const handle=item.getAttribute("data-handle"),itemImg=item.querySelector("img"),flavourText=item.querySelector(".flavour_name");if(dropdownItems.forEach(function(el){el.classList.remove("active")}),this.classList.add("active"),itemImg&&flavourText&&(selectedText.innerHTML=` 2 <img src="${itemImg.src}" alt="${itemImg.alt}"> 3 <span class="selected_flavour">${flavourText.textContent}</span> 4 `),handle){if(console.log("Handle updated:",handle),updateProductMediaByHandle(handle.replace("/fr","")),fetchProductMetafields(handle.replace("/fr","")),handle.includes("/fr")){var productHandle=this.getAttribute("data-handle").replace("/fr",""),newUrl="/fr/products/"+productHandle;console.log(newUrl)}else var productHandle=this.getAttribute("data-handle"),newUrl="/products/"+productHandle;window.history.pushState({},"",newUrl),console.log(productHandle)}else console.warn("No product handle found on clicked item.");dropdown.classList.remove("open")})})});function redirectToLink(url){url&&(window.location.href=url)}document.querySelectorAll('input[name="purchase-type"]').forEach(input=>{input.addEventListener("change",function(){console.log(`Selected option: ${this.value}`)})});const metafieldsMap=JSON.parse(document.getElementById("variant-metafields-json").textContent),ctaContainer=document.querySelector(".atc_buttons");document.addEventListener("change",function(e){if(e.target.name==="id"){const variantId=e.target.value,data=metafieldsMap[variantId],buyNowButton=document.getElementById("buy-now-button"),addToCartButton=document.querySelector(".redirect_atc_hide");data?.enable_redirect&&data?.redirect_link?(buyNowButton.classList.remove("hidden"),addToCartButton.classList.add("hidden"),buyNowButton.href=data.redirect_link):(buyNowButton.classList.add("hidden"),addToCartButton.classList.remove("hidden"))}}); 5//# sourceMappingURL=/cdn/shop/t/79/assets/custom_pdp.js.map?v=151968470149057143641773039624
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.