(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,25913,e=>{"use strict";var t=e.i(7670);let r=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,a=t.clsx;e.s(["cva",0,(e,t)=>s=>{var n;if((null==t?void 0:t.variants)==null)return a(e,null==s?void 0:s.class,null==s?void 0:s.className);let{variants:i,defaultVariants:d}=t,l=Object.keys(i).map(e=>{let t=null==s?void 0:s[e],a=null==d?void 0:d[e];if(null===t)return null;let n=r(t)||r(a);return i[e][n]}),c=s&&Object.entries(s).reduce((e,t)=>{let[r,a]=t;return void 0===a||(e[r]=a),e},{});return a(e,l,null==t||null==(n=t.compoundVariants)?void 0:n.reduce((e,t)=>{let{class:r,className:a,...s}=t;return Object.entries(s).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...d,...c}[t]):({...d,...c})[t]===r})?[...e,r,a]:e},[]),null==s?void 0:s.class,null==s?void 0:s.className)}])},70065,e=>{"use strict";var t=e.i(43476),r=e.i(47163);e.s(["Card",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card",className:(0,r.cn)("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",e),...a})},"CardContent",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-content",className:(0,r.cn)("px-6",e),...a})},"CardDescription",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-description",className:(0,r.cn)("text-sm text-muted-foreground",e),...a})},"CardFooter",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-footer",className:(0,r.cn)("flex items-center px-6 [.border-t]:pt-6",e),...a})},"CardHeader",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-header",className:(0,r.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...a})},"CardTitle",0,function({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-title",className:(0,r.cn)("leading-none font-semibold",e),...a})}])},94179,e=>{"use strict";var t=e.i(43476),r=e.i(25913),a=e.i(47163);let s=(0,r.cva)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});e.s(["Badge",0,function({className:e,variant:r,...n}){return(0,t.jsx)("div",{className:(0,a.cn)(s({variant:r}),e),...n})}])},93353,e=>{"use strict";var t=e.i(43476),r=e.i(71645),a=e.i(70065),s=e.i(94179),n=e.i(22016);let i={pending:"bg-amber-500/20 text-amber-400 border-amber-500/30",active:"bg-green-500/20 text-green-400 border-green-500/30",cancelled:"bg-red-500/20 text-red-400 border-red-500/30"},d={pending:"Eingegangen",active:"In Bearbeitung",cancelled:"Storniert"};e.s(["AdminRecentOrders",0,function(){let[e,l]=(0,r.useState)([]),[c,o]=(0,r.useState)(new Set),[u,m]=(0,r.useState)(new Date),x=(0,r.useRef)(new Set),f=async()=>{try{let e=await fetch("/api/admin/recent-orders",{cache:"no-store"});if(!e.ok)return;let{orders:t}=await e.json(),r=new Set(t.map(e=>e.id)),a=new Set;r.forEach(e=>{x.current.has(e)||a.add(e)}),x.current=r,l(t),o(a),m(new Date),a.size>0&&setTimeout(()=>o(new Set),5e3)}catch(e){console.error("Polling error:",e)}};return(0,r.useEffect)(()=>{f();let e=setInterval(f,3e4);return()=>clearInterval(e)},[]),(0,t.jsxs)("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-7",children:[(0,t.jsxs)(a.Card,{className:"col-span-4 glass-dark border-white/5",children:[(0,t.jsx)(a.CardHeader,{children:(0,t.jsx)(a.CardTitle,{children:"Übersicht"})}),(0,t.jsx)(a.CardContent,{className:"pl-2",children:(0,t.jsx)("div",{className:"h-[200px] flex items-center justify-center text-slate-400 italic",children:"[Umsatz-Chart – folgt in nächstem Update]"})})]}),(0,t.jsxs)(a.Card,{className:"col-span-3 glass-dark border-white/5",children:[(0,t.jsxs)(a.CardHeader,{className:"flex flex-row items-center justify-between pb-3",children:[(0,t.jsx)(a.CardTitle,{children:"Neue Bestellungen"}),(0,t.jsxs)("span",{className:"text-[10px] text-slate-500",children:["Aktualisiert: ",u.toLocaleTimeString("de-DE")]})]}),(0,t.jsx)(a.CardContent,{children:0===e.length?(0,t.jsx)("p",{className:"text-slate-500 text-sm italic text-center py-8",children:"Noch keine Bestellungen"}):(0,t.jsx)("div",{className:"space-y-3",children:e.map(e=>{let r=c.has(e.id),a=e.customer_data?.company_name||`${e.customer_data?.first_name??""} ${e.customer_data?.last_name??""}`.trim()||"Unbekannt";return(0,t.jsx)(n.default,{href:"/admin/orders",className:"block",children:(0,t.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg transition-all duration-500 ${r?"bg-primary/10 border border-primary/30 shadow-[0_0_12px_rgba(59,130,246,0.2)]":"bg-white/5 hover:bg-white/10 border border-white/5"}`,children:[(0,t.jsx)("div",{className:"w-9 h-9 rounded-full bg-primary/10 flex items-center justify-center text-primary text-xs font-bold shrink-0",children:a.slice(0,2).toUpperCase()}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-white truncate",children:a}),(0,t.jsxs)("p",{className:"text-xs text-slate-500 font-mono",children:["#",e.order_number]})]}),(0,t.jsxs)("div",{className:"text-right shrink-0 space-y-1",children:[(0,t.jsx)("p",{className:"font-medium text-white text-sm",children:new Intl.NumberFormat("de-DE",{style:"currency",currency:"EUR"}).format(e.total_price)}),(0,t.jsx)(s.Badge,{className:`text-[10px] ${i[e.status]??""}`,children:d[e.status]??e.status})]})]})},e.id)})})})]})]})}])}]);