import{j as e}from"./vendor-react-Dkpvlwai.js";import{C as k}from"./index-VJPzCABl.js";import{A as M}from"./AnimatedNumber-Bn2Qf9FV.js";import{b2 as C,b3 as A}from"./vendor-icons-CbmLcMl-.js";const W=({label:j,value:c,icon:v,trend:t,color:l="cyan",sparklineData:m})=>{const x={cyan:"text-primary",magenta:"text-secondary",lime:"text-success",gold:"text-warning",red:"text-destructive"},b={cyan:"bg-primary/10",magenta:"bg-secondary/10",lime:"bg-success/10",gold:"bg-warning/10",red:"bg-destructive/10"},y=r=>{if(!r||r.length<2)return null;const h=Math.min(...r),N=Math.max(...r)-h||1,p=100,a=40,$=u=>{const n=u.map((s,i)=>({x:i/(u.length-1)*p,y:a-(s-h)/N*a}));let f=`M ${n[0].x},${n[0].y}`;for(let s=0;s=0,w=typeof t=="number"?`${Math.abs(t)}%`:t;return e.jsxs(k,{variant:"surface",className:"flex flex-col justify-between h-full p-5 relative overflow-hidden rounded-xl",children:[e.jsxs("div",{className:"flex justify-between items-start gap-4 relative z-10",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-xs font-medium text-muted-foreground mb-0.5",children:j}),e.jsx("h3",{className:"text-xl font-semibold text-foreground tracking-tight truncate",children:typeof c=="number"?e.jsx(M,{value:c}):c})]}),e.jsx("div",{className:`p-2 rounded-lg shrink-0 ${b[l]} ${x[l]}`,children:v})]}),e.jsx("div",{className:"relative z-10 flex items-center gap-1.5 mt-3",children:t&&e.jsxs("div",{className:`flex items-center gap-1 text-xs font-medium ${d?"text-success":"text-destructive"}`,children:[d?e.jsx(C,{className:"w-3 h-3 shrink-0"}):e.jsx(A,{className:"w-3 h-3 shrink-0"}),e.jsx("span",{children:w}),e.jsx("span",{className:"text-muted-foreground font-normal",children:"vs last period"})]})}),m&&e.jsx("div",{className:`absolute bottom-0 left-0 right-0 h-12 ${x[l]} opacity-20 pointer-events-none`,children:y(m)})]})};export{W as S};