import{E as e,H as t,I as n,J as r,O as i,X as a,Y as o,a as s,at as c,d as l,et as u,j as d,k as f,ot as p,ut as m}from"./DyGQ_VXC.js";import"./CQCxd1p9.js";var h=d(`<svg class="sparkline is-empty svelte-v8wd7u" role="img"><line x1="0" stroke="var(--border)" stroke-dasharray="2 3" stroke-width="1"></line></svg>`),g=d(`<defs><linearGradient x1="0" y1="0" x2="0" y2="1"><stop offset="0%" stop-opacity="0.5"></stop><stop offset="100%" stop-opacity="0"></stop></linearGradient></defs><path></path>`,1),_=d(`<svg class="sparkline svelte-v8wd7u" role="img"><!><path fill="none" stroke-linejoin="round" stroke-linecap="round"></path><circle></circle></svg>`);function v(d,v){p(v,!0);let y=s(v,`strokeWidth`,3,1.5),b=s(v,`width`,3,120),x=s(v,`height`,3,32),S=s(v,`tone`,3,`accent`),C=s(v,`fill`,3,!0),w=s(v,`ariaLabel`,3,`Activity trend`),T=u(()=>Array.isArray(v.points)?v.points:[]),E=u(()=>D(n(T),b(),x(),y()));function D(e,t,n,r){if(e.length<2)return{pathD:``,areaD:``,lastX:0,lastY:n/2,min:0,max:0};let i=r,a=Math.max(1,t-i*2),o=Math.max(1,n-i*2),s=Math.min(...e),c=Math.max(...e),l=c-s||1,u=a/(e.length-1),d=e.map((e,t)=>({x:i+u*t,y:i+o-(e-s)/l*o})),f=d.map((e,t)=>`${t===0?`M`:`L`}${e.x.toFixed(2)},${e.y.toFixed(2)}`).join(` `),p=`${f} L${d[d.length-1].x.toFixed(2)},${(n-i).toFixed(2)} L${d[0].x.toFixed(2)},${(n-i).toFixed(2)} Z`,m=d[d.length-1];return{pathD:f,areaD:p,lastX:m.x,lastY:m.y,min:s,max:c}}let O=`spark-grad-${Math.random().toString(36).slice(2,8)}`,k=u(()=>`var(--${S()})`),A=u(()=>`var(--${S()}-soft, var(--${S()}))`);var j=f(),M=o(j),N=e=>{var n=h(),a=r(n);m(n),t(()=>{l(n,`width`,b()),l(n,`height`,x()),l(n,`viewBox`,`0 0 ${b()??``} ${x()??``}`),l(n,`aria-label`,w()),l(a,`y1`,x()/2),l(a,`x2`,b()),l(a,`y2`,x()/2)}),i(e,n)},P=s=>{var c=_(),u=r(c),d=e=>{var s=g(),c=o(s),u=r(c),d=r(u),f=a(d);m(u),m(c);var p=a(c);t(()=>{l(u,`id`,O),l(d,`stop-color`,n(A)),l(f,`stop-color`,n(A)),l(p,`d`,n(E).areaD),l(p,`fill`,`url(#${O})`)}),i(e,s)};e(u,e=>{C()&&e(d)});var f=a(u),p=a(f);m(c),t(()=>{l(c,`width`,b()),l(c,`height`,x()),l(c,`viewBox`,`0 0 ${b()??``} ${x()??``}`),l(c,`aria-label`,w()),l(f,`d`,n(E).pathD),l(f,`stroke`,n(k)),l(f,`stroke-width`,y()),l(p,`cx`,n(E).lastX),l(p,`cy`,n(E).lastY),l(p,`r`,y()+.5),l(p,`fill`,n(k))}),i(s,c)};e(M,e=>{n(T).length<2?e(N):e(P,-1)}),i(d,j),c()}export{v as t};