"use strict";(self.webpackChunkui=self.webpackChunkui||[]).push([[24],{92:(e,t,r)=>{r.d(t,{a:()=>h});var l=r(0),s=r(3),n=r(21),i=r(50),o=r(59),d=r(2),c=r(72),a=r(55);function u(){const e=(0,a.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,l.jsxs)("div",{class:n.a.empty,children:[(0,l.jsx)("h2",{children:"No Results"}),(0,l.jsx)("button",{"data-has-selected-filters":t,onClick:()=>{(0,c.c)(e)},children:"Clear Filters"})]})}function f({direction:e,onClick:t,className:r,ariaLabel:s}){return(0,l.jsx)("button",{className:r,onClick:t,"aria-label":s||("left"===e?"Previous":"Next")+" slide",children:(0,l.jsx)("svg",{width:"6",height:"10",viewBox:"0 0 6 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{transform:"right"===e?"rotate(180deg)":"none"},"aria-hidden":"true",children:(0,l.jsx)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5.35408 9.2621C5.40065 9.21566 5.43759 9.16048 5.4628 9.09974C5.488 9.03899 5.50098 8.97387 5.50098 8.9081C5.50098 8.84233 5.488 8.77721 5.4628 8.71647C5.43759 8.65572 5.40065 8.60055 5.35408 8.5541L1.70708 4.9081L5.35408 1.2621C5.44797 1.16822 5.50071 1.04088 5.50071 0.908102C5.50071 0.775327 5.44797 0.647989 5.35408 0.554102C5.2602 0.460216 5.13286 0.407471 5.00008 0.407471C4.86731 0.407471 4.73997 0.460216 4.64608 0.554102L0.646083 4.5541C0.59952 4.60055 0.562577 4.65572 0.53737 4.71647C0.512164 4.77721 0.499189 4.84234 0.499189 4.9081C0.499189 4.97387 0.512164 5.03899 0.53737 5.09974C0.562577 5.16048 0.59952 5.21566 0.646083 5.2621L4.64608 9.2621C4.69253 9.30867 4.7477 9.34561 4.80845 9.37081C4.86919 9.39602 4.93432 9.409 5.00008 9.409C5.06585 9.409 5.13097 9.39602 5.19172 9.37081C5.25246 9.34561 5.30764 9.30867 5.35408 9.2621Z",fill:"currentColor"})})})}function h({collection:e,mobile_slider:t="disabled",desktop_slider:r="disabled",device:c}){var a;(0,i.d)(e);const[h,p]=(0,d.useState)(0),v=(0,d.useRef)(null),b=(0,d.useRef)(null),C=()=>{const e=v.current,t=b.current;if(!e||!t)return;const r=e.scrollLeft/(e.scrollWidth-e.clientWidth);t.style.setProperty("--scroll-progress",r.toString())},m=()=>{const e=v.current;if(!e)return;C();const t=e.getBoundingClientRect(),r=Array.from(e.children),l=r[r.length-1].getBoundingClientRect().right-t.right<45;let s=1/0;r.forEach(((e,r)=>{const n=e.getBoundingClientRect();if(l&&n.left<0)return;const i=Math.abs(n.left-t.left)+(n.left<0?20:0);i{var t;const r=null===(t=e.transformedMetafields)||void 0===t?void 0:t.disruptors;return r?e.products.flatMap(((e,t)=>{const l=r.find((e=>e.position===t+1));return l?[l,e]:e})):e.products}),[e.products,null===(a=e.transformedMetafields)||void 0===a?void 0:a.disruptors]);return(0,d.useEffect)((()=>{const e=v.current;if(e)return e.addEventListener("scroll",m),C(),()=>{e.removeEventListener("scroll",m)}}),[v.current]),0===g.length?(0,l.jsx)(u,{}):(t=function(e,t){return 1===e||"1.5"===t?"1.5":2===e?"disabled":t}(g.length,t),(0,l.jsxs)(s.Fragment,{children:[(0,l.jsxs)("div",{class:n.a.container,ref:b,children:["disabled"!==r&&"desktop"===c?(0,l.jsx)(f,{direction:"left",onClick:()=>{const e=v.current;if(!e)return;const t=.8*e.offsetWidth;e.scrollBy({left:-t,behavior:"smooth"})},className:n.a.arrowLeft,ariaLabel:"Previous products"}):null,(0,l.jsx)("div",{class:[n.a.collectionItems,"disabled"!==r&&n.a.desktopItemsSlider,"disabled"!==t&&n.a.mobileItemsSlider].join(" "),style:{"--collection-desktop-slider-size":r,"--collection-mobile-slider-size":t},ref:v,"data-slider":"disabled"!==t||"disabled"!==r?"true":void 0,children:g.map(((t,r)=>{if(!t)return null;const s="defaultVariantId"in t?`${t.handle}${t.defaultVariantId}`:`${t.handle}${r}`;return(0,l.jsx)(o.a,{product:t,collectionHandle:e.handle},s)}))}),"disabled"!==r&&"desktop"===c?(0,l.jsx)(f,{direction:"right",onClick:()=>{const e=v.current;if(!e)return;const t=.8*e.offsetWidth;e.scrollBy({left:t,behavior:"smooth"})},className:n.a.arrowRight,ariaLabel:"Next products"}):null]}),"disabled"!==t&&g.length>=parseFloat(t)&&(0,l.jsx)("div",{class:n.a.sliderDots,children:e.products.slice(0,["2.0","2.5"].includes(t)?e.products.length-1:e.products.length).map(((e,t)=>(0,l.jsx)("button",{type:"button",class:[n.a.dot,t===h&&n.a.dotActive].join(" "),onClick:()=>(e=>{const t=v.current;if(!t)return;const r=Array.from(t.children)[e];r&&r.scrollIntoView({behavior:"smooth",block:"nearest",inline:"start"})})(t),"aria-label":`Go to product ${t+1}`},t)))})]}))}}}]);