@juliantanx/aiusage 1.5.1 → 1.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -18
- package/dist/index.js +1982 -662
- package/dist/web/_app/immutable/assets/12.C1f-IaHK.css +1 -0
- package/dist/web/_app/immutable/assets/7.CahA9iix.css +1 -0
- package/dist/web/_app/immutable/assets/_page.CahA9iix.css +1 -0
- package/dist/web/_app/immutable/assets/_page.DO7aPEA-.css +1 -0
- package/dist/web/_app/immutable/chunks/{ToolSelector.CofvKVw2.js → ToolSelector.0iI1cXVj.js} +2 -2
- package/dist/web/_app/immutable/chunks/api.DVLAklIn.js +1 -0
- package/dist/web/_app/immutable/chunks/{entry.BdArkS4U.js → entry.DhBBmiYe.js} +2 -2
- package/dist/web/_app/immutable/chunks/i18n.DApJIXOT.js +1 -0
- package/dist/web/_app/immutable/chunks/{index.66Vu9Sio.js → index.BfJlbjrK.js} +1 -1
- package/dist/web/_app/immutable/chunks/{stores.COyyqc3i.js → stores.CSRSkpU3.js} +1 -1
- package/dist/web/_app/immutable/entry/{app.fIWuRyD7.js → app.C_5glR-X.js} +2 -2
- package/dist/web/_app/immutable/entry/start.B0qYhR-d.js +1 -0
- package/dist/web/_app/immutable/nodes/{0.D19pLRbx.js → 0.DJfx41KV.js} +1 -1
- package/dist/web/_app/immutable/nodes/{1.Cr_OSeqa.js → 1.BLZj3WNW.js} +1 -1
- package/dist/web/_app/immutable/nodes/{10.DTaETIM6.js → 10.CnTuhaua.js} +1 -1
- package/dist/web/_app/immutable/nodes/{11.BbAcHr8g.js → 11.Bu1W8Jx8.js} +1 -1
- package/dist/web/_app/immutable/nodes/12.BCT8Dv1G.js +1 -0
- package/dist/web/_app/immutable/nodes/{13.BFaBQy6e.js → 13.Cu-n0wZ9.js} +1 -1
- package/dist/web/_app/immutable/nodes/{14.BgJEC28r.js → 14.u96Ucsue.js} +1 -1
- package/dist/web/_app/immutable/nodes/{15.DjuCO6OE.js → 15.CMhy_NGl.js} +1 -1
- package/dist/web/_app/immutable/nodes/{2.CoxR54dV.js → 2.JQynNxpe.js} +1 -1
- package/dist/web/_app/immutable/nodes/{3.Bua2oewW.js → 3.Chtgl9hh.js} +1 -1
- package/dist/web/_app/immutable/nodes/{4.DJwmYYKI.js → 4.BIau4H47.js} +1 -1
- package/dist/web/_app/immutable/nodes/{5.CXmtjVJL.js → 5.DtYG5yJy.js} +1 -1
- package/dist/web/_app/immutable/nodes/{6.kpxBlrHt.js → 6.B-ud4zCO.js} +1 -1
- package/dist/web/_app/immutable/nodes/7.7Fm6yzqA.js +9 -0
- package/dist/web/_app/immutable/nodes/{8.ByAI01dT.js → 8.Chp3dlzK.js} +1 -1
- package/dist/web/_app/immutable/nodes/{9.Ubt4Bfxd.js → 9.PMJrdCxq.js} +1 -1
- package/dist/web/_app/version.json +1 -1
- package/dist/web/index.html +7 -7
- package/package.json +7 -5
- package/dist/web/_app/immutable/assets/12.nNHFRI35.css +0 -1
- package/dist/web/_app/immutable/assets/7.oxd6PqWk.css +0 -1
- package/dist/web/_app/immutable/assets/_page.ZSDsIDry.css +0 -1
- package/dist/web/_app/immutable/assets/_page.oxd6PqWk.css +0 -1
- package/dist/web/_app/immutable/chunks/api.Mv_KcGhp.js +0 -1
- package/dist/web/_app/immutable/chunks/i18n.CwV3KceS.js +0 -1
- package/dist/web/_app/immutable/entry/start.B0xmplla.js +0 -1
- package/dist/web/_app/immutable/nodes/12.DeLNKhlw.js +0 -1
- package/dist/web/_app/immutable/nodes/7.LSfdx4vz.js +0 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as xe,c as me,r as et}from"../chunks/scheduler.DsWd5xup.js";import{S as tt,i as lt,d as r,k as qe,l as De,m as Se,s as C,a as z,b as a,n as Ne,o as u,p as st,g as V,c as v,e as m,f as R,q as Pe,r as ke,j as I,h as p,t as W,u as Ae,z as pe,w as je,x as oe,v as at}from"../chunks/index.66Vu9Sio.js";import{g as ot,e as ge,h as nt,i as rt}from"../chunks/api.Mv_KcGhp.js";import{f as we,b as K,c as ze,s as it,a as ct,d as ft}from"../chunks/stores.BSI_cVy6.js";import{t as ut}from"../chunks/i18n.CwV3KceS.js";import{D as dt,a as ht,T as _t}from"../chunks/ToolSelector.CofvKVw2.js";function $e(o,e,t){const l=o.slice();return l[17]=e[t],l[19]=t,l}function Ge(o,e,t){const l=o.slice();return l[20]=e[t],l}function vt(o){let e,t,l,s=o[5]("models.chartTitle")+"",n,f,g,b,E=o[5]("models.modeTokens")+"",T,w,c,d,D=o[5]("models.modeCost")+"",k,q,M,H,B,i,h=[],A=new Map,U,_,S=o[1]==="tokens"&&Je(o),O=ge(o[2]);const G=N=>N[17].model;for(let N=0;N<O.length;N+=1){let P=$e(o,O,N),j=G(P);A.set(j,h[N]=Ze(j,P))}return{c(){e=p("div"),t=p("div"),l=p("div"),n=W(s),f=I(),g=p("div"),b=p("button"),T=W(E),c=I(),d=p("button"),k=W(D),H=I(),S&&S.c(),B=I(),i=p("div");for(let N=0;N<h.length;N+=1)h[N].c();this.h()},l(N){e=v(N,"DIV",{class:!0});var P=m(e);t=v(P,"DIV",{class:!0});var j=m(t);l=v(j,"DIV",{class:!0});var Q=m(l);n=R(Q,s),Q.forEach(r),f=V(j),g=v(j,"DIV",{class:!0,role:!0,"aria-label":!0});var L=m(g);b=v(L,"BUTTON",{class:!0,"aria-pressed":!0});var x=m(b);T=R(x,E),x.forEach(r),c=V(L),d=v(L,"BUTTON",{class:!0,"aria-pressed":!0});var ee=m(d);k=R(ee,D),ee.forEach(r),L.forEach(r),j.forEach(r),H=V(P),S&&S.l(P),B=V(P),i=v(P,"DIV",{class:!0});var X=m(i);for(let Y=0;Y<h.length;Y+=1)h[Y].l(X);X.forEach(r),P.forEach(r),this.h()},h(){u(l,"class","section-title svelte-1kqg791"),u(b,"class","mode-btn svelte-1kqg791"),u(b,"aria-pressed",w=o[1]==="tokens"),pe(b,"active",o[1]==="tokens"),u(d,"class","mode-btn svelte-1kqg791"),u(d,"aria-pressed",q=o[1]==="cost"),pe(d,"active",o[1]==="cost"),u(g,"class","mode-toggle svelte-1kqg791"),u(g,"role","group"),u(g,"aria-label",M=o[5]("models.chartTitle")),u(t,"class","chart-header svelte-1kqg791"),u(i,"class","model-list svelte-1kqg791"),u(e,"class","card")},m(N,P){z(N,e,P),a(e,t),a(t,l),a(l,n),a(t,f),a(t,g),a(g,b),a(b,T),a(g,c),a(g,d),a(d,k),a(e,H),S&&S.m(e,null),a(e,B),a(e,i);for(let j=0;j<h.length;j+=1)h[j]&&h[j].m(i,null);U||(_=[je(b,"click",o[12]),je(d,"click",o[13])],U=!0)},p(N,P){P&32&&s!==(s=N[5]("models.chartTitle")+"")&&C(n,s),P&32&&E!==(E=N[5]("models.modeTokens")+"")&&C(T,E),P&2&&w!==(w=N[1]==="tokens")&&u(b,"aria-pressed",w),P&2&&pe(b,"active",N[1]==="tokens"),P&32&&D!==(D=N[5]("models.modeCost")+"")&&C(k,D),P&2&&q!==(q=N[1]==="cost")&&u(d,"aria-pressed",q),P&2&&pe(d,"active",N[1]==="cost"),P&32&&M!==(M=N[5]("models.chartTitle"))&&u(g,"aria-label",M),N[1]==="tokens"?S?S.p(N,P):(S=Je(N),S.c(),S.m(e,B)):S&&(S.d(1),S=null),P&486&&(O=ge(N[2]),h=nt(h,P,G,1,N,O,A,i,rt,Ze,null,$e))},d(N){N&&r(e),S&&S.d();for(let P=0;P<h.length;P+=1)h[P].d();U=!1,et(_)}}}function mt(o){let e,t,l=o[5]("models.noData")+"",s,n,f,g=o[5]("models.noDataHint")+"",b;return{c(){e=p("div"),t=p("h2"),s=W(l),n=I(),f=p("p"),b=W(g),this.h()},l(E){e=v(E,"DIV",{class:!0});var T=m(e);t=v(T,"H2",{});var w=m(t);s=R(w,l),w.forEach(r),n=V(T),f=v(T,"P",{});var c=m(f);b=R(c,g),c.forEach(r),T.forEach(r),this.h()},h(){u(e,"class","state-msg")},m(E,T){z(E,e,T),a(e,t),a(t,s),a(e,n),a(e,f),a(f,b)},p(E,T){T&32&&l!==(l=E[5]("models.noData")+"")&&C(s,l),T&32&&g!==(g=E[5]("models.noDataHint")+"")&&C(b,g)},d(E){E&&r(e)}}}function pt(o){let e,t;return{c(){e=p("div"),t=W(o[3]),this.h()},l(l){e=v(l,"DIV",{class:!0});var s=m(e);t=R(s,o[3]),s.forEach(r),this.h()},h(){u(e,"class","state-msg error")},m(l,s){z(l,e,s),a(e,t)},p(l,s){s&8&&C(t,l[3])},d(l){l&&r(e)}}}function kt(o){let e,t=o[5]("common.loading")+"",l;return{c(){e=p("div"),l=W(t),this.h()},l(s){e=v(s,"DIV",{class:!0});var n=m(e);l=R(n,t),n.forEach(r),this.h()},h(){u(e,"class","state-msg")},m(s,n){z(s,e,n),a(e,l)},p(s,n){n&32&&t!==(t=s[5]("common.loading")+"")&&C(l,t)},d(s){s&&r(e)}}}function Je(o){let e,t,l=o[5]("models.input")+"",s,n,f,g=o[5]("models.output")+"",b,E,T,w=o[5]("models.cacheRead")+"",c,d,D,k=o[5]("models.cacheWrite")+"",q,M,H,B=o[5]("models.thinking")+"",i;return{c(){e=p("div"),t=p("span"),s=W(l),n=I(),f=p("span"),b=W(g),E=I(),T=p("span"),c=W(w),d=I(),D=p("span"),q=W(k),M=I(),H=p("span"),i=W(B),this.h()},l(h){e=v(h,"DIV",{class:!0});var A=m(e);t=v(A,"SPAN",{class:!0});var U=m(t);s=R(U,l),U.forEach(r),n=V(A),f=v(A,"SPAN",{class:!0});var _=m(f);b=R(_,g),_.forEach(r),E=V(A),T=v(A,"SPAN",{class:!0});var S=m(T);c=R(S,w),S.forEach(r),d=V(A),D=v(A,"SPAN",{class:!0});var O=m(D);q=R(O,k),O.forEach(r),M=V(A),H=v(A,"SPAN",{class:!0});var G=m(H);i=R(G,B),G.forEach(r),A.forEach(r),this.h()},h(){u(t,"class","leg leg-i svelte-1kqg791"),u(f,"class","leg leg-o svelte-1kqg791"),u(T,"class","leg leg-cr svelte-1kqg791"),u(D,"class","leg leg-cw svelte-1kqg791"),u(H,"class","leg leg-thinking svelte-1kqg791"),u(e,"class","comp-legend svelte-1kqg791")},m(h,A){z(h,e,A),a(e,t),a(t,s),a(e,n),a(e,f),a(f,b),a(e,E),a(e,T),a(T,c),a(e,d),a(e,D),a(D,q),a(e,M),a(e,H),a(H,i)},p(h,A){A&32&&l!==(l=h[5]("models.input")+"")&&C(s,l),A&32&&g!==(g=h[5]("models.output")+"")&&C(b,g),A&32&&w!==(w=h[5]("models.cacheRead")+"")&&C(c,w),A&32&&k!==(k=h[5]("models.cacheWrite")+"")&&C(q,k),A&32&&B!==(B=h[5]("models.thinking")+"")&&C(i,B)},d(h){h&&r(e)}}}function gt(o){let e;return{c(){e=p("div"),this.h()},l(t){e=v(t,"DIV",{class:!0,style:!0}),m(e).forEach(r),this.h()},h(){u(e,"class","ranking-bar-fill svelte-1kqg791"),oe(e,"width",o[6](o[17])+"%")},m(t,l){z(t,e,l)},p(t,l){l&4&&oe(e,"width",t[6](t[17])+"%")},d(t){t&&r(e)}}}function bt(o){let e,t=ge(o[8](o[17])),l=[];for(let s=0;s<t.length;s+=1)l[s]=Ke(Ge(o,t,s));return{c(){for(let s=0;s<l.length;s+=1)l[s].c();e=ke()},l(s){for(let n=0;n<l.length;n+=1)l[n].l(s);e=ke()},m(s,n){for(let f=0;f<l.length;f+=1)l[f]&&l[f].m(s,n);z(s,e,n)},p(s,n){if(n&260){t=ge(s[8](s[17]));let f;for(f=0;f<t.length;f+=1){const g=Ge(s,t,f);l[f]?l[f].p(g,n):(l[f]=Ke(g),l[f].c(),l[f].m(e.parentNode,e))}for(;f<l.length;f+=1)l[f].d(1);l.length=t.length}},d(s){s&&r(e),at(l,s)}}}function Ke(o){let e,t;return{c(){e=p("div"),this.h()},l(l){e=v(l,"DIV",{class:!0,style:!0}),m(e).forEach(r),this.h()},h(){u(e,"class",t="stack-seg "+o[20].cls+" svelte-1kqg791"),oe(e,"width",o[20].w+"%")},m(l,s){z(l,e,s)},p(l,s){s&4&&t!==(t="stack-seg "+l[20].cls+" svelte-1kqg791")&&u(e,"class",t),s&4&&oe(e,"width",l[20].w+"%")},d(l){l&&r(e)}}}function Le(o){let e,t,l=K(o[17].inputTokens)+"",s,n,f,g=K(o[17].outputTokens)+"",b,E,T,w,c=o[17].cacheReadTokens&&Qe(o),d=o[17].cacheWriteTokens&&Xe(o),D=o[17].thinkingTokens&&Ye(o);return{c(){e=p("div"),t=p("span"),s=W(l),n=I(),f=p("span"),b=W(g),E=I(),c&&c.c(),T=I(),d&&d.c(),w=I(),D&&D.c(),this.h()},l(k){e=v(k,"DIV",{class:!0});var q=m(e);t=v(q,"SPAN",{class:!0});var M=m(t);s=R(M,l),M.forEach(r),n=V(q),f=v(q,"SPAN",{class:!0});var H=m(f);b=R(H,g),H.forEach(r),E=V(q),c&&c.l(q),T=V(q),d&&d.l(q),w=V(q),D&&D.l(q),q.forEach(r),this.h()},h(){u(t,"class","mono leg-i svelte-1kqg791"),u(f,"class","mono leg-o svelte-1kqg791"),u(e,"class","token-breakdown svelte-1kqg791")},m(k,q){z(k,e,q),a(e,t),a(t,s),a(e,n),a(e,f),a(f,b),a(e,E),c&&c.m(e,null),a(e,T),d&&d.m(e,null),a(e,w),D&&D.m(e,null)},p(k,q){q&4&&l!==(l=K(k[17].inputTokens)+"")&&C(s,l),q&4&&g!==(g=K(k[17].outputTokens)+"")&&C(b,g),k[17].cacheReadTokens?c?c.p(k,q):(c=Qe(k),c.c(),c.m(e,T)):c&&(c.d(1),c=null),k[17].cacheWriteTokens?d?d.p(k,q):(d=Xe(k),d.c(),d.m(e,w)):d&&(d.d(1),d=null),k[17].thinkingTokens?D?D.p(k,q):(D=Ye(k),D.c(),D.m(e,null)):D&&(D.d(1),D=null)},d(k){k&&r(e),c&&c.d(),d&&d.d(),D&&D.d()}}}function Qe(o){let e,t=K(o[17].cacheReadTokens)+"",l;return{c(){e=p("span"),l=W(t),this.h()},l(s){e=v(s,"SPAN",{class:!0});var n=m(e);l=R(n,t),n.forEach(r),this.h()},h(){u(e,"class","mono leg-cr svelte-1kqg791")},m(s,n){z(s,e,n),a(e,l)},p(s,n){n&4&&t!==(t=K(s[17].cacheReadTokens)+"")&&C(l,t)},d(s){s&&r(e)}}}function Xe(o){let e,t=K(o[17].cacheWriteTokens)+"",l;return{c(){e=p("span"),l=W(t),this.h()},l(s){e=v(s,"SPAN",{class:!0});var n=m(e);l=R(n,t),n.forEach(r),this.h()},h(){u(e,"class","mono leg-cw svelte-1kqg791")},m(s,n){z(s,e,n),a(e,l)},p(s,n){n&4&&t!==(t=K(s[17].cacheWriteTokens)+"")&&C(l,t)},d(s){s&&r(e)}}}function Ye(o){let e,t=K(o[17].thinkingTokens)+"",l;return{c(){e=p("span"),l=W(t),this.h()},l(s){e=v(s,"SPAN",{class:!0});var n=m(e);l=R(n,t),n.forEach(r),this.h()},h(){u(e,"class","mono leg-thinking svelte-1kqg791")},m(s,n){z(s,e,n),a(e,l)},p(s,n){n&4&&t!==(t=K(s[17].thinkingTokens)+"")&&C(l,t)},d(s){s&&r(e)}}}function Ze(o,e){let t,l,s,n=e[17].model+"",f,g,b,E=e[17].provider+"",T,w,c,d,D,k,q=e[7](e[17])+"",M,H,B,i,h,A,U=e[5]("models.cost")+"",_,S,O,G=we(e[17].totalCost)+"",N,P,j,Q,L=e[5]("models.calls")+"",x,ee,X,Y=ze(e[17].callCount)+"",ie,be,y,te,ne=e[5]("models.share")+"",ce,Ee,le,re=ye(e[17].percentage)+"",fe,Te;function Ve(Z,F){return Z[1]==="tokens"?bt:gt}let ue=Ve(e),J=ue(e),$=e[1]==="tokens"&&Le(e);return{key:o,first:null,c(){t=p("div"),l=p("div"),s=p("span"),f=W(n),g=I(),b=p("span"),T=W(E),w=I(),c=p("div"),d=p("div"),J.c(),D=I(),k=p("span"),M=W(q),H=I(),$&&$.c(),B=I(),i=p("div"),h=p("span"),A=p("span"),_=W(U),S=I(),O=p("span"),N=W(G),P=I(),j=p("span"),Q=p("span"),x=W(L),ee=I(),X=p("span"),ie=W(Y),be=I(),y=p("span"),te=p("span"),ce=W(ne),Ee=I(),le=p("span"),fe=W(re),Te=I(),this.h()},l(Z){t=v(Z,"DIV",{class:!0,style:!0});var F=m(t);l=v(F,"DIV",{class:!0});var de=m(l);s=v(de,"SPAN",{class:!0});var Ie=m(s);f=R(Ie,n),Ie.forEach(r),g=V(de),b=v(de,"SPAN",{class:!0});var Ce=m(b);T=R(Ce,E),Ce.forEach(r),de.forEach(r),w=V(F),c=v(F,"DIV",{class:!0});var se=m(c);d=v(se,"DIV",{class:!0});var Re=m(d);J.l(Re),Re.forEach(r),D=V(se),k=v(se,"SPAN",{class:!0});var We=m(k);M=R(We,q),We.forEach(r),H=V(se),$&&$.l(se),se.forEach(r),B=V(F),i=v(F,"DIV",{class:!0});var ae=m(i);h=v(ae,"SPAN",{class:!0});var he=m(h);A=v(he,"SPAN",{class:!0});var Me=m(A);_=R(Me,U),Me.forEach(r),S=V(he),O=v(he,"SPAN",{class:!0});var He=m(O);N=R(He,G),He.forEach(r),he.forEach(r),P=V(ae),j=v(ae,"SPAN",{class:!0});var _e=m(j);Q=v(_e,"SPAN",{class:!0});var Ue=m(Q);x=R(Ue,L),Ue.forEach(r),ee=V(_e),X=v(_e,"SPAN",{class:!0});var Be=m(X);ie=R(Be,Y),Be.forEach(r),_e.forEach(r),be=V(ae),y=v(ae,"SPAN",{class:!0});var ve=m(y);te=v(ve,"SPAN",{class:!0});var Fe=m(te);ce=R(Fe,ne),Fe.forEach(r),Ee=V(ve),le=v(ve,"SPAN",{class:!0});var Oe=m(le);fe=R(Oe,re),Oe.forEach(r),ve.forEach(r),ae.forEach(r),Te=V(F),F.forEach(r),this.h()},h(){u(s,"class","mono model-name svelte-1kqg791"),u(b,"class","model-provider svelte-1kqg791"),u(l,"class","model-meta svelte-1kqg791"),u(d,"class","bar-track svelte-1kqg791"),u(k,"class","mono bar-value svelte-1kqg791"),u(c,"class","bar-area svelte-1kqg791"),u(A,"class","stat-label svelte-1kqg791"),u(O,"class","mono stat-value svelte-1kqg791"),u(h,"class","stat-item svelte-1kqg791"),u(Q,"class","stat-label svelte-1kqg791"),u(X,"class","mono stat-value svelte-1kqg791"),u(j,"class","stat-item svelte-1kqg791"),u(te,"class","stat-label svelte-1kqg791"),u(le,"class","mono stat-value svelte-1kqg791"),u(y,"class","stat-item svelte-1kqg791"),u(i,"class","model-stats svelte-1kqg791"),u(t,"class","model-row animate-row svelte-1kqg791"),oe(t,"animation-delay",e[19]*30+"ms"),this.first=t},m(Z,F){z(Z,t,F),a(t,l),a(l,s),a(s,f),a(l,g),a(l,b),a(b,T),a(t,w),a(t,c),a(c,d),J.m(d,null),a(c,D),a(c,k),a(k,M),a(c,H),$&&$.m(c,null),a(t,B),a(t,i),a(i,h),a(h,A),a(A,_),a(h,S),a(h,O),a(O,N),a(i,P),a(i,j),a(j,Q),a(Q,x),a(j,ee),a(j,X),a(X,ie),a(i,be),a(i,y),a(y,te),a(te,ce),a(y,Ee),a(y,le),a(le,fe),a(t,Te)},p(Z,F){e=Z,F&4&&n!==(n=e[17].model+"")&&C(f,n),F&4&&E!==(E=e[17].provider+"")&&C(T,E),ue===(ue=Ve(e))&&J?J.p(e,F):(J.d(1),J=ue(e),J&&(J.c(),J.m(d,null))),F&4&&q!==(q=e[7](e[17])+"")&&C(M,q),e[1]==="tokens"?$?$.p(e,F):($=Le(e),$.c(),$.m(c,null)):$&&($.d(1),$=null),F&32&&U!==(U=e[5]("models.cost")+"")&&C(_,U),F&4&&G!==(G=we(e[17].totalCost)+"")&&C(N,G),F&32&&L!==(L=e[5]("models.calls")+"")&&C(x,L),F&4&&Y!==(Y=ze(e[17].callCount)+"")&&C(ie,Y),F&32&&ne!==(ne=e[5]("models.share")+"")&&C(ce,ne),F&4&&re!==(re=ye(e[17].percentage)+"")&&C(fe,re),F&4&&oe(t,"animation-delay",e[19]*30+"ms")},d(Z){Z&&r(t),J.d(),$&&$.d()}}}function Et(o){let e,t,l,s,n=o[5]("models.title")+"",f,g,b,E=o[5]("models.desc")+"",T,w,c,d,D,k,q,M,H,B,i;document.title=e=o[5]("models.title")+" — AIUsage",d=new dt({}),k=new ht({}),M=new _t({});function h(_,S){var O;return _[4]?kt:_[3]?pt:(O=_[0])!=null&&O.models.length?vt:mt}let A=h(o),U=A(o);return{c(){t=I(),l=p("div"),s=p("h1"),f=W(n),g=I(),b=p("p"),T=W(E),w=I(),c=p("div"),Ae(d.$$.fragment),D=I(),Ae(k.$$.fragment),q=I(),Ae(M.$$.fragment),H=I(),U.c(),B=ke(),this.h()},l(_){st("svelte-1sv33gh",document.head).forEach(r),t=V(_),l=v(_,"DIV",{class:!0});var O=m(l);s=v(O,"H1",{});var G=m(s);f=R(G,n),G.forEach(r),g=V(O),b=v(O,"P",{});var N=m(b);T=R(N,E),N.forEach(r),O.forEach(r),w=V(_),c=v(_,"DIV",{class:!0});var P=m(c);Pe(d.$$.fragment,P),D=V(P),Pe(k.$$.fragment,P),q=V(P),Pe(M.$$.fragment,P),P.forEach(r),H=V(_),U.l(_),B=ke(),this.h()},h(){u(l,"class","page-header"),u(c,"class","filter-bar")},m(_,S){z(_,t,S),z(_,l,S),a(l,s),a(s,f),a(l,g),a(l,b),a(b,T),z(_,w,S),z(_,c,S),Ne(d,c,null),a(c,D),Ne(k,c,null),a(c,q),Ne(M,c,null),z(_,H,S),U.m(_,S),z(_,B,S),i=!0},p(_,[S]){(!i||S&32)&&e!==(e=_[5]("models.title")+" — AIUsage")&&(document.title=e),(!i||S&32)&&n!==(n=_[5]("models.title")+"")&&C(f,n),(!i||S&32)&&E!==(E=_[5]("models.desc")+"")&&C(T,E),A===(A=h(_))&&U?U.p(_,S):(U.d(1),U=A(_),U&&(U.c(),U.m(B.parentNode,B)))},i(_){i||(Se(d.$$.fragment,_),Se(k.$$.fragment,_),Se(M.$$.fragment,_),i=!0)},o(_){De(d.$$.fragment,_),De(k.$$.fragment,_),De(M.$$.fragment,_),i=!1},d(_){_&&(r(t),r(l),r(w),r(c),r(H),r(B)),qe(d),qe(k),qe(M),U.d(_)}}}function ye(o){return`${Number(o||0).toFixed(1)}%`}function Tt(o,e,t){let l,s,n,f,g,b;me(o,it,i=>t(9,n=i)),me(o,ct,i=>t(10,f=i)),me(o,ft,i=>t(11,g=i)),me(o,ut,i=>t(5,b=i));let E=null,T=null,w=!0,c="tokens";async function d(){t(4,w=!0),t(3,T=null);try{t(0,E=await ot({...g,device:f,tool:n}))}catch(i){t(3,T=i instanceof Error?i.message:"Failed to load data"),t(0,E=null)}finally{t(4,w=!1)}}function D(i){return c==="cost"?i.totalCost:i.totalTokens}function k(i){const h=D(i);return s>0?h/s*100:0}function q(i){return c==="cost"?we(i.totalCost):K(i.totalTokens)}function M(i){const h=s||1;return[{cls:"seg-input",w:(i.inputTokens||0)/h*100},{cls:"seg-output",w:(i.outputTokens||0)/h*100},{cls:"seg-cr",w:(i.cacheReadTokens||0)/h*100},{cls:"seg-cw",w:(i.cacheWriteTokens||0)/h*100},{cls:"seg-thinking",w:(i.thinkingTokens||0)/h*100}]}const H=()=>t(1,c="tokens"),B=()=>t(1,c="cost");return o.$$.update=()=>{o.$$.dirty&3584&&d(),o.$$.dirty&3&&t(2,l=[...(E==null?void 0:E.models)||[]].sort((i,h)=>c==="cost"?h.totalCost-i.totalCost:h.totalTokens-i.totalTokens)),o.$$.dirty&6&&(s=l.length?Math.max(...l.map(i=>c==="cost"?i.totalCost:i.totalTokens)):0)},[E,c,l,T,w,b,k,q,M,n,f,g,H,B]}class wt extends tt{constructor(e){super(),lt(this,e,Tt,Et,xe,{})}}export{wt as component};
|
|
1
|
+
import{s as xe,c as me,r as et}from"../chunks/scheduler.DsWd5xup.js";import{S as tt,i as lt,d as r,k as qe,l as De,m as Se,s as C,a as z,b as a,n as Ne,o as u,p as st,g as V,c as v,e as m,f as R,q as Pe,r as ke,j as I,h as p,t as W,u as Ae,z as pe,w as je,x as oe,v as at}from"../chunks/index.BfJlbjrK.js";import{g as ot,e as ge,h as nt,i as rt}from"../chunks/api.DVLAklIn.js";import{f as we,b as K,c as ze,s as it,a as ct,d as ft}from"../chunks/stores.BSI_cVy6.js";import{t as ut}from"../chunks/i18n.DApJIXOT.js";import{D as dt,a as ht,T as _t}from"../chunks/ToolSelector.0iI1cXVj.js";function $e(o,e,t){const l=o.slice();return l[17]=e[t],l[19]=t,l}function Ge(o,e,t){const l=o.slice();return l[20]=e[t],l}function vt(o){let e,t,l,s=o[5]("models.chartTitle")+"",n,f,g,b,E=o[5]("models.modeTokens")+"",T,w,c,d,D=o[5]("models.modeCost")+"",k,q,M,H,B,i,h=[],A=new Map,U,_,S=o[1]==="tokens"&&Je(o),O=ge(o[2]);const G=N=>N[17].model;for(let N=0;N<O.length;N+=1){let P=$e(o,O,N),j=G(P);A.set(j,h[N]=Ze(j,P))}return{c(){e=p("div"),t=p("div"),l=p("div"),n=W(s),f=I(),g=p("div"),b=p("button"),T=W(E),c=I(),d=p("button"),k=W(D),H=I(),S&&S.c(),B=I(),i=p("div");for(let N=0;N<h.length;N+=1)h[N].c();this.h()},l(N){e=v(N,"DIV",{class:!0});var P=m(e);t=v(P,"DIV",{class:!0});var j=m(t);l=v(j,"DIV",{class:!0});var Q=m(l);n=R(Q,s),Q.forEach(r),f=V(j),g=v(j,"DIV",{class:!0,role:!0,"aria-label":!0});var L=m(g);b=v(L,"BUTTON",{class:!0,"aria-pressed":!0});var x=m(b);T=R(x,E),x.forEach(r),c=V(L),d=v(L,"BUTTON",{class:!0,"aria-pressed":!0});var ee=m(d);k=R(ee,D),ee.forEach(r),L.forEach(r),j.forEach(r),H=V(P),S&&S.l(P),B=V(P),i=v(P,"DIV",{class:!0});var X=m(i);for(let Y=0;Y<h.length;Y+=1)h[Y].l(X);X.forEach(r),P.forEach(r),this.h()},h(){u(l,"class","section-title svelte-1kqg791"),u(b,"class","mode-btn svelte-1kqg791"),u(b,"aria-pressed",w=o[1]==="tokens"),pe(b,"active",o[1]==="tokens"),u(d,"class","mode-btn svelte-1kqg791"),u(d,"aria-pressed",q=o[1]==="cost"),pe(d,"active",o[1]==="cost"),u(g,"class","mode-toggle svelte-1kqg791"),u(g,"role","group"),u(g,"aria-label",M=o[5]("models.chartTitle")),u(t,"class","chart-header svelte-1kqg791"),u(i,"class","model-list svelte-1kqg791"),u(e,"class","card")},m(N,P){z(N,e,P),a(e,t),a(t,l),a(l,n),a(t,f),a(t,g),a(g,b),a(b,T),a(g,c),a(g,d),a(d,k),a(e,H),S&&S.m(e,null),a(e,B),a(e,i);for(let j=0;j<h.length;j+=1)h[j]&&h[j].m(i,null);U||(_=[je(b,"click",o[12]),je(d,"click",o[13])],U=!0)},p(N,P){P&32&&s!==(s=N[5]("models.chartTitle")+"")&&C(n,s),P&32&&E!==(E=N[5]("models.modeTokens")+"")&&C(T,E),P&2&&w!==(w=N[1]==="tokens")&&u(b,"aria-pressed",w),P&2&&pe(b,"active",N[1]==="tokens"),P&32&&D!==(D=N[5]("models.modeCost")+"")&&C(k,D),P&2&&q!==(q=N[1]==="cost")&&u(d,"aria-pressed",q),P&2&&pe(d,"active",N[1]==="cost"),P&32&&M!==(M=N[5]("models.chartTitle"))&&u(g,"aria-label",M),N[1]==="tokens"?S?S.p(N,P):(S=Je(N),S.c(),S.m(e,B)):S&&(S.d(1),S=null),P&486&&(O=ge(N[2]),h=nt(h,P,G,1,N,O,A,i,rt,Ze,null,$e))},d(N){N&&r(e),S&&S.d();for(let P=0;P<h.length;P+=1)h[P].d();U=!1,et(_)}}}function mt(o){let e,t,l=o[5]("models.noData")+"",s,n,f,g=o[5]("models.noDataHint")+"",b;return{c(){e=p("div"),t=p("h2"),s=W(l),n=I(),f=p("p"),b=W(g),this.h()},l(E){e=v(E,"DIV",{class:!0});var T=m(e);t=v(T,"H2",{});var w=m(t);s=R(w,l),w.forEach(r),n=V(T),f=v(T,"P",{});var c=m(f);b=R(c,g),c.forEach(r),T.forEach(r),this.h()},h(){u(e,"class","state-msg")},m(E,T){z(E,e,T),a(e,t),a(t,s),a(e,n),a(e,f),a(f,b)},p(E,T){T&32&&l!==(l=E[5]("models.noData")+"")&&C(s,l),T&32&&g!==(g=E[5]("models.noDataHint")+"")&&C(b,g)},d(E){E&&r(e)}}}function pt(o){let e,t;return{c(){e=p("div"),t=W(o[3]),this.h()},l(l){e=v(l,"DIV",{class:!0});var s=m(e);t=R(s,o[3]),s.forEach(r),this.h()},h(){u(e,"class","state-msg error")},m(l,s){z(l,e,s),a(e,t)},p(l,s){s&8&&C(t,l[3])},d(l){l&&r(e)}}}function kt(o){let e,t=o[5]("common.loading")+"",l;return{c(){e=p("div"),l=W(t),this.h()},l(s){e=v(s,"DIV",{class:!0});var n=m(e);l=R(n,t),n.forEach(r),this.h()},h(){u(e,"class","state-msg")},m(s,n){z(s,e,n),a(e,l)},p(s,n){n&32&&t!==(t=s[5]("common.loading")+"")&&C(l,t)},d(s){s&&r(e)}}}function Je(o){let e,t,l=o[5]("models.input")+"",s,n,f,g=o[5]("models.output")+"",b,E,T,w=o[5]("models.cacheRead")+"",c,d,D,k=o[5]("models.cacheWrite")+"",q,M,H,B=o[5]("models.thinking")+"",i;return{c(){e=p("div"),t=p("span"),s=W(l),n=I(),f=p("span"),b=W(g),E=I(),T=p("span"),c=W(w),d=I(),D=p("span"),q=W(k),M=I(),H=p("span"),i=W(B),this.h()},l(h){e=v(h,"DIV",{class:!0});var A=m(e);t=v(A,"SPAN",{class:!0});var U=m(t);s=R(U,l),U.forEach(r),n=V(A),f=v(A,"SPAN",{class:!0});var _=m(f);b=R(_,g),_.forEach(r),E=V(A),T=v(A,"SPAN",{class:!0});var S=m(T);c=R(S,w),S.forEach(r),d=V(A),D=v(A,"SPAN",{class:!0});var O=m(D);q=R(O,k),O.forEach(r),M=V(A),H=v(A,"SPAN",{class:!0});var G=m(H);i=R(G,B),G.forEach(r),A.forEach(r),this.h()},h(){u(t,"class","leg leg-i svelte-1kqg791"),u(f,"class","leg leg-o svelte-1kqg791"),u(T,"class","leg leg-cr svelte-1kqg791"),u(D,"class","leg leg-cw svelte-1kqg791"),u(H,"class","leg leg-thinking svelte-1kqg791"),u(e,"class","comp-legend svelte-1kqg791")},m(h,A){z(h,e,A),a(e,t),a(t,s),a(e,n),a(e,f),a(f,b),a(e,E),a(e,T),a(T,c),a(e,d),a(e,D),a(D,q),a(e,M),a(e,H),a(H,i)},p(h,A){A&32&&l!==(l=h[5]("models.input")+"")&&C(s,l),A&32&&g!==(g=h[5]("models.output")+"")&&C(b,g),A&32&&w!==(w=h[5]("models.cacheRead")+"")&&C(c,w),A&32&&k!==(k=h[5]("models.cacheWrite")+"")&&C(q,k),A&32&&B!==(B=h[5]("models.thinking")+"")&&C(i,B)},d(h){h&&r(e)}}}function gt(o){let e;return{c(){e=p("div"),this.h()},l(t){e=v(t,"DIV",{class:!0,style:!0}),m(e).forEach(r),this.h()},h(){u(e,"class","ranking-bar-fill svelte-1kqg791"),oe(e,"width",o[6](o[17])+"%")},m(t,l){z(t,e,l)},p(t,l){l&4&&oe(e,"width",t[6](t[17])+"%")},d(t){t&&r(e)}}}function bt(o){let e,t=ge(o[8](o[17])),l=[];for(let s=0;s<t.length;s+=1)l[s]=Ke(Ge(o,t,s));return{c(){for(let s=0;s<l.length;s+=1)l[s].c();e=ke()},l(s){for(let n=0;n<l.length;n+=1)l[n].l(s);e=ke()},m(s,n){for(let f=0;f<l.length;f+=1)l[f]&&l[f].m(s,n);z(s,e,n)},p(s,n){if(n&260){t=ge(s[8](s[17]));let f;for(f=0;f<t.length;f+=1){const g=Ge(s,t,f);l[f]?l[f].p(g,n):(l[f]=Ke(g),l[f].c(),l[f].m(e.parentNode,e))}for(;f<l.length;f+=1)l[f].d(1);l.length=t.length}},d(s){s&&r(e),at(l,s)}}}function Ke(o){let e,t;return{c(){e=p("div"),this.h()},l(l){e=v(l,"DIV",{class:!0,style:!0}),m(e).forEach(r),this.h()},h(){u(e,"class",t="stack-seg "+o[20].cls+" svelte-1kqg791"),oe(e,"width",o[20].w+"%")},m(l,s){z(l,e,s)},p(l,s){s&4&&t!==(t="stack-seg "+l[20].cls+" svelte-1kqg791")&&u(e,"class",t),s&4&&oe(e,"width",l[20].w+"%")},d(l){l&&r(e)}}}function Le(o){let e,t,l=K(o[17].inputTokens)+"",s,n,f,g=K(o[17].outputTokens)+"",b,E,T,w,c=o[17].cacheReadTokens&&Qe(o),d=o[17].cacheWriteTokens&&Xe(o),D=o[17].thinkingTokens&&Ye(o);return{c(){e=p("div"),t=p("span"),s=W(l),n=I(),f=p("span"),b=W(g),E=I(),c&&c.c(),T=I(),d&&d.c(),w=I(),D&&D.c(),this.h()},l(k){e=v(k,"DIV",{class:!0});var q=m(e);t=v(q,"SPAN",{class:!0});var M=m(t);s=R(M,l),M.forEach(r),n=V(q),f=v(q,"SPAN",{class:!0});var H=m(f);b=R(H,g),H.forEach(r),E=V(q),c&&c.l(q),T=V(q),d&&d.l(q),w=V(q),D&&D.l(q),q.forEach(r),this.h()},h(){u(t,"class","mono leg-i svelte-1kqg791"),u(f,"class","mono leg-o svelte-1kqg791"),u(e,"class","token-breakdown svelte-1kqg791")},m(k,q){z(k,e,q),a(e,t),a(t,s),a(e,n),a(e,f),a(f,b),a(e,E),c&&c.m(e,null),a(e,T),d&&d.m(e,null),a(e,w),D&&D.m(e,null)},p(k,q){q&4&&l!==(l=K(k[17].inputTokens)+"")&&C(s,l),q&4&&g!==(g=K(k[17].outputTokens)+"")&&C(b,g),k[17].cacheReadTokens?c?c.p(k,q):(c=Qe(k),c.c(),c.m(e,T)):c&&(c.d(1),c=null),k[17].cacheWriteTokens?d?d.p(k,q):(d=Xe(k),d.c(),d.m(e,w)):d&&(d.d(1),d=null),k[17].thinkingTokens?D?D.p(k,q):(D=Ye(k),D.c(),D.m(e,null)):D&&(D.d(1),D=null)},d(k){k&&r(e),c&&c.d(),d&&d.d(),D&&D.d()}}}function Qe(o){let e,t=K(o[17].cacheReadTokens)+"",l;return{c(){e=p("span"),l=W(t),this.h()},l(s){e=v(s,"SPAN",{class:!0});var n=m(e);l=R(n,t),n.forEach(r),this.h()},h(){u(e,"class","mono leg-cr svelte-1kqg791")},m(s,n){z(s,e,n),a(e,l)},p(s,n){n&4&&t!==(t=K(s[17].cacheReadTokens)+"")&&C(l,t)},d(s){s&&r(e)}}}function Xe(o){let e,t=K(o[17].cacheWriteTokens)+"",l;return{c(){e=p("span"),l=W(t),this.h()},l(s){e=v(s,"SPAN",{class:!0});var n=m(e);l=R(n,t),n.forEach(r),this.h()},h(){u(e,"class","mono leg-cw svelte-1kqg791")},m(s,n){z(s,e,n),a(e,l)},p(s,n){n&4&&t!==(t=K(s[17].cacheWriteTokens)+"")&&C(l,t)},d(s){s&&r(e)}}}function Ye(o){let e,t=K(o[17].thinkingTokens)+"",l;return{c(){e=p("span"),l=W(t),this.h()},l(s){e=v(s,"SPAN",{class:!0});var n=m(e);l=R(n,t),n.forEach(r),this.h()},h(){u(e,"class","mono leg-thinking svelte-1kqg791")},m(s,n){z(s,e,n),a(e,l)},p(s,n){n&4&&t!==(t=K(s[17].thinkingTokens)+"")&&C(l,t)},d(s){s&&r(e)}}}function Ze(o,e){let t,l,s,n=e[17].model+"",f,g,b,E=e[17].provider+"",T,w,c,d,D,k,q=e[7](e[17])+"",M,H,B,i,h,A,U=e[5]("models.cost")+"",_,S,O,G=we(e[17].totalCost)+"",N,P,j,Q,L=e[5]("models.calls")+"",x,ee,X,Y=ze(e[17].callCount)+"",ie,be,y,te,ne=e[5]("models.share")+"",ce,Ee,le,re=ye(e[17].percentage)+"",fe,Te;function Ve(Z,F){return Z[1]==="tokens"?bt:gt}let ue=Ve(e),J=ue(e),$=e[1]==="tokens"&&Le(e);return{key:o,first:null,c(){t=p("div"),l=p("div"),s=p("span"),f=W(n),g=I(),b=p("span"),T=W(E),w=I(),c=p("div"),d=p("div"),J.c(),D=I(),k=p("span"),M=W(q),H=I(),$&&$.c(),B=I(),i=p("div"),h=p("span"),A=p("span"),_=W(U),S=I(),O=p("span"),N=W(G),P=I(),j=p("span"),Q=p("span"),x=W(L),ee=I(),X=p("span"),ie=W(Y),be=I(),y=p("span"),te=p("span"),ce=W(ne),Ee=I(),le=p("span"),fe=W(re),Te=I(),this.h()},l(Z){t=v(Z,"DIV",{class:!0,style:!0});var F=m(t);l=v(F,"DIV",{class:!0});var de=m(l);s=v(de,"SPAN",{class:!0});var Ie=m(s);f=R(Ie,n),Ie.forEach(r),g=V(de),b=v(de,"SPAN",{class:!0});var Ce=m(b);T=R(Ce,E),Ce.forEach(r),de.forEach(r),w=V(F),c=v(F,"DIV",{class:!0});var se=m(c);d=v(se,"DIV",{class:!0});var Re=m(d);J.l(Re),Re.forEach(r),D=V(se),k=v(se,"SPAN",{class:!0});var We=m(k);M=R(We,q),We.forEach(r),H=V(se),$&&$.l(se),se.forEach(r),B=V(F),i=v(F,"DIV",{class:!0});var ae=m(i);h=v(ae,"SPAN",{class:!0});var he=m(h);A=v(he,"SPAN",{class:!0});var Me=m(A);_=R(Me,U),Me.forEach(r),S=V(he),O=v(he,"SPAN",{class:!0});var He=m(O);N=R(He,G),He.forEach(r),he.forEach(r),P=V(ae),j=v(ae,"SPAN",{class:!0});var _e=m(j);Q=v(_e,"SPAN",{class:!0});var Ue=m(Q);x=R(Ue,L),Ue.forEach(r),ee=V(_e),X=v(_e,"SPAN",{class:!0});var Be=m(X);ie=R(Be,Y),Be.forEach(r),_e.forEach(r),be=V(ae),y=v(ae,"SPAN",{class:!0});var ve=m(y);te=v(ve,"SPAN",{class:!0});var Fe=m(te);ce=R(Fe,ne),Fe.forEach(r),Ee=V(ve),le=v(ve,"SPAN",{class:!0});var Oe=m(le);fe=R(Oe,re),Oe.forEach(r),ve.forEach(r),ae.forEach(r),Te=V(F),F.forEach(r),this.h()},h(){u(s,"class","mono model-name svelte-1kqg791"),u(b,"class","model-provider svelte-1kqg791"),u(l,"class","model-meta svelte-1kqg791"),u(d,"class","bar-track svelte-1kqg791"),u(k,"class","mono bar-value svelte-1kqg791"),u(c,"class","bar-area svelte-1kqg791"),u(A,"class","stat-label svelte-1kqg791"),u(O,"class","mono stat-value svelte-1kqg791"),u(h,"class","stat-item svelte-1kqg791"),u(Q,"class","stat-label svelte-1kqg791"),u(X,"class","mono stat-value svelte-1kqg791"),u(j,"class","stat-item svelte-1kqg791"),u(te,"class","stat-label svelte-1kqg791"),u(le,"class","mono stat-value svelte-1kqg791"),u(y,"class","stat-item svelte-1kqg791"),u(i,"class","model-stats svelte-1kqg791"),u(t,"class","model-row animate-row svelte-1kqg791"),oe(t,"animation-delay",e[19]*30+"ms"),this.first=t},m(Z,F){z(Z,t,F),a(t,l),a(l,s),a(s,f),a(l,g),a(l,b),a(b,T),a(t,w),a(t,c),a(c,d),J.m(d,null),a(c,D),a(c,k),a(k,M),a(c,H),$&&$.m(c,null),a(t,B),a(t,i),a(i,h),a(h,A),a(A,_),a(h,S),a(h,O),a(O,N),a(i,P),a(i,j),a(j,Q),a(Q,x),a(j,ee),a(j,X),a(X,ie),a(i,be),a(i,y),a(y,te),a(te,ce),a(y,Ee),a(y,le),a(le,fe),a(t,Te)},p(Z,F){e=Z,F&4&&n!==(n=e[17].model+"")&&C(f,n),F&4&&E!==(E=e[17].provider+"")&&C(T,E),ue===(ue=Ve(e))&&J?J.p(e,F):(J.d(1),J=ue(e),J&&(J.c(),J.m(d,null))),F&4&&q!==(q=e[7](e[17])+"")&&C(M,q),e[1]==="tokens"?$?$.p(e,F):($=Le(e),$.c(),$.m(c,null)):$&&($.d(1),$=null),F&32&&U!==(U=e[5]("models.cost")+"")&&C(_,U),F&4&&G!==(G=we(e[17].totalCost)+"")&&C(N,G),F&32&&L!==(L=e[5]("models.calls")+"")&&C(x,L),F&4&&Y!==(Y=ze(e[17].callCount)+"")&&C(ie,Y),F&32&&ne!==(ne=e[5]("models.share")+"")&&C(ce,ne),F&4&&re!==(re=ye(e[17].percentage)+"")&&C(fe,re),F&4&&oe(t,"animation-delay",e[19]*30+"ms")},d(Z){Z&&r(t),J.d(),$&&$.d()}}}function Et(o){let e,t,l,s,n=o[5]("models.title")+"",f,g,b,E=o[5]("models.desc")+"",T,w,c,d,D,k,q,M,H,B,i;document.title=e=o[5]("models.title")+" — AIUsage",d=new dt({}),k=new ht({}),M=new _t({});function h(_,S){var O;return _[4]?kt:_[3]?pt:(O=_[0])!=null&&O.models.length?vt:mt}let A=h(o),U=A(o);return{c(){t=I(),l=p("div"),s=p("h1"),f=W(n),g=I(),b=p("p"),T=W(E),w=I(),c=p("div"),Ae(d.$$.fragment),D=I(),Ae(k.$$.fragment),q=I(),Ae(M.$$.fragment),H=I(),U.c(),B=ke(),this.h()},l(_){st("svelte-1sv33gh",document.head).forEach(r),t=V(_),l=v(_,"DIV",{class:!0});var O=m(l);s=v(O,"H1",{});var G=m(s);f=R(G,n),G.forEach(r),g=V(O),b=v(O,"P",{});var N=m(b);T=R(N,E),N.forEach(r),O.forEach(r),w=V(_),c=v(_,"DIV",{class:!0});var P=m(c);Pe(d.$$.fragment,P),D=V(P),Pe(k.$$.fragment,P),q=V(P),Pe(M.$$.fragment,P),P.forEach(r),H=V(_),U.l(_),B=ke(),this.h()},h(){u(l,"class","page-header"),u(c,"class","filter-bar")},m(_,S){z(_,t,S),z(_,l,S),a(l,s),a(s,f),a(l,g),a(l,b),a(b,T),z(_,w,S),z(_,c,S),Ne(d,c,null),a(c,D),Ne(k,c,null),a(c,q),Ne(M,c,null),z(_,H,S),U.m(_,S),z(_,B,S),i=!0},p(_,[S]){(!i||S&32)&&e!==(e=_[5]("models.title")+" — AIUsage")&&(document.title=e),(!i||S&32)&&n!==(n=_[5]("models.title")+"")&&C(f,n),(!i||S&32)&&E!==(E=_[5]("models.desc")+"")&&C(T,E),A===(A=h(_))&&U?U.p(_,S):(U.d(1),U=A(_),U&&(U.c(),U.m(B.parentNode,B)))},i(_){i||(Se(d.$$.fragment,_),Se(k.$$.fragment,_),Se(M.$$.fragment,_),i=!0)},o(_){De(d.$$.fragment,_),De(k.$$.fragment,_),De(M.$$.fragment,_),i=!1},d(_){_&&(r(t),r(l),r(w),r(c),r(H),r(B)),qe(d),qe(k),qe(M),U.d(_)}}}function ye(o){return`${Number(o||0).toFixed(1)}%`}function Tt(o,e,t){let l,s,n,f,g,b;me(o,it,i=>t(9,n=i)),me(o,ct,i=>t(10,f=i)),me(o,ft,i=>t(11,g=i)),me(o,ut,i=>t(5,b=i));let E=null,T=null,w=!0,c="tokens";async function d(){t(4,w=!0),t(3,T=null);try{t(0,E=await ot({...g,device:f,tool:n}))}catch(i){t(3,T=i instanceof Error?i.message:"Failed to load data"),t(0,E=null)}finally{t(4,w=!1)}}function D(i){return c==="cost"?i.totalCost:i.totalTokens}function k(i){const h=D(i);return s>0?h/s*100:0}function q(i){return c==="cost"?we(i.totalCost):K(i.totalTokens)}function M(i){const h=s||1;return[{cls:"seg-input",w:(i.inputTokens||0)/h*100},{cls:"seg-output",w:(i.outputTokens||0)/h*100},{cls:"seg-cr",w:(i.cacheReadTokens||0)/h*100},{cls:"seg-cw",w:(i.cacheWriteTokens||0)/h*100},{cls:"seg-thinking",w:(i.thinkingTokens||0)/h*100}]}const H=()=>t(1,c="tokens"),B=()=>t(1,c="cost");return o.$$.update=()=>{o.$$.dirty&3584&&d(),o.$$.dirty&3&&t(2,l=[...(E==null?void 0:E.models)||[]].sort((i,h)=>c==="cost"?h.totalCost-i.totalCost:h.totalTokens-i.totalTokens)),o.$$.dirty&6&&(s=l.length?Math.max(...l.map(i=>c==="cost"?i.totalCost:i.totalTokens)):0)},[E,c,l,T,w,b,k,q,M,n,f,g,H,B]}class wt extends tt{constructor(e){super(),lt(this,e,Tt,Et,xe,{})}}export{wt as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as hl,c as ut,o as pl,r as dl}from"../chunks/scheduler.DsWd5xup.js";import{S as ml,i as kl,d as r,k as Nt,l as Vt,m as Ct,s as I,a as B,b as l,n as Rt,o as _,p as wl,g as S,c as v,e as i,f as j,q as Ht,r as ht,j as A,h as f,t as D,u as Mt,z as _t,w as rl,v as Ot,x as _l}from"../chunks/index.66Vu9Sio.js";import{r as bl,j as El,e as we}from"../chunks/api.Mv_KcGhp.js";import{b as $,f as pt,c as be,s as Tl,a as jl,d as Dl}from"../chunks/stores.BSI_cVy6.js";import{t as gl}from"../chunks/i18n.CwV3KceS.js";import{D as Sl,a as Al,T as Il}from"../chunks/ToolSelector.CofvKVw2.js";function nl(n,e,a){const t=n.slice();return t[15]=e[a],t[14]=a,t}function cl(n,e,a){const t=n.slice();return t[12]=e[a],t[14]=a,t}function vl(n,e,a){const t=n.slice();return t[17]=e[a][0],t[18]=e[a][1],t}function Pl(n){let e,a,t,s=n[4]("overview.totalTokens")+"",o,c,h,w=$(n[0].totalTokens)+"",b,g,E,p,V=n[4]("overview.totalCost")+"",C,u,m,R=pt(n[0].totalCost)+"",N,P,M,H,U=n[4]("overview.activeDays")+"",W,k,O,q=n[0].activeDays+"",F,re,y,ne,Ee=n[4]("overview.totalSessions")+"",Me,dt,ce,Te=be(n[0].totalSessions||0)+"",Oe,Be,z,Z,ve,je=n[4]("overview.inputTokens")+"",Ue,mt,ie,De=$(n[0].inputTokens)+"",We,kt,x,fe,ge=n[4]("overview.outputTokens")+"",ye,wt,ue,Se=$(n[0].outputTokens)+"",qe,bt,ee,_e,Ae=n[4]("overview.cacheRead")+"",ze,Et,he,Ie=$(n[0].cacheReadTokens)+"",$e,Tt,te,pe,Pe=n[4]("overview.cacheWrite")+"",Fe,jt,de,Ne=$(n[0].cacheWriteTokens)+"",Le,Ye,G,J,me,Ve=n[4]("overview.byTool")+"",Ge,Dt,Je,gt,K,le,ke,Ce=n[4]("overview.topToolCalls")+"",Ke,St,se,Q,Re=n[4]("overview.tabAll")+"",Qe,At,X,He=n[4]("overview.tabMcp")+"",Xe,It,Pt,Bt;function Ut(d,T){return T&1&&(Je=null),Je==null&&(Je=Object.keys(d[0].byTool).length===0),Je?Hl:Rl}let Ze=Ut(n,-1),L=Ze(n);function Wt(d,T){var oe;return d[3]==="all"?Bl:(oe=d[0].topMcpServers)!=null&&oe.length?Ml:Ol}let xe=Wt(n),Y=xe(n);return{c(){e=f("div"),a=f("div"),t=f("span"),o=D(s),c=A(),h=f("span"),b=D(w),g=A(),E=f("div"),p=f("span"),C=D(V),u=A(),m=f("span"),N=D(R),P=A(),M=f("div"),H=f("span"),W=D(U),k=A(),O=f("span"),F=D(q),re=A(),y=f("div"),ne=f("span"),Me=D(Ee),dt=A(),ce=f("span"),Oe=D(Te),Be=A(),z=f("div"),Z=f("div"),ve=f("span"),Ue=D(je),mt=A(),ie=f("span"),We=D(De),kt=A(),x=f("div"),fe=f("span"),ye=D(ge),wt=A(),ue=f("span"),qe=D(Se),bt=A(),ee=f("div"),_e=f("span"),ze=D(Ae),Et=A(),he=f("span"),$e=D(Ie),Tt=A(),te=f("div"),pe=f("span"),Fe=D(Pe),jt=A(),de=f("span"),Le=D(Ne),Ye=A(),G=f("div"),J=f("div"),me=f("div"),Ge=D(Ve),Dt=A(),L.c(),gt=A(),K=f("div"),le=f("div"),ke=f("div"),Ke=D(Ce),St=A(),se=f("div"),Q=f("button"),Qe=D(Re),At=A(),X=f("button"),Xe=D(He),It=A(),Y.c(),this.h()},l(d){e=v(d,"DIV",{class:!0});var T=i(e);a=v(T,"DIV",{class:!0});var oe=i(a);t=v(oe,"SPAN",{class:!0});var yt=i(t);o=j(yt,s),yt.forEach(r),c=S(oe),h=v(oe,"SPAN",{class:!0});var qt=i(h);b=j(qt,w),qt.forEach(r),oe.forEach(r),g=S(T),E=v(T,"DIV",{class:!0});var et=i(E);p=v(et,"SPAN",{class:!0});var zt=i(p);C=j(zt,V),zt.forEach(r),u=S(et),m=v(et,"SPAN",{class:!0});var $t=i(m);N=j($t,R),$t.forEach(r),et.forEach(r),P=S(T),M=v(T,"DIV",{class:!0});var tt=i(M);H=v(tt,"SPAN",{class:!0});var Ft=i(H);W=j(Ft,U),Ft.forEach(r),k=S(tt),O=v(tt,"SPAN",{class:!0});var Lt=i(O);F=j(Lt,q),Lt.forEach(r),tt.forEach(r),re=S(T),y=v(T,"DIV",{class:!0});var lt=i(y);ne=v(lt,"SPAN",{class:!0});var Yt=i(ne);Me=j(Yt,Ee),Yt.forEach(r),dt=S(lt),ce=v(lt,"SPAN",{class:!0});var Gt=i(ce);Oe=j(Gt,Te),Gt.forEach(r),lt.forEach(r),T.forEach(r),Be=S(d),z=v(d,"DIV",{class:!0});var ae=i(z);Z=v(ae,"DIV",{class:!0});var st=i(Z);ve=v(st,"SPAN",{class:!0});var Jt=i(ve);Ue=j(Jt,je),Jt.forEach(r),mt=S(st),ie=v(st,"SPAN",{class:!0});var Kt=i(ie);We=j(Kt,De),Kt.forEach(r),st.forEach(r),kt=S(ae),x=v(ae,"DIV",{class:!0});var at=i(x);fe=v(at,"SPAN",{class:!0});var Qt=i(fe);ye=j(Qt,ge),Qt.forEach(r),wt=S(at),ue=v(at,"SPAN",{class:!0});var Xt=i(ue);qe=j(Xt,Se),Xt.forEach(r),at.forEach(r),bt=S(ae),ee=v(ae,"DIV",{class:!0});var ot=i(ee);_e=v(ot,"SPAN",{class:!0});var Zt=i(_e);ze=j(Zt,Ae),Zt.forEach(r),Et=S(ot),he=v(ot,"SPAN",{class:!0});var xt=i(he);$e=j(xt,Ie),xt.forEach(r),ot.forEach(r),Tt=S(ae),te=v(ae,"DIV",{class:!0});var rt=i(te);pe=v(rt,"SPAN",{class:!0});var el=i(pe);Fe=j(el,Pe),el.forEach(r),jt=S(rt),de=v(rt,"SPAN",{class:!0});var tl=i(de);Le=j(tl,Ne),tl.forEach(r),rt.forEach(r),ae.forEach(r),Ye=S(d),G=v(d,"DIV",{class:!0});var nt=i(G);J=v(nt,"DIV",{class:!0});var ct=i(J);me=v(ct,"DIV",{class:!0});var ll=i(me);Ge=j(ll,Ve),ll.forEach(r),Dt=S(ct),L.l(ct),ct.forEach(r),gt=S(nt),K=v(nt,"DIV",{class:!0});var vt=i(K);le=v(vt,"DIV",{class:!0});var it=i(le);ke=v(it,"DIV",{class:!0});var sl=i(ke);Ke=j(sl,Ce),sl.forEach(r),St=S(it),se=v(it,"DIV",{class:!0});var ft=i(se);Q=v(ft,"BUTTON",{class:!0});var al=i(Q);Qe=j(al,Re),al.forEach(r),At=S(ft),X=v(ft,"BUTTON",{class:!0});var ol=i(X);Xe=j(ol,He),ol.forEach(r),ft.forEach(r),it.forEach(r),It=S(vt),Y.l(vt),vt.forEach(r),nt.forEach(r),this.h()},h(){_(t,"class","hero-label svelte-1mkw3jp"),_(h,"class","hero-value svelte-1mkw3jp"),_(a,"class","hero-card svelte-1mkw3jp"),_(p,"class","hero-label svelte-1mkw3jp"),_(m,"class","hero-value svelte-1mkw3jp"),_(E,"class","hero-card svelte-1mkw3jp"),_(H,"class","hero-label svelte-1mkw3jp"),_(O,"class","hero-value svelte-1mkw3jp"),_(M,"class","hero-card svelte-1mkw3jp"),_(ne,"class","hero-label svelte-1mkw3jp"),_(ce,"class","hero-value svelte-1mkw3jp"),_(y,"class","hero-card svelte-1mkw3jp"),_(e,"class","hero-stats svelte-1mkw3jp"),_(ve,"class","token-label svelte-1mkw3jp"),_(ie,"class","token-value svelte-1mkw3jp"),_(Z,"class","token-item svelte-1mkw3jp"),_(fe,"class","token-label svelte-1mkw3jp"),_(ue,"class","token-value svelte-1mkw3jp"),_(x,"class","token-item svelte-1mkw3jp"),_(_e,"class","token-label svelte-1mkw3jp"),_(he,"class","token-value svelte-1mkw3jp"),_(ee,"class","token-item svelte-1mkw3jp"),_(pe,"class","token-label svelte-1mkw3jp"),_(de,"class","token-value svelte-1mkw3jp"),_(te,"class","token-item svelte-1mkw3jp"),_(z,"class","token-breakdown svelte-1mkw3jp"),_(me,"class","section-title"),_(J,"class","card"),_(ke,"class","section-title svelte-1mkw3jp"),_(Q,"class","card-tab svelte-1mkw3jp"),_t(Q,"active",n[3]==="all"),_(X,"class","card-tab svelte-1mkw3jp"),_t(X,"active",n[3]==="mcp"),_(se,"class","card-tabs svelte-1mkw3jp"),_(le,"class","card-header svelte-1mkw3jp"),_(K,"class","card"),_(G,"class","grid-2 svelte-1mkw3jp")},m(d,T){B(d,e,T),l(e,a),l(a,t),l(t,o),l(a,c),l(a,h),l(h,b),l(e,g),l(e,E),l(E,p),l(p,C),l(E,u),l(E,m),l(m,N),l(e,P),l(e,M),l(M,H),l(H,W),l(M,k),l(M,O),l(O,F),l(e,re),l(e,y),l(y,ne),l(ne,Me),l(y,dt),l(y,ce),l(ce,Oe),B(d,Be,T),B(d,z,T),l(z,Z),l(Z,ve),l(ve,Ue),l(Z,mt),l(Z,ie),l(ie,We),l(z,kt),l(z,x),l(x,fe),l(fe,ye),l(x,wt),l(x,ue),l(ue,qe),l(z,bt),l(z,ee),l(ee,_e),l(_e,ze),l(ee,Et),l(ee,he),l(he,$e),l(z,Tt),l(z,te),l(te,pe),l(pe,Fe),l(te,jt),l(te,de),l(de,Le),B(d,Ye,T),B(d,G,T),l(G,J),l(J,me),l(me,Ge),l(J,Dt),L.m(J,null),l(G,gt),l(G,K),l(K,le),l(le,ke),l(ke,Ke),l(le,St),l(le,se),l(se,Q),l(Q,Qe),l(se,At),l(se,X),l(X,Xe),l(K,It),Y.m(K,null),Pt||(Bt=[rl(Q,"click",n[8]),rl(X,"click",n[9])],Pt=!0)},p(d,T){T&16&&s!==(s=d[4]("overview.totalTokens")+"")&&I(o,s),T&1&&w!==(w=$(d[0].totalTokens)+"")&&I(b,w),T&16&&V!==(V=d[4]("overview.totalCost")+"")&&I(C,V),T&1&&R!==(R=pt(d[0].totalCost)+"")&&I(N,R),T&16&&U!==(U=d[4]("overview.activeDays")+"")&&I(W,U),T&1&&q!==(q=d[0].activeDays+"")&&I(F,q),T&16&&Ee!==(Ee=d[4]("overview.totalSessions")+"")&&I(Me,Ee),T&1&&Te!==(Te=be(d[0].totalSessions||0)+"")&&I(Oe,Te),T&16&&je!==(je=d[4]("overview.inputTokens")+"")&&I(Ue,je),T&1&&De!==(De=$(d[0].inputTokens)+"")&&I(We,De),T&16&&ge!==(ge=d[4]("overview.outputTokens")+"")&&I(ye,ge),T&1&&Se!==(Se=$(d[0].outputTokens)+"")&&I(qe,Se),T&16&&Ae!==(Ae=d[4]("overview.cacheRead")+"")&&I(ze,Ae),T&1&&Ie!==(Ie=$(d[0].cacheReadTokens)+"")&&I($e,Ie),T&16&&Pe!==(Pe=d[4]("overview.cacheWrite")+"")&&I(Fe,Pe),T&1&&Ne!==(Ne=$(d[0].cacheWriteTokens)+"")&&I(Le,Ne),T&16&&Ve!==(Ve=d[4]("overview.byTool")+"")&&I(Ge,Ve),Ze===(Ze=Ut(d,T))&&L?L.p(d,T):(L.d(1),L=Ze(d),L&&(L.c(),L.m(J,null))),T&16&&Ce!==(Ce=d[4]("overview.topToolCalls")+"")&&I(Ke,Ce),T&16&&Re!==(Re=d[4]("overview.tabAll")+"")&&I(Qe,Re),T&8&&_t(Q,"active",d[3]==="all"),T&16&&He!==(He=d[4]("overview.tabMcp")+"")&&I(Xe,He),T&8&&_t(X,"active",d[3]==="mcp"),xe===(xe=Wt(d))&&Y?Y.p(d,T):(Y.d(1),Y=xe(d),Y&&(Y.c(),Y.m(K,null)))},d(d){d&&(r(e),r(Be),r(z),r(Ye),r(G)),L.d(),Y.d(),Pt=!1,dl(Bt)}}}function Nl(n){let e,a,t=n[4]("common.noData")+"",s,o,c,h=n[4]("common.noDataHint")+"",w;return{c(){e=f("div"),a=f("h2"),s=D(t),o=A(),c=f("p"),w=D(h),this.h()},l(b){e=v(b,"DIV",{class:!0});var g=i(e);a=v(g,"H2",{});var E=i(a);s=j(E,t),E.forEach(r),o=S(g),c=v(g,"P",{});var p=i(c);w=j(p,h),p.forEach(r),g.forEach(r),this.h()},h(){_(e,"class","state-msg")},m(b,g){B(b,e,g),l(e,a),l(a,s),l(e,o),l(e,c),l(c,w)},p(b,g){g&16&&t!==(t=b[4]("common.noData")+"")&&I(s,t),g&16&&h!==(h=b[4]("common.noDataHint")+"")&&I(w,h)},d(b){b&&r(e)}}}function Vl(n){let e,a;return{c(){e=f("div"),a=D(n[1]),this.h()},l(t){e=v(t,"DIV",{class:!0});var s=i(e);a=j(s,n[1]),s.forEach(r),this.h()},h(){_(e,"class","state-msg error")},m(t,s){B(t,e,s),l(e,a)},p(t,s){s&2&&I(a,t[1])},d(t){t&&r(e)}}}function Cl(n){let e,a=n[4]("common.loading")+"",t;return{c(){e=f("div"),t=D(a),this.h()},l(s){e=v(s,"DIV",{class:!0});var o=i(e);t=j(o,a),o.forEach(r),this.h()},h(){_(e,"class","state-msg")},m(s,o){B(s,e,o),l(e,t)},p(s,o){o&16&&a!==(a=s[4]("common.loading")+"")&&I(t,a)},d(s){s&&r(e)}}}function Rl(n){let e,a,t,s,o=n[4]("overview.tool")+"",c,h,w,b=n[4]("overview.tokens")+"",g,E,p,V=n[4]("overview.cost")+"",C,u,m,R=we(Object.entries(n[0].byTool)),N=[];for(let P=0;P<R.length;P+=1)N[P]=il(vl(n,R,P));return{c(){e=f("table"),a=f("thead"),t=f("tr"),s=f("th"),c=D(o),h=A(),w=f("th"),g=D(b),E=A(),p=f("th"),C=D(V),u=A(),m=f("tbody");for(let P=0;P<N.length;P+=1)N[P].c()},l(P){e=v(P,"TABLE",{});var M=i(e);a=v(M,"THEAD",{});var H=i(a);t=v(H,"TR",{});var U=i(t);s=v(U,"TH",{});var W=i(s);c=j(W,o),W.forEach(r),h=S(U),w=v(U,"TH",{});var k=i(w);g=j(k,b),k.forEach(r),E=S(U),p=v(U,"TH",{});var O=i(p);C=j(O,V),O.forEach(r),U.forEach(r),H.forEach(r),u=S(M),m=v(M,"TBODY",{});var q=i(m);for(let F=0;F<N.length;F+=1)N[F].l(q);q.forEach(r),M.forEach(r)},m(P,M){B(P,e,M),l(e,a),l(a,t),l(t,s),l(s,c),l(t,h),l(t,w),l(w,g),l(t,E),l(t,p),l(p,C),l(e,u),l(e,m);for(let H=0;H<N.length;H+=1)N[H]&&N[H].m(m,null)},p(P,M){if(M&16&&o!==(o=P[4]("overview.tool")+"")&&I(c,o),M&16&&b!==(b=P[4]("overview.tokens")+"")&&I(g,b),M&16&&V!==(V=P[4]("overview.cost")+"")&&I(C,V),M&1){R=we(Object.entries(P[0].byTool));let H;for(H=0;H<R.length;H+=1){const U=vl(P,R,H);N[H]?N[H].p(U,M):(N[H]=il(U),N[H].c(),N[H].m(m,null))}for(;H<N.length;H+=1)N[H].d(1);N.length=R.length}},d(P){P&&r(e),Ot(N,P)}}}function Hl(n){let e,a=n[4]("overview.noToolData")+"",t;return{c(){e=f("p"),t=D(a),this.h()},l(s){e=v(s,"P",{class:!0});var o=i(e);t=j(o,a),o.forEach(r),this.h()},h(){_(e,"class","muted svelte-1mkw3jp")},m(s,o){B(s,e,o),l(e,t)},p(s,o){o&16&&a!==(a=s[4]("overview.noToolData")+"")&&I(t,a)},d(s){s&&r(e)}}}function il(n){let e,a,t=n[17]+"",s,o,c,h=$(n[18].tokens)+"",w,b,g,E=pt(n[18].cost)+"",p,V;return{c(){e=f("tr"),a=f("td"),s=D(t),o=A(),c=f("td"),w=D(h),b=A(),g=f("td"),p=D(E),V=A(),this.h()},l(C){e=v(C,"TR",{});var u=i(e);a=v(u,"TD",{class:!0});var m=i(a);s=j(m,t),m.forEach(r),o=S(u),c=v(u,"TD",{class:!0});var R=i(c);w=j(R,h),R.forEach(r),b=S(u),g=v(u,"TD",{class:!0});var N=i(g);p=j(N,E),N.forEach(r),V=S(u),u.forEach(r),this.h()},h(){_(a,"class","mono"),_(c,"class","mono"),_(g,"class","mono accent")},m(C,u){B(C,e,u),l(e,a),l(a,s),l(e,o),l(e,c),l(c,w),l(e,b),l(e,g),l(g,p),l(e,V)},p(C,u){u&1&&t!==(t=C[17]+"")&&I(s,t),u&1&&h!==(h=$(C[18].tokens)+"")&&I(w,h),u&1&&E!==(E=pt(C[18].cost)+"")&&I(p,E)},d(C){C&&r(e)}}}function Ml(n){let e,a=we(n[0].topMcpServers),t=[];for(let s=0;s<a.length;s+=1)t[s]=fl(nl(n,a,s));return{c(){e=f("div");for(let s=0;s<t.length;s+=1)t[s].c();this.h()},l(s){e=v(s,"DIV",{class:!0});var o=i(e);for(let c=0;c<t.length;c+=1)t[c].l(o);o.forEach(r),this.h()},h(){_(e,"class","tc-list svelte-1mkw3jp")},m(s,o){B(s,e,o);for(let c=0;c<t.length;c+=1)t[c]&&t[c].m(e,null)},p(s,o){if(o&1){a=we(s[0].topMcpServers);let c;for(c=0;c<a.length;c+=1){const h=nl(s,a,c);t[c]?t[c].p(h,o):(t[c]=fl(h),t[c].c(),t[c].m(e,null))}for(;c<t.length;c+=1)t[c].d(1);t.length=a.length}},d(s){s&&r(e),Ot(t,s)}}}function Ol(n){let e,a=n[4]("overview.noMcpCalls")+"",t;return{c(){e=f("p"),t=D(a),this.h()},l(s){e=v(s,"P",{class:!0});var o=i(e);t=j(o,a),o.forEach(r),this.h()},h(){_(e,"class","muted svelte-1mkw3jp")},m(s,o){B(s,e,o),l(e,t)},p(s,o){o&16&&a!==(a=s[4]("overview.noMcpCalls")+"")&&I(t,a)},d(s){s&&r(e)}}}function Bl(n){let e;function a(o,c){return o[0].topToolCalls.length===0?Wl:Ul}let t=a(n),s=t(n);return{c(){s.c(),e=ht()},l(o){s.l(o),e=ht()},m(o,c){s.m(o,c),B(o,e,c)},p(o,c){t===(t=a(o))&&s?s.p(o,c):(s.d(1),s=t(o),s&&(s.c(),s.m(e.parentNode,e)))},d(o){o&&r(e),s.d(o)}}}function fl(n){let e,a,t,s=n[14]+1+"",o,c,h,w=n[15].server+"",b,g,E,p=be(n[15].count)+"",V,C;return{c(){e=f("div"),a=f("span"),t=D("#"),o=D(s),c=A(),h=f("span"),b=D(w),g=A(),E=f("span"),V=D(p),C=A(),this.h()},l(u){e=v(u,"DIV",{class:!0,style:!0});var m=i(e);a=v(m,"SPAN",{class:!0});var R=i(a);t=j(R,"#"),o=j(R,s),R.forEach(r),c=S(m),h=v(m,"SPAN",{class:!0});var N=i(h);b=j(N,w),N.forEach(r),g=S(m),E=v(m,"SPAN",{class:!0});var P=i(E);V=j(P,p),P.forEach(r),C=S(m),m.forEach(r),this.h()},h(){_(a,"class","tc-rank svelte-1mkw3jp"),_(h,"class","tc-name mono svelte-1mkw3jp"),_(E,"class","tc-count mono svelte-1mkw3jp"),_(e,"class","tc-row svelte-1mkw3jp"),_l(e,"animation-delay",n[14]*40+"ms")},m(u,m){B(u,e,m),l(e,a),l(a,t),l(a,o),l(e,c),l(e,h),l(h,b),l(e,g),l(e,E),l(E,V),l(e,C)},p(u,m){m&1&&w!==(w=u[15].server+"")&&I(b,w),m&1&&p!==(p=be(u[15].count)+"")&&I(V,p)},d(u){u&&r(e)}}}function Ul(n){let e,a=we(n[0].topToolCalls),t=[];for(let s=0;s<a.length;s+=1)t[s]=ul(cl(n,a,s));return{c(){e=f("div");for(let s=0;s<t.length;s+=1)t[s].c();this.h()},l(s){e=v(s,"DIV",{class:!0});var o=i(e);for(let c=0;c<t.length;c+=1)t[c].l(o);o.forEach(r),this.h()},h(){_(e,"class","tc-list svelte-1mkw3jp")},m(s,o){B(s,e,o);for(let c=0;c<t.length;c+=1)t[c]&&t[c].m(e,null)},p(s,o){if(o&1){a=we(s[0].topToolCalls);let c;for(c=0;c<a.length;c+=1){const h=cl(s,a,c);t[c]?t[c].p(h,o):(t[c]=ul(h),t[c].c(),t[c].m(e,null))}for(;c<t.length;c+=1)t[c].d(1);t.length=a.length}},d(s){s&&r(e),Ot(t,s)}}}function Wl(n){let e,a=n[4]("overview.noToolCalls")+"",t;return{c(){e=f("p"),t=D(a),this.h()},l(s){e=v(s,"P",{class:!0});var o=i(e);t=j(o,a),o.forEach(r),this.h()},h(){_(e,"class","muted svelte-1mkw3jp")},m(s,o){B(s,e,o),l(e,t)},p(s,o){o&16&&a!==(a=s[4]("overview.noToolCalls")+"")&&I(t,a)},d(s){s&&r(e)}}}function ul(n){let e,a,t,s=n[14]+1+"",o,c,h,w=n[12].name+"",b,g,E,p=be(n[12].count)+"",V,C;return{c(){e=f("div"),a=f("span"),t=D("#"),o=D(s),c=A(),h=f("span"),b=D(w),g=A(),E=f("span"),V=D(p),C=A(),this.h()},l(u){e=v(u,"DIV",{class:!0,style:!0});var m=i(e);a=v(m,"SPAN",{class:!0});var R=i(a);t=j(R,"#"),o=j(R,s),R.forEach(r),c=S(m),h=v(m,"SPAN",{class:!0});var N=i(h);b=j(N,w),N.forEach(r),g=S(m),E=v(m,"SPAN",{class:!0});var P=i(E);V=j(P,p),P.forEach(r),C=S(m),m.forEach(r),this.h()},h(){_(a,"class","tc-rank svelte-1mkw3jp"),_(h,"class","tc-name mono svelte-1mkw3jp"),_(E,"class","tc-count mono svelte-1mkw3jp"),_(e,"class","tc-row svelte-1mkw3jp"),_l(e,"animation-delay",n[14]*40+"ms")},m(u,m){B(u,e,m),l(e,a),l(a,t),l(a,o),l(e,c),l(e,h),l(h,b),l(e,g),l(e,E),l(E,V),l(e,C)},p(u,m){m&1&&w!==(w=u[12].name+"")&&I(b,w),m&1&&p!==(p=be(u[12].count)+"")&&I(V,p)},d(u){u&&r(e)}}}function yl(n){let e,a,t,s,o=n[4]("overview.title")+"",c,h,w,b=n[4]("overview.desc")+"",g,E,p,V,C,u,m,R,N,P,M;document.title=e=n[4]("overview.title")+" — AIUsage",V=new Sl({}),u=new Al({}),R=new Il({});function H(k,O){return k[2]?Cl:k[1]?Vl:!k[0]||k[0].totalTokens===0?Nl:Pl}let U=H(n),W=U(n);return{c(){a=A(),t=f("div"),s=f("h1"),c=D(o),h=A(),w=f("p"),g=D(b),E=A(),p=f("div"),Mt(V.$$.fragment),C=A(),Mt(u.$$.fragment),m=A(),Mt(R.$$.fragment),N=A(),W.c(),P=ht(),this.h()},l(k){wl("svelte-lwbxws",document.head).forEach(r),a=S(k),t=v(k,"DIV",{class:!0});var q=i(t);s=v(q,"H1",{});var F=i(s);c=j(F,o),F.forEach(r),h=S(q),w=v(q,"P",{});var re=i(w);g=j(re,b),re.forEach(r),q.forEach(r),E=S(k),p=v(k,"DIV",{class:!0});var y=i(p);Ht(V.$$.fragment,y),C=S(y),Ht(u.$$.fragment,y),m=S(y),Ht(R.$$.fragment,y),y.forEach(r),N=S(k),W.l(k),P=ht(),this.h()},h(){_(t,"class","page-header"),_(p,"class","filter-bar")},m(k,O){B(k,a,O),B(k,t,O),l(t,s),l(s,c),l(t,h),l(t,w),l(w,g),B(k,E,O),B(k,p,O),Rt(V,p,null),l(p,C),Rt(u,p,null),l(p,m),Rt(R,p,null),B(k,N,O),W.m(k,O),B(k,P,O),M=!0},p(k,[O]){(!M||O&16)&&e!==(e=k[4]("overview.title")+" — AIUsage")&&(document.title=e),(!M||O&16)&&o!==(o=k[4]("overview.title")+"")&&I(c,o),(!M||O&16)&&b!==(b=k[4]("overview.desc")+"")&&I(g,b),U===(U=H(k))&&W?W.p(k,O):(W.d(1),W=U(k),W&&(W.c(),W.m(P.parentNode,P)))},i(k){M||(Ct(V.$$.fragment,k),Ct(u.$$.fragment,k),Ct(R.$$.fragment,k),M=!0)},o(k){Vt(V.$$.fragment,k),Vt(u.$$.fragment,k),Vt(R.$$.fragment,k),M=!1},d(k){k&&(r(a),r(t),r(E),r(p),r(N),r(P)),Nt(V),Nt(u),Nt(R),W.d(k)}}}function ql(n,e,a){let t,s,o,c;ut(n,Tl,u=>a(5,t=u)),ut(n,jl,u=>a(6,s=u)),ut(n,Dl,u=>a(7,o=u)),ut(n,gl,u=>a(4,c=u));let h=null,w=null,b=!0,g="all",E=!1;async function p(){if(E){a(2,b=!0),a(1,w=null);try{a(0,h=await El({...o,device:s,tool:t}))}catch(u){a(1,w=u instanceof Error?u.message:"Failed to load data"),a(0,h=null)}finally{a(2,b=!1)}}}pl(async()=>{await bl().catch(()=>{}),E=!0,await p()});const V=()=>a(3,g="all"),C=()=>a(3,g="mcp");return n.$$.update=()=>{n.$$.dirty&224&&p()},[h,w,b,g,c,t,s,o,V,C]}class Jl extends ml{constructor(e){super(),kl(this,e,ql,yl,hl,{})}}export{Jl as component};
|
|
1
|
+
import{s as hl,c as ut,o as pl,r as dl}from"../chunks/scheduler.DsWd5xup.js";import{S as ml,i as kl,d as r,k as Nt,l as Vt,m as Ct,s as I,a as B,b as l,n as Rt,o as _,p as wl,g as S,c as v,e as i,f as j,q as Ht,r as ht,j as A,h as f,t as D,u as Mt,z as _t,w as rl,v as Ot,x as _l}from"../chunks/index.BfJlbjrK.js";import{r as bl,j as El,e as we}from"../chunks/api.DVLAklIn.js";import{b as $,f as pt,c as be,s as Tl,a as jl,d as Dl}from"../chunks/stores.BSI_cVy6.js";import{t as gl}from"../chunks/i18n.DApJIXOT.js";import{D as Sl,a as Al,T as Il}from"../chunks/ToolSelector.0iI1cXVj.js";function nl(n,e,a){const t=n.slice();return t[15]=e[a],t[14]=a,t}function cl(n,e,a){const t=n.slice();return t[12]=e[a],t[14]=a,t}function vl(n,e,a){const t=n.slice();return t[17]=e[a][0],t[18]=e[a][1],t}function Pl(n){let e,a,t,s=n[4]("overview.totalTokens")+"",o,c,h,w=$(n[0].totalTokens)+"",b,g,E,p,V=n[4]("overview.totalCost")+"",C,u,m,R=pt(n[0].totalCost)+"",N,P,M,H,U=n[4]("overview.activeDays")+"",W,k,O,q=n[0].activeDays+"",F,re,y,ne,Ee=n[4]("overview.totalSessions")+"",Me,dt,ce,Te=be(n[0].totalSessions||0)+"",Oe,Be,z,Z,ve,je=n[4]("overview.inputTokens")+"",Ue,mt,ie,De=$(n[0].inputTokens)+"",We,kt,x,fe,ge=n[4]("overview.outputTokens")+"",ye,wt,ue,Se=$(n[0].outputTokens)+"",qe,bt,ee,_e,Ae=n[4]("overview.cacheRead")+"",ze,Et,he,Ie=$(n[0].cacheReadTokens)+"",$e,Tt,te,pe,Pe=n[4]("overview.cacheWrite")+"",Fe,jt,de,Ne=$(n[0].cacheWriteTokens)+"",Le,Ye,G,J,me,Ve=n[4]("overview.byTool")+"",Ge,Dt,Je,gt,K,le,ke,Ce=n[4]("overview.topToolCalls")+"",Ke,St,se,Q,Re=n[4]("overview.tabAll")+"",Qe,At,X,He=n[4]("overview.tabMcp")+"",Xe,It,Pt,Bt;function Ut(d,T){return T&1&&(Je=null),Je==null&&(Je=Object.keys(d[0].byTool).length===0),Je?Hl:Rl}let Ze=Ut(n,-1),L=Ze(n);function Wt(d,T){var oe;return d[3]==="all"?Bl:(oe=d[0].topMcpServers)!=null&&oe.length?Ml:Ol}let xe=Wt(n),Y=xe(n);return{c(){e=f("div"),a=f("div"),t=f("span"),o=D(s),c=A(),h=f("span"),b=D(w),g=A(),E=f("div"),p=f("span"),C=D(V),u=A(),m=f("span"),N=D(R),P=A(),M=f("div"),H=f("span"),W=D(U),k=A(),O=f("span"),F=D(q),re=A(),y=f("div"),ne=f("span"),Me=D(Ee),dt=A(),ce=f("span"),Oe=D(Te),Be=A(),z=f("div"),Z=f("div"),ve=f("span"),Ue=D(je),mt=A(),ie=f("span"),We=D(De),kt=A(),x=f("div"),fe=f("span"),ye=D(ge),wt=A(),ue=f("span"),qe=D(Se),bt=A(),ee=f("div"),_e=f("span"),ze=D(Ae),Et=A(),he=f("span"),$e=D(Ie),Tt=A(),te=f("div"),pe=f("span"),Fe=D(Pe),jt=A(),de=f("span"),Le=D(Ne),Ye=A(),G=f("div"),J=f("div"),me=f("div"),Ge=D(Ve),Dt=A(),L.c(),gt=A(),K=f("div"),le=f("div"),ke=f("div"),Ke=D(Ce),St=A(),se=f("div"),Q=f("button"),Qe=D(Re),At=A(),X=f("button"),Xe=D(He),It=A(),Y.c(),this.h()},l(d){e=v(d,"DIV",{class:!0});var T=i(e);a=v(T,"DIV",{class:!0});var oe=i(a);t=v(oe,"SPAN",{class:!0});var yt=i(t);o=j(yt,s),yt.forEach(r),c=S(oe),h=v(oe,"SPAN",{class:!0});var qt=i(h);b=j(qt,w),qt.forEach(r),oe.forEach(r),g=S(T),E=v(T,"DIV",{class:!0});var et=i(E);p=v(et,"SPAN",{class:!0});var zt=i(p);C=j(zt,V),zt.forEach(r),u=S(et),m=v(et,"SPAN",{class:!0});var $t=i(m);N=j($t,R),$t.forEach(r),et.forEach(r),P=S(T),M=v(T,"DIV",{class:!0});var tt=i(M);H=v(tt,"SPAN",{class:!0});var Ft=i(H);W=j(Ft,U),Ft.forEach(r),k=S(tt),O=v(tt,"SPAN",{class:!0});var Lt=i(O);F=j(Lt,q),Lt.forEach(r),tt.forEach(r),re=S(T),y=v(T,"DIV",{class:!0});var lt=i(y);ne=v(lt,"SPAN",{class:!0});var Yt=i(ne);Me=j(Yt,Ee),Yt.forEach(r),dt=S(lt),ce=v(lt,"SPAN",{class:!0});var Gt=i(ce);Oe=j(Gt,Te),Gt.forEach(r),lt.forEach(r),T.forEach(r),Be=S(d),z=v(d,"DIV",{class:!0});var ae=i(z);Z=v(ae,"DIV",{class:!0});var st=i(Z);ve=v(st,"SPAN",{class:!0});var Jt=i(ve);Ue=j(Jt,je),Jt.forEach(r),mt=S(st),ie=v(st,"SPAN",{class:!0});var Kt=i(ie);We=j(Kt,De),Kt.forEach(r),st.forEach(r),kt=S(ae),x=v(ae,"DIV",{class:!0});var at=i(x);fe=v(at,"SPAN",{class:!0});var Qt=i(fe);ye=j(Qt,ge),Qt.forEach(r),wt=S(at),ue=v(at,"SPAN",{class:!0});var Xt=i(ue);qe=j(Xt,Se),Xt.forEach(r),at.forEach(r),bt=S(ae),ee=v(ae,"DIV",{class:!0});var ot=i(ee);_e=v(ot,"SPAN",{class:!0});var Zt=i(_e);ze=j(Zt,Ae),Zt.forEach(r),Et=S(ot),he=v(ot,"SPAN",{class:!0});var xt=i(he);$e=j(xt,Ie),xt.forEach(r),ot.forEach(r),Tt=S(ae),te=v(ae,"DIV",{class:!0});var rt=i(te);pe=v(rt,"SPAN",{class:!0});var el=i(pe);Fe=j(el,Pe),el.forEach(r),jt=S(rt),de=v(rt,"SPAN",{class:!0});var tl=i(de);Le=j(tl,Ne),tl.forEach(r),rt.forEach(r),ae.forEach(r),Ye=S(d),G=v(d,"DIV",{class:!0});var nt=i(G);J=v(nt,"DIV",{class:!0});var ct=i(J);me=v(ct,"DIV",{class:!0});var ll=i(me);Ge=j(ll,Ve),ll.forEach(r),Dt=S(ct),L.l(ct),ct.forEach(r),gt=S(nt),K=v(nt,"DIV",{class:!0});var vt=i(K);le=v(vt,"DIV",{class:!0});var it=i(le);ke=v(it,"DIV",{class:!0});var sl=i(ke);Ke=j(sl,Ce),sl.forEach(r),St=S(it),se=v(it,"DIV",{class:!0});var ft=i(se);Q=v(ft,"BUTTON",{class:!0});var al=i(Q);Qe=j(al,Re),al.forEach(r),At=S(ft),X=v(ft,"BUTTON",{class:!0});var ol=i(X);Xe=j(ol,He),ol.forEach(r),ft.forEach(r),it.forEach(r),It=S(vt),Y.l(vt),vt.forEach(r),nt.forEach(r),this.h()},h(){_(t,"class","hero-label svelte-1mkw3jp"),_(h,"class","hero-value svelte-1mkw3jp"),_(a,"class","hero-card svelte-1mkw3jp"),_(p,"class","hero-label svelte-1mkw3jp"),_(m,"class","hero-value svelte-1mkw3jp"),_(E,"class","hero-card svelte-1mkw3jp"),_(H,"class","hero-label svelte-1mkw3jp"),_(O,"class","hero-value svelte-1mkw3jp"),_(M,"class","hero-card svelte-1mkw3jp"),_(ne,"class","hero-label svelte-1mkw3jp"),_(ce,"class","hero-value svelte-1mkw3jp"),_(y,"class","hero-card svelte-1mkw3jp"),_(e,"class","hero-stats svelte-1mkw3jp"),_(ve,"class","token-label svelte-1mkw3jp"),_(ie,"class","token-value svelte-1mkw3jp"),_(Z,"class","token-item svelte-1mkw3jp"),_(fe,"class","token-label svelte-1mkw3jp"),_(ue,"class","token-value svelte-1mkw3jp"),_(x,"class","token-item svelte-1mkw3jp"),_(_e,"class","token-label svelte-1mkw3jp"),_(he,"class","token-value svelte-1mkw3jp"),_(ee,"class","token-item svelte-1mkw3jp"),_(pe,"class","token-label svelte-1mkw3jp"),_(de,"class","token-value svelte-1mkw3jp"),_(te,"class","token-item svelte-1mkw3jp"),_(z,"class","token-breakdown svelte-1mkw3jp"),_(me,"class","section-title"),_(J,"class","card"),_(ke,"class","section-title svelte-1mkw3jp"),_(Q,"class","card-tab svelte-1mkw3jp"),_t(Q,"active",n[3]==="all"),_(X,"class","card-tab svelte-1mkw3jp"),_t(X,"active",n[3]==="mcp"),_(se,"class","card-tabs svelte-1mkw3jp"),_(le,"class","card-header svelte-1mkw3jp"),_(K,"class","card"),_(G,"class","grid-2 svelte-1mkw3jp")},m(d,T){B(d,e,T),l(e,a),l(a,t),l(t,o),l(a,c),l(a,h),l(h,b),l(e,g),l(e,E),l(E,p),l(p,C),l(E,u),l(E,m),l(m,N),l(e,P),l(e,M),l(M,H),l(H,W),l(M,k),l(M,O),l(O,F),l(e,re),l(e,y),l(y,ne),l(ne,Me),l(y,dt),l(y,ce),l(ce,Oe),B(d,Be,T),B(d,z,T),l(z,Z),l(Z,ve),l(ve,Ue),l(Z,mt),l(Z,ie),l(ie,We),l(z,kt),l(z,x),l(x,fe),l(fe,ye),l(x,wt),l(x,ue),l(ue,qe),l(z,bt),l(z,ee),l(ee,_e),l(_e,ze),l(ee,Et),l(ee,he),l(he,$e),l(z,Tt),l(z,te),l(te,pe),l(pe,Fe),l(te,jt),l(te,de),l(de,Le),B(d,Ye,T),B(d,G,T),l(G,J),l(J,me),l(me,Ge),l(J,Dt),L.m(J,null),l(G,gt),l(G,K),l(K,le),l(le,ke),l(ke,Ke),l(le,St),l(le,se),l(se,Q),l(Q,Qe),l(se,At),l(se,X),l(X,Xe),l(K,It),Y.m(K,null),Pt||(Bt=[rl(Q,"click",n[8]),rl(X,"click",n[9])],Pt=!0)},p(d,T){T&16&&s!==(s=d[4]("overview.totalTokens")+"")&&I(o,s),T&1&&w!==(w=$(d[0].totalTokens)+"")&&I(b,w),T&16&&V!==(V=d[4]("overview.totalCost")+"")&&I(C,V),T&1&&R!==(R=pt(d[0].totalCost)+"")&&I(N,R),T&16&&U!==(U=d[4]("overview.activeDays")+"")&&I(W,U),T&1&&q!==(q=d[0].activeDays+"")&&I(F,q),T&16&&Ee!==(Ee=d[4]("overview.totalSessions")+"")&&I(Me,Ee),T&1&&Te!==(Te=be(d[0].totalSessions||0)+"")&&I(Oe,Te),T&16&&je!==(je=d[4]("overview.inputTokens")+"")&&I(Ue,je),T&1&&De!==(De=$(d[0].inputTokens)+"")&&I(We,De),T&16&&ge!==(ge=d[4]("overview.outputTokens")+"")&&I(ye,ge),T&1&&Se!==(Se=$(d[0].outputTokens)+"")&&I(qe,Se),T&16&&Ae!==(Ae=d[4]("overview.cacheRead")+"")&&I(ze,Ae),T&1&&Ie!==(Ie=$(d[0].cacheReadTokens)+"")&&I($e,Ie),T&16&&Pe!==(Pe=d[4]("overview.cacheWrite")+"")&&I(Fe,Pe),T&1&&Ne!==(Ne=$(d[0].cacheWriteTokens)+"")&&I(Le,Ne),T&16&&Ve!==(Ve=d[4]("overview.byTool")+"")&&I(Ge,Ve),Ze===(Ze=Ut(d,T))&&L?L.p(d,T):(L.d(1),L=Ze(d),L&&(L.c(),L.m(J,null))),T&16&&Ce!==(Ce=d[4]("overview.topToolCalls")+"")&&I(Ke,Ce),T&16&&Re!==(Re=d[4]("overview.tabAll")+"")&&I(Qe,Re),T&8&&_t(Q,"active",d[3]==="all"),T&16&&He!==(He=d[4]("overview.tabMcp")+"")&&I(Xe,He),T&8&&_t(X,"active",d[3]==="mcp"),xe===(xe=Wt(d))&&Y?Y.p(d,T):(Y.d(1),Y=xe(d),Y&&(Y.c(),Y.m(K,null)))},d(d){d&&(r(e),r(Be),r(z),r(Ye),r(G)),L.d(),Y.d(),Pt=!1,dl(Bt)}}}function Nl(n){let e,a,t=n[4]("common.noData")+"",s,o,c,h=n[4]("common.noDataHint")+"",w;return{c(){e=f("div"),a=f("h2"),s=D(t),o=A(),c=f("p"),w=D(h),this.h()},l(b){e=v(b,"DIV",{class:!0});var g=i(e);a=v(g,"H2",{});var E=i(a);s=j(E,t),E.forEach(r),o=S(g),c=v(g,"P",{});var p=i(c);w=j(p,h),p.forEach(r),g.forEach(r),this.h()},h(){_(e,"class","state-msg")},m(b,g){B(b,e,g),l(e,a),l(a,s),l(e,o),l(e,c),l(c,w)},p(b,g){g&16&&t!==(t=b[4]("common.noData")+"")&&I(s,t),g&16&&h!==(h=b[4]("common.noDataHint")+"")&&I(w,h)},d(b){b&&r(e)}}}function Vl(n){let e,a;return{c(){e=f("div"),a=D(n[1]),this.h()},l(t){e=v(t,"DIV",{class:!0});var s=i(e);a=j(s,n[1]),s.forEach(r),this.h()},h(){_(e,"class","state-msg error")},m(t,s){B(t,e,s),l(e,a)},p(t,s){s&2&&I(a,t[1])},d(t){t&&r(e)}}}function Cl(n){let e,a=n[4]("common.loading")+"",t;return{c(){e=f("div"),t=D(a),this.h()},l(s){e=v(s,"DIV",{class:!0});var o=i(e);t=j(o,a),o.forEach(r),this.h()},h(){_(e,"class","state-msg")},m(s,o){B(s,e,o),l(e,t)},p(s,o){o&16&&a!==(a=s[4]("common.loading")+"")&&I(t,a)},d(s){s&&r(e)}}}function Rl(n){let e,a,t,s,o=n[4]("overview.tool")+"",c,h,w,b=n[4]("overview.tokens")+"",g,E,p,V=n[4]("overview.cost")+"",C,u,m,R=we(Object.entries(n[0].byTool)),N=[];for(let P=0;P<R.length;P+=1)N[P]=il(vl(n,R,P));return{c(){e=f("table"),a=f("thead"),t=f("tr"),s=f("th"),c=D(o),h=A(),w=f("th"),g=D(b),E=A(),p=f("th"),C=D(V),u=A(),m=f("tbody");for(let P=0;P<N.length;P+=1)N[P].c()},l(P){e=v(P,"TABLE",{});var M=i(e);a=v(M,"THEAD",{});var H=i(a);t=v(H,"TR",{});var U=i(t);s=v(U,"TH",{});var W=i(s);c=j(W,o),W.forEach(r),h=S(U),w=v(U,"TH",{});var k=i(w);g=j(k,b),k.forEach(r),E=S(U),p=v(U,"TH",{});var O=i(p);C=j(O,V),O.forEach(r),U.forEach(r),H.forEach(r),u=S(M),m=v(M,"TBODY",{});var q=i(m);for(let F=0;F<N.length;F+=1)N[F].l(q);q.forEach(r),M.forEach(r)},m(P,M){B(P,e,M),l(e,a),l(a,t),l(t,s),l(s,c),l(t,h),l(t,w),l(w,g),l(t,E),l(t,p),l(p,C),l(e,u),l(e,m);for(let H=0;H<N.length;H+=1)N[H]&&N[H].m(m,null)},p(P,M){if(M&16&&o!==(o=P[4]("overview.tool")+"")&&I(c,o),M&16&&b!==(b=P[4]("overview.tokens")+"")&&I(g,b),M&16&&V!==(V=P[4]("overview.cost")+"")&&I(C,V),M&1){R=we(Object.entries(P[0].byTool));let H;for(H=0;H<R.length;H+=1){const U=vl(P,R,H);N[H]?N[H].p(U,M):(N[H]=il(U),N[H].c(),N[H].m(m,null))}for(;H<N.length;H+=1)N[H].d(1);N.length=R.length}},d(P){P&&r(e),Ot(N,P)}}}function Hl(n){let e,a=n[4]("overview.noToolData")+"",t;return{c(){e=f("p"),t=D(a),this.h()},l(s){e=v(s,"P",{class:!0});var o=i(e);t=j(o,a),o.forEach(r),this.h()},h(){_(e,"class","muted svelte-1mkw3jp")},m(s,o){B(s,e,o),l(e,t)},p(s,o){o&16&&a!==(a=s[4]("overview.noToolData")+"")&&I(t,a)},d(s){s&&r(e)}}}function il(n){let e,a,t=n[17]+"",s,o,c,h=$(n[18].tokens)+"",w,b,g,E=pt(n[18].cost)+"",p,V;return{c(){e=f("tr"),a=f("td"),s=D(t),o=A(),c=f("td"),w=D(h),b=A(),g=f("td"),p=D(E),V=A(),this.h()},l(C){e=v(C,"TR",{});var u=i(e);a=v(u,"TD",{class:!0});var m=i(a);s=j(m,t),m.forEach(r),o=S(u),c=v(u,"TD",{class:!0});var R=i(c);w=j(R,h),R.forEach(r),b=S(u),g=v(u,"TD",{class:!0});var N=i(g);p=j(N,E),N.forEach(r),V=S(u),u.forEach(r),this.h()},h(){_(a,"class","mono"),_(c,"class","mono"),_(g,"class","mono accent")},m(C,u){B(C,e,u),l(e,a),l(a,s),l(e,o),l(e,c),l(c,w),l(e,b),l(e,g),l(g,p),l(e,V)},p(C,u){u&1&&t!==(t=C[17]+"")&&I(s,t),u&1&&h!==(h=$(C[18].tokens)+"")&&I(w,h),u&1&&E!==(E=pt(C[18].cost)+"")&&I(p,E)},d(C){C&&r(e)}}}function Ml(n){let e,a=we(n[0].topMcpServers),t=[];for(let s=0;s<a.length;s+=1)t[s]=fl(nl(n,a,s));return{c(){e=f("div");for(let s=0;s<t.length;s+=1)t[s].c();this.h()},l(s){e=v(s,"DIV",{class:!0});var o=i(e);for(let c=0;c<t.length;c+=1)t[c].l(o);o.forEach(r),this.h()},h(){_(e,"class","tc-list svelte-1mkw3jp")},m(s,o){B(s,e,o);for(let c=0;c<t.length;c+=1)t[c]&&t[c].m(e,null)},p(s,o){if(o&1){a=we(s[0].topMcpServers);let c;for(c=0;c<a.length;c+=1){const h=nl(s,a,c);t[c]?t[c].p(h,o):(t[c]=fl(h),t[c].c(),t[c].m(e,null))}for(;c<t.length;c+=1)t[c].d(1);t.length=a.length}},d(s){s&&r(e),Ot(t,s)}}}function Ol(n){let e,a=n[4]("overview.noMcpCalls")+"",t;return{c(){e=f("p"),t=D(a),this.h()},l(s){e=v(s,"P",{class:!0});var o=i(e);t=j(o,a),o.forEach(r),this.h()},h(){_(e,"class","muted svelte-1mkw3jp")},m(s,o){B(s,e,o),l(e,t)},p(s,o){o&16&&a!==(a=s[4]("overview.noMcpCalls")+"")&&I(t,a)},d(s){s&&r(e)}}}function Bl(n){let e;function a(o,c){return o[0].topToolCalls.length===0?Wl:Ul}let t=a(n),s=t(n);return{c(){s.c(),e=ht()},l(o){s.l(o),e=ht()},m(o,c){s.m(o,c),B(o,e,c)},p(o,c){t===(t=a(o))&&s?s.p(o,c):(s.d(1),s=t(o),s&&(s.c(),s.m(e.parentNode,e)))},d(o){o&&r(e),s.d(o)}}}function fl(n){let e,a,t,s=n[14]+1+"",o,c,h,w=n[15].server+"",b,g,E,p=be(n[15].count)+"",V,C;return{c(){e=f("div"),a=f("span"),t=D("#"),o=D(s),c=A(),h=f("span"),b=D(w),g=A(),E=f("span"),V=D(p),C=A(),this.h()},l(u){e=v(u,"DIV",{class:!0,style:!0});var m=i(e);a=v(m,"SPAN",{class:!0});var R=i(a);t=j(R,"#"),o=j(R,s),R.forEach(r),c=S(m),h=v(m,"SPAN",{class:!0});var N=i(h);b=j(N,w),N.forEach(r),g=S(m),E=v(m,"SPAN",{class:!0});var P=i(E);V=j(P,p),P.forEach(r),C=S(m),m.forEach(r),this.h()},h(){_(a,"class","tc-rank svelte-1mkw3jp"),_(h,"class","tc-name mono svelte-1mkw3jp"),_(E,"class","tc-count mono svelte-1mkw3jp"),_(e,"class","tc-row svelte-1mkw3jp"),_l(e,"animation-delay",n[14]*40+"ms")},m(u,m){B(u,e,m),l(e,a),l(a,t),l(a,o),l(e,c),l(e,h),l(h,b),l(e,g),l(e,E),l(E,V),l(e,C)},p(u,m){m&1&&w!==(w=u[15].server+"")&&I(b,w),m&1&&p!==(p=be(u[15].count)+"")&&I(V,p)},d(u){u&&r(e)}}}function Ul(n){let e,a=we(n[0].topToolCalls),t=[];for(let s=0;s<a.length;s+=1)t[s]=ul(cl(n,a,s));return{c(){e=f("div");for(let s=0;s<t.length;s+=1)t[s].c();this.h()},l(s){e=v(s,"DIV",{class:!0});var o=i(e);for(let c=0;c<t.length;c+=1)t[c].l(o);o.forEach(r),this.h()},h(){_(e,"class","tc-list svelte-1mkw3jp")},m(s,o){B(s,e,o);for(let c=0;c<t.length;c+=1)t[c]&&t[c].m(e,null)},p(s,o){if(o&1){a=we(s[0].topToolCalls);let c;for(c=0;c<a.length;c+=1){const h=cl(s,a,c);t[c]?t[c].p(h,o):(t[c]=ul(h),t[c].c(),t[c].m(e,null))}for(;c<t.length;c+=1)t[c].d(1);t.length=a.length}},d(s){s&&r(e),Ot(t,s)}}}function Wl(n){let e,a=n[4]("overview.noToolCalls")+"",t;return{c(){e=f("p"),t=D(a),this.h()},l(s){e=v(s,"P",{class:!0});var o=i(e);t=j(o,a),o.forEach(r),this.h()},h(){_(e,"class","muted svelte-1mkw3jp")},m(s,o){B(s,e,o),l(e,t)},p(s,o){o&16&&a!==(a=s[4]("overview.noToolCalls")+"")&&I(t,a)},d(s){s&&r(e)}}}function ul(n){let e,a,t,s=n[14]+1+"",o,c,h,w=n[12].name+"",b,g,E,p=be(n[12].count)+"",V,C;return{c(){e=f("div"),a=f("span"),t=D("#"),o=D(s),c=A(),h=f("span"),b=D(w),g=A(),E=f("span"),V=D(p),C=A(),this.h()},l(u){e=v(u,"DIV",{class:!0,style:!0});var m=i(e);a=v(m,"SPAN",{class:!0});var R=i(a);t=j(R,"#"),o=j(R,s),R.forEach(r),c=S(m),h=v(m,"SPAN",{class:!0});var N=i(h);b=j(N,w),N.forEach(r),g=S(m),E=v(m,"SPAN",{class:!0});var P=i(E);V=j(P,p),P.forEach(r),C=S(m),m.forEach(r),this.h()},h(){_(a,"class","tc-rank svelte-1mkw3jp"),_(h,"class","tc-name mono svelte-1mkw3jp"),_(E,"class","tc-count mono svelte-1mkw3jp"),_(e,"class","tc-row svelte-1mkw3jp"),_l(e,"animation-delay",n[14]*40+"ms")},m(u,m){B(u,e,m),l(e,a),l(a,t),l(a,o),l(e,c),l(e,h),l(h,b),l(e,g),l(e,E),l(E,V),l(e,C)},p(u,m){m&1&&w!==(w=u[12].name+"")&&I(b,w),m&1&&p!==(p=be(u[12].count)+"")&&I(V,p)},d(u){u&&r(e)}}}function yl(n){let e,a,t,s,o=n[4]("overview.title")+"",c,h,w,b=n[4]("overview.desc")+"",g,E,p,V,C,u,m,R,N,P,M;document.title=e=n[4]("overview.title")+" — AIUsage",V=new Sl({}),u=new Al({}),R=new Il({});function H(k,O){return k[2]?Cl:k[1]?Vl:!k[0]||k[0].totalTokens===0?Nl:Pl}let U=H(n),W=U(n);return{c(){a=A(),t=f("div"),s=f("h1"),c=D(o),h=A(),w=f("p"),g=D(b),E=A(),p=f("div"),Mt(V.$$.fragment),C=A(),Mt(u.$$.fragment),m=A(),Mt(R.$$.fragment),N=A(),W.c(),P=ht(),this.h()},l(k){wl("svelte-lwbxws",document.head).forEach(r),a=S(k),t=v(k,"DIV",{class:!0});var q=i(t);s=v(q,"H1",{});var F=i(s);c=j(F,o),F.forEach(r),h=S(q),w=v(q,"P",{});var re=i(w);g=j(re,b),re.forEach(r),q.forEach(r),E=S(k),p=v(k,"DIV",{class:!0});var y=i(p);Ht(V.$$.fragment,y),C=S(y),Ht(u.$$.fragment,y),m=S(y),Ht(R.$$.fragment,y),y.forEach(r),N=S(k),W.l(k),P=ht(),this.h()},h(){_(t,"class","page-header"),_(p,"class","filter-bar")},m(k,O){B(k,a,O),B(k,t,O),l(t,s),l(s,c),l(t,h),l(t,w),l(w,g),B(k,E,O),B(k,p,O),Rt(V,p,null),l(p,C),Rt(u,p,null),l(p,m),Rt(R,p,null),B(k,N,O),W.m(k,O),B(k,P,O),M=!0},p(k,[O]){(!M||O&16)&&e!==(e=k[4]("overview.title")+" — AIUsage")&&(document.title=e),(!M||O&16)&&o!==(o=k[4]("overview.title")+"")&&I(c,o),(!M||O&16)&&b!==(b=k[4]("overview.desc")+"")&&I(g,b),U===(U=H(k))&&W?W.p(k,O):(W.d(1),W=U(k),W&&(W.c(),W.m(P.parentNode,P)))},i(k){M||(Ct(V.$$.fragment,k),Ct(u.$$.fragment,k),Ct(R.$$.fragment,k),M=!0)},o(k){Vt(V.$$.fragment,k),Vt(u.$$.fragment,k),Vt(R.$$.fragment,k),M=!1},d(k){k&&(r(a),r(t),r(E),r(p),r(N),r(P)),Nt(V),Nt(u),Nt(R),W.d(k)}}}function ql(n,e,a){let t,s,o,c;ut(n,Tl,u=>a(5,t=u)),ut(n,jl,u=>a(6,s=u)),ut(n,Dl,u=>a(7,o=u)),ut(n,gl,u=>a(4,c=u));let h=null,w=null,b=!0,g="all",E=!1;async function p(){if(E){a(2,b=!0),a(1,w=null);try{a(0,h=await El({...o,device:s,tool:t}))}catch(u){a(1,w=u instanceof Error?u.message:"Failed to load data"),a(0,h=null)}finally{a(2,b=!1)}}}pl(async()=>{await bl().catch(()=>{}),E=!0,await p()});const V=()=>a(3,g="all"),C=()=>a(3,g="mcp");return n.$$.update=()=>{n.$$.dirty&224&&p()},[h,w,b,g,c,t,s,o,V,C]}class Jl extends ml{constructor(e){super(),kl(this,e,ql,yl,hl,{})}}export{Jl as component};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{s as ot,n as pl,r as vl,c as hl,e as ut,o as ft}from"../chunks/scheduler.DsWd5xup.js";import{S as dt,i as ht,d as c,s as O,z as he,a as Y,b as r,w as oe,o as u,p as pt,g as U,c as _,e as m,f as B,C as sl,r as je,j as L,h as v,t as I,D as He,x as _l,A as Le,v as zl,E as _t}from"../chunks/index.BfJlbjrK.js";import{k as vt,m as ml,n as mt,o as gt,p as bt,q as yt,t as Et,v as kt,e as Ge,h as jl,i as Gl}from"../chunks/api.DVLAklIn.js";import{t as Pt}from"../chunks/i18n.DApJIXOT.js";import{r as Se,e as St,g as Nt}from"../chunks/stores.BSI_cVy6.js";function gl(e,l,t){const s=e.slice();s[101]=l[t],s[104]=t;const i=s[8]===s[101].model;return s[102]=i,s}function bl(e,l,t){const s=e.slice();s[105]=l[t];const i=s[105].model;s[106]=i;const n=s[13][s[106]];s[107]=n;const a=s[14][s[106]]??s[46](s[106]);s[108]=a;const o=s[45](s[107],s[108]);s[109]=o;const p=fl(s[109],s[105]);return s[110]=p,s}function yl(e,l,t){const s=e.slice();return s[113]=l[t],s}function El(e,l,t){const s=e.slice();s[105]=l[t];const i=s[105].model;s[106]=i;const n=s[14][s[106]]??s[46](s[106]);return s[108]=n,s}function kl(e){let l,t;return{c(){l=v("div"),t=I(e[29]),this.h()},l(s){l=_(s,"DIV",{class:!0});var i=m(l);t=B(i,e[29]),i.forEach(c),this.h()},h(){u(l,"class","sync-summary mono svelte-yt12fh")},m(s,i){Y(s,l,i),r(l,t)},p(s,i){i[0]&536870912&&O(t,s[29])},d(s){s&&c(l)}}}function Pl(e){let l,t,s,i,n,a,o,p,y,w,A,g,b,k=e[19]&&Sl(e),R=!e[22]&&(e[4]==="needed"||e[4]==="error")&&Nl(e),S=!e[22]&&Tl(e),E=e[22]&&Al(e);return{c(){l=v("div"),t=v("div"),s=v("div"),i=v("span"),n=L(),a=v("div"),o=v("span"),p=I(e[20]),y=L(),k&&k.c(),w=L(),A=v("div"),R&&R.c(),g=L(),S&&S.c(),b=L(),E&&E.c(),this.h()},l(h){l=_(h,"DIV",{class:!0});var d=m(l);t=_(d,"DIV",{class:!0});var N=m(t);s=_(N,"DIV",{class:!0});var q=m(s);i=_(q,"SPAN",{class:!0,"aria-hidden":!0}),m(i).forEach(c),n=U(q),a=_(q,"DIV",{class:!0});var V=m(a);o=_(V,"SPAN",{class:!0});var T=m(o);p=B(T,e[20]),T.forEach(c),y=U(V),k&&k.l(V),V.forEach(c),q.forEach(c),w=U(N),A=_(N,"DIV",{class:!0});var W=m(A);R&&R.l(W),g=U(W),S&&S.l(W),W.forEach(c),N.forEach(c),b=U(d),E&&E.l(d),d.forEach(c),this.h()},h(){u(i,"class","recalc-dot svelte-yt12fh"),u(i,"aria-hidden","true"),u(o,"class","recalc-label mono svelte-yt12fh"),u(a,"class","recalc-copy svelte-yt12fh"),u(s,"class","recalc-status svelte-yt12fh"),u(A,"class","recalc-actions svelte-yt12fh"),u(t,"class","recalc-head svelte-yt12fh"),u(l,"class","recalc-panel svelte-yt12fh"),he(l,"active",e[22]),he(l,"done",e[4]==="done"),he(l,"error",e[4]==="error")},m(h,d){Y(h,l,d),r(l,t),r(t,s),r(s,i),r(s,n),r(s,a),r(a,o),r(o,p),r(a,y),k&&k.m(a,null),r(t,w),r(t,A),R&&R.m(A,null),r(A,g),S&&S.m(A,null),r(l,b),E&&E.m(l,null)},p(h,d){d[0]&1048576&&O(p,h[20]),h[19]?k?k.p(h,d):(k=Sl(h),k.c(),k.m(a,null)):k&&(k.d(1),k=null),!h[22]&&(h[4]==="needed"||h[4]==="error")?R?R.p(h,d):(R=Nl(h),R.c(),R.m(A,g)):R&&(R.d(1),R=null),h[22]?S&&(S.d(1),S=null):S?S.p(h,d):(S=Tl(h),S.c(),S.m(A,null)),h[22]?E?E.p(h,d):(E=Al(h),E.c(),E.m(l,null)):E&&(E.d(1),E=null),d[0]&4194304&&he(l,"active",h[22]),d[0]&16&&he(l,"done",h[4]==="done"),d[0]&16&&he(l,"error",h[4]==="error")},d(h){h&&c(l),k&&k.d(),R&&R.d(),S&&S.d(),E&&E.d()}}}function Sl(e){let l,t;return{c(){l=v("span"),t=I(e[19]),this.h()},l(s){l=_(s,"SPAN",{class:!0});var i=m(l);t=B(i,e[19]),i.forEach(c),this.h()},h(){u(l,"class","recalc-summary svelte-yt12fh")},m(s,i){Y(s,l,i),r(l,t)},p(s,i){i[0]&524288&&O(t,s[19])},d(s){s&&c(l)}}}function Nl(e){let l,t=e[7]("pricing.recalcNow")+"",s,i,n;return{c(){l=v("button"),s=I(t),this.h()},l(a){l=_(a,"BUTTON",{class:!0,type:!0});var o=m(l);s=B(o,t),o.forEach(c),this.h()},h(){u(l,"class","btn-sm primary svelte-yt12fh"),u(l,"type","button"),l.disabled=e[6]},m(a,o){Y(a,l,o),r(l,s),i||(n=oe(l,"click",e[34]),i=!0)},p(a,o){o[0]&128&&t!==(t=a[7]("pricing.recalcNow")+"")&&O(s,t),o[0]&64&&(l.disabled=a[6])},d(a){a&&c(l),i=!1,n()}}}function Tl(e){let l,t="×",s,i;return{c(){l=v("button"),l.textContent=t,this.h()},l(n){l=_(n,"BUTTON",{class:!0,type:!0,"aria-label":!0,"data-svelte-h":!0}),sl(l)!=="svelte-8p94wv"&&(l.textContent=t),this.h()},h(){u(l,"class","recalc-close svelte-yt12fh"),u(l,"type","button"),u(l,"aria-label","Close")},m(n,a){Y(n,l,a),s||(i=oe(l,"click",e[33]),s=!0)},p:pl,d(n){n&&c(l),s=!1,i()}}}function Al(e){let l,t;return{c(){l=v("div"),t=v("span"),this.h()},l(s){l=_(s,"DIV",{class:!0,"aria-hidden":!0});var i=m(l);t=_(i,"SPAN",{class:!0,style:!0}),m(t).forEach(c),i.forEach(c),this.h()},h(){u(t,"class","recalc-bar svelte-yt12fh"),_l(t,"width",Math.max(4,e[23])+"%"),u(l,"class","recalc-track svelte-yt12fh"),u(l,"aria-hidden","true")},m(s,i){Y(s,l,i),r(l,t)},p(s,i){i[0]&8388608&&_l(t,"width",Math.max(4,s[23])+"%")},d(s){s&&c(l)}}}function Tt(e){let l,t,s,i,n=e[7]("pricing.modelSearch")+"",a,o,p,y,w,A,g,b=e[7]("pricing.modelSearchCount").replace("{shown}",e[25].length).replace("{total}",e[0].length)+"",k,R,S,E,h,d=e[24]&&Bl(e);function N(T,W){return T[25].length===0?Dt:wt}let q=N(e),V=q(e);return{c(){d&&d.c(),l=L(),t=v("div"),s=v("label"),i=v("span"),a=I(n),o=L(),p=v("input"),A=L(),g=v("span"),k=I(b),R=L(),V.c(),S=je(),this.h()},l(T){d&&d.l(T),l=U(T),t=_(T,"DIV",{class:!0});var W=m(t);s=_(W,"LABEL",{class:!0});var K=m(s);i=_(K,"SPAN",{});var x=m(i);a=B(x,n),x.forEach(c),o=U(K),p=_(K,"INPUT",{class:!0,type:!0,placeholder:!0,"aria-label":!0}),K.forEach(c),A=U(W),g=_(W,"SPAN",{class:!0});var F=m(g);k=B(F,b),F.forEach(c),W.forEach(c),R=U(T),V.l(T),S=je(),this.h()},h(){u(p,"class","model-filter-input svelte-yt12fh"),u(p,"type","search"),u(p,"placeholder",y=e[7]("pricing.modelSearchPlaceholder")),u(p,"aria-label",w=e[7]("pricing.modelSearch")),u(s,"class","model-filter svelte-yt12fh"),u(g,"class","pricing-count mono svelte-yt12fh"),u(t,"class","pricing-toolbar svelte-yt12fh")},m(T,W){d&&d.m(T,W),Y(T,l,W),Y(T,t,W),r(t,s),r(s,i),r(i,a),r(s,o),r(s,p),Le(p,e[3]),r(t,A),r(t,g),r(g,k),Y(T,R,W),V.m(T,W),Y(T,S,W),E||(h=oe(p,"input",e[66]),E=!0)},p(T,W){T[24]?d?d.p(T,W):(d=Bl(T),d.c(),d.m(l.parentNode,l)):d&&(d.d(1),d=null),W[0]&128&&n!==(n=T[7]("pricing.modelSearch")+"")&&O(a,n),W[0]&128&&y!==(y=T[7]("pricing.modelSearchPlaceholder"))&&u(p,"placeholder",y),W[0]&128&&w!==(w=T[7]("pricing.modelSearch"))&&u(p,"aria-label",w),W[0]&8&&p.value!==T[3]&&Le(p,T[3]),W[0]&33554561&&b!==(b=T[7]("pricing.modelSearchCount").replace("{shown}",T[25].length).replace("{total}",T[0].length)+"")&&O(k,b),q===(q=N(T))&&V?V.p(T,W):(V.d(1),V=q(T),V&&(V.c(),V.m(S.parentNode,S)))},d(T){T&&(c(l),c(t),c(R),c(S)),d&&d.d(T),V.d(T),E=!1,h()}}}function At(e){let l,t,s,i=e[7]("pricing.emptyTitle")+"",n,a,o,p=e[7]("pricing.emptyBody")+"",y,w,A,g=(e[12]?e[7]("pricing.syncingPrices"):e[7]("pricing.emptySync"))+"",b,k,R;return{c(){l=v("section"),t=v("div"),s=v("h2"),n=I(i),a=L(),o=v("p"),y=I(p),w=L(),A=v("button"),b=I(g),this.h()},l(S){l=_(S,"SECTION",{class:!0});var E=m(l);t=_(E,"DIV",{class:!0});var h=m(t);s=_(h,"H2",{class:!0});var d=m(s);n=B(d,i),d.forEach(c),a=U(h),o=_(h,"P",{class:!0});var N=m(o);y=B(N,p),N.forEach(c),h.forEach(c),w=U(E),A=_(E,"BUTTON",{class:!0});var q=m(A);b=B(q,g),q.forEach(c),E.forEach(c),this.h()},h(){u(s,"class","svelte-yt12fh"),u(o,"class","svelte-yt12fh"),u(t,"class","empty-copy svelte-yt12fh"),u(A,"class","btn-sm primary svelte-yt12fh"),A.disabled=e[12],u(l,"class","empty-pricing svelte-yt12fh")},m(S,E){Y(S,l,E),r(l,t),r(t,s),r(s,n),r(t,a),r(t,o),r(o,y),r(l,w),r(l,A),r(A,b),k||(R=oe(A,"click",e[37]),k=!0)},p(S,E){E[0]&128&&i!==(i=S[7]("pricing.emptyTitle")+"")&&O(n,i),E[0]&128&&p!==(p=S[7]("pricing.emptyBody")+"")&&O(y,p),E[0]&4224&&g!==(g=(S[12]?S[7]("pricing.syncingPrices"):S[7]("pricing.emptySync"))+"")&&O(b,g),E[0]&4096&&(A.disabled=S[12])},d(S){S&&c(l),k=!1,R()}}}function Bt(e){let l,t;return{c(){l=v("div"),t=I(e[2]),this.h()},l(s){l=_(s,"DIV",{class:!0});var i=m(l);t=B(i,e[2]),i.forEach(c),this.h()},h(){u(l,"class","state-msg error svelte-yt12fh")},m(s,i){Y(s,l,i),r(l,t)},p(s,i){i[0]&4&&O(t,s[2])},d(s){s&&c(l)}}}function It(e){let l,t=e[7]("common.loading")+"",s;return{c(){l=v("div"),s=I(t),this.h()},l(i){l=_(i,"DIV",{class:!0});var n=m(l);s=B(n,t),n.forEach(c),this.h()},h(){u(l,"class","state-msg svelte-yt12fh")},m(i,n){Y(i,l,n),r(l,s)},p(i,n){n[0]&128&&t!==(t=i[7]("common.loading")+"")&&O(s,t)},d(i){i&&c(l)}}}function Bl(e){let l,t,s,i,n=e[7]("pricing.bindingsTitle")+"",a,o,p,y=e[7]("pricing.bindingsBody").replace("{count}",e[5].length).replace("{unresolved}",e[28].length)+"",w,A,g,b=(e[15]?e[7]("pricing.collapseUnresolved"):e[7]("pricing.expandUnresolved"))+"",k,R,S,E,h=e[15]&&Il(e);return{c(){l=v("section"),t=v("div"),s=v("div"),i=v("h2"),a=I(n),o=L(),p=v("p"),w=I(y),A=L(),g=v("button"),k=I(b),R=L(),h&&h.c(),this.h()},l(d){l=_(d,"SECTION",{class:!0});var N=m(l);t=_(N,"DIV",{class:!0});var q=m(t);s=_(q,"DIV",{});var V=m(s);i=_(V,"H2",{class:!0});var T=m(i);a=B(T,n),T.forEach(c),o=U(V),p=_(V,"P",{class:!0});var W=m(p);w=B(W,y),W.forEach(c),V.forEach(c),A=U(q),g=_(q,"BUTTON",{class:!0,type:!0,"aria-expanded":!0});var K=m(g);k=B(K,b),K.forEach(c),q.forEach(c),R=U(N),h&&h.l(N),N.forEach(c),this.h()},h(){u(i,"class","svelte-yt12fh"),u(p,"class","svelte-yt12fh"),u(g,"class","btn-sm alias-toggle svelte-yt12fh"),u(g,"type","button"),u(g,"aria-expanded",e[15]),u(t,"class","alias-head svelte-yt12fh"),u(l,"class","alias-panel svelte-yt12fh")},m(d,N){Y(d,l,N),r(l,t),r(t,s),r(s,i),r(i,a),r(s,o),r(s,p),r(p,w),r(t,A),r(t,g),r(g,k),r(l,R),h&&h.m(l,null),S||(E=oe(g,"click",e[41]),S=!0)},p(d,N){N[0]&128&&n!==(n=d[7]("pricing.bindingsTitle")+"")&&O(a,n),N[0]&268435616&&y!==(y=d[7]("pricing.bindingsBody").replace("{count}",d[5].length).replace("{unresolved}",d[28].length)+"")&&O(w,y),N[0]&32896&&b!==(b=(d[15]?d[7]("pricing.collapseUnresolved"):d[7]("pricing.expandUnresolved"))+"")&&O(k,b),N[0]&32768&&u(g,"aria-expanded",d[15]),d[15]?h?h.p(d,N):(h=Il(d),h.c(),h.m(l,null)):h&&(h.d(1),h=null)},d(d){d&&c(l),h&&h.d(),S=!1,E()}}}function Il(e){let l,t,s=e[27].length&&wl(e),i=e[26].length&&Rl(e);return{c(){l=v("div"),s&&s.c(),t=L(),i&&i.c(),this.h()},l(n){l=_(n,"DIV",{class:!0});var a=m(l);s&&s.l(a),t=U(a),i&&i.l(a),a.forEach(c),this.h()},h(){u(l,"class","alias-list svelte-yt12fh")},m(n,a){Y(n,l,a),s&&s.m(l,null),r(l,t),i&&i.m(l,null)},p(n,a){n[27].length?s?s.p(n,a):(s=wl(n),s.c(),s.m(l,t)):s&&(s.d(1),s=null),n[26].length?i?i.p(n,a):(i=Rl(n),i.c(),i.m(l,null)):i&&(i.d(1),i=null)},d(n){n&&c(l),s&&s.d(),i&&i.d()}}}function wl(e){let l,t,s,i,n=e[16]?"−":"+",a,o,p,y=e[7]("pricing.autoBindingsTitle")+"",w,A,g,b=e[27].length+"",k,R,S,E,h=e[16]&&Dl(e);return{c(){l=v("div"),t=v("div"),s=v("button"),i=v("span"),a=I(n),o=L(),p=v("h3"),w=I(y),A=L(),g=v("span"),k=I(b),R=L(),h&&h.c(),this.h()},l(d){l=_(d,"DIV",{class:!0});var N=m(l);t=_(N,"DIV",{class:!0});var q=m(t);s=_(q,"BUTTON",{class:!0,type:!0,"aria-expanded":!0});var V=m(s);i=_(V,"SPAN",{"aria-hidden":!0,class:!0});var T=m(i);a=B(T,n),T.forEach(c),o=U(V),p=_(V,"H3",{class:!0});var W=m(p);w=B(W,y),W.forEach(c),V.forEach(c),A=U(q),g=_(q,"SPAN",{class:!0});var K=m(g);k=B(K,b),K.forEach(c),q.forEach(c),R=U(N),h&&h.l(N),N.forEach(c),this.h()},h(){u(i,"aria-hidden","true"),u(i,"class","svelte-yt12fh"),u(p,"class","svelte-yt12fh"),u(s,"class","section-toggle svelte-yt12fh"),u(s,"type","button"),u(s,"aria-expanded",e[16]),u(g,"class","mono svelte-yt12fh"),u(t,"class","alias-section-head svelte-yt12fh"),u(l,"class","alias-section svelte-yt12fh")},m(d,N){Y(d,l,N),r(l,t),r(t,s),r(s,i),r(i,a),r(s,o),r(s,p),r(p,w),r(t,A),r(t,g),r(g,k),r(l,R),h&&h.m(l,null),S||(E=oe(s,"click",e[42]),S=!0)},p(d,N){N[0]&65536&&n!==(n=d[16]?"−":"+")&&O(a,n),N[0]&128&&y!==(y=d[7]("pricing.autoBindingsTitle")+"")&&O(w,y),N[0]&65536&&u(s,"aria-expanded",d[16]),N[0]&134217728&&b!==(b=d[27].length+"")&&O(k,b),d[16]?h?h.p(d,N):(h=Dl(d),h.c(),h.m(l,null)):h&&(h.d(1),h=null)},d(d){d&&c(l),h&&h.d(),S=!1,E()}}}function Dl(e){let l=[],t=new Map,s,i=Ge(e[27]);const n=a=>a[105].model;for(let a=0;a<i.length;a+=1){let o=El(e,i,a),p=n(o);t.set(p,l[a]=Cl(p,o))}return{c(){for(let a=0;a<l.length;a+=1)l[a].c();s=je()},l(a){for(let o=0;o<l.length;o+=1)l[o].l(a);s=je()},m(a,o){for(let p=0;p<l.length;p+=1)l[p]&&l[p].m(a,o);Y(a,s,o)},p(a,o){o[0]&134234240|o[1]&98304&&(i=Ge(a[27]),l=jl(l,o,n,1,a,i,t,s.parentNode,Gl,Cl,s,El))},d(a){a&&c(s);for(let o=0;o<l.length;o+=1)l[o].d(a)}}}function Cl(e,l){let t,s,i,n=l[106]+"",a,o,p,y=l[47](l[105])+"",w,A,g,b,k,R,S,E;return{key:e,first:null,c(){t=v("div"),s=v("div"),i=v("span"),a=I(n),o=L(),p=v("span"),w=I(y),A=L(),g=v("div"),b=v("input"),E=L(),this.h()},l(h){t=_(h,"DIV",{class:!0});var d=m(t);s=_(d,"DIV",{class:!0});var N=m(s);i=_(N,"SPAN",{class:!0});var q=m(i);a=B(q,n),q.forEach(c),o=U(N),p=_(N,"SPAN",{class:!0});var V=m(p);w=B(V,y),V.forEach(c),N.forEach(c),A=U(d),g=_(d,"DIV",{class:!0});var T=m(g);b=_(T,"INPUT",{class:!0,placeholder:!0,"aria-label":!0}),T.forEach(c),E=U(d),d.forEach(c),this.h()},h(){u(i,"class","alias-model mono svelte-yt12fh"),u(p,"class","alias-state svelte-yt12fh"),u(s,"class","alias-meta svelte-yt12fh"),u(b,"class","alias-search svelte-yt12fh"),b.value=k=l[108],u(b,"placeholder",R=l[7]("pricing.aliasSearch")),u(b,"aria-label",S=l[7]("pricing.aliasTarget")),b.disabled=!0,u(g,"class","alias-combobox svelte-yt12fh"),u(t,"class","alias-row auto svelte-yt12fh"),this.first=t},m(h,d){Y(h,t,d),r(t,s),r(s,i),r(i,a),r(s,o),r(s,p),r(p,w),r(t,A),r(t,g),r(g,b),r(t,E)},p(h,d){l=h,d[0]&134217728&&n!==(n=l[106]+"")&&O(a,n),d[0]&134217728&&y!==(y=l[47](l[105])+"")&&O(w,y),d[0]&134234112&&k!==(k=l[108])&&b.value!==k&&(b.value=k),d[0]&128&&R!==(R=l[7]("pricing.aliasSearch"))&&u(b,"placeholder",R),d[0]&128&&S!==(S=l[7]("pricing.aliasTarget"))&&u(b,"aria-label",S)},d(h){h&&c(t)}}}function Rl(e){let l,t,s,i,n=e[17]?"−":"+",a,o,p,y=e[7]("pricing.manualBindingsTitle")+"",w,A,g,b=e[26].length+"",k,R,S,E,h=e[17]&&Vl(e);return{c(){l=v("div"),t=v("div"),s=v("button"),i=v("span"),a=I(n),o=L(),p=v("h3"),w=I(y),A=L(),g=v("span"),k=I(b),R=L(),h&&h.c(),this.h()},l(d){l=_(d,"DIV",{class:!0});var N=m(l);t=_(N,"DIV",{class:!0});var q=m(t);s=_(q,"BUTTON",{class:!0,type:!0,"aria-expanded":!0});var V=m(s);i=_(V,"SPAN",{"aria-hidden":!0,class:!0});var T=m(i);a=B(T,n),T.forEach(c),o=U(V),p=_(V,"H3",{class:!0});var W=m(p);w=B(W,y),W.forEach(c),V.forEach(c),A=U(q),g=_(q,"SPAN",{class:!0});var K=m(g);k=B(K,b),K.forEach(c),q.forEach(c),R=U(N),h&&h.l(N),N.forEach(c),this.h()},h(){u(i,"aria-hidden","true"),u(i,"class","svelte-yt12fh"),u(p,"class","svelte-yt12fh"),u(s,"class","section-toggle svelte-yt12fh"),u(s,"type","button"),u(s,"aria-expanded",e[17]),u(g,"class","mono svelte-yt12fh"),u(t,"class","alias-section-head svelte-yt12fh"),u(l,"class","alias-section svelte-yt12fh")},m(d,N){Y(d,l,N),r(l,t),r(t,s),r(s,i),r(i,a),r(s,o),r(s,p),r(p,w),r(t,A),r(t,g),r(g,k),r(l,R),h&&h.m(l,null),S||(E=oe(s,"click",e[43]),S=!0)},p(d,N){N[0]&131072&&n!==(n=d[17]?"−":"+")&&O(a,n),N[0]&128&&y!==(y=d[7]("pricing.manualBindingsTitle")+"")&&O(w,y),N[0]&131072&&u(s,"aria-expanded",d[17]),N[0]&67108864&&b!==(b=d[26].length+"")&&O(k,b),d[17]?h?h.p(d,N):(h=Vl(d),h.c(),h.m(l,null)):h&&(h.d(1),h=null)},d(d){d&&c(l),h&&h.d(),S=!1,E()}}}function Vl(e){let l=[],t=new Map,s,i=Ge(e[26]);const n=a=>a[105].model;for(let a=0;a<i.length;a+=1){let o=bl(e,i,a),p=n(o);t.set(p,l[a]=Wl(p,o))}return{c(){for(let a=0;a<l.length;a+=1)l[a].c();s=je()},l(a){for(let o=0;o<l.length;o+=1)l[o].l(a);s=je()},m(a,o){for(let p=0;p<l.length;p+=1)l[p]&&l[p].m(a,o);Y(a,s,o)},p(a,o){o[0]&67395712|o[1]&1041280&&(i=Ge(a[26]),l=jl(l,o,n,1,a,i,t,s.parentNode,Gl,Wl,s,bl))},d(a){a&&c(s);for(let o=0;o<l.length;o+=1)l[o].d(a)}}}function Ml(e){let l,t=Ge(e[38](e[14][e[106]]??"")),s=[];for(let n=0;n<t.length;n+=1)s[n]=Ol(yl(e,t,n));let i=null;return t.length||(i=Ul(e)),{c(){l=v("div");for(let n=0;n<s.length;n+=1)s[n].c();i&&i.c(),this.h()},l(n){l=_(n,"DIV",{class:!0,role:!0});var a=m(l);for(let o=0;o<s.length;o+=1)s[o].l(a);i&&i.l(a),a.forEach(c),this.h()},h(){u(l,"class","alias-options svelte-yt12fh"),u(l,"role","listbox")},m(n,a){Y(n,l,a);for(let o=0;o<s.length;o+=1)s[o]&&s[o].m(l,null);i&&i.m(l,null)},p(n,a){if(a[0]&67125376|a[1]&8320){t=Ge(n[38](n[14][n[106]]??""));let o;for(o=0;o<t.length;o+=1){const p=yl(n,t,o);s[o]?s[o].p(p,a):(s[o]=Ol(p),s[o].c(),s[o].m(l,null))}for(;o<s.length;o+=1)s[o].d(1);s.length=t.length,!t.length&&i?i.p(n,a):t.length?i&&(i.d(1),i=null):(i=Ul(n),i.c(),i.m(l,null))}},d(n){n&&c(l),zl(s,n),i&&i.d()}}}function Ul(e){let l,t=e[7]("pricing.aliasNoResults")+"",s;return{c(){l=v("span"),s=I(t),this.h()},l(i){l=_(i,"SPAN",{class:!0});var n=m(l);s=B(n,t),n.forEach(c),this.h()},h(){u(l,"class","alias-empty svelte-yt12fh")},m(i,n){Y(i,l,n),r(l,s)},p(i,n){n[0]&128&&t!==(t=i[7]("pricing.aliasNoResults")+"")&&O(s,t)},d(i){i&&c(l)}}}function Ll(e){let l,t=e[113].provider+"",s;return{c(){l=v("span"),s=I(t),this.h()},l(i){l=_(i,"SPAN",{class:!0});var n=m(l);s=B(n,t),n.forEach(c),this.h()},h(){u(l,"class","alias-option-provider svelte-yt12fh")},m(i,n){Y(i,l,n),r(l,s)},p(i,n){n[0]&67125248&&t!==(t=i[113].provider+"")&&O(s,t)},d(i){i&&c(l)}}}function Ol(e){let l,t,s=e[113].model+"",i,n,a,o,p,y=e[113].provider&&Ll(e);function w(){return e[64](e[106],e[113])}return{c(){l=v("button"),t=v("span"),i=I(s),n=L(),y&&y.c(),a=L(),this.h()},l(A){l=_(A,"BUTTON",{type:!0,class:!0});var g=m(l);t=_(g,"SPAN",{class:!0});var b=m(t);i=B(b,s),b.forEach(c),n=U(g),y&&y.l(g),a=U(g),g.forEach(c),this.h()},h(){u(t,"class","alias-option-model mono svelte-yt12fh"),u(l,"type","button"),u(l,"class","alias-option svelte-yt12fh")},m(A,g){Y(A,l,g),r(l,t),r(t,i),r(l,n),y&&y.m(l,null),r(l,a),o||(p=oe(l,"mousedown",_t(w)),o=!0)},p(A,g){e=A,g[0]&67125248&&s!==(s=e[113].model+"")&&O(i,s),e[113].provider?y?y.p(e,g):(y=Ll(e),y.c(),y.m(l,a)):y&&(y.d(1),y=null)},d(A){A&&c(l),y&&y.d(),o=!1,p()}}}function ql(e){let l,t,s=e[49](e[106],e[105],e[109])+"",i,n,a,o;function p(){return e[65](e[106],e[105],e[109])}return{c(){l=v("div"),t=v("button"),i=I(s),this.h()},l(y){l=_(y,"DIV",{class:!0});var w=m(l);t=_(w,"BUTTON",{class:!0});var A=m(t);i=B(A,s),A.forEach(c),w.forEach(c),this.h()},h(){u(t,"class","btn-sm svelte-yt12fh"),t.disabled=n=e[48](e[106],e[105],e[109]),he(t,"save",!$e(e[105])||e[110]),he(t,"reset",$e(e[105])&&!e[110]),u(l,"class","alias-actions svelte-yt12fh")},m(y,w){Y(y,l,w),r(l,t),r(t,i),a||(o=oe(t,"click",p),a=!0)},p(y,w){e=y,w[0]&67133440&&s!==(s=e[49](e[106],e[105],e[109])+"")&&O(i,s),w[0]&67133440&&n!==(n=e[48](e[106],e[105],e[109]))&&(t.disabled=n),w[0]&67133440|w[1]&49152&&he(t,"save",!$e(e[105])||e[110]),w[0]&67133440|w[1]&49152&&he(t,"reset",$e(e[105])&&!e[110])},d(y){y&&c(l),a=!1,o()}}}function Wl(e,l){let t,s,i,n=l[106]+"",a,o,p,y=l[47](l[105])+"",w,A,g,b,k,R,S,E,h,d,N=ze(l[105]),q,V,T;function W(){return l[61](l[106])}function K(){return l[62](l[106])}function x(...ie){return l[63](l[106],...ie)}let F=l[18]===l[106]&&Ml(l),X=N&&ql(l);return{key:e,first:null,c(){t=v("div"),s=v("div"),i=v("span"),a=I(n),o=L(),p=v("span"),w=I(y),A=L(),g=v("div"),b=v("input"),h=L(),F&&F.c(),d=L(),X&&X.c(),q=L(),this.h()},l(ie){t=_(ie,"DIV",{class:!0});var M=m(t);s=_(M,"DIV",{class:!0});var z=m(s);i=_(z,"SPAN",{class:!0});var Z=m(i);a=B(Z,n),Z.forEach(c),o=U(z),p=_(z,"SPAN",{class:!0});var ee=m(p);w=B(ee,y),ee.forEach(c),z.forEach(c),A=U(M),g=_(M,"DIV",{class:!0});var Q=m(g);b=_(Q,"INPUT",{class:!0,placeholder:!0,"aria-label":!0}),h=U(Q),F&&F.l(Q),Q.forEach(c),d=U(M),X&&X.l(M),q=U(M),M.forEach(c),this.h()},h(){u(i,"class","alias-model mono svelte-yt12fh"),u(p,"class","alias-state svelte-yt12fh"),he(p,"unresolved",!l[105].hasPrice),u(s,"class","alias-meta svelte-yt12fh"),u(b,"class","alias-search svelte-yt12fh"),b.value=k=l[108],u(b,"placeholder",R=l[7]("pricing.aliasSearch")),u(b,"aria-label",S=l[7]("pricing.aliasTarget")),b.disabled=E=!ze(l[105]),u(g,"class","alias-combobox svelte-yt12fh"),u(t,"class","alias-row svelte-yt12fh"),this.first=t},m(ie,M){Y(ie,t,M),r(t,s),r(s,i),r(i,a),r(s,o),r(s,p),r(p,w),r(t,A),r(t,g),r(g,b),r(g,h),F&&F.m(g,null),r(t,d),X&&X.m(t,null),r(t,q),V||(T=[oe(b,"focus",W),oe(b,"blur",K),oe(b,"input",x)],V=!0)},p(ie,M){l=ie,M[0]&67108864&&n!==(n=l[106]+"")&&O(a,n),M[0]&67108864&&y!==(y=l[47](l[105])+"")&&O(w,y),M[0]&67108864&&he(p,"unresolved",!l[105].hasPrice),M[0]&67125248&&k!==(k=l[108])&&b.value!==k&&(b.value=k),M[0]&128&&R!==(R=l[7]("pricing.aliasSearch"))&&u(b,"placeholder",R),M[0]&128&&S!==(S=l[7]("pricing.aliasTarget"))&&u(b,"aria-label",S),M[0]&67108864&&E!==(E=!ze(l[105]))&&(b.disabled=E),l[18]===l[106]?F?F.p(l,M):(F=Ml(l),F.c(),F.m(g,null)):F&&(F.d(1),F=null),M[0]&67108864&&(N=ze(l[105])),N?X?X.p(l,M):(X=ql(l),X.c(),X.m(t,q)):X&&(X.d(1),X=null)},d(ie){ie&&c(t),F&&F.d(),X&&X.d(),V=!1,vl(T)}}}function wt(e){let l,t=Ge(e[25]),s=[];for(let i=0;i<t.length;i+=1)s[i]=Ql(gl(e,t,i));return{c(){l=v("div");for(let i=0;i<s.length;i+=1)s[i].c();this.h()},l(i){l=_(i,"DIV",{class:!0});var n=m(l);for(let a=0;a<s.length;a+=1)s[a].l(n);n.forEach(c),this.h()},h(){u(l,"class","grid svelte-yt12fh")},m(i,n){Y(i,l,n);for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(l,null)},p(i,n){if(n[0]&1107300224|n[1]&51){t=Ge(i[25]);let a;for(a=0;a<t.length;a+=1){const o=gl(i,t,a);s[a]?s[a].p(o,n):(s[a]=Ql(o),s[a].c(),s[a].m(l,null))}for(;a<s.length;a+=1)s[a].d(1);s.length=t.length}},d(i){i&&c(l),zl(s,i)}}}function Dt(e){let l,t=e[7]("pricing.modelSearchEmpty")+"",s;return{c(){l=v("div"),s=I(t),this.h()},l(i){l=_(i,"DIV",{class:!0});var n=m(l);s=B(n,t),n.forEach(c),this.h()},h(){u(l,"class","state-msg svelte-yt12fh")},m(i,n){Y(i,l,n),r(l,s)},p(i,n){n[0]&128&&t!==(t=i[7]("pricing.modelSearchEmpty")+"")&&O(s,t)},d(i){i&&c(l)}}}function Ct(e){var De,Ve;let l,t,s=e[101].model+"",i,n,a,o,p=e[7]("pricing.edit")+"",y,w,A,g,b,k,R=e[7]("pricing.input")+"",S,E,h,d=(e[101].price?e[32](e[101].price.input,e[101].currency,e[11]):"-")+"",N,q,V,T="/",W,K,x,F=e[7]("pricing.output")+"",X,ie,M,z=(e[101].price?e[32](e[101].price.output,e[101].currency,e[11]):"-")+"",Z,ee,Q,C,H,me=e[7]("pricing.cacheRead")+"",ke,te,ge,ne=(((De=e[101].price)==null?void 0:De.cacheRead)!=null?e[32](e[101].price.cacheRead,e[101].currency,e[11]):"-")+"",re,Be,ye,pe,J=e[7]("pricing.cacheWrite")+"",be,_e,le,fe=(((Ve=e[101].price)==null?void 0:Ve.cacheWrite)!=null?e[32](e[101].price.cacheWrite,e[101].currency,e[11]):"-")+"",Ne,Ie,ae,Ue,Te,we=dl(e[101]),Ae,We;function Ye(){return e[72](e[101])}let ve=e[101].isOverride&&Yl(e);function de($,G){return $[101].isOverride?Lt:$[101].isBuiltin||$[101].isDefault?Ut:$[101].matchedBy?Mt:Vt}let j=de(e),Pe=j(e),ue=e[101].currency==="CNY"&&Kl(),se=we&&Fl(e);return{c(){l=v("div"),t=v("span"),i=I(s),n=L(),a=v("div"),o=v("button"),y=I(p),w=L(),ve&&ve.c(),A=L(),g=v("div"),b=v("div"),k=v("span"),S=I(R),E=L(),h=v("span"),N=I(d),q=L(),V=v("span"),V.textContent=T,W=L(),K=v("div"),x=v("span"),X=I(F),ie=L(),M=v("span"),Z=I(z),ee=L(),Q=v("div"),C=v("div"),H=v("span"),ke=I(me),te=L(),ge=v("span"),re=I(ne),Be=L(),ye=v("div"),pe=v("span"),be=I(J),_e=L(),le=v("span"),Ne=I(fe),Ie=L(),ae=v("div"),Pe.c(),Ue=L(),ue&&ue.c(),Te=L(),se&&se.c(),this.h()},l($){l=_($,"DIV",{class:!0});var G=m(l);t=_(G,"SPAN",{class:!0});var Ce=m(t);i=B(Ce,s),Ce.forEach(c),n=U(G),a=_(G,"DIV",{class:!0});var Re=m(a);o=_(Re,"BUTTON",{class:!0});var Ke=m(o);y=B(Ke,p),Ke.forEach(c),w=U(Re),ve&&ve.l(Re),Re.forEach(c),G.forEach(c),A=U($),g=_($,"DIV",{class:!0});var Oe=m(g);b=_(Oe,"DIV",{class:!0});var xe=m(b);k=_(xe,"SPAN",{class:!0});var il=m(k);S=B(il,R),il.forEach(c),E=U(xe),h=_(xe,"SPAN",{class:!0});var nl=m(h);N=B(nl,d),nl.forEach(c),xe.forEach(c),q=U(Oe),V=_(Oe,"SPAN",{class:!0,"data-svelte-h":!0}),sl(V)!=="svelte-ums4yv"&&(V.textContent=T),W=U(Oe),K=_(Oe,"DIV",{class:!0});var Je=m(K);x=_(Je,"SPAN",{class:!0});var tl=m(x);X=B(tl,F),tl.forEach(c),ie=U(Je),M=_(Je,"SPAN",{class:!0});var Fe=m(M);Z=B(Fe,z),Fe.forEach(c),Je.forEach(c),Oe.forEach(c),ee=U($),Q=_($,"DIV",{class:!0});var Xe=m(Q);C=_(Xe,"DIV",{class:!0});var el=m(C);H=_(el,"SPAN",{class:!0});var al=m(H);ke=B(al,me),al.forEach(c),te=U(el),ge=_(el,"SPAN",{class:!0});var rl=m(ge);re=B(rl,ne),rl.forEach(c),el.forEach(c),Be=U(Xe),ye=_(Xe,"DIV",{class:!0});var Ze=m(ye);pe=_(Ze,"SPAN",{class:!0});var cl=m(pe);be=B(cl,J),cl.forEach(c),_e=U(Ze),le=_(Ze,"SPAN",{class:!0});var ol=m(le);Ne=B(ol,fe),ol.forEach(c),Ze.forEach(c),Xe.forEach(c),Ie=U($),ae=_($,"DIV",{class:!0});var Qe=m(ae);Pe.l(Qe),Ue=U(Qe),ue&&ue.l(Qe),Te=U(Qe),se&&se.l(Qe),Qe.forEach(c),this.h()},h(){u(t,"class","model-name mono svelte-yt12fh"),u(o,"class","btn-sm svelte-yt12fh"),u(a,"class","card-btns svelte-yt12fh"),u(l,"class","card-head svelte-yt12fh"),u(k,"class","price-label svelte-yt12fh"),u(h,"class","price-val svelte-yt12fh"),u(b,"class","price-block primary svelte-yt12fh"),u(V,"class","slash svelte-yt12fh"),u(x,"class","price-label svelte-yt12fh"),u(M,"class","price-val svelte-yt12fh"),u(K,"class","price-block primary svelte-yt12fh"),u(g,"class","price-row svelte-yt12fh"),u(H,"class","price-label svelte-yt12fh"),u(ge,"class","price-val sm svelte-yt12fh"),u(C,"class","price-block svelte-yt12fh"),u(pe,"class","price-label svelte-yt12fh"),u(le,"class","price-val sm svelte-yt12fh"),u(ye,"class","price-block svelte-yt12fh"),u(Q,"class","price-row secondary svelte-yt12fh"),u(ae,"class","card-footer svelte-yt12fh")},m($,G){Y($,l,G),r(l,t),r(t,i),r(l,n),r(l,a),r(a,o),r(o,y),r(a,w),ve&&ve.m(a,null),Y($,A,G),Y($,g,G),r(g,b),r(b,k),r(k,S),r(b,E),r(b,h),r(h,N),r(g,q),r(g,V),r(g,W),r(g,K),r(K,x),r(x,X),r(K,ie),r(K,M),r(M,Z),Y($,ee,G),Y($,Q,G),r(Q,C),r(C,H),r(H,ke),r(C,te),r(C,ge),r(ge,re),r(Q,Be),r(Q,ye),r(ye,pe),r(pe,be),r(ye,_e),r(ye,le),r(le,Ne),Y($,Ie,G),Y($,ae,G),Pe.m(ae,null),r(ae,Ue),ue&&ue.m(ae,null),r(ae,Te),se&&se.m(ae,null),Ae||(We=oe(o,"click",Ye),Ae=!0)},p($,G){var Ce,Re;e=$,G[0]&33554432&&s!==(s=e[101].model+"")&&O(i,s),G[0]&128&&p!==(p=e[7]("pricing.edit")+"")&&O(y,p),e[101].isOverride?ve?ve.p(e,G):(ve=Yl(e),ve.c(),ve.m(a,null)):ve&&(ve.d(1),ve=null),G[0]&128&&R!==(R=e[7]("pricing.input")+"")&&O(S,R),G[0]&33556480&&d!==(d=(e[101].price?e[32](e[101].price.input,e[101].currency,e[11]):"-")+"")&&O(N,d),G[0]&128&&F!==(F=e[7]("pricing.output")+"")&&O(X,F),G[0]&33556480&&z!==(z=(e[101].price?e[32](e[101].price.output,e[101].currency,e[11]):"-")+"")&&O(Z,z),G[0]&128&&me!==(me=e[7]("pricing.cacheRead")+"")&&O(ke,me),G[0]&33556480&&ne!==(ne=(((Ce=e[101].price)==null?void 0:Ce.cacheRead)!=null?e[32](e[101].price.cacheRead,e[101].currency,e[11]):"-")+"")&&O(re,ne),G[0]&128&&J!==(J=e[7]("pricing.cacheWrite")+"")&&O(be,J),G[0]&33556480&&fe!==(fe=(((Re=e[101].price)==null?void 0:Re.cacheWrite)!=null?e[32](e[101].price.cacheWrite,e[101].currency,e[11]):"-")+"")&&O(Ne,fe),j===(j=de(e))&&Pe?Pe.p(e,G):(Pe.d(1),Pe=j(e),Pe&&(Pe.c(),Pe.m(ae,Ue))),e[101].currency==="CNY"?ue||(ue=Kl(),ue.c(),ue.m(ae,Te)):ue&&(ue.d(1),ue=null),G[0]&33554432&&(we=dl(e[101])),we?se?se.p(e,G):(se=Fl(e),se.c(),se.m(ae,null)):se&&(se.d(1),se=null)},d($){$&&(c(l),c(A),c(g),c(ee),c(Q),c(Ie),c(ae)),ve&&ve.d(),Pe.d(),ue&&ue.d(),se&&se.d(),Ae=!1,We()}}}function Rt(e){let l,t,s=e[101].model+"",i,n,a,o,p,y=Me(e[9])+"",w,A,g,b,k,R=e[7]("pricing.input")+"",S,E,h=Me(e[9])+"",d,N,q,V,T,W=e[7]("pricing.output")+"",K,x,F=Me(e[9])+"",X,ie,M,z,Z,ee=e[7]("pricing.cacheRead")+"",Q,C,H=Me(e[9])+"",me,ke,te,ge,ne,re=e[7]("pricing.cacheWrite")+"",Be,ye,pe=Me(e[9])+"",J,be,_e,le,fe,Ne,Ie=e[7]("pricing.save")+"",ae,Ue,Te,we=e[7]("pricing.cancel")+"",Ae,We,Ye;function ve(){return e[71](e[101])}return{c(){l=v("div"),t=v("span"),i=I(s),n=L(),a=v("span"),o=I(e[9]),p=I(" ("),w=I(y),A=I(")"),g=L(),b=v("div"),k=v("label"),S=I(R),E=I(" ("),d=I(h),N=I(`/1M)
|
|
2
|
+
`),q=v("input"),V=L(),T=v("label"),K=I(W),x=I(" ("),X=I(F),ie=I(`/1M)
|
|
3
|
+
`),M=v("input"),z=L(),Z=v("label"),Q=I(ee),C=I(" ("),me=I(H),ke=I(`/1M)
|
|
4
|
+
`),te=v("input"),ge=L(),ne=v("label"),Be=I(re),ye=I(" ("),J=I(pe),be=I(`/1M)
|
|
5
|
+
`),_e=v("input"),le=L(),fe=v("div"),Ne=v("button"),ae=I(Ie),Ue=L(),Te=v("button"),Ae=I(we),this.h()},l(de){l=_(de,"DIV",{class:!0});var j=m(l);t=_(j,"SPAN",{class:!0});var Pe=m(t);i=B(Pe,s),Pe.forEach(c),n=U(j),a=_(j,"SPAN",{class:!0});var ue=m(a);o=B(ue,e[9]),p=B(ue," ("),w=B(ue,y),A=B(ue,")"),ue.forEach(c),j.forEach(c),g=U(de),b=_(de,"DIV",{class:!0});var se=m(b);k=_(se,"LABEL",{class:!0});var De=m(k);S=B(De,R),E=B(De," ("),d=B(De,h),N=B(De,`/1M)
|
|
6
|
+
`),q=_(De,"INPUT",{type:!0,step:!0,class:!0}),De.forEach(c),V=U(se),T=_(se,"LABEL",{class:!0});var Ve=m(T);K=B(Ve,W),x=B(Ve," ("),X=B(Ve,F),ie=B(Ve,`/1M)
|
|
7
|
+
`),M=_(Ve,"INPUT",{type:!0,step:!0,class:!0}),Ve.forEach(c),z=U(se),Z=_(se,"LABEL",{class:!0});var $=m(Z);Q=B($,ee),C=B($," ("),me=B($,H),ke=B($,`/1M)
|
|
8
|
+
`),te=_($,"INPUT",{type:!0,step:!0,class:!0}),$.forEach(c),ge=U(se),ne=_(se,"LABEL",{class:!0});var G=m(ne);Be=B(G,re),ye=B(G," ("),J=B(G,pe),be=B(G,`/1M)
|
|
9
|
+
`),_e=_(G,"INPUT",{type:!0,step:!0,class:!0}),G.forEach(c),se.forEach(c),le=U(de),fe=_(de,"DIV",{class:!0});var Ce=m(fe);Ne=_(Ce,"BUTTON",{class:!0});var Re=m(Ne);ae=B(Re,Ie),Re.forEach(c),Ue=U(Ce),Te=_(Ce,"BUTTON",{class:!0});var Ke=m(Te);Ae=B(Ke,we),Ke.forEach(c),Ce.forEach(c),this.h()},h(){u(t,"class","model-name mono svelte-yt12fh"),u(a,"class","badge svelte-yt12fh"),he(a,"cny",e[9]==="CNY"),he(a,"default",e[9]!=="CNY"),u(l,"class","card-head svelte-yt12fh"),u(q,"type","number"),u(q,"step","0.01"),u(q,"class","edit-input svelte-yt12fh"),u(k,"class","svelte-yt12fh"),u(M,"type","number"),u(M,"step","0.01"),u(M,"class","edit-input svelte-yt12fh"),u(T,"class","svelte-yt12fh"),u(te,"type","number"),u(te,"step","0.01"),u(te,"class","edit-input svelte-yt12fh"),u(Z,"class","svelte-yt12fh"),u(_e,"type","number"),u(_e,"step","0.01"),u(_e,"class","edit-input svelte-yt12fh"),u(ne,"class","svelte-yt12fh"),u(b,"class","edit-fields svelte-yt12fh"),u(Ne,"class","btn-sm save svelte-yt12fh"),u(Te,"class","btn-sm svelte-yt12fh"),u(fe,"class","edit-btns svelte-yt12fh")},m(de,j){Y(de,l,j),r(l,t),r(t,i),r(l,n),r(l,a),r(a,o),r(a,p),r(a,w),r(a,A),Y(de,g,j),Y(de,b,j),r(b,k),r(k,S),r(k,E),r(k,d),r(k,N),r(k,q),Le(q,e[10].input),r(b,V),r(b,T),r(T,K),r(T,x),r(T,X),r(T,ie),r(T,M),Le(M,e[10].output),r(b,z),r(b,Z),r(Z,Q),r(Z,C),r(Z,me),r(Z,ke),r(Z,te),Le(te,e[10].cacheRead),r(b,ge),r(b,ne),r(ne,Be),r(ne,ye),r(ne,J),r(ne,be),r(ne,_e),Le(_e,e[10].cacheWrite),Y(de,le,j),Y(de,fe,j),r(fe,Ne),r(Ne,ae),r(fe,Ue),r(fe,Te),r(Te,Ae),We||(Ye=[oe(q,"input",e[67]),oe(M,"input",e[68]),oe(te,"input",e[69]),oe(_e,"input",e[70]),oe(Ne,"click",ve),oe(Te,"click",e[31])],We=!0)},p(de,j){e=de,j[0]&33554432&&s!==(s=e[101].model+"")&&O(i,s),j[0]&512&&O(o,e[9]),j[0]&512&&y!==(y=Me(e[9])+"")&&O(w,y),j[0]&512&&he(a,"cny",e[9]==="CNY"),j[0]&512&&he(a,"default",e[9]!=="CNY"),j[0]&128&&R!==(R=e[7]("pricing.input")+"")&&O(S,R),j[0]&512&&h!==(h=Me(e[9])+"")&&O(d,h),j[0]&1024&&He(q.value)!==e[10].input&&Le(q,e[10].input),j[0]&128&&W!==(W=e[7]("pricing.output")+"")&&O(K,W),j[0]&512&&F!==(F=Me(e[9])+"")&&O(X,F),j[0]&1024&&He(M.value)!==e[10].output&&Le(M,e[10].output),j[0]&128&&ee!==(ee=e[7]("pricing.cacheRead")+"")&&O(Q,ee),j[0]&512&&H!==(H=Me(e[9])+"")&&O(me,H),j[0]&1024&&He(te.value)!==e[10].cacheRead&&Le(te,e[10].cacheRead),j[0]&128&&re!==(re=e[7]("pricing.cacheWrite")+"")&&O(Be,re),j[0]&512&&pe!==(pe=Me(e[9])+"")&&O(J,pe),j[0]&1024&&He(_e.value)!==e[10].cacheWrite&&Le(_e,e[10].cacheWrite),j[0]&128&&Ie!==(Ie=e[7]("pricing.save")+"")&&O(ae,Ie),j[0]&128&&we!==(we=e[7]("pricing.cancel")+"")&&O(Ae,we)},d(de){de&&(c(l),c(g),c(b),c(le),c(fe)),We=!1,vl(Ye)}}}function Yl(e){let l,t=e[7]("pricing.reset")+"",s,i,n;function a(){return e[73](e[101])}return{c(){l=v("button"),s=I(t),this.h()},l(o){l=_(o,"BUTTON",{class:!0});var p=m(l);s=B(p,t),p.forEach(c),this.h()},h(){u(l,"class","btn-sm reset svelte-yt12fh")},m(o,p){Y(o,l,p),r(l,s),i||(n=oe(l,"click",a),i=!0)},p(o,p){e=o,p[0]&128&&t!==(t=e[7]("pricing.reset")+"")&&O(s,t)},d(o){o&&c(l),i=!1,n()}}}function Vt(e){let l,t=e[7]("pricing.noPrice")+"",s;return{c(){l=v("span"),s=I(t),this.h()},l(i){l=_(i,"SPAN",{class:!0});var n=m(l);s=B(n,t),n.forEach(c),this.h()},h(){u(l,"class","badge no-price svelte-yt12fh")},m(i,n){Y(i,l,n),r(l,s)},p(i,n){n[0]&128&&t!==(t=i[7]("pricing.noPrice")+"")&&O(s,t)},d(i){i&&c(l)}}}function Mt(e){let l,t=e[101].matchedBy+"",s;return{c(){l=v("span"),s=I(t),this.h()},l(i){l=_(i,"SPAN",{class:!0});var n=m(l);s=B(n,t),n.forEach(c),this.h()},h(){u(l,"class","badge matched svelte-yt12fh")},m(i,n){Y(i,l,n),r(l,s)},p(i,n){n[0]&33554432&&t!==(t=i[101].matchedBy+"")&&O(s,t)},d(i){i&&c(l)}}}function Ut(e){let l,t=e[7]("pricing.default")+"",s;return{c(){l=v("span"),s=I(t),this.h()},l(i){l=_(i,"SPAN",{class:!0});var n=m(l);s=B(n,t),n.forEach(c),this.h()},h(){u(l,"class","badge default svelte-yt12fh")},m(i,n){Y(i,l,n),r(l,s)},p(i,n){n[0]&128&&t!==(t=i[7]("pricing.default")+"")&&O(s,t)},d(i){i&&c(l)}}}function Lt(e){let l,t=(e[101].hasSyncedBaseline?e[7]("pricing.syncedOverride"):e[7]("pricing.override"))+"",s;return{c(){l=v("span"),s=I(t),this.h()},l(i){l=_(i,"SPAN",{class:!0});var n=m(l);s=B(n,t),n.forEach(c),this.h()},h(){u(l,"class","badge override svelte-yt12fh")},m(i,n){Y(i,l,n),r(l,s)},p(i,n){n[0]&33554560&&t!==(t=(i[101].hasSyncedBaseline?i[7]("pricing.syncedOverride"):i[7]("pricing.override"))+"")&&O(s,t)},d(i){i&&c(l)}}}function Kl(e){let l,t="CNY";return{c(){l=v("span"),l.textContent=t,this.h()},l(s){l=_(s,"SPAN",{class:!0,"data-svelte-h":!0}),sl(l)!=="svelte-16dyd5a"&&(l.textContent=t),this.h()},h(){u(l,"class","badge cny svelte-yt12fh")},m(s,i){Y(s,l,i)},d(s){s&&c(l)}}}function Fl(e){let l,t=dl(e[101])+"",s;return{c(){l=v("span"),s=I(t),this.h()},l(i){l=_(i,"SPAN",{class:!0});var n=m(l);s=B(n,t),n.forEach(c),this.h()},h(){u(l,"class","badge source svelte-yt12fh")},m(i,n){Y(i,l,n),r(l,s)},p(i,n){n[0]&33554432&&t!==(t=dl(i[101])+"")&&O(s,t)},d(i){i&&c(l)}}}function Ql(e){let l,t;function s(a,o){return a[102]?Rt:Ct}let i=s(e),n=i(e);return{c(){l=v("div"),n.c(),t=L(),this.h()},l(a){l=_(a,"DIV",{class:!0,style:!0});var o=m(l);n.l(o),t=U(o),o.forEach(c),this.h()},h(){u(l,"class","card svelte-yt12fh"),_l(l,"animation-delay",e[104]*25+"ms"),he(l,"no-price",!e[101].price&&!e[101].matchedBy)},m(a,o){Y(a,l,o),n.m(l,null),r(l,t)},p(a,o){i===(i=s(a))&&n?n.p(a,o):(n.d(1),n=i(a),n&&(n.c(),n.m(l,t))),o[0]&33554432&&he(l,"no-price",!a[101].price&&!a[101].matchedBy)},d(a){a&&c(l),n.d()}}}function Ot(e){let l,t,s,i,n=e[7]("pricing.title")+"",a,o,p,y,w=(e[22]?e[7]("pricing.costsUpdating"):e[7]("pricing.recalc"))+"",A,g,b,k,R=(e[12]?e[7]("pricing.syncingPrices"):e[7]("pricing.syncPrices"))+"",S,E,h,d,N="USD",q,V,T="CNY",W,K,x,F,X,ie;document.title=l=e[7]("pricing.title")+" — AIUsage";let M=e[29]&&kl(e),z=e[21]&&Pl(e);function Z(C,H){return C[1]?It:C[2]?Bt:C[6]?At:Tt}let ee=Z(e),Q=ee(e);return{c(){t=L(),s=v("div"),i=v("h1"),a=I(n),o=L(),p=v("div"),y=v("button"),A=I(w),b=L(),k=v("button"),S=I(R),E=L(),h=v("div"),d=v("button"),d.textContent=N,q=L(),V=v("button"),V.textContent=T,W=L(),M&&M.c(),K=L(),z&&z.c(),x=L(),Q.c(),F=je(),this.h()},l(C){pt("svelte-tm7ewl",document.head).forEach(c),t=U(C),s=_(C,"DIV",{class:!0});var me=m(s);i=_(me,"H1",{class:!0});var ke=m(i);a=B(ke,n),ke.forEach(c),o=U(me),p=_(me,"DIV",{class:!0});var te=m(p);y=_(te,"BUTTON",{class:!0});var ge=m(y);A=B(ge,w),ge.forEach(c),b=U(te),k=_(te,"BUTTON",{class:!0});var ne=m(k);S=B(ne,R),ne.forEach(c),E=U(te),h=_(te,"DIV",{class:!0});var re=m(h);d=_(re,"BUTTON",{class:!0,"data-svelte-h":!0}),sl(d)!=="svelte-13ez77b"&&(d.textContent=N),q=U(re),V=_(re,"BUTTON",{class:!0,"data-svelte-h":!0}),sl(V)!=="svelte-3m3km3"&&(V.textContent=T),re.forEach(c),te.forEach(c),me.forEach(c),W=U(C),M&&M.l(C),K=U(C),z&&z.l(C),x=U(C),Q.l(C),F=je(),this.h()},h(){u(i,"class","page-title svelte-yt12fh"),u(y,"class","btn-sm primary svelte-yt12fh"),y.disabled=g=e[22]||e[6],u(k,"class","btn-sm sync-btn svelte-yt12fh"),k.disabled=e[12],u(d,"class","toggle-btn svelte-yt12fh"),he(d,"active",e[11]==="USD"),u(V,"class","toggle-btn svelte-yt12fh"),he(V,"active",e[11]==="CNY"),u(h,"class","currency-toggle svelte-yt12fh"),u(p,"class","header-right svelte-yt12fh"),u(s,"class","header-row svelte-yt12fh")},m(C,H){Y(C,t,H),Y(C,s,H),r(s,i),r(i,a),r(s,o),r(s,p),r(p,y),r(y,A),r(p,b),r(p,k),r(k,S),r(p,E),r(p,h),r(h,d),r(h,q),r(h,V),Y(C,W,H),M&&M.m(C,H),Y(C,K,H),z&&z.m(C,H),Y(C,x,H),Q.m(C,H),Y(C,F,H),X||(ie=[oe(y,"click",e[34]),oe(k,"click",e[37]),oe(d,"click",e[59]),oe(V,"click",e[60])],X=!0)},p(C,H){H[0]&128&&l!==(l=C[7]("pricing.title")+" — AIUsage")&&(document.title=l),H[0]&128&&n!==(n=C[7]("pricing.title")+"")&&O(a,n),H[0]&4194432&&w!==(w=(C[22]?C[7]("pricing.costsUpdating"):C[7]("pricing.recalc"))+"")&&O(A,w),H[0]&4194368&&g!==(g=C[22]||C[6])&&(y.disabled=g),H[0]&4224&&R!==(R=(C[12]?C[7]("pricing.syncingPrices"):C[7]("pricing.syncPrices"))+"")&&O(S,R),H[0]&4096&&(k.disabled=C[12]),H[0]&2048&&he(d,"active",C[11]==="USD"),H[0]&2048&&he(V,"active",C[11]==="CNY"),C[29]?M?M.p(C,H):(M=kl(C),M.c(),M.m(K.parentNode,K)):M&&(M.d(1),M=null),C[21]?z?z.p(C,H):(z=Pl(C),z.c(),z.m(x.parentNode,x)):z&&(z.d(1),z=null),ee===(ee=Z(C))&&Q?Q.p(C,H):(Q.d(1),Q=ee(C),Q&&(Q.c(),Q.m(F.parentNode,F)))},i:pl,o:pl,d(C){C&&(c(t),c(s),c(W),c(K),c(x),c(F)),M&&M.d(C),z&&z.d(C),Q.d(C),X=!1,vl(ie)}}}function Me(e){return e==="CNY"?"¥":"$"}function Hl(e){return(e==null?void 0:e.state)==="queued"||(e==null?void 0:e.state)==="running"}function qt(e){return new Promise(l=>setTimeout(l,e))}function Wt(e){return e==null?"-":e===0?"0":e<.01?e.toFixed(4):e<1?e.toFixed(3):e.toFixed(2)}function dl(e){return e.source?e.source==="litellm"?e.sourceModelId&&e.sourceModelId!==e.model?e.sourceModelId:"":e.sourceModelId&&e.sourceModelId!==e.model?`${e.source}: ${e.sourceModelId}`:e.source:""}function ll(e){return`${e.provider?`${e.provider} / `:""}${e.model}`}function Yt(e,l){const t=(l||"").trim().toLowerCase();return t?[e.model,e.provider,ll(e)].some(s=>String(s||"").toLowerCase().includes(t)):!0}function $e(e){return!!e.hasManualBinding}function ze(e){return e.bindingType==="none"||e.hasManualBinding}function ul(e){return e.bindingType==="automatic"}function fl(e,l){return!!(e&&e!==l.modelKey)}function Kt(e,l){const t=l.trim().toLowerCase();return t?[e.model,e.provider,e.source,e.sourceModelId,e.matchedBy,e.origin,e.currency].some(s=>String(s||"").toLowerCase().includes(t)):!0}function Ft(e,l,t){let s,i,n,a,o,p,y,w,A,g,b,k,R,S,E,h,d;hl(e,Pt,f=>t(7,E=f)),hl(e,St,f=>t(82,h=f)),hl(e,Nt,f=>t(83,d=f));let N=[],q=!0,V=null,T=null,W=null,K={},x=null,F=d||"USD",X=!1,ie=null,M=null,z=[],Z=[],ee={},Q={},C="",H=!1,me=!1,ke=!1,te=null,ge=null,ne=null,re=!1,Be=null,ye=null,pe=!1,J={state:"idle",total:0,processed:0,updated:0,skipped:0,error:null},be=null,_e=0,le="idle";ut(()=>{_e+=1,x&&clearTimeout(x),be&&clearInterval(be)}),ft(async()=>{await fe(),await de()});async function fe({showLoading:f=!0}={}){f&&t(1,q=!0),t(2,V=null);try{const P=await vt();t(0,N=P.models||[]),t(52,M=P.registry||null),t(53,z=P.targets||[]),t(54,Z=P.localBindings||[]);const D={},ce={};for(const Ee of Z){if(!Ee.modelKey)continue;D[Ee.model]=Ee.modelKey;const qe=(P.targets||[]).find(ct=>ct.model===Ee.modelKey);ce[Ee.model]=qe?ll(qe):Ee.modelKey}t(13,ee=D),t(14,Q=ce),Z.length||t(15,H=!1)}catch(P){t(2,V=P instanceof Error?P.message:"Failed to load")}finally{f&&t(1,q=!1)}}function Ne(f){var D,ce,Ee,qe;t(8,T=f.model);const P=f.currency||"USD";t(9,W=F),t(10,K={input:ae(((D=f.price)==null?void 0:D.input)??0,P,F)??0,output:ae(((ce=f.price)==null?void 0:ce.output)??0,P,F)??0,cacheRead:ae(((Ee=f.price)==null?void 0:Ee.cacheRead)??0,P,F)??0,cacheWrite:ae(((qe=f.price)==null?void 0:qe.cacheWrite)??0,P,F)??0})}function Ie(){t(8,T=null),t(9,W=null),t(10,K={})}function ae(f,P,D){return f==null||P===D?f:P==="CNY"?f*h:f/h}function Ue(f,P,D){const ce=ae(f,P,D);return ce!=null?`${Me(D)}${Wt(ce)}`:"-"}function Te(){x&&clearTimeout(x),Se.set("done"),x=setTimeout(()=>{Se.set("idle")},3e3)}function we(f=Date.now()){x&&(clearTimeout(x),x=null),t(55,re=!0),Be=f,t(56,pe=!1),Se.set("idle")}function Ae(f){f!=null&&f.needsRecalc&&we(f.needsRecalcSince??Date.now())}function We(f){return!f||typeof f.needsRecalc!="boolean"?!1:(f.needsRecalc?we(f.needsRecalcSince??Date.now()):(t(55,re=!1),Be=null,ye=null),!0)}function Ye(f){t(57,J=f||{state:"idle",total:0,processed:0,updated:0,skipped:0,error:null});const P=We(J);if(J.state==="queued"||J.state==="running"){t(56,pe=!1),Se.set("updating"),j();return}be&&(clearInterval(be),be=null),J.state==="done"?(P?!re:!re||ye!=null&&ye>=Be)?(t(55,re=!1),Be=null,ye=null,t(56,pe=!1),Te()):Se.set("idle"):J.state==="error"?(t(56,pe=!1),Se.set("idle")):Se.set("idle")}function ve(){t(56,pe=!0),!re&&(J.state==="done"||J.state==="error")&&(t(57,J={state:"idle",total:0,processed:0,updated:0,skipped:0,error:null}),Se.set("idle"))}async function de(){try{Ye(await ml())}catch{be&&(clearInterval(be),be=null),Se.set("idle")}}function j(){be||(be=setInterval(de,700))}async function Pe(f){for(let P=0;P<180&&f===_e;P+=1){if(await qt(P<5?250:700),f!==_e)return;const D=await ml();if(Ye(D),!Hl(D))return}}async function ue(){try{const f=Date.now();t(56,pe=!1),Se.set("updating");const P=await mt(),D=P.status||P;P.accepted!==!1&&(ye=D.startedAt??f),_e+=1;const ce=_e;Ye(D),Hl(D)?await Pe(ce):await de()}catch(f){Se.set("idle"),alert(f.message)}}async function se(f){try{const P=await gt(f,{...K,currency:W});t(8,T=null),t(9,W=null),await fe({showLoading:!1}),Ae(P)}catch(P){Se.set("idle"),alert(P.message)}}async function De(f){try{const P=await bt(f);await fe({showLoading:!1}),Ae(P)}catch(P){Se.set("idle"),alert(P.message)}}async function Ve(){try{t(12,X=!0);const f=await yt();t(51,ie=f.summary||null),await fe(),Ae(f)}catch(f){Se.set("idle"),alert(f.message)}finally{t(12,X=!1)}}async function $(f,P=Fe(f)){const D=P;if(!D)return;const ce=z.find(Ee=>Ee.model===D);try{ge=f;const Ee=await kt(f,D);Ae(Ee),t(54,Z=Z.map(qe=>qe.model===f?{...qe,modelKey:D,origin:"user",source:"manual",matchType:"alias",hasPrice:!0}:qe)),t(13,ee={...ee,[f]:D}),t(14,Q={...Q,[f]:ce?ll(ce):D}),ge=null,await fe({showLoading:!1})}catch(Ee){Se.set("idle"),alert(Ee.message)}finally{ge=null}}async function G(f){try{ne=f;const P=await Et(f);Ae(P),t(54,Z=Z.map(D=>D.model===f?{...D,modelKey:null,origin:null,source:null,matchType:null,hasPrice:!1}:D)),t(13,ee={...ee,[f]:""}),t(14,Q={...Q,[f]:""}),ne=null,await fe({showLoading:!1})}catch(P){Se.set("idle"),alert(P.message)}finally{ne=null}}function Ce(f){return z.filter(P=>Yt(P,f)).slice(0,30)}function Re(f){return Q[f]??Xe(f)}function Ke(f){const P=Z.find(D=>D.model===f);P&&!ze(P)||(t(14,Q={...Q,[f]:Re(f)}),t(18,te=f))}function Oe(f,P){const D=Z.find(ce=>ce.model===f);D&&!ze(D)||(t(14,Q={...Q,[f]:P}),t(13,ee={...ee,[f]:""}),t(18,te=f))}function xe(){t(15,H=!H),H||t(18,te=null)}function il(){t(16,me=!me)}function nl(){t(17,ke=!ke),ke||t(18,te=null)}function Je(f,P){t(13,ee={...ee,[f]:P.model}),t(14,Q={...Q,[f]:ll(P)}),t(18,te=null)}function tl(f,P){if(f)return f;const D=(P||"").trim().toLowerCase();if(!D)return"";const ce=z.find(Ee=>Ee.model.toLowerCase()===D||ll(Ee).toLowerCase()===D);return(ce==null?void 0:ce.model)||""}function Fe(f){return tl(ee[f],Q[f])}function Xe(f){const P=z.find(D=>D.model===ee[f]);return P?ll(P):""}function el(f){return!f.hasPrice||!f.modelKey?E("pricing.noPrice"):f.bindingType==="custom"?E("pricing.customPricing"):f.bindingType==="manual"?E("pricing.manualBinding"):f.matchType==="alias"?E("pricing.autoBinding"):f.matchType==="prefix"?E("pricing.prefixBinding"):E("pricing.exactBinding")}function al(f,P,D=Fe(f)){return ge===f||ne===f||!ze(P)||ul(P)?!0:$e(P)&&!fl(D,P)?!1:!D||D===P.modelKey}function rl(f,P,D=Fe(f)){return ne===f?E("pricing.unbindingAlias"):$e(P)&&!fl(D,P)?E("pricing.unbindAlias"):cl(f,D)}function Ze(f,P,D=Fe(f)){if(!ul(P)&&ze(P))return $e(P)&&!fl(D,P)?G(f):$(f,D)}function cl(f,P=Fe(f)){if(ge===f)return E("pricing.bindingAlias");const D=Z.find(ce=>ce.model===f);return D!=null&&D.modelKey&&D.modelKey!==P?E("pricing.updateBinding"):E("pricing.bindAlias")}const ol=()=>t(11,F="USD"),Qe=()=>t(11,F="CNY"),Jl=f=>Ke(f),Xl=f=>setTimeout(()=>{te===f&&t(18,te=null)},100),Zl=(f,P)=>Oe(f,P.currentTarget.value),$l=(f,P)=>Je(f,P),xl=(f,P,D)=>Ze(f,P,D);function et(){C=this.value,t(3,C)}function lt(){K.input=He(this.value),t(10,K)}function tt(){K.output=He(this.value),t(10,K)}function st(){K.cacheRead=He(this.value),t(10,K)}function it(){K.cacheWrite=He(this.value),t(10,K)}const nt=f=>se(f.model),at=f=>Ne(f),rt=f=>De(f.model);return e.$$.update=()=>{var f,P;if(e.$$.dirty[0]&128|e.$$.dirty[1]&1048576&&t(29,s=ie?E("pricing.syncSummary").replace("{added}",ie.added??0).replace("{updated}",ie.updated??0).replace("{unresolved}",((P=(f=ie.dryRun)==null?void 0:f.unresolved)==null?void 0:P.length)??0):""),e.$$.dirty[0]&6|e.$$.dirty[1]&2097152&&t(6,i=!q&&!V&&(M==null?void 0:M.totalPrices)===0),e.$$.dirty[1]&2097152&&t(28,n=(M==null?void 0:M.unresolvedLocalModels)||[]),e.$$.dirty[1]&8388608&&t(5,a=Z||[]),e.$$.dirty[0]&32&&t(27,o=a.filter(D=>ul(D))),e.$$.dirty[0]&32&&t(26,p=a.filter(D=>!ul(D))),e.$$.dirty[0]&9&&t(25,y=N.filter(D=>Kt(D,C))),e.$$.dirty[0]&96|e.$$.dirty[1]&4194304&&t(24,w=!i&&a.length>0&&z.length>0),e.$$.dirty[1]&83886080){const D=J.state,ce=re;D==="queued"||D==="running"?t(4,le=D):D==="error"?t(4,le="error"):D==="done"&&!ce?t(4,le="done"):ce?t(4,le="needed"):t(4,le="idle")}e.$$.dirty[1]&67108864&&t(23,A=J.total>0?Math.min(100,Math.round(J.processed/J.total*100)):0),e.$$.dirty[0]&16&&t(22,g=le==="queued"||le==="running"),e.$$.dirty[0]&16|e.$$.dirty[1]&33554432&&t(21,b=!pe&&le!=="idle"),e.$$.dirty[0]&128|e.$$.dirty[1]&67108864&&t(58,k=J.state==="done"?E("pricing.recalcSummary").replace("{updated}",J.updated??0).replace("{skipped}",J.skipped??0):J.error||""),e.$$.dirty[0]&144|e.$$.dirty[1]&67108864&&t(20,R=le==="queued"?E("pricing.recalcQueued"):le==="running"?E("pricing.recalcRunning").replace("{processed}",J.processed??0).replace("{total}",J.total??0):le==="needed"?E("pricing.recalcNeeded"):le==="error"?E("pricing.recalcFailed"):le==="done"?E("pricing.recalcDone"):""),e.$$.dirty[0]&144|e.$$.dirty[1]&201326592&&t(19,S=le==="queued"?J.queueRunning||Math.max(0,(J.queuePending??1)-1)>0?E("pricing.recalcQueuedBehindWrites").replace("{count}",Math.max(0,(J.queuePending??1)-1)):E("pricing.recalcQueuedBody"):le==="running"?E("pricing.recalcRunningBody"):le==="needed"?E("pricing.recalcNeededBody"):le==="error"?J.error||E("pricing.recalcFailedBody"):le==="done"?k:"")},[N,q,V,C,le,a,i,E,T,W,K,F,X,ee,Q,H,me,ke,te,S,R,b,g,A,w,y,p,o,n,s,Ne,Ie,Ue,ve,ue,se,De,Ve,Ce,Ke,Oe,xe,il,nl,Je,tl,Xe,el,al,rl,Ze,ie,M,z,Z,re,pe,J,k,ol,Qe,Jl,Xl,Zl,$l,xl,et,lt,tt,st,it,nt,at,rt]}class Jt extends dt{constructor(l){super(),ht(this,l,Ft,Ot,ot,{},null,[-1,-1,-1,-1])}}export{Jt as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as he,c as L}from"../chunks/scheduler.DsWd5xup.js";import{S as ue,i as _e,d as i,k as Q,l as W,m as X,s as R,a as y,b as c,n as Y,o as D,p as pe,g as S,c as g,e as E,f as V,q as Z,r as ae,j as A,h as k,t as N,u as x,v as me,x as se}from"../chunks/index.
|
|
1
|
+
import{s as he,c as L}from"../chunks/scheduler.DsWd5xup.js";import{S as ue,i as _e,d as i,k as Q,l as W,m as X,s as R,a as y,b as c,n as Y,o as D,p as pe,g as S,c as g,e as E,f as V,q as Z,r as ae,j as A,h as k,t as N,u as x,v as me,x as se}from"../chunks/index.BfJlbjrK.js";import{w as de,e as ne}from"../chunks/api.DVLAklIn.js";import{b as oe,f as re,s as ve,a as ge,d as Ee}from"../chunks/stores.BSI_cVy6.js";import{t as ke}from"../chunks/i18n.DApJIXOT.js";import{D as we,a as be,T as De}from"../chunks/ToolSelector.0iI1cXVj.js";function ce(n,e,a){const t=n.slice();return t[8]=e[a],t[10]=a,t}function Pe(n){let e,a=ne(n[0].projects),t=[];for(let l=0;l<a.length;l+=1)t[l]=fe(ce(n,a,l));return{c(){e=k("div");for(let l=0;l<t.length;l+=1)t[l].c();this.h()},l(l){e=g(l,"DIV",{class:!0});var o=E(e);for(let r=0;r<t.length;r+=1)t[r].l(o);o.forEach(i),this.h()},h(){D(e,"class","ranking svelte-13wlcic")},m(l,o){y(l,e,o);for(let r=0;r<t.length;r+=1)t[r]&&t[r].m(e,null)},p(l,o){if(o&1){a=ne(l[0].projects);let r;for(r=0;r<a.length;r+=1){const f=ce(l,a,r);t[r]?t[r].p(f,o):(t[r]=fe(f),t[r].c(),t[r].m(e,null))}for(;r<t.length;r+=1)t[r].d(1);t.length=a.length}},d(l){l&&i(e),me(t,l)}}}function je(n){let e,a,t=n[3]("projects.noData")+"",l,o,r,f=n[3]("projects.noDataHint")+"",m;return{c(){e=k("div"),a=k("h2"),l=N(t),o=A(),r=k("p"),m=N(f),this.h()},l(h){e=g(h,"DIV",{class:!0});var d=E(e);a=g(d,"H2",{});var u=E(a);l=V(u,t),u.forEach(i),o=S(d),r=g(d,"P",{});var w=E(r);m=V(w,f),w.forEach(i),d.forEach(i),this.h()},h(){D(e,"class","state-msg")},m(h,d){y(h,e,d),c(e,a),c(a,l),c(e,o),c(e,r),c(r,m)},p(h,d){d&8&&t!==(t=h[3]("projects.noData")+"")&&R(l,t),d&8&&f!==(f=h[3]("projects.noDataHint")+"")&&R(m,f)},d(h){h&&i(e)}}}function Ie(n){let e,a;return{c(){e=k("div"),a=N(n[1]),this.h()},l(t){e=g(t,"DIV",{class:!0});var l=E(e);a=V(l,n[1]),l.forEach(i),this.h()},h(){D(e,"class","state-msg error")},m(t,l){y(t,e,l),c(e,a)},p(t,l){l&2&&R(a,t[1])},d(t){t&&i(e)}}}function Se(n){let e,a=n[3]("common.loading")+"",t;return{c(){e=k("div"),t=N(a),this.h()},l(l){e=g(l,"DIV",{class:!0});var o=E(e);t=V(o,a),o.forEach(i),this.h()},h(){D(e,"class","state-msg")},m(l,o){y(l,e,o),c(e,t)},p(l,o){o&8&&a!==(a=l[3]("common.loading")+"")&&R(t,a)},d(l){l&&i(e)}}}function ie(n){let e,a=n[8].fullPath+"",t;return{c(){e=k("span"),t=N(a),this.h()},l(l){e=g(l,"SPAN",{class:!0});var o=E(e);t=V(o,a),o.forEach(i),this.h()},h(){D(e,"class","path svelte-13wlcic")},m(l,o){y(l,e,o),c(e,t)},p(l,o){o&1&&a!==(a=l[8].fullPath+"")&&R(t,a)},d(l){l&&i(e)}}}function fe(n){let e,a,t,l=n[10]+1+"",o,r,f,m=n[8].name+"",h,d,u,w,j,H,F,q,$=oe(n[8].tokens)+"",U,C,I,B=re(n[8].cost)+"",z,P,s,v=n[8].percentage.toFixed(1)+"",T,G,J,_=n[8].fullPath&&n[8].fullPath!==n[8].name&&ie(n);return{c(){e=k("div"),a=k("span"),t=N("#"),o=N(l),r=A(),f=k("span"),h=N(m),d=A(),_&&_.c(),w=A(),j=k("div"),H=k("div"),F=A(),q=k("span"),U=N($),C=A(),I=k("span"),z=N(B),P=A(),s=k("span"),T=N(v),G=N("%"),J=A(),this.h()},l(b){e=g(b,"DIV",{class:!0});var p=E(e);a=g(p,"SPAN",{class:!0});var M=E(a);t=V(M,"#"),o=V(M,l),M.forEach(i),r=S(p),f=g(p,"SPAN",{class:!0,title:!0});var K=E(f);h=V(K,m),d=S(K),_&&_.l(K),K.forEach(i),w=S(p),j=g(p,"DIV",{class:!0});var ee=E(j);H=g(ee,"DIV",{class:!0,style:!0}),E(H).forEach(i),ee.forEach(i),F=S(p),q=g(p,"SPAN",{class:!0});var te=E(q);U=V(te,$),te.forEach(i),C=S(p),I=g(p,"SPAN",{class:!0});var le=E(I);z=V(le,B),le.forEach(i),P=S(p),s=g(p,"SPAN",{class:!0});var O=E(s);T=V(O,v),G=V(O,"%"),O.forEach(i),J=S(p),p.forEach(i),this.h()},h(){D(a,"class","rank mono svelte-13wlcic"),D(f,"class","name mono svelte-13wlcic"),D(f,"title",u=n[8].fullPath||n[8].name),D(H,"class","bar svelte-13wlcic"),se(H,"width",n[8].percentage+"%"),D(j,"class","bar-container svelte-13wlcic"),D(q,"class","tokens mono svelte-13wlcic"),D(I,"class","cost mono accent svelte-13wlcic"),D(s,"class","pct mono svelte-13wlcic"),D(e,"class","row animate-row svelte-13wlcic")},m(b,p){y(b,e,p),c(e,a),c(a,t),c(a,o),c(e,r),c(e,f),c(f,h),c(f,d),_&&_.m(f,null),c(e,w),c(e,j),c(j,H),c(e,F),c(e,q),c(q,U),c(e,C),c(e,I),c(I,z),c(e,P),c(e,s),c(s,T),c(s,G),c(e,J)},p(b,p){p&1&&m!==(m=b[8].name+"")&&R(h,m),b[8].fullPath&&b[8].fullPath!==b[8].name?_?_.p(b,p):(_=ie(b),_.c(),_.m(f,null)):_&&(_.d(1),_=null),p&1&&u!==(u=b[8].fullPath||b[8].name)&&D(f,"title",u),p&1&&se(H,"width",b[8].percentage+"%"),p&1&&$!==($=oe(b[8].tokens)+"")&&R(U,$),p&1&&B!==(B=re(b[8].cost)+"")&&R(z,B),p&1&&v!==(v=b[8].percentage.toFixed(1)+"")&&R(T,v)},d(b){b&&i(e),_&&_.d()}}}function Ve(n){let e,a,t,l,o=n[3]("projects.title")+"",r,f,m,h=n[3]("projects.desc")+"",d,u,w,j,H,F,q,$,U,C,I;document.title=e=n[3]("projects.title")+" — AIUsage",j=new we({}),F=new be({}),$=new De({});function B(s,v){var T;return s[2]?Se:s[1]?Ie:(T=s[0])!=null&&T.projects.length?Pe:je}let z=B(n),P=z(n);return{c(){a=A(),t=k("div"),l=k("h1"),r=N(o),f=A(),m=k("p"),d=N(h),u=A(),w=k("div"),x(j.$$.fragment),H=A(),x(F.$$.fragment),q=A(),x($.$$.fragment),U=A(),P.c(),C=ae(),this.h()},l(s){pe("svelte-11fw4x1",document.head).forEach(i),a=S(s),t=g(s,"DIV",{class:!0});var T=E(t);l=g(T,"H1",{});var G=E(l);r=V(G,o),G.forEach(i),f=S(T),m=g(T,"P",{});var J=E(m);d=V(J,h),J.forEach(i),T.forEach(i),u=S(s),w=g(s,"DIV",{class:!0});var _=E(w);Z(j.$$.fragment,_),H=S(_),Z(F.$$.fragment,_),q=S(_),Z($.$$.fragment,_),_.forEach(i),U=S(s),P.l(s),C=ae(),this.h()},h(){D(t,"class","page-header"),D(w,"class","filter-bar")},m(s,v){y(s,a,v),y(s,t,v),c(t,l),c(l,r),c(t,f),c(t,m),c(m,d),y(s,u,v),y(s,w,v),Y(j,w,null),c(w,H),Y(F,w,null),c(w,q),Y($,w,null),y(s,U,v),P.m(s,v),y(s,C,v),I=!0},p(s,[v]){(!I||v&8)&&e!==(e=s[3]("projects.title")+" — AIUsage")&&(document.title=e),(!I||v&8)&&o!==(o=s[3]("projects.title")+"")&&R(r,o),(!I||v&8)&&h!==(h=s[3]("projects.desc")+"")&&R(d,h),z===(z=B(s))&&P?P.p(s,v):(P.d(1),P=z(s),P&&(P.c(),P.m(C.parentNode,C)))},i(s){I||(X(j.$$.fragment,s),X(F.$$.fragment,s),X($.$$.fragment,s),I=!0)},o(s){W(j.$$.fragment,s),W(F.$$.fragment,s),W($.$$.fragment,s),I=!1},d(s){s&&(i(a),i(t),i(u),i(w),i(U),i(C)),Q(j),Q(F),Q($),P.d(s)}}}function Ae(n,e,a){let t,l,o,r;L(n,ve,u=>a(4,t=u)),L(n,ge,u=>a(5,l=u)),L(n,Ee,u=>a(6,o=u)),L(n,ke,u=>a(3,r=u));let f=null,m=null,h=!0;async function d(){a(2,h=!0),a(1,m=null);try{a(0,f=await de({...o,device:l,tool:t}))}catch(u){a(1,m=u instanceof Error?u.message:"Failed to load data"),a(0,f=null)}finally{a(2,h=!1)}}return n.$$.update=()=>{n.$$.dirty&112&&d()},[f,m,h,r,t,l,o]}class Re extends ue{constructor(e){super(),_e(this,e,Ae,Ve,he,{})}}export{Re as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as ve,n as ee,c as he,o as _e}from"../chunks/scheduler.DsWd5xup.js";import{S as pe,i as me,d,s as M,z as te,a as N,b as c,w as be,o as E,p as ke,g as P,c as h,e as b,f as C,C as B,r as G,j as w,h as _,t as S,x as O}from"../chunks/index.66Vu9Sio.js";import{p as ge,e as Q,h as J,i as X}from"../chunks/api.Mv_KcGhp.js";import{t as Ee}from"../chunks/i18n.CwV3KceS.js";function le(u,e,t){const a=u.slice();return a[13]=e[t],a}function se(u,e,t){const a=u.slice();return a[13]=e[t],a}function ae(u,e,t){const a=u.slice();a[18]=e[t];const i=Math.min(Math.round(a[18].utilization),100);a[19]=i;const l=Me(a[18].resetsAt);return a[20]=l,a}function qe(u){let e,t,a=u[5].length>0&&ie(u),i=u[4].length>0&&fe(u);return{c(){a&&a.c(),e=w(),i&&i.c(),t=G()},l(l){a&&a.l(l),e=P(l),i&&i.l(l),t=G()},m(l,s){a&&a.m(l,s),N(l,e,s),i&&i.m(l,s),N(l,t,s)},p(l,s){l[5].length>0?a?a.p(l,s):(a=ie(l),a.c(),a.m(e.parentNode,e)):a&&(a.d(1),a=null),l[4].length>0?i?i.p(l,s):(i=fe(l),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(l){l&&(d(e),d(t)),a&&a.d(l),i&&i.d(l)}}}function De(u){let e,t,a=u[6]("common.noData")+"",i;return{c(){e=_("div"),t=_("p"),i=S(a),this.h()},l(l){e=h(l,"DIV",{class:!0});var s=b(e);t=h(s,"P",{});var o=b(t);i=C(o,a),o.forEach(d),s.forEach(d),this.h()},h(){E(e,"class","state-msg")},m(l,s){N(l,e,s),c(e,t),c(t,i)},p(l,s){s&64&&a!==(a=l[6]("common.noData")+"")&&M(i,a)},d(l){l&&d(e)}}}function Ie(u){let e,t,a;return{c(){e=_("div"),t=_("p"),a=S(u[2]),this.h()},l(i){e=h(i,"DIV",{class:!0});var l=b(e);t=h(l,"P",{});var s=b(t);a=C(s,u[2]),s.forEach(d),l.forEach(d),this.h()},h(){E(e,"class","state-msg error")},m(i,l){N(i,e,l),c(e,t),c(t,a)},p(i,l){l&4&&M(a,i[2])},d(i){i&&d(e)}}}function Ve(u){let e,t,a=u[6]("common.loading")+"",i;return{c(){e=_("div"),t=_("p"),i=S(a),this.h()},l(l){e=h(l,"DIV",{class:!0});var s=b(e);t=h(s,"P",{});var o=b(t);i=C(o,a),o.forEach(d),s.forEach(d),this.h()},h(){E(e,"class","state-msg")},m(l,s){N(l,e,s),c(e,t),c(t,i)},p(l,s){s&64&&a!==(a=l[6]("common.loading")+"")&&M(i,a)},d(l){l&&d(e)}}}function ie(u){let e,t=[],a=new Map,i=Q(u[5]);const l=s=>s[13].tool;for(let s=0;s<i.length;s+=1){let o=se(u,i,s),r=l(o);a.set(r,t[s]=ue(r,o))}return{c(){e=_("div");for(let s=0;s<t.length;s+=1)t[s].c();this.h()},l(s){e=h(s,"DIV",{class:!0});var o=b(e);for(let r=0;r<t.length;r+=1)t[r].l(o);o.forEach(d),this.h()},h(){E(e,"class","quota-grid svelte-1ipbcl2")},m(s,o){N(s,e,o);for(let r=0;r<t.length;r+=1)t[r]&&t[r].m(e,null)},p(s,o){o&1888&&(i=Q(s[5]),t=J(t,o,l,1,s,i,a,e,X,ue,null,se))},d(s){s&&d(e);for(let o=0;o<t.length;o+=1)t[o].d()}}}function ye(u){let e,t=[],a=new Map,i=Q(u[13].tiers);const l=s=>s[18].name;for(let s=0;s<i.length;s+=1){let o=ae(u,i,s),r=l(o);a.set(r,t[s]=oe(r,o))}return{c(){e=_("div");for(let s=0;s<t.length;s+=1)t[s].c();this.h()},l(s){e=h(s,"DIV",{class:!0});var o=b(e);for(let r=0;r<t.length;r+=1)t[r].l(o);o.forEach(d),this.h()},h(){E(e,"class","tiers svelte-1ipbcl2")},m(s,o){N(s,e,o);for(let r=0;r<t.length;r+=1)t[r]&&t[r].m(e,null)},p(s,o){o&288&&(i=Q(s[13].tiers),t=J(t,o,l,1,s,i,a,e,X,oe,null,ae))},d(s){s&&d(e);for(let o=0;o<t.length;o+=1)t[o].d()}}}function Ce(u){let e,t,a="○",i,l,s=u[6]("quotas.noTiers")+"",o;return{c(){e=_("div"),t=_("span"),t.textContent=a,i=w(),l=_("div"),o=S(s),this.h()},l(r){e=h(r,"DIV",{class:!0});var p=b(e);t=h(p,"SPAN",{class:!0,"data-svelte-h":!0}),B(t)!=="svelte-1iupoui"&&(t.textContent=a),i=P(p),l=h(p,"DIV",{class:!0});var n=b(l);o=C(n,s),n.forEach(d),p.forEach(d),this.h()},h(){E(t,"class","status-icon svelte-1ipbcl2"),E(l,"class","status-title svelte-1ipbcl2"),E(e,"class","status-msg status-neutral svelte-1ipbcl2")},m(r,p){N(r,e,p),c(e,t),c(e,i),c(e,l),c(l,o)},p(r,p){p&64&&s!==(s=r[6]("quotas.noTiers")+"")&&M(o,s)},d(r){r&&d(e)}}}function Se(u){let e,t,a="✕",i,l,s,o=u[6]("quotas.queryFailed")+"",r,p,n=u[13].error&&re(u);return{c(){e=_("div"),t=_("span"),t.textContent=a,i=w(),l=_("div"),s=_("div"),r=S(o),p=w(),n&&n.c(),this.h()},l(f){e=h(f,"DIV",{class:!0});var v=b(e);t=h(v,"SPAN",{class:!0,"data-svelte-h":!0}),B(t)!=="svelte-1cay5lc"&&(t.textContent=a),i=P(v),l=h(v,"DIV",{});var m=b(l);s=h(m,"DIV",{class:!0});var k=b(s);r=C(k,o),k.forEach(d),p=P(m),n&&n.l(m),m.forEach(d),v.forEach(d),this.h()},h(){E(t,"class","status-icon svelte-1ipbcl2"),E(s,"class","status-title svelte-1ipbcl2"),E(e,"class","status-msg status-error svelte-1ipbcl2")},m(f,v){N(f,e,v),c(e,t),c(e,i),c(e,l),c(l,s),c(s,r),c(l,p),n&&n.m(l,null)},p(f,v){v&64&&o!==(o=f[6]("quotas.queryFailed")+"")&&M(r,o),f[13].error?n?n.p(f,v):(n=re(f),n.c(),n.m(l,null)):n&&(n.d(1),n=null)},d(f){f&&d(e),n&&n.d()}}}function Ae(u){let e,t,a="✕",i,l,s,o=u[6]("quotas.queryFailed")+"",r,p,n=u[13].credentialMessage&&ce(u);return{c(){e=_("div"),t=_("span"),t.textContent=a,i=w(),l=_("div"),s=_("div"),r=S(o),p=w(),n&&n.c(),this.h()},l(f){e=h(f,"DIV",{class:!0});var v=b(e);t=h(v,"SPAN",{class:!0,"data-svelte-h":!0}),B(t)!=="svelte-1cay5lc"&&(t.textContent=a),i=P(v),l=h(v,"DIV",{});var m=b(l);s=h(m,"DIV",{class:!0});var k=b(s);r=C(k,o),k.forEach(d),p=P(m),n&&n.l(m),m.forEach(d),v.forEach(d),this.h()},h(){E(t,"class","status-icon svelte-1ipbcl2"),E(s,"class","status-title svelte-1ipbcl2"),E(e,"class","status-msg status-error svelte-1ipbcl2")},m(f,v){N(f,e,v),c(e,t),c(e,i),c(e,l),c(l,s),c(s,r),c(l,p),n&&n.m(l,null)},p(f,v){v&64&&o!==(o=f[6]("quotas.queryFailed")+"")&&M(r,o),f[13].credentialMessage?n?n.p(f,v):(n=ce(f),n.c(),n.m(l,null)):n&&(n.d(1),n=null)},d(f){f&&d(e),n&&n.d()}}}function Pe(u){let e,t,a="⚠",i,l,s,o=u[6]("quotas.expired")+"",r,p,n,f=u[6]("quotas.expiredHint")+"",v;return{c(){e=_("div"),t=_("span"),t.textContent=a,i=w(),l=_("div"),s=_("div"),r=S(o),p=w(),n=_("div"),v=S(f),this.h()},l(m){e=h(m,"DIV",{class:!0});var k=b(e);t=h(k,"SPAN",{class:!0,"data-svelte-h":!0}),B(t)!=="svelte-ksyvhl"&&(t.textContent=a),i=P(k),l=h(k,"DIV",{});var V=b(l);s=h(V,"DIV",{class:!0});var I=b(s);r=C(I,o),I.forEach(d),p=P(V),n=h(V,"DIV",{class:!0});var A=b(n);v=C(A,f),A.forEach(d),V.forEach(d),k.forEach(d),this.h()},h(){E(t,"class","status-icon svelte-1ipbcl2"),E(s,"class","status-title svelte-1ipbcl2"),E(n,"class","status-hint svelte-1ipbcl2"),E(e,"class","status-msg status-warn svelte-1ipbcl2")},m(m,k){N(m,e,k),c(e,t),c(e,i),c(e,l),c(l,s),c(s,r),c(l,p),c(l,n),c(n,v)},p(m,k){k&64&&o!==(o=m[6]("quotas.expired")+"")&&M(r,o),k&64&&f!==(f=m[6]("quotas.expiredHint")+"")&&M(v,f)},d(m){m&&d(e)}}}function ne(u){let e,t,a=u[20]+"",i;return{c(){e=_("span"),t=S("↻ "),i=S(a),this.h()},l(l){e=h(l,"SPAN",{class:!0});var s=b(e);t=C(s,"↻ "),i=C(s,a),s.forEach(d),this.h()},h(){E(e,"class","tier-reset svelte-1ipbcl2")},m(l,s){N(l,e,s),c(e,t),c(e,i)},p(l,s){s&32&&a!==(a=l[20]+"")&&M(i,a)},d(l){l&&d(e)}}}function oe(u,e){let t,a,i,l=e[8](e[18].name)+"",s,o,r,p,n,f,v,m,k=e[19]+"",V,I,A,g=e[20]&&ne(e);return{key:u,first:null,c(){t=_("div"),a=_("div"),i=_("span"),s=S(l),o=w(),g&&g.c(),r=w(),p=_("div"),n=_("div"),f=_("div"),v=w(),m=_("span"),V=S(k),I=S("%"),A=w(),this.h()},l(q){t=h(q,"DIV",{class:!0});var D=b(t);a=h(D,"DIV",{class:!0});var L=b(a);i=h(L,"SPAN",{class:!0});var z=b(i);s=C(z,l),z.forEach(d),o=P(L),g&&g.l(L),L.forEach(d),r=P(D),p=h(D,"DIV",{class:!0});var H=b(p);n=h(H,"DIV",{class:!0});var j=b(n);f=h(j,"DIV",{class:!0,style:!0}),b(f).forEach(d),j.forEach(d),v=P(H),m=h(H,"SPAN",{class:!0,style:!0});var F=b(m);V=C(F,k),I=C(F,"%"),F.forEach(d),H.forEach(d),A=P(D),D.forEach(d),this.h()},h(){E(i,"class","tier-name svelte-1ipbcl2"),E(a,"class","tier-label svelte-1ipbcl2"),E(f,"class","tier-fill svelte-1ipbcl2"),O(f,"width",e[19]+"%"),O(f,"background",R(e[18].utilization)),E(n,"class","tier-bar svelte-1ipbcl2"),E(m,"class","tier-pct svelte-1ipbcl2"),O(m,"color",R(e[18].utilization)),E(p,"class","tier-bar-wrap svelte-1ipbcl2"),E(t,"class","tier-row svelte-1ipbcl2"),this.first=t},m(q,D){N(q,t,D),c(t,a),c(a,i),c(i,s),c(a,o),g&&g.m(a,null),c(t,r),c(t,p),c(p,n),c(n,f),c(p,v),c(p,m),c(m,V),c(m,I),c(t,A)},p(q,D){e=q,D&32&&l!==(l=e[8](e[18].name)+"")&&M(s,l),e[20]?g?g.p(e,D):(g=ne(e),g.c(),g.m(a,null)):g&&(g.d(1),g=null),D&32&&O(f,"width",e[19]+"%"),D&32&&O(f,"background",R(e[18].utilization)),D&32&&k!==(k=e[19]+"")&&M(V,k),D&32&&O(m,"color",R(e[18].utilization))},d(q){q&&d(t),g&&g.d()}}}function re(u){let e,t=u[13].error+"",a;return{c(){e=_("div"),a=S(t),this.h()},l(i){e=h(i,"DIV",{class:!0});var l=b(e);a=C(l,t),l.forEach(d),this.h()},h(){E(e,"class","status-hint svelte-1ipbcl2")},m(i,l){N(i,e,l),c(e,a)},p(i,l){l&32&&t!==(t=i[13].error+"")&&M(a,t)},d(i){i&&d(e)}}}function ce(u){let e,t=u[13].credentialMessage+"",a;return{c(){e=_("div"),a=S(t),this.h()},l(i){e=h(i,"DIV",{class:!0});var l=b(e);a=C(l,t),l.forEach(d),this.h()},h(){E(e,"class","status-hint svelte-1ipbcl2")},m(i,l){N(i,e,l),c(e,a)},p(i,l){l&32&&t!==(t=i[13].credentialMessage+"")&&M(a,t)},d(i){i&&d(e)}}}function ue(u,e){let t,a,i,l=e[9](e[13].tool)+"",s,o,r,p=e[6]("quotas.lastUpdated")+"",n,f,v=e[10](e[13].queriedAt)+"",m,k,V;function I(q,D){return q[13].credentialStatus==="expired"&&!q[13].success?Pe:q[13].credentialStatus==="parse_error"?Ae:q[13].success?q[13].tiers.length===0?Ce:ye:Se}let A=I(e),g=A(e);return{key:u,first:null,c(){t=_("div"),a=_("div"),i=_("span"),s=S(l),o=w(),r=_("span"),n=S(p),f=S(": "),m=S(v),k=w(),g.c(),V=w(),this.h()},l(q){t=h(q,"DIV",{class:!0});var D=b(t);a=h(D,"DIV",{class:!0});var L=b(a);i=h(L,"SPAN",{class:!0});var z=b(i);s=C(z,l),z.forEach(d),o=P(L),r=h(L,"SPAN",{class:!0});var H=b(r);n=C(H,p),f=C(H,": "),m=C(H,v),H.forEach(d),L.forEach(d),k=P(D),g.l(D),V=P(D),D.forEach(d),this.h()},h(){E(i,"class","tool-name svelte-1ipbcl2"),E(r,"class","query-time svelte-1ipbcl2"),E(a,"class","card-header svelte-1ipbcl2"),E(t,"class","quota-card card svelte-1ipbcl2"),this.first=t},m(q,D){N(q,t,D),c(t,a),c(a,i),c(i,s),c(a,o),c(a,r),c(r,n),c(r,f),c(r,m),c(t,k),g.m(t,null),c(t,V)},p(q,D){e=q,D&32&&l!==(l=e[9](e[13].tool)+"")&&M(s,l),D&64&&p!==(p=e[6]("quotas.lastUpdated")+"")&&M(n,p),D&32&&v!==(v=e[10](e[13].queriedAt)+"")&&M(m,v),A===(A=I(e))&&g?g.p(e,D):(g.d(1),g=A(e),g&&(g.c(),g.m(t,V)))},d(q){q&&d(t),g.d()}}}function fe(u){let e,t=u[6]("common.noData")+"",a,i,l,s=[],o=new Map,r=Q(u[4]);const p=n=>n[13].tool;for(let n=0;n<r.length;n+=1){let f=le(u,r,n),v=p(f);o.set(v,s[n]=de(v,f))}return{c(){e=_("div"),a=S(t),i=w(),l=_("div");for(let n=0;n<s.length;n+=1)s[n].c();this.h()},l(n){e=h(n,"DIV",{class:!0,style:!0});var f=b(e);a=C(f,t),f.forEach(d),i=P(n),l=h(n,"DIV",{class:!0});var v=b(l);for(let m=0;m<s.length;m+=1)s[m].l(v);v.forEach(d),this.h()},h(){E(e,"class","section-title"),O(e,"margin-top",u[5].length>0?"2rem":"0"),E(l,"class","inactive-list svelte-1ipbcl2")},m(n,f){N(n,e,f),c(e,a),N(n,i,f),N(n,l,f);for(let v=0;v<s.length;v+=1)s[v]&&s[v].m(l,null)},p(n,f){f&64&&t!==(t=n[6]("common.noData")+"")&&M(a,t),f&32&&O(e,"margin-top",n[5].length>0?"2rem":"0"),f&592&&(r=Q(n[4]),s=J(s,f,p,1,n,r,o,l,X,de,null,le))},d(n){n&&(d(e),d(i),d(l));for(let f=0;f<s.length;f+=1)s[f].d()}}}function de(u,e){let t,a,i=e[9](e[13].tool)+"",l,s,o,r,p="○",n,f,v=e[6]("quotas.noCredentials")+"",m,k,V=e[6]("quotas.noCredentialsHint")+"",I,A;return{key:u,first:null,c(){t=_("div"),a=_("span"),l=S(i),s=w(),o=_("div"),r=_("span"),r.textContent=p,n=w(),f=_("span"),m=S(v),k=S(" — "),I=S(V),A=w(),this.h()},l(g){t=h(g,"DIV",{class:!0});var q=b(t);a=h(q,"SPAN",{class:!0});var D=b(a);l=C(D,i),D.forEach(d),s=P(q),o=h(q,"DIV",{class:!0});var L=b(o);r=h(L,"SPAN",{class:!0,"data-svelte-h":!0}),B(r)!=="svelte-1s95f73"&&(r.textContent=p),n=P(L),f=h(L,"SPAN",{});var z=b(f);m=C(z,v),k=C(z," — "),I=C(z,V),z.forEach(d),L.forEach(d),A=P(q),q.forEach(d),this.h()},h(){E(a,"class","tool-name svelte-1ipbcl2"),E(r,"class","hint-icon svelte-1ipbcl2"),E(o,"class","inactive-hint svelte-1ipbcl2"),E(t,"class","inactive-card card svelte-1ipbcl2"),this.first=t},m(g,q){N(g,t,q),c(t,a),c(a,l),c(t,s),c(t,o),c(o,r),c(o,n),c(o,f),c(f,m),c(f,k),c(f,I),c(t,A)},p(g,q){e=g,q&16&&i!==(i=e[9](e[13].tool)+"")&&M(l,i),q&64&&v!==(v=e[6]("quotas.noCredentials")+"")&&M(m,v),q&64&&V!==(V=e[6]("quotas.noCredentialsHint")+"")&&M(I,V)},d(g){g&&d(t)}}}function we(u){let e,t,a,i,l,s,o=u[6]("quotas.title")+"",r,p,n,f=u[6]("quotas.desc")+"",v,m,k,V,I="↻",A,g=(u[3]?u[6]("quotas.refreshing"):u[6]("quotas.refresh"))+"",q,D,L,z,H;document.title=e=u[6]("quotas.title")+" — AIUsage";function j(y,T){return y[3]&&!y[0]?Ve:y[2]?Ie:y[1].length===0?De:qe}let F=j(u),U=F(u);return{c(){t=w(),a=_("div"),i=_("div"),l=_("div"),s=_("h1"),r=S(o),p=w(),n=_("p"),v=S(f),m=w(),k=_("button"),V=_("span"),V.textContent=I,A=w(),q=S(g),D=w(),U.c(),L=G(),this.h()},l(y){ke("svelte-fabgfq",document.head).forEach(d),t=P(y),a=h(y,"DIV",{class:!0});var Z=b(a);i=h(Z,"DIV",{class:!0});var K=b(i);l=h(K,"DIV",{});var W=b(l);s=h(W,"H1",{});var $=b(s);r=C($,o),$.forEach(d),p=P(W),n=h(W,"P",{});var x=b(n);v=C(x,f),x.forEach(d),W.forEach(d),m=P(K),k=h(K,"BUTTON",{class:!0});var Y=b(k);V=h(Y,"SPAN",{class:!0,"data-svelte-h":!0}),B(V)!=="svelte-otut42"&&(V.textContent=I),A=P(Y),q=C(Y,g),Y.forEach(d),K.forEach(d),Z.forEach(d),D=P(y),U.l(y),L=G(),this.h()},h(){E(V,"class","refresh-icon svelte-1ipbcl2"),te(V,"spinning",u[3]),E(k,"class","refresh-btn svelte-1ipbcl2"),k.disabled=u[3],E(i,"class","page-header-row svelte-1ipbcl2"),E(a,"class","page-header")},m(y,T){N(y,t,T),N(y,a,T),c(a,i),c(i,l),c(l,s),c(s,r),c(l,p),c(l,n),c(n,v),c(i,m),c(i,k),c(k,V),c(k,A),c(k,q),N(y,D,T),U.m(y,T),N(y,L,T),z||(H=be(k,"click",u[7]),z=!0)},p(y,[T]){T&64&&e!==(e=y[6]("quotas.title")+" — AIUsage")&&(document.title=e),T&64&&o!==(o=y[6]("quotas.title")+"")&&M(r,o),T&64&&f!==(f=y[6]("quotas.desc")+"")&&M(v,f),T&8&&te(V,"spinning",y[3]),T&72&&g!==(g=(y[3]?y[6]("quotas.refreshing"):y[6]("quotas.refresh"))+"")&&M(q,g),T&8&&(k.disabled=y[3]),F===(F=j(y))&&U?U.p(y,T):(U.d(1),U=F(y),U&&(U.c(),U.m(L.parentNode,L)))},i:ee,o:ee,d(y){y&&(d(t),d(a),d(D),d(L)),U.d(y),z=!1,H()}}}function Ne(u){return u.split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ").replace(/^Five Hour/i,"5h").replace(/^Seven Day/i,"7d").replace(/^Weekly Limit/i,"Weekly")}function R(u){return u>=90?"var(--rose)":u>=70?"oklch(0.7 0.15 60)":"var(--green)"}function Me(u){if(!u)return null;const e=new Date(u).getTime()-Date.now();if(e<=0)return null;const t=Math.floor(e/(1e3*60*60)),a=Math.floor(e%(1e3*60*60)/(1e3*60));return t>24?`${Math.floor(t/24)}d ${t%24}h`:t>0?`${t}h ${a}m`:`${a}m`}function Le(u,e,t){let a,i,l,s;he(u,Ee,I=>t(6,s=I));let o=null,r=null,p=!0;const n={five_hour:"quotas.fiveHour",seven_day:"quotas.sevenDay",seven_day_opus:"quotas.sevenDayOpus",seven_day_sonnet:"quotas.sevenDaySonnet",seven_day_omelette:"quotas.sevenDayOmelette",weekly_limit:"quotas.weeklyLimit"},f={"claude-code":"quotas.toolLabels.claude-code",codex:"quotas.toolLabels.codex"};async function v(){t(3,p=!0),t(2,r=null);try{t(0,o=await ge())}catch(I){t(2,r=I instanceof Error?I.message:"Failed to load quota data"),t(0,o=null)}finally{t(3,p=!1)}}_e(v);function m(I){const A=n[I];return A?s(A):Ne(I)}function k(I){const A=f[I];return A?s(A):I}function V(I){return I?new Date(I).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}):s("quotas.never")}return u.$$.update=()=>{u.$$.dirty&1&&t(1,a=(o==null?void 0:o.quotas)??[]),u.$$.dirty&2&&t(5,i=a.filter(I=>I.credentialStatus!=="not_found")),u.$$.dirty&2&&t(4,l=a.filter(I=>I.credentialStatus==="not_found"))},[o,a,r,p,l,i,s,v,m,k,V]}class Fe extends pe{constructor(e){super(),me(this,e,Le,we,ve,{})}}export{Fe as component};
|
|
1
|
+
import{s as ve,n as ee,c as he,o as _e}from"../chunks/scheduler.DsWd5xup.js";import{S as pe,i as me,d,s as M,z as te,a as N,b as c,w as be,o as E,p as ke,g as P,c as h,e as b,f as C,C as B,r as G,j as w,h as _,t as S,x as O}from"../chunks/index.BfJlbjrK.js";import{x as ge,e as Q,h as J,i as X}from"../chunks/api.DVLAklIn.js";import{t as Ee}from"../chunks/i18n.DApJIXOT.js";function le(u,e,t){const a=u.slice();return a[13]=e[t],a}function se(u,e,t){const a=u.slice();return a[13]=e[t],a}function ae(u,e,t){const a=u.slice();a[18]=e[t];const i=Math.min(Math.round(a[18].utilization),100);a[19]=i;const l=Me(a[18].resetsAt);return a[20]=l,a}function qe(u){let e,t,a=u[5].length>0&&ie(u),i=u[4].length>0&&fe(u);return{c(){a&&a.c(),e=w(),i&&i.c(),t=G()},l(l){a&&a.l(l),e=P(l),i&&i.l(l),t=G()},m(l,s){a&&a.m(l,s),N(l,e,s),i&&i.m(l,s),N(l,t,s)},p(l,s){l[5].length>0?a?a.p(l,s):(a=ie(l),a.c(),a.m(e.parentNode,e)):a&&(a.d(1),a=null),l[4].length>0?i?i.p(l,s):(i=fe(l),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(l){l&&(d(e),d(t)),a&&a.d(l),i&&i.d(l)}}}function De(u){let e,t,a=u[6]("common.noData")+"",i;return{c(){e=_("div"),t=_("p"),i=S(a),this.h()},l(l){e=h(l,"DIV",{class:!0});var s=b(e);t=h(s,"P",{});var o=b(t);i=C(o,a),o.forEach(d),s.forEach(d),this.h()},h(){E(e,"class","state-msg")},m(l,s){N(l,e,s),c(e,t),c(t,i)},p(l,s){s&64&&a!==(a=l[6]("common.noData")+"")&&M(i,a)},d(l){l&&d(e)}}}function Ie(u){let e,t,a;return{c(){e=_("div"),t=_("p"),a=S(u[2]),this.h()},l(i){e=h(i,"DIV",{class:!0});var l=b(e);t=h(l,"P",{});var s=b(t);a=C(s,u[2]),s.forEach(d),l.forEach(d),this.h()},h(){E(e,"class","state-msg error")},m(i,l){N(i,e,l),c(e,t),c(t,a)},p(i,l){l&4&&M(a,i[2])},d(i){i&&d(e)}}}function Ve(u){let e,t,a=u[6]("common.loading")+"",i;return{c(){e=_("div"),t=_("p"),i=S(a),this.h()},l(l){e=h(l,"DIV",{class:!0});var s=b(e);t=h(s,"P",{});var o=b(t);i=C(o,a),o.forEach(d),s.forEach(d),this.h()},h(){E(e,"class","state-msg")},m(l,s){N(l,e,s),c(e,t),c(t,i)},p(l,s){s&64&&a!==(a=l[6]("common.loading")+"")&&M(i,a)},d(l){l&&d(e)}}}function ie(u){let e,t=[],a=new Map,i=Q(u[5]);const l=s=>s[13].tool;for(let s=0;s<i.length;s+=1){let o=se(u,i,s),r=l(o);a.set(r,t[s]=ue(r,o))}return{c(){e=_("div");for(let s=0;s<t.length;s+=1)t[s].c();this.h()},l(s){e=h(s,"DIV",{class:!0});var o=b(e);for(let r=0;r<t.length;r+=1)t[r].l(o);o.forEach(d),this.h()},h(){E(e,"class","quota-grid svelte-1ipbcl2")},m(s,o){N(s,e,o);for(let r=0;r<t.length;r+=1)t[r]&&t[r].m(e,null)},p(s,o){o&1888&&(i=Q(s[5]),t=J(t,o,l,1,s,i,a,e,X,ue,null,se))},d(s){s&&d(e);for(let o=0;o<t.length;o+=1)t[o].d()}}}function ye(u){let e,t=[],a=new Map,i=Q(u[13].tiers);const l=s=>s[18].name;for(let s=0;s<i.length;s+=1){let o=ae(u,i,s),r=l(o);a.set(r,t[s]=oe(r,o))}return{c(){e=_("div");for(let s=0;s<t.length;s+=1)t[s].c();this.h()},l(s){e=h(s,"DIV",{class:!0});var o=b(e);for(let r=0;r<t.length;r+=1)t[r].l(o);o.forEach(d),this.h()},h(){E(e,"class","tiers svelte-1ipbcl2")},m(s,o){N(s,e,o);for(let r=0;r<t.length;r+=1)t[r]&&t[r].m(e,null)},p(s,o){o&288&&(i=Q(s[13].tiers),t=J(t,o,l,1,s,i,a,e,X,oe,null,ae))},d(s){s&&d(e);for(let o=0;o<t.length;o+=1)t[o].d()}}}function Ce(u){let e,t,a="○",i,l,s=u[6]("quotas.noTiers")+"",o;return{c(){e=_("div"),t=_("span"),t.textContent=a,i=w(),l=_("div"),o=S(s),this.h()},l(r){e=h(r,"DIV",{class:!0});var p=b(e);t=h(p,"SPAN",{class:!0,"data-svelte-h":!0}),B(t)!=="svelte-1iupoui"&&(t.textContent=a),i=P(p),l=h(p,"DIV",{class:!0});var n=b(l);o=C(n,s),n.forEach(d),p.forEach(d),this.h()},h(){E(t,"class","status-icon svelte-1ipbcl2"),E(l,"class","status-title svelte-1ipbcl2"),E(e,"class","status-msg status-neutral svelte-1ipbcl2")},m(r,p){N(r,e,p),c(e,t),c(e,i),c(e,l),c(l,o)},p(r,p){p&64&&s!==(s=r[6]("quotas.noTiers")+"")&&M(o,s)},d(r){r&&d(e)}}}function Se(u){let e,t,a="✕",i,l,s,o=u[6]("quotas.queryFailed")+"",r,p,n=u[13].error&&re(u);return{c(){e=_("div"),t=_("span"),t.textContent=a,i=w(),l=_("div"),s=_("div"),r=S(o),p=w(),n&&n.c(),this.h()},l(f){e=h(f,"DIV",{class:!0});var v=b(e);t=h(v,"SPAN",{class:!0,"data-svelte-h":!0}),B(t)!=="svelte-1cay5lc"&&(t.textContent=a),i=P(v),l=h(v,"DIV",{});var m=b(l);s=h(m,"DIV",{class:!0});var k=b(s);r=C(k,o),k.forEach(d),p=P(m),n&&n.l(m),m.forEach(d),v.forEach(d),this.h()},h(){E(t,"class","status-icon svelte-1ipbcl2"),E(s,"class","status-title svelte-1ipbcl2"),E(e,"class","status-msg status-error svelte-1ipbcl2")},m(f,v){N(f,e,v),c(e,t),c(e,i),c(e,l),c(l,s),c(s,r),c(l,p),n&&n.m(l,null)},p(f,v){v&64&&o!==(o=f[6]("quotas.queryFailed")+"")&&M(r,o),f[13].error?n?n.p(f,v):(n=re(f),n.c(),n.m(l,null)):n&&(n.d(1),n=null)},d(f){f&&d(e),n&&n.d()}}}function Ae(u){let e,t,a="✕",i,l,s,o=u[6]("quotas.queryFailed")+"",r,p,n=u[13].credentialMessage&&ce(u);return{c(){e=_("div"),t=_("span"),t.textContent=a,i=w(),l=_("div"),s=_("div"),r=S(o),p=w(),n&&n.c(),this.h()},l(f){e=h(f,"DIV",{class:!0});var v=b(e);t=h(v,"SPAN",{class:!0,"data-svelte-h":!0}),B(t)!=="svelte-1cay5lc"&&(t.textContent=a),i=P(v),l=h(v,"DIV",{});var m=b(l);s=h(m,"DIV",{class:!0});var k=b(s);r=C(k,o),k.forEach(d),p=P(m),n&&n.l(m),m.forEach(d),v.forEach(d),this.h()},h(){E(t,"class","status-icon svelte-1ipbcl2"),E(s,"class","status-title svelte-1ipbcl2"),E(e,"class","status-msg status-error svelte-1ipbcl2")},m(f,v){N(f,e,v),c(e,t),c(e,i),c(e,l),c(l,s),c(s,r),c(l,p),n&&n.m(l,null)},p(f,v){v&64&&o!==(o=f[6]("quotas.queryFailed")+"")&&M(r,o),f[13].credentialMessage?n?n.p(f,v):(n=ce(f),n.c(),n.m(l,null)):n&&(n.d(1),n=null)},d(f){f&&d(e),n&&n.d()}}}function Pe(u){let e,t,a="⚠",i,l,s,o=u[6]("quotas.expired")+"",r,p,n,f=u[6]("quotas.expiredHint")+"",v;return{c(){e=_("div"),t=_("span"),t.textContent=a,i=w(),l=_("div"),s=_("div"),r=S(o),p=w(),n=_("div"),v=S(f),this.h()},l(m){e=h(m,"DIV",{class:!0});var k=b(e);t=h(k,"SPAN",{class:!0,"data-svelte-h":!0}),B(t)!=="svelte-ksyvhl"&&(t.textContent=a),i=P(k),l=h(k,"DIV",{});var V=b(l);s=h(V,"DIV",{class:!0});var I=b(s);r=C(I,o),I.forEach(d),p=P(V),n=h(V,"DIV",{class:!0});var A=b(n);v=C(A,f),A.forEach(d),V.forEach(d),k.forEach(d),this.h()},h(){E(t,"class","status-icon svelte-1ipbcl2"),E(s,"class","status-title svelte-1ipbcl2"),E(n,"class","status-hint svelte-1ipbcl2"),E(e,"class","status-msg status-warn svelte-1ipbcl2")},m(m,k){N(m,e,k),c(e,t),c(e,i),c(e,l),c(l,s),c(s,r),c(l,p),c(l,n),c(n,v)},p(m,k){k&64&&o!==(o=m[6]("quotas.expired")+"")&&M(r,o),k&64&&f!==(f=m[6]("quotas.expiredHint")+"")&&M(v,f)},d(m){m&&d(e)}}}function ne(u){let e,t,a=u[20]+"",i;return{c(){e=_("span"),t=S("↻ "),i=S(a),this.h()},l(l){e=h(l,"SPAN",{class:!0});var s=b(e);t=C(s,"↻ "),i=C(s,a),s.forEach(d),this.h()},h(){E(e,"class","tier-reset svelte-1ipbcl2")},m(l,s){N(l,e,s),c(e,t),c(e,i)},p(l,s){s&32&&a!==(a=l[20]+"")&&M(i,a)},d(l){l&&d(e)}}}function oe(u,e){let t,a,i,l=e[8](e[18].name)+"",s,o,r,p,n,f,v,m,k=e[19]+"",V,I,A,g=e[20]&&ne(e);return{key:u,first:null,c(){t=_("div"),a=_("div"),i=_("span"),s=S(l),o=w(),g&&g.c(),r=w(),p=_("div"),n=_("div"),f=_("div"),v=w(),m=_("span"),V=S(k),I=S("%"),A=w(),this.h()},l(q){t=h(q,"DIV",{class:!0});var D=b(t);a=h(D,"DIV",{class:!0});var L=b(a);i=h(L,"SPAN",{class:!0});var z=b(i);s=C(z,l),z.forEach(d),o=P(L),g&&g.l(L),L.forEach(d),r=P(D),p=h(D,"DIV",{class:!0});var H=b(p);n=h(H,"DIV",{class:!0});var j=b(n);f=h(j,"DIV",{class:!0,style:!0}),b(f).forEach(d),j.forEach(d),v=P(H),m=h(H,"SPAN",{class:!0,style:!0});var F=b(m);V=C(F,k),I=C(F,"%"),F.forEach(d),H.forEach(d),A=P(D),D.forEach(d),this.h()},h(){E(i,"class","tier-name svelte-1ipbcl2"),E(a,"class","tier-label svelte-1ipbcl2"),E(f,"class","tier-fill svelte-1ipbcl2"),O(f,"width",e[19]+"%"),O(f,"background",R(e[18].utilization)),E(n,"class","tier-bar svelte-1ipbcl2"),E(m,"class","tier-pct svelte-1ipbcl2"),O(m,"color",R(e[18].utilization)),E(p,"class","tier-bar-wrap svelte-1ipbcl2"),E(t,"class","tier-row svelte-1ipbcl2"),this.first=t},m(q,D){N(q,t,D),c(t,a),c(a,i),c(i,s),c(a,o),g&&g.m(a,null),c(t,r),c(t,p),c(p,n),c(n,f),c(p,v),c(p,m),c(m,V),c(m,I),c(t,A)},p(q,D){e=q,D&32&&l!==(l=e[8](e[18].name)+"")&&M(s,l),e[20]?g?g.p(e,D):(g=ne(e),g.c(),g.m(a,null)):g&&(g.d(1),g=null),D&32&&O(f,"width",e[19]+"%"),D&32&&O(f,"background",R(e[18].utilization)),D&32&&k!==(k=e[19]+"")&&M(V,k),D&32&&O(m,"color",R(e[18].utilization))},d(q){q&&d(t),g&&g.d()}}}function re(u){let e,t=u[13].error+"",a;return{c(){e=_("div"),a=S(t),this.h()},l(i){e=h(i,"DIV",{class:!0});var l=b(e);a=C(l,t),l.forEach(d),this.h()},h(){E(e,"class","status-hint svelte-1ipbcl2")},m(i,l){N(i,e,l),c(e,a)},p(i,l){l&32&&t!==(t=i[13].error+"")&&M(a,t)},d(i){i&&d(e)}}}function ce(u){let e,t=u[13].credentialMessage+"",a;return{c(){e=_("div"),a=S(t),this.h()},l(i){e=h(i,"DIV",{class:!0});var l=b(e);a=C(l,t),l.forEach(d),this.h()},h(){E(e,"class","status-hint svelte-1ipbcl2")},m(i,l){N(i,e,l),c(e,a)},p(i,l){l&32&&t!==(t=i[13].credentialMessage+"")&&M(a,t)},d(i){i&&d(e)}}}function ue(u,e){let t,a,i,l=e[9](e[13].tool)+"",s,o,r,p=e[6]("quotas.lastUpdated")+"",n,f,v=e[10](e[13].queriedAt)+"",m,k,V;function I(q,D){return q[13].credentialStatus==="expired"&&!q[13].success?Pe:q[13].credentialStatus==="parse_error"?Ae:q[13].success?q[13].tiers.length===0?Ce:ye:Se}let A=I(e),g=A(e);return{key:u,first:null,c(){t=_("div"),a=_("div"),i=_("span"),s=S(l),o=w(),r=_("span"),n=S(p),f=S(": "),m=S(v),k=w(),g.c(),V=w(),this.h()},l(q){t=h(q,"DIV",{class:!0});var D=b(t);a=h(D,"DIV",{class:!0});var L=b(a);i=h(L,"SPAN",{class:!0});var z=b(i);s=C(z,l),z.forEach(d),o=P(L),r=h(L,"SPAN",{class:!0});var H=b(r);n=C(H,p),f=C(H,": "),m=C(H,v),H.forEach(d),L.forEach(d),k=P(D),g.l(D),V=P(D),D.forEach(d),this.h()},h(){E(i,"class","tool-name svelte-1ipbcl2"),E(r,"class","query-time svelte-1ipbcl2"),E(a,"class","card-header svelte-1ipbcl2"),E(t,"class","quota-card card svelte-1ipbcl2"),this.first=t},m(q,D){N(q,t,D),c(t,a),c(a,i),c(i,s),c(a,o),c(a,r),c(r,n),c(r,f),c(r,m),c(t,k),g.m(t,null),c(t,V)},p(q,D){e=q,D&32&&l!==(l=e[9](e[13].tool)+"")&&M(s,l),D&64&&p!==(p=e[6]("quotas.lastUpdated")+"")&&M(n,p),D&32&&v!==(v=e[10](e[13].queriedAt)+"")&&M(m,v),A===(A=I(e))&&g?g.p(e,D):(g.d(1),g=A(e),g&&(g.c(),g.m(t,V)))},d(q){q&&d(t),g.d()}}}function fe(u){let e,t=u[6]("common.noData")+"",a,i,l,s=[],o=new Map,r=Q(u[4]);const p=n=>n[13].tool;for(let n=0;n<r.length;n+=1){let f=le(u,r,n),v=p(f);o.set(v,s[n]=de(v,f))}return{c(){e=_("div"),a=S(t),i=w(),l=_("div");for(let n=0;n<s.length;n+=1)s[n].c();this.h()},l(n){e=h(n,"DIV",{class:!0,style:!0});var f=b(e);a=C(f,t),f.forEach(d),i=P(n),l=h(n,"DIV",{class:!0});var v=b(l);for(let m=0;m<s.length;m+=1)s[m].l(v);v.forEach(d),this.h()},h(){E(e,"class","section-title"),O(e,"margin-top",u[5].length>0?"2rem":"0"),E(l,"class","inactive-list svelte-1ipbcl2")},m(n,f){N(n,e,f),c(e,a),N(n,i,f),N(n,l,f);for(let v=0;v<s.length;v+=1)s[v]&&s[v].m(l,null)},p(n,f){f&64&&t!==(t=n[6]("common.noData")+"")&&M(a,t),f&32&&O(e,"margin-top",n[5].length>0?"2rem":"0"),f&592&&(r=Q(n[4]),s=J(s,f,p,1,n,r,o,l,X,de,null,le))},d(n){n&&(d(e),d(i),d(l));for(let f=0;f<s.length;f+=1)s[f].d()}}}function de(u,e){let t,a,i=e[9](e[13].tool)+"",l,s,o,r,p="○",n,f,v=e[6]("quotas.noCredentials")+"",m,k,V=e[6]("quotas.noCredentialsHint")+"",I,A;return{key:u,first:null,c(){t=_("div"),a=_("span"),l=S(i),s=w(),o=_("div"),r=_("span"),r.textContent=p,n=w(),f=_("span"),m=S(v),k=S(" — "),I=S(V),A=w(),this.h()},l(g){t=h(g,"DIV",{class:!0});var q=b(t);a=h(q,"SPAN",{class:!0});var D=b(a);l=C(D,i),D.forEach(d),s=P(q),o=h(q,"DIV",{class:!0});var L=b(o);r=h(L,"SPAN",{class:!0,"data-svelte-h":!0}),B(r)!=="svelte-1s95f73"&&(r.textContent=p),n=P(L),f=h(L,"SPAN",{});var z=b(f);m=C(z,v),k=C(z," — "),I=C(z,V),z.forEach(d),L.forEach(d),A=P(q),q.forEach(d),this.h()},h(){E(a,"class","tool-name svelte-1ipbcl2"),E(r,"class","hint-icon svelte-1ipbcl2"),E(o,"class","inactive-hint svelte-1ipbcl2"),E(t,"class","inactive-card card svelte-1ipbcl2"),this.first=t},m(g,q){N(g,t,q),c(t,a),c(a,l),c(t,s),c(t,o),c(o,r),c(o,n),c(o,f),c(f,m),c(f,k),c(f,I),c(t,A)},p(g,q){e=g,q&16&&i!==(i=e[9](e[13].tool)+"")&&M(l,i),q&64&&v!==(v=e[6]("quotas.noCredentials")+"")&&M(m,v),q&64&&V!==(V=e[6]("quotas.noCredentialsHint")+"")&&M(I,V)},d(g){g&&d(t)}}}function we(u){let e,t,a,i,l,s,o=u[6]("quotas.title")+"",r,p,n,f=u[6]("quotas.desc")+"",v,m,k,V,I="↻",A,g=(u[3]?u[6]("quotas.refreshing"):u[6]("quotas.refresh"))+"",q,D,L,z,H;document.title=e=u[6]("quotas.title")+" — AIUsage";function j(y,T){return y[3]&&!y[0]?Ve:y[2]?Ie:y[1].length===0?De:qe}let F=j(u),U=F(u);return{c(){t=w(),a=_("div"),i=_("div"),l=_("div"),s=_("h1"),r=S(o),p=w(),n=_("p"),v=S(f),m=w(),k=_("button"),V=_("span"),V.textContent=I,A=w(),q=S(g),D=w(),U.c(),L=G(),this.h()},l(y){ke("svelte-fabgfq",document.head).forEach(d),t=P(y),a=h(y,"DIV",{class:!0});var Z=b(a);i=h(Z,"DIV",{class:!0});var K=b(i);l=h(K,"DIV",{});var W=b(l);s=h(W,"H1",{});var $=b(s);r=C($,o),$.forEach(d),p=P(W),n=h(W,"P",{});var x=b(n);v=C(x,f),x.forEach(d),W.forEach(d),m=P(K),k=h(K,"BUTTON",{class:!0});var Y=b(k);V=h(Y,"SPAN",{class:!0,"data-svelte-h":!0}),B(V)!=="svelte-otut42"&&(V.textContent=I),A=P(Y),q=C(Y,g),Y.forEach(d),K.forEach(d),Z.forEach(d),D=P(y),U.l(y),L=G(),this.h()},h(){E(V,"class","refresh-icon svelte-1ipbcl2"),te(V,"spinning",u[3]),E(k,"class","refresh-btn svelte-1ipbcl2"),k.disabled=u[3],E(i,"class","page-header-row svelte-1ipbcl2"),E(a,"class","page-header")},m(y,T){N(y,t,T),N(y,a,T),c(a,i),c(i,l),c(l,s),c(s,r),c(l,p),c(l,n),c(n,v),c(i,m),c(i,k),c(k,V),c(k,A),c(k,q),N(y,D,T),U.m(y,T),N(y,L,T),z||(H=be(k,"click",u[7]),z=!0)},p(y,[T]){T&64&&e!==(e=y[6]("quotas.title")+" — AIUsage")&&(document.title=e),T&64&&o!==(o=y[6]("quotas.title")+"")&&M(r,o),T&64&&f!==(f=y[6]("quotas.desc")+"")&&M(v,f),T&8&&te(V,"spinning",y[3]),T&72&&g!==(g=(y[3]?y[6]("quotas.refreshing"):y[6]("quotas.refresh"))+"")&&M(q,g),T&8&&(k.disabled=y[3]),F===(F=j(y))&&U?U.p(y,T):(U.d(1),U=F(y),U&&(U.c(),U.m(L.parentNode,L)))},i:ee,o:ee,d(y){y&&(d(t),d(a),d(D),d(L)),U.d(y),z=!1,H()}}}function Ne(u){return u.split("_").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ").replace(/^Five Hour/i,"5h").replace(/^Seven Day/i,"7d").replace(/^Weekly Limit/i,"Weekly")}function R(u){return u>=90?"var(--rose)":u>=70?"oklch(0.7 0.15 60)":"var(--green)"}function Me(u){if(!u)return null;const e=new Date(u).getTime()-Date.now();if(e<=0)return null;const t=Math.floor(e/(1e3*60*60)),a=Math.floor(e%(1e3*60*60)/(1e3*60));return t>24?`${Math.floor(t/24)}d ${t%24}h`:t>0?`${t}h ${a}m`:`${a}m`}function Le(u,e,t){let a,i,l,s;he(u,Ee,I=>t(6,s=I));let o=null,r=null,p=!0;const n={five_hour:"quotas.fiveHour",seven_day:"quotas.sevenDay",seven_day_opus:"quotas.sevenDayOpus",seven_day_sonnet:"quotas.sevenDaySonnet",seven_day_omelette:"quotas.sevenDayOmelette",weekly_limit:"quotas.weeklyLimit"},f={"claude-code":"quotas.toolLabels.claude-code",codex:"quotas.toolLabels.codex"};async function v(){t(3,p=!0),t(2,r=null);try{t(0,o=await ge())}catch(I){t(2,r=I instanceof Error?I.message:"Failed to load quota data"),t(0,o=null)}finally{t(3,p=!1)}}_e(v);function m(I){const A=n[I];return A?s(A):Ne(I)}function k(I){const A=f[I];return A?s(A):I}function V(I){return I?new Date(I).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}):s("quotas.never")}return u.$$.update=()=>{u.$$.dirty&1&&t(1,a=(o==null?void 0:o.quotas)??[]),u.$$.dirty&2&&t(5,i=a.filter(I=>I.credentialStatus!=="not_found")),u.$$.dirty&2&&t(4,l=a.filter(I=>I.credentialStatus==="not_found"))},[o,a,r,p,l,i,s,v,m,k,V]}class Fe extends pe{constructor(e){super(),me(this,e,Le,we,ve,{})}}export{Fe as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"
|
|
1
|
+
{"version":"1781033150474"}
|
package/dist/web/index.html
CHANGED
|
@@ -19,26 +19,26 @@
|
|
|
19
19
|
})();
|
|
20
20
|
</script>
|
|
21
21
|
|
|
22
|
-
<link rel="modulepreload" href="/_app/immutable/entry/start.
|
|
23
|
-
<link rel="modulepreload" href="/_app/immutable/chunks/entry.
|
|
22
|
+
<link rel="modulepreload" href="/_app/immutable/entry/start.B0qYhR-d.js">
|
|
23
|
+
<link rel="modulepreload" href="/_app/immutable/chunks/entry.DhBBmiYe.js">
|
|
24
24
|
<link rel="modulepreload" href="/_app/immutable/chunks/scheduler.DsWd5xup.js">
|
|
25
25
|
<link rel="modulepreload" href="/_app/immutable/chunks/index.m3oCcA6N.js">
|
|
26
|
-
<link rel="modulepreload" href="/_app/immutable/entry/app.
|
|
27
|
-
<link rel="modulepreload" href="/_app/immutable/chunks/index.
|
|
26
|
+
<link rel="modulepreload" href="/_app/immutable/entry/app.C_5glR-X.js">
|
|
27
|
+
<link rel="modulepreload" href="/_app/immutable/chunks/index.BfJlbjrK.js">
|
|
28
28
|
</head>
|
|
29
29
|
<body data-sveltekit-preload-data="hover">
|
|
30
30
|
<div style="display: contents">
|
|
31
31
|
<script>
|
|
32
32
|
{
|
|
33
|
-
|
|
33
|
+
__sveltekit_16j729l = {
|
|
34
34
|
base: ""
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
const element = document.currentScript.parentElement;
|
|
38
38
|
|
|
39
39
|
Promise.all([
|
|
40
|
-
import("/_app/immutable/entry/start.
|
|
41
|
-
import("/_app/immutable/entry/app.
|
|
40
|
+
import("/_app/immutable/entry/start.B0qYhR-d.js"),
|
|
41
|
+
import("/_app/immutable/entry/app.C_5glR-X.js")
|
|
42
42
|
]).then(([kit, app]) => {
|
|
43
43
|
kit.start(app, element);
|
|
44
44
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juliantanx/aiusage",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Track and analyze AI coding assistant usage across Claude Code, Codex, and more",
|
|
6
6
|
"keywords": [
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"dashboard",
|
|
20
20
|
"developer-tools"
|
|
21
21
|
],
|
|
22
|
-
"homepage": "https://
|
|
22
|
+
"homepage": "https://aiusage.jtanx.com",
|
|
23
23
|
"repository": {
|
|
24
24
|
"type": "git",
|
|
25
25
|
"url": "https://github.com/juliantanx/aiusage.git"
|
|
@@ -43,17 +43,19 @@
|
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@aws-sdk/client-s3": "^3.700.0",
|
|
45
45
|
"better-sqlite3": "^12.0.0",
|
|
46
|
-
"commander": "^12.0.0"
|
|
46
|
+
"commander": "^12.0.0",
|
|
47
|
+
"yauzl": "^3.3.2"
|
|
47
48
|
},
|
|
48
49
|
"devDependencies": {
|
|
49
50
|
"@types/better-sqlite3": "^7.6.0",
|
|
50
51
|
"@types/node": "^25.7.0",
|
|
52
|
+
"@types/yauzl": "^2.10.3",
|
|
51
53
|
"tsup": "^8.0.0",
|
|
52
54
|
"tsx": "^4.0.0",
|
|
53
55
|
"typescript": "^5.7.0",
|
|
54
56
|
"vitest": "^3.0.0",
|
|
55
|
-
"@aiusage/core": "1.5.
|
|
56
|
-
"@aiusage/web": "1.5.
|
|
57
|
+
"@aiusage/core": "1.5.3",
|
|
58
|
+
"@aiusage/web": "1.5.3"
|
|
57
59
|
},
|
|
58
60
|
"scripts": {
|
|
59
61
|
"build": "tsup && node scripts/copy-web.js",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.sections.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{display:flex;flex-direction:column;gap:1rem;max-width:none}.card.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{background:var(--surface);border-radius:8px;padding:1.25rem}.sync-card.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{order:-1}.group-title-row.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{display:flex;align-items:center;gap:.5rem;margin-bottom:.75rem}.group-title.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{font-family:var(--mono);font-size:.75rem;font-weight:550;text-transform:uppercase;letter-spacing:.06em;color:var(--text-muted);margin-bottom:.75rem}.group-title-row.svelte-o8xfsv .group-title.svelte-o8xfsv.svelte-o8xfsv{margin-bottom:0}.platform-badge.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{font-family:var(--mono);font-size:.75rem;font-weight:600;padding:.15rem .45rem;border-radius:4px;background:var(--accent-dim);color:var(--accent);letter-spacing:.04em}.fields.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{display:grid;grid-template-columns:1fr 1fr;gap:.75rem}.field.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{display:flex;flex-direction:column;gap:.2rem}.field.full.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{grid-column:1 / -1}.field-label.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{font-family:var(--mono);font-size:.75rem;font-weight:550;text-transform:uppercase;letter-spacing:.06em;color:var(--text-secondary)}.field-hint.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{font-size:.75rem;color:var(--text-muted)}.key-hint.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{font-family:var(--mono);font-size:.75rem;background:var(--raised);padding:.05rem .3rem;border-radius:3px;border:1px solid var(--border-subtle);color:var(--text-secondary)}.field-input.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{font-family:Inter,-apple-system,BlinkMacSystemFont,Segoe UI,system-ui,sans-serif;font-size:.85rem;padding:0 .65rem;border:1px solid var(--border-subtle);border-radius:6px;background:var(--raised);color:var(--text);transition:border-color .15s;width:100%;height:32px}.field-input.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv:focus{outline:none;border-color:var(--accent)}.field-input.mono.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{font-family:var(--mono);font-size:.8rem}select.field-input.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{cursor:pointer;-webkit-appearance:auto;-moz-appearance:auto;appearance:auto}.section-error.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{margin-top:.5rem;font-size:.8rem;color:var(--rose)}.section-footer.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{display:flex;justify-content:flex-end;margin-top:.75rem;padding-top:.625rem;border-top:1px solid var(--border-subtle)}.btn-save.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{font-family:var(--mono);font-size:.75rem;font-weight:600;padding:.375rem 1rem;border:1px solid var(--accent);border-radius:6px;background:var(--accent);color:var(--surface);cursor:pointer;transition:background .15s;min-width:64px}.btn-save.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv:hover:not(:disabled){background:var(--accent-hover)}.btn-save.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv:disabled{opacity:.55;cursor:not-allowed}.btn-save.saved.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{border-color:var(--green);background:transparent;color:var(--green)}.sync-status-section.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{margin-top:1rem;padding-top:.75rem;border-top:1px solid var(--border-subtle)}.sync-status-section.svelte-o8xfsv .group-title.svelte-o8xfsv.svelte-o8xfsv{margin-bottom:.5rem}.sync-status-grid.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{display:grid;grid-template-columns:1fr 1fr;gap:.375rem 1.5rem}.sync-status-item.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{display:flex;justify-content:space-between;align-items:baseline;gap:.5rem;padding:.25rem 0}.sync-status-item.full.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{grid-column:1 / -1}.sync-status-label.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{font-size:.8125rem;color:var(--text-muted)}.sync-status-hint.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{grid-column:1 / -1;font-size:.75rem;color:var(--text-muted);padding-top:.125rem}.sync-status-value.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{font-size:.8125rem;color:var(--text);text-align:right}.sync-status-value.ok.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{color:var(--green)}.sync-status-value.err.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{color:var(--rose)}.sync-action.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{margin-top:.75rem;display:flex;flex-direction:column;align-items:flex-start;gap:.4rem}.sync-unsaved-warn.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{font-size:.75rem;font-weight:600;color:var(--amber, #f59e0b);background:color-mix(in oklab,var(--amber, #f59e0b) 10%,transparent);border:1px solid color-mix(in oklab,var(--amber, #f59e0b) 25%,transparent);border-radius:6px;padding:.375rem .625rem}.btn-sync.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{font-family:var(--mono);font-size:.75rem;font-weight:600;padding:.375rem 1rem;border:1px solid var(--border-medium);border-radius:6px;background:transparent;color:var(--text-secondary);cursor:pointer;transition:border-color .15s,color .15s}.btn-sync.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv:hover:not(:disabled){border-color:var(--accent);color:var(--accent)}.btn-sync.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv:disabled{opacity:.55;cursor:not-allowed}.sync-progress-counts.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{font-variant-numeric:tabular-nums;opacity:.7;margin-left:.25rem}.auto-sync-toggle-row.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{display:flex;align-items:center;justify-content:space-between;gap:1rem}.toggle-row.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{display:flex;gap:.625rem;align-items:center;min-width:0;cursor:pointer}.toggle-row.svelte-o8xfsv input.svelte-o8xfsv.svelte-o8xfsv{position:absolute;opacity:0;pointer-events:none}.switch.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{position:relative;width:34px;height:20px;border:1px solid var(--border-medium);border-radius:999px;background:var(--raised);transition:background .16s ease,border-color .16s ease;flex-shrink:0}.switch.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv:after{content:"";position:absolute;top:2px;left:2px;width:14px;height:14px;border-radius:50%;background:var(--text-secondary);transition:transform .16s ease,background .16s ease}.toggle-row.svelte-o8xfsv input.svelte-o8xfsv:checked+.switch.svelte-o8xfsv{border-color:var(--accent);background:var(--accent)}.toggle-row.svelte-o8xfsv input.svelte-o8xfsv:checked+.switch.svelte-o8xfsv:after{background:#fafcfc;transform:translate(14px)}.toggle-row.svelte-o8xfsv input.svelte-o8xfsv:focus-visible+.switch.svelte-o8xfsv{outline:2px solid color-mix(in oklab,var(--accent) 40%,transparent);outline-offset:2px}.toggle-row.svelte-o8xfsv strong.svelte-o8xfsv.svelte-o8xfsv{display:block;color:var(--text);font-size:.8125rem}.interval-control.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{display:inline-flex;gap:.5rem;align-items:center;color:var(--text-muted);font-size:.75rem;font-weight:650;white-space:nowrap;flex-shrink:0}.interval-control.svelte-o8xfsv select.svelte-o8xfsv.svelte-o8xfsv{min-height:32px;padding:0 1.875rem 0 .625rem;border:1px solid var(--border-subtle);border-radius:6px;background:var(--surface);color:var(--text-secondary);font:inherit;cursor:pointer}.state-msg.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{color:var(--text-muted);padding:2rem;text-align:center}.state-msg.error.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{color:var(--rose)}.cloud-setup.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{background:var(--raised);border:1px solid var(--border-subtle);border-radius:8px;padding:.875rem 1rem;margin-bottom:.75rem}.cloud-setup-title.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{font-family:var(--mono);font-size:.6875rem;font-weight:550;text-transform:uppercase;letter-spacing:.06em;color:var(--text-muted);margin-bottom:.625rem}.cloud-steps.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{display:flex;flex-direction:column;gap:.5rem}.cloud-step.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{display:flex;align-items:flex-start;gap:.625rem}.cloud-step-num.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{width:20px;height:20px;border-radius:50%;border:1.5px solid var(--border-medium);display:flex;align-items:center;justify-content:center;font-family:var(--mono);font-size:.6875rem;font-weight:600;color:var(--text-muted);flex-shrink:0;margin-top:.0625rem}.cloud-step-body.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{display:flex;flex-direction:column;gap:.125rem}.cloud-step-label.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{font-size:.8125rem;font-weight:600;color:var(--text)}.cloud-step-link.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{font-family:var(--mono);font-size:.75rem;color:var(--accent);text-decoration:none;font-weight:600}.cloud-step-link.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv:hover{text-decoration:underline}.cloud-status.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{display:flex;align-items:center;gap:.5rem;font-size:.8125rem;color:var(--text-secondary);padding:.5rem 0}.status-dot.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{width:6px;height:6px;border-radius:50%;background:var(--text-muted);flex-shrink:0}.status-dot.ok.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{background:var(--green)}.credential-row.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{display:flex;gap:.5rem;align-items:center}.credential-row.svelte-o8xfsv .field-input.svelte-o8xfsv.svelte-o8xfsv{flex:1}.btn-ghost.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{font-family:var(--mono);font-size:.75rem;font-weight:600;padding:.375rem .75rem;border:none;border-radius:6px;background:transparent;color:var(--text-secondary);cursor:pointer;white-space:nowrap;transition:color .15s}.btn-ghost.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv:hover{color:var(--accent)}.btn-ghost.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv:disabled{opacity:.55;cursor:not-allowed}.rate-row.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{display:flex;gap:.5rem;align-items:center}.rate-row.svelte-o8xfsv .field-input.svelte-o8xfsv.svelte-o8xfsv{flex:1}.rate-time.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{color:var(--text-muted);font-size:.75rem;margin-left:.25rem}.detected-tools-list.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{display:flex;flex-direction:column;gap:.375rem}.detected-tool.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{padding:.5rem .625rem;border-radius:6px;background:var(--raised);border:1px solid var(--border-subtle)}.detected-tool-header.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{display:flex;align-items:center;gap:.5rem}.status-dot.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{width:7px;height:7px;border-radius:50%;flex-shrink:0}.status-dot.green.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{background:var(--green)}.status-dot.yellow.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{background:var(--amber, #f59e0b)}.status-dot.gray.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{background:var(--text-muted);opacity:.4}.detected-tool-name.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{font-family:var(--mono);font-size:.8rem;font-weight:600;color:var(--text)}.detected-tool-status.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{font-family:var(--mono);font-size:.75rem;color:var(--text-muted);margin-left:auto}.not-found-toggle.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{display:flex;align-items:center;gap:.375rem;font-family:var(--mono);font-size:.75rem;font-weight:550;color:var(--text-muted);background:none;border:none;padding:.375rem .25rem;cursor:pointer;transition:color .12s}.not-found-toggle.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv:hover{color:var(--text-secondary)}.not-found-chevron.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{font-size:.5rem;transition:transform .15s;display:inline-block}.not-found-chevron.open.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{transform:rotate(90deg)}.detected-tool.not-found.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{opacity:.6}.detected-tool-path.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{font-family:var(--mono);font-size:.75rem;color:var(--text-secondary);margin-top:.2rem;margin-left:1.25rem;word-break:break-all}@media (max-width: 640px){.fields.svelte-o8xfsv.svelte-o8xfsv.svelte-o8xfsv{grid-template-columns:1fr}}
|