import{$i as e,Ai as t,Qi as n,Tr as r,Xi as i,_i as a,fi as o,hi as s,kr as c,mi as l,ra as u,vi as d,wi as f,wr as p}from"./CzLxtfx3.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=f({__name:`SubscriptionInfo`,props:{subscriptionInfo:{}},setup(u){let f=u,{t:p}=c(),x=l(()=>f.subscriptionInfo?r(f.subscriptionInfo.Total||0,{units:`iec`}).toString():`0 B`),S=l(()=>{if(!f.subscriptionInfo)return`0 B`;let{Download:e=0,Upload:t=0}=f.subscriptionInfo;return r(e+t,{units:`iec`}).toString()}),C=l(()=>{if(!f.subscriptionInfo?.Total)return 0;let{Download:e=0,Upload:t=0,Total:n=1}=f.subscriptionInfo;return Math.min(Number(((e+t)/n*100).toFixed(1)),999)}),w=l(()=>f.subscriptionInfo?.Expire?(0,m.default)(f.subscriptionInfo.Expire*1e3).format(`YYYY-MM-DD`):p(`noExpire`));return(r,c)=>u.subscriptionInfo?(t(),d(o,{key:0},[s(`div`,h,[s(`div`,g,[s(`div`,{class:`h-full rounded-full transition-[width] duration-500 ease-out`,style:n({width:`${i(C)}%`,background:`linear-gradient(90deg, var(--color-primary), var(--color-secondary))`})},null,4)]),s(`div`,_,e(i(C))+`% `,1)]),s(`div`,v,[s(`div`,y,e(i(S))+` / `+e(i(x)),1),s(`div`,b,e(i(p)(`expire`))+`: `+e(i(w)),1)])],64)):a(``,!0)}}),S=Object.assign(x,{__name:`SubscriptionInfo`});export{S as t};