1class WlmThemeSearch{constructor(){var _this=this;window.wlm_local_data==null&&(window.wlm_local_data={}),_this.observeSearch()}customFind(arr,callback){for(var i=0;i<arr.length;i++){var match=callback(arr[i]);if(match)return arr[i]}}saveWLMHideProductLocally(json){window.wlm_local_data.hideProductPayload?json.products.length&&(window.wlm_local_data.hideProductPayload.products=[].concat(window.wlm_local_data.hideProductPayload.products,json.products)):window.wlm_local_data.hideProductPayload=json}hideShowLoader(loader){try{loader?document.getElementById("wlm-loader-container").style.display="block":document.getElementById("wlm-loader-container").style.display="none"}catch(e){console.log("wlm- ",e)}}getHandleFromProductUrl(url=null){url===null&&(url=currentUrl());const tempEl=document.createElement("a");tempEl.href=url;const matches=tempEl.pathname.match("/products/(.*)");return matches&&matches.length>1&&matches[1]}getProductListFromSearch(){var _this=this;const productList=[];if(document.querySelector("."+window.WLM_Theme_Default_Search_List_container)===null)return[];const products=document.querySelectorAll("."+window.WLM_Theme_Default_Search_List_container);for(let productNode of products)try{const productNameAnchorEl=productNode;if(productNameAnchorEl!=null){const handle=_this.getHandleFromProductUrl(productNameAnchorEl.href);productList.push(handle)}}catch(e){console.log("wlm -",e)}return productList}getThemeProductsContainer(){return document.querySelectorAll("."+window.WLM_Theme_Default_Search_List_container)}RemoveHideProducts(){var _this=this;let SearchProductsContainer=_this.getThemeProductsContainer(),products=[];products=_this.getProductListFromSearch(),products.forEach(function(product){var isHide=_this.customFind(window.wlm_local_data.hideProductPayload.products,function(LocalProduct){return product==LocalProduct.handle});if(isHide==null)for(var i=0;i<SearchProductsContainer.length;i++){let isRemoveContainer=!1,aTagContainers=[];try{aTagContainers=SearchProductsContainer[i]}catch(e){aTagContainers=[],console.log(e)}let handle=aTagContainers.href.split("/");handle=handle[handle.length-1],handle=handle.split("?"),handle=handle[0],product==handle&&(isRemoveContainer=!0),isRemoveContainer&&SearchProductsContainer[i].remove()}}),_this.hideShowLoader(!1)}checkIsProductHide(handles=[]){var _this=this;if(_this.hideShowLoader(!0),!handles||!handles.length){_this.hideShowLoader(!1);return}const filteredHandles=handles.filter(handle=>window.wlm_local_data.hideProductPayload?handle?_this.customFind(window.wlm_local_data.hideProductPayload.products,function(product){return product.handle==handle})==null:!1:!0);if(filteredHandles.length===0)return _this.RemoveHideProducts(),Promise.resolve();const maxHandleLimit=20;let from=0,left=filteredHandles.length,to=maxHandleLimit;do{const url=`/search?view=wlm-api&handle=${filteredHandles.slice(from,to).join(",")}`;var xhttp=new XMLHttpRequest;xhttp.onreadystatechange=function(){if(this.readyState==4&&this.status==200){var json=JSON.parse(this.responseText);_this.saveWLMHideProductLocally(json)}},xhttp.open("GET",url,!1),xhttp.send(),from=to,to+=maxHandleLimit,left-=maxHandleLimit}while(left>=0);_this.RemoveHideProducts()}currentUrl(){return window.location.toString()}observeSearch(){var _this=this;let SearchObserverTimeout=setInterval(function(){let SearchContainer=null;if(SearchContainer=document.querySelectorAll("."+window.WLM_Theme_Default_Search_main_container),console.log("wlm - finding"),SearchContainer!=null){console.log("wlm - found"),clearInterval(SearchObserverTimeout);const observerSearch=new MutationObserver(mutations=>{let products=_this.getProductListFromSearch();console.log("wlm- ",products);for(var SearchResultsNodes=document.querySelectorAll("."+window.WLM_Theme_Default_Search_List_container),iw=0;iw<SearchResultsNodes.length;iw++)SearchResultsNodes[iw].style.display="none";for(_this.checkIsProductHide(products),iw=0;iw<SearchResultsNodes.length;iw++)SearchResultsNodes[iw].style.display="block";SearchResultsNodes.length==0?document.querySelector("."+window.WLM_Theme_Default_Search_main_container).style.display="none":document.querySelector("."+window.WLM_Theme_Default_Search_main_container).style.display="block"});for(var j=0;j<SearchContainer.length;j++)observerSearch.observe(SearchContainer[j],{subtree:!0,childList:!0})}},100)}}var WLMThemeDefaultSearchPopup=new WlmThemeSearch; 2//# sourceMappingURL=/cdn/shop/t/16/assets/wlm-theme-search.js.map?v=72579033475856342581742598987
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.