PageSourceSearch

https://www.glamnetic.com/cdn/shop/t/558/assets/filter-utils.js?v=52726427945460665631779803225

js glamnetic.com collected 2026-09-25 21:05:05 UTC 7,309 bytes, 2 lines download raw bytes

1(function(){"use strict";const CONFIG={localStorageKeys:{filterOpen:"collection_filter_open",filterValue:"filter_value",accordionStates:"accordion_states",selectedFilters:"selected_filters"},selectors:{showFilterBtn:"#show_filter",collectionFilter:".collection-filter",closeFilterBtn:".filter-close-button",blurCover:".desktop-blur-cover",filterTags:".collection-filter__tag a",filterTagItems:".collection-filter__tag",sortSelect:"#sort-by",filterBarContainer:".filter--bar__container",filterBarCarousel:".filter-bar--carousel",filterCollectionBoxes:".filter-collection-box",accordionDetails:"[data-accordion-details]",filterLoadingOverlay:"#filter-loading-overlay",collectionLoadingOverlay:"#collection-loading-overlay",productsWrapper:".collection__products-wrapper",collectionMain:".collection__main",selectedFiltersContainer:"#selected-filters-container",selectedFiltersWrapper:"#selected-filters-wrapper",selectedFiltersList:"#selected-filters-list",clearAllFiltersBtn:"#clear-all-filters",applyButton:"#filter-apply-button",applyButtonCount:"#filter-apply-button-count",applyContainer:"#filter-apply-container",applyButtonText:".filter-apply-button-text",collectionElement:"[data-collection-handle], .collection",productCard:"product-card, .product-card, [data-product-card], .card"},breakpoints:{desktop:990,mobile:768}},Utils={isDesktop:()=>window.innerWidth>=CONFIG.breakpoints.desktop,isMobile:()=>window.innerWidth<=CONFIG.breakpoints.mobile,getLocalStorage:key=>localStorage.getItem(key),setLocalStorage:(key,value)=>localStorage.setItem(key,value),removeLocalStorage:key=>localStorage.removeItem(key),log:()=>{},error:(message,data=null)=>{console.error(`[CollectionFilter] ${message}`,data||"")},warn:()=>{},showError:message=>{const errorToast=document.createElement("div");errorToast.className="filter-error-toast",errorToast.style.cssText="position: fixed; top: 20px; right: 20px; background: #ff4444; color: white; padding: 16px 24px; border-radius: 8px; z-index: 1000000; box-shadow: 0 4px 12px rgba(0,0,0,0.15); max-width: 400px;",errorToast.textContent=message,document.body.appendChild(errorToast),requestAnimationFrame(()=>{setTimeout(()=>{errorToast.style.opacity="0",errorToast.style.transition="opacity 0.3s",requestAnimationFrame(()=>{setTimeout(()=>errorToast.remove(),300)})},5e3)}),Utils.error(message)},debounce:function(func,delay){var timeoutId;return function(){var context=this,args=arguments;clearTimeout(timeoutId),timeoutId=setTimeout(function(){func.apply(context,args)},delay)}},throttle:function(func,delay){var inThrottle;return function(){var context=this,args=arguments;inThrottle||(func.apply(context,args),inThrottle=!0,setTimeout(function(){inThrottle=!1},delay))}},updateDOMEfficiently:(targetElement,newHTML)=>{if(!targetElement)return;const fragment=document.createDocumentFragment(),tempDiv=document.createElement("div");for(tempDiv.innerHTML=newHTML;tempDiv.firstChild;)fragment.appendChild(tempDiv.firstChild);requestAnimationFrame(()=>{targetElement.innerHTML="",targetElement.appendChild(fragment)})},preloadResource:(url,type="fetch")=>{if(type==="fetch"){const link=document.createElement("link");link.rel="prefetch",link.href=url,document.head.appendChild(link)}}},UrlUtils={parseUrl(url){try{return url instanceof URL?new URL(url):new URL(url,window.location.origin)}catch{return new URL(url,window.location.href)}},getBaseUrl(url=window.location.href){const urlObj=this.parseUrl(url);return urlObj.origin+urlObj.pathname},getSearchParams(url=window.location.href){return this.parseUrl(url).searchParams},getParam(key,url=window.location.href){return this.getSearchParams(url).get(key)},setParam(key,value,url=window.location.href){const urlObj=this.parseUrl(url);return urlObj.searchParams.set(key,value),urlObj.pathname+urlObj.search},deleteParam(key,url=window.location.href){const urlObj=this.parseUrl(url);return urlObj.searchParams.delete(key),urlObj.pathname+urlObj.search},buildUrl(baseUrl,params={},preserveExisting=!0){const urlObj=this.parseUrl(baseUrl);return preserveExisting||(urlObj.search=""),Object.entries(params).forEac
1h(([key,value])=>{value==null||value===""?urlObj.searchParams.delete(key):urlObj.searchParams.set(key,String(value))}),urlObj.pathname+urlObj.search},parseFilterParams(url=window.location.href){const searchParams=this.parseUrl(url).searchParams,filters={};for(const[key,value]of searchParams.entries())key.startsWith("filter.")&&(filters[key]=value);return filters},buildSortUrl(sortValue,baseUrl=window.location.href){const urlObj=this.parseUrl(baseUrl);return sortValue==="filter.v.availability=1"?(urlObj.searchParams.set("filter.v.availability","1"),urlObj.searchParams.delete("sort_by")):(urlObj.searchParams.set("sort_by",sortValue),urlObj.searchParams.delete("filter.v.availability")),urlObj.pathname+urlObj.search},isFilterQueryParam(key){return key==="page"||typeof key=="string"&&key.indexOf("filter.")===0},copyPreservedSearchParams(referenceUrl=window.location.href){const ref=this.parseUrl(referenceUrl),preserved=new URLSearchParams;return ref.searchParams.forEach((value,key)=>{this.isFilterQueryParam(key)||preserved.set(key,value)}),preserved},buildUrlWithPreservedQuery(pathname,referenceUrl=window.location.href,options={}){const params=this.copyPreservedSearchParams(referenceUrl),path=pathname.startsWith("/")?pathname:"/"+pathname;if(options.page!=null){const pageNum=parseInt(options.page,10);pageNum>1?params.set("page",String(pageNum)):params.delete("page")}const qs=params.toString();return qs?path+"?"+qs:path},buildClearedCollectionUrl(referenceUrl=window.location.href){const ref=this.parseUrl(referenceUrl),parts=ref.pathname.split("/").filter(Boolean);let basePath=ref.pathname;return parts.length>=2&&parts[0]==="collections"&&(basePath="/collections/"+parts[1]),this.buildUrlWithPreservedQuery(basePath,referenceUrl)},buildUrlWithAllQuery(pathname,referenceUrl=window.location.href,options={}){const ref=this.parseUrl(referenceUrl),params=new URLSearchParams;if(ref.searchParams.forEach((value,key)=>{key!=="page"&&params.set(key,value)}),options.page!=null){const pageNum=parseInt(options.page,10);pageNum>1?params.set("page",String(pageNum)):params.delete("page")}const path=pathname.startsWith("/")?pathname:"/"+pathname,qs=params.toString();return qs?path+"?"+qs:path},buildSingleTagFetchUrls(collectionBaseUrl,tags,referenceUrl=window.location.href){return tags.map(tag=>this.buildUrlWithAllQuery(`${collectionBaseUrl}/${tag}`,referenceUrl))}},CacheManager={cache:new Map,cacheExpiry:1200*1e3,generateKey:(url,params={})=>{const keyParams=new URLSearchParams(params).toString();return`${url}${keyParams?"?"+keyParams:""}`},set:function(key,data){const item={data,timestamp:Date.now(),expires:Date.now()+CacheManager.cacheExpiry};CacheManager.cache.set(key,item)},get:function(key){const item=CacheManager.cache.get(key);return item?Date.now()>item.expires?(CacheManager.cache.delete(key),null):item.data:null},clear:function(){CacheManager.cache.clear()},cleanup:function(){const now=Date.now();for(const[key,item]of CacheManager.cache.entries())now>item.expires&&CacheManager.cache.delete(key)}};window.FilterUtils={CONFIG,Utils,UrlUtils},window.CacheManager=CacheManager})();
2//# sourceMappingURL=/cdn/shop/t/558/assets/filter-utils.js.map?v=52726427945460665631779803225

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.