omnigateway 0.8.1 → 0.9.0
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 +7 -0
- package/bin/omni.js +23 -2
- package/gateway.js +10 -0
- package/package.json +1 -1
- package/public/assets/{Chip-BZWa7onX.js → Chip-shturdCv.js} +1 -1
- package/public/assets/{CopyValue-Cs2JUZQD.js → CopyValue-BGt9RRTL.js} +1 -1
- package/public/assets/{Field-DK5zaBVA.js → Field-DcNu4yw-.js} +1 -1
- package/public/assets/Lamp-CVGUT2YK.js +25 -0
- package/public/assets/{Panel-CYQvfI3L.js → Panel-BlNr9j6-.js} +3 -1
- package/public/assets/{Rack-CRuJZY00.js → Rack-BbZyyu2u.js} +5 -5
- package/public/assets/{Readout-D6-aurU8.js → Readout-D8Ofl3Gz.js} +1 -1
- package/public/assets/{RequestTable-D9hFf4o5.js → RequestTable-huSAoNZg.js} +1 -1
- package/public/assets/{SummaryDeck-D29h0rFx.js → SummaryDeck-BPo2bMSC.js} +1 -1
- package/public/assets/{Toggle-BIHUR4pS.js → Toggle-C84xs_YB.js} +1 -1
- package/public/assets/{TokenBreakdown-D5mQFSfo.js → TokenBreakdown-CmzXuENj.js} +1 -1
- package/public/assets/{WindowChart-DVl7kwqb.js → WindowChart-BZzVrxYk.js} +1 -1
- package/public/assets/{_app-BWNEo1e-.js → _app-CWXzHdhc.js} +1 -1
- package/public/assets/_app.accounts-DMmtkwnl.js +59 -0
- package/public/assets/{_app.console-Bvo2fugd.js → _app.console-BBz3kCPV.js} +1 -1
- package/public/assets/_app.database-ZvtMVgsh.js +24 -0
- package/public/assets/{_app.index-CgI1OrZR.js → _app.index-DKouD-rz.js} +5 -5
- package/public/assets/{_app.keys-CcfPhvCD.js → _app.keys-BG9-zfh6.js} +5 -5
- package/public/assets/{_app.logs-C8ZiArCn.js → _app.logs-DjinYGYS.js} +2 -2
- package/public/assets/{_app.models-nfMWzVb4.js → _app.models-BCfQVuoT.js} +5 -5
- package/public/assets/_app.plugins._pluginId-B9k5eqAt.js +2 -0
- package/public/assets/{_app.plugins._pluginId-CE8Jknhs.js → _app.plugins._pluginId-Dm48f3wz.js} +1 -1
- package/public/assets/{_app.settings-C45FJLeX.js → _app.settings-C42ylcNP.js} +4 -4
- package/public/assets/{_app.usage-C5s-DfBV.js → _app.usage-DfPM6eQ-.js} +3 -3
- package/public/assets/{chevron-right-B7JOx5ra.js → chevron-right-HI_fK6Gw.js} +1 -1
- package/public/assets/client-TUf0nuim.js +39 -0
- package/public/assets/index-C66Zn0tX.js +13 -0
- package/public/assets/login-DWgivEPK.js +2 -0
- package/public/assets/{login-DvRXHEGv.js → login-w-hVstKf.js} +2 -2
- package/public/assets/plus-BCf2TPqz.js +1 -0
- package/public/assets/{preload-helper-D2sCuvIY.js → preload-helper-Unv7FI91.js} +1 -1
- package/public/assets/{shared-BKWNmsjH.js → shared-XRnr7At9.js} +1 -1
- package/public/assets/{stream-BUWwtwme.js → stream-3PafhwhZ.js} +1 -1
- package/public/assets/{trash-2-rvGFhAn8.js → trash-2-Bq4GaXzx.js} +1 -1
- package/public/index.html +8 -8
- package/public/assets/Lamp-BHYJpauE.js +0 -25
- package/public/assets/_app.accounts-C3Yv991L.js +0 -59
- package/public/assets/_app.database-CfWNOIl-.js +0 -24
- package/public/assets/_app.plugins._pluginId-ByykviWs.js +0 -2
- package/public/assets/client-DvN2dbYV.js +0 -39
- package/public/assets/index-BW1O9p6N.js +0 -13
- package/public/assets/login-9Ovj_4DV.js +0 -2
- package/public/assets/plus-64jUPIDJ.js +0 -1
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import{A as e,D as t,G as n,N as r,Ot as i,P as a,Ut as o,ht as s,j as c,jt as l,pt as u,st as d,ut as f,zt as ee}from"./Lamp-BHYJpauE.js";import{C as p,D as m,_ as h,a as g,b as _,g as v,i as y,o as b,r as x,t as S,w as C,x as w}from"./Panel-CYQvfI3L.js";import{b as T,r as E,t as D}from"./Rack-CRuJZY00.js";import{r as O,t as k}from"./Field-DK5zaBVA.js";import{t as A}from"./Meter-stpt3vQu.js";import{i as j,n as M,r as N,t as P}from"./Table-CVDZ69Zx.js";import{t as F}from"./Readout-D6-aurU8.js";import{n as I}from"./reasons-Du1OBWAM.js";import{useQueryClient as L}from"@tanstack/react-query";import{useCallback as R,useState as z}from"react";import{Fragment as B,jsx as V,jsxs as H}from"react/jsx-runtime";import U from"styled-components";var W=T(`camera`,[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]),G=T(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]),K=[{id:`keepLatest`,label:`Snapshots kept`,hint:`How many survive regardless of age. The newest is always kept, whatever both numbers say.`,unit:`files`,max:100},{id:`maxAgeDays`,label:`Maximum age`,hint:`Older snapshots are pruned after every new one and on the hourly maintenance sweep.`,unit:`days`,max:3650}],q=U.p`
|
|
2
|
-
font-size: 12px;
|
|
3
|
-
color: ${({theme:e})=>e.color.down};
|
|
4
|
-
`,J=U.p`
|
|
5
|
-
font-size: 12px;
|
|
6
|
-
color: ${({theme:e})=>e.color.ok};
|
|
7
|
-
`,Y=U.div`
|
|
8
|
-
display: grid;
|
|
9
|
-
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
|
10
|
-
gap: ${({theme:e})=>e.space(3)};
|
|
11
|
-
`;function X(e){let t={};for(let n of K){let r=e[n.id].trim(),i=Number(r);if(r.length===0||!Number.isInteger(i)||i<1)return{ok:!1,problem:`${n.label} must be a whole number of 1 or more.`};if(i>n.max)return{ok:!1,problem:`${n.label} cannot exceed ${n.max}.`};t[n.id]=i}return{ok:!0,policy:t}}function Z({retention:e}){let t=l(),[n,r]=z({}),[i,a]=z(null),[o,s]=z(!1),c={keepLatest:n.keepLatest??(e===void 0?``:String(e.keepLatest)),maxAgeDays:n.maxAgeDays??(e===void 0?``:String(e.maxAgeDays))};return V(S,{legend:`Retention`,actions:V(m,{type:`button`,$size:`sm`,disabled:t.isPending||e===void 0,onClick:()=>{s(!1);let e=X(c);if(!e.ok){a(e.problem);return}a(null),t.mutate(e.policy,{onSuccess:()=>{s(!0),r({})},onError:e=>a(b(e))})},children:t.isPending?`Saving…`:`Save retention`}),children:H(p,{$gap:3,children:[V(Y,{children:K.map(e=>V(k,{label:e.label,hint:e.hint,children:t=>H(_,{$gap:2,children:[V(O,{...t,min:1,max:e.max,step:1,value:c[e.id],onChange:t=>r({...n,[e.id]:t.target.value})}),V(h,{children:e.unit})]})},e.id))}),i===null?null:V(q,{role:`alert`,children:i}),o&&i===null?V(J,{role:`status`,children:`Retention saved.`}):null]})})}function Q(){let e=L();return R(t=>{if(t.adminPasswordChanged){I(`admin-password-changed`);return}e.invalidateQueries()},[e])}var $=U.p`
|
|
12
|
-
font-size: 12px;
|
|
13
|
-
color: ${({theme:e})=>e.color.down};
|
|
14
|
-
`,te=U.input`
|
|
15
|
-
font-size: 12px;
|
|
16
|
-
color: ${({theme:e})=>e.color.inkDim};
|
|
17
|
-
max-width: 40ch;
|
|
18
|
-
`;function ne(){let e=ee(),r=d(),a=i(),o=Q(),l=u(),f=s(),[h,v]=z(null),[T,D]=z(null),[O,A]=z(null),[F,I]=z(!1),L=e.data??[],R=H(m,{type:`button`,$variant:`primary`,$size:`sm`,disabled:r.isPending,onClick:()=>r.mutate(),children:[V(W,{}),r.isPending?`Copying…`:`Take a snapshot`]}),B=H(p,{$gap:2,children:[H(_,{$gap:2,$wrap:!0,children:[V(k,{label:`Database file to import`,hint:`A snapshot taken from this or another OmniGateway. It is checked for integrity and rejected if it is not one of ours.`,children:e=>V(te,{...e,type:`file`,accept:`.sqlite,.db,application/octet-stream`,onChange:e=>A(e.target.files?.[0]??null)})}),V(m,{type:`button`,$variant:`danger`,$size:`sm`,disabled:O===null||f.isPending,onClick:()=>I(!0),children:f.isPending?`Replacing…`:`Import`})]}),f.isError?V($,{role:`alert`,children:b(f.error)}):null,a.isError?V($,{role:`alert`,children:b(a.error)}):null,r.isError?V($,{role:`alert`,children:b(r.error)}):null]});return H(S,{legend:`Snapshots`,meta:`${L.length}`,actions:R,footer:B,flush:!0,children:[e.isError?V(y,{error:e.error,onRetry:()=>void e.refetch()}):e.isLoading?V(`div`,{style:{padding:12},children:V(g,{rows:3})}):L.length===0?V(x,{legend:`No snapshots`,message:`Nothing has been copied yet, so there is nothing to go back to. Take one before a migration or a settings change you are unsure of.`,action:V(m,{type:`button`,$variant:`primary`,$size:`sm`,disabled:r.isPending,onClick:()=>r.mutate(),children:`Take the first snapshot`})}):V(w,{children:H(P,{children:[V(`thead`,{children:H(`tr`,{children:[V(N,{children:`File`}),V(N,{children:`Reason`}),V(N,{$align:`right`,children:`Size`}),V(N,{$align:`right`,children:`Taken`}),V(N,{})]})}),V(`tbody`,{children:L.map(e=>H(j,{children:[V(M,{$mono:!0,children:V(C,{style:{maxWidth:`38ch`,display:`block`},children:e.filename})}),V(M,{children:e.reason}),V(M,{$align:`right`,$mono:!0,children:t(e.sizeBytes)}),V(M,{$align:`right`,$mono:!0,children:c(e.createdAt)}),V(M,{$align:`right`,children:H(_,{$gap:1,$justify:`flex-end`,children:[V(m,{as:`a`,$size:`sm`,href:n(e.id),download:e.filename,children:`Download`}),V(m,{type:`button`,$variant:`danger`,$size:`sm`,onClick:()=>v(e),children:`Restore`}),V(m,{type:`button`,$variant:`danger`,$size:`sm`,onClick:()=>D(e),children:`Delete`})]})})]},e.id))})]})}),V(E,{open:h!==null,onOpenChange:e=>{e||v(null)},title:`Restore database`,body:h===null?``:`Replacing the live database with ${h.filename}. Client requests are refused while the file is swapped, and a copy of the current database is taken first so this can be undone. Captured request bodies are not part of a snapshot and are left where they are.`,confirmLabel:`Restore database`,busy:a.isPending,onConfirm:()=>{h!==null&&a.mutate(h.id,{onSuccess:o,onSettled:()=>v(null)})}}),V(E,{open:T!==null,onOpenChange:e=>{e||D(null)},title:`Delete snapshot`,body:T===null?``:`Deleting ${T.filename} from disk. Download it first if it is the copy you would go back to; there is no other one of it.`,confirmLabel:`Delete snapshot`,busy:l.isPending,onConfirm:()=>{T!==null&&l.mutate(T.id,{onSettled:()=>D(null)})}}),V(E,{open:F,onOpenChange:I,title:`Import database`,body:O===null?``:`Replacing the live database with ${O.name}. It is validated before anything is touched, and a copy of the current database is taken first. If the file carries a different admin password, every session ends and you will be asked to sign in again.`,confirmLabel:`Replace database`,busy:f.isPending,onConfirm:()=>{O!==null&&f.mutate(O,{onSuccess:o,onSettled:()=>I(!1)})}})]})}var re=U.p`
|
|
19
|
-
font-size: 12px;
|
|
20
|
-
color: ${({theme:e})=>e.color.ok};
|
|
21
|
-
`,ie=U.p`
|
|
22
|
-
font-size: 12px;
|
|
23
|
-
color: ${({theme:e})=>e.color.down};
|
|
24
|
-
`;function ae(){let n=f(),i=o(),[s,c]=z(!1),l=n.data,u=l?.engine===`postgres`,d=l===void 0||l.logicalBytes===0?0:l.freePageBytes/l.logicalBytes;return H(B,{children:[V(D,{legend:`Database`,title:`Storage, snapshots, and retention`,summary:n.isLoading?`Measuring the database…`:u?`The Postgres database every replica of this cluster runs from. Back it up with pg_dump; nothing here copies or replaces it.`:`The one SQLite file this gateway runs from, the copies taken of it, and how long they are kept.`}),V(S,{legend:`Size`,meta:l===void 0?void 0:`schema v${l.stats.schemaVersion}`,actions:u?void 0:H(m,{type:`button`,$size:`sm`,disabled:i.isPending||l===void 0,onClick:()=>c(!0),children:[V(G,{}),i.isPending?`Compacting…`:`Compact`]}),footer:i.isError?V(ie,{role:`alert`,children:b(i.error)}):i.data===void 0?void 0:V(re,{role:`status`,children:`Compacted, reclaiming ${t(i.data.reclaimedBytes)} in ${r(i.data.durationMs)}.`}),children:n.isError?V(y,{error:n.error,onRetry:()=>void n.refetch()}):l===void 0?V(g,{rows:3}):u?H(v,{$min:`180px`,$stretch:!0,children:[V(F,{legend:`Database`,value:t(l.logicalBytes),unit:`${l.stats.pageCount} blocks of ${t(l.stats.pageSize)}`}),V(F,{legend:`Server`,value:l.location,unit:`password masked`}),V(F,{legend:`Captured bodies`,value:t(l.bodiesBytes),unit:`the request_bodies table`})]}):H(v,{$min:`180px`,$stretch:!0,children:[V(F,{legend:`Database file`,value:t(l.fileBytes),unit:`${l.stats.pageCount} pages of ${t(l.stats.pageSize)}`,trace:V(A,{fraction:d,label:`${a(d,0)} of the file is reclaimable`})}),V(F,{legend:`Reclaimable`,value:t(l.freePageBytes),unit:`${l.stats.freelistCount} free pages`}),V(F,{legend:`Write-ahead log`,value:t(l.walBytes),unit:`folded into every snapshot`}),V(F,{legend:`Captured bodies`,value:t(l.bodiesBytes),unit:`never in a snapshot`}),V(F,{legend:`Snapshots`,value:t(l.snapshots.totalBytes),unit:`${l.snapshots.count} kept`}),V(F,{legend:`Free disk`,value:t(l.freeDiskBytes),unit:l.freeDiskBytes===null?`not readable here`:`on this filesystem`})]})}),V(S,{legend:`Tables`,meta:u?`row counts are the planner's estimates; dead rows await autovacuum`:`size includes each table's indexes`,children:l===void 0?V(g,{rows:4}):H(P,{children:[V(`thead`,{children:H(j,{children:[V(N,{children:`Table`}),V(N,{$align:`right`,children:`Size`}),V(N,{$align:`right`,children:`Rows`}),u?V(N,{$align:`right`,children:`Dead rows`}):null]})}),V(`tbody`,{children:l.tables.map(n=>H(j,{children:[V(M,{children:n.name}),V(M,{$align:`right`,children:t(n.bytes)}),V(M,{$align:`right`,children:e(n.rows)}),u?V(M,{$align:`right`,children:e(n.deadRows??0)}):null]},n.name))})]})}),u?null:H(B,{children:[V(ne,{}),V(Z,{retention:l?.retention})]}),V(E,{open:s,onOpenChange:c,title:`Compact database`,body:`Running VACUUM rewrites the database to give back its free pages. It holds the write lock for as long as it takes, so requests in flight will wait, and it needs room on disk for a second copy while it runs.`,confirmLabel:`Compact database`,busy:i.isPending,onConfirm:()=>i.mutate(void 0,{onSettled:()=>c(!1)})})]})}var oe=ae;export{oe as component};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/_app.plugins._pluginId-CE8Jknhs.js","assets/Lamp-BHYJpauE.js","assets/Panel-CYQvfI3L.js","assets/preload-helper-D2sCuvIY.js","assets/Rack-CRuJZY00.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{n as e,r as t,t as n}from"./preload-helper-D2sCuvIY.js";var r=t(`/_app/plugins/$pluginId`)({component:e(()=>n(()=>import(`./_app.plugins._pluginId-CE8Jknhs.js`),__vite__mapDeps([0,1,2,3,4])),`component`)});export{r as t};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import{_ as e,h as t,i as n}from"./shared-BKWNmsjH.js";import{$ as r,A as i,B as ee,F as a,I as o,P as s,Q as te,X as c,Z as ne,et as re,g as l,l as ie,r as u,tt as d,u as ae}from"./Lamp-BHYJpauE.js";import{C as f,D as oe,O as se,_ as p,a as ce,b as m,i as le,t as ue,v as h,x as g,y as _}from"./Panel-CYQvfI3L.js";import{_ as de,d as v,i as fe,t as pe}from"./Rack-CRuJZY00.js";import{n as me,t as y}from"./chevron-right-B7JOx5ra.js";import{n as b,t as x}from"./stream-BUWwtwme.js";import{i as S,n as he}from"./Field-DK5zaBVA.js";import{t as C}from"./Meter-stpt3vQu.js";import{i as w,n as T,r as E,t as D}from"./Table-CVDZ69Zx.js";import{n as ge,r as O}from"./WindowChart-DVl7kwqb.js";import{i as _e,n as ve,r as ye,t as be}from"./RequestTable-D9hFf4o5.js";import{i as k,n as A,r as xe,t as Se}from"./SummaryDeck-D29h0rFx.js";import{Fragment as Ce,useMemo as j,useState as M}from"react";import{jsx as N,jsxs as P}from"react/jsx-runtime";import F from"styled-components";var I=F.div`
|
|
2
|
-
display: grid;
|
|
3
|
-
grid-template-areas:
|
|
4
|
-
"chassis"
|
|
5
|
-
"main";
|
|
6
|
-
grid-template-columns: minmax(0, 1fr);
|
|
7
|
-
grid-template-rows: auto minmax(0, 1fr);
|
|
8
|
-
height: 100vh;
|
|
9
|
-
min-height: 0;
|
|
10
|
-
overflow: hidden;
|
|
11
|
-
`,L=F.main`
|
|
12
|
-
grid-area: main;
|
|
13
|
-
padding: ${({theme:e})=>e.space(4)};
|
|
14
|
-
display: flex;
|
|
15
|
-
flex-direction: column;
|
|
16
|
-
gap: ${({theme:e})=>e.space(4)};
|
|
17
|
-
min-width: 0;
|
|
18
|
-
min-height: 0;
|
|
19
|
-
overflow-y: auto;
|
|
20
|
-
|
|
21
|
-
@media (max-width: 720px) {
|
|
22
|
-
padding: ${({theme:e})=>e.space(3)};
|
|
23
|
-
}
|
|
24
|
-
`;function R({children:e}){let{cadence:t}=de(),n=c(),r=ne(200,t(1e4,`res:logs`));return P(I,{"data-testid":`client-shell`,children:[N(v,{logs:r.data??[],logsFailed:r.isError,signOut:{pending:n.isPending,run:()=>{n.mutate(void 0,{onSuccess:()=>window.location.assign(`/login`)})}}}),N(L,{children:e})]})}var z=[20,50,100,250],B={"1m":`per minute`,"5h":`per 5 hours`,"1w":`per week`};function we({reading:e}){let t=e.window===null?`concurrent requests`:`${e.dimension} ${B[e.window]??e.window}`,n=e.dimension===`spend`?o:i,r=e.used===null?null:e.limit===0?1:e.used/e.limit;return P(w,{children:[N(T,{children:t}),N(T,{$align:`right`,$mono:!0,children:e.used===null?N(_,{children:`unknown`}):n(e.used)}),N(T,{$align:`right`,$mono:!0,children:n(e.limit)}),N(T,{children:r===null?null:N(C,{fraction:r,label:`${t}, ${Math.round(Math.min(1,r)*100)}% used`})})]})}function V(e){return{observedAt:e.observedAt,windowType:e.windowType,windowMs:e.windowMs,resetsAt:e.resetsAt,usedRatio:e.usedRatio}}function H(e){return{stale:e.stale,rolledOver:e.rolledOver,estimateStale:e.stale||e.rolledOver,survives:e.survives,exhaustsAt:e.exhaustsAt}}var U=F.div`
|
|
25
|
-
display: flex;
|
|
26
|
-
flex-direction: column;
|
|
27
|
-
gap: 4px;
|
|
28
|
-
`,W=F.div`
|
|
29
|
-
display: grid;
|
|
30
|
-
/* Bar, figure, legend — the accounts page's own three columns, so the two
|
|
31
|
-
screens read the same way and the legends stay aligned down the stack. */
|
|
32
|
-
grid-template-columns: 96px 34px 1fr;
|
|
33
|
-
align-items: center;
|
|
34
|
-
min-width: 208px;
|
|
35
|
-
gap: 6px;
|
|
36
|
-
`,G=F(h)`
|
|
37
|
-
font-size: 11px;
|
|
38
|
-
text-align: right;
|
|
39
|
-
`;function Te({windows:e,open:t,onToggle:n}){let r=e[0],i=e.filter(e=>e.usedRatio!==null);return P(w,{children:[N(T,{children:r.label}),N(T,{children:i.length===0?N(_,{children:`unknown`}):N(U,{children:i.map(e=>P(W,{children:[N(C,{fraction:e.usedRatio,label:`${e.label} ${e.windowType} window, ${Math.round(e.usedRatio*100)}% used`}),N(G,{children:s(e.usedRatio,0)}),N(p,{children:l(e,H(e),Date.now(),a)})]},e.windowType))})}),N(T,{$align:`right`,children:N(se,{type:`button`,$variant:`ghost`,$size:`sm`,"aria-expanded":t,"aria-label":`${t?`Hide`:`Show`} quota history for ${r.label}`,title:`${t?`Hide`:`Show`} quota history for ${r.label}`,onClick:n,children:N(t?me:y,{})})})]})}function K(){let{cadence:a,live:c}=de(),[l,se]=M(`24h`),[v,me]=M(`all`),[y,b]=M(``),[x,C]=M(z[0]),[F,I]=M(null),[L,R]=M(null),B=t(l),H=j(()=>B.grain===`daily`?e(Date.now()-B.ms):Math.floor((Date.now()-B.ms)/6e4)*6e4,[B]),U=j(()=>H+B.ms,[H,B]),W=re(),G={since:H,grain:B.grain},K=d({...G,groupBy:B.by},a(6e4,`res:usage`)),q=d({...G,groupBy:`model`},a(6e4,`res:usage`)),J=ne(x,a(ee,`res:logs`)),Y=te(6e4),X=Y.data??[],Ee=j(()=>{let e=new Map;for(let t of X){let n=e.get(t.provider)??new Map,r=n.get(t.credentialId);r===void 0?n.set(t.credentialId,[t]):r.push(t),e.set(t.provider,n)}return[...e.entries()].map(([e,t])=>[e,[...t.entries()].map(([e,t])=>({credentialId:e,windows:[...t].sort((e,t)=>u[e.windowType]-u[t.windowType])}))])},[X]),Z=X.map(e=>O(V(e))).filter(e=>e!==null),De=Z.length===0?0:Math.floor(Math.min(...Z)/6e4)*6e4,Oe=r({since:De},L!==null&&Z.length>0),ke=(J.data??[]).some(ae),Ae=_e(c&&ke),Q=ye(J.data??[],v,y),je=(J.data??[]).filter(ie).length,$=K.data??[],Me=$.reduce((e,t)=>e+t.requests,0),Ne=$.reduce((e,t)=>e+t.costUsd,0);return P(f,{$gap:4,children:[N(pe,{legend:`Client`,title:`Your usage`,summary:K.isLoading?`Reading your usage…`:`${i(Me)} requests and ${o(Ne)} over the last ${B.label}.`,actions:N(A,{children:n.map(e=>N(xe,{type:`button`,$size:`sm`,$on:e.id===l,"aria-pressed":e.id===l,onClick:()=>se(e.id),children:e.id},e.id))})}),N(ue,{legend:`Your key`,meta:W.data===void 0?void 0:P(h,{$dim:!0,children:[W.data.prefix,`…`]}),children:W.isPending?N(ce,{rows:2}):W.isError?N(le,{legend:`Could not read your key`,error:W.error}):P(f,{$gap:2,children:[P(m,{$gap:2,$wrap:!0,children:[N(p,{children:W.data.label}),W.data.bodyLoggingOptOut?N(_,{children:`Request bodies are never stored for this key.`}):null]}),W.data.modelAllowlist===null?N(_,{children:`Every model this gateway serves.`}):W.data.modelAllowlist.length===0?N(_,{children:`No models. This key cannot serve a request.`}):N(m,{$gap:1,$wrap:!0,children:W.data.modelAllowlist.map(e=>N(h,{children:e},e))})]})}),N(Se,{buckets:$,since:H,until:U,by:B.by,rangeLabel:B.label}),N(k,{legend:`By model`,meta:B.label,query:{isLoading:q.isLoading,isError:q.isError,error:q.error,refetch:()=>void q.refetch()},failure:`Could not read usage`,empty:{legend:`No traffic`,message:`Nothing served in this window.`},isEmpty:(q.data??[]).length===0,children:N(g,{children:P(D,{children:[N(`thead`,{children:P(`tr`,{children:[N(E,{children:`Model`}),N(E,{$align:`right`,children:`Requests`}),N(E,{$align:`right`,children:`Tokens`}),N(E,{$align:`right`,children:`Spend`})]})}),N(`tbody`,{children:(q.data??[]).map(e=>P(w,{children:[N(T,{$mono:!0,children:e.key}),N(T,{$align:`right`,$mono:!0,children:i(e.requests)}),N(T,{$align:`right`,$mono:!0,children:i(e.inputTokens+e.outputTokens+e.cacheReadTokens+e.cacheWriteTokens)}),N(T,{$align:`right`,$mono:!0,children:o(e.costUsd)})]},e.key))})]})})}),N(k,{legend:`Your limits`,query:{isLoading:W.isLoading,isError:W.isError,error:W.error,refetch:()=>void W.refetch()},failure:`Could not read your limits`,empty:W.data?.limits===null?{legend:`Limits unreadable`,message:`This key's limits could not be read. Requests are refused until an operator repairs it.`}:{legend:`No limits`,message:`This key is not rate limited.`},isEmpty:W.data?.limits===null||(W.data?.limitUsage.length??0)===0,footer:N(_,{children:`Counted from completed requests, so a burst in flight right now may not be included yet.`}),children:N(g,{children:P(D,{children:[N(`thead`,{children:P(`tr`,{children:[N(E,{children:`Limit`}),N(E,{$align:`right`,children:`Used`}),N(E,{$align:`right`,children:`Ceiling`}),N(E,{$width:`30%`,children:`Consumption`})]})}),N(`tbody`,{children:(W.data?.limitUsage??[]).map(e=>N(we,{reading:e},`${e.dimension}:${e.window??`gauge`}`))})]})})}),N(k,{legend:`Provider headroom`,query:{isLoading:Y.isLoading,isError:Y.isError,error:Y.error,refetch:()=>void Y.refetch()},failure:`Could not read provider headroom`,empty:{legend:`No data`,message:`No provider has reported a usage window.`},isEmpty:X.length===0,footer:N(_,{children:`What each account serving this gateway has left. A request is served by whichever account of a provider can take it.`}),children:N(f,{$gap:4,children:Ee.map(([e,t])=>P(f,{$gap:1,children:[N(p,{children:e}),N(g,{children:P(D,{children:[N(`thead`,{children:P(`tr`,{children:[N(E,{children:`Account`}),N(E,{$width:`60%`,children:`Quota`}),N(E,{})]})}),N(`tbody`,{children:t.map(({credentialId:e,windows:t})=>P(Ce,{children:[N(Te,{windows:t,open:L===e,onToggle:()=>R(L===e?null:e)}),L===e?N(w,{children:N(T,{colSpan:3,children:N(f,{$gap:4,children:t.map(e=>{let t=V(e),n=O(t),r=(Oe.data?.samples??[]).filter(t=>t.credentialId===e.credentialId&&t.windowType===e.windowType&&t.observedAt>=(n??0));return N(ge,{live:t,samples:r.map(e=>({observedAt:e.observedAt,windowType:e.windowType,windowMs:e.windowMs,resetsAt:e.resetsAt,usedRatio:e.usedRatio})),since:n,now:Date.now(),truncated:Oe.data?.truncated===!0&&n!==null&&r.length>0&&(r[0]?.observedAt??0)>n,ratePerHourRatio:e.ratePerHourRatio,exhaustsAt:e.exhaustsAt,survives:e.survives,stale:e.stale,rolledOver:e.rolledOver,spent:e.usedRatio===null?`no ceiling reported`:`${s(e.usedRatio,0)} used`,rateText:e.ratePerHourRatio===null?`unknown`:`${s(e.ratePerHourRatio,1)}/h`},e.windowType)})})})}):null]},e))})]})})]},e))})}),N(k,{legend:`Recent requests`,meta:`${Q.length} shown`,actions:P(A,{children:[N(he,{value:y,placeholder:`Filter by model or error`,"aria-label":`Filter requests`,style:{width:200},onChange:e=>b(e.target.value)}),P(S,{value:v,"aria-label":`Show which requests`,style:{width:`auto`},onChange:e=>me(e.target.value),children:[N(`option`,{value:`all`,children:`All requests`}),N(`option`,{value:`failed`,children:`Failed only`})]}),N(S,{value:x,"aria-label":`How many requests to fetch`,style:{width:`auto`},onChange:e=>C(Number(e.target.value)),children:z.map(e=>P(`option`,{value:e,children:[`last `,e]},e))})]}),query:{isLoading:J.isLoading,isError:J.isError,error:J.error,refetch:()=>void J.refetch()},failure:`Could not read your requests`,empty:{legend:`No requests`,message:(J.data??[]).length===0?`Nothing served through this key yet.`:`No request in this window matches the filter. Clear it to see everything.`},isEmpty:Q.length===0,footer:P(_,{children:[i(je),` of the last `,i((J.data??[]).length),` failed.`]}),children:N(g,{children:N(ve,{rows:Q,now:Ae,onOpen:I})})}),N(fe,{open:F!==null,onOpenChange:e=>{e||I(null)},title:`Request detail`,width:`640px`,footer:N(oe,{type:`button`,onClick:()=>I(null),children:`Close`}),children:F===null?null:N(be,{log:F})})]})}var q=()=>N(x,{children:N(b,{children:N(R,{children:N(K,{})})})});export{q as component};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/_app-BWNEo1e-.js","assets/Panel-CYQvfI3L.js","assets/client-DvN2dbYV.js","assets/shared-BKWNmsjH.js","assets/Lamp-BHYJpauE.js","assets/Rack-CRuJZY00.js","assets/chevron-right-B7JOx5ra.js","assets/stream-BUWwtwme.js","assets/Field-DK5zaBVA.js","assets/Meter-stpt3vQu.js","assets/Table-CVDZ69Zx.js","assets/WindowChart-DVl7kwqb.js","assets/RequestTable-D9hFf4o5.js","assets/TokenBreakdown-D5mQFSfo.js","assets/Chip-BZWa7onX.js","assets/SummaryDeck-D29h0rFx.js","assets/Readout-D6-aurU8.js","assets/_app.index-CgI1OrZR.js","assets/_app.accounts-C3Yv991L.js","assets/CopyValue-Cs2JUZQD.js","assets/plus-64jUPIDJ.js","assets/trash-2-rvGFhAn8.js","assets/Toggle-BIHUR4pS.js","assets/_app.console-Bvo2fugd.js","assets/_app.database-CfWNOIl-.js","assets/reasons-Du1OBWAM.js","assets/_app.keys-CcfPhvCD.js","assets/_app.logs-C8ZiArCn.js","assets/_app.models-nfMWzVb4.js","assets/_app.settings-C45FJLeX.js","assets/_app.usage-C5s-DfBV.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{$t as e,Jt as t,Kt as n,Qt as r,Sn as i,V as a,W as o,Xt as s,Yt as c,Zt as l,_n as u,an as d,bn as f,cn as p,dn as m,en as h,fn as g,gn as _,hn as v,in as y,ln as b,mn as x,nn as S,on as C,pn as w,rn as T,sn as ee,vn as E,wn as D,wt as te,xn as O}from"./Lamp-BHYJpauE.js";import{a as ne,c as re,i as ie,n as k,o as ae,r as A,s as oe,t as j}from"./preload-helper-D2sCuvIY.js";import{A as se,C as ce,D as le,_ as ue,a as de,k as M,l as fe,s as pe,t as me}from"./Panel-CYQvfI3L.js";import{h as he,n as ge,p as _e}from"./Rack-CRuJZY00.js";import{n as ve,t as ye}from"./stream-BUWwtwme.js";import{t as be}from"./login-9Ovj_4DV.js";import{t as xe}from"./_app.plugins._pluginId-ByykviWs.js";import{MutationCache as Se,QueryCache as Ce,QueryClient as we,QueryClientProvider as Te}from"@tanstack/react-query";import*as N from"react";import{StrictMode as Ee}from"react";import{Fragment as De,jsx as P,jsxs as F}from"react/jsx-runtime";import{createRoot as Oe}from"react-dom/client";import ke from"styled-components";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function I(e){return e?.isNotFound===!0}function Ae(){try{return sessionStorage}catch{return}}var je=`tsr-scroll-restoration-v1_3`,Me=Ae();function Ne(){try{return JSON.parse(Me?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}function Pe(){try{Me?.setItem(je,JSON.stringify(L))}catch{}}var L=Ne(),Fe=`data-scroll-restoration-id`,Ie=e=>e.state.__TSR_key||e.href;function Le(e){let t=e.getAttribute(Fe);if(t)return`[${Fe}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var Re=!1,ze=`window`;function Be(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function Ve(e){let t=new Set;for(let n of e){if(n===ze)continue;let e=Be(n);e&&t.add(e)}return t}function He(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);let i=e.options.getScrollRestorationKey||Ie,a=new Set,o=e=>{let t=L[e]||={};for(let e of a)e===document?t[ze]={scrollX,scrollY}:e.isConnected&&(t[Le(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.restoration&&(r.restoration=!0,Re=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{Re||a.add(e.target)},!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&o(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{o(i(e.stores.resolvedLocation.get()??e.stores.location.get())),Pe()})),!r.reset&&(r.reset=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.next,c=r.hash,l;if(a.clear(),r.next=!0,r.hash=!1,typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let u=i(t.toLocation),d=t.fromLocation&&i(t.fromLocation);if(r.restoring&&d&&d!==u){let e=L[d];if(e){let t=L[u];for(let n in e){if(n===ze){if(s)continue}else{let e=Be(n);if(!e||s&&o&&(l??=Ve(o),l.has(e)))continue}t||=L[u]={},t[n]??=e[n]}}}Re=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=Ve(o));let t=e&&i&&c,s=r.restoring?L[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===ze){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=Be(e);t&&(t.scrollLeft=r,t.scrollTop=i,l?.delete(t))}}if(!e){let e={top:0,left:0,behavior:n};if(a||scrollTo(e),l)for(let t of l)t.scrollTo(e)}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{Re=!1}}))}function Ue(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function We(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function Ge(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=We(r):Array.isArray(t)?t.push(We(r)):n[e]=[t,We(r)]}return n}var Ke=/^(?:\s|["[{\d-]|fa|nu|tr)/,qe=Ye(JSON.parse),Je=Xe(JSON.stringify,JSON.parse);function Ye(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=Ge(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function Xe(e,t){let n=t===JSON.parse;function r(r){if(r&&typeof r==`object`)try{return e(r)}catch{}else if(t&&typeof r==`string`){if(n&&!Ke.test(r))return r;try{return t(r),e(r)}catch{}}return r}return e=>{let t=Ue(e,r);return t?`?${t}`:``}}function Ze(e){return{input:({url:t})=>{for(let n of e)t=$e(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=et(e[n],t);return t}}}function Qe(e){let t=h(e.basepath),n=`/${t}`,i=e.caseSensitive?n:n.toLowerCase(),a=`${i}/`;return{input:({url:t})=>{let r=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return r===i?t.pathname=`/`:r.startsWith(a)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=r([`/`,t,e.pathname]),e)}}function $e(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function et(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function tt(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i}=t,a=new Map,o=n(`idle`),s=n(e),c=n(void 0),l=n([]),u=r(()=>l.get().map(e=>a.get(e).get())),d=r(()=>({status:o.get(),isLoading:o.get()===`pending`,matches:u.get(),location:s.get(),resolvedLocation:c.get()}));function f(e){let t=a.get(e);return t||(t=n(void 0),a.set(e,t)),t}let p={status:o,location:s,resolvedLocation:c,ids:l,matches:u,byRoute:a,__store:d,getMatchStore:f,setMatches:m};function m(e){let t=l.get(),n=e.map(e=>e.routeId);i(()=>{g(t,n)||l.set(n);for(let e of t)n.includes(e)||a.get(e).set(()=>void 0);for(let t of e){let e=f(t.routeId);e.get()!==t&&e.set(t)}})}return p}var R=`__TSR_index`,nt=`popstate`,rt=`beforeunload`;function it(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=ct(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[R];i=at(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[R];i=at(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[R]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function at(e,t){t||={};let n=lt();return{...t,key:n,__TSR_key:n,[R]:e}}function ot(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>ct(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=lt();t.history.replaceState({[R]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_=()=>{g&&(S._ignoreSubscribers=!0,(g[2]?t.history.pushState:t.history.replaceState)(g[1],``,g[0]),S._ignoreSubscribers=!1,g=void 0,u=void 0)},v=(e,t,n)=>{let r=s(t),i=!!g;i||(u=l),l=ct(t,n),g=[r,n,g?.[2]||e],i||queueMicrotask(()=>_())},y=e=>{l=c(),S.notify({type:e})},b=async()=>{if(f){f=!1;return}let e=c(),n=e.state[R]-l.state[R],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),S.notify(u);return}}}l=c(),S.notify(u)},x=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},S=it({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>v(!0,e,t),replaceState:(e,t)=>v(!1,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(rt,x,{capture:!0}),t.removeEventListener(nt,b)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(rt,x,{capture:!0}),t.addEventListener(nt,b),t.history.pushState=function(...e){let r=n.apply(t.history,e);return S._ignoreSubscribers||y(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return S._ignoreSubscribers||y(`REPLACE`),n},S}function st(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function ct(e,t){let n=st(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=lt();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[R]:0,key:a,__TSR_key:a}}}function lt(){return(Math.random()+1).toString(36).substring(7)}function ut(e){return e.options.loader||e.options.beforeLoad||e.lazyFn||e.options.component?.preload||e.options.pendingComponent?.preload}function dt(e,t){return{fromLocation:t,toLocation:e,pathChanged:t?.pathname!==e.pathname,hrefChanged:t?.href!==e.href,hashChanged:t?.hash!==e.hash}}function ft({key:e,__TSR_key:t,__TSR_index:n,__hashScrollIntoViewOptions:r,...i}){return i}function pt(e,t,n,r){for(let i of t){if(r?.()===!1)return;n.some(e=>e.routeId===i.routeId)||e.routesById[i.routeId].options.onLeave?.(i)}for(let i of n){if(r?.()===!1)return;e.routesById[i.routeId].options[t.some(e=>e.routeId===i.routeId)?`onStay`:`onEnter`]?.(i)}}var mt=class{constructor(t,n){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=async e=>(e(),!1),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??!1??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=s(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history?this.options.history:ot()),this.origin=this.options.origin,this.origin||=window?.origin&&window.origin!==`null`?window.origin:`http://localhost`,this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=b(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=tt(this.latestLocation,e),He(this)}let a=this.options.basepath??`/`,o=this.options.rewrite;if(r||n!==a||i!==o){this.basepath=a;let e=[],t=h(a);t&&t!==`/`&&e.push(Qe({basepath:a})),o&&e.push(o),this.rewrite=e.length===0?void 0:e.length===1?e[0]:Ze(e),this.history&&this.updateLatestLocation(),this.stores&&this.stores.location.set(this.latestLocation)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=p(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&ee(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{for(let t of this.subscribers)if(t.eventType===e.type)try{t.fn(e)}catch(e){console.error(e)}},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:a,state:o})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let a=this.options.parseSearch(n),s=this.options.stringifySearch(a);return{href:e+s+r,publicHref:e+s+r,pathname:w(e).path,external:!1,searchStr:s,search:O(t?.search,a),hash:w(r.slice(1)).path,state:i(t?.state,o)}}let s=new URL(a,this.origin),c=$e(this.rewrite,s),l=this.options.parseSearch(c.search),u=this.options.stringifySearch(l);return c.search=u,{href:c.href.replace(c.origin,``),publicHref:a,pathname:w(c.pathname).path,external:!!this.rewrite&&c.origin!==this.origin,searchStr:u,search:O(t?.search,l),hash:w(c.hash.slice(1)).path,state:i(t?.state,o)}},r=n(e),{__tempLocation:a,__tempKey:o}=r.state;if(a&&(!o||o===this.tempLocationKey)){let e=n(a);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(t,n)=>e({base:t,to:n.includes(`//`)?c(n):n,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>{let t=Object.create(null),n=d(S(e),this.processedTree,!0);return n&&Object.assign(t,n.rawParams),[n?.branch||[this.routesById.__root__],t,n?.route]},this.buildLocation=e=>{let t=(t={})=>{let n=t._fromLocation||this._pendingLocation||this.latestLocation,r=this.matchRoutesLightweight(n);t.from;let a=t.unsafeRelative===`path`?n.pathname:t.from??r[1],o=t.to?`${t.to}`:void 0,s=r[2],c=Object.assign(Object.create(null),r[3]),d=o?.charCodeAt(0)===47?`/`:this.resolvePathWithBase(a,`.`),f=o?this.resolvePathWithBase(d,o):d,p=bt(t.params,c),m=this.routesByPath[S(f)],h;if(m)h=this.getRouteBranch(m);else if(f.includes(`$`))h=[];else{let[e,t,n]=this.getMatchedRoutes(f);h=e,this.options.notFoundRoute&&(!n||n.path!==`/`&&t[`**`])&&(h=[...h,this.options.notFoundRoute])}if(h.length&&u(p))for(let e of h){let t=e.options.params?.stringify??e.options.stringifyParams;if(t)try{Object.assign(p,t(p))}catch{}}let g=e.leaveParams?f:w(l({path:f,params:p,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,y=s;if(e._includeValidateSearch&&this.options.search?.strict){let e={};h.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,_t(t.options.validateSearch,{...e,...y}))}catch{}}),y=e}y=vt(y,t,h,e._includeValidateSearch),y=O(s,y);let b=this.options.stringifySearch(y),x=t.hash===!0?n.hash:t.hash?_(t.hash,n.hash):void 0,C=x?`#${x}`:``,T=t.state===!0?n.state:t.state?_(t.state,n.state):{};T=i(n.state,T);let ee=`${g}${b}${C}`,E,D,te=!1;if(this.rewrite){let e=new URL(ee,this.origin),t=et(this.rewrite,e);E=e.href.replace(e.origin,``),t.origin===this.origin?D=t.pathname+t.search+t.hash:(D=t.href,te=!0)}else E=v(ee),D=E;return{publicHref:D,href:E,pathname:g,search:y,searchStr:b,state:T,hash:x??``,external:te,unmaskOnReload:t.unmaskOnReload}},n=(n={},r)=>{let i=t(n),a=r?t(r):void 0;if(!a){let n=Object.create(null);if(this.options.routeMasks){let o=y(i.pathname,this.processedTree);if(o){Object.assign(n,o.rawParams);let{from:i,params:s,...c}=o.route,l=bt(s,n);r={from:e.from,...c,params:l},a=t(r)}}}return a&&(i.maskedLocation=a),i};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r,i=S(this.latestLocation.href)===S(n.href)&&x(ft(n.state),ft(this.latestLocation.state)),a=this._commitPromise,o,s=new Promise(e=>{o=e});if(s.resolve=()=>{o(),a?.resolve()},this._commitPromise=s,i)this.load();else{let{maskedLocation:i,hashScrollIntoView:a,...o}=n;i&&(o={...i,state:{...i.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state.__hashScrollIntoViewOptions=a??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,r=n.replace?`REPLACE`:`PUSH`,this.history[r===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t}),this.history.subscribers.size||this.load({action:{type:r}})}return this._scroll.next=n.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,_redirects:a,href:o,...s}={})=>{if(o){let t=this.history.location.state.__TSR_index,n=ct(o,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);s.to=$e(this.rewrite,r).pathname,s.search=this.options.parseSearch(n.search),s.hash=n.hash.slice(1)}let c=this.buildLocation({...s,_includeValidateSearch:!0});a&&(c._redirects=a),this._pendingLocation=c;let l=this.commitLocation({...c,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return queueMicrotask(()=>{this._pendingLocation===c&&(this._pendingLocation=void 0)}),l},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(E(t,this.protocolAllowlist))return;if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return}i.replace?window.location.replace(t):window.location.href=t;return}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.load=async e=>{this.updateLatestLocation(),e?.action&&(this._scroll.hash=e.action.type===`PUSH`||e.action.type===`REPLACE`),await tn(this,e)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&window.CSS?.supports?.(`selector(:active-view-transition-type(a))`)){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(dt(r,i)):t.types;if(a===!1)return e();n={update:e,types:a}}else n=e;return document.startViewTransition(n).updateCallbackDone}return e()},this.invalidate=e=>{let t=this._committed,n=e?.filter,r=this._preloads,i=new Set([...t,...this._cache.values(),...[...r?.values()??[]].flat(),...this._tx?.[3]??[]].filter(e=>!n||n(e)).map(e=>e.id)),a=[];for(let[e,t]of r??[])t.some(e=>i.has(e.id))&&(r.delete(e),a.push(e));let o=t=>{if(i.has(t.id)){let n=this.routesById[t.routeId],r={...t,invalid:!0,...(e?.forcePending||t.status===`error`||t.status===`notFound`)&&ut(n)?{status:`pending`,error:void 0}:void 0};return t._flight=void 0,r}return t};this._committed=t.map(o);for(let[t,n]of this._cache)i.has(t)&&(n.invalid=!0,e?.forcePending&&(n.status=`pending`));for(let e of i)this._flights?.delete(e);for(let e of a)e.abort();return this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href||e.options._builtLocation){let t=(e.options._builtLocation??this.buildLocation(e.options)).publicHref||`/`;e.options.href=t,e.headers.set(`Location`,t)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&!e.options._builtLocation&&E(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=this._cache,n=this._preloads,r=e?.filter,i=[],a=[];for(let[e,n]of t)(!r||r(n))&&(a.push(e),i.push(n));let o=[];for(let[e,t]of n??[])(!r||t.some(r))&&(o.push(e),i.push(...t));for(let e of a)t.delete(e);for(let e of o)n.delete(e);for(let e of i){let t=e._flight;e._flight=void 0,t&&!--t[2]&&(this._flights?.get(e.id)===t&&this._flights.delete(e.id),o.push(t[1]))}for(let e of o)e.abort()},this.loadRouteChunk=z,this.preloadRoute=e=>nn(this,e),this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n),i=this.stores.status.get()===`pending`;if(t?.pending&&!i)return!1;let a=t?.pending??!i?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),o=C(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,a.pathname,this.processedTree);return!o||e.params&&!x(o.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?x(a.search,r.search,{partial:!0})?o.rawParams:!1:o.rawParams},this.getStoreConfig=n,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??`fuzzy`,stringifySearch:t.stringifySearch??Je,parseSearch:t.parseSearch??qe,protocolAllowlist:t.protocolAllowlist??m}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=T(e),this.routeBranchCache.set(e,t)),t}matchRoutesInternal(e,t){let[n,r,a]=this.getMatchedRoutes(e.pathname),o=n,s=!1;(a?a.path!==`/`&&r[`**`]:S(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:s=!0);let c=s?yt(this.options.notFoundMode,o):void 0,u=Array(o.length),d=this._committed,f=(e,t)=>{let n=d[t];return n?.routeId===e.id?n:e===this.options.notFoundRoute?d.find(t=>t.routeId===e.id):void 0},p;for(let n=0;n<o.length;n++){let a=o[n],s=u[n-1],d,m,h;{let n=s?.search??e.search,r=s?._strictSearch??void 0;try{let e=_t(a.options.validateSearch,{...n})??void 0;d={...n,...e},m={...r,...e}}catch(e){let r=e;if(e instanceof ht||(r=new ht(e.message,{cause:e})),t?.throwOnError)throw r;d=n,m={},h=r}}let g=``,_=``;try{g=a.options.loaderDeps?.({search:d})??``,_=g&&JSON.stringify(g)||``}catch(e){if(t?.throwOnError)throw e;h??=e}let{interpolatedPath:v,usedParams:y}=l({path:a.fullPath,params:r,decoder:this.pathParamsDecoder,server:this.isServer}),b=a.id+v+_,x=f(a,n),S=this._cache.get(b)??(x?.id===b?x:void 0);p=S?._strictParams??Object.assign(y,p);let C;if(!S)try{xt(a,p)}catch(e){if(C=I(e)||ae(e)?e:new gt(e.message,{cause:e}),t?.throwOnError)throw C}let w=x?`stay`:`enter`,T;if(S)T={...S,cause:w,search:O(x?x.search:S.search,d),_strictSearch:m,searchError:h};else{let e=ut(a)?`pending`:`success`;T={id:b,ssr:a.options.ssr,index:n,routeId:a.id,params:x?.params??p,_strictParams:p,pathname:v,updatedAt:Date.now(),search:x?O(x.search,d):d,_strictSearch:m,searchError:h,status:e,isFetching:!1,error:void 0,paramsError:C,context:{},abortController:t?._controller??new AbortController,cause:w,loaderDeps:x?i(x.loaderDeps,g):g,invalid:!1,preload:!1,staticData:a.options.staticData||{},fullPath:a.fullPath}}let ee=c===a.id;T._notFound&&!ee&&(T.error=void 0),T._notFound=ee,u[n]=T}for(let e=0;e<u.length;e++){let n=u[e];n.params=n.cause===`stay`?O(n.params,p):p,t?._controller&&(n.context={})}return u}matchRoutesLightweight(e){let t=f(this.stores.ids.get()),n=t?this.stores.byRoute.get(t).get():void 0,r=n?.id,i=this.lightweightCache.get(e);if(i&&i[0]===r)return i[1];let[a,o]=this.getMatchedRoutes(e.pathname),s=f(a),c={...e.search};for(let e of a)try{Object.assign(c,_t(e.options.validateSearch,c))}catch{}let l=n&&n.routeId===s.id&&n.pathname===e.pathname,u;if(l)u=n.params;else{let e=Object.assign(Object.create(null),o);for(let t of a)try{xt(t,e)}catch{}u=e}let d=[a,s.fullPath,c,u];return this.lightweightCache.set(e,[r,d]),d}},ht=class extends Error{},gt=class extends Error{};function _t(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new ht(`Async validation not supported`);if(n.issues)throw new ht(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function vt(e,t,n,r){let i=[];for(let e of n){let t=e.options;`search`in t?t.search?.middlewares&&i.push(...t.search.middlewares):(t.preSearchFilters||t.postSearchFilters)&&i.push(({search:e,next:n})=>{let r=n(t.preSearchFilters?t.preSearchFilters.reduce((e,t)=>t(e),e):e);return t.postSearchFilters?t.postSearchFilters.reduce((e,t)=>t(e),r):r});let n=t.validateSearch;n&&i.push(({search:e,next:t,meta:i})=>{let a=t(e);if(r)try{let e=_t(n,a);if(i&&e)for(let t in e)t in a||(i.defaulted||=new Map).set(t,e[t]);return{...a,...e}}catch{}return a})}let a=(e,n,r)=>{if(e>=i.length){if(!t.search)return{};if(t.search===!0)return n;let e=_(t.search,n);return r&&(r.explicit=e),e}return i[e]({search:n,next:(t,n)=>{if(n){let n=r||{};return{search:a(e+1,t,n),meta:n}}return a(e+1,t,r)},meta:r})};return a(0,e)}function yt(e,t){if(e!==`root`){let e;for(let n=t.length-1;n>=0;n--){let r=t[n];if(r.options.notFoundComponent)return r.id;e||=r.children&&r.id}if(e)return e}return re}function bt(e,t){return e===!1||e===null?Object.create(null):(e??!0)===!0?t:Object.assign(t,_(e,t))}function xt(e,t){let n=e.options.params?.parse??e.options.parseParams;n&&Object.assign(t,n(t))}function St(e,t){return e.options[t]?.preload?.()}function Ct(e,t){let n=St(e,`component`),r=St(e,`pendingComponent`),i=t&&r?r.then(t):r;return t&&!r&&t(),n&&i?Promise.all([n,i]).then(()=>{}):n??i}function z(e,t,n){let r=()=>t===!1?void 0:t?St(e,t):Ct(e,n),i=e._lazy;if(i)return i===!0?r():i.then(r);if(!e.lazyFn)return r();let a=e.lazyFn().then(t=>{{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazy=!0}},t=>{throw e._lazy=void 0,t});return e._lazy=a,a.then(r)}function wt(e){let t=e.findIndex(e=>e.status!==`success`||e._notFound)+1;return t&&t<e.length?e.slice(0,t):e}var B=0,V=1,Tt=2,H=3,U=4;function Et(e){return typeof e[0]==`number`}function W(e,t){return t.aborted?Promise.race([Promise.reject(t),e]):new Promise((n,r)=>{let i=()=>r(t);t.addEventListener(`abort`,i,{once:!0}),Promise.resolve(e).then(n,r).finally(()=>t.removeEventListener(`abort`,i))})}function G(e,t){return e.routesById[t.routeId]}function Dt(e,t,n){return ae(e)?[H,e]:I(e)?(e.routeId||=n,[Tt,e]):(t&&typeof e?.then==`function`&&(e=Error(`A Promise was thrown`,{cause:e})),t?[V,e]:[B,e])}function Ot(e,t){let n=Dt(t,!0,e.id);if(n[0]!==V)return n;try{e.options.onError?.(n[1])}catch(t){n=Dt(t,!0,e.id)}return n}function kt(e,t,n){return n[0].signal.aborted||!n[2]()?(n[0].abort(),[U]):Ot(e,t)}function At(e,t){return n=>e.navigate({...n,_fromLocation:t})}async function jt(e,t,n,r,i,a){let[o,s]=t,c=n[0].signal,l=!!n[4];for(let t=n[7]??0;t<r;t++){let r=s[t],i=G(e,r);r.abortController=n[0];let u=s[t-1]?.context??e.options.context??{},d={params:r.params,location:o,navigate:At(e,o),buildLocation:e.buildLocation,cause:l?`preload`:r.cause,abortController:n[0],preload:l,matches:s,routeId:i.id},f=u;try{let e=r._ctx;!e&&i.options.context&&(e=r._ctx=i.options.context({...d,deps:r.loaderDeps,context:u})||{}),f={...u,...e},r.context=f}catch(a){return K(e,r),[t,kt(i,a,n)]}if(c.aborted||!n[2]())return n[0].abort(),[t,[U]];let p=r.paramsError??r.searchError;if(p!==void 0)return K(e,r),[t,kt(i,p,n)];let m=i.options.beforeLoad;if(!m)continue;let h={...d,search:r.search,context:f,...e.options.additionalContext},g=r.status;g===`success`&&t>=a&&(r.status=`pending`),n[8]?.();try{Pt(e,r,`beforeLoad`,n[0]);let a=await W(m(h),c);if(!n[2]())return n[0].abort(),[t,[U]];let o=Dt(a,!1,i.id);if(o[0]!==B)return K(e,r),[t,o];r.context={...f,...a}}catch(a){return K(e,r),[t,kt(i,a,n)]}finally{g===`success`&&r.status===`pending`&&(r.status=`success`),Pt(e,r,!1,n[0])}}i()}function Mt(e,t,n){if(!(!n||--n[2])){if(e._flights?.get(t.id)===n){let n=e._tx;if(n&&!n[0].signal.aborted&&!n[3].includes(t)&&n[3].some(e=>e.id===t.id)&&n[3].some(e=>e.isFetching===`beforeLoad`))return;e._flights.delete(t.id)}return n[1]}}function K(e,t){let n=t._flight;t._flight=void 0,Mt(e,t,n)?.abort()}function q(e,t,n,r){let i=[];for(let a of t)if(!n?.includes(a)){let t=a._flight;if(a._flight=void 0,r&&t?.[2]===1&&e._flights?.get(a.id)===t&&n?.some(e=>e.id===a.id))t[2]=0;else{let n=Mt(e,a,t);n&&i.push(n)}}for(let e of i)e.abort()}function Nt(e){for(let t of e){let e=t._flight;e&&e[2]++}}function Pt(e,t,n,r){if(t.isFetching=n,r&&e._tx?.[0]!==r)return;let i=e.stores.byRoute.get(t.routeId),a=i?.get();a?.id===t.id&&i.set({...a,isFetching:n})}function Ft(e,t,n,r,i,a,o){let s=t[0];return{params:n.params,location:s,navigate:At(e,s),cause:o?`preload`:n.cause,abortController:i,preload:o,deps:n.loaderDeps,parentMatchPromise:a,context:n.context,route:r,...e.options.additionalContext}}async function It(e,t,n,r,i,a,o,s){let c=s.signal;if(c.aborted)return[U];if(!i)return[B,void 0];let l=n._flight;Pt(e,n,`loader`,s);try{if(!l){let s=new AbortController;l=[Promise.resolve().then(()=>i(Ft(e,t,n,r,s,a,o))).then(e=>Dt(e,!1,r.id),e=>Dt(e,!0,r.id)).then(t=>(t[0]!==B&&e._flights?.get(n.id)===l&&(e._flights.delete(n.id),l[2]||s.abort()),t[0]===V&&l[2]?Ot(r,t[1]):t)),s,1],(e._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],await W(l[0],c)}catch(t){if(t!==c)throw t;return K(e,n),[U]}finally{Pt(e,n,!1,s)}}function Lt(e,t,n){t[0]===B?(e.loaderData=t[1],e.error=void 0,e.status=`success`,e.invalid=!1,e.updatedAt=Date.now(),e.preload=n):t[0]!==H&&(e.status=`success`,e.error=void 0,e.invalid=!0)}function Rt(e,t,n){let r=e._cache.get(t.id);if(r!==n||e._committed.some(e=>e.id===t.id&&e._flight===t._flight))return;let i={...t,_notFound:void 0,context:{}};i._flight&&i._flight[2]++,e._cache.set(t.id,i),r&&K(e,r)}function zt(e,t){return t[0]===V||t[0]===Tt?{...e,status:t[0]===V?`error`:`notFound`,error:t[1],_flight:void 0}:e}function Bt(e,t,n,r,i,a,o){let s=t[1][n],c=G(e,s),l=!!a[4],u=l?e._cache.get(s.id):void 0,d,f=!1,p;try{if(s.status===`success`&&(d=c.options.shouldReload,typeof d==`function`&&(d=d(Ft(e,t,s,c,a[0],i,l))),a[2]()||(a[0].abort(),p=[U])),!p)if(s.status!==`success`)f=!0;else{let t=a[4]||s.preload?c.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:c.options.staleTime??e.options.defaultStaleTime??0;f=!!(s.invalid||d||d===void 0&&Date.now()-s.updatedAt>=t&&(a[6]||s.cause===`enter`||a[3].some(e=>e.routeId===s.routeId&&e.id!==s.id)))}}catch(t){s.invalid=!0,K(e,s),p=kt(c,t,a)}let m=c.options.loader,h=typeof m==`function`?m:m?.handler,g=(!l||c.options.preload!==!1)&&m?e._flights?.get(s.id):void 0;g===s._flight||p?g=void 0:g&&!f&&!l&&d===void 0?f=!0:f||(g=void 0);let _=!!(m&&f&&s.status===`success`&&!l&&!a[5]&&((typeof m==`function`?void 0:m?.staleReloadMode)??e.options.defaultStaleReloadMode)!==`blocking`),v=f&&(!l||c.options.preload!==!1),y=v&&!_&&(s.status!==`success`||!!m),b=c.lazyFn&&c._lazy!==!0?a[8]:void 0;if(v&&!m&&(s.invalid=!1,s.updatedAt=Date.now()),g&&g[2]++,y){let t=s._flight;s._flight=g,Mt(e,s,t)?.abort(),s.status===`success`&&n>=o&&(s.status=`pending`),a[8]?.()}v||(s.isFetching=!1);let x=(p?Promise.resolve(p):y?It(e,t,s,c,h,i,l,a[0]):Promise.resolve([B,s.loaderData])).then(t=>(y&&(Lt(s,t,l),t[0]===B&&(l&&m&&!a[0].signal.aborted&&Rt(e,s,u),s.status=`pending`)),t)),S=W(Promise.resolve().then(()=>z(c,void 0,b)),a[0].signal).then(()=>void 0,e=>[n,kt(c,e,a)]).then(e=>x.then(t=>(y&&!e&&t[0]===B&&s.status===`pending`&&a[2]()&&(s.status=`success`,a[8]?.()),e)));if(r.push([n,x,S]),!_)return x.then(e=>zt(s,e));let C={...s,status:`pending`,preload:!1,_flight:g};s.invalid=!1,s.isFetching=`loader`;let w=It(e,t,C,c,h,i,!1,a[0]).then(e=>(s.isFetching=!1,Lt(C,e,!1),e));return(t[2]??=[]).push([n,w,S,C]),w.then(e=>zt(C,e))}async function Vt(e,t,n,r,i=0){let a=n?.[1][1],o=a?.routeId?t.findIndex(e=>e.routeId===a.routeId):n?.[0]??t.length-1;o<0&&(o=0);for(let n=o;n>=0;n--){let i=G(e,t[n]),a=z(i,!1);if(a)try{await W(a,r)}catch(e){if(e===r)throw e}if(i.options.notFoundComponent)return n}return a?.routeId?o:i}function J(e,t){t[2]&&=(q(e,t[2].map(e=>e[3])),void 0)}async function Ht(e,t,n,r){let i;try{await Promise.all(e.map(e=>e[1].then(async t=>{let a=e[0];if(!(r&&a>=await r)){if(t[0]>=H)throw[a,t];!i&&t[0]!==B&&(i=[a,t],await Promise.all((n??[]).map(e=>{if(!(e[0]<=a))return e[1].then(t=>{if(t[0]===H)throw[e[0],t]})})))}})))}catch(e){return e}return t??i}async function Ut(e,t,n,r,i,a,o){let s=t[1],c=await a,l=!1,u=s.findIndex(e=>e._notFound),d=t=>t[1][0]===Tt?Vt(e,s,t,r.signal):t[0],f=u<0?s.length:u;if((c?.[1][0]??0)>=H)f=0;else if(c){f=c[2]??=await d(c);for(let e of n){if(e[0]>=f)break;let t=await e[1];if(t[0]!==B&&t[0]<H&&!(`loaderData`in s[e[0]])){c=[e[0],t],f=c[2]=await d(c);break}}}for(let e of n){if(e[0]>=f)break;let t=await e[2];if(t){c=t;break}}if((c?.[1][0]??0)>=H){let n=c[1];if(n[0]!==H||n[1].options.reloadDocument||i<20)return J(e,t),n;l=!0,c=[0,[V,Error(`Too many redirects`)]]}let p=c?c[2]??await d(c):u;if(p>=0){let i=c?.[1],a=i?.[0],u=s[p],d=i?.[1],f=()=>{i&&(u._notFound=void 0,a===V?u.status=`error`:(d.routeId=u.routeId,u.routeId===e.routeTree.id?(u.status=`success`,u._notFound=!0):u.status=`notFound`),u.error=d,u.isFetching=!1)};f();let m=G(e,u);try{await W(i?Promise.resolve().then(()=>z(m,a===V?`errorComponent`:`notFoundComponent`)):Promise.all([z(m),z(m,`notFoundComponent`)]),r.signal)}catch(n){if(n===r.signal)return J(e,t),[U]}i?l&&(r.abort(),await Promise.all([...n.map(e=>e[1]),...n.map(e=>e[2]),...(t[2]??[]).map(e=>e[1])]),J(e,t),q(e,s),f()):(u.status=`success`,o?.())}return t}async function Wt(e,t,n,r=0,i=t[1].length){let a=t[1];for(let t=r;t<i;t++){let r=a[t],i=G(e,r).options;if(i.head||i.scripts)try{let t={ssr:e.options.ssr,matches:a,match:r,params:r.params,loaderData:r.loaderData},[o,s]=await W(Promise.all([i.head?.(t),i.scripts?.(t)]),n);r.meta=o?.meta,r.links=o?.links,r.headScripts=o?.scripts,r.styles=o?.styles,r.scripts=s}catch(e){if(e===n)break;console.error(e)}if(r.status!==`success`||r._notFound)break}return t}async function Gt(e,t,n,r){let i=[t,n],a=e.stores.matches.get(),o=n.findIndex(e=>e._notFound);if(e.options.notFoundMode!==`root`&&o>=0){let t=await Vt(e,i[1],void 0,r[0].signal,o);t!==o&&(n[o]._notFound=void 0,n[t]._notFound=!0),o=t}let s=o<0?n.length:o+1,c=0;for(;c<s&&c!==o;){let e=n[c],t=r[3][c],i=a[c];if(t?.id!==e.id||t.status!==`success`||t._notFound||e.preload||i?.id!==e.id||i.status!==`success`||i._notFound)break;c++}let l=[],u=r[7]??0,d=u?Promise.resolve(i[1][u-1]):void 0,f=()=>{for(let t=u;t<s&&!r[0].signal.aborted;t++)d=Bt(e,i,t,l,d,r,c)},p=await jt(e,i,r,s,f,c);if(p&&(r[5]=!0,s=p[0],p[1][0]===Tt?(p[2]=await Vt(e,i[1],p,r[0].signal),s=Math.min(s,p[2]+1)):p[1][0]>=H&&(s=0),f()),r[2]()&&!r[4]){let t=[];for(let[n,r]of e._flights??[])r[2]||(e._flights.delete(n),t.push(r[1]));for(let e of t)e.abort()}let m;try{let t=Ut(e,i,l,r[0],r[1],Ht(l,p,i[2]),r[8]);i[2]?.length&&(i[3]=Ht(i[2],void 0,void 0,t.then(e=>Et(e)?0:wt(e[1]).length,()=>0))),m=await t}catch(t){throw J(e,i),t}return Et(m)?m:Wt(e,m,r[0].signal,r[7]===m[1].length?r[7]:0)}function Kt(e,t){if(e._tx!==t)return;let n=e._pending,r=!1,i=n?.[0][3][n[1]]?.id;n?.[0]!==t&&(n&&t[3][n[1]]?.id===i?(n[0]=t,r=!0):(clearTimeout(n?.[3]),e._pending=n=void 0));let a=t[3],o=e.stores.matches.get(),s=-1,c,l,u,d=!1;for(let t=0;t<a.length;t++){let n=a[t],r=n.status===`success`;if(d=o[t]?.id===n.id&&o[t]?.status===`pending`,r&&!d)continue;let i=G(e,n);if(c=r&&d||n.invalid?0:i.options.pendingMs??e.options.defaultPendingMs,u=i.options.pendingComponent??e.options.defaultPendingComponent,!u||typeof c!=`number`||c===1/0)return;s=t,l=i.options.pendingMinMs??e.options.defaultPendingMinMs??0;break}if(s<0)return;let f=a[s].id;if((!n||n[1]!==s||i!==f)&&(clearTimeout(n?.[3]),e._pending=n=[t,s,d?Date.now()+l:t[4]+c,void 0,d?Promise.resolve(!0):void 0,u]),n[4]&&!r&&n[5]===u)return;if(n[5]=u,!n[4]){clearTimeout(n[3]);let r=n[2]-Date.now();if(r>0){n[3]=setTimeout(()=>Kt(e,t),r);return}n[2]=0}let p=a.map(e=>({...e,_flight:void 0}));p[s].status=`pending`;let m=e.startTransition(()=>e.stores.setMatches(p),p).then(t=>(t&&e._pending===n&&n[4]===m&&!n[2]&&(n[2]=Date.now()+l),t));n[4]=m}function qt(e,t){let n=e._pending;n?.[0]===t&&(clearTimeout(n[3]),e._pending=void 0)}function Jt(e,t){e._committed=t,e.stores.setMatches(t)}function Yt(e,t){q(e,t[1]),J(e,t)}function Xt(e,t,n,r){let i=e._committed,a=e._cache;for(let e of n)e.preload=!1,r&&(e._assetEnd=void 0);let o=wt(n).length,s=new Map,c=Date.now();for(let t of[...i,...a.values()]){if(t.status!==`success`||n.some((e,n)=>e.id===t.id&&(n<o||e.status===`success`)))continue;let r=G(e,t);!r.options.loader||c-t.updatedAt>=(t.preload?r.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:r.options.gcTime??e.options.defaultGcTime??3e5)||s.set(t.id,a.get(t.id)===t?t:{...t,_flight:void 0,isFetching:!1,context:{}})}t[3]=[],e._cache=s,Jt(e,n),q(e,[...a.values(),...i],[...n,...s.values()]),pt(e,i,n,()=>e._tx===t)}async function Y(e,t){let n=e._tx;for(;n&&n!==t;){if(await n[5],e._tx===n)return;n=e._tx}}async function Zt(e,t,n){await e.navigate({...n.options,replace:!0,ignoreBlocker:!0,_redirects:t[1]+1})}function Qt(e,t){qt(e,t),t[0].abort(),q(e,t[3]),t[3]=[],e._tx===t&&(e.batch(()=>{e.stores.status.set(`idle`),e.stores.setMatches(e._committed)}),e._tx===t&&(e._commitPromise?.resolve(),e._commitPromise=void 0))}async function $t(e,t,n,r,i){let a=n.map(e=>({...e}));Nt(a);for(let t of r)K(e,a[t[0]]),a[t[0]]=t[3];let o=[t[2],a],s;try{s=await Ut(e,o,r,t[0],t[1],i)}catch(t){throw q(e,a),t}if(Et(s)){q(e,a),s[0]===H&&e._tx===t&&e._committed===n&&await Zt(e,t,s[1]);return}let c=await Wt(e,s,t[0].signal);if(e._tx!==t||e._committed!==n){q(e,c[1]);return}for(let t of c[1]){let n=e._cache.get(t.id);n?._flight&&n._flight===t._flight&&(e._cache.delete(t.id),K(e,n))}Jt(e,c[1]),q(e,n,c[1])}async function en(e,t,n,r,i,a){let o=[t[0],t[1],()=>e._tx===t&&!!t[3].length,e._committed,void 0,i,n,a,r],s=await Gt(e,t[2],t[3],o);if(Et(s)){s[0]===H&&e._tx===t?(qt(e,t),q(e,t[3]),t[3]=[],e._tx===t&&await Zt(e,t,s[1])):Qt(e,t);return}let c=e._pending;if(c?.[0]===t&&(clearTimeout(c[3]),c[4])){let n=t[0].signal,r=!1;try{r=await W(c[4],n)}catch(e){if(e!==n)throw e}if(r&&e._pending===c&&c[0]===t){let e=c[2]-Date.now();if(e>0){try{await W(new Promise(t=>{c[3]=setTimeout(t,e)}),n)}catch{}clearTimeout(c[3])}}}if(e._tx!==t){qt(e,t),Yt(e,s);return}let l=t[2],u=dt(l,e.stores.resolvedLocation.get()),d=s[2];await e.startViewTransition(async()=>{if(e._tx!==t){Yt(e,s);return}let n=await e.startTransition(()=>{qt(e,t),Xt(e,t,s[1],a),e._tx===t&&(e.emit({type:`onLoad`,...u}),e._tx===t&&e.emit({type:`onBeforeRouteMount`,...u}))},s[1]);if(e._tx!==t){J(e,s);return}d?.length&&$t(e,t,s[1],d,s[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(l),e.stores.status.set(`idle`),e._tx===t&&e.emit({type:`onResolved`,...u}),n&&e._tx===t&&e.emit({type:`onRendered`,...u})}),e._tx===t&&(e._commitPromise?.resolve(),e._commitPromise=void 0)})}async function tn(e,t){let n=e._tx,r=e.stores.resolvedLocation.get(),i=r??e.stores.location.get(),a=e.latestLocation,o=e._pendingLocation,s=o?.href===a.href?o._redirects??0:0,c=e._handoff,l=c?.[0](),u=new AbortController,d=e._preflight;if(e._preflight=u,l||c?.[1](),d?.abort(),u.signal.aborted){await Y(e,n);return}let f=dt(a,r);if(e.emit({type:`onBeforeNavigate`,...f}),u.signal.aborted||e.emit({type:`onBeforeLoad`,...f}),u.signal.aborted){await Y(e,n);return}let p=i.href===a.href,m,h=u;try{m=e.matchRoutes(a,{_controller:u}),Nt(m)}catch(t){if(u.abort(),!ae(t)){await Y(e),e._commitPromise?.resolve(),e._commitPromise=void 0;return}await e.navigate({...t.options,replace:!0,ignoreBlocker:!0}),await Y(e,n);return}let g=l?c[1](m):void 0;if(g?h=l:l?.abort(),u.signal.aborted){q(e,m),await Y(e,n);return}e._preflight=void 0;let _=[h,s,a,m,Date.now(),Promise.resolve().then(()=>en(e,_,p,()=>Kt(e,_),t?.sync,g)).catch(()=>{e._tx===_&&Qt(e,_)})];if(e._tx=_,n){for(let t of e.stores.matches.get()){if(e._tx!==_)break;t.isFetching&&Pt(e,t,!1)}n[0].abort(),q(e,n[3],_[3],!0)}if(e._tx!==_){q(e,_[3]),_[3]=[],await Y(e,_);return}e.batch(()=>{e.stores.status.set(`pending`),e.stores.location.set(a)}),!r&&!m.some(e=>e._notFound)&&Kt(e,_);try{await _[5]}finally{await Y(e,_)}}async function nn(e,t,n=0){if(n>20)return;let r=t._builtLocation??e.buildLocation(t),i=e._committed,a=new AbortController,o;try{o=e.matchRoutes(r,{_controller:a}),Nt(o)}catch(e){a.abort(),I(e)||console.error(e);return}(e._preloads??=new Map).set(a,o);let s;try{let t;try{t=await Gt(e,r,o,[a,n,()=>!0,i,!0])}finally{s=e._preloads.delete(a),q(e,o),a.abort()}if(!Et(t))return t[1];if(s&&t[0]===H&&!t[1].options.reloadDocument)return nn(e,{...t[1].options,_fromLocation:r},n+1)}catch(e){I(e)||console.error(e)}}function rn(e){return P(an,{...e})}var an=class extends N.Component{constructor(...e){super(...e),this.state={error:null},this.reset=()=>{this.setState({error:null})}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){this.props.onCatch?.(e,t)}render(){let e=this.state.error;return e?N.createElement(this.props.errorComponent??on,{error:e,reset:this.reset}):this.props.children}};function on({error:e}){let[t,n]=N.useState(!1);return F(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[F(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[P(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),P(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),P(`div`,{style:{height:`.25rem`}}),t?P(`div`,{children:P(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?P(`code`,{children:e.message}):null})}):null]})}var X=(e=>(e[e.None=0]=`None`,e[e.Mutable=1]=`Mutable`,e[e.Watching=2]=`Watching`,e[e.RecursedCheck=4]=`RecursedCheck`,e[e.Recursed=8]=`Recursed`,e[e.Dirty=16]=`Dirty`,e[e.Pending=32]=`Pending`,e))(X||{});function sn({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(!0)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(!0)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function cn(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var ln=[],un=0,{link:dn,unlink:fn,propagate:pn,checkDirty:mn,shallowPropagate:hn}=sn({update(e){return e._update()},notify(e){ln[_n++]=e,e.flags&=~X.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=X.Mutable|X.Dirty,bn(e))}}),gn=0,_n=0,Z,vn=0;function yn(e){try{++vn,e()}finally{--vn||xn()}}function bn(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=fn(n,e)}function xn(){if(!(vn>0)){for(;gn<_n;){let e=ln[gn];ln[gn++]=void 0,e.notify()}gn=0,_n=0}}function Sn(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?X.None:X.Mutable,get(){return Z!==void 0&&dn(i,Z,un),i._snapshot},subscribe(e){let t=cn(e),n={current:!1},r=Cn(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=Z,o=t?.compare??Object.is;if(n)Z=i,++un,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=X.Mutable|X.RecursedCheck);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{Z=a,n&&(i.flags&=~X.RecursedCheck),bn(i)}}};return n?(i.flags=X.Mutable|X.Dirty,i.get=function(){let e=i.flags;if(e&X.Dirty||e&X.Pending&&mn(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&hn(e)}}else e&X.Pending&&(i.flags=e&~X.Pending);return Z!==void 0&&dn(i,Z,un),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(pn(e),hn(e),xn())}},i}function Cn(e){let t=()=>{let t=Z;Z=n,++un,n.depsTail=void 0,n.flags=X.Watching|X.RecursedCheck;try{return e()}finally{Z=t,n.flags&=~X.RecursedCheck,bn(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:X.Watching|X.RecursedCheck,notify(){let e=this.flags;e&X.Dirty||e&X.Pending&&mn(this.deps,this)?t():this.flags=X.Watching},stop(){this.flags=X.None,this.depsTail=void 0,bn(this)}};return t(),n}function wn(e){let t=M(),r=`not-found-${n(t.stores.location,e=>e.pathname)}-${n(t.stores.status,e=>e)}`;return P(rn,{getResetKey:()=>r,onCatch:(t,n)=>{if(I(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(I(t))return e.fallback?.(t);throw t},children:e.children})}function Tn(){return P(`p`,{children:`Not Found`})}function Q(e){return P(De,{children:e.children})}function En(e,t,n){return t.options.notFoundComponent?P(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?P(e.options.defaultNotFoundComponent,{...n}):P(Tn,{})}function Dn(e,t){let n=t?.options.pendingComponent??e.options.defaultPendingComponent;return n?P(n,{}):null}var On=(e,t)=>e[0]===t[0]&&e[1]===t[1],kn=N.memo(function({routeId:e}){let t=M();return P(An,{router:t,match:n(t.stores.getMatchStore(e),e=>e)})});function An({router:e,match:n}){let r=e.routesById[n.routeId],i=Dn(e,r),a=r.options.errorComponent??e.options.defaultErrorComponent,o=r.options.onCatch??e.options.defaultOnCatch,s=r.isRoot?r.options.notFoundComponent??e.options.notFoundRoute?.options.component:r.options.notFoundComponent,c=n.ssr===!1||n.ssr===`data-only`,l=r.options.wrapInSuspense??i??(r.options.errorComponent?.preload||c)?N.Suspense:Q,u=a?rn:Q,d=s?wn:Q;return F(r.isRoot?r.options.shellComponent??Q:Q,{children:[P(ne.Provider,{value:n.routeId,children:P(l,{fallback:i,children:P(u,{getResetKey:()=>n,errorComponent:a,onCatch:(e,t)=>{if(I(e))throw e.routeId??=n.routeId,e;o?.(e,t)},children:P(d,{fallback:e=>{if(e.routeId??=n.routeId,e.routeId!==n.routeId)throw e;return N.createElement(s,e)},children:c?P(t,{fallback:i,children:P(jn,{match:n})}):P(jn,{match:n})})})})}),null]})}var jn=N.memo(function({match:e}){let t=M(),n=e.routeId,r=t.routesById[n],i=N.useMemo(()=>{let i=(r.options.remountDeps??t.options.defaultRemountDeps)?.({routeId:n,loaderDeps:e.loaderDeps,params:e._strictParams,search:e._strictSearch});return i?JSON.stringify(i):void 0},[n,e.loaderDeps,e._strictParams,e._strictSearch,r.options.remountDeps,t.options.defaultRemountDeps]),a=N.useMemo(()=>{let e=r.options.component??t.options.defaultComponent;return e?P(e,{},i):P(Mn,{})},[i,r.options.component,t.options.defaultComponent]);if(e.status===`pending`){if(t._tx)throw t._tx[5];return Dn(t,r)}if(e.status===`notFound`)return En(t,r,e.error);if(e.status===`error`)throw e.error;return a}),Mn=N.memo(function(){let e=M(),t=N.useContext(ne),r,i,a;{let o=e.stores.getMatchStore(t);[r,i]=n(o,e=>[!!e._notFound,e.error],On),a=n(e.stores.ids,e=>e[e.indexOf(t)+1])}if(r)return En(e,e.routesById[t],i);if(!a)return null;let o=P(kn,{routeId:a});return t===`__root__`?P(N.Suspense,{fallback:Dn(e),children:o}):o});function Nn(e,t){let n=e[1];e.length=0,n?.(t)}function Pn({t:e}){let t=M(),n=t._rendered??=[];return t.startTransition=(r,i)=>new Promise((a,o)=>{Nn(n,!1),n.push(i,a),e(t),N.startTransition(()=>{try{r()}catch(e){n[1]===a&&(n.length=0),o(e)}})}),D(()=>{let e=t.history.subscribe(t.load);t.updateLatestLocation();let r=t.latestLocation,i=t.buildLocation({to:r.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(S(r.publicHref)!==S(i.publicHref))return t.commitLocation({...i,replace:!0,ignoreBlocker:!0}),e;let a=t.stores.resolvedLocation.get();return a?.href===r.href&&a.state.__TSR_key===r.state.__TSR_key?n.push(t.stores.matches.get(),e=>{e&&t.emit({type:`onRendered`,...dt(a,a)})}):t._tx||t.load().catch(console.error),e},[t,t.history]),null}function Fn(){let e=M(),t=e.routesById[re],n=Dn(e,t),r=e.ssr?Q:N.Suspense,i=F(De,{children:[P(Pn,{t:N.useState()[1]}),P(r,{fallback:n,children:P(In,{})})]});return e.options.InnerWrap?P(e.options.InnerWrap,{children:i}):i}function In(){let e=M(),t=e._rendered,r=n(e.stores.matches,e=>t[0]??e),i=r[0],a=i?.routeId;D(()=>{t[0]===r&&Nn(t,!0)},[t,r]);let o=a?P(kn,{routeId:a}):null;return P(ne.Provider,{value:a,children:e.options.disableGlobalCatchBoundary?o:P(rn,{getResetKey:()=>i,onCatch:void 0,children:o})})}var Ln=e=>({createMutableStore:Sn,createReadonlyStore:Sn,batch:yn}),Rn=e=>new zn(e),zn=class extends mt{constructor(e){super(e,Ln)}};function Bn({router:e,children:t,...n}){u(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=P(se.Provider,{value:e,children:t});return e.options.Wrap?P(e.options.Wrap,{children:r}):r}function Vn({router:e,...t}){return P(Bn,{router:e,...t,children:P(Fn,{})})}var Hn=ke.div`
|
|
3
|
-
display: flex;
|
|
4
|
-
align-items: center;
|
|
5
|
-
justify-content: center;
|
|
6
|
-
min-height: 100vh;
|
|
7
|
-
padding: ${({theme:e})=>e.space(4)};
|
|
8
|
-
text-align: center;
|
|
9
|
-
`,Un=ke.p`
|
|
10
|
-
font-size: 13px;
|
|
11
|
-
color: ${({theme:e})=>e.color.inkDim};
|
|
12
|
-
max-width: 48ch;
|
|
13
|
-
`,Wn=ie()({component:Mn,notFoundComponent:()=>P(Hn,{children:F(ce,{$gap:3,style:{alignItems:`center`},children:[P(ue,{children:`Not found`}),P(Un,{children:`This console has no screen at that address.`}),P(le,{as:`a`,href:`/`,$variant:`primary`,$size:`sm`,children:`Back to the rack`})]})})});async function Gn(e){return e.queryClient.ensureQueryData({queryKey:o.status,queryFn:()=>fe(`/api/status`),revalidateIfStale:!0})}function Kn(e){let t=e.principal;return e.authenticated!==!0||t==null?`/login`:t.kind===`client`?`/client`:t.kind===`admin`||t.kind===`viewer`?`/`:`/login`}function qn(e,t){let n=Kn(e);if(n===`/login`)throw oe({to:`/login`,search:{next:t}});if(n!==`/`)throw oe({to:n})}function Jn(e,t){let n=Kn(e);if(n===`/login`)throw oe({to:`/login`,search:{next:t}});if(n!==`/client`)throw oe({to:n})}var Yn=A(`/_app`)({beforeLoad:async({context:e,location:t})=>{qn(await Gn(e),t.href),await e.queryClient.ensureQueryData(a)},pendingComponent:Xn,pendingMs:200,errorComponent:k(()=>j(()=>import(`./_app-BWNEo1e-.js`),__vite__mapDeps([0,1])),`errorComponent`),component:Zn});function Xn(){return P(me,{legend:`Console`,children:P(de,{rows:6})})}function Zn(){let e=te().data??[];return P(ye,{children:F(ve,{children:[P(he,{$providers:e}),P(ge,{children:P(Mn,{})})]})})}var Qn=A(`/client`)({beforeLoad:async({context:e,location:t})=>{Jn(await Gn(e),t.href)},component:k(()=>j(()=>import(`./client-DvN2dbYV.js`),__vite__mapDeps([2,3,4,1,5,6,7,8,9,10,11,12,13,14,15,16])),`component`)}),$n=A(`/_app/`)({component:k(()=>j(()=>import(`./_app.index-CgI1OrZR.js`),__vite__mapDeps([17,4,1,5,13,14,9,10,16])),`component`)}),er=A(`/_app/accounts`)({component:k(()=>j(()=>import(`./_app.accounts-C3Yv991L.js`),__vite__mapDeps([18,4,1,5,19,6,20,21,22,14,8,9,10,11,3])),`component`)}),tr=A(`/_app/console`)({component:k(()=>j(()=>import(`./_app.console-Bvo2fugd.js`),__vite__mapDeps([23,4,1,5,7,8])),`component`)}),nr=A(`/_app/database`)({component:k(()=>j(()=>import(`./_app.database-CfWNOIl-.js`),__vite__mapDeps([24,4,1,5,8,9,10,16,25])),`component`)}),rr=A(`/_app/keys`)({component:k(()=>j(()=>import(`./_app.keys-CcfPhvCD.js`),__vite__mapDeps([26,4,1,5,19,6,20,22,14,8,9,10])),`component`)}),ir=A(`/_app/logs`)({component:k(()=>j(()=>import(`./_app.logs-C8ZiArCn.js`),__vite__mapDeps([27,4,1,5,14,8,12,13,10])),`component`)}),ar=A(`/_app/models`)({component:k(()=>j(()=>import(`./_app.models-nfMWzVb4.js`),__vite__mapDeps([28,4,1,5,20,21,22,14,8,9])),`component`)}),or=A(`/_app/settings`)({component:k(()=>j(()=>import(`./_app.settings-C45FJLeX.js`),__vite__mapDeps([29,4,1,5,22,8,9,25])),`component`)}),sr=A(`/_app/usage`)({component:k(()=>j(()=>import(`./_app.usage-C5s-DfBV.js`),__vite__mapDeps([30,3,4,1,5,10,15,16])),`component`)}),$=Yn.update({id:`/_app`,getParentRoute:()=>Wn}),cr=Qn.update({id:`/client`,path:`/client`,getParentRoute:()=>Wn}),lr=be.update({id:`/login`,path:`/login`,getParentRoute:()=>Wn}),ur=$n.update({id:`/`,path:`/`,getParentRoute:()=>$}),dr={AppAccountsRoute:er.update({id:`/accounts`,path:`/accounts`,getParentRoute:()=>$}),AppConsoleRoute:tr.update({id:`/console`,path:`/console`,getParentRoute:()=>$}),AppDatabaseRoute:nr.update({id:`/database`,path:`/database`,getParentRoute:()=>$}),AppKeysRoute:rr.update({id:`/keys`,path:`/keys`,getParentRoute:()=>$}),AppLogsRoute:ir.update({id:`/logs`,path:`/logs`,getParentRoute:()=>$}),AppModelsRoute:ar.update({id:`/models`,path:`/models`,getParentRoute:()=>$}),AppSettingsRoute:or.update({id:`/settings`,path:`/settings`,getParentRoute:()=>$}),AppUsageRoute:sr.update({id:`/usage`,path:`/usage`,getParentRoute:()=>$}),AppIndexRoute:ur,AppPluginsPluginIdRoute:xe.update({id:`/plugins/$pluginId`,path:`/plugins/$pluginId`,getParentRoute:()=>$})},fr={AppRoute:$._addFileChildren(dr),ClientRoute:cr,LoginRoute:lr},pr=Wn._addFileChildren(fr)._addFileTypes();function mr(e){return{isLoginRoute:()=>e().state.location.pathname===`/login`,onUnauthenticated:()=>void e().navigate({to:`/login`,search:{next:e().state.location.href}})}}function hr(e){let t=t=>{!(t instanceof pe)||!t.isUnauthenticated||e.isLoginRoute()||e.onUnauthenticated()};return new we({queryCache:new Ce({onError:t}),mutationCache:new Se({onError:t}),defaultOptions:{queries:{retry:(e,t)=>t instanceof pe&&t.isUnauthenticated?!1:e<2,staleTime:5e3,refetchOnWindowFocus:!0},mutations:{retry:!1}}})}var gr,_r=hr(mr(()=>gr));gr=Rn({routeTree:pr,context:{queryClient:_r}});var vr=document.getElementById(`root`);if(vr===null)throw Error(`#root is missing from index.html`);Oe(vr).render(P(Ee,{children:P(_e,{children:P(Te,{client:_r,children:P(Vn,{router:gr})})})}));
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/login-DvRXHEGv.js","assets/Lamp-BHYJpauE.js","assets/Panel-CYQvfI3L.js","assets/Field-DK5zaBVA.js","assets/reasons-Du1OBWAM.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{n as e,r as t,t as n}from"./preload-helper-D2sCuvIY.js";var r=t(`/login`)({validateSearch:e=>({...typeof e.next==`string`?{next:e.next}:{},...typeof e.reason==`string`?{reason:e.reason}:{}}),component:e(()=>n(()=>import(`./login-DvRXHEGv.js`),__vite__mapDeps([0,1,2,3,4])),`component`)});export{r as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{b as e}from"./Rack-CRuJZY00.js";var t=e(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]);export{t};
|