import{B as e,E as t,H as n,It as r,Mt as i,Q as a,T as o,U as s,V as c,W as l,Z as u,_t as d,at as f,d as p,ft as m,ht as h,jt as g,mt as _,ot as v,pt as y,s as b,st as x,tt as S,yt as C}from"./BA99CCI5.js";import"./xihTtKlq.js";import"./DGo8yE5j.js";import{t as w}from"./BB59mDRy.js";import{n as T}from"./B66v-P2b.js";var E=l(`<span class="font-mono text-xs text-neutral-400 dark:text-neutral-500"> </span>`),D=l(`<div class="flex w-full flex-col gap-1"><div class="flex items-center justify-between gap-2"><span class="font-mono text-xs text-neutral-700 dark:text-neutral-300"> <span class="text-neutral-400 dark:text-neutral-500"> </span></span> <!></div> <div class="h-1.5 w-full overflow-hidden rounded-full bg-neutral-200 dark:bg-neutral-700"><div></div></div></div>`),O=l(`<div class="flex items-center gap-2 whitespace-nowrap"><div class="h-1.5 w-12 flex-shrink-0 overflow-hidden rounded-full bg-neutral-200 dark:bg-neutral-700"><div></div></div> <span class="font-mono text-xs text-neutral-500 dark:text-neutral-400"> </span> <!></div>`),k=l(`<div class="flex flex-col gap-1"><div class="flex items-center justify-between gap-2"><span class="font-mono text-xs text-neutral-700 dark:text-neutral-300"> <span class="text-neutral-400 dark:text-neutral-500"> </span></span> <!></div> <div class="h-1.5 w-full overflow-hidden rounded-full bg-neutral-200 dark:bg-neutral-700"><div></div></div></div>`);function A(l,A){i(A,!1);let j=h(),M=h(),N=h(),P=b(A,`current`,8,0),F=b(A,`target`,8,0),I=b(A,`met`,8,!1),L=b(A,`mode`,8,`compact`),R=b(A,`colorMode`,8,`threshold`),z=b(A,`tooltip`,8,``),B=b(A,`tooltipPosition`,8,`bottom`),V=b(A,`tooltipAlign`,8,`middle`);function H(e,t,n){return t?`bg-green-500 dark:bg-green-400`:n===`completion`?`bg-yellow-500 dark:bg-yellow-400`:e>=.75?`bg-green-500 dark:bg-green-400`:e>=.5?`bg-yellow-500 dark:bg-yellow-400`:`bg-red-500 dark:bg-red-400`}f(()=>(u(F()),u(P())),()=>{d(j,F()>0?Math.max(0,Math.min(P()/F(),1)):0)}),f(()=>a(j),()=>{d(M,Math.round(a(j)*100))}),f(()=>(a(j),u(I()),u(R())),()=>{d(N,H(a(j),I(),R()))}),v(),p();var U=s(),W=y(U),G=i=>{{let l=C(()=>L()===`compact`);T(i,{get text(){return z()},get position(){return B()},get align(){return V()},get fullWidth(){return a(l)},children:(i,l)=>{var d=s(),f=y(d),p=i=>{var s=D(),l=m(s),d=m(l),f=m(d),p=_(f),h=m(p);r(p),r(d);var g=_(d,2),v=e=>{w(e,{size:14,class:`flex-shrink-0 text-green-600 dark:text-green-400`})},y=e=>{var t=E(),i=m(t);r(t),x(()=>c(i,`${a(M)??``}%`)),n(e,t)};e(g,e=>{I()?e(v):e(y,-1)}),r(l);var b=_(l,2),C=m(b);r(b),r(s),x((e,n)=>{c(f,`${e??``} `),c(h,`/ ${n??``}`),t(C,1,`h-full rounded-full transition-all ${a(N)??``}`),o(C,`width: ${a(M)??``}%`)},[()=>(u(P()),S(()=>P().toLocaleString())),()=>(u(F()),S(()=>F().toLocaleString()))]),n(i,s)},h=i=>{var s=O(),l=m(s),d=m(l);r(l);var f=_(l,2),p=m(f);r(f);var h=_(f,2),g=e=>{w(e,{size:12,class:`flex-shrink-0 text-green-600 dark:text-green-400`})};e(h,e=>{I()&&e(g)}),r(s),x((e,n)=>{t(d,1,`h-full rounded-full transition-all ${a(N)??``}`),o(d,`width: ${a(M)??``}%`),c(p,`${e??``} / ${n??``}`)},[()=>(u(P()),S(()=>P().toLocaleString())),()=>(u(F()),S(()=>F().toLocaleString()))]),n(i,s)};e(f,e=>{L()===`compact`?e(p):e(h,-1)}),n(i,d)},$$slots:{default:!0}})}},K=i=>{var s=k(),l=m(s),d=m(l),f=m(d),p=_(f),h=m(p);r(p),r(d);var g=_(d,2),v=e=>{w(e,{size:14,class:`flex-shrink-0 text-green-600 dark:text-green-400`})},y=e=>{var t=E(),i=m(t);r(t),x(()=>c(i,`${a(M)??``}%`)),n(e,t)};e(g,e=>{I()?e(v):e(y,-1)}),r(l);var b=_(l,2),C=m(b);r(b),r(s),x((e,n)=>{c(f,`${e??``} `),c(h,`/ ${n??``}`),t(C,1,`h-full rounded-full transition-all ${a(N)??``}`),o(C,`width: ${a(M)??``}%`)},[()=>(u(P()),S(()=>P().toLocaleString())),()=>(u(F()),S(()=>F().toLocaleString()))]),n(i,s)},q=i=>{var s=O(),l=m(s),d=m(l);r(l);var f=_(l,2),p=m(f);r(f);var h=_(f,2),g=e=>{w(e,{size:12,class:`flex-shrink-0 text-green-600 dark:text-green-400`})};e(h,e=>{I()&&e(g)}),r(s),x((e,n)=>{t(d,1,`h-full rounded-full transition-all ${a(N)??``}`),o(d,`width: ${a(M)??``}%`),c(p,`${e??``} / ${n??``}`)},[()=>(u(P()),S(()=>P().toLocaleString())),()=>(u(F()),S(()=>F().toLocaleString()))]),n(i,s)};e(W,e=>{z()?e(G):L()===`compact`?e(K,1):e(q,-1)}),n(l,U),g()}export{A as t};