1import{i as e,t}from"./jsx-runtime-DUAcabCT.js";import{t as n}from"./react-6OGjdfot.js";import{n as r}from"./queryOptions-Dj0iNmXa.js";import{t as i}from"./chevron-down-C-_8mnXs.js";import{t as a}from"./loader-circle-Bi0ABZR6.js";import{t as o}from"./CollectionFilters-DlSX0XRc.js";import{t as s}from"./PromoBanner-RkfWUuZO.js";import{n as c,r as l}from"./ProductCard-CRvEJyYi.js";import{t as u}from"./ProductGrid-BsaURidi.js";import{i as d,r as f}from"./index-IIEG9hZI.js";var p=e(n()),m=t(),h={featured:`In primo piano`,bestseller:`Bestseller`,alpha:`Alfabetico (A-Z)`};function g(){let{sort:e,sport:t,color:n,benefit:g}=f.useSearch(),_=f.useNavigate(),{data:v,isFetching:y}=r(d(e)),b=(0,p.useMemo)(()=>c(v),[v]),x=(0,p.useMemo)(()=>l(v,{sport:t,color:n,benefit:g}),[v,t,n,g]);return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(s,{variant:`band`,placement:`plp_top`}),(0,m.jsxs)(`div`,{className:`container mx-auto max-w-[1400px] px-4 md:px-8 py-8 sm:py-12`,children:[(0,m.jsxs)(`div`,{className:`mb-6 sm:mb-8 md:mb-10 flex flex-col md:flex-row md:items-end md:justify-between gap-4`,children:[(0,m.jsxs)(`div`,{children:[(0,m.jsx)(`h1`,{className:`text-3xl sm:text-4xl md:text-5xl font-extrabold uppercase text-black`,children:`Tutti i prodotti`}),(0,m.jsxs)(`p`,{className:`text-muted-foreground mt-2 text-sm`,children:[x.length,` `,x.length===1?`prodotto`:`prodotti`,x.length===v.length?``:` su ${v.length}`]})]}),(0,m.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,m.jsx)(`label`,{htmlFor:`sort`,className:`text-xs font-semibold uppercase tracking-wider text-muted-foreground shrink-0`,children:`Ordina per`}),(0,m.jsxs)(`div`,{className:`relative flex-1 sm:flex-none`,children:[(0,m.jsx)(`select`,{id:`sort`,value:e,onChange:e=>_({search:t=>({...t,sort:e.target.value})}),className:`w-full sm:w-auto appearance-none border-2 border-black bg-white pl-3 sm:pl-4 pr-10 py-2.5 text-xs sm:text-sm font-medium uppercase tracking-wider focus:outline-none cursor-pointer`,children:Object.keys(h).map(e=>(0,m.jsx)(`option`,{value:e,children:h[e]},e))}),(0,m.jsx)(i,{className:`h-4 w-4 absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none`})]})]})]}),(0,m.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-[260px_1fr] gap-6 lg:gap-8`,children:[(0,m.jsx)(o,{facets:b,selected:{sport:t,color:n,benefit:g},onToggle:(e,t)=>{_({search:n=>{let r=n[e]??[],i=r.includes(t)?r.filter(e=>e!==t):[...r,t];return{...n,[e]:i}}})},onClear:()=>_({search:e=>({...e,sport:[],color:[],benefit:[]})})}),(0,m.jsx)(`div`,{children:x.length===0?(0,m.jsx)(`div`,{className:`py-20 text-center text-muted-foreground`,children:`Nessun prodotto corrisponde ai filtri selezionati.`}):(0,m.jsx)(u,{products:x,selectedColors:n,className:`grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-x-3 sm:gap-x-4 gap-y-8 sm:gap-y-10 transition-opacity ${y?`opacity-60`:``}`})})]}),y&&(0,m.jsxs)(`div`,{className:`fixed bottom-6 right-6 bg-black text-white px-4 py-2 text-xs uppercase tracking-wider flex items-center gap-2 shadow-lg`,children:[(0,m.jsx)(a,{className:`h-4 w-4 animate-spin`}),` Caricoâ¦`]})]})]})}export{g as component};
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.