1window.Eurus.loadedScript.includes("product-recommendations.js")||(window.Eurus.loadedScript.push("product-recommendations.js"),requestAnimationFrame(()=>{document.addEventListener("alpine:init",()=>{Alpine.store("xProductRecommendations",{loading:!1,listOfUpsellProducts:[],el:"",listUpsellId:[],productCount:0,async loadUpsell(el,url,listId,limit,maxItems){this.el=el,this.loading=!0,this.listOfUpsellProducts=[],this.productCount=0,this.listUpsellId=[];for(let i=0;i<listId.length&&!(this.productCount>=maxItems);i++)try{const text=await(await fetch(`${url}&product_id=${listId[i]}&limit=${limit}&intent=related`)).text(),html=document.createElement("div");html.innerHTML=text;const des=document.querySelector(".cart-upsell-carousel"),src=html.querySelector(".cart-upsell-carousel");src&&des&&(des.innerHTML=src.innerHTML);const recommendations=html.querySelector(".product-recommendations");if(recommendations&&recommendations.innerHTML.trim().length){const newUpsellProducts=recommendations.querySelectorAll('template[x-teleport="#cart-upsell-drawer"], template[x-teleport="#cart-upsell"]');this.listOfUpsellProducts=[...newUpsellProducts,...this.listOfUpsellProducts];for(let index=0;index<this.listOfUpsellProducts.length&&!(this.productCount>=maxItems);index++){const element=this.listOfUpsellProducts[index],elementId=new DOMParser().parseFromString(element.innerHTML,"text/html").querySelector(".hover-text-link, .link-product-variant").id;this.listUpsellId.includes(elementId)||(this.listUpsellId.push(elementId),el.appendChild(element),this.productCount++)}recommendations.classList.contains("main-product")&&(el.className+=" mb-4 md:mb-6 border-y border-solid accordion empty:border-b-0")}else recommendations&&recommendations.classList.contains("main-product")&&(recommendations.classList.add("hidden"),el.innerHTML=recommendations.innerHTML)}catch(e){console.error(e)}finally{this.loading=!1}},load(el,url){this.loading=!0,fetch(url).then(response=>response.text()).then(text=>{const html=document.createElement("div");html.innerHTML=text;const recommendations=html.querySelector(".product-recommendations");recommendations&&recommendations.innerHTML.trim().length?(requestAnimationFrame(()=>{el.innerHTML=recommendations.innerHTML}),recommendations.classList.contains("main-product")&&(el.className+=" mb-4 md:mb-6 border-y border-solid accordion empty:border-b-0")):recommendations.classList.contains("main-product")&&(recommendations.classList.add("hidden"),el.innerHTML=recommendations.innerHTML)}).finally(()=>{this.loading=!1}).catch(e=>{console.error(e)})}})})})); 2//# sourceMappingURL=/cdn/shop/t/4/assets/product-recommendations.js.map?v=34614423222916566501747335364
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.