1import{j as u,w as p,z as x,h as g,r as m,o as e,L as h,d as b,S as j,X as v,B as N}from"./index-DlQDt9gK.js";import{I as y}from"./input-BrXrzj_X.js";import{P as w}from"./product-card-bBU9BNZl.js";import{C as k}from"./category-sidebar-Bf0u74bR.js";import{u as C,R as _}from"./radio-BssieScl.js";const S=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],E=u("arrow-right",S);const $=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],A=u("chevron-left",$);const P=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],q=u("chevron-right",P);const R=[["path",{d:"M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z",key:"q8bfy3"}],["path",{d:"M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14",key:"1853fq"}],["path",{d:"M8 6v8",key:"15ugcq"}]],z=u("megaphone",R),G=9e3;function L(){const{lang:s,t:a}=p(),l=x(g.catalog.listHeroProducts,{limit:5}),t=x(g.announcements.listActiveAnnouncements,{}),[c,o]=m.useState(0),r=[...(t??[]).map(n=>({kind:"announcement",id:n._id,title:s==="el"?n.titleGr:n.titleEn,body:s==="el"?n.bodyGr:n.bodyEn,linkUrl:n.linkUrl,image:n.image})),...(l??[]).map(n=>({kind:"product",id:n._id,slug:n.slug,code:n.code,name:s==="el"?n.nameGr:n.nameEn,image:n.images?.[0]}))];if(m.useEffect(()=>{c>=r.length&&o(0)},[r.length,c]),m.useEffect(()=>{if(r.length<2)return;const n=setInterval(()=>o(d=>(d+1)%r.length),G);return()=>clearInterval(n)},[r.length]),l===void 0||t===void 0)return e.jsx("div",{className:"aspect-[4/3] w-full animate-pulse rounded-2xl bg-card/60 lg:aspect-auto lg:h-full","aria-hidden":!0});if(r.length===0)return null;const i=r[c]??r[0];function f(n){o(d=>(d+n+r.length)%r.length)}return e.jsx("div",{className:"relative w-full overflow-hidden rounded-2xl border border-border bg-card shadow-sm",children:e.jsxs("div",{className:"relative aspect-[4/3] w-full lg:h-full lg:min-h-[320px]",children:[i.kind==="announcement"?e.jsx(I,{slide:i}):e.jsx(M,{slide:i},i.id),r.length>1&&e.jsxs(e.Fragment,{children:[e.jsx("button",{type:"button",onClick:()=>f(-1),"aria-label":a("hero.prev"),className:"absolute left-2 top-1/2 -translate-y-1/2 inline-flex h-8 w-8 items-center justify-center rounded-full bg-background/80 text-foreground shadow-sm backdrop-blur transition-colors hover:bg-background",children:e.jsx(A,{className:"h-4 w-4"})}),e.jsx("button",{type:"button",onClick:()=>f(1),"aria-label":a("hero.next"),className:"absolute right-2 top-1/2 -translate-y-1/2 inline-flex h-8 w-8 items-center justify-center rounded-full bg-background/80 text-foreground shadow-sm backdrop-blur transition-colors hover:bg-background",children:e.jsx(q,{className:"h-4 w-4"})}),e.jsx("div",{className:"absolute bottom-3 left-0 right-0 flex justify-center gap-1.5",children:r.map((n,d)=>e.jsx("button",{type:"button",onClick:()=>o(d),"aria-label":`${d+1}`,className:`h-1.5 rounded-full transition-all ${d===c?"w-6 bg-brand":"w-1.5 bg-foreground
1/25 hover:bg-foreground/40"}`},n.id))})]})]})})}function I({slide:s}){const a=e.jsxs("div",{className:"relative flex h-full w-full flex-col justify-end p-5",children:[s.image?e.jsx("img",{src:s.image,alt:"",className:"absolute inset-0 h-full w-full object-cover",loading:"lazy"}):e.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-brand to-brand-2","aria-hidden":!0}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/70 via-black/20 to-transparent","aria-hidden":!0}),e.jsxs("div",{className:"relative",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-action px-2.5 py-1 fs-mono text-[0.62rem] font-bold uppercase tracking-wide text-brand",children:[e.jsx(z,{className:"h-3 w-3"})," Promo"]}),e.jsx("h3",{className:"mt-2 font-display text-xl font-bold leading-tight text-white sm:text-2xl",children:s.title}),s.body&&e.jsx("p",{className:"mt-1 line-clamp-2 text-sm text-white/85",children:s.body})]})]});return s.linkUrl?e.jsx("a",{href:s.linkUrl,className:"block h-full w-full",children:a}):a}function M({slide:s}){return e.jsxs(h,{to:"/product/$slug",params:{slug:s.slug},className:"flex h-full w-full flex-col",children:[e.jsx("div",{className:"relative flex-1 bg-white",children:s.image?e.jsx("img",{src:s.image,alt:s.name,className:"h-full w-full object-contain p-4",loading:"lazy"}):e.jsx("div",{className:"flex h-full items-center justify-center text-muted-foreground/40",children:s.code})}),e.jsx("div",{className:"border-t border-border bg-card px-4 py-3",children:e.jsx("span",{className:"line-clamp-1 text-sm font-semibold text-foreground",children:s.name})})]})}function X(){const{lang:s,t:a}=p(),{preloadedCategories:l}=b.useLoaderData(),t=C(l);return e.jsxs("div",{children:[e.jsx(B,{categories:t,t:a,lang:s}),e.jsxs("section",{className:"bg-[#cac9c9] mx-auto lg:py-14 sm:px-6 py-10 px-4 max-w-7xl",children:[e.jsx(H,{t:a}),e.jsxs("div",{className:"grid gap-8 lg:grid-cols-[260px_1fr]",children:[e.jsx("aside",{className:"hidden lg:block",children:e.jsx(k,{categories:t,lang:s,t:a})}),e.jsx("div",{children:e.jsx(T,{categories:t,t:a,lang:s})})]})]}),e.jsx(U,{categories:t,t:a,lang:s})]})}function B({categories:s,t:a,lang:l}){const t=s.reduce((c,o)=>
1c+(o.productCount??0),0);return e.jsxs("section",{className:"relative isolate overflow-hidden bg-muted text-foreground",children:[e.jsx("div",{className:"absolute inset-0 fs-grid-bg opacity-[0.35] [mask-image:radial-gradient(70%_60%_at_50%_30%,black,transparent)]","aria-hidden":!0}),e.jsx("div",{className:"relative bg-[#cac9c9] mx-auto sm:py-16 sm:px-6 py-14 px-4 max-w-7xl",children:e.jsxs("div",{className:"grid gap-8 lg:grid-cols-[1.1fr_1fr] lg:items-start",children:[e.jsxs("div",{children:[e.jsx("nav",{className:"fs-mono text-xs text-muted-foreground",children:e.jsx("span",{className:"text-signal",children:a("nav.home")})}),e.jsx("h1",{className:"mt-3 font-display text-3xl font-bold tracking-tight sm:text-4xl",children:"B2B - ÎαÏÎ¬Î»Î¿Î³Î¿Ï 2026"}),e.jsx("p",{className:"mt-3 max-w-2xl text-muted-foreground",children:l==="el"?"ÎÎ»Î¿Ï Î¿ ÏεÏνικÏÏ ÎºÎ±ÏÎ¬Î»Î¿Î³Î¿Ï Ïε δεκαÏÏÎµÎ¯Ï ÎºÎ±ÏηγοÏÎ¯ÎµÏ ÎºÎ±Î¹ 333 κÏδικοÏÏ.":"The complete technical catalog in ten categories and 328 product codes."}),e.jsxs("div",{className:"mt-6 flex gap-6 fs-mono text-sm text-signal",children:[e.jsxs("span",{children:[e.jsx("strong",{className:"font-bold",children:s.length})," ",e.jsx("span",{className:"text-muted-foreground",children:a("nav.categories")})]}),e.jsxs("span",{children:[e.jsx("strong",{className:"font-bold",children:t})," ",e.jsx("span",{className:"text-muted-foreground",children:a("home.hero.stat1Label")})]})]})]}),e.jsx("div",{className:"lg:mt-1",children:e.jsx(L,{})})]})})]})}function H({t:s}){const[a,l]=m.useState(""),[t,c]=m.useState("");m.useEffect(()=>{const i=setTimeout(()=>c(a.trim()),300);return()=>clearTimeout(i)},[a]);const o=x(g.catalog.searchProducts,t?{q:t,limit:12}:{q:" "}),r=t&&o?o:[];return e.jsxs("div",{className:"mb-12",children:[e.jsxs("div",{className:"relative mx-auto max-w-2xl",children:[e.jsx(j,{className:"pointer-events-none absolute left-3.5 top-1/2 h-5 w-5 -translate-y-1/2 text-muted-foreground"}),e.jsx(y,{value:a,onChange:i=>l(i.target.value),placeholder:s("search.placeholder"),className:"h-12 border-brand/15 bg-card pl-11 pr-11 text-base shadow-sm focus-visible:ring-signal","aria-label":s("common.search")}),a&&e.jsx("button",{onClick:()=>l(""),className:"absolute right-3 top-1/2 -translate-y-1/2 rounded p-1 text-muted-foreground hover:text-foreground","aria-label":"Clear",children:e.jsx(v,{className:"h-4 w-4"})})]}),t&&e.jsxs("div",{className:"mx-auto mt-6 max-w-5xl",children:[e.jsx("p",{className:"mb-4 text-sm text-muted-foreground",children:r.length>0?`${s("search.results")}: ${r.length}`:s("search.noResults")}),r.length>0&&e.jsx("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-4",children:r.map(i=>e.jsx(w,{product:i,canSeePrices:!1},i._id))})]})]})}function T({categories:s,t:a,lang:l}){return e.jsxs("div",{children:[e.jsx("h2",{className:"font-display text-xl font-bold tracking-tight text-foreground",children:a("nav.categories")}),e.jsx("div",{className:"mt-6 grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:s.map((t,c)=>{const o=l==="el"?t.nameGr:t.nameEn,r=l==="el"?t.descriptionGr:t.descriptionEn;return e.jsxs(h,{to:"/category/$slug",params:{slug:t.slug}
1,className:"group flex items-center gap-4 rounded-xl border border-border bg-card p-5 transition-all hover:-translate-y-0.5 hover:border-signal/40 hover:shadow-md",children:[e.jsx("span",{className:"inline-flex h-12 w-12 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-brand/10 text-brand transition-colors group-hover:bg-signal group-hover:text-brand",children:t.image?e.jsx("img",{src:t.image,alt:o,loading:"lazy",className:"h-full w-full object-contain p-1"}):e.jsx(_,{className:"h-6 w-6"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"fs-mono text-xs text-signal",children:String(c+1).padStart(2,"0")}),e.jsx("h3",{className:"font-display text-base font-semibold text-foreground line-clamp-1",children:o})]}),r&&e.jsx("p",{className:"mt-1 text-sm text-muted-foreground line-clamp-2",children:r}),e.jsxs("span",{className:"mt-1.5 inline-block text-xs text-muted-foreground",children:[t.productCount," ",a("home.categories.products")]})]}),e.jsx(E,{className:"h-5 w-5 shrink-0 text-muted-foreground/40 transition-all group-hover:translate-x-0.5 group-hover:text-brand"})]},t._id)})})]})}function U({categories:s,t:a,lang:l}){return e.jsx("section",{className:"border-t border-border bg-paper-2/40",children:e.jsxs("div",{className:"text-[#cac9c9] bg-[#cac9c9] mx-auto sm:px-6 py-12 px-4 max-w-7xl",children:[e.jsx("h2",{className:"font-display text-lg font-semibold text-foreground",children:a("home.categories.viewAll")}),e.jsx("div",{className:"mt-5 flex flex-wrap gap-2.5",children:s.map(t=>e.jsx(N,{asChild:!0,variant:"outline",size:"sm",className:"rounded-full border-brand/20 text-brand hover:bg-brand hover:text-primary-foreground",children:e.jsxs(h,{to:"/category/$slug",params:{slug:t.slug},children:[t.productCount," · ",l==="el"?t.nameGr:t.nameEn]})},t._id))})]})})}export{X 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.