PageSourceSearch

https://star-board.com/cdn/shop/t/6/assets/facets.min.js?v=3878571502767260731739243649

js star-board.com collected 2026-09-24 10:19:01 UTC 11,281 bytes, 1 lines download raw bytes

1import{Delegate as t,inView as e}from"vendor";import{$4 as s,$$4 as i,$id4 as n,getterAdd as r,getterGet as o,getterRunFn as a,_matchMedia as l}from"global";var c=s('[is="hdt-switch-to-list-view"].is-active')?":list":":grid",h=c,d=!1;const u="shopify-section",p="hdt-view-layout-switch";function b(t){this.dispatchEvent(new CustomEvent("facet:render",{bubbles:!0,detail:t}))}var m,g,f,w,v,C,E,P,A,k,L,S,_,y,I,x=new Map;async function $(t,e="",s){const i=t+e;if(x.has(i))return Promise.resolve(new Response(new Blob([x.get(i)])));const n=await fetch(t,s);if(200===n.status){const t=n.headers.get("Content-Type");(t&&t.match(/text\//i)||t.match(/application\/json/i))&&n.clone().text().then((t=>{x.set(i,t)}))}return n}class N extends HTMLFormElement{#t;constructor(){super(),r(m,this,!1),r(g,this),r(w,this),r(C,this)}connectedCallback(){this.#t=new AbortController,this.addEventListener("change",a(w,this,v),{signal:this.#t.signal}),this.addEventListener("submit",a(C,this,E),{signal:this.#t.signal})}disconnectedCallback(){this.#t.abort()}}m=new WeakMap,g=new WeakSet,f=function(){const t=new URLSearchParams(new FormData(this)),e=new URL(this.action);return t.forEach(((t,s)=>e.searchParams.append(s,t))),e.searchParams.delete("page"),["filter.v.price.gte","filter.v.price.lte"].forEach((t=>{""===e.searchParams.get(t)&&e.searchParams.delete(t)})),e.searchParams.set("section_id",this.getAttribute("section-id")),e},w=new WeakSet,v=function(){r(m,this,!0,!0),this.hasAttribute("render-on-change")?this.dispatchEvent(new Event("submit",{cancelable:!0})):$(a(g,this,f).call(this).toString(),c)},C=new WeakSet,E=function(t){t.preventDefault(),o(m,this)&&(b.call(this,{url:a(g,this,f).call(this)}),r(m,this,!1,!0))},customElements.define("hdt-facet-filters-form",N,{extends:"form"});class T extends HTMLElement{#t;constructor(){super()}connectedCallback(){this.#t=new AbortController,s("hdt-popover",this).addEventListener("richlist:change",(t=>{const e=new URL(window.location.href);e.searchParams.set("sort_by",t.detail.value),e.searchParams.delete("page"),e.searchParams.set("section_id",this.getAttribute("section-id")),b.call(this,{url:e})}),{signal:this.#t.signal})}disconnectedCallback(){this.#t.abort()}}customElements.define("hdt-popover-sorting",T);class W extends HTMLAnchorElement{#t;constructor(){super(),r(P,this)}connectedCallback(){this.#t=new AbortController,this.addEventListener("click",a(P,this,A).bind(this),{signal:this.#t.signal})}disconnectedCallback(){this.#t.abort()}}P=new WeakSet,A=function(t){t.preventDefault();const e=(i=(i=t.target).classList.contains(u)?i:i.closest("."+u)).id.replace(u+"-",""),s=new URL(this.href);var i;s.searchParams.set("section_id",e),b.call(this,{url:s})},customElements.define("hdt-facet-url",W,{extends:"a"});class M extends HTMLAnchorElement{#t;constructor(){super(),r(k,this),r(S,this),r(y,this)}connectedCallback(){this.#t=new AbortController,this.abortController2=null,this.addEventListener("click",a(k,this,L).bind(this),{signal:this.#t.signal}),this.isInfinite&&e(this,a(S,this,_).bind(this))}disconnectedCallback(){this.#t.abort()}get isInfinite(){return this.hasAttribute("render-on-scroll")}get idcontrol(){return"#"+this.getAttribute("append")}get action(){return this.hasAttribute("prepend")?"prepend":"append"}}k=new WeakSet,L=function(t){t.preventDefault();const e=new URL(this.href);e.searchParams.set("section_id",this.getAttribute("section-id")),a(y,this,I).call(this,{detail:{url:e,id:this.idcontrol,action:this.action}})},S=new WeakSet,_=function(t){t.isIntersecting&&t.target.click()},y=new WeakSet,I=async function(t){this.abortController2&&this.abortController2.abort(),this.abortController2=new AbortController;const e=t.detail.url,i=e.searchParams.get("section_id"),n=e.searchParams.get("page"),r=document.getElementById(`${u}-${i}`);new URL(e).searchParams.delete("section_id");const o=s(t.detail.id,r),a=s("[loadmore-btn-wrapp]",r);try{a.setAttribute("loading","");const i=(new DOMParser).parseFromString(await(await $(e.toString(),c,{signal:this.abortController2.signal})).text(),"text/html"),r=s(`.${u} ${t.detail.id}`,i),h="append"==t.detail.action;o[h?"lastElementChild":"firstElementChild"].classList.add(`point-effect-${n}`),o[t.detail.action](...document.importNode(r,!0).childNodes),l("motion")&&(o.prependEl=h?`.point-effect-${n} ~ `:"",o.appendEl=h?"":`:not(nathan ~ .point-effect-${n}):not(.point-effect-${n} ~ nathan)`,o.reveal&&o.reveal());const d=s("[loadmore-btn-wrapp]",i);d?(a.replaceChildren(...document.importNode(d,!0).childNodes),a.removeAttribute("loading")):a.remove()}catch(t){}},customElements.define("hdt-lm-main-url",M,{extends:"a"});class R extends HTMLElement{#t;constructor(){super(),this.rangePriceInputs=i(".hdt-filter-group__range-price input",this),this.inputPriceInputs=i(".hdt-filter-group__input-price input",this),this.priceGap=0}connectedCallback(){this.#t=new AbortController,this.rangePriceInputs.forEac
1h((t=>t.addEventListener("input",this.onRangeInput.bind(this),{signal:this.#t.signal}))),this.inputPriceInputs.forEach((t=>t.addEventListener("input",this.onPriceInput.bind(this),{signal:this.#t.signal})))}disconnectedCallback(){this.#t.abort()}onRangeInput(t){const e=this.inputPriceInputs[0],s=this.inputPriceInputs[1],i=this.rangePriceInputs[0],n=this.rangePriceInputs[1];let r=Number(i.value),o=Number(n.value);o-r<this.priceGap?t.target===i?i.value=o-this.priceGap:n.value=r+this.priceGap:(e.value=r,s.value=o,this.style.setProperty("--min-progress",r/i.max*100+"%"),this.style.setProperty("--max-progress",100-o/n.max*100+"%"))}onPriceInput(t){const e=this.inputPriceInputs[0],s=this.inputPriceInputs[1],i=this.rangePriceInputs[0],n=this.rangePriceInputs[1];let r=Number(e.value),o=Number(s.value);o-r>=this.priceGap&&o<=n.max&&("filter.v.price.gte"===t.target.name?(i.value=r,this.style.setProperty("--min-progress",r/i.max*100+"%")):(n.value=o,this.style.setProperty("--max-progress",100-o/n.max*100+"%")))}}customElements.define("hdt-price-range",R);var U,F,H,D,G,O,j,z,V,q,B,J,K={mobile:"",tablet:"md:",desktop:"lg:"},Q={mobile:0,tablet:1,desktop:2},X=s(p)?s(p).getAttribute("views"):"";class Y extends HTMLElement{constructor(){super(),r(U,this,new t(this)),r(F,this),r(D,this,this.getAttribute("breakpoint")),r(G,this,K[o(D,this)]+"hdt-grid-cols-"),r(O,this),r(z,this)}static get observedAttributes(){return["views"]}attributeChangedCallback(t,e,s){a(z,this,V).call(this,t,e,s)}connectedCallback(){o(U,this).on("click",'button[type="button"]',a(F,this,H).bind(this))}disconnectedCallback(){o(U,this).off()}get $control(){return n(this.getAttribute("aria-controls"))}}D=new WeakMap,G=new WeakMap,U=new WeakMap,F=new WeakSet,H=function(t,e){if(e.classList.contains("is-active"))return;const s=this.getAttribute("views").split(".");s.indexOf("0")>
1-1&&0!=e.value?s.forEach(((t,e)=>{0==t&&(s[e]=e+2)})):0==e.value&&s.forEach(((t,e)=>s[e]=0)),q=e.getAttribute("sizes"),s[Q[o(D,this)]]=e.value,a(O,this,j).call(this,s.join("."),e.hasAttribute("is"))},O=new WeakSet,j=function(t,e){d=h!=(c=e?":list":":grid"),h=c,X=t,i(p).forEach((e=>e.setAttribute("views",t)));const s=new URL(window.location.href);s.searchParams.delete("page"),s.searchParams.set("section_id",this.getAttribute("section-id"));var n=!0;d&x.has(s.toString()+c)&&(n=!1,b.call(this,{url:s,disableScrollToVIew:!0})),d&&n&&(this.closest(".shopify-section").setAttribute("loading",""),document.dispatchEvent(new CustomEvent("theme:loading:doing",{bubbles:!0}))),fetch(`${Shopify.routes.root}cart/update.js`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({attributes:{products_items_per_row:t}}),keepalive:!0}).then((t=>{200===t.status&&d&&n?this.dispatchEvent(new CustomEvent("update:products_items_per_row"),{bubbles:!0}):d&&n&&(this.closest(".shopify-section").removeAttribute("loading"),document.dispatchEvent(new CustomEvent("theme:loading:done",{bubbles:!0})))}))},z=new WeakSet,V=function(t,e,n){if(null!==e&&n!==e){const t=e.split("."),r=n.split("."),a=t[Q[o(D,this)]],c=r[Q[o(D,this)]];if(i("button",this).forEach((t=>t.classList.toggle("is-active",t.value==c))),d)return;l("motion")&&(clearTimeout(this.$control.timeout),this.$control.timeout=setTimeout((()=>{this.$control.classList.remove(o(G,this)+a),this.$control.classList.add(o(G,this)+c),i(".hdt-card-product__media img",this.$control).forEach((t=>t.setAttribute("sizes",s(".is-active",this).getAttribute("sizes")))),this.$control.reveal()})))}},customElements.define(p,Y);class Z extends HTMLButtonElement{#t;constructor(){super(),r(B,this)}connectedCallback(){this.#t=new AbortController,this.parentNode.addEventListener("update:products_items_per_row",a(B,this,J).bind(this),{signal:this.#t.signal})}disconnectedCallback(){this.#t.abort()}}B=new WeakSet,J=function(t){const e=new URL(window.location.href);e.searchParams.delete("page"),e.searchParams.set("section_id",this.parentNode.getAttribute("section-id")),b.call(this,{url:e,disableScrollToVIew:!0})},customElements.define("hdt-switch-to-list-view",Z,{extends:"button"}),(()=>{window.addEventListener("popstate",(t=>{if(t.state&&t.state.FacetUrl){const e=new URL(t.state.FacetUrl);e.searchParams.set("section_id",t.state.section_id),b.call(document,{url:e,notPushState:!0})}}));var e=null,r=new t(document.body),o=new Set(Array.from(i('[is="hdt-facet-filters-form"] details[open] input[name*="filter."]'),(t=>t.name)));r.on("toggle",'[is="hdt-facet-filters-form"] details',((t,e)=>{[...new Set(Array.from(i('input[name*="filter."]',e),(t=>t.name)))].forEach((t=>{e.open?o.add(t):o.delete(t)}))}),!0),document.addEventListener("facet:render",(async t=>{e&&e.abort(),e=new AbortController;const r=t.detail.url,a=r.searchParams.get("section_id"),l=n(`${u}-${a}`),h=new URL(r);h.searchParams.delete("section_id");const d=s("[main-content]",l);try{l.setAttribute("loading",""),document.dispatchEvent(new CustomEvent("theme:loading:doing",{bubbles:!0}));const n=(new DOMParser).parseFromString(await(await $(r.toString(),c,{signal:e.signal})).text(),"text/html");document.dispatchEvent(new CustomEvent("theme:loading:done",{bubbles:!0}));const b=s(`.${u} [main-content]`,n);if(i('[is="hdt-facet-filters-form"] details',b).forEach((t=>{[...new Set(Array.from(i('input[name*="filter."]',t),(t=>t.name)))].forEach((e=>{t.open=o.has(e)}))})),x.has(r.toString()+":grid")||x.has(r.toString()+":list")||history.pushState({FacetUrl:h.toString(),section_id:a},"",h.toString()),s(p,b)){const t=s(p,b).getAttribute("views");if(t!==X){const e=t.split("."),n=["","md:","lg:"],r=s(`#products-${a}`,b);let o=r.className;const l=X.split(".");i(p,b).forEach(((t,i)=>{t.setAttribute("views",X),s(".is-active",t).classList.remove("is-active"),s(`button[value="${l[i]}"]`,t).classList.add("is-active"),o=o.replace(` ${n[i]}hdt-grid-cols-${e[i]}`,` ${n[i]}hdt-grid-cols-${l[i]}`)})),r.className=o,i(".hdt-card-product__media img",r).forEach((t=>t.setAttribute("sizes",q)))}}d.replaceChildren(...document.importNode(b,!0).childNodes),i(".hdt-tooltip").forEach((t=>t.remove())),l.removeAttribute("loading","");const m=s("[scroll-into-view]",l);if(!m||t.detail.disableScrollToVIew)return;const g=()=>m.scrollIntoView({block:"start",behavior:"smooth"});"requestIdleCallback"in window?requestIdleCallback(g,{timeout:500}):requestAnimationFrame(g)}catch(t){}}))})();

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.