import{Ar as e,Sr as t,ei as n,fr as r,gr as i,hr as a,kn as o,ni as s,pr as c,ri as l,si as u,ur as d}from"./bEsZKPzd.js";import{X as f,Y as p}from"./CCO0nGOX.js";var m=u(p(),1),h={class:`flex items-center gap-2 pt-1`},g={class:`h-2 flex-1 overflow-hidden rounded-full bg-base-content/15`},_={class:`flex items-center justify-center rounded-full bg-secondary px-2 py-0.5 text-xs font-semibold text-secondary-content`},v={class:`mt-1.5 flex flex-wrap items-center justify-between gap-2`},y={class:`text-sm text-base-content/60`},b={class:`text-sm text-base-content/60`},x=t({__name:`SubscriptionInfo`,props:{subscriptionInfo:{}},setup(t){let u=t,{t:p}=o(),x=r(()=>u.subscriptionInfo?f(u.subscriptionInfo.Total||0,{units:`iec`}).toString():`0 B`),S=r(()=>{if(!u.subscriptionInfo)return`0 B`;let{Download:e=0,Upload:t=0}=u.subscriptionInfo;return f(e+t,{units:`iec`}).toString()}),C=r(()=>{if(!u.subscriptionInfo?.Total)return 0;let{Download:e=0,Upload:t=0,Total:n=1}=u.subscriptionInfo;return Math.min(Number(((e+t)/n*100).toFixed(1)),999)}),w=r(()=>u.subscriptionInfo?.Expire?(0,m.default)(u.subscriptionInfo.Expire*1e3).format(`YYYY-MM-DD`):p(`noExpire`));return(r,o)=>t.subscriptionInfo?(e(),i(d,{key:0},[c(`div`,h,[c(`div`,g,[c(`div`,{class:`h-full rounded-full transition-[width] duration-500 ease-out`,style:s({width:`${n(C)}%`,background:`linear-gradient(90deg, var(--color-primary), var(--color-secondary))`})},null,4)]),c(`div`,_,l(n(C))+`% `,1)]),c(`div`,v,[c(`div`,y,l(n(S))+` / `+l(n(x)),1),c(`div`,b,l(n(p)(`expire`))+`: `+l(n(w)),1)])],64)):a(``,!0)}}),S=Object.assign(x,{__name:`SubscriptionInfo`});export{S as t};