"use strict";(self.webpackChunkui=self.webpackChunkui||[]).push([[25],{97:(e,t,l)=>{l.d(t,{a:()=>f});var r=l(0),n=l(3),s=l(22),i=l(51),o=l(61),d=l(2),a=l(76),c=l(64);function u(){const e=(0,c.a)((e=>e.filterList)),t=(0,d.useMemo)((()=>function(e){return 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.jsxs)("div",{class:s.a.empty,children:[(0,r.jsx)("h2",{children:"No Results"}),(0,r.jsx)("button",{"data-has-selected-filters":t,onClick:()=>{(0,a.c)(e)},children:"Clear Filters"})]})}function f({collection:e,mobile_slider:t="disabled",desktop_slider:l="disabled"}){var a;(0,i.d)(e);const[c,f]=(0,d.useState)(0),h=(0,d.useRef)(null),v=()=>{const e=h.current;if(!e)return;const t=e.getBoundingClientRect(),l=Array.from(e.children),r=l[l.length-1].getBoundingClientRect().right-t.right<45;let n=1/0;l.forEach(((e,l)=>{const s=e.getBoundingClientRect();if(r&&s.left<0)return;const i=Math.abs(s.left-t.left)+(s.left<0?20:0);i{var t;const l=null===(t=e.transformedMetafields)||void 0===t?void 0:t.disruptors;return l?e.products.flatMap(((e,t)=>{const r=l.find((e=>e.position===t+1));return r?[r,e]:e})):e.products}),[e.products,null===(a=e.transformedMetafields)||void 0===a?void 0:a.disruptors]);return(0,d.useEffect)((()=>{var e;return null===(e=h.current)||void 0===e||e.addEventListener("scroll",v),()=>{var e;null===(e=h.current)||void 0===e||e.removeEventListener("scroll",v)}}),[h.current]),0===p.length?(0,r.jsx)(u,{}):(t=function(e,t){return 1===e||"1.5"===t?"1.5":2===e?"disabled":t}(p.length,t),(0,r.jsxs)(n.Fragment,{children:[(0,r.jsx)("div",{class:s.a.container,children:(0,r.jsx)("div",{class:[s.a.collectionItems,"disabled"!==l&&s.a.desktopItemsSlider,"disabled"!==t&&s.a.mobileItemsSlider].join(" "),style:{"--collection-desktop-slider-size":l,"--collection-mobile-slider-size":t},ref:h,"data-slider":"disabled"!==t||"disabled"!==l?"true":void 0,children:p.map(((t,l)=>{if(!t)return null;const n="defaultVariantId"in t?`${t.handle}${t.defaultVariantId}`:`${t.handle}${l}`;return(0,r.jsx)(o.a,{product:t,collectionHandle:e.handle},n)}))})}),"disabled"!==t&&p.length>=parseFloat(t)&&(0,r.jsx)("div",{class:s.a.sliderDots,children:e.products.slice(0,["2.0","2.5"].includes(t)?e.products.length-1:e.products.length).map(((e,t)=>(0,r.jsx)("button",{type:"button",class:[s.a.dot,t===c&&s.a.dotActive].join(" "),onClick:()=>(e=>{const t=h.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)))})]}))}}}]);