1class recordRecentlyViewedProducts extends HTMLElement{constructor(){super(),this.name="minion_recently_viewed",this.recordRecentlyViewed()}config(){return{howManyToStoreInMemory:Number(this.getAttribute("data-count"))+1,settings:this.getAttribute("data-settings")}}setCookie(name,value,days){var expires="";if(days){var date=new Date;date.setTime(date.getTime()+days*24*60*60*1e3),expires="; expires="+date.toUTCString()}document.cookie=name+"="+(value||"")+expires+"; path=/"}getCookie(name){for(var nameEQ=name+"=",ca=document.cookie.split(";"),i=0;i<ca.length;i++){for(var c=ca[i];c.charAt(0)==" ";)c=c.substring(1,c.length);if(c.indexOf(nameEQ)==0){var arr=c.substring(nameEQ.length,c.length);return arr.split(" ")}}return[]}recordRecentlyViewed(){var config=this.config(),recentlyViewed=this.getCookie(this.name);if(window.location.pathname.indexOf("/products/")!==-1){var productHandle=document.querySelector("[data-product-handle]").getAttribute("data-product-handle"),position=-1;recentlyViewed&&(position=recentlyViewed.indexOf(productHandle)),position===-1?(recentlyViewed.unshift(productHandle),recentlyViewed=recentlyViewed.splice(0,config.howManyToStoreInMemory)):(recentlyViewed.splice(position,1),recentlyViewed.unshift(productHandle)),this.setCookie(this.name,recentlyViewed.join(" "),1)}}}class recentlyViewedProducts extends recordRecentlyViewedProducts{constructor(){super();var currentproducts=this.getCookie(this.name);if(!(currentproducts.length<=1)){if(window.location.pathname.indexOf("/products/")!==-1){var productHandle=document.querySelector("[data-product-handle]").getAttribute("data-product-handle"),index=currentproducts.indexOf(productHandle);index!==-1&¤tproducts.splice(index,1)}currentproducts=currentproducts.join("||"),this.getProducts(currentproducts)}}getProducts(currentproducts){var _this=this;fetch(`${window.routes.collections_url}/all?view=ajax_recently_viewed&sort_by=${currentproducts}||${this.config().settings}`).then(response=>response.text()).then(responseText=>{if(responseText!=""){_this.classList.remove("hide");var html=_this.querySelector(".recently-viewed-products-content").innerHTML;_this.querySelector(".recently-viewed-products-content").innerHTML=html+responseText,initImageScale()}})}}customElements.define("recently-viewed-products",recentlyViewedProducts),!document.querySelector("recently-viewed-products")&&customElements.define("recently-viewed-products-record",recordRecentlyViewedProducts); 2//# sourceMappingURL=/cdn/shop/t/25/assets/component-recently-viewed-products.js.map?v=78366560556915995431779581870
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.