PageSourceSearch

https://ripskirthawaii.com/cdn/shop/t/155/assets/pr-collection-filters.js?v=127468297459071699221787402867

js ripskirthawaii.com collected 2026-09-28 05:50:36 UTC 11,685 bytes, 2 lines download raw bytes

1window.theme=window.theme||{},theme.AjaxRenderer=theme.AjaxRenderer||(function(){function AjaxRenderer({sections,onReplace,debug}={}){this.sections=sections||[],this.cachedSections=[],this.onReplace=onReplace,this.debug=!!debug}return AjaxRenderer.prototype=Object.assign({},AjaxRenderer.prototype,{renderPage:function(basePath,newParams,updateURLHash=!0){const currentParams=new URLSearchParams(window.location.search),updatedParams=this.getUpdatedParams(currentParams,newParams),sectionRenders=this.sections.map(section=>{const url=`${basePath}?section_id=${section.sectionId}&${updatedParams.toString()}`,cachedSectionUrl=cachedSection=>cachedSection.url===url;return this.cachedSections.some(cachedSectionUrl)?this.renderSectionFromCache(cachedSectionUrl,section):this.renderSectionFromFetch(url,section)});return updateURLHash&&this.updateURLHash(updatedParams),Promise.all(sectionRenders)},renderSectionFromCache:function(url,section){const cachedSection=this.cachedSections.find(url);return this.renderSection(cachedSection.html,section),Promise.resolve(section)},renderSectionFromFetch:function(url,section){return new Promise((resolve,reject)=>{fetch(url).then(response=>response.text()).then(responseText=>{const html=responseText;this.cachedSections=[...this.cachedSections,{html,url}],this.renderSection(html,section),resolve(section)}).catch(err=>reject(err))})},renderSection:function(html,section){const newDom=new DOMParser().parseFromString(html,"text/html");if(this.onReplace)this.onReplace(newDom,section);else{var newContentEl=newDom.getElementById(section.nodeId);if(!newContentEl)return;document.getElementById(section.nodeId).innerHTML=newContentEl.innerHTML}return section},getUpdatedParams:function(currentParams,newParams){const clone=new URLSearchParams(currentParams),preservedParams=["sort_by","q","options[prefix]","type"];for(const[key,value]of Array.from(clone.entries()))!newParams.getAll(key).includes(value)&&!preservedParams.includes(key)&&clone.delete(key);for(const key of preservedParams)newParams.has(key)&&clone.delete(key);for(const[key,value]of newParams.entries())!clone.getAll(key).includes(value)&&value!==""&&clone.append(key,value);return clone},updateURLHash:function(searchParams){history.pushState({},"",`${window.location.pathname}${searchParams&&"?".concat(searchParams)}`)}}),AjaxRenderer})(),theme.CollectionGrid=(function(){var isAnimating=!1,selectors={sortSelect:"#SortBy",collectionGrid:".collection-grid__wrapper",trigger:".collapsible-trigger",sidebar:"#CollectionSidebar",activeTagList:".tag-list--active-tags",tags:".tag-list input",activeTags:".tag-list a",tagsForm:".filter-form",filters:".collection-filter",priceRange:".price-range",drawer:"#FilterDrawer",applyFilters:".filter-btns__apply",clearFilters:".filter-btns__clear"},classes={activeTag:"tag--active",removeTagParent:"tag--remove",filterSidebar:"collapsible-content--sidebar",isOpen:"is-open"};function CollectionGrid(container){this.container=container,this.sectionId=container.getAttribute("data-section-id"),this.namespace=".collection-"+this.sectionId,this.ajaxRenderer=new theme.AjaxRenderer({sections:[{sectionId:this.sectionId,nodeId:"CollectionAjaxContent"}],onReplace:this.onReplaceAjaxContent.bind(this)}),this.init()}return CollectionGrid.prototype=Object.assign({},CollectionGrid.prototype,{init:function(){this.initSort(),this.initFilters(),this.initBar(),this.initDrawer(),this.initLoadMore()},initLoadMore:function(){var btn=document.querySelector(".pr-load-more__btn");btn&&btn.addEventListener("click",this.onLoadMore.bind(this))},onLoadMore:function(evt){var btn=evt.currentTarget,nextUrl=btn.getAttribute("data-next-url");if(!(!nextUrl||btn.classList.contains("is-busy"))){btn.classList.add("is-busy"),btn.textContent=btn.getAttribute("data-loading-text")||btn.textContent;var joiner=nextUrl.indexOf("?")>-1?"&":"?";fetch(nextUrl+joiner+"section_id="+this.sectionId).then(function(response){return response.text()}).then(function(responseText){var newDom=new DOMParser().parseFromString(responseText,"text/html"),grid=document.querySelector(".grid--collection"),newGrid=newDom.querySelector(".grid--collection");if(grid&&newGrid)for(;newGrid.firstChild;)grid.appendChild(newGrid.firstChild);var ajaxContent=document.getElementById("CollectionAjaxContent");newDom.querySelectorAll(".modal--quick-shop").forEach(function(modal){ajaxContent&&!document.getElementById(modal.id)&&ajaxContent.appendChild(modal)});var wrap=document.querySelector(".pr-load-more"),newWrap=newDom.querySelector(".pr-load-more");wrap&&(newWrap?(wrap.replaceWith(newWrap),this.initLoadMore()):wrap.remove()),theme.reinitProductGridItem(),document.dispatchEvent(new CustomEvent("collection:reloaded"))}.bind(this)).catch(function(err){console.error("Load more failed:",err),btn.classList.remove("is-busy")})}},initSort:function(){this.sortSelect=document.querySelector(selectors.sortSelect),this.sortSelect&&(this.defaultSort=this.sortSelect.getAttribute("data-default-sortby"),this.sortSelect.addEventListener("change",this.onSortChange.bind(this)))},onSortChange:function(){if(!isAnimating){isAnimating=!0;var params=new URLSearchParams(window.location.search);params.set("sort_by",this.sortSelect.value||this.defaultSort),params.delete("page"),this.updateScroll(!0),this.startLoading(),this.renderCollectionPage(params)}},initBar:function(){var bar=document.querySelector(".collection-sidebar--bar");bar&&bar.querySelectorAll(selectors.trigger).forEach(trigger=>{trigger.addEventListener("click",function(){bar.querySelectorAll(selectors.trigger).forEach(other=>
1{other===trigger||!other.classList.contains(classes.isOpen)||other.click()})})})},initDrawer:function(){theme.Drawers&&document.querySelector(selectors.drawer)&&(theme.FilterDrawer=new theme.Drawers("FilterDrawer","collection-filters",!0))},initFilters:function(){var tags=document.querySelectorAll(selectors.tags);if(tags.length){this.bindBackButton(),theme.config.stickyHeader&&(this.setFilterStickyPosition(),this.resizeBound||(this.resizeBound=!0,window.addEventListener("resize",this.setFilterStickyPosition.bind(this)))),document.querySelectorAll(selectors.activeTags).forEach(tag=>{tag.addEventListener("click",this.tagClick.bind(this))}),document.querySelectorAll(selectors.tagsForm).forEach(form=>{form.addEventListener("input",this.onFormSubmit.bind(this))});var applyBtn=document.querySelector(selectors.applyFilters);applyBtn&&applyBtn.addEventListener("click",this.onDrawerApply.bind(this)),document.querySelectorAll(selectors.clearFilters).forEach(btn=>{btn.addEventListener("click",this.onClearAll.bind(this))})}},tagClick:function(evt){var el=evt.currentTarget;if(theme.FilterDrawer&&theme.FilterDrawer.close(),el.classList.contains("no-ajax")||(evt.preventDefault(),evt.stopPropagation(),isAnimating))return;isAnimating=!0;const parent=el.parentNode,newUrl=new URL(el.href);this.renderActiveTag(parent,el),this.updateScroll(!0),this.startLoading(),this.renderCollectionPage(newUrl.searchParams)},onFormSubmit:function(evt){var el=evt.target;if(!el.closest(selectors.drawer)){if(el.type==="number"){clearTimeout(this.priceTimer),this.priceTimer=setTimeout(function(){this.applyFilterInput(el)}.bind(this),500);return}this.applyFilterInput(el)}},applyFilterInput:function(el){if(isAnimating)return;isAnimating=!0;const parent=el.closest("li"),formEl=el.closest("form"),formData=new FormData(formEl);this.renderActiveTag(parent,el),this.updateScroll(!0),this.startLoading(),this.renderFromFormData(formData)},onDrawerApply:function(evt){evt.preventDefault();var drawer=document.querySelector(selectors.drawer),formEl=drawer.querySelector(selectors.tagsForm);theme.FilterDrawer&&theme.FilterDrawer.close(),!(!formEl||isAnimating)&&(isAnimating=!0,this.updateScroll(!0),this.startLoading(),this.renderFromFormData(new FormData(formEl)))},onClearAll:function(evt){evt.preventDefault(),document.querySelectorAll(selectors.tagsForm).forEach(form=>{form.querySelectorAll('input[type="checkbox"]').forEach(input=>{input.checked=!1})}),theme.FilterDrawer&&theme.FilterDrawer.close(),!isAnimating&&(isAnimating=!0,this.updateScroll(!0),this.startLoading(),this.renderCollectionPage(new URLSearchParams))},fetchOpenCollasibleFilters:function(){return Array.from(document.querySelectorAll(`${selectors.sidebar} ${selectors.trigger}.${classes.isOpen}`)).map(trigger=>trigger.dataset.collapsibleId)},renderActiveTag:function(parent,el){if(!parent)return;const textEl=parent.querySelector(".tag__text");parent.classList.contains(classes.activeTag)?parent.classList.remove(classes.activeTag):(parent.classList.add(classes.activeTag),el.closest("li").classList.contains(classes.removeTagParent)?parent.remove():textEl&&document.querySelectorAll(selectors.activeTagList).forEach(list=>{const newTag=document.createElement("li"),newTagLink=document.createElement("a");newTag.classList.add("tag","tag--remove"),newTagLink.classList.add("btn","btn--small"),newTagLink.innerText=textEl.innerText,newTag.appendChild(newTagLink),list.appendChild(newTag)}))},renderFromFormData:function(formData){const searchParams=new URLSearchParams(formData);this.renderCollectionPage(searchParams)},onReplaceAjaxContent:function(newDom,section){this.fetchOpenCollasibleFilters().forEach(selector=>{newDom.querySelectorAll(`[data-collapsible-id=${selector}]`).forEach(this.openCollapsible)});var newContentEl=newDom.getElementById(section.nodeId);newContentEl&&(document.getElementById(section.nodeId).innerHTML=newContentEl.innerHTML)},openCollapsible:function(el){el.classList.contains(classes.filterSidebar)&&(el.style.height="auto"),el.classList.add(classes.isOpen)},renderCollectionPage:function(searchParams,updateURLHash=!0){this.ajaxRenderer.renderPage(window.location.pathname,searchParams,updateURLHash).then(()=>{theme.reinitSection("collection-grid"),this.updateScroll(!1),theme.reinitProductGridItem(),document.dispatchEvent(new CustomEvent("collection:reloaded")),isA
1nimating=!1}).catch(err=>{console.error("Filter request failed:",err),isAnimating=!1})},bindBackButton:function(){this.popstateBound||(this.popstateBound=!0,window.addEventListener("popstate",state=>{if(state){const newUrl=new URL(window.location.href);this.renderCollectionPage(newUrl.searchParams,!1)}}))},updateScroll:function(animate){var scrollToElement=document.querySelector("[data-scroll-to]");if(scrollToElement){var scrollTo=scrollToElement.getBoundingClientRect().top+window.pageYOffset;if(theme.config.bpSmall||(scrollTo-=15),theme.config.stickyHeader){var headerHeight=document.querySelector(".site-header").offsetHeight;scrollTo=scrollTo-headerHeight}animate?window.scrollTo({top:scrollTo,behavior:"smooth"}):window.scrollTo({top:scrollTo})}},setFilterStickyPosition:function(){var header=document.querySelector(".site-header"),filters=document.querySelector(selectors.filters);if(!(!header||!filters)){var headerHeight=header.offsetHeight;filters.style.top=headerHeight+10+"px";var stickySidebar=document.querySelector(".grid__item--sidebar");stickySidebar&&(stickySidebar.style.top=headerHeight+10+"px")}},forceReload:function(){this.init()},startLoading:function(){var grid=document.querySelector(selectors.collectionGrid);grid&&grid.classList.add("unload")},onUnload:function(){window.removeEventListener("resize",this.setFilterStickyPosition)}}),CollectionGrid})(),document.addEventListener("DOMContentLoaded",function(){var tries=0;(function hookUp(){if(window.sections&&window.sections.register){window.sections.register("collection-grid",theme.CollectionGrid);return}tries<60&&(tries+=1,setTimeout(hookUp,50))})()});
2//# sourceMappingURL=/cdn/shop/t/155/assets/pr-collection-filters.js.map?v=127468297459071699221787402867

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.