1import{ab as p,r as h,u as c,f,j as e,l as g,L as n,o as b,b as y,F as j,d as N,ac as v}from"./index-BCW6nnV8.js";import{S as w}from"./ShopifyProductCard-CZFJMr4T.js";function C(){const{collection:s}=p.useSearch(),[o,i]=h.useState(""),a=c({queryKey:["shopify","collection",s,"all"],queryFn:()=>N(s),staleTime:1e3*60*5,enabled:!!s}),l=c({queryKey:["shopify","products","all"],queryFn:()=>v(),staleTime:1e3*60*5,enabled:!s}),u=s?a.isLoading:l.isLoading,d=f(s?a.data?.products?.edges??[]:l.data??[]),m=s?a.data?.title??s:"Shop All",x=s?a.data?.description||"Live products from this collection â pulled directly from Shopify.":"The full GelToyNation arsenal â pulled live from our Shopify store.",r=o?d.filter(t=>t.node.title.toLowerCase().includes(o.toLowerCase())):d;return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(g,{}),e.jsxs("main",{children:[e.jsx("section",{className:"border-b border-border bg-surface/40",children:e.jsxs("div",{className:"mx-auto max-w-7xl px-4 md:px-6 py-12 md:py-16",children:[e.jsx("p",{className:"text-xs font-bold uppercase tracking-[0.25em] text-brand",children:s?"Collection":"Catalog"}),e.jsx("h1",{className:"mt-2 font-display text-4xl md:text-6xl font-extrabold uppercase",children:m}),e.jsx("p",{className:"mt-3 max-w-xl text-muted-foreground",children:x}),s&&e.jsx(n,{to:"/shop",search:{collection:void 0},className:"mt-3 inline-block text-xs uppercase tracking-wider text-brand hover:underline",children:"â View all products"}),e.jsxs("div",{className:"mt-6 relative max-w-md",children:[e.jsx(b,{className:"absolute left-4 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground","aria-hidden":"true"}),e.jsx("input",{type:"search",value:o,onChange:t=>i(t.target.value),placeholder:"Search productsâ¦","aria-label":"Search products",className:"w-full h-12 pl-11 pr-4 rounded-full bg-background border border-border focus:border-brand focus:outline-none text-sm"})]})]})}),e.jsx("section",{className:"mx-auto max-w-7xl px-4 md:px-6 py-12 md:py-16",children:u?e.jsx("div",{className:"flex justify-center py-24",children:e.jsx(y,{className:"h-8 w-8 animate-spin text-brand"})}):r.length===0?e.jsxs("div",{className:"text-center py-24 text-muted-foreground",children:["No products found."," ",e.jsx(n,{to:"/",className:"text-brand hover:underline",children:"Back to home"})]}):e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-sm text-muted-foreground mb-6",children:[r.length," product",r.length!==1&&"s"]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4 md:gap-6",children:r.map(t=>e.jsx(w,{product:t},t.node.id))})]})})]}),e.jsx(j,{})]})}export{C 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.