@juliantanx/aiusage 1.5.0 → 1.5.2
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 +5 -15
- package/dist/index.js +849 -259
- package/dist/web/_app/immutable/assets/12.C1f-IaHK.css +1 -0
- package/dist/web/_app/immutable/assets/_page.DO7aPEA-.css +1 -0
- package/dist/web/_app/immutable/chunks/{ToolSelector.CofvKVw2.js → ToolSelector.DTPGX4zP.js} +1 -1
- package/dist/web/_app/immutable/chunks/api.DC92Gfvo.js +1 -0
- package/dist/web/_app/immutable/chunks/{entry.PDoHFbXz.js → entry.Cxpjn2cB.js} +2 -2
- package/dist/web/_app/immutable/chunks/i18n.yxU9Ieh-.js +1 -0
- package/dist/web/_app/immutable/chunks/{stores.Botc0ioY.js → stores.CK2Vof2m.js} +1 -1
- package/dist/web/_app/immutable/entry/{app.CoPtpbXI.js → app.BzFxp-0D.js} +2 -2
- package/dist/web/_app/immutable/entry/start.C2M6huNJ.js +1 -0
- package/dist/web/_app/immutable/nodes/{0.CZMa2uzk.js → 0.5419U2xS.js} +2 -2
- package/dist/web/_app/immutable/nodes/{1.DJI2NNga.js → 1.C4em9nwH.js} +1 -1
- package/dist/web/_app/immutable/nodes/{10.DTaETIM6.js → 10.DGXLHPeN.js} +1 -1
- package/dist/web/_app/immutable/nodes/{11.CScZqjVc.js → 11.SDWfdWaC.js} +1 -1
- package/dist/web/_app/immutable/nodes/12.B5loVhie.js +1 -0
- package/dist/web/_app/immutable/nodes/{13.BFaBQy6e.js → 13.9M-J-sT0.js} +1 -1
- package/dist/web/_app/immutable/nodes/{14.BgJEC28r.js → 14.F_F2PTIe.js} +1 -1
- package/dist/web/_app/immutable/nodes/{15.DjuCO6OE.js → 15.B0ylahpi.js} +1 -1
- package/dist/web/_app/immutable/nodes/{2.CoxR54dV.js → 2.oTDdkLn9.js} +1 -1
- package/dist/web/_app/immutable/nodes/{3.Bua2oewW.js → 3.Oyghjrgn.js} +1 -1
- package/dist/web/_app/immutable/nodes/{4.DJwmYYKI.js → 4.DiPBEiKy.js} +1 -1
- package/dist/web/_app/immutable/nodes/{5.CXmtjVJL.js → 5.CtE-oF5k.js} +1 -1
- package/dist/web/_app/immutable/nodes/{6.kpxBlrHt.js → 6.tVPvf7jD.js} +1 -1
- package/dist/web/_app/immutable/nodes/{7.LSfdx4vz.js → 7.CAfC8ItM.js} +1 -1
- package/dist/web/_app/immutable/nodes/{8.ByAI01dT.js → 8.DJsWN3X2.js} +1 -1
- package/dist/web/_app/immutable/nodes/{9.Ubt4Bfxd.js → 9.30YXO0yd.js} +1 -1
- package/dist/web/_app/version.json +1 -1
- package/dist/web/index.html +6 -6
- package/package.json +7 -5
- package/dist/web/_app/immutable/assets/12.nNHFRI35.css +0 -1
- package/dist/web/_app/immutable/assets/_page.ZSDsIDry.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.CaOJNprV.js +0 -1
- package/dist/web/_app/immutable/nodes/12.DeLNKhlw.js +0 -1
|
@@ -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.66Vu9Sio.js";import{p as ge,e as Q,h as J,i as X}from"../chunks/api.DC92Gfvo.js";import{t as Ee}from"../chunks/i18n.yxU9Ieh-.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":"1780909986858"}
|
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.C2M6huNJ.js">
|
|
23
|
+
<link rel="modulepreload" href="/_app/immutable/chunks/entry.Cxpjn2cB.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.
|
|
26
|
+
<link rel="modulepreload" href="/_app/immutable/entry/app.BzFxp-0D.js">
|
|
27
27
|
<link rel="modulepreload" href="/_app/immutable/chunks/index.66Vu9Sio.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_a24kl5 = {
|
|
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.C2M6huNJ.js"),
|
|
41
|
+
import("/_app/immutable/entry/app.BzFxp-0D.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.2",
|
|
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.2",
|
|
58
|
+
"@aiusage/web": "1.5.2"
|
|
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}}
|
|
@@ -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;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}}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{m as D}from"./index.66Vu9Sio.js";import{r as H}from"./scheduler.DsWd5xup.js";function q(e){return(e==null?void 0:e.length)!==void 0?e:Array.from(e)}function M(e,t){e.d(1),t.delete(e.key)}function N(e,t,n,s,p,a,c,u,k,I,P,O){let d=e.length,g=a.length,w=d;const S={};for(;w--;)S[e[w].key]=w;const l=[],j=new Map,E=new Map,b=[];for(w=g;w--;){const r=O(p,a,w),i=n(r);let f=c.get(i);f?b.push(()=>f.p(r,t)):(f=I(i,r),f.c()),j.set(i,l[w]=f),i in S&&E.set(i,Math.abs(w-S[i]))}const $=new Set,C=new Set;function A(r){D(r,1),r.m(u,P),c.set(r.key,r),P=r.first,g--}for(;d&&g;){const r=l[g-1],i=e[d-1],f=r.key,m=i.key;r===i?(P=r.first,d--,g--):j.has(m)?!c.has(f)||$.has(f)?A(r):C.has(m)?d--:E.get(f)>E.get(m)?(C.add(f),A(r)):($.add(m),d--):(k(i,c),d--)}for(;d--;){const r=e[d];j.has(r.key)||k(r,c)}for(;g;)A(l[g-1]);return H(b),l}function h(e,t){const n=new URLSearchParams;for(const[p,a]of Object.entries(t))a&&n.set(p,a);const s=n.toString();return s?`${e}?${s}`:e}const T=new Map,y=new Map;async function o(e,{signal:t,swr:n=!1}={}){const s=()=>t?fetch(e,{signal:t}):fetch(e);if(n&&T.has(e)){const a=T.get(e);if(Date.now()-a.fetchedAt>5e3&&!y.has(e)){const c=s().then(u=>u.ok?u.json():null).then(u=>{u&&T.set(e,{data:u,fetchedAt:Date.now()})}).catch(()=>{}).finally(()=>y.delete(e));y.set(e,c)}return a.data}if(y.has(e))return y.get(e);const p=s().then(async a=>{var c;if(!a.ok){const u=await a.json().catch(()=>({error:{message:"API error"}}));throw new Error(((c=u.error)==null?void 0:c.message)||`HTTP ${a.status}`)}return a.json()}).then(a=>(n&&T.set(e,{data:a,fetchedAt:Date.now()}),a)).finally(()=>y.delete(e));return y.set(e,p),p}async function R(e,{signal:t,swr:n=!0}={}){return o(h("/api/summary",e),{signal:t,swr:n})}async function x(e){return o(h("/api/tokens",e))}async function J(e){return o(h("/api/cost",e))}async function z(e){return o(h("/api/models",e))}async function F(e){return o(h("/api/tool-calls",{...e,toolType:e.toolType||void 0}))}async function B(e){var t,n;return o(h("/api/sessions",{...e,page:(t=e.page)==null?void 0:t.toString(),pageSize:(n=e.pageSize)==null?void 0:n.toString()}))}async function G(e,t={}){return o(h(`/api/sessions/${encodeURIComponent(e)}`,t))}async function Q(e){return o(h("/api/projects",e))}async function V(){return o("/api/refresh")}async function _(){return o("/api/pricing")}async function K(e,t){var s;const n=await fetch("/api/pricing",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:e,...t})});if(!n.ok){const p=await n.json().catch(()=>({error:{message:"API error"}}));throw new Error(((s=p.error)==null?void 0:s.message)||`HTTP ${n.status}`)}return n.json()}async function W(e){var n;const t=await fetch(`/api/pricing?model=${encodeURIComponent(e)}`,{method:"DELETE"});if(!t.ok){const s=await t.json().catch(()=>({error:{message:"API error"}}));throw new Error(((n=s.error)==null?void 0:n.message)||`HTTP ${t.status}`)}return t.json()}async function X(){var t;const e=await fetch("/api/sync",{method:"POST"});if(!e.ok){const n=await e.json().catch(()=>({error:{message:"API error"}}));throw new Error(((t=n.error)==null?void 0:t.message)||`HTTP ${e.status}`)}return e.json()}async function Y(){return o("/api/sync")}async function Z(){return o("/api/config")}async function ee(e){var n;const t=await fetch("/api/config",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const s=await t.json().catch(()=>({error:{message:"API error"}}));throw new Error(((n=s.error)==null?void 0:n.message)||`HTTP ${t.status}`)}return t.json()}async function te(e){return o(h("/api/tools",e))}async function ne(){return o("/api/detected-tools")}async function se(){return o("/api/quotas")}async function re(){return o("/api/auth/status")}async function oe(e){var n;const t=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:e})});if(!t.ok){const s=await t.json().catch(()=>({error:{message:"API error"}}));throw new Error(((n=s.error)==null?void 0:n.message)||`HTTP ${t.status}`)}return t.json()}async function ae(){return o("/api/leaderboard/auth/status")}async function ce(){var t;const e=await fetch("/api/leaderboard/auth/start",{method:"POST"});if(!e.ok){const n=await e.json().catch(()=>({error:{message:"API error"}}));throw new Error(((t=n.error)==null?void 0:t.message)||`HTTP ${e.status}`)}return e.json()}async function ie(e){var s;const t=await fetch("/api/leaderboard/auth/complete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({device_request_id:e})}),n=await t.json().catch(()=>null);if(t.status===202||n!=null&&n.pending)return n||{pending:!0};if(!t.ok)throw new Error(((s=n==null?void 0:n.error)==null?void 0:s.message)||`HTTP ${t.status}`);return n}async function fe(){var t;const e=await fetch("/api/leaderboard/auth/logout",{method:"POST"});if(!e.ok){const n=await e.json().catch(()=>({error:{message:"API error"}}));throw new Error(((t=n.error)==null?void 0:t.message)||`HTTP ${e.status}`)}return e.json()}async function he(){var t;const e=await fetch("/api/leaderboard/upload",{method:"POST"});if(!e.ok){const n=await e.json().catch(()=>({error:{message:"API error"}}));throw new Error(((t=n.error)==null?void 0:t.message)||`HTTP ${e.status}`)}return e.json()}async function ue(){var t;const e=await fetch("/api/exchange-rate/refresh",{method:"POST"});if(!e.ok){const n=await e.json().catch(()=>({error:{message:"API error"}}));throw new Error(((t=n.error)==null?void 0:t.message)||`HTTP ${e.status}`)}return e.json()}async function de(e){return o(h("/api/config/credential",{ref:e}))}const v="aiusage:settings-updated";function pe(e){typeof window>"u"||window.dispatchEvent(new CustomEvent(v,{detail:e}))}export{de as A,x as B,F as C,te as D,re as E,oe as F,v as S,Z as a,ae as b,ee as c,ie as d,q as e,J as f,z as g,N as h,M as i,R as j,_ as k,fe as l,K as m,W as n,Q as o,se as p,B as q,V as r,ce as s,G as t,he as u,ne as v,Y as w,X as x,pe as y,ue as z};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{w as r,d}from"./index.m3oCcA6N.js";const n={en:{nav:{home:"Home",overview:"Overview",tokens:"Tokens",cost:"Cost",models:"Models",toolCalls:"Tool Calls",projects:"Projects",sessions:"Sessions",quotas:"Quotas",leaderboard:"Leaderboard",pricing:"Pricing",support:"Support",settings:"Settings",docs:"Docs",collapse:"Collapse",expand:"Expand",group:{overview:"Overview",analytics:"Analytics",activity:"Activity",system:"System"}},common:{loading:"Loading...",error:"Error",noData:"No data available",noDataHint:"Start using AI tools to see statistics here.",apply:"Apply",all:"All",previous:"Previous",next:"Next",page:"Page",of:"of"},range:{today:"Today",week:"This Week",month:"This Month",last30:"Last 30d",allTime:"All Time",from:"From",to:"To",pickMonth:"Month..."},overview:{title:"Overview",desc:"Aggregated token, cost and session stats across all AI tools.",totalTokens:"Total Tokens",totalCost:"Total Cost",activeDays:"Active Days",totalSessions:"Sessions",inputTokens:"Input",outputTokens:"Output",cacheRead:"Cache Read",cacheWrite:"Cache Write",byTool:"By AI Assistant",byProject:"By Project",topToolCalls:"Top Tool Calls",tool:"Tool",tokens:"Tokens",cost:"Cost",noToolData:"No data",noToolCalls:"No tool calls recorded",topMcpServers:"MCP Servers",noMcpCalls:"No MCP calls recorded",tabAll:"All",tabMcp:"MCP Servers"},tokens:{title:"Tokens",desc:"Daily token usage breakdown by type.",chartTitle:"Token Usage by Day",input:"Input",output:"Output",cacheRead:"Cache Read",cacheWrite:"Cache Write",thinking:"Thinking",date:"Date",total:"Total",modeBreakdown:"Breakdown",modeTotal:"Total",noData:"No token data",noDataHint:"No token usage recorded for this period."},projects:{title:"Projects",desc:"Token usage and cost ranked by project directory.",project:"Project",sessions:"Sessions",tokens:"Tokens",cost:"Cost",share:"Share",noData:"No project data",noDataHint:"No project usage recorded for this period."},cost:{title:"Cost",desc:"Daily spending trends and cost breakdown by tool and model.",totalCost:"Total Cost",chartTitle:"Cost by Day",byTool:"By AI Assistant",byModel:"By Model",noData:"No cost data",noDataHint:"No costs recorded for this period."},models:{title:"Models",desc:"Usage ranking across all AI models.",chartTitle:"Model Ranking",modeTokens:"Tokens",modeCost:"Cost",model:"Model",provider:"Provider",calls:"Calls",tokens:"Tokens",input:"Input",output:"Output",cacheRead:"Cache Read",cacheWrite:"Cache Write",thinking:"Thinking",total:"Total",cost:"Cost",share:"Share",noData:"No model data",noDataHint:"No model usage recorded for this period."},toolCalls:{title:"Tool Calls",desc:"Most frequently invoked tools by AI assistants.",noData:"No tool call data",noDataHint:"No tool calls recorded for this period.",typeAll:"All",typeBuiltin:"Built-in",typeMcp:"MCP",typeSkill:"Skill",badgeMcp:"mcp",badgeSkill:"skill",noToolCallData:"Tool call data is not available in this tool's data source."},sessions:{title:"Sessions",desc:"Per-session log with token and cost details.",assistant:"AI Assistant",time:"Time",tool:"Tool",model:"Model",input:"Input",output:"Output",cost:"Cost",duration:"Duration",toolCalls:"Tools",noData:"No sessions",noDataHint:"No sessions recorded for this period.",detail:{back:"← Sessions",title:"Session Detail",meta:{duration:"Duration",tokens:"Tokens",cost:"Cost",apiCalls:"API Calls",toolCalls:"Tool Calls",model:"Model",path:"Path",input:"Input",output:"Output",cacheRead:"Cache Read",cacheWrite:"Cache Write",thinking:"Thinking",totalTokens:"Total",sessionId:"Session"},gap:"gap",noToolCalls:"No tool calls",record:"API Call",toolCall:"Tool"}},theme:{system:"System",dark:"Dark",light:"Light"},pricing:{title:"Pricing",model:"Model",input:"Input",output:"Output",cacheRead:"Cache Read",cacheWrite:"Cache Write",thinking:"Thinking",status:"Status",actions:"Actions",edit:"Edit",save:"Save",cancel:"Cancel",reset:"Reset",recalc:"Recalculate Costs",recalcDone:"Recalculated",costsUpdating:"Updating costs...",costsUpdated:"Costs updated",default:"Default",override:"Custom",matched:"Matched by prefix",noPrice:"No pricing",perMillion:"/ 1M tokens"},sync:{trigger:"Sync",syncing:"Syncing...",started:"Sync started",inProgress:"Sync already running",complete:"Synced",failed:"Sync failed",notConfigured:"Not configured",lastSync:"Last sync",never:"Never",phase:{pulling:"Pulling",merging:"Merging",uploading:"Uploading",finalizing:"Finalizing"}},device:{allDevices:"All Devices",loading:"Loading..."},tool:{allTools:"All tools"},settings:{title:"Settings",save:"Save",saved:"Saved",general:"General",detectedTools:"Detected Tools",detectedToolsHint:"Auto-detected AI tools on this system. Override paths via AIUSAGE_*_PATH environment variables.",toolFound:"Found",toolNotFound:"Not found",toolEmpty:"Empty",toolFiles:"files",sync:"Multi-device Sync",syncBackendCloudDesc:"Encrypted, fast, automatic. Sync usage data across all your devices with zero configuration.",syncCloudSetup:"Setup required",syncCloudStep1:"Bind your GitHub account",syncCloudStep2:"Star the repository",syncCloudReady:"Cloud Sync is ready",syncStarRequired:"Star the repository to activate Cloud Sync.",syncGithubBindingRequired:"Bind your GitHub account first.",syncBackendGithubDesc:"Keep usage data in sync across your devices via a private GitHub repository. Requires a personal access token.",syncBackendS3Desc:"Keep usage data in sync across your devices via S3-compatible storage (AWS S3, MinIO, R2, etc.).",syncBackendNoneDesc:"Select a backend to enable multi-device sync.",device:"Device Alias",deviceHint:"Optional alias; hostname is used if blank",weekStart:"Week Starts On",weekStartSunday:"Sunday",weekStartMonday:"Monday (ISO)",refreshInterval:"Refresh Interval (ms)",retentionDays:"Local Data Retention (days)",retentionHint:"Days to keep local data (0 or empty = keep forever)",retentionPlaceholder:"Forever",syncBackend:"Backend",syncBackendNone:"Disabled",cloudLoggedIn:"Device authorized. Ready to sync.",cloudNotLoggedIn:'Not logged in. Run "aiusage login" in the terminal first.',syncRepo:"Repository (owner/repo)",syncBucket:"Bucket",syncPrefix:"S3 Object Prefix",syncEndpoint:"Endpoint",syncRegion:"Region",syncCredentialRef:"Credential Key Name",syncCredentialValue:"Credential Value",syncStatus:"Status",syncLastSync:"Last Sync",syncNextSync:"Next Sync",syncStatusLabel:"Status",syncPulled:"Pulled records",syncUploaded:"Uploaded records",syncCountHint:"Shows usage records processed in the latest sync.",syncError:"Error",syncDuration:"Duration",syncNow:"Sync Now",syncNever:"Never",syncUnsavedHint:"Please save your sync settings before syncing.",autoSync:"Auto sync",syncFrequency:"Every",syncMinutes:"min",syncHour:"hour",syncHours:"hours",credentialSet:"Set — leave empty to keep",credentialNotSet:"Not set",credentialStoredAs:"Stored as",syncRepoRequired:"Repository is required for GitHub sync.",syncRepoInvalid:"Repository must use the owner/repo format.",syncGithubTokenRequired:"GitHub token is required for GitHub sync.",syncBucketRequired:"Bucket is required for S3 sync.",syncS3AccessKeyRequired:"Access Key ID is required for S3 sync.",syncS3SecretKeyRequired:"Secret Access Key is required for S3 sync.",showCredential:"Show",hideCredential:"Hide",currency:"Currency",displayCurrency:"Display Currency",exchangeRate:"Exchange Rate",exchangeRateHint:"Leave empty to use auto-fetched rate",refreshRate:"Refresh",rateLastUpdated:"Last updated"},home:{counterLabel:"AI Tokens Consumed",cfgTitle:"Display Config",timeRange:"Time Range",numFormat:"Number Format",numExact:"Exact",numExactEx:"1,234,567",numShort:"Short",numShortEx:"1.234M",nextRefresh:"next refresh in",seconds:"s",refreshing:"refreshing…",manualMode:"manual mode",refreshNow:"↺ now",refreshBtn:"↺ refresh",refreshInfo:"Refresh interval set in",input:"Input",output:"Output",cache:"Cache",quotaWarning:"Quota Warning",quotaWarningDesc:"quota used",quotaWarningLink:"View Quotas"},quotas:{title:"Quotas",desc:"Official subscription quota usage for each AI tool.",refresh:"Refresh",refreshing:"Refreshing...",lastUpdated:"Updated",never:"Never",noCredentials:"No credentials found",noCredentialsHint:"Log in with the AI tool's CLI to enable quota tracking.",expired:"Credentials expired",expiredHint:"Re-login with the CLI to refresh your credentials.",queryFailed:"Query failed",noTiers:"No quota data available",fiveHour:"5h Window",sevenDay:"7d Window",sevenDayOpus:"7d Opus",sevenDaySonnet:"7d Sonnet",sevenDayOmelette:"7d Design",weeklyLimit:"Weekly",resetsIn:"resets in {time}",toolLabels:{"claude-code":"Claude Code",codex:"Codex (OpenAI)"}},leaderboard:{title:"Leaderboard",desc:"Manage leaderboard sign-in and uploads. Public rankings live on the site.",publicView:"Public view",privacyTitle:"Uploaded data",account:"Account",device:"Device",authorizedDevice:"Authorized device",authorizedAt:"Authorized",uploadStatus:"Upload status",noUploads:"No uploads yet",noUploadTime:"No upload time yet",nextUpload:"Next upload",afterFirstUpload:"After the first upload",autoUploadOff:"Off",enableAutoUploadHint:"Enable auto upload to schedule it",openLeaderboard:"Open public leaderboard",period:"Period",showing:"Showing",periodStart:"Period start",user:"User",updated:"Updated",loadMore:"Load more",loadingMore:"Loading...",noEntries:"No public entries yet.",openSite:"Open Leaderboard",authTitle:"Upload account",loggedIn:"CLI and web are signed in",notLoggedIn:"Not authorized",webLoginHint:"Authorize in the browser. The local CLI will use the same credentials.",loginInWeb:"Sign in on this device",authorizing:"Authorizing...",uploadInWeb:"Upload data",uploading:"Uploading...",autoUpload:"Auto upload",autoUploadHint:"The local server periodically parses and uploads aggregate totals.",autoUploadRequiresLogin:"Sign in on this device before enabling auto upload.",uploadEvery:"Frequency",autoUploadIntervals:{daily:"Daily",weekly:"Weekly",monthly:"Monthly"},uploadLimits:"Limits",uploadLimitsSummary:"At most one scheduled upload per interval. Each run submits aggregate totals only.",uploadResult:"Upload result",uploadResultHint:"Accepted / flagged / rejected",uploadSuccess:"Upload successful",logout:"Log out locally",verifyCode:"Verification code",openVerify:"Open authorization page",lastUpload:"Latest upload",privacy:"Uploads include aggregate token totals only. Prompts, completions, source code, file paths, model breakdowns, project data, and local cost estimates stay out of the leaderboard payload.",periods:{daily:"Daily",weekly:"Weekly",monthly:"Monthly",yearly:"Yearly",all_time:"All time"}},auth:{locked:"Dashboard locked",lockedHint:"Enter the dashboard password to view this page.",unlock:"Unlock",unlocking:"Unlocking...",unlockDashboard:"Unlock dashboard",unlockHint:"Enter the dashboard password to show navigation and protected pages.",password:"Password",backHome:"Back to public home",checking:"Checking access...",loginFailed:"Login failed"},support:{title:"Service & Support",desc:"Stable contact channels for product questions, support, and community discussion.",personal:"Direct contact",community:"Community",wechat:"WeChat",wechatHint:"Scan the QR code and include your request in the note. Use it for product questions, feedback, or community group access.",qrExpand:"Click to enlarge QR code",qrScanHint:"Scan with WeChat to add",email:"Email",discord:"Discord",discordHint:"Join the community for discussion and support.",telegram:"Telegram",telegramHint:"Updates and community discussion.",open:"Open"}},zh:{nav:{home:"首页",overview:"概览",tokens:"Token",cost:"费用",models:"模型",toolCalls:"工具调用",projects:"项目",sessions:"会话",quotas:"配额",leaderboard:"排行榜",pricing:"定价",support:"服务与支持",settings:"设置",docs:"文档",collapse:"收起",expand:"展开",group:{overview:"概览",analytics:"统计",activity:"活动",system:"系统"}},common:{loading:"加载中...",error:"错误",noData:"暂无数据",noDataHint:"开始使用 AI 工具后,统计数据将显示在此处。",apply:"应用",all:"全部",previous:"上一页",next:"下一页",page:"第",of:"页,共"},range:{today:"今天",week:"本周",month:"本月",last30:"近 30 天",allTime:"全部",from:"开始",to:"结束",pickMonth:"选择月份..."},overview:{title:"概览",desc:"所有 AI 工具的 Token、费用和会话聚合统计。",totalTokens:"总 Token",totalCost:"总费用",activeDays:"活跃天数",totalSessions:"会话数",inputTokens:"输入",outputTokens:"输出",cacheRead:"缓存读取",cacheWrite:"缓存写入",byTool:"按 AI 助手",byProject:"按项目",topToolCalls:"常用工具",tool:"工具",tokens:"Token",cost:"费用",noToolData:"暂无数据",noToolCalls:"暂无工具调用记录",topMcpServers:"MCP 服务器",noMcpCalls:"暂无 MCP 调用记录",tabAll:"全部",tabMcp:"MCP 服务器"},tokens:{title:"Token",desc:"按类型分类的每日 Token 用量趋势。",chartTitle:"每日 Token 用量",input:"输入",output:"输出",cacheRead:"缓存读取",cacheWrite:"缓存写入",thinking:"思考",date:"日期",total:"合计",modeBreakdown:"分类",modeTotal:"总量",noData:"暂无 Token 数据",noDataHint:"当前时间段内无 Token 使用记录。"},projects:{title:"项目",desc:"按项目目录排列的 Token 用量和费用排名。",project:"项目",sessions:"会话",tokens:"Token",cost:"费用",share:"占比",noData:"暂无项目数据",noDataHint:"当前时间段内无项目使用记录。"},cost:{title:"费用",desc:"每日费用趋势及按工具、模型的费用分布。",totalCost:"总费用",chartTitle:"每日费用",byTool:"按 AI 助手",byModel:"按模型",noData:"暂无费用数据",noDataHint:"当前时间段内无费用记录。"},models:{title:"模型",desc:"各 AI 模型的用量排名。",chartTitle:"模型排名",modeTokens:"Token",modeCost:"费用",model:"模型",provider:"提供商",calls:"调用次数",tokens:"Token",input:"输入",output:"输出",cacheRead:"缓存读取",cacheWrite:"缓存写入",thinking:"思考",total:"合计",cost:"费用",share:"占比",noData:"暂无模型数据",noDataHint:"当前时间段内无模型使用记录。"},toolCalls:{title:"工具调用",desc:"AI 助手最常调用的工具排名。",noData:"暂无工具调用数据",noDataHint:"当前时间段内无工具调用记录。",typeAll:"全部",typeBuiltin:"内置",typeMcp:"MCP",typeSkill:"Skill",badgeMcp:"mcp",badgeSkill:"skill",noToolCallData:"该工具的数据源中不包含工具调用记录。"},sessions:{title:"会话",desc:"每条会话的 Token 用量和费用详细记录。",assistant:"AI 助手",time:"时间",tool:"工具",model:"模型",input:"输入",output:"输出",cost:"费用",duration:"时长",toolCalls:"工具调用",noData:"暂无会话",noDataHint:"当前时间段内无会话记录。",detail:{back:"← 会话列表",title:"会话详情",meta:{duration:"时长",tokens:"Token",cost:"费用",apiCalls:"API 调用",toolCalls:"工具调用",model:"模型",path:"路径",input:"输入",output:"输出",cacheRead:"缓存读取",cacheWrite:"缓存写入",thinking:"思考",totalTokens:"合计",sessionId:"会话"},gap:"间隔",noToolCalls:"无工具调用",record:"API 调用",toolCall:"工具"}},theme:{system:"跟随系统",dark:"深色",light:"浅色"},pricing:{title:"定价管理",model:"模型",input:"输入",output:"输出",cacheRead:"缓存读取",cacheWrite:"缓存写入",thinking:"思考",status:"状态",actions:"操作",edit:"编辑",save:"保存",cancel:"取消",reset:"重置",recalc:"重新计算费用",recalcDone:"已重新计算",costsUpdating:"费用更新中...",costsUpdated:"费用已自动更新",default:"默认",override:"自定义",matched:"前缀匹配",noPrice:"无定价",perMillion:"/ 1M tokens"},sync:{trigger:"同步",syncing:"同步中...",started:"已开始同步",inProgress:"同步已在进行中",complete:"已同步",failed:"同步失败",notConfigured:"未配置",lastSync:"上次同步",never:"从未",phase:{pulling:"拉取中",merging:"合并中",uploading:"上传中",finalizing:"完成中"}},device:{allDevices:"全部设备",loading:"加载中..."},tool:{allTools:"全部工具"},settings:{title:"设置",save:"保存",saved:"已保存",general:"通用",detectedTools:"已检测工具",detectedToolsHint:"系统上自动检测到的 AI 工具。可通过 AIUSAGE_*_PATH 环境变量覆盖路径。",toolFound:"已检测",toolNotFound:"未检测到",toolEmpty:"空",toolFiles:"个文件",sync:"多设备同步",syncBackendCloudDesc:"加密传输、极速同步、自动化。零配置跨设备同步用量数据。",syncCloudSetup:"需要完成以下设置",syncCloudStep1:"绑定 GitHub 账号",syncCloudStep2:"Star 仓库",syncCloudReady:"Cloud Sync 已就绪",syncStarRequired:"请先 Star 仓库以激活 Cloud Sync。",syncGithubBindingRequired:"请先绑定 GitHub 账号。",syncBackendGithubDesc:"通过私有 GitHub 仓库在多台设备之间同步用量数据。需要个人访问令牌。",syncBackendS3Desc:"通过 S3 兼容存储(AWS S3、MinIO、R2 等)在多台设备之间同步用量数据。",syncBackendNoneDesc:"选择同步后端以启用多设备同步。",device:"设备别名",deviceHint:"可选别名;留空则使用主机名",weekStart:"每周起始日",weekStartSunday:"周日",weekStartMonday:"周一(ISO)",refreshInterval:"刷新间隔(ms)",retentionDays:"本地数据保留天数",retentionHint:"0 或留空表示永久保留本地数据",retentionPlaceholder:"永久",syncBackend:"后端类型",syncBackendNone:"已禁用",cloudLoggedIn:"设备已授权,可以同步。",cloudNotLoggedIn:'未登录。请先在终端运行 "aiusage login"。',syncRepo:"仓库(owner/repo)",syncBucket:"存储桶",syncPrefix:"S3 对象前缀",syncEndpoint:"Endpoint",syncRegion:"Region",syncCredentialRef:"凭据引用名",syncCredentialValue:"凭据值",syncStatus:"状态",syncLastSync:"上次同步",syncNextSync:"下次同步",syncStatusLabel:"状态",syncPulled:"拉取记录",syncUploaded:"上传记录",syncCountHint:"显示最近一次同步处理的用量记录数。",syncError:"错误",syncDuration:"耗时",syncNow:"立即同步",syncNever:"从未",syncUnsavedHint:"请先保存同步配置,再点击立即同步。",autoSync:"自动同步",syncFrequency:"每隔",syncMinutes:"分钟",syncHour:"小时",syncHours:"小时",credentialSet:"已设置,留空则不修改",credentialNotSet:"未设置",credentialStoredAs:"存储为",syncRepoRequired:"GitHub 同步需要填写仓库。",syncRepoInvalid:"仓库必须使用 owner/repo 格式。",syncGithubTokenRequired:"GitHub 同步需要填写 GitHub Token。",syncBucketRequired:"S3 同步需要填写存储桶。",syncS3AccessKeyRequired:"S3 同步需要填写 Access Key ID。",syncS3SecretKeyRequired:"S3 同步需要填写 Secret Access Key。",showCredential:"显示",hideCredential:"隐藏",currency:"货币",displayCurrency:"显示货币",exchangeRate:"汇率",exchangeRateHint:"留空使用自动获取的汇率",refreshRate:"刷新",rateLastUpdated:"上次更新"},home:{counterLabel:"AI Token 消耗",cfgTitle:"显示配置",timeRange:"时间范围",numFormat:"数字格式",numExact:"精确",numExactEx:"1,234,567",numShort:"简短",numShortEx:"1.234M",nextRefresh:"下次刷新",seconds:"s",refreshing:"刷新中…",manualMode:"手动模式",refreshNow:"↺ 立即",refreshBtn:"↺ 刷新",refreshInfo:"刷新间隔在",input:"输入",output:"输出",cache:"缓存",quotaWarning:"配额警告",quotaWarningDesc:"配额已使用",quotaWarningLink:"查看配额"},quotas:{title:"配额",desc:"各 AI 工具的官方订阅配额使用情况。",refresh:"刷新",refreshing:"刷新中...",lastUpdated:"更新于",never:"从未",noCredentials:"未找到凭据",noCredentialsHint:"请先用 AI 工具的 CLI 登录,以启用配额追踪。",expired:"凭据已过期",expiredHint:"请重新使用 CLI 登录以刷新凭据。",queryFailed:"查询失败",noTiers:"暂无配额数据",fiveHour:"5 小时窗口",sevenDay:"7 天窗口",sevenDayOpus:"7 天 Opus",sevenDaySonnet:"7 天 Sonnet",sevenDayOmelette:"7 天 Design",weeklyLimit:"每周限额",resetsIn:"{time} 后重置",toolLabels:{"claude-code":"Claude Code",codex:"Codex(OpenAI)"}},leaderboard:{title:"排行榜",desc:"管理排行榜登录与上传。公开排名在官网查看。",publicView:"公开浏览",privacyTitle:"上传内容",account:"账号",device:"设备",authorizedDevice:"已授权设备",authorizedAt:"授权时间",uploadStatus:"上传状态",noUploads:"暂无上传记录",noUploadTime:"暂无上传时间",nextUpload:"下次上传",afterFirstUpload:"首次上传后计算",autoUploadOff:"未开启",enableAutoUploadHint:"开启自动上传后会按频率执行",openLeaderboard:"打开公开排行榜",period:"周期",showing:"已显示",periodStart:"周期开始",user:"用户",updated:"更新",loadMore:"加载更多",loadingMore:"加载中...",noEntries:"暂无公开数据。",openSite:"打开排行榜",authTitle:"上传账号",loggedIn:"CLI 与界面已登录",notLoggedIn:"未授权",webLoginHint:"可直接在浏览器授权,本地 CLI 会使用同一份凭证。",loginInWeb:"在本机登录",authorizing:"授权中...",uploadInWeb:"上传数据",uploading:"上传中...",autoUpload:"自动上传",autoUploadHint:"本地服务会定时解析并上传聚合总量。",autoUploadRequiresLogin:"请先在本机登录后再开启自动上传。",uploadEvery:"频率",autoUploadIntervals:{daily:"每天",weekly:"每周",monthly:"每月"},uploadLimits:"上传限制",uploadLimitsSummary:"每个频率周期最多自动上传一次。每次只提交聚合总量。",uploadResult:"上传结果",uploadResultHint:"已接受 / 待审核 / 已拒绝",uploadSuccess:"上传成功",logout:"退出本机登录",verifyCode:"验证码",openVerify:"打开授权页面",lastUpload:"最近上传",privacy:"上传内容仅包含聚合 Token 总量。prompt、completion、源码、文件路径、模型分布、项目数据和本地费用估算不会进入排行榜 payload。",periods:{daily:"今日",weekly:"本周",monthly:"本月",yearly:"今年",all_time:"累计"}},auth:{locked:"仪表盘已锁定",lockedHint:"请输入仪表盘密码以查看此页面。",unlock:"解锁",unlocking:"解锁中...",unlockDashboard:"解锁仪表盘",unlockHint:"请输入仪表盘密码以显示导航和受保护的页面。",password:"密码",backHome:"返回公开首页",checking:"正在检查访问权限...",loginFailed:"登录失败"},support:{title:"服务与支持",desc:"产品问题、使用支持和社区交流的稳定联系方式。",personal:"直接联系",community:"社区",wechat:"微信",wechatHint:"扫码添加时请备注来意,可咨询使用问题、反馈建议或加入交流群。",qrExpand:"点击放大二维码",qrScanHint:"使用微信扫码添加",email:"邮件",discord:"Discord",discordHint:"加入社区,交流使用心得、获取帮助。",telegram:"Telegram",telegramHint:"获取更新通知,参与讨论。",open:"打开"}}};function c(){return typeof window>"u"?"en":localStorage.getItem("aiusage-lang")||"en"}const s=r(c());function p(){s.update(o=>{const t=o==="en"?"zh":"en";return typeof window<"u"&&localStorage.setItem("aiusage-lang",t),t})}const y=d(s,o=>{const t=n[o]||n.en;return a=>{const i=a.split(".");let e=t;for(const l of i)e=e==null?void 0:e[l];return e||a}});export{p as a,s as l,y as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as t}from"../chunks/entry.PDoHFbXz.js";export{t as start};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{s as ms,n as Gt,c as Ss,o as Es,e as Is,r as ul,d as rl}from"../chunks/scheduler.DsWd5xup.js";import{S as Cs,i as Ds,d as o,s as I,a as w,b as a,o as i,p as Ns,g as C,c as d,e as _,f as y,r as Ct,j as D,h as v,t as m,B as ol,D as qt,v as yl,A as fe,y as Pt,z as tt,w as be,x as As,C as kt}from"../chunks/index.66Vu9Sio.js";import{a as Ps,v as ws,w as Ts,x as Vs,c as Gl,y as Rs,z as Bs,A as gl,e as Yt}from"../chunks/api.Mv_KcGhp.js";import{t as Ls}from"../chunks/i18n.CwV3KceS.js";import{g as Os,e as kl}from"../chunks/stores.BSI_cVy6.js";function Yl(s,t,e){const l=s.slice();return l[85]=t[e],l}function jl(s,t,e){const l=s.slice();return l[85]=t[e],l}function zl(s,t,e){const l=s.slice();return l[90]=t[e],l}function Us(s){let t,e,l,n=s[37]("settings.general")+"",u,r,c,h,b,g=s[37]("settings.device")+"",S,k,p,H,E,A,N=s[37]("settings.deviceHint")+"",R,f,j,V,B=s[37]("settings.weekStart")+"",L,te,z,ee,Y=s[37]("settings.weekStartSunday")+"",le,se,x=s[37]("settings.weekStartMonday")+"",M,O,U,Z,$=s[37]("settings.refreshInterval")+"",re,ae,J,ie,ne,q,G=s[37]("settings.retentionDays")+"",Se,ve,oe,ge,Te,Ne,he=s[37]("settings.retentionHint")+"",ce,Ue,Ee,Ie,He=s[37]("settings.displayCurrency")+"",at,K,X,pe,_e="USD ($)",Ce,Pe="CNY (¥)",ke,Re,Fe,Be,de,Le=il(s[25],s[27],s[37]("settings.save"),s[37]("settings.saved"))+"",ot,ct,lt,Ye,Ve,yt=s[37]("settings.detectedTools")+"",dt,Ke,T,W,mt=s[37]("settings.detectedToolsHint")+"",vt,At,Me,Dt,St,we,st,it=s[37]("settings.sync")+"",F,Ae,ye,De,nt,_t=s[37]("settings.syncBackend")+"",rt,Nt,Oe,pt,ue=s[37]("settings.syncBackendNone")+"",Bt,qe,jt="AIUsage Cloud",ht,Lt="GitHub",ut,ml="S3 / Compatible",fl,Vt,cl,Wt,Xt,Zt,dl,xt,Ot,bt,zt=il(s[28],s[30],s[37]("settings.save"),s[37]("settings.saved"))+"",$t,vl,_l,Sl,je=s[9].displayCurrency==="CNY"&&Jl(s),ze=s[26]&&Wl(s),Je=s[11]&&Xl(s),Ut=Yt(s[36]),Ge=[];for(let P=0;P<Ut.length;P+=1)Ge[P]=xl(jl(s,Ut,P));let Qe=s[35].length&&$l(s);function El(P,Q){return P[0].backend==="cloud"?Js:P[0].backend==="github"?zs:P[0].backend==="s3"?js:Ys}let el=El(s),gt=el(s),We=s[0].backend==="cloud"&&ss(s),Xe=s[0].backend==="github"&&ns(s),Ze=s[0].backend==="s3"&&as(s),xe=s[0].backend&&os(s),$e=s[29]&&rs(s),et=s[0].backend&&us(s);return{c(){t=v("div"),e=v("div"),l=v("div"),u=m(n),r=D(),c=v("div"),h=v("div"),b=v("label"),S=m(g),k=D(),p=v("input"),E=D(),A=v("div"),R=m(N),f=D(),j=v("div"),V=v("label"),L=m(B),te=D(),z=v("select"),ee=v("option"),le=m(Y),se=v("option"),M=m(x),O=D(),U=v("div"),Z=v("label"),re=m($),ae=D(),J=v("input"),ie=D(),ne=v("div"),q=v("label"),Se=m(G),ve=D(),oe=v("input"),Te=D(),Ne=v("div"),ce=m(he),Ue=D(),Ee=v("div"),Ie=v("label"),at=m(He),K=D(),X=v("select"),pe=v("option"),pe.textContent=_e,Ce=v("option"),Ce.textContent=Pe,ke=D(),je&&je.c(),Re=D(),ze&&ze.c(),Fe=D(),Be=v("div"),de=v("button"),ot=m(Le),ct=D(),lt=v("div"),Ye=v("div"),Ve=v("span"),dt=m(yt),Ke=D(),Je&&Je.c(),T=D(),W=v("div"),vt=m(mt),At=D(),Me=v("div");for(let P=0;P<Ge.length;P+=1)Ge[P].c();Dt=D(),Qe&&Qe.c(),St=D(),we=v("div"),st=v("div"),F=m(it),Ae=D(),ye=v("div"),De=v("div"),nt=v("label"),rt=m(_t),Nt=D(),Oe=v("select"),pt=v("option"),Bt=m(ue),qe=v("option"),qe.textContent=jt,ht=v("option"),ht.textContent=Lt,ut=v("option"),ut.textContent=ml,fl=D(),Vt=v("div"),gt.c(),cl=D(),We&&We.c(),Wt=D(),Xe&&Xe.c(),Xt=D(),Ze&&Ze.c(),Zt=D(),xe&&xe.c(),dl=D(),$e&&$e.c(),xt=D(),Ot=v("div"),bt=v("button"),$t=m(zt),vl=D(),et&&et.c(),this.h()},l(P){t=d(P,"DIV",{class:!0});var Q=_(t);e=d(Q,"DIV",{class:!0});var me=_(e);l=d(me,"DIV",{class:!0});var Jt=_(l);u=y(Jt,n),Jt.forEach(o),r=C(me),c=d(me,"DIV",{class:!0});var ft=_(c);h=d(ft,"DIV",{class:!0});var Ht=_(h);b=d(Ht,"LABEL",{class:!0,for:!0});var Il=_(b);S=y(Il,g),Il.forEach(o),k=C(Ht),p=d(Ht,"INPUT",{id:!0,type:!0,class:!0,placeholder:!0}),E=C(Ht),A=d(Ht,"DIV",{class:!0});var Cl=_(A);R=y(Cl,N),Cl.forEach(o),Ht.forEach(o),f=C(ft),j=d(ft,"DIV",{class:!0});var tl=_(j);V=d(tl,"LABEL",{class:!0,for:!0});var Dl=_(V);L=y(Dl,B),Dl.forEach(o),te=C(tl),z=d(tl,"SELECT",{id:!0,class:!0});var pl=_(z);ee=d(pl,"OPTION",{});var Nl=_(ee);le=y(Nl,Y),Nl.forEach(o),se=d(pl,"OPTION",{});var Al=_(se);M=y(Al,x),Al.forEach(o),pl.forEach(o),tl.forEach(o),O=C(ft),U=d(ft,"DIV",{class:!0});var ll=_(U);Z=d(ll,"LABEL",{class:!0,for:!0});var Pl=_(Z);re=y(Pl,$),Pl.forEach(o),ae=C(ll),J=d(ll,"INPUT",{id:!0,type:!0,class:!0,placeholder:!0,min:!0}),ll.forEach(o),ie=C(ft),ne=d(ft,"DIV",{class:!0});var Ft=_(ne);q=d(Ft,"LABEL",{class:!0,for:!0});var wl=_(q);Se=y(wl,G),wl.forEach(o),ve=C(Ft),oe=d(Ft,"INPUT",{id:!0,type:!0,class:!0,placeholder:!0,min:!0}),Te=C(Ft),Ne=d(Ft,"DIV",{class:!0});var Tl=_(Ne);ce=y(Tl,he),Tl.forEach(o),Ft.forEach(o),Ue=C(ft),Ee=d(ft,"DIV",{class:!0});var sl=_(Ee);Ie=d(sl,"LABEL",{class:!0,for:!0});var Vl=_(Ie);at=y(Vl,He),Vl.forEach(o),K=C(sl),X=d(sl,"SELECT",{id:!0,class:!0});var hl=_(X);pe=d(hl,"OPTION",{"data-svelte-h":!0}),kt(pe)!=="svelte-wl8sxv"&&(pe.textContent=_e),Ce=d(hl,"OPTION",{"data-svelte-h":!0}),kt(Ce)!=="svelte-1hbzyw4"&&(Ce.textContent=Pe),hl.forEach(o),sl.forEach(o),ke=C(ft),je&&je.l(ft),ft.forEach(o),Re=C(me),ze&&ze.l(me),Fe=C(me),Be=d(me,"DIV",{class:!0});var Rl=_(Be);de=d(Rl,"BUTTON",{class:!0});var Bl=_(de);ot=y(Bl,Le),Bl.forEach(o),Rl.forEach(o),me.forEach(o),ct=C(Q),lt=d(Q,"DIV",{class:!0});var Kt=_(lt);Ye=d(Kt,"DIV",{class:!0});var nl=_(Ye);Ve=d(nl,"SPAN",{class:!0});var Ll=_(Ve);dt=y(Ll,yt),Ll.forEach(o),Ke=C(nl),Je&&Je.l(nl),nl.forEach(o),T=C(Kt),W=d(Kt,"DIV",{class:!0,style:!0});var Ol=_(W);vt=y(Ol,mt),Ol.forEach(o),At=C(Kt),Me=d(Kt,"DIV",{class:!0});var al=_(Me);for(let bl=0;bl<Ge.length;bl+=1)Ge[bl].l(al);Dt=C(al),Qe&&Qe.l(al),al.forEach(o),Kt.forEach(o),St=C(Q),we=d(Q,"DIV",{class:!0});var Et=_(we);st=d(Et,"DIV",{class:!0});var Ul=_(st);F=y(Ul,it),Ul.forEach(o),Ae=C(Et),ye=d(Et,"DIV",{class:!0});var It=_(ye);De=d(It,"DIV",{class:!0});var Mt=_(De);nt=d(Mt,"LABEL",{class:!0,for:!0});var Hl=_(nt);rt=y(Hl,_t),Hl.forEach(o),Nt=C(Mt),Oe=d(Mt,"SELECT",{id:!0,class:!0});var Qt=_(Oe);pt=d(Qt,"OPTION",{});var Fl=_(pt);Bt=y(Fl,ue),Fl.forEach(o),qe=d(Qt,"OPTION",{"data-svelte-h":!0}),kt(qe)!=="svelte-f8k0g3"&&(qe.textContent=jt),ht=d(Qt,"OPTION",{"data-svelte-h":!0}),kt(ht)!=="svelte-qlpbhy"&&(ht.textContent=Lt),ut=d(Qt,"OPTION",{"data-svelte-h":!0}),kt(ut)!=="svelte-1tn9oy9"&&(ut.textContent=ml),Qt.forEach(o),fl=C(Mt),Vt=d(Mt,"DIV",{class:!0});var Kl=_(Vt);gt.l(Kl),Kl.forEach(o),Mt.forEach(o),cl=C(It),We&&We.l(It),Wt=C(It),Xe&&Xe.l(It),Xt=C(It),Ze&&Ze.l(It),Zt=C(It),xe&&xe.l(It),It.forEach(o),dl=C(Et),$e&&$e.l(Et),xt=C(Et),Ot=d(Et,"DIV",{class:!0});var Ml=_(Ot);bt=d(Ml,"BUTTON",{class:!0});var ql=_(bt);$t=y(ql,zt),ql.forEach(o),Ml.forEach(o),vl=C(Et),et&&et.l(Et),Et.forEach(o),Q.forEach(o),this.h()},h(){i(l,"class","group-title svelte-o8xfsv"),i(b,"class","field-label svelte-o8xfsv"),i(b,"for","field-device"),i(p,"id","field-device"),i(p,"type","text"),i(p,"class","field-input svelte-o8xfsv"),i(p,"placeholder",H=s[12]||"hostname"),i(A,"class","field-hint svelte-o8xfsv"),i(h,"class","field svelte-o8xfsv"),i(V,"class","field-label svelte-o8xfsv"),i(V,"for","field-week-start"),ee.__value=0,fe(ee,ee.__value),se.__value=1,fe(se,se.__value),i(z,"id","field-week-start"),i(z,"class","field-input svelte-o8xfsv"),s[9].weekStart===void 0&&rl(()=>s[56].call(z)),i(j,"class","field svelte-o8xfsv"),i(Z,"class","field-label svelte-o8xfsv"),i(Z,"for","field-refresh-interval"),i(J,"id","field-refresh-interval"),i(J,"type","number"),i(J,"class","field-input svelte-o8xfsv"),i(J,"placeholder","e.g. 30000"),i(J,"min","1000"),i(U,"class","field svelte-o8xfsv"),i(q,"class","field-label svelte-o8xfsv"),i(q,"for","field-retention-days"),i(oe,"id","field-retention-days"),i(oe,"type","number"),i(oe,"class","field-input svelte-o8xfsv"),i(oe,"placeholder",ge=s[37]("settings.retentionPlaceholder")),i(oe,"min","0"),i(Ne,"class","field-hint svelte-o8xfsv"),i(ne,"class","field svelte-o8xfsv"),i(Ie,"class","field-label svelte-o8xfsv"),i(Ie,"for","field-display-currency"),pe.__value="USD",fe(pe,pe.__value),Ce.__value="CNY",fe(Ce,Ce.__value),i(X,"id","field-display-currency"),i(X,"class","field-input svelte-o8xfsv"),s[9].displayCurrency===void 0&&rl(()=>s[59].call(X)),i(Ee,"class","field svelte-o8xfsv"),i(c,"class","fields svelte-o8xfsv"),i(de,"class","btn-save svelte-o8xfsv"),de.disabled=s[25],tt(de,"saved",s[27]),i(Be,"class","section-footer svelte-o8xfsv"),i(e,"class","card svelte-o8xfsv"),i(Ve,"class","group-title svelte-o8xfsv"),i(Ye,"class","group-title-row svelte-o8xfsv"),i(W,"class","field-hint svelte-o8xfsv"),As(W,"margin-bottom","0.5rem"),i(Me,"class","detected-tools-list svelte-o8xfsv"),i(lt,"class","card svelte-o8xfsv"),i(st,"class","group-title svelte-o8xfsv"),i(nt,"class","field-label svelte-o8xfsv"),i(nt,"for","field-sync-backend"),pt.__value="",fe(pt,pt.__value),qe.__value="cloud",fe(qe,qe.__value),ht.__value="github",fe(ht,ht.__value),ut.__value="s3",fe(ut,ut.__value),i(Oe,"id","field-sync-backend"),i(Oe,"class","field-input svelte-o8xfsv"),s[0].backend===void 0&&rl(()=>s[62].call(Oe)),i(Vt,"class","field-hint svelte-o8xfsv"),i(De,"class","field full svelte-o8xfsv"),i(ye,"class","fields svelte-o8xfsv"),i(bt,"class","btn-save svelte-o8xfsv"),bt.disabled=s[28],tt(bt,"saved",s[30]),i(Ot,"class","section-footer svelte-o8xfsv"),i(we,"class","card sync-card svelte-o8xfsv"),i(t,"class","sections svelte-o8xfsv")},m(P,Q){w(P,t,Q),a(t,e),a(e,l),a(l,u),a(e,r),a(e,c),a(c,h),a(h,b),a(b,S),a(h,k),a(h,p),fe(p,s[9].device),a(h,E),a(h,A),a(A,R),a(c,f),a(c,j),a(j,V),a(V,L),a(j,te),a(j,z),a(z,ee),a(ee,le),a(z,se),a(se,M),Pt(z,s[9].weekStart,!0),a(c,O),a(c,U),a(U,Z),a(Z,re),a(U,ae),a(U,J),fe(J,s[9].refreshInterval),a(c,ie),a(c,ne),a(ne,q),a(q,Se),a(ne,ve),a(ne,oe),fe(oe,s[9].retentionDays),a(ne,Te),a(ne,Ne),a(Ne,ce),a(c,Ue),a(c,Ee),a(Ee,Ie),a(Ie,at),a(Ee,K),a(Ee,X),a(X,pe),a(X,Ce),Pt(X,s[9].displayCurrency,!0),a(c,ke),je&&je.m(c,null),a(e,Re),ze&&ze.m(e,null),a(e,Fe),a(e,Be),a(Be,de),a(de,ot),a(t,ct),a(t,lt),a(lt,Ye),a(Ye,Ve),a(Ve,dt),a(Ye,Ke),Je&&Je.m(Ye,null),a(lt,T),a(lt,W),a(W,vt),a(lt,At),a(lt,Me);for(let me=0;me<Ge.length;me+=1)Ge[me]&&Ge[me].m(Me,null);a(Me,Dt),Qe&&Qe.m(Me,null),a(t,St),a(t,we),a(we,st),a(st,F),a(we,Ae),a(we,ye),a(ye,De),a(De,nt),a(nt,rt),a(De,Nt),a(De,Oe),a(Oe,pt),a(pt,Bt),a(Oe,qe),a(Oe,ht),a(Oe,ut),Pt(Oe,s[0].backend,!0),a(De,fl),a(De,Vt),gt.m(Vt,null),a(ye,cl),We&&We.m(ye,null),a(ye,Wt),Xe&&Xe.m(ye,null),a(ye,Xt),Ze&&Ze.m(ye,null),a(ye,Zt),xe&&xe.m(ye,null),a(we,dl),$e&&$e.m(we,null),a(we,xt),a(we,Ot),a(Ot,bt),a(bt,$t),a(we,vl),et&&et.m(we,null),_l||(Sl=[be(p,"input",s[55]),be(z,"change",s[56]),be(J,"input",s[57]),be(oe,"input",s[58]),be(X,"change",s[59]),be(de,"click",s[44]),be(Oe,"change",s[62]),be(Oe,"change",s[39]),be(bt,"click",s[45])],_l=!0)},p(P,Q){if(Q[1]&64&&n!==(n=P[37]("settings.general")+"")&&I(u,n),Q[1]&64&&g!==(g=P[37]("settings.device")+"")&&I(S,g),Q[0]&4096&&H!==(H=P[12]||"hostname")&&i(p,"placeholder",H),Q[0]&512&&p.value!==P[9].device&&fe(p,P[9].device),Q[1]&64&&N!==(N=P[37]("settings.deviceHint")+"")&&I(R,N),Q[1]&64&&B!==(B=P[37]("settings.weekStart")+"")&&I(L,B),Q[1]&64&&Y!==(Y=P[37]("settings.weekStartSunday")+"")&&I(le,Y),Q[1]&64&&x!==(x=P[37]("settings.weekStartMonday")+"")&&I(M,x),Q[0]&512&&Pt(z,P[9].weekStart),Q[1]&64&&$!==($=P[37]("settings.refreshInterval")+"")&&I(re,$),Q[0]&512&&qt(J.value)!==P[9].refreshInterval&&fe(J,P[9].refreshInterval),Q[1]&64&&G!==(G=P[37]("settings.retentionDays")+"")&&I(Se,G),Q[1]&64&&ge!==(ge=P[37]("settings.retentionPlaceholder"))&&i(oe,"placeholder",ge),Q[0]&512&&qt(oe.value)!==P[9].retentionDays&&fe(oe,P[9].retentionDays),Q[1]&64&&he!==(he=P[37]("settings.retentionHint")+"")&&I(ce,he),Q[1]&64&&He!==(He=P[37]("settings.displayCurrency")+"")&&I(at,He),Q[0]&512&&Pt(X,P[9].displayCurrency),P[9].displayCurrency==="CNY"?je?je.p(P,Q):(je=Jl(P),je.c(),je.m(c,null)):je&&(je.d(1),je=null),P[26]?ze?ze.p(P,Q):(ze=Wl(P),ze.c(),ze.m(e,Fe)):ze&&(ze.d(1),ze=null),Q[0]&167772160|Q[1]&64&&Le!==(Le=il(P[25],P[27],P[37]("settings.save"),P[37]("settings.saved"))+"")&&I(ot,Le),Q[0]&33554432&&(de.disabled=P[25]),Q[0]&134217728&&tt(de,"saved",P[27]),Q[1]&64&&yt!==(yt=P[37]("settings.detectedTools")+"")&&I(dt,yt),P[11]?Je?Je.p(P,Q):(Je=Xl(P),Je.c(),Je.m(Ye,null)):Je&&(Je.d(1),Je=null),Q[1]&64&&mt!==(mt=P[37]("settings.detectedToolsHint")+"")&&I(vt,mt),Q[1]&96){Ut=Yt(P[36]);let me;for(me=0;me<Ut.length;me+=1){const Jt=jl(P,Ut,me);Ge[me]?Ge[me].p(Jt,Q):(Ge[me]=xl(Jt),Ge[me].c(),Ge[me].m(Me,Dt))}for(;me<Ge.length;me+=1)Ge[me].d(1);Ge.length=Ut.length}P[35].length?Qe?Qe.p(P,Q):(Qe=$l(P),Qe.c(),Qe.m(Me,null)):Qe&&(Qe.d(1),Qe=null),Q[1]&64&&it!==(it=P[37]("settings.sync")+"")&&I(F,it),Q[1]&64&&_t!==(_t=P[37]("settings.syncBackend")+"")&&I(rt,_t),Q[1]&64&&ue!==(ue=P[37]("settings.syncBackendNone")+"")&&I(Bt,ue),Q[0]&1&&Pt(Oe,P[0].backend),el===(el=El(P))&>?gt.p(P,Q):(gt.d(1),gt=el(P),gt&&(gt.c(),gt.m(Vt,null))),P[0].backend==="cloud"?We?We.p(P,Q):(We=ss(P),We.c(),We.m(ye,Wt)):We&&(We.d(1),We=null),P[0].backend==="github"?Xe?Xe.p(P,Q):(Xe=ns(P),Xe.c(),Xe.m(ye,Xt)):Xe&&(Xe.d(1),Xe=null),P[0].backend==="s3"?Ze?Ze.p(P,Q):(Ze=as(P),Ze.c(),Ze.m(ye,Zt)):Ze&&(Ze.d(1),Ze=null),P[0].backend?xe?xe.p(P,Q):(xe=os(P),xe.c(),xe.m(ye,null)):xe&&(xe.d(1),xe=null),P[29]?$e?$e.p(P,Q):($e=rs(P),$e.c(),$e.m(we,xt)):$e&&($e.d(1),$e=null),Q[0]&1342177280|Q[1]&64&&zt!==(zt=il(P[28],P[30],P[37]("settings.save"),P[37]("settings.saved"))+"")&&I($t,zt),Q[0]&268435456&&(bt.disabled=P[28]),Q[0]&1073741824&&tt(bt,"saved",P[30]),P[0].backend?et?et.p(P,Q):(et=us(P),et.c(),et.m(we,null)):et&&(et.d(1),et=null)},d(P){P&&o(t),je&&je.d(),ze&&ze.d(),Je&&Je.d(),yl(Ge,P),Qe&&Qe.d(),gt.d(),We&&We.d(),Xe&&Xe.d(),Ze&&Ze.d(),xe&&xe.d(),$e&&$e.d(),et&&et.d(),_l=!1,ul(Sl)}}}function Hs(s){let t,e;return{c(){t=v("div"),e=m(s[8]),this.h()},l(l){t=d(l,"DIV",{class:!0});var n=_(t);e=y(n,s[8]),n.forEach(o),this.h()},h(){i(t,"class","state-msg error svelte-o8xfsv")},m(l,n){w(l,t,n),a(t,e)},p(l,n){n[0]&256&&I(e,l[8])},d(l){l&&o(t)}}}function Fs(s){let t,e=s[37]("common.loading")+"",l;return{c(){t=v("div"),l=m(e),this.h()},l(n){t=d(n,"DIV",{class:!0});var u=_(t);l=y(u,e),u.forEach(o),this.h()},h(){i(t,"class","state-msg svelte-o8xfsv")},m(n,u){w(n,t,u),a(t,l)},p(n,u){u[1]&64&&e!==(e=n[37]("common.loading")+"")&&I(l,e)},d(n){n&&o(t)}}}function Jl(s){let t,e,l=s[37]("settings.exchangeRate")+"",n,u,r,c,h,b,g,S,k=(s[24]?"...":s[37]("settings.refreshRate"))+"",p,H,E,A=s[37]("settings.exchangeRateHint")+"",N,R,f,j,V=s[32]&&Ql(s);return{c(){t=v("div"),e=v("label"),n=m(l),u=m(" (1 USD = ? CNY)"),r=D(),c=v("div"),h=v("input"),g=D(),S=v("button"),p=m(k),H=D(),E=v("div"),N=m(A),R=D(),V&&V.c(),this.h()},l(B){t=d(B,"DIV",{class:!0});var L=_(t);e=d(L,"LABEL",{class:!0,for:!0});var te=_(e);n=y(te,l),u=y(te," (1 USD = ? CNY)"),te.forEach(o),r=C(L),c=d(L,"DIV",{class:!0});var z=_(c);h=d(z,"INPUT",{id:!0,type:!0,step:!0,min:!0,class:!0,placeholder:!0}),g=C(z),S=d(z,"BUTTON",{type:!0,class:!0});var ee=_(S);p=y(ee,k),ee.forEach(o),z.forEach(o),H=C(L),E=d(L,"DIV",{class:!0});var Y=_(E);N=y(Y,A),R=C(Y),V&&V.l(Y),Y.forEach(o),L.forEach(o),this.h()},h(){i(e,"class","field-label svelte-o8xfsv"),i(e,"for","field-exchange-rate"),i(h,"id","field-exchange-rate"),i(h,"type","number"),i(h,"step","0.01"),i(h,"min","0"),i(h,"class","field-input svelte-o8xfsv"),i(h,"placeholder",b="Auto: "+s[33]),i(S,"type","button"),i(S,"class","btn-ghost svelte-o8xfsv"),S.disabled=s[24],i(c,"class","rate-row svelte-o8xfsv"),i(E,"class","field-hint svelte-o8xfsv"),i(t,"class","field svelte-o8xfsv")},m(B,L){w(B,t,L),a(t,e),a(e,n),a(e,u),a(t,r),a(t,c),a(c,h),fe(h,s[9].exchangeRate),a(c,g),a(c,S),a(S,p),a(t,H),a(t,E),a(E,N),a(E,R),V&&V.m(E,null),f||(j=[be(h,"input",s[60]),be(S,"click",s[46])],f=!0)},p(B,L){L[1]&64&&l!==(l=B[37]("settings.exchangeRate")+"")&&I(n,l),L[1]&4&&b!==(b="Auto: "+B[33])&&i(h,"placeholder",b),L[0]&512&&qt(h.value)!==B[9].exchangeRate&&fe(h,B[9].exchangeRate),L[0]&16777216|L[1]&64&&k!==(k=(B[24]?"...":B[37]("settings.refreshRate"))+"")&&I(p,k),L[0]&16777216&&(S.disabled=B[24]),L[1]&64&&A!==(A=B[37]("settings.exchangeRateHint")+"")&&I(N,A),B[32]?V?V.p(B,L):(V=Ql(B),V.c(),V.m(E,null)):V&&(V.d(1),V=null)},d(B){B&&o(t),V&&V.d(),f=!1,ul(j)}}}function Ql(s){let t,e=s[37]("settings.rateLastUpdated")+"",l,n,u;return{c(){t=v("span"),l=m(e),n=m(": "),u=m(s[32]),this.h()},l(r){t=d(r,"SPAN",{class:!0});var c=_(t);l=y(c,e),n=y(c,": "),u=y(c,s[32]),c.forEach(o),this.h()},h(){i(t,"class","rate-time svelte-o8xfsv")},m(r,c){w(r,t,c),a(t,l),a(t,n),a(t,u)},p(r,c){c[1]&64&&e!==(e=r[37]("settings.rateLastUpdated")+"")&&I(l,e),c[1]&2&&I(u,r[32])},d(r){r&&o(t)}}}function Wl(s){let t,e;return{c(){t=v("p"),e=m(s[26]),this.h()},l(l){t=d(l,"P",{class:!0});var n=_(t);e=y(n,s[26]),n.forEach(o),this.h()},h(){i(t,"class","section-error svelte-o8xfsv")},m(l,n){w(l,t,n),a(t,e)},p(l,n){n[0]&67108864&&I(e,l[26])},d(l){l&&o(t)}}}function Xl(s){let t,e=(s[38][s[11]]??s[11])+"",l;return{c(){t=v("span"),l=m(e),this.h()},l(n){t=d(n,"SPAN",{class:!0});var u=_(t);l=y(u,e),u.forEach(o),this.h()},h(){i(t,"class","platform-badge svelte-o8xfsv")},m(n,u){w(n,t,u),a(t,l)},p(n,u){u[0]&2048&&e!==(e=(n[38][n[11]]??n[11])+"")&&I(l,e)},d(n){n&&o(t)}}}function Ks(s){let t=s[37]("settings.toolEmpty")+"",e;return{c(){e=m(t)},l(l){e=y(l,t)},m(l,n){w(l,e,n)},p(l,n){n[1]&64&&t!==(t=l[37]("settings.toolEmpty")+"")&&I(e,t)},d(l){l&&o(e)}}}function Ms(s){let t=s[37]("settings.toolFound")+"",e,l,n=s[85].fileCount+"",u,r,c=s[37]("settings.toolFiles")+"",h;return{c(){e=m(t),l=m(" · "),u=m(n),r=D(),h=m(c)},l(b){e=y(b,t),l=y(b," · "),u=y(b,n),r=C(b),h=y(b,c)},m(b,g){w(b,e,g),w(b,l,g),w(b,u,g),w(b,r,g),w(b,h,g)},p(b,g){g[1]&64&&t!==(t=b[37]("settings.toolFound")+"")&&I(e,t),g[1]&32&&n!==(n=b[85].fileCount+"")&&I(u,n),g[1]&64&&c!==(c=b[37]("settings.toolFiles")+"")&&I(h,c)},d(b){b&&(o(e),o(l),o(u),o(r),o(h))}}}function qs(s){let t,e=s[85].path+"",l;return{c(){t=v("div"),l=m(e),this.h()},l(n){t=d(n,"DIV",{class:!0});var u=_(t);l=y(u,e),u.forEach(o),this.h()},h(){i(t,"class","detected-tool-path svelte-o8xfsv")},m(n,u){w(n,t,u),a(t,l)},p(n,u){u[1]&32&&e!==(e=n[85].path+"")&&I(l,e)},d(n){n&&o(t)}}}function Gs(s){let t,e=Yt(s[85].paths),l=[];for(let n=0;n<e.length;n+=1)l[n]=Zl(zl(s,e,n));return{c(){for(let n=0;n<l.length;n+=1)l[n].c();t=Ct()},l(n){for(let u=0;u<l.length;u+=1)l[u].l(n);t=Ct()},m(n,u){for(let r=0;r<l.length;r+=1)l[r]&&l[r].m(n,u);w(n,t,u)},p(n,u){if(u[1]&32){e=Yt(n[85].paths);let r;for(r=0;r<e.length;r+=1){const c=zl(n,e,r);l[r]?l[r].p(c,u):(l[r]=Zl(c),l[r].c(),l[r].m(t.parentNode,t))}for(;r<l.length;r+=1)l[r].d(1);l.length=e.length}},d(n){n&&o(t),yl(l,n)}}}function Zl(s){let t,e=s[90]+"",l;return{c(){t=v("div"),l=m(e),this.h()},l(n){t=d(n,"DIV",{class:!0});var u=_(t);l=y(u,e),u.forEach(o),this.h()},h(){i(t,"class","detected-tool-path svelte-o8xfsv")},m(n,u){w(n,t,u),a(t,l)},p(n,u){u[1]&32&&e!==(e=n[90]+"")&&I(l,e)},d(n){n&&o(t)}}}function xl(s){let t,e,l,n,u,r=s[85].label+"",c,h,b,g;function S(N,R){return N[85].status==="found"?Ms:Ks}let k=S(s),p=k(s);function H(N,R){var f;if((f=N[85].paths)!=null&&f.length)return Gs;if(N[85].path)return qs}let E=H(s),A=E&&E(s);return{c(){t=v("div"),e=v("div"),l=v("span"),n=D(),u=v("span"),c=m(r),h=D(),b=v("span"),p.c(),g=D(),A&&A.c(),this.h()},l(N){t=d(N,"DIV",{class:!0});var R=_(t);e=d(R,"DIV",{class:!0});var f=_(e);l=d(f,"SPAN",{class:!0}),_(l).forEach(o),n=C(f),u=d(f,"SPAN",{class:!0});var j=_(u);c=y(j,r),j.forEach(o),h=C(f),b=d(f,"SPAN",{class:!0});var V=_(b);p.l(V),V.forEach(o),f.forEach(o),g=C(R),A&&A.l(R),R.forEach(o),this.h()},h(){i(l,"class","status-dot svelte-o8xfsv"),tt(l,"green",s[85].status==="found"),tt(l,"yellow",s[85].status==="empty"),i(u,"class","detected-tool-name svelte-o8xfsv"),i(b,"class","detected-tool-status svelte-o8xfsv"),i(e,"class","detected-tool-header svelte-o8xfsv"),i(t,"class","detected-tool svelte-o8xfsv")},m(N,R){w(N,t,R),a(t,e),a(e,l),a(e,n),a(e,u),a(u,c),a(e,h),a(e,b),p.m(b,null),a(t,g),A&&A.m(t,null)},p(N,R){R[1]&32&&tt(l,"green",N[85].status==="found"),R[1]&32&&tt(l,"yellow",N[85].status==="empty"),R[1]&32&&r!==(r=N[85].label+"")&&I(c,r),k===(k=S(N))&&p?p.p(N,R):(p.d(1),p=k(N),p&&(p.c(),p.m(b,null))),E===(E=H(N))&&A?A.p(N,R):(A&&A.d(1),A=E&&E(N),A&&(A.c(),A.m(t,null)))},d(N){N&&o(t),p.d(),A&&A.d()}}}function $l(s){let t,e,l="▶",n,u=s[37]("settings.toolNotFound")+"",r,c,h=s[35].length+"",b,g,S,k,p,H,E=s[10]&&es(s);return{c(){t=v("button"),e=v("span"),e.textContent=l,n=D(),r=m(u),c=m(" ("),b=m(h),g=m(")"),S=D(),E&&E.c(),k=Ct(),this.h()},l(A){t=d(A,"BUTTON",{class:!0});var N=_(t);e=d(N,"SPAN",{class:!0,"data-svelte-h":!0}),kt(e)!=="svelte-r28k9s"&&(e.textContent=l),n=C(N),r=y(N,u),c=y(N," ("),b=y(N,h),g=y(N,")"),N.forEach(o),S=C(A),E&&E.l(A),k=Ct(),this.h()},h(){i(e,"class","not-found-chevron svelte-o8xfsv"),tt(e,"open",s[10]),i(t,"class","not-found-toggle svelte-o8xfsv")},m(A,N){w(A,t,N),a(t,e),a(t,n),a(t,r),a(t,c),a(t,b),a(t,g),w(A,S,N),E&&E.m(A,N),w(A,k,N),p||(H=be(t,"click",s[61]),p=!0)},p(A,N){N[0]&1024&&tt(e,"open",A[10]),N[1]&64&&u!==(u=A[37]("settings.toolNotFound")+"")&&I(r,u),N[1]&16&&h!==(h=A[35].length+"")&&I(b,h),A[10]?E?E.p(A,N):(E=es(A),E.c(),E.m(k.parentNode,k)):E&&(E.d(1),E=null)},d(A){A&&(o(t),o(S),o(k)),E&&E.d(A),p=!1,H()}}}function es(s){let t,e=Yt(s[35]),l=[];for(let n=0;n<e.length;n+=1)l[n]=ls(Yl(s,e,n));return{c(){for(let n=0;n<l.length;n+=1)l[n].c();t=Ct()},l(n){for(let u=0;u<l.length;u+=1)l[u].l(n);t=Ct()},m(n,u){for(let r=0;r<l.length;r+=1)l[r]&&l[r].m(n,u);w(n,t,u)},p(n,u){if(u[1]&16){e=Yt(n[35]);let r;for(r=0;r<e.length;r+=1){const c=Yl(n,e,r);l[r]?l[r].p(c,u):(l[r]=ls(c),l[r].c(),l[r].m(t.parentNode,t))}for(;r<l.length;r+=1)l[r].d(1);l.length=e.length}},d(n){n&&o(t),yl(l,n)}}}function ts(s){let t,e=s[85].path+"",l;return{c(){t=v("div"),l=m(e),this.h()},l(n){t=d(n,"DIV",{class:!0});var u=_(t);l=y(u,e),u.forEach(o),this.h()},h(){i(t,"class","detected-tool-path svelte-o8xfsv")},m(n,u){w(n,t,u),a(t,l)},p(n,u){u[1]&16&&e!==(e=n[85].path+"")&&I(l,e)},d(n){n&&o(t)}}}function ls(s){let t,e,l,n,u,r=s[85].label+"",c,h,b,g=s[85].path&&ts(s);return{c(){t=v("div"),e=v("div"),l=v("span"),n=D(),u=v("span"),c=m(r),h=D(),g&&g.c(),b=D(),this.h()},l(S){t=d(S,"DIV",{class:!0});var k=_(t);e=d(k,"DIV",{class:!0});var p=_(e);l=d(p,"SPAN",{class:!0}),_(l).forEach(o),n=C(p),u=d(p,"SPAN",{class:!0});var H=_(u);c=y(H,r),H.forEach(o),p.forEach(o),h=C(k),g&&g.l(k),b=C(k),k.forEach(o),this.h()},h(){i(l,"class","status-dot gray svelte-o8xfsv"),i(u,"class","detected-tool-name svelte-o8xfsv"),i(e,"class","detected-tool-header svelte-o8xfsv"),i(t,"class","detected-tool not-found svelte-o8xfsv")},m(S,k){w(S,t,k),a(t,e),a(e,l),a(e,n),a(e,u),a(u,c),a(t,h),g&&g.m(t,null),a(t,b)},p(S,k){k[1]&16&&r!==(r=S[85].label+"")&&I(c,r),S[85].path?g?g.p(S,k):(g=ts(S),g.c(),g.m(t,b)):g&&(g.d(1),g=null)},d(S){S&&o(t),g&&g.d()}}}function Ys(s){let t=s[37]("settings.syncBackendNoneDesc")+"",e;return{c(){e=m(t)},l(l){e=y(l,t)},m(l,n){w(l,e,n)},p(l,n){n[1]&64&&t!==(t=l[37]("settings.syncBackendNoneDesc")+"")&&I(e,t)},d(l){l&&o(e)}}}function js(s){let t=s[37]("settings.syncBackendS3Desc")+"",e;return{c(){e=m(t)},l(l){e=y(l,t)},m(l,n){w(l,e,n)},p(l,n){n[1]&64&&t!==(t=l[37]("settings.syncBackendS3Desc")+"")&&I(e,t)},d(l){l&&o(e)}}}function zs(s){let t=s[37]("settings.syncBackendGithubDesc")+"",e;return{c(){e=m(t)},l(l){e=y(l,t)},m(l,n){w(l,e,n)},p(l,n){n[1]&64&&t!==(t=l[37]("settings.syncBackendGithubDesc")+"")&&I(e,t)},d(l){l&&o(e)}}}function Js(s){let t=s[37]("settings.syncBackendCloudDesc")+"",e;return{c(){e=m(t)},l(l){e=y(l,t)},m(l,n){w(l,e,n)},p(l,n){n[1]&64&&t!==(t=l[37]("settings.syncBackendCloudDesc")+"")&&I(e,t)},d(l){l&&o(e)}}}function ss(s){let t,e,l,n=s[37]("settings.syncCloudSetup")+"",u,r,c,h,b,g="1",S,k,p,H,E=s[37]("settings.syncCloudStep1")+"",A,N,R,f,j="2",V,B,L,te,z=s[37]("settings.syncCloudStep2")+"",ee,Y,le;function se(O,U){return O[13]?Ws:Qs}let x=se(s),M=x(s);return{c(){t=v("div"),e=v("div"),l=v("div"),u=m(n),r=D(),c=v("div"),h=v("div"),b=v("span"),b.textContent=g,S=D(),k=v("div"),p=v("span"),H=v("a"),A=m(E),N=D(),R=v("div"),f=v("span"),f.textContent=j,V=D(),B=v("div"),L=v("span"),te=v("a"),ee=m(z),Y=D(),le=v("div"),M.c(),this.h()},l(O){t=d(O,"DIV",{class:!0});var U=_(t);e=d(U,"DIV",{class:!0});var Z=_(e);l=d(Z,"DIV",{class:!0});var $=_(l);u=y($,n),$.forEach(o),r=C(Z),c=d(Z,"DIV",{class:!0});var re=_(c);h=d(re,"DIV",{class:!0});var ae=_(h);b=d(ae,"SPAN",{class:!0,"data-svelte-h":!0}),kt(b)!=="svelte-mx7ifn"&&(b.textContent=g),S=C(ae),k=d(ae,"DIV",{class:!0});var J=_(k);p=d(J,"SPAN",{class:!0});var ie=_(p);H=d(ie,"A",{href:!0,target:!0,rel:!0,class:!0});var ne=_(H);A=y(ne,E),ne.forEach(o),ie.forEach(o),J.forEach(o),ae.forEach(o),N=C(re),R=d(re,"DIV",{class:!0});var q=_(R);f=d(q,"SPAN",{class:!0,"data-svelte-h":!0}),kt(f)!=="svelte-7d5r7u"&&(f.textContent=j),V=C(q),B=d(q,"DIV",{class:!0});var G=_(B);L=d(G,"SPAN",{class:!0});var Se=_(L);te=d(Se,"A",{href:!0,target:!0,rel:!0,class:!0});var ve=_(te);ee=y(ve,z),ve.forEach(o),Se.forEach(o),G.forEach(o),q.forEach(o),re.forEach(o),Z.forEach(o),Y=C(U),le=d(U,"DIV",{class:!0});var oe=_(le);M.l(oe),oe.forEach(o),U.forEach(o),this.h()},h(){i(l,"class","cloud-setup-title svelte-o8xfsv"),i(b,"class","cloud-step-num svelte-o8xfsv"),i(H,"href","https://aiusage.jtanx.com/settings#accounts"),i(H,"target","_blank"),i(H,"rel","noopener noreferrer"),i(H,"class","cloud-step-link svelte-o8xfsv"),i(p,"class","cloud-step-label svelte-o8xfsv"),i(k,"class","cloud-step-body svelte-o8xfsv"),i(h,"class","cloud-step svelte-o8xfsv"),i(f,"class","cloud-step-num svelte-o8xfsv"),i(te,"href","https://github.com/juliantanx/aiusage"),i(te,"target","_blank"),i(te,"rel","noopener noreferrer"),i(te,"class","cloud-step-link svelte-o8xfsv"),i(L,"class","cloud-step-label svelte-o8xfsv"),i(B,"class","cloud-step-body svelte-o8xfsv"),i(R,"class","cloud-step svelte-o8xfsv"),i(c,"class","cloud-steps svelte-o8xfsv"),i(e,"class","cloud-setup svelte-o8xfsv"),i(le,"class","cloud-status svelte-o8xfsv"),tt(le,"logged-in",s[13]),i(t,"class","field full svelte-o8xfsv")},m(O,U){w(O,t,U),a(t,e),a(e,l),a(l,u),a(e,r),a(e,c),a(c,h),a(h,b),a(h,S),a(h,k),a(k,p),a(p,H),a(H,A),a(c,N),a(c,R),a(R,f),a(R,V),a(R,B),a(B,L),a(L,te),a(te,ee),a(t,Y),a(t,le),M.m(le,null)},p(O,U){U[1]&64&&n!==(n=O[37]("settings.syncCloudSetup")+"")&&I(u,n),U[1]&64&&E!==(E=O[37]("settings.syncCloudStep1")+"")&&I(A,E),U[1]&64&&z!==(z=O[37]("settings.syncCloudStep2")+"")&&I(ee,z),x===(x=se(O))&&M?M.p(O,U):(M.d(1),M=x(O),M&&(M.c(),M.m(le,null))),U[0]&8192&&tt(le,"logged-in",O[13])},d(O){O&&o(t),M.d()}}}function Qs(s){let t,e,l,n=s[37]("settings.cloudNotLoggedIn")+"",u;return{c(){t=v("span"),e=D(),l=v("span"),u=m(n),this.h()},l(r){t=d(r,"SPAN",{class:!0}),_(t).forEach(o),e=C(r),l=d(r,"SPAN",{});var c=_(l);u=y(c,n),c.forEach(o),this.h()},h(){i(t,"class","status-dot svelte-o8xfsv")},m(r,c){w(r,t,c),w(r,e,c),w(r,l,c),a(l,u)},p(r,c){c[1]&64&&n!==(n=r[37]("settings.cloudNotLoggedIn")+"")&&I(u,n)},d(r){r&&(o(t),o(e),o(l))}}}function Ws(s){let t,e,l,n=s[37]("settings.cloudLoggedIn")+"",u;return{c(){t=v("span"),e=D(),l=v("span"),u=m(n),this.h()},l(r){t=d(r,"SPAN",{class:!0}),_(t).forEach(o),e=C(r),l=d(r,"SPAN",{});var c=_(l);u=y(c,n),c.forEach(o),this.h()},h(){i(t,"class","status-dot ok svelte-o8xfsv")},m(r,c){w(r,t,c),w(r,e,c),w(r,l,c),a(l,u)},p(r,c){c[1]&64&&n!==(n=r[37]("settings.cloudLoggedIn")+"")&&I(u,n)},d(r){r&&(o(t),o(e),o(l))}}}function ns(s){let t,e,l=s[37]("settings.syncRepo")+"",n,u,r,c,h,b,g="GitHub Token",S,k,p=s[37]("settings.credentialStoredAs")+"",H,E,A,N=(s[0].repo?wt(s[0].repo):"github/owner/repo/token")+"",R,f,j,V,B,L,te,z,ee,Y,le;function se(O,U){return O[16]?xs:O[15]?Zs:Xs}let x=se(s),M=x(s);return{c(){t=v("div"),e=v("label"),n=m(l),u=D(),r=v("input"),c=D(),h=v("div"),b=v("label"),b.textContent=g,S=D(),k=v("div"),H=m(p),E=D(),A=v("code"),R=m(N),f=D(),j=v("div"),V=v("input"),te=D(),z=v("button"),M.c(),this.h()},l(O){t=d(O,"DIV",{class:!0});var U=_(t);e=d(U,"LABEL",{class:!0,for:!0});var Z=_(e);n=y(Z,l),Z.forEach(o),u=C(U),r=d(U,"INPUT",{id:!0,type:!0,class:!0,placeholder:!0}),U.forEach(o),c=C(O),h=d(O,"DIV",{class:!0});var $=_(h);b=d($,"LABEL",{class:!0,for:!0,"data-svelte-h":!0}),kt(b)!=="svelte-1fvnya8"&&(b.textContent=g),S=C($),k=d($,"DIV",{class:!0});var re=_(k);H=y(re,p),E=C(re),A=d(re,"CODE",{class:!0});var ae=_(A);R=y(ae,N),ae.forEach(o),re.forEach(o),f=C($),j=d($,"DIV",{class:!0});var J=_(j);V=d(J,"INPUT",{id:!0,type:!0,class:!0,autocomplete:!0,placeholder:!0}),te=C(J),z=d(J,"BUTTON",{type:!0,class:!0});var ie=_(z);M.l(ie),ie.forEach(o),J.forEach(o),$.forEach(o),this.h()},h(){i(e,"class","field-label svelte-o8xfsv"),i(e,"for","field-sync-repo"),i(r,"id","field-sync-repo"),i(r,"type","text"),i(r,"class","field-input mono svelte-o8xfsv"),i(r,"placeholder","owner/repo"),i(t,"class","field svelte-o8xfsv"),i(b,"class","field-label svelte-o8xfsv"),i(b,"for","field-gh-token"),i(A,"class","key-hint svelte-o8xfsv"),i(k,"class","field-hint svelte-o8xfsv"),i(V,"id","field-gh-token"),i(V,"type",B=s[15]?"text":"password"),V.value=s[4],i(V,"class","field-input mono svelte-o8xfsv"),i(V,"autocomplete","new-password"),i(V,"placeholder",L=s[17]?s[37]("settings.credentialSet"):s[37]("settings.credentialNotSet")),i(z,"type","button"),i(z,"class","btn-ghost svelte-o8xfsv"),z.disabled=ee=s[16]||!s[0].repo,i(j,"class","credential-row svelte-o8xfsv"),i(h,"class","field full svelte-o8xfsv")},m(O,U){w(O,t,U),a(t,e),a(e,n),a(t,u),a(t,r),fe(r,s[0].repo),w(O,c,U),w(O,h,U),a(h,b),a(h,S),a(h,k),a(k,H),a(k,E),a(k,A),a(A,R),a(h,f),a(h,j),a(j,V),a(j,te),a(j,z),M.m(z,null),Y||(le=[be(r,"input",s[63]),be(r,"input",s[40]),be(V,"input",s[64]),be(z,"click",s[47])],Y=!0)},p(O,U){U[1]&64&&l!==(l=O[37]("settings.syncRepo")+"")&&I(n,l),U[0]&1&&r.value!==O[0].repo&&fe(r,O[0].repo),U[1]&64&&p!==(p=O[37]("settings.credentialStoredAs")+"")&&I(H,p),U[0]&1&&N!==(N=(O[0].repo?wt(O[0].repo):"github/owner/repo/token")+"")&&I(R,N),U[0]&32768&&B!==(B=O[15]?"text":"password")&&i(V,"type",B),U[0]&16&&V.value!==O[4]&&(V.value=O[4]),U[0]&131072|U[1]&64&&L!==(L=O[17]?O[37]("settings.credentialSet"):O[37]("settings.credentialNotSet"))&&i(V,"placeholder",L),x===(x=se(O))&&M?M.p(O,U):(M.d(1),M=x(O),M&&(M.c(),M.m(z,null))),U[0]&65537&&ee!==(ee=O[16]||!O[0].repo)&&(z.disabled=ee)},d(O){O&&(o(t),o(c),o(h)),M.d(),Y=!1,ul(le)}}}function Xs(s){let t=s[37]("settings.showCredential")+"",e;return{c(){e=m(t)},l(l){e=y(l,t)},m(l,n){w(l,e,n)},p(l,n){n[1]&64&&t!==(t=l[37]("settings.showCredential")+"")&&I(e,t)},d(l){l&&o(e)}}}function Zs(s){let t=s[37]("settings.hideCredential")+"",e;return{c(){e=m(t)},l(l){e=y(l,t)},m(l,n){w(l,e,n)},p(l,n){n[1]&64&&t!==(t=l[37]("settings.hideCredential")+"")&&I(e,t)},d(l){l&&o(e)}}}function xs(s){let t;return{c(){t=m("...")},l(e){t=y(e,"...")},m(e,l){w(e,t,l)},p:Gt,d(e){e&&o(t)}}}function as(s){let t,e,l=s[37]("settings.syncBucket")+"",n,u,r,c,h,b,g=s[37]("settings.syncPrefix")+"",S,k,p,H,E,A,N=s[37]("settings.syncEndpoint")+"",R,f,j,V,B,L,te=s[37]("settings.syncRegion")+"",z,ee,Y,le,se,x,M="Access Key ID",O,U,Z=s[37]("settings.credentialStoredAs")+"",$,re,ae,J=(s[0].bucket?Tt(s[0].bucket):"s3/my-bucket/accessKeyId")+"",ie,ne,q,G,Se,ve,oe,ge,Te,Ne,he,ce,Ue="Secret Access Key",Ee,Ie,He=s[37]("settings.credentialStoredAs")+"",at,K,X,pe=(s[0].bucket?Rt(s[0].bucket):"s3/my-bucket/secretAccessKey")+"",_e,Ce,Pe,ke,Re,Fe,Be,de,Le,ot,ct;function lt(T,W){return T[19]?tn:T[18]?en:$s}let Ye=lt(s),Ve=Ye(s);function yt(T,W){return T[22]?nn:T[21]?sn:ln}let dt=yt(s),Ke=dt(s);return{c(){t=v("div"),e=v("label"),n=m(l),u=D(),r=v("input"),c=D(),h=v("div"),b=v("label"),S=m(g),k=D(),p=v("input"),H=D(),E=v("div"),A=v("label"),R=m(N),f=D(),j=v("input"),V=D(),B=v("div"),L=v("label"),z=m(te),ee=D(),Y=v("input"),le=D(),se=v("div"),x=v("label"),x.textContent=M,O=D(),U=v("div"),$=m(Z),re=D(),ae=v("code"),ie=m(J),ne=D(),q=v("div"),G=v("input"),oe=D(),ge=v("button"),Ve.c(),Ne=D(),he=v("div"),ce=v("label"),ce.textContent=Ue,Ee=D(),Ie=v("div"),at=m(He),K=D(),X=v("code"),_e=m(pe),Ce=D(),Pe=v("div"),ke=v("input"),Be=D(),de=v("button"),Ke.c(),this.h()},l(T){t=d(T,"DIV",{class:!0});var W=_(t);e=d(W,"LABEL",{class:!0,for:!0});var mt=_(e);n=y(mt,l),mt.forEach(o),u=C(W),r=d(W,"INPUT",{id:!0,type:!0,class:!0,placeholder:!0}),W.forEach(o),c=C(T),h=d(T,"DIV",{class:!0});var vt=_(h);b=d(vt,"LABEL",{class:!0,for:!0});var At=_(b);S=y(At,g),At.forEach(o),k=C(vt),p=d(vt,"INPUT",{id:!0,type:!0,class:!0,placeholder:!0}),vt.forEach(o),H=C(T),E=d(T,"DIV",{class:!0});var Me=_(E);A=d(Me,"LABEL",{class:!0,for:!0});var Dt=_(A);R=y(Dt,N),Dt.forEach(o),f=C(Me),j=d(Me,"INPUT",{id:!0,type:!0,class:!0,placeholder:!0}),Me.forEach(o),V=C(T),B=d(T,"DIV",{class:!0});var St=_(B);L=d(St,"LABEL",{class:!0,for:!0});var we=_(L);z=y(we,te),we.forEach(o),ee=C(St),Y=d(St,"INPUT",{id:!0,type:!0,class:!0,placeholder:!0}),St.forEach(o),le=C(T),se=d(T,"DIV",{class:!0});var st=_(se);x=d(st,"LABEL",{class:!0,for:!0,"data-svelte-h":!0}),kt(x)!=="svelte-19hx02n"&&(x.textContent=M),O=C(st),U=d(st,"DIV",{class:!0});var it=_(U);$=y(it,Z),re=C(it),ae=d(it,"CODE",{class:!0});var F=_(ae);ie=y(F,J),F.forEach(o),it.forEach(o),ne=C(st),q=d(st,"DIV",{class:!0});var Ae=_(q);G=d(Ae,"INPUT",{id:!0,type:!0,class:!0,autocomplete:!0,placeholder:!0}),oe=C(Ae),ge=d(Ae,"BUTTON",{type:!0,class:!0});var ye=_(ge);Ve.l(ye),ye.forEach(o),Ae.forEach(o),st.forEach(o),Ne=C(T),he=d(T,"DIV",{class:!0});var De=_(he);ce=d(De,"LABEL",{class:!0,for:!0,"data-svelte-h":!0}),kt(ce)!=="svelte-v09gt4"&&(ce.textContent=Ue),Ee=C(De),Ie=d(De,"DIV",{class:!0});var nt=_(Ie);at=y(nt,He),K=C(nt),X=d(nt,"CODE",{class:!0});var _t=_(X);_e=y(_t,pe),_t.forEach(o),nt.forEach(o),Ce=C(De),Pe=d(De,"DIV",{class:!0});var rt=_(Pe);ke=d(rt,"INPUT",{id:!0,type:!0,class:!0,autocomplete:!0,placeholder:!0}),Be=C(rt),de=d(rt,"BUTTON",{type:!0,class:!0});var Nt=_(de);Ke.l(Nt),Nt.forEach(o),rt.forEach(o),De.forEach(o),this.h()},h(){i(e,"class","field-label svelte-o8xfsv"),i(e,"for","field-sync-bucket"),i(r,"id","field-sync-bucket"),i(r,"type","text"),i(r,"class","field-input mono svelte-o8xfsv"),i(r,"placeholder","my-bucket"),i(t,"class","field svelte-o8xfsv"),i(b,"class","field-label svelte-o8xfsv"),i(b,"for","field-sync-prefix"),i(p,"id","field-sync-prefix"),i(p,"type","text"),i(p,"class","field-input mono svelte-o8xfsv"),i(p,"placeholder","aiusage/"),i(h,"class","field svelte-o8xfsv"),i(A,"class","field-label svelte-o8xfsv"),i(A,"for","field-sync-endpoint"),i(j,"id","field-sync-endpoint"),i(j,"type","text"),i(j,"class","field-input mono svelte-o8xfsv"),i(j,"placeholder","https://s3.amazonaws.com"),i(E,"class","field svelte-o8xfsv"),i(L,"class","field-label svelte-o8xfsv"),i(L,"for","field-sync-region"),i(Y,"id","field-sync-region"),i(Y,"type","text"),i(Y,"class","field-input mono svelte-o8xfsv"),i(Y,"placeholder","auto"),i(B,"class","field svelte-o8xfsv"),i(x,"class","field-label svelte-o8xfsv"),i(x,"for","field-s3-akid"),i(ae,"class","key-hint svelte-o8xfsv"),i(U,"class","field-hint svelte-o8xfsv"),i(G,"id","field-s3-akid"),i(G,"type",Se=s[18]?"text":"password"),G.value=s[5],i(G,"class","field-input mono svelte-o8xfsv"),i(G,"autocomplete","new-password"),i(G,"placeholder",ve=s[20]?s[37]("settings.credentialSet"):s[37]("settings.credentialNotSet")),i(ge,"type","button"),i(ge,"class","btn-ghost svelte-o8xfsv"),ge.disabled=Te=s[19]||!s[0].bucket,i(q,"class","credential-row svelte-o8xfsv"),i(se,"class","field full svelte-o8xfsv"),i(ce,"class","field-label svelte-o8xfsv"),i(ce,"for","field-s3-sak"),i(X,"class","key-hint svelte-o8xfsv"),i(Ie,"class","field-hint svelte-o8xfsv"),i(ke,"id","field-s3-sak"),i(ke,"type",Re=s[21]?"text":"password"),ke.value=s[6],i(ke,"class","field-input mono svelte-o8xfsv"),i(ke,"autocomplete","new-password"),i(ke,"placeholder",Fe=s[23]?s[37]("settings.credentialSet"):s[37]("settings.credentialNotSet")),i(de,"type","button"),i(de,"class","btn-ghost svelte-o8xfsv"),de.disabled=Le=s[22]||!s[0].bucket,i(Pe,"class","credential-row svelte-o8xfsv"),i(he,"class","field full svelte-o8xfsv")},m(T,W){w(T,t,W),a(t,e),a(e,n),a(t,u),a(t,r),fe(r,s[0].bucket),w(T,c,W),w(T,h,W),a(h,b),a(b,S),a(h,k),a(h,p),fe(p,s[0].prefix),w(T,H,W),w(T,E,W),a(E,A),a(A,R),a(E,f),a(E,j),fe(j,s[0].endpoint),w(T,V,W),w(T,B,W),a(B,L),a(L,z),a(B,ee),a(B,Y),fe(Y,s[0].region),w(T,le,W),w(T,se,W),a(se,x),a(se,O),a(se,U),a(U,$),a(U,re),a(U,ae),a(ae,ie),a(se,ne),a(se,q),a(q,G),a(q,oe),a(q,ge),Ve.m(ge,null),w(T,Ne,W),w(T,he,W),a(he,ce),a(he,Ee),a(he,Ie),a(Ie,at),a(Ie,K),a(Ie,X),a(X,_e),a(he,Ce),a(he,Pe),a(Pe,ke),a(Pe,Be),a(Pe,de),Ke.m(de,null),ot||(ct=[be(r,"input",s[65]),be(r,"input",s[41]),be(p,"input",s[66]),be(j,"input",s[67]),be(Y,"input",s[68]),be(G,"input",s[69]),be(ge,"click",s[48]),be(ke,"input",s[70]),be(de,"click",s[49])],ot=!0)},p(T,W){W[1]&64&&l!==(l=T[37]("settings.syncBucket")+"")&&I(n,l),W[0]&1&&r.value!==T[0].bucket&&fe(r,T[0].bucket),W[1]&64&&g!==(g=T[37]("settings.syncPrefix")+"")&&I(S,g),W[0]&1&&p.value!==T[0].prefix&&fe(p,T[0].prefix),W[1]&64&&N!==(N=T[37]("settings.syncEndpoint")+"")&&I(R,N),W[0]&1&&j.value!==T[0].endpoint&&fe(j,T[0].endpoint),W[1]&64&&te!==(te=T[37]("settings.syncRegion")+"")&&I(z,te),W[0]&1&&Y.value!==T[0].region&&fe(Y,T[0].region),W[1]&64&&Z!==(Z=T[37]("settings.credentialStoredAs")+"")&&I($,Z),W[0]&1&&J!==(J=(T[0].bucket?Tt(T[0].bucket):"s3/my-bucket/accessKeyId")+"")&&I(ie,J),W[0]&262144&&Se!==(Se=T[18]?"text":"password")&&i(G,"type",Se),W[0]&32&&G.value!==T[5]&&(G.value=T[5]),W[0]&1048576|W[1]&64&&ve!==(ve=T[20]?T[37]("settings.credentialSet"):T[37]("settings.credentialNotSet"))&&i(G,"placeholder",ve),Ye===(Ye=lt(T))&&Ve?Ve.p(T,W):(Ve.d(1),Ve=Ye(T),Ve&&(Ve.c(),Ve.m(ge,null))),W[0]&524289&&Te!==(Te=T[19]||!T[0].bucket)&&(ge.disabled=Te),W[1]&64&&He!==(He=T[37]("settings.credentialStoredAs")+"")&&I(at,He),W[0]&1&&pe!==(pe=(T[0].bucket?Rt(T[0].bucket):"s3/my-bucket/secretAccessKey")+"")&&I(_e,pe),W[0]&2097152&&Re!==(Re=T[21]?"text":"password")&&i(ke,"type",Re),W[0]&64&&ke.value!==T[6]&&(ke.value=T[6]),W[0]&8388608|W[1]&64&&Fe!==(Fe=T[23]?T[37]("settings.credentialSet"):T[37]("settings.credentialNotSet"))&&i(ke,"placeholder",Fe),dt===(dt=yt(T))&&Ke?Ke.p(T,W):(Ke.d(1),Ke=dt(T),Ke&&(Ke.c(),Ke.m(de,null))),W[0]&4194305&&Le!==(Le=T[22]||!T[0].bucket)&&(de.disabled=Le)},d(T){T&&(o(t),o(c),o(h),o(H),o(E),o(V),o(B),o(le),o(se),o(Ne),o(he)),Ve.d(),Ke.d(),ot=!1,ul(ct)}}}function $s(s){let t=s[37]("settings.showCredential")+"",e;return{c(){e=m(t)},l(l){e=y(l,t)},m(l,n){w(l,e,n)},p(l,n){n[1]&64&&t!==(t=l[37]("settings.showCredential")+"")&&I(e,t)},d(l){l&&o(e)}}}function en(s){let t=s[37]("settings.hideCredential")+"",e;return{c(){e=m(t)},l(l){e=y(l,t)},m(l,n){w(l,e,n)},p(l,n){n[1]&64&&t!==(t=l[37]("settings.hideCredential")+"")&&I(e,t)},d(l){l&&o(e)}}}function tn(s){let t;return{c(){t=m("...")},l(e){t=y(e,"...")},m(e,l){w(e,t,l)},p:Gt,d(e){e&&o(t)}}}function ln(s){let t=s[37]("settings.showCredential")+"",e;return{c(){e=m(t)},l(l){e=y(l,t)},m(l,n){w(l,e,n)},p(l,n){n[1]&64&&t!==(t=l[37]("settings.showCredential")+"")&&I(e,t)},d(l){l&&o(e)}}}function sn(s){let t=s[37]("settings.hideCredential")+"",e;return{c(){e=m(t)},l(l){e=y(l,t)},m(l,n){w(l,e,n)},p(l,n){n[1]&64&&t!==(t=l[37]("settings.hideCredential")+"")&&I(e,t)},d(l){l&&o(e)}}}function nn(s){let t;return{c(){t=m("...")},l(e){t=y(e,"...")},m(e,l){w(e,t,l)},p:Gt,d(e){e&&o(t)}}}function os(s){let t,e,l,n,u,r,c,h,b,g=s[37]("settings.autoSync")+"",S,k,p,H,E=s[1]&&is(s);return{c(){t=v("div"),e=v("div"),l=v("label"),n=v("input"),u=D(),r=v("span"),c=D(),h=v("span"),b=v("strong"),S=m(g),k=D(),E&&E.c(),this.h()},l(A){t=d(A,"DIV",{class:!0});var N=_(t);e=d(N,"DIV",{class:!0});var R=_(e);l=d(R,"LABEL",{class:!0});var f=_(l);n=d(f,"INPUT",{type:!0,class:!0}),u=C(f),r=d(f,"SPAN",{class:!0,"aria-hidden":!0}),_(r).forEach(o),c=C(f),h=d(f,"SPAN",{});var j=_(h);b=d(j,"STRONG",{class:!0});var V=_(b);S=y(V,g),V.forEach(o),j.forEach(o),f.forEach(o),k=C(R),E&&E.l(R),R.forEach(o),N.forEach(o),this.h()},h(){i(n,"type","checkbox"),i(n,"class","svelte-o8xfsv"),i(r,"class","switch svelte-o8xfsv"),i(r,"aria-hidden","true"),i(b,"class","svelte-o8xfsv"),i(l,"class","toggle-row svelte-o8xfsv"),i(e,"class","auto-sync-toggle-row svelte-o8xfsv"),i(t,"class","field full svelte-o8xfsv")},m(A,N){w(A,t,N),a(t,e),a(e,l),a(l,n),n.checked=s[1],a(l,u),a(l,r),a(l,c),a(l,h),a(h,b),a(b,S),a(e,k),E&&E.m(e,null),p||(H=be(n,"change",s[71]),p=!0)},p(A,N){N[0]&2&&(n.checked=A[1]),N[1]&64&&g!==(g=A[37]("settings.autoSync")+"")&&I(S,g),A[1]?E?E.p(A,N):(E=is(A),E.c(),E.m(e,null)):E&&(E.d(1),E=null)},d(A){A&&o(t),E&&E.d(),p=!1,H()}}}function is(s){let t,e,l=s[37]("settings.syncFrequency")+"",n,u,r,c,h,b=s[37]("settings.syncMinutes")+"",g,S,k,p=s[37]("settings.syncMinutes")+"",H,E,A,N=s[37]("settings.syncMinutes")+"",R,f,j,V=s[37]("settings.syncHour")+"",B,L,te,z=s[37]("settings.syncHours")+"",ee,Y,le,se=s[37]("settings.syncHours")+"",x,M,O,U=s[37]("settings.syncHours")+"",Z,$,re,ae=s[37]("settings.syncHours")+"",J,ie,ne;return{c(){t=v("label"),e=v("span"),n=m(l),u=D(),r=v("select"),c=v("option"),h=m("5 "),g=m(b),S=v("option"),k=m("15 "),H=m(p),E=v("option"),A=m("30 "),R=m(N),f=v("option"),j=m("1 "),B=m(V),L=v("option"),te=m("2 "),ee=m(z),Y=v("option"),le=m("6 "),x=m(se),M=v("option"),O=m("12 "),Z=m(U),$=v("option"),re=m("24 "),J=m(ae),this.h()},l(q){t=d(q,"LABEL",{class:!0});var G=_(t);e=d(G,"SPAN",{});var Se=_(e);n=y(Se,l),Se.forEach(o),u=C(G),r=d(G,"SELECT",{class:!0});var ve=_(r);c=d(ve,"OPTION",{});var oe=_(c);h=y(oe,"5 "),g=y(oe,b),oe.forEach(o),S=d(ve,"OPTION",{});var ge=_(S);k=y(ge,"15 "),H=y(ge,p),ge.forEach(o),E=d(ve,"OPTION",{});var Te=_(E);A=y(Te,"30 "),R=y(Te,N),Te.forEach(o),f=d(ve,"OPTION",{});var Ne=_(f);j=y(Ne,"1 "),B=y(Ne,V),Ne.forEach(o),L=d(ve,"OPTION",{});var he=_(L);te=y(he,"2 "),ee=y(he,z),he.forEach(o),Y=d(ve,"OPTION",{});var ce=_(Y);le=y(ce,"6 "),x=y(ce,se),ce.forEach(o),M=d(ve,"OPTION",{});var Ue=_(M);O=y(Ue,"12 "),Z=y(Ue,U),Ue.forEach(o),$=d(ve,"OPTION",{});var Ee=_($);re=y(Ee,"24 "),J=y(Ee,ae),Ee.forEach(o),ve.forEach(o),G.forEach(o),this.h()},h(){c.__value="5",fe(c,c.__value),S.__value="15",fe(S,S.__value),E.__value="30",fe(E,E.__value),f.__value="60",fe(f,f.__value),L.__value="120",fe(L,L.__value),Y.__value="360",fe(Y,Y.__value),M.__value="720",fe(M,M.__value),$.__value="1440",fe($,$.__value),i(r,"class","svelte-o8xfsv"),s[2]===void 0&&rl(()=>s[72].call(r)),i(t,"class","interval-control svelte-o8xfsv")},m(q,G){w(q,t,G),a(t,e),a(e,n),a(t,u),a(t,r),a(r,c),a(c,h),a(c,g),a(r,S),a(S,k),a(S,H),a(r,E),a(E,A),a(E,R),a(r,f),a(f,j),a(f,B),a(r,L),a(L,te),a(L,ee),a(r,Y),a(Y,le),a(Y,x),a(r,M),a(M,O),a(M,Z),a(r,$),a($,re),a($,J),Pt(r,s[2],!0),ie||(ne=be(r,"change",s[72]),ie=!0)},p(q,G){G[1]&64&&l!==(l=q[37]("settings.syncFrequency")+"")&&I(n,l),G[1]&64&&b!==(b=q[37]("settings.syncMinutes")+"")&&I(g,b),G[1]&64&&p!==(p=q[37]("settings.syncMinutes")+"")&&I(H,p),G[1]&64&&N!==(N=q[37]("settings.syncMinutes")+"")&&I(R,N),G[1]&64&&V!==(V=q[37]("settings.syncHour")+"")&&I(B,V),G[1]&64&&z!==(z=q[37]("settings.syncHours")+"")&&I(ee,z),G[1]&64&&se!==(se=q[37]("settings.syncHours")+"")&&I(x,se),G[1]&64&&U!==(U=q[37]("settings.syncHours")+"")&&I(Z,U),G[1]&64&&ae!==(ae=q[37]("settings.syncHours")+"")&&I(J,ae),G[0]&4&&Pt(r,q[2])},d(q){q&&o(t),ie=!1,ne()}}}function rs(s){let t,e;return{c(){t=v("p"),e=m(s[29]),this.h()},l(l){t=d(l,"P",{class:!0});var n=_(t);e=y(n,s[29]),n.forEach(o),this.h()},h(){i(t,"class","section-error svelte-o8xfsv")},m(l,n){w(l,t,n),a(t,e)},p(l,n){n[0]&536870912&&I(e,l[29])},d(l){l&&o(t)}}}function us(s){var ge,Te,Ne,he,ce,Ue,Ee,Ie,He,at;let t,e,l=s[37]("settings.syncStatus")+"",n,u,r,c,h,b=s[37]("settings.syncLastSync")+"",g,S,k,p=s[43]((ge=s[34])==null?void 0:ge.lastSyncAt)+"",H,E,A,N,R,f=s[37]("settings.syncStatusLabel")+"",j,V,B,L,te,z,ee,Y,le,se,x,M,O,U,Z=((Te=s[3])==null?void 0:Te.nextSyncAt)&&fs(s);function $(K,X){var pe,_e;return K[14]?un:((pe=K[34])==null?void 0:pe.lastSyncStatus)==="ok"?rn:(_e=K[34])!=null&&_e.lastSyncStatus?on:an}let re=$(s),ae=re(s),J=((Ne=s[34])==null?void 0:Ne.lastSyncPulled)!=null&&((he=s[34])==null?void 0:he.lastSyncStatus)==="ok"&&cs(s),ie=((ce=s[34])==null?void 0:ce.lastSyncError)&&((Ue=s[34])==null?void 0:Ue.lastSyncStatus)!=="ok"&&ds(s),ne=((Ee=s[34])==null?void 0:Ee.lastSyncDurationMs)!=null&&((Ie=s[34])==null?void 0:Ie.lastSyncStatus)==="ok"&&vs(s),q=((He=s[34])==null?void 0:He.lastSyncPulled)!=null&&((at=s[34])==null?void 0:at.lastSyncStatus)==="ok"&&_s(s),G=s[31]&&!s[14]&&ps(s);function Se(K,X){return K[14]?_n:vn}let ve=Se(s),oe=ve(s);return{c(){t=v("div"),e=v("div"),n=m(l),u=D(),r=v("div"),c=v("div"),h=v("span"),g=m(b),S=D(),k=v("span"),H=m(p),E=D(),Z&&Z.c(),A=D(),N=v("div"),R=v("span"),j=m(f),V=D(),B=v("span"),ae.c(),L=D(),J&&J.c(),te=D(),ie&&ie.c(),z=D(),ne&&ne.c(),ee=D(),q&&q.c(),Y=D(),le=v("div"),G&&G.c(),se=D(),x=v("button"),oe.c(),this.h()},l(K){t=d(K,"DIV",{class:!0});var X=_(t);e=d(X,"DIV",{class:!0});var pe=_(e);n=y(pe,l),pe.forEach(o),u=C(X),r=d(X,"DIV",{class:!0});var _e=_(r);c=d(_e,"DIV",{class:!0});var Ce=_(c);h=d(Ce,"SPAN",{class:!0});var Pe=_(h);g=y(Pe,b),Pe.forEach(o),S=C(Ce),k=d(Ce,"SPAN",{class:!0});var ke=_(k);H=y(ke,p),ke.forEach(o),Ce.forEach(o),E=C(_e),Z&&Z.l(_e),A=C(_e),N=d(_e,"DIV",{class:!0});var Re=_(N);R=d(Re,"SPAN",{class:!0});var Fe=_(R);j=y(Fe,f),Fe.forEach(o),V=C(Re),B=d(Re,"SPAN",{class:!0});var Be=_(B);ae.l(Be),Be.forEach(o),Re.forEach(o),L=C(_e),J&&J.l(_e),te=C(_e),ie&&ie.l(_e),z=C(_e),ne&&ne.l(_e),ee=C(_e),q&&q.l(_e),_e.forEach(o),Y=C(X),le=d(X,"DIV",{class:!0});var de=_(le);G&&G.l(de),se=C(de),x=d(de,"BUTTON",{class:!0});var Le=_(x);oe.l(Le),Le.forEach(o),de.forEach(o),X.forEach(o),this.h()},h(){var K,X;i(e,"class","group-title svelte-o8xfsv"),i(h,"class","sync-status-label svelte-o8xfsv"),i(k,"class","sync-status-value mono svelte-o8xfsv"),i(c,"class","sync-status-item svelte-o8xfsv"),i(R,"class","sync-status-label svelte-o8xfsv"),i(B,"class","sync-status-value svelte-o8xfsv"),tt(B,"ok",((K=s[34])==null?void 0:K.lastSyncStatus)==="ok"),tt(B,"err",((X=s[34])==null?void 0:X.lastSyncStatus)==="failed"),i(N,"class","sync-status-item svelte-o8xfsv"),i(r,"class","sync-status-grid svelte-o8xfsv"),i(x,"class","btn-sync svelte-o8xfsv"),x.disabled=M=s[14]||s[28]||s[31],i(le,"class","sync-action svelte-o8xfsv"),i(t,"class","sync-status-section svelte-o8xfsv")},m(K,X){w(K,t,X),a(t,e),a(e,n),a(t,u),a(t,r),a(r,c),a(c,h),a(h,g),a(c,S),a(c,k),a(k,H),a(r,E),Z&&Z.m(r,null),a(r,A),a(r,N),a(N,R),a(R,j),a(N,V),a(N,B),ae.m(B,null),a(r,L),J&&J.m(r,null),a(r,te),ie&&ie.m(r,null),a(r,z),ne&&ne.m(r,null),a(r,ee),q&&q.m(r,null),a(t,Y),a(t,le),G&&G.m(le,null),a(le,se),a(le,x),oe.m(x,null),O||(U=be(x,"click",s[42]),O=!0)},p(K,X){var pe,_e,Ce,Pe,ke,Re,Fe,Be,de,Le,ot,ct;X[1]&64&&l!==(l=K[37]("settings.syncStatus")+"")&&I(n,l),X[1]&64&&b!==(b=K[37]("settings.syncLastSync")+"")&&I(g,b),X[1]&8&&p!==(p=K[43]((pe=K[34])==null?void 0:pe.lastSyncAt)+"")&&I(H,p),(_e=K[3])!=null&&_e.nextSyncAt?Z?Z.p(K,X):(Z=fs(K),Z.c(),Z.m(r,A)):Z&&(Z.d(1),Z=null),X[1]&64&&f!==(f=K[37]("settings.syncStatusLabel")+"")&&I(j,f),re===(re=$(K))&&ae?ae.p(K,X):(ae.d(1),ae=re(K),ae&&(ae.c(),ae.m(B,null))),X[1]&8&&tt(B,"ok",((Ce=K[34])==null?void 0:Ce.lastSyncStatus)==="ok"),X[1]&8&&tt(B,"err",((Pe=K[34])==null?void 0:Pe.lastSyncStatus)==="failed"),((ke=K[34])==null?void 0:ke.lastSyncPulled)!=null&&((Re=K[34])==null?void 0:Re.lastSyncStatus)==="ok"?J?J.p(K,X):(J=cs(K),J.c(),J.m(r,te)):J&&(J.d(1),J=null),(Fe=K[34])!=null&&Fe.lastSyncError&&((Be=K[34])==null?void 0:Be.lastSyncStatus)!=="ok"?ie?ie.p(K,X):(ie=ds(K),ie.c(),ie.m(r,z)):ie&&(ie.d(1),ie=null),((de=K[34])==null?void 0:de.lastSyncDurationMs)!=null&&((Le=K[34])==null?void 0:Le.lastSyncStatus)==="ok"?ne?ne.p(K,X):(ne=vs(K),ne.c(),ne.m(r,ee)):ne&&(ne.d(1),ne=null),((ot=K[34])==null?void 0:ot.lastSyncPulled)!=null&&((ct=K[34])==null?void 0:ct.lastSyncStatus)==="ok"?q?q.p(K,X):(q=_s(K),q.c(),q.m(r,null)):q&&(q.d(1),q=null),K[31]&&!K[14]?G?G.p(K,X):(G=ps(K),G.c(),G.m(le,se)):G&&(G.d(1),G=null),ve===(ve=Se(K))&&oe?oe.p(K,X):(oe.d(1),oe=ve(K),oe&&(oe.c(),oe.m(x,null))),X[0]&268451840|X[1]&1&&M!==(M=K[14]||K[28]||K[31])&&(x.disabled=M)},d(K){K&&o(t),Z&&Z.d(),ae.d(),J&&J.d(),ie&&ie.d(),ne&&ne.d(),q&&q.d(),G&&G.d(),oe.d(),O=!1,U()}}}function fs(s){let t,e,l=s[37]("settings.syncNextSync")+"",n,u,r,c=s[43](s[3].nextSyncAt)+"",h;return{c(){t=v("div"),e=v("span"),n=m(l),u=D(),r=v("span"),h=m(c),this.h()},l(b){t=d(b,"DIV",{class:!0});var g=_(t);e=d(g,"SPAN",{class:!0});var S=_(e);n=y(S,l),S.forEach(o),u=C(g),r=d(g,"SPAN",{class:!0});var k=_(r);h=y(k,c),k.forEach(o),g.forEach(o),this.h()},h(){i(e,"class","sync-status-label svelte-o8xfsv"),i(r,"class","sync-status-value mono svelte-o8xfsv"),i(t,"class","sync-status-item svelte-o8xfsv")},m(b,g){w(b,t,g),a(t,e),a(e,n),a(t,u),a(t,r),a(r,h)},p(b,g){g[1]&64&&l!==(l=b[37]("settings.syncNextSync")+"")&&I(n,l),g[0]&8&&c!==(c=b[43](b[3].nextSyncAt)+"")&&I(h,c)},d(b){b&&o(t)}}}function an(s){let t;return{c(){t=m("—")},l(e){t=y(e,"—")},m(e,l){w(e,t,l)},p:Gt,d(e){e&&o(t)}}}function on(s){let t=s[37]("sync.failed")+"",e;return{c(){e=m(t)},l(l){e=y(l,t)},m(l,n){w(l,e,n)},p(l,n){n[1]&64&&t!==(t=l[37]("sync.failed")+"")&&I(e,t)},d(l){l&&o(e)}}}function rn(s){let t=s[37]("sync.complete")+"",e;return{c(){e=m(t)},l(l){e=y(l,t)},m(l,n){w(l,e,n)},p(l,n){n[1]&64&&t!==(t=l[37]("sync.complete")+"")&&I(e,t)},d(l){l&&o(e)}}}function un(s){var l;let t=((l=s[3])!=null&&l.phase?s[37](`sync.phase.${s[3].phase}`):s[37]("sync.syncing"))+"",e;return{c(){e=m(t)},l(n){e=y(n,t)},m(n,u){w(n,e,u)},p(n,u){var r;u[0]&8|u[1]&64&&t!==(t=((r=n[3])!=null&&r.phase?n[37](`sync.phase.${n[3].phase}`):n[37]("sync.syncing"))+"")&&I(e,t)},d(n){n&&o(e)}}}function cs(s){let t,e,l=s[37]("settings.syncPulled")+"",n,u,r,c=s[34].lastSyncPulled+"",h,b,g,S,k=s[37]("settings.syncUploaded")+"",p,H,E,A=(s[34].lastSyncUploaded??0)+"",N;return{c(){t=v("div"),e=v("span"),n=m(l),u=D(),r=v("span"),h=m(c),b=D(),g=v("div"),S=v("span"),p=m(k),H=D(),E=v("span"),N=m(A),this.h()},l(R){t=d(R,"DIV",{class:!0});var f=_(t);e=d(f,"SPAN",{class:!0});var j=_(e);n=y(j,l),j.forEach(o),u=C(f),r=d(f,"SPAN",{class:!0});var V=_(r);h=y(V,c),V.forEach(o),f.forEach(o),b=C(R),g=d(R,"DIV",{class:!0});var B=_(g);S=d(B,"SPAN",{class:!0});var L=_(S);p=y(L,k),L.forEach(o),H=C(B),E=d(B,"SPAN",{class:!0});var te=_(E);N=y(te,A),te.forEach(o),B.forEach(o),this.h()},h(){i(e,"class","sync-status-label svelte-o8xfsv"),i(r,"class","sync-status-value mono svelte-o8xfsv"),i(t,"class","sync-status-item svelte-o8xfsv"),i(S,"class","sync-status-label svelte-o8xfsv"),i(E,"class","sync-status-value mono svelte-o8xfsv"),i(g,"class","sync-status-item svelte-o8xfsv")},m(R,f){w(R,t,f),a(t,e),a(e,n),a(t,u),a(t,r),a(r,h),w(R,b,f),w(R,g,f),a(g,S),a(S,p),a(g,H),a(g,E),a(E,N)},p(R,f){f[1]&64&&l!==(l=R[37]("settings.syncPulled")+"")&&I(n,l),f[1]&8&&c!==(c=R[34].lastSyncPulled+"")&&I(h,c),f[1]&64&&k!==(k=R[37]("settings.syncUploaded")+"")&&I(p,k),f[1]&8&&A!==(A=(R[34].lastSyncUploaded??0)+"")&&I(N,A)},d(R){R&&(o(t),o(b),o(g))}}}function ds(s){let t,e,l=s[37]("settings.syncError")+"",n,u,r,c,h;function b(k,p){return p[1]&8&&(c=null),p[1]&8&&(h=null),c==null&&(c=!!(k[34].lastSyncError.includes("star")||k[34].lastSyncError.includes("Star")||k[34].lastSyncError.includes("STAR_REQUIRED"))),c?dn:(h==null&&(h=!!(k[34].lastSyncError.includes("bind")||k[34].lastSyncError.includes("GitHub")||k[34].lastSyncError.includes("GITHUB_BINDING"))),h?cn:fn)}let g=b(s,[-1,-1,-1]),S=g(s);return{c(){t=v("div"),e=v("span"),n=m(l),u=D(),r=v("span"),S.c(),this.h()},l(k){t=d(k,"DIV",{class:!0});var p=_(t);e=d(p,"SPAN",{class:!0});var H=_(e);n=y(H,l),H.forEach(o),u=C(p),r=d(p,"SPAN",{class:!0});var E=_(r);S.l(E),E.forEach(o),p.forEach(o),this.h()},h(){i(e,"class","sync-status-label svelte-o8xfsv"),i(r,"class","sync-status-value err svelte-o8xfsv"),i(t,"class","sync-status-item full svelte-o8xfsv")},m(k,p){w(k,t,p),a(t,e),a(e,n),a(t,u),a(t,r),S.m(r,null)},p(k,p){p[1]&64&&l!==(l=k[37]("settings.syncError")+"")&&I(n,l),g===(g=b(k,p))&&S?S.p(k,p):(S.d(1),S=g(k),S&&(S.c(),S.m(r,null)))},d(k){k&&o(t),S.d()}}}function fn(s){let t=s[34].lastSyncError+"",e;return{c(){e=m(t)},l(l){e=y(l,t)},m(l,n){w(l,e,n)},p(l,n){n[1]&8&&t!==(t=l[34].lastSyncError+"")&&I(e,t)},d(l){l&&o(e)}}}function cn(s){let t=s[37]("settings.syncGithubBindingRequired")+"",e,l,n,u=s[37]("settings.syncCloudStep1")+"",r;return{c(){e=m(t),l=D(),n=v("a"),r=m(u),this.h()},l(c){e=y(c,t),l=C(c),n=d(c,"A",{href:!0,target:!0,rel:!0,class:!0});var h=_(n);r=y(h,u),h.forEach(o),this.h()},h(){i(n,"href","https://aiusage.jtanx.com/settings#accounts"),i(n,"target","_blank"),i(n,"rel","noopener noreferrer"),i(n,"class","cloud-step-link svelte-o8xfsv")},m(c,h){w(c,e,h),w(c,l,h),w(c,n,h),a(n,r)},p(c,h){h[1]&64&&t!==(t=c[37]("settings.syncGithubBindingRequired")+"")&&I(e,t),h[1]&64&&u!==(u=c[37]("settings.syncCloudStep1")+"")&&I(r,u)},d(c){c&&(o(e),o(l),o(n))}}}function dn(s){let t=s[37]("settings.syncStarRequired")+"",e,l,n,u=s[37]("settings.syncCloudStep2")+"",r;return{c(){e=m(t),l=D(),n=v("a"),r=m(u),this.h()},l(c){e=y(c,t),l=C(c),n=d(c,"A",{href:!0,target:!0,rel:!0,class:!0});var h=_(n);r=y(h,u),h.forEach(o),this.h()},h(){i(n,"href","https://github.com/juliantanx/aiusage"),i(n,"target","_blank"),i(n,"rel","noopener noreferrer"),i(n,"class","cloud-step-link svelte-o8xfsv")},m(c,h){w(c,e,h),w(c,l,h),w(c,n,h),a(n,r)},p(c,h){h[1]&64&&t!==(t=c[37]("settings.syncStarRequired")+"")&&I(e,t),h[1]&64&&u!==(u=c[37]("settings.syncCloudStep2")+"")&&I(r,u)},d(c){c&&(o(e),o(l),o(n))}}}function vs(s){let t,e,l=s[37]("settings.syncDuration")+"",n,u,r,c=(s[34].lastSyncDurationMs/1e3).toFixed(1)+"",h,b;return{c(){t=v("div"),e=v("span"),n=m(l),u=D(),r=v("span"),h=m(c),b=m("s"),this.h()},l(g){t=d(g,"DIV",{class:!0});var S=_(t);e=d(S,"SPAN",{class:!0});var k=_(e);n=y(k,l),k.forEach(o),u=C(S),r=d(S,"SPAN",{class:!0});var p=_(r);h=y(p,c),b=y(p,"s"),p.forEach(o),S.forEach(o),this.h()},h(){i(e,"class","sync-status-label svelte-o8xfsv"),i(r,"class","sync-status-value mono svelte-o8xfsv"),i(t,"class","sync-status-item svelte-o8xfsv")},m(g,S){w(g,t,S),a(t,e),a(e,n),a(t,u),a(t,r),a(r,h),a(r,b)},p(g,S){S[1]&64&&l!==(l=g[37]("settings.syncDuration")+"")&&I(n,l),S[1]&8&&c!==(c=(g[34].lastSyncDurationMs/1e3).toFixed(1)+"")&&I(h,c)},d(g){g&&o(t)}}}function _s(s){let t,e=s[37]("settings.syncCountHint")+"",l;return{c(){t=v("div"),l=m(e),this.h()},l(n){t=d(n,"DIV",{class:!0});var u=_(t);l=y(u,e),u.forEach(o),this.h()},h(){i(t,"class","sync-status-hint svelte-o8xfsv")},m(n,u){w(n,t,u),a(t,l)},p(n,u){u[1]&64&&e!==(e=n[37]("settings.syncCountHint")+"")&&I(l,e)},d(n){n&&o(t)}}}function ps(s){let t,e=s[37]("settings.syncUnsavedHint")+"",l;return{c(){t=v("div"),l=m(e),this.h()},l(n){t=d(n,"DIV",{class:!0});var u=_(t);l=y(u,e),u.forEach(o),this.h()},h(){i(t,"class","sync-unsaved-warn svelte-o8xfsv")},m(n,u){w(n,t,u),a(t,l)},p(n,u){u[1]&64&&e!==(e=n[37]("settings.syncUnsavedHint")+"")&&I(l,e)},d(n){n&&o(t)}}}function vn(s){let t=(s[28]?"...":s[37]("settings.syncNow"))+"",e;return{c(){e=m(t)},l(l){e=y(l,t)},m(l,n){w(l,e,n)},p(l,n){n[0]&268435456|n[1]&64&&t!==(t=(l[28]?"...":l[37]("settings.syncNow"))+"")&&I(e,t)},d(l){l&&o(e)}}}function _n(s){var r,c,h;let t=((r=s[3])!=null&&r.phase?s[37](`sync.phase.${s[3].phase}`):s[37]("sync.syncing"))+"",e,l,n,u=(((c=s[3])==null?void 0:c.pulledCount)||((h=s[3])==null?void 0:h.uploadedCount))&&hs(s);return{c(){e=m(t),l=D(),u&&u.c(),n=Ct()},l(b){e=y(b,t),l=C(b),u&&u.l(b),n=Ct()},m(b,g){w(b,e,g),w(b,l,g),u&&u.m(b,g),w(b,n,g)},p(b,g){var S,k,p;g[0]&8|g[1]&64&&t!==(t=((S=b[3])!=null&&S.phase?b[37](`sync.phase.${b[3].phase}`):b[37]("sync.syncing"))+"")&&I(e,t),(k=b[3])!=null&&k.pulledCount||(p=b[3])!=null&&p.uploadedCount?u?u.p(b,g):(u=hs(b),u.c(),u.m(n.parentNode,n)):u&&(u.d(1),u=null)},d(b){b&&(o(e),o(l),o(n)),u&&u.d(b)}}}function hs(s){let t,e,l=s[3].pulledCount&&bs(s),n=s[3].uploadedCount&&gs(s);return{c(){t=v("span"),l&&l.c(),e=D(),n&&n.c(),this.h()},l(u){t=d(u,"SPAN",{class:!0});var r=_(t);l&&l.l(r),e=C(r),n&&n.l(r),r.forEach(o),this.h()},h(){i(t,"class","sync-progress-counts svelte-o8xfsv")},m(u,r){w(u,t,r),l&&l.m(t,null),a(t,e),n&&n.m(t,null)},p(u,r){u[3].pulledCount?l?l.p(u,r):(l=bs(u),l.c(),l.m(t,e)):l&&(l.d(1),l=null),u[3].uploadedCount?n?n.p(u,r):(n=gs(u),n.c(),n.m(t,null)):n&&(n.d(1),n=null)},d(u){u&&o(t),l&&l.d(),n&&n.d()}}}function bs(s){let t,e=s[3].pulledCount+"",l;return{c(){t=m("↓"),l=m(e)},l(n){t=y(n,"↓"),l=y(n,e)},m(n,u){w(n,t,u),w(n,l,u)},p(n,u){u[0]&8&&e!==(e=n[3].pulledCount+"")&&I(l,e)},d(n){n&&(o(t),o(l))}}}function gs(s){let t,e=s[3].uploadedCount+"",l;return{c(){t=m("↑"),l=m(e)},l(n){t=y(n,"↑"),l=y(n,e)},m(n,u){w(n,t,u),w(n,l,u)},p(n,u){u[0]&8&&e!==(e=n[3].uploadedCount+"")&&I(l,e)},d(n){n&&(o(t),o(l))}}}function pn(s){let t,e,l,n,u=s[37]("settings.title")+"",r,c,h;document.title=t=s[37]("settings.title")+" — AIUsage";function b(k,p){return k[7]?Fs:k[8]?Hs:Us}let g=b(s),S=g(s);return{c(){e=D(),l=v("div"),n=v("h1"),r=m(u),c=D(),S.c(),h=Ct(),this.h()},l(k){Ns("svelte-dva2f2",document.head).forEach(o),e=C(k),l=d(k,"DIV",{class:!0});var H=_(l);n=d(H,"H1",{});var E=_(n);r=y(E,u),E.forEach(o),H.forEach(o),c=C(k),S.l(k),h=Ct(),this.h()},h(){i(l,"class","page-header")},m(k,p){w(k,e,p),w(k,l,p),a(l,n),a(n,r),w(k,c,p),S.m(k,p),w(k,h,p)},p(k,p){p[1]&64&&t!==(t=k[37]("settings.title")+" — AIUsage")&&(document.title=t),p[1]&64&&u!==(u=k[37]("settings.title")+"")&&I(r,u),g===(g=b(k))&&S?S.p(k,p):(S.d(1),S=g(k),S&&(S.c(),S.m(h.parentNode,h)))},i:Gt,o:Gt,d(k){k&&(o(e),o(l),o(c),o(h)),S.d(k)}}}function wt(s){return`github/${s}/token`}function Tt(s){return`s3/${s}/accessKeyId`}function Rt(s){return`s3/${s}/secretAccessKey`}function ks(s){const t=s.find(e=>/^github\/[^/]+\/[^/]+\/token$/.test(e));return t?t.replace(/^github\//,"").replace(/\/token$/,""):""}function ys(s){const t=s.find(e=>/^s3\/[^/]+\/accessKeyId$/.test(e));return t?t.replace(/^s3\//,"").replace(/\/accessKeyId$/,""):""}function il(s,t,e,l){return s?"...":t?l:e}function hn(s,t,e){let l,n,u,r,c,h,b,g;Ss(s,Ls,F=>e(37,g=F));let S=!0,k=null,p={device:"",weekStart:1,refreshInterval:"",retentionDays:"",displayCurrency:"USD",exchangeRate:""},H=[],E=!1,A="",N="";const R={darwin:"macOS",win32:"Windows",linux:"Linux"};let f={backend:"",repo:"",bucket:"",prefix:"",endpoint:"",region:"auto"},j=!1,V=!1,B="30",L=null,te=!1,z=null,ee=[],Y="",le=!1,se=!1,x=!1,M="",O=!1,U=!1,Z=!1,$="",re=!1,ae=!1,J=!1,ie="",ne="",q="",G="",Se=.137,ve=null,oe=!1,ge=!1,Te="",Ne=!1,he=!1,ce="",Ue=!1,Ee="";function Ie(F){return ee.includes(F)}function He(){return JSON.stringify({backend:f.backend||"",repo:f.repo.trim(),bucket:f.bucket.trim(),prefix:f.prefix.trim(),endpoint:f.endpoint.trim(),region:f.region.trim(),autoSyncEnabled:V,syncIntervalMinutes:V?String(B):"",ghTokenPending:!!Y,s3AkidPending:!!M,s3SakPending:!!$})}function at(){f.backend==="github"&&!f.repo&&e(0,f.repo=ks(ee),f),f.backend==="s3"&&!f.bucket&&e(0,f.bucket=ys(ee),f),e(4,Y=""),e(15,le=!1),e(16,se=!1),e(5,M=""),e(18,O=!1),e(19,U=!1),e(6,$=""),e(21,re=!1),e(22,ae=!1),e(17,x=!!(f.repo&&Ie(wt(f.repo)))),e(20,Z=!!(f.bucket&&Ie(Tt(f.bucket)))),e(23,J=!!(f.bucket&&Ie(Rt(f.bucket)))),f.backend==="s3"&&!f.region&&e(0,f.region="auto",f),ie=f.backend,ne=f.repo,q=f.bucket}function K(){f.repo!==ne&&(e(4,Y=""),e(15,le=!1),e(16,se=!1),e(17,x=!1),ne=f.repo)}function X(){f.bucket!==q&&(e(5,M=""),e(18,O=!1),e(19,U=!1),e(20,Z=!1),e(6,$=""),e(21,re=!1),e(22,ae=!1),e(23,J=!1),q=f.bucket)}Es(async()=>{var F,Ae,ye,De,nt,_t,rt,Nt,Oe,pt;try{const[ue,Bt]=await Promise.all([Ps(),ws()]);e(9,p={device:ue.device??"",weekStart:ue.weekStart??1,refreshInterval:ue.refreshInterval!=null?String(ue.refreshInterval):"",retentionDays:ue.retentionDays!=null?String(ue.retentionDays):"",displayCurrency:ue.displayCurrency||"USD",exchangeRate:ue.exchangeRate?(1/ue.exchangeRate).toFixed(4):""}),e(50,H=Bt.tools??[]),e(11,A=ue.platform??""),e(12,N=ue.hostname??"");const qe=ue.credentialKeys??[];ee=qe;const jt=ks(qe),ht=ys(qe);e(0,f={backend:((F=ue.sync)==null?void 0:F.backend)??(jt?"github":""),repo:((Ae=ue.sync)==null?void 0:Ae.repo)??jt,bucket:((ye=ue.sync)==null?void 0:ye.bucket)??ht,prefix:((De=ue.sync)==null?void 0:De.prefix)??"",endpoint:((nt=ue.sync)==null?void 0:nt.endpoint)??"",region:((_t=ue.sync)==null?void 0:_t.backend)==="s3"?((rt=ue.sync)==null?void 0:rt.region)??"auto":((Nt=ue.sync)==null?void 0:Nt.region)??""}),ie=f.backend,ne=f.repo,q=f.bucket,e(13,j=!!ue.loggedIn);const Lt=ue.syncInterval;Lt&&Lt>0&&(e(1,V=!0),e(2,B=String(Math.round(Lt/6e4))));const ut=((Oe=ue.sync)==null?void 0:Oe.credentialRef)??"";e(17,x=!!(f.repo&&(qe.includes(wt(f.repo))||ut&&qe.includes(ut)))),e(20,Z=!!(f.bucket&&qe.includes(Tt(f.bucket)))),e(23,J=!!(f.bucket&&qe.includes(Rt(f.bucket)))),e(53,Ee=He()),G=ue.device||N||"hostname",(pt=ue.exchangeRateCache)!=null&&pt.CNY_USD&&(e(51,Se=ue.exchangeRateCache.CNY_USD),e(52,ve=ue.exchangeRateCache.fetchedAt)),pe()}catch(ue){e(8,k=ue instanceof Error?ue.message:"Failed to load")}finally{e(7,S=!1)}});async function pe(){try{const F=await Ts();e(3,L=F.status),e(14,te=!!(L!=null&&L.isRunning))}catch{e(3,L=null)}}async function _e(){e(14,te=!0);try{await Vs(),Ce()}catch{e(14,te=!1),await pe()}}function Ce(){Pe(),z=setInterval(async()=>{await pe(),L!=null&&L.isRunning||(Pe(),e(14,te=!1))},800)}function Pe(){z&&(clearInterval(z),z=null)}function ke(F){return F?new Date(F).toLocaleString():g("settings.syncNever")}async function Re(){e(25,ge=!0),e(26,Te="");try{const F=p.exchangeRate?Number(p.exchangeRate):0,Ae=F>0?1/F:null;await Gl({device:p.device||null,weekStart:Number(p.weekStart),refreshInterval:p.refreshInterval?Number(p.refreshInterval):null,retentionDays:p.retentionDays?Number(p.retentionDays):null,displayCurrency:p.displayCurrency,exchangeRate:Ae}),Rs({refreshInterval:p.refreshInterval?Number(p.refreshInterval):null,device:p.device||null}),G=p.device||N||"hostname",Os.set(p.displayCurrency),Ae?kl.set(Ae):kl.set(Se),e(27,Ne=!0),setTimeout(()=>{e(27,Ne=!1)},2e3)}catch(F){e(26,Te=F instanceof Error?F.message:"Save failed")}finally{e(25,ge=!1)}}async function Fe(){e(28,he=!0),e(29,ce="");try{if(e(0,f.repo=f.repo.trim(),f),e(0,f.bucket=f.bucket.trim(),f),e(0,f.prefix=f.prefix.trim(),f),e(0,f.endpoint=f.endpoint.trim(),f),e(0,f.region=f.region.trim(),f),f.backend==="github"){if(!f.repo)throw new Error(g("settings.syncRepoRequired"));if(!/^[^/\s]+\/[^/\s]+$/.test(f.repo))throw new Error(g("settings.syncRepoInvalid"));if(!Y&&!x)throw new Error(g("settings.syncGithubTokenRequired"))}else if(f.backend==="s3"){if(!f.bucket)throw new Error(g("settings.syncBucketRequired"));if(!M&&!Z)throw new Error(g("settings.syncS3AccessKeyRequired"));if(!$&&!J)throw new Error(g("settings.syncS3SecretKeyRequired"))}let F=null;f.backend==="cloud"?F={backend:"cloud"}:f.backend==="github"&&f.repo?F={backend:"github",repo:f.repo,credentialRef:wt(f.repo)}:f.backend==="s3"&&f.bucket&&(F={backend:"s3",bucket:f.bucket,prefix:f.prefix||"",endpoint:f.endpoint||"",region:f.region||"auto",credentialRef:Tt(f.bucket)});const Ae={};f.backend==="github"&&f.repo&&Y&&(Ae[wt(f.repo)]=Y),f.backend==="s3"&&f.bucket&&(M&&(Ae[Tt(f.bucket)]=M),$&&(Ae[Rt(f.bucket)]=$));const ye=V&&B?Number(B)*6e4:null,De={sync:F,syncInterval:ye};return Object.keys(Ae).length>0&&(De.credentials=Ae),await Gl(De),f.backend==="github"?Y&&(ee=Array.from(new Set([...ee,wt(f.repo)])),e(17,x=!0),e(4,Y=""),e(15,le=!1)):f.backend==="s3"&&(M&&(ee=Array.from(new Set([...ee,Tt(f.bucket)])),e(20,Z=!0),e(5,M=""),e(18,O=!1)),$&&(ee=Array.from(new Set([...ee,Rt(f.bucket)])),e(23,J=!0),e(6,$=""),e(21,re=!1))),ie=f.backend,ne=f.repo,q=f.bucket,e(53,Ee=He()),e(30,Ue=!0),setTimeout(()=>{e(30,Ue=!1)},2e3),await pe(),!0}catch(F){return e(29,ce=F instanceof Error?F.message:"Save failed"),!1}finally{e(28,he=!1)}}async function Be(){e(24,oe=!0);try{const F=await Bs();e(51,Se=F.rate),e(52,ve=F.fetchedAt),p.exchangeRate||kl.set(F.rate)}catch(F){e(26,Te=F instanceof Error?F.message:"Refresh failed")}finally{e(24,oe=!1)}}async function de(){if(e(29,ce=""),e(0,f.repo=f.repo.trim(),f),!f.repo){e(29,ce=g("settings.syncRepoRequired"));return}if(le){e(15,le=!1);return}if(Y){e(15,le=!0);return}e(16,se=!0);try{const F=await gl(wt(f.repo));e(4,Y=F.value??""),e(15,le=!0),e(17,x=!!Y)}catch(F){e(29,ce=F instanceof Error?F.message:"Failed to load credential")}finally{e(16,se=!1)}}async function Le(){if(e(29,ce=""),e(0,f.bucket=f.bucket.trim(),f),!f.bucket){e(29,ce=g("settings.syncBucketRequired"));return}if(O){e(18,O=!1);return}if(M){e(18,O=!0);return}e(19,U=!0);try{const F=await gl(Tt(f.bucket));e(5,M=F.value??""),e(18,O=!0),e(20,Z=!!M)}catch(F){e(29,ce=F instanceof Error?F.message:"Failed to load credential")}finally{e(19,U=!1)}}async function ot(){if(e(29,ce=""),e(0,f.bucket=f.bucket.trim(),f),!f.bucket){e(29,ce=g("settings.syncBucketRequired"));return}if(re){e(21,re=!1);return}if($){e(21,re=!0);return}e(22,ae=!0);try{const F=await gl(Rt(f.bucket));e(6,$=F.value??""),e(21,re=!0),e(23,J=!!$)}catch(F){e(29,ce=F instanceof Error?F.message:"Failed to load credential")}finally{e(22,ae=!1)}}Is(()=>{Pe()});function ct(){p.device=this.value,e(9,p)}function lt(){p.weekStart=ol(this),e(9,p)}function Ye(){p.refreshInterval=qt(this.value),e(9,p)}function Ve(){p.retentionDays=qt(this.value),e(9,p)}function yt(){p.displayCurrency=ol(this),e(9,p)}function dt(){p.exchangeRate=qt(this.value),e(9,p)}const Ke=()=>e(10,E=!E);function T(){f.backend=ol(this),e(0,f)}function W(){f.repo=this.value,e(0,f)}const mt=F=>e(4,Y=F.target.value);function vt(){f.bucket=this.value,e(0,f)}function At(){f.prefix=this.value,e(0,f)}function Me(){f.endpoint=this.value,e(0,f)}function Dt(){f.region=this.value,e(0,f)}const St=F=>e(5,M=F.target.value),we=F=>e(6,$=F.target.value);function st(){V=this.checked,e(1,V)}function it(){B=ol(this),e(2,B)}return s.$$.update=()=>{s.$$.dirty[1]&524288&&e(36,l=H.filter(F=>F.status!=="not_found")),s.$$.dirty[1]&524288&&e(35,n=H.filter(F=>F.status==="not_found")),s.$$.dirty[0]&1&&e(54,u=f.backend==="cloud"?"cloud":f.backend==="github"&&f.repo?`github:${f.repo}`:f.backend==="s3"&&f.bucket?`s3:${f.bucket}`:""),s.$$.dirty[0]&8|s.$$.dirty[1]&8388608&&e(34,r=!(L!=null&&L.lastSyncTarget)||!u||L.lastSyncTarget===u?L:null),s.$$.dirty[1]&1048576&&e(33,c=Se?(1/Se).toFixed(2):""),s.$$.dirty[1]&2097152&&e(32,h=ve?new Date(ve).toLocaleString():null),s.$$.dirty[0]&119|s.$$.dirty[1]&4194304&&e(31,b=JSON.stringify({backend:f.backend||"",repo:f.repo.trim(),bucket:f.bucket.trim(),prefix:f.prefix.trim(),endpoint:f.endpoint.trim(),region:f.region.trim(),autoSyncEnabled:V,syncIntervalMinutes:V?String(B):"",ghTokenPending:!!Y,s3AkidPending:!!M,s3SakPending:!!$})!==Ee)},[f,V,B,L,Y,M,$,S,k,p,E,A,N,j,te,le,se,x,O,U,Z,re,ae,J,oe,ge,Te,Ne,he,ce,Ue,b,h,c,r,n,l,g,R,at,K,X,_e,ke,Re,Fe,Be,de,Le,ot,H,Se,ve,Ee,u,ct,lt,Ye,Ve,yt,dt,Ke,T,W,mt,vt,At,Me,Dt,St,we,st,it]}class Sn extends Cs{constructor(t){super(),Ds(this,t,hn,pn,ms,{},null,[-1,-1,-1])}}export{Sn as component};
|