"use strict";(self.webpackChunkui=self.webpackChunkui||[]).push([[38],{93(e,t,l){l.d(t,{a:()=>a});var r=l(0),i=l(3),n=l(67),o=l(50),s=l(1),d=l(243),c=l(89);function a({collection:e,mobile_slider:t="disabled",desktop_slider:l="disabled",device:a,cartApp:u,collectionApp:f,productApp:h,processedDisruptors:p}){var v,b,m,g;const k=null!==(v=null==f?void 0:f.collection.value)&&void 0!==v?v:e,j=null!==(b=null==k?void 0:k.products)&&void 0!==b?b:[],L=null!==(m=null==k?void 0:k.handle)&&void 0!==m?m:"",x=null==f?void 0:f.filterList.value,C=null!=p?p:null===(g=null==k?void 0:k.transformedMetafields)||void 0===g?void 0:g.disruptors,[y,A]=(0,s.k)(0),[I,w]=(0,s.k)(!0),[B,R]=(0,s.k)(!1),$=(0,s.j)(null),N=(0,s.j)(null),W=()=>{const e=$.current,t=N.current;if(!e||!t)return;const l=e.scrollWidth-e.clientWidth,r=l>0?e.scrollLeft/l:0;t.style.setProperty("--scroll-progress",r.toString()),w(e.scrollLeft<=0),R(l<=0||e.scrollLeft>=l-1)},E=()=>{const e=$.current;if(!e)return;W();const t=e.getBoundingClientRect(),l=Array.from(e.children),r=l[l.length-1].getBoundingClientRect().right-t.right<45;let i=1/0;l.forEach(((e,l)=>{const n=e.getBoundingClientRect();if(r&&n.left<0)return;const o=Math.abs(n.left-t.left)+(n.left<0?20:0);ot?e.flatMap(((e,l)=>{const r=t.find((e=>e.position===l+1));return r?[r,e]:e})):e),[e,t])}(j,C);return(0,s.c)((()=>{const e=$.current;if(e)return e.addEventListener("scroll",E),W(),()=>{e.removeEventListener("scroll",E)}}),[$.current]),0===M.length?(0,r.jsx)(d.a,{filterList:x}):(t=function(e,t){return 1===e||"1.5"===t?"1.5":2===e?"disabled":t}(M.length,t),(0,r.b)(i.b,{children:[(0,r.b)("div",{class:n.a.container,ref:N,children:["disabled"!==l&&"desktop"===a?(0,r.jsx)(c.a,{direction:"left",onClick:()=>{const e=$.current;if(!e)return;const t=.8*e.offsetWidth;e.scrollBy({left:-t,behavior:"smooth"})},className:n.a.arrowLeft,ariaLabel:"Previous products",disabled:I}):null,(0,r.jsx)("div",{class:[n.a.collectionItems,"disabled"!==l&&n.a.desktopItemsSlider,"disabled"!==t&&n.a.mobileItemsSlider].join(" "),style:{"--collection-desktop-slider-size":l,"--collection-mobile-slider-size":t},ref:$,"data-slider":"disabled"!==t||"disabled"!==l?"true":void 0,children:M.map(((e,t)=>{if(!e)return null;const l="defaultVariantId"in e?`${e.handle}${e.defaultVariantId}`:`${e.handle}${t}`;return(0,r.jsx)(o.a,{product:e,collectionHandle:L,cartApp:u,productApp:h},l)}))}),"disabled"!==l&&"desktop"===a?(0,r.jsx)(c.a,{direction:"right",onClick:()=>{const e=$.current;if(!e)return;const t=.8*e.offsetWidth;e.scrollBy({left:t,behavior:"smooth"})},className:n.a.arrowRight,ariaLabel:"Next products",disabled:B}):null]}),"disabled"!==t&&M.length>=parseFloat(t)&&(0,r.jsx)("div",{class:n.a.sliderDots,children:j.slice(0,["2.0","2.5"].includes(t)?j.length-1:j.length).map(((e,t)=>(0,r.jsx)("button",{type:"button",class:[n.a.dot,t===y&&n.a.dotActive].join(" "),onClick:()=>(e=>{const t=$.current;if(!t)return;const l=Array.from(t.children)[e];l&&l.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"})})(t),"aria-label":`Go to product ${t+1}`},t)))})]}))}},243(e,t,l){l.d(t,{a:()=>s});var r=l(0),i=l(1),n=l(67),o=l(114);function s({filterList:e}){const t=(0,i.h)((()=>function(e){return null==e?void 0:e.some((e=>{var t;return null===(t=e.values)||void 0===t?void 0:t.some((e=>e.selected))}))}(e)),[e]);return(0,r.b)("div",{class:n.a.empty,children:[(0,r.jsx)("h2",{children:"No Results"}),(0,r.jsx)("button",{"data-has-selected-filters":t,onClick:()=>{(0,o.c)(e)},children:"Clear Filters"})]})}}}]);