omnigateway 0.4.0 → 0.4.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.
Files changed (37) hide show
  1. package/README.md +20 -17
  2. package/bin/omni.js +41 -3
  3. package/gateway.js +41 -3
  4. package/package.json +1 -1
  5. package/public/assets/{Confirm-gd8Y6snu.js → Confirm-BO1xS6uH.js} +1 -1
  6. package/public/assets/{CopyValue-Dds-Ow9a.js → CopyValue-BiiqC_Z2.js} +1 -1
  7. package/public/assets/{Field-D-14HF0x.js → Field-b0ohzqzR.js} +1 -1
  8. package/public/assets/{Match-CgNxphvS.js → Match-B2ZxNor3.js} +1 -1
  9. package/public/assets/{Modal-Dj3LvMS9.js → Modal-OALemCh6.js} +1 -1
  10. package/public/assets/{Rack-B4c0dbIb.js → Rack-DhVnjAjC.js} +1 -1
  11. package/public/assets/{Readout-Du15WYx0.js → Readout-VYnpaTMg.js} +1 -1
  12. package/public/assets/{States-CxLDlCaw.js → States-6G9NsYha.js} +1 -1
  13. package/public/assets/{TokenBreakdown-BySwFK6Q.js → TokenBreakdown-B9RanXin.js} +1 -1
  14. package/public/assets/_app-ChlUa_Ov.js +1 -0
  15. package/public/assets/_app.accounts-CJ6lFXIx.js +64 -0
  16. package/public/assets/{_app.console-CoaRdkB1.js → _app.console-eFiUh-OA.js} +1 -1
  17. package/public/assets/{_app.database-CES5ec5g.js → _app.database-BHaMpXld.js} +1 -1
  18. package/public/assets/{_app.index-DwOZe1A-.js → _app.index-C1vtrxnM.js} +1 -1
  19. package/public/assets/{_app.keys-B5HrAu2U.js → _app.keys-Bz6-VVJi.js} +1 -1
  20. package/public/assets/{_app.logs-NbfIexz0.js → _app.logs-DV7O6ZUp.js} +1 -1
  21. package/public/assets/{_app.models-B1MdFRtQ.js → _app.models-KIctkivt.js} +1 -1
  22. package/public/assets/{_app.plugins._pluginId-ByMziW8p.js → _app.plugins._pluginId-BbqXEJUB.js} +1 -1
  23. package/public/assets/{_app.settings-BkDkGkKF.js → _app.settings-B8zjCira.js} +1 -1
  24. package/public/assets/_app.usage-C4GR06sI.js +83 -0
  25. package/public/assets/{index-gMv8Qs7m.js → index-B2twwe7y.js} +3 -3
  26. package/public/assets/{login-cCXnl34r.js → login-CJz2YA-O.js} +1 -1
  27. package/public/assets/plus-C7a0RuII.js +1 -0
  28. package/public/assets/queries-BOAAI06M.js +142 -0
  29. package/public/assets/shared-Rzhx6i7s.js +84 -0
  30. package/public/assets/{trash-2-ZPh3619D.js → trash-2-C7-QrCg5.js} +1 -1
  31. package/public/index.html +3 -3
  32. package/public/assets/_app-Dx_xnlud.js +0 -1
  33. package/public/assets/_app.accounts-DvBYnbfS.js +0 -64
  34. package/public/assets/_app.usage-DNpM8Nub.js +0 -83
  35. package/public/assets/plus-fXfUTt6_.js +0 -1
  36. package/public/assets/queries-CIOPbRcE.js +0 -142
  37. package/public/assets/shared-B4o-2quR.js +0 -84
@@ -1,4 +1,4 @@
1
- import{$ as e,C as t,D as n,at as r,et as ee,g as te,j as i,lt as a,n as ne,nt as o,ot as s,rt as c,s as l}from"./queries-CIOPbRcE.js";import{a as u,t as d}from"./Rack-B4c0dbIb.js";import{n as f,r as p,t as m}from"./TokenBreakdown-BySwFK6Q.js";import{t as h}from"./Modal-Dj3LvMS9.js";import{C as g,O as _,S as v,T as y,c as b,d as re,f as ie,k as x,l as S,t as ae,w as oe,x as se}from"./Lamp-BDf7-dMa.js";import{n as C,t as w}from"./Chip-BltJSw8A.js";import{i as T,n as E}from"./Field-D-14HF0x.js";import{a as D,n as O,r as k,t as ce}from"./States-CxLDlCaw.js";import{i as le,n as A,r as j,t as ue}from"./Table-CVDZ69Zx.js";import{useEffect as M,useMemo as N,useState as P}from"react";import{Fragment as F,jsx as I,jsxs as L}from"react/jsx-runtime";import R from"styled-components";var z={none:{legend:`Not captured`,message:`Body capture was not running for this request. It needs OMNI_BODY_LOGGING_ALLOWED in the environment and the body logging setting turned on, and the calling key must not have opted out.`},missing:{legend:`Captured, then lost`,message:`This request was captured, but its artifact is no longer on disk. Retention or the row cap has since pruned it, or something removed the file underneath the gateway.`},corrupt:{legend:`Captured, but unreadable`,message:`This request was captured and the artifact is still on disk, but it failed its checksum or would not decrypt. Changing OMNI_ENCRYPTION_KEY invalidates every artifact written under the old one.`}},B=new Intl.NumberFormat(`en-US`),V=R.p`
1
+ import{$ as e,C as t,D as n,at as r,et as ee,g as te,j as i,lt as a,n as ne,nt as o,ot as s,rt as c,s as l}from"./queries-BOAAI06M.js";import{a as u,t as d}from"./Rack-DhVnjAjC.js";import{n as f,r as p,t as m}from"./TokenBreakdown-B9RanXin.js";import{t as h}from"./Modal-OALemCh6.js";import{C as g,O as _,S as v,T as y,c as b,d as re,f as ie,k as x,l as S,t as ae,w as oe,x as se}from"./Lamp-BDf7-dMa.js";import{n as C,t as w}from"./Chip-BltJSw8A.js";import{i as T,n as E}from"./Field-b0ohzqzR.js";import{a as D,n as O,r as k,t as ce}from"./States-6G9NsYha.js";import{i as le,n as A,r as j,t as ue}from"./Table-CVDZ69Zx.js";import{useEffect as M,useMemo as N,useState as P}from"react";import{Fragment as F,jsx as I,jsxs as L}from"react/jsx-runtime";import R from"styled-components";var z={none:{legend:`Not captured`,message:`Body capture was not running for this request. It needs OMNI_BODY_LOGGING_ALLOWED in the environment and the body logging setting turned on, and the calling key must not have opted out.`},missing:{legend:`Captured, then lost`,message:`This request was captured, but its artifact is no longer on disk. Retention or the row cap has since pruned it, or something removed the file underneath the gateway.`},corrupt:{legend:`Captured, but unreadable`,message:`This request was captured and the artifact is still on disk, but it failed its checksum or would not decrypt. Changing OMNI_ENCRYPTION_KEY invalidates every artifact written under the old one.`}},B=new Intl.NumberFormat(`en-US`),V=R.p`
2
2
  font-size: 12px;
3
3
  color: ${({theme:e})=>e.color.inkDim};
4
4
  max-width: 62ch;
@@ -1,4 +1,4 @@
1
- import{$ as e,F as t,O as n,at as r,et as i,g as a,it as o,lt as s,nt as c,ot as l,ut as u,x as d,y as f,z as p}from"./queries-CIOPbRcE.js";import{r as m}from"./index-gMv8Qs7m.js";import{c as h,t as g}from"./Rack-B4c0dbIb.js";import{t as _}from"./plus-fXfUTt6_.js";import{t as v}from"./trash-2-ZPh3619D.js";import{t as y}from"./Toggle-DMk46RX2.js";import{t as b}from"./Confirm-gd8Y6snu.js";import{n as x,t as S}from"./Chip-BltJSw8A.js";import{i as C,n as w,r as T,t as E}from"./Field-D-14HF0x.js";import{t as D}from"./Meter-stpt3vQu.js";import{a as O,i as k,n as A,r as j,t as M}from"./States-CxLDlCaw.js";import{i as N,n as ee,r as te,t as P}from"./catalog-BBKm8Ih8.js";import{useEffect as ne,useId as re,useState as F}from"react";import{Fragment as I,jsx as L,jsxs as R}from"react/jsx-runtime";import z from"styled-components";var ie=h(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),ae=h(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),B=[`tier`,`health`,`quota`,`cost`,`latency`,`load`],oe={tier:`How preferred this tier is`,health:`Consecutive failures and breaker state`,quota:`Headroom in the tightest window, against how much of it is left`,cost:`Price of this request against the other candidates`,latency:`Observed time to first token`,load:`Requests in flight on this pair right now`},se=z.li`
1
+ import{$ as e,F as t,O as n,at as r,et as i,g as a,it as o,lt as s,nt as c,ot as l,ut as u,x as d,y as f,z as p}from"./queries-BOAAI06M.js";import{r as m}from"./index-B2twwe7y.js";import{c as h,t as g}from"./Rack-DhVnjAjC.js";import{t as _}from"./plus-C7a0RuII.js";import{t as v}from"./trash-2-C7-QrCg5.js";import{t as y}from"./Toggle-DMk46RX2.js";import{t as b}from"./Confirm-BO1xS6uH.js";import{n as x,t as S}from"./Chip-BltJSw8A.js";import{i as C,n as w,r as T,t as E}from"./Field-b0ohzqzR.js";import{t as D}from"./Meter-stpt3vQu.js";import{a as O,i as k,n as A,r as j,t as M}from"./States-6G9NsYha.js";import{i as N,n as ee,r as te,t as P}from"./catalog-BBKm8Ih8.js";import{useEffect as ne,useId as re,useState as F}from"react";import{Fragment as I,jsx as L,jsxs as R}from"react/jsx-runtime";import z from"styled-components";var ie=h(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),ae=h(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),B=[`tier`,`health`,`quota`,`cost`,`latency`,`load`],oe={tier:`How preferred this tier is`,health:`Consecutive failures and breaker state`,quota:`Headroom in the tightest window, against how much of it is left`,cost:`Price of this request against the other candidates`,latency:`Observed time to first token`,load:`Requests in flight on this pair right now`},se=z.li`
2
2
  padding: ${({theme:e})=>e.space(2)} 0;
3
3
  border-bottom: 1px solid ${({theme:e})=>e.color.rule};
4
4
 
@@ -1,4 +1,4 @@
1
- import{J as e,X as t,Y as n,Z as r,at as i,k as a}from"./queries-CIOPbRcE.js";import{a as o,s}from"./index-gMv8Qs7m.js";import{t as c}from"./Rack-B4c0dbIb.js";import{a as l,n as u,r as d,t as f}from"./States-CxLDlCaw.js";import{Component as p,Suspense as m,createContext as h,lazy as g,useContext as _,useMemo as v}from"react";import{Fragment as y,jsx as b,jsxs as x}from"react/jsx-runtime";import S from"styled-components";var C=/%2e/i;function w(e,t){if(t.length===0)throw TypeError(`plugin api ${e} must not be empty`);if(t.startsWith(`/`))throw TypeError(`plugin api ${e} must be relative to the plugin's own prefix, got ${JSON.stringify(t)}`);if(t.includes(`..`)||C.test(t))throw TypeError(`plugin api ${e} must not escape the plugin's own prefix, got ${JSON.stringify(t)}`)}function T(e,t){if(w(`plugin id`,e),e.includes(`/`))throw TypeError(`plugin api plugin id must be a single path segment, got ${e}`);return w(`path`,t),`/api/plugins/${e}/${t}`}var E=new Map;function D(i){let a=E.get(i);if(a!==void 0)return a;let o={get:(e,t)=>n(T(i,e),t),post:(e,n)=>t(T(i,e),n),put:(e,t)=>r(T(i,e),t),del:t=>e(T(i,t))};return E.set(i,o),o}var O=h(e=>s(()=>import(e),[]));O.Provider;function k(){return _(O)}function A(e,t){let n=e?.default;if(n==null)throw Error(`plugin ${t} has no default export from definePluginUI`);if(typeof n.mount!=`function`)throw Error(`plugin ${t} exported a default without a mount function`);return n}function j(e,t,n){return g(async()=>{let r=A(await n(t),e);return{default:()=>r.mount({pluginId:e,api:D(e)})}})}var M=S.p`
1
+ import{J as e,X as t,Y as n,Z as r,at as i,k as a}from"./queries-BOAAI06M.js";import{a as o,s}from"./index-B2twwe7y.js";import{t as c}from"./Rack-DhVnjAjC.js";import{a as l,n as u,r as d,t as f}from"./States-6G9NsYha.js";import{Component as p,Suspense as m,createContext as h,lazy as g,useContext as _,useMemo as v}from"react";import{Fragment as y,jsx as b,jsxs as x}from"react/jsx-runtime";import S from"styled-components";var C=/%2e/i;function w(e,t){if(t.length===0)throw TypeError(`plugin api ${e} must not be empty`);if(t.startsWith(`/`))throw TypeError(`plugin api ${e} must be relative to the plugin's own prefix, got ${JSON.stringify(t)}`);if(t.includes(`..`)||C.test(t))throw TypeError(`plugin api ${e} must not escape the plugin's own prefix, got ${JSON.stringify(t)}`)}function T(e,t){if(w(`plugin id`,e),e.includes(`/`))throw TypeError(`plugin api plugin id must be a single path segment, got ${e}`);return w(`path`,t),`/api/plugins/${e}/${t}`}var E=new Map;function D(i){let a=E.get(i);if(a!==void 0)return a;let o={get:(e,t)=>n(T(i,e),t),post:(e,n)=>t(T(i,e),n),put:(e,t)=>r(T(i,e),t),del:t=>e(T(i,t))};return E.set(i,o),o}var O=h(e=>s(()=>import(e),[]));O.Provider;function k(){return _(O)}function A(e,t){let n=e?.default;if(n==null)throw Error(`plugin ${t} has no default export from definePluginUI`);if(typeof n.mount!=`function`)throw Error(`plugin ${t} exported a default without a mount function`);return n}function j(e,t,n){return g(async()=>{let r=A(await n(t),e);return{default:()=>r.mount({pluginId:e,api:D(e)})}})}var M=S.p`
2
2
  font-size: 13px;
3
3
  color: ${({theme:e})=>e.color.down};
4
4
  `,N=S.p`
@@ -1,4 +1,4 @@
1
- import{$ as e,L as t,O as n,at as r,c as i,et as a,it as o,lt as s,nt as c,o as l,z as u}from"./queries-CIOPbRcE.js";import{t as d}from"./Rack-B4c0dbIb.js";import{t as f}from"./Toggle-DMk46RX2.js";import{i as p,n as m,t as h}from"./Field-D-14HF0x.js";import{t as g}from"./Meter-stpt3vQu.js";import{a as _,i as v,n as y,r as b}from"./States-CxLDlCaw.js";import{useEffect as x,useState as S}from"react";import{Fragment as C,jsx as w,jsxs as T}from"react/jsx-runtime";import E from"styled-components";var D=[{id:`claude`,label:`Claude Code`,where:`settings.json under ~/.claude`},{id:`opencode`,label:`opencode`,where:`opencode.json in your project`}],O=E(a)`
1
+ import{$ as e,L as t,O as n,at as r,c as i,et as a,it as o,lt as s,nt as c,o as l,z as u}from"./queries-BOAAI06M.js";import{t as d}from"./Rack-DhVnjAjC.js";import{t as f}from"./Toggle-DMk46RX2.js";import{i as p,n as m,t as h}from"./Field-b0ohzqzR.js";import{t as g}from"./Meter-stpt3vQu.js";import{a as _,i as v,n as y,r as b}from"./States-6G9NsYha.js";import{useEffect as x,useState as S}from"react";import{Fragment as C,jsx as w,jsxs as T}from"react/jsx-runtime";import E from"styled-components";var D=[{id:`claude`,label:`Claude Code`,where:`settings.json under ~/.claude`},{id:`opencode`,label:`opencode`,where:`opencode.json in your project`}],O=E(a)`
2
2
  display: block;
3
3
  white-space: pre;
4
4
  overflow-x: auto;
@@ -0,0 +1,83 @@
1
+ import{$ as e,A as t,At as n,B as r,C as i,Ct as a,D as o,Dt as s,E as c,Et as l,F as u,G as d,H as f,I as p,J as m,K as h,L as g,M as _,Mt as v,N as y,O as b,Ot as x,P as S,Q as C,R as ee,S as w,St as te,T,Tt as E,U as D,V as ne,W as re,X as ie,Y as ae,Z as oe,_ as se,_t as ce,a as le,at as O,b as k,bt as A,c as j,ct as M,d as ue,dt as de,et as fe,f as N,ft as pe,g as me,gt as he,h as ge,ht as _e,i as ve,it as ye,j as be,jt as xe,k as Se,kt as Ce,l as we,lt as Te,m as Ee,mt as De,n as Oe,nt as ke,o as Ae,ot as je,p as Me,pt as Ne,q as Pe,r as Fe,rt as Ie,s as P,st as Le,t as Re,tt as ze,u as Be,ut as Ve,v as He,vt as Ue,w as We,wt as Ge,x as F,xt as Ke,y as qe,yt as Je,z as Ye}from"./shared-Rzhx6i7s.js";import{$ as Xe,C as Ze,G as I,O as Qe,Q as $e,at as L,et as R,g as et,nt as tt,ot as nt,rt}from"./queries-BOAAI06M.js";import{i as it,n as at,r as ot}from"./index-B2twwe7y.js";import{a as st,r as z,t as ct}from"./Rack-DhVnjAjC.js";import{E as B,O as V,S as H,T as lt}from"./Lamp-BDf7-dMa.js";import{a as ut,n as dt,r as ft,t as pt}from"./States-6G9NsYha.js";import{i as mt,n as U,r as W,t as ht}from"./Table-CVDZ69Zx.js";import{t as gt}from"./catalog-BBKm8Ih8.js";import{t as G}from"./Readout-VYnpaTMg.js";import*as K from"react";import{PureComponent as _t,forwardRef as vt,useMemo as q,useRef as yt,useState as bt}from"react";import{jsx as J,jsxs as Y}from"react/jsx-runtime";import X from"styled-components";function xt(e,t){return e.graphicalItems.cartesianItems.find(e=>e.id===t)?.xAxisId??0}function St(e,t){return e.graphicalItems.cartesianItems.find(e=>e.id===t)?.yAxisId??0}var Ct=(e,t,n)=>C(e,`xAxis`,xt(e,t),n),wt=(e,t,n)=>fe(e,`xAxis`,xt(e,t),n),Tt=(e,t,n)=>C(e,`yAxis`,St(e,t),n),Et=(e,t,n)=>fe(e,`yAxis`,St(e,t),n),Dt=A([M,Ct,Tt,wt,Et],(e,t,n,r,i)=>Ue(e,`xAxis`)?Ne(t,r,!1):Ne(n,i,!1)),Ot=A([ze,(e,t)=>t],(e,t)=>e.filter(e=>e.type===`area`).find(e=>e.id===t)),kt=e=>{var t=M(e);return Ue(t,`xAxis`)?`yAxis`:`xAxis`},At=(e,t)=>kt(e)===`yAxis`?St(e,t):xt(e,t),jt=(t,n,r)=>e(t,kt(t),At(t,n),r),Mt=A([Ot,jt],(e,t)=>{if(e!=null&&t!=null){var n=e.stackId,r=ke(e);if(n!=null&&r!=null){var i=(t[n]?.stackedData)?.find(e=>e.key===r);if(i!=null)return i.map(e=>[e[0],e[1]])}}}),Nt=A([Ot,jt],(e,t)=>{if(e!=null&&e.stackId!=null&&t!=null){var n=t[e.stackId];if(n!=null)return n.graphicalItems.map(e=>e.dataKey).filter(E)}}),Pt=A([M,Ct,Tt,wt,Et,Mt,O,Dt,Ot,ye,Nt],(e,t,n,r,i,a,o,s,c,l,u)=>{var d=o.chartData,f=o.dataStartIndex,p=o.dataEndIndex;if(!(c==null||e!==`horizontal`&&e!==`vertical`||t==null||n==null||r==null||i==null||r.length===0||i.length===0||s==null)){var m=c.data,h=m&&m.length>0?m:d?.slice(f,p+1);if(h!=null)return pn({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:f,areaSettings:c,stackedData:a,displayedData:h,chartBaseValue:l,bandSize:s,stackDataKeys:u})}}),Ft=[`animationElapsedTime`,`isAnimating`,`isEntrance`,`layout`,`isRange`,`stroke`,`connectNulls`],It=[`id`,`baseLine`];function Lt(){return Lt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Lt.apply(null,arguments)}function Rt(e,t){if(e==null)return{};var n,r,i=zt(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function zt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Bt(e){var t=e.alpha,n=e.baseLine,r=e.points,i=e.strokeWidth,a=r[0]?.x,o=r[r.length-1]?.x;if(!Je(a)||!Je(o))return null;var c=t*Math.abs(a-o),l=Math.max(...r.map(e=>e.y||0));return s(n)?l=Math.max(n,l):n&&Array.isArray(n)&&n.length&&(l=Math.max(...n.map(e=>e.y||0),l)),s(l)?K.createElement(`rect`,{x:a<o?a:a-c,y:0,width:c,height:Math.floor(l+(i?parseInt(`${i}`,10):1))}):null}function Vt(e){var t=e.alpha,n=e.baseLine,r=e.points,i=e.strokeWidth,a=r[0]?.y,o=r[r.length-1]?.y;if(!Je(a)||!Je(o))return null;var c=t*Math.abs(a-o),l=Math.max(...r.map(e=>e.x||0));return s(n)?l=Math.max(n,l):n&&Array.isArray(n)&&n.length&&(l=Math.max(...n.map(e=>e.x||0),l)),s(l)?K.createElement(`rect`,{x:0,y:a<o?a:a-c,width:l+(i?parseInt(`${i}`,10):1),height:Math.floor(c)}):null}function Ht(e){var t=e.alpha,n=e.layout,r=e.points,i=e.baseLine,a=e.strokeWidth;return n===`vertical`?K.createElement(Vt,{alpha:t,points:r,baseLine:i,strokeWidth:a}):K.createElement(Bt,{alpha:t,points:r,baseLine:i,strokeWidth:a})}function Ut(e){var t=e.animationElapsedTime,n=t===void 0?1:t,r=e.isAnimating,i=r!==void 0&&r,a=e.isEntrance,o=a!==void 0&&a,s=e.layout,c=e.isRange,l=e.stroke,u=e.connectNulls,d=Rt(e,Ft),f=s===`vertical`?`vertical`:`horizontal`,m=u??!1,h=p(),g=d.id,_=d.baseLine,v=Rt(d,It),y=xe(v),b=K.createElement(je,Lt({},d,{id:g,baseLine:_,connectNulls:m,stroke:`none`,className:`recharts-area-area`,layout:f})),x=l!==`none`&&K.createElement(je,Lt({},y,{className:`recharts-area-curve`,layout:f,type:d.type,connectNulls:m,fill:`none`,stroke:l,points:d.points})),S=l!==`none`&&c&&Array.isArray(_)&&K.createElement(je,Lt({},y,{className:`recharts-area-curve`,layout:f,type:d.type,connectNulls:m,fill:`none`,stroke:l,points:_}));return o&&(i||n<1)?K.createElement(Ce,null,K.createElement(`defs`,null,K.createElement(`clipPath`,{id:h},K.createElement(Ht,{alpha:n,points:d.points??[],baseLine:_,layout:f,strokeWidth:d.strokeWidth}))),K.createElement(Ce,{clipPath:`url(#${h})`},b,x,S)):K.createElement(K.Fragment,null,b,x,S)}var Wt=[`id`],Gt=[`activeDot`,`animationBegin`,`animationDuration`,`animationEasing`,`connectNulls`,`dot`,`fill`,`fillOpacity`,`hide`,`isAnimationActive`,`legendType`,`stroke`,`xAxisId`,`yAxisId`];function Kt(){return Kt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Kt.apply(null,arguments)}function qt(e,t){if(e==null)return{};var n,r,i=Jt(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Jt(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function Yt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Z(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Yt(Object(n),!0).forEach(function(t){Xt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Xt(e,t,n){return(t=Zt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zt(e){var t=Qt(e,`string`);return typeof t==`symbol`?t:t+``}function Qt(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var $t={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:`ease`,animationMatchBy:ne,animationInterpolateFn:(e,t)=>e==null?[]:t===1?e.flatMap(e=>e.status===`removed`?[]:[e.next]):e.flatMap(e=>e.status===`matched`?[Z(Z({},e.next),{},{x:a(e.prev.x,e.next.x,t),y:a(e.prev.y,e.next.y,t)})]:e.status===`added`?[e.next]:[]),connectNulls:!1,dot:!1,fill:`#3182bd`,fillOpacity:.6,hide:!1,isAnimationActive:`auto`,legendType:`line`,stroke:`#3182bd`,strokeWidth:1,type:`linear`,label:!1,shape:Ut,xAxisId:0,yAxisId:0,zIndex:Ie.area};function en(e,t){return e&&e!==`none`?e:t}var tn=e=>{var t=e.dataKey,n=e.name,r=e.stroke,i=e.fill,a=e.legendType;return[{inactive:e.hide,dataKey:t,type:a,color:en(r,i),value:he(n,t),payload:e}]},nn=K.memo(e=>{var t=e.dataKey,n=e.data,r=e.stroke,i=e.strokeWidth,a=e.fill,o=e.name,s=e.hide,c=e.unit,l=e.formatter,u=e.tooltipType,d=e.id,f={dataDefinedOnItem:n,getPosition:x,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:he(o,t),hide:s,type:u,color:en(r,a),unit:c,formatter:l,graphicalItemId:d}};return K.createElement(D,{tooltipEntrySettings:f})});function rn(e){var t=e.clipPathId,n=e.points,r=e.props,i=r.needClip,a=r.dot,o=r.dataKey,s=xe(r);return K.createElement(y,{points:n,dot:a,className:`recharts-area-dots`,dotClassName:`recharts-area-dot`,dataKey:o,baseProps:s,needClip:i,clipPathId:t})}function an(e){var t=e.showLabels,n=e.children,r=e.points.map(e=>{var t={x:e.x??0,y:e.y??0,width:0,lowerWidth:0,upperWidth:0,height:0};return Z(Z({},t),{},{value:e.value,payload:e.payload,parentViewBox:void 0,viewBox:t,fill:void 0})});return K.createElement(h,{value:t?r:void 0},n)}function on(e){var t=e.points,r=e.baseLine,i=e.needClip,a=e.clipPathId,o=e.props,s=e.animationElapsedTime,c=e.isAnimating,l=e.isEntrance,u=o.layout,d=o.type,f=o.stroke,p=o.connectNulls,m=o.isRange,h=o.shape,g=o.id,_=qt(o,Wt),v=Z(Z({},n(_)),{},{id:g,points:t,connectNulls:p,type:d,baseLine:r,layout:u,stroke:f,isRange:m,animationElapsedTime:s,isAnimating:c,isEntrance:l});return K.createElement(K.Fragment,null,t?.length>1&&K.createElement(Ce,{clipPath:i?`url(#clipPath-${a})`:void 0},K.createElement(re,{option:h,DefaultShape:$t.shape,shapeProps:v})),K.createElement(rn,{points:t,props:_,clipPathId:a}))}function sn(e,t,n){if(s(e)){var r=s(t)?t:void 0;return a(r,e,n)}if(l(e)||Ge(e)){var i=s(t)?t:void 0;return a(i,0,n)}return e}function cn(e){var t=e.needClip,n=e.clipPathId,i=e.props,a=e.previousPointsRef,o=e.previousBaselineRef,s=i.points,c=i.baseLine,l=i.isAnimationActive,u=i.animationBegin,d=i.animationDuration,f=i.animationEasing,p=i.animationMatchBy,m=i.animationInterpolateFn,h=q(()=>({points:s,baseLine:c}),[s,c]),_=Ye(h,o),v=Te(),y=ee(i.onAnimationStart,i.onAnimationEnd),b=y.isAnimating,x=y.handleAnimationStart,S=y.handleAnimationEnd,C=_.startValue;if(v==null)return null;var w=Array.isArray(c)&&Array.isArray(C)?r(C,c,p):Array.isArray(c)?r(null,c,p):null;return K.createElement(g,{animationInput:h,animationIdPrefix:`recharts-area-`,items:s,previousItemsRef:a,isAnimationActive:l,animationBegin:u,animationDuration:d,animationEasing:f,onAnimationStart:x,onAnimationEnd:S,animationInterpolateFn:m,animationMatchBy:p,layout:v},(e,r,a)=>{var o=r===1?c:Array.isArray(c)?m(w,r,v):a?c:sn(c,C,r);return _.syncStepValue(o,r),K.createElement(an,{showLabels:!b,points:s},i.children,K.createElement(on,{points:e,baseLine:o,needClip:t,clipPathId:n,props:i,animationElapsedTime:r,isAnimating:b||r<1,isEntrance:a}),K.createElement(Pe,{label:i.label}))})}function ln(e){var t=e.needClip,n=e.clipPathId,r=e.props,i=yt(null),a=yt();return K.createElement(cn,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a})}var un=class extends _t{render(){var e=this.props,t=e.hide,n=e.dot,r=e.points,i=e.className,a=e.top,s=e.left,c=e.needClip,l=e.xAxisId,u=e.yAxisId,f=e.width,p=e.height,m=e.id,h=e.baseLine,g=e.zIndex;if(t)return null;var _=v(`recharts-area`,i),y=m,x=o(n),S=x.r,C=x.strokeWidth,ee=d(n),w=S*2+C,te=c?`url(#clipPath-${ee?``:`dots-`}${y})`:void 0;return K.createElement(ie,{zIndex:g},K.createElement(Ce,{className:_},c&&K.createElement(`defs`,null,K.createElement(b,{clipPathId:y,xAxisId:l,yAxisId:u}),!ee&&K.createElement(`clipPath`,{id:`clipPath-dots-${y}`},K.createElement(`rect`,{x:s-w/2,y:a-w/2,width:f+w,height:p+w}))),K.createElement(ln,{needClip:c,clipPathId:y,props:this.props})),K.createElement(be,{points:r,mainColor:en(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:te}),this.props.isRange&&Array.isArray(h)&&K.createElement(be,{points:h,mainColor:en(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:te}))}};function dn(e){var t=e.activeDot,n=e.animationBegin,r=e.animationDuration,i=e.animationEasing,a=e.connectNulls,o=e.dot,s=e.fill,c=e.fillOpacity,l=e.hide,u=e.isAnimationActive,d=e.legendType,f=e.stroke,p=e.xAxisId,m=e.yAxisId,h=qt(e,Gt),g=Ve(),v=oe(),y=Se(p,m).needClip,b=pe(),x=Ke(t=>Pt(t,e.id,b))??{},S=x.points,C=x.isRange,ee=x.baseLine,w=_();if(g!==`horizontal`&&g!==`vertical`||w==null||v!==`AreaChart`&&v!==`ComposedChart`)return null;var te=w.height,T=w.width,E=w.x,D=w.y;return!S||!S.length?null:K.createElement(un,Kt({},h,{activeDot:t,animationBegin:n,animationDuration:r,animationEasing:i,baseLine:ee,connectNulls:a,dot:o,fill:s,fillOpacity:c,height:te,hide:l,layout:g,isAnimationActive:u,isRange:C,legendType:d,needClip:y,points:S,stroke:f,width:T,left:E,top:D,xAxisId:p,yAxisId:m}))}var fn=(e,t,n,r,i)=>{var a=n??t;if(s(a))return a;var o=e===`horizontal`?i:r,c=o.scale.domain();if(o.type===`number`){var l=Math.max(c[0],c[1]),u=Math.min(c[0],c[1]);return a===`dataMin`?u:a===`dataMax`||l<0?l:Math.max(Math.min(c[0],c[1]),0)}return a===`dataMin`?c[0]:a===`dataMax`?c[1]:c[0]};function pn(e){var t=e.areaSettings,n=t.connectNulls,r=t.baseValue,i=t.dataKey,a=e.stackedData,o=e.layout,s=e.chartBaseValue,c=e.xAxis,l=e.yAxis,u=e.displayedData,d=e.dataStartIndex,f=e.xAxisTicks,p=e.yAxisTicks,m=e.bandSize,h=e.stackDataKeys,g=a&&a.length,_=fn(o,s,r,c,l),v=o===`horizontal`,y=!1,b=u.map((e,t)=>{var r;if(g)r=a[d+t];else{var o=ce(e,i);Array.isArray(o)?(r=o,y=!0):r=[_,o]}var s=r?.[1]??null,u=ce(e,i),b=g&&u==null&&h!=null&&h.length>0&&h.every(t=>ce(e,t)==null),x=s==null||g&&!n&&u==null||b;return v?{x:De({axis:c,ticks:f,bandSize:m,entry:e,index:t}),y:x?null:l.scale.map(s)??null,value:r,payload:e}:{x:x?null:c.scale.map(s)??null,y:De({axis:l,ticks:p,bandSize:m,entry:e,index:t}),value:r,payload:e}});return{points:b,baseLine:(g||y?b.map(e=>{var t=Array.isArray(e.value)?e.value[0]:null;return v?{x:e.x,y:t!=null&&e.y!=null?l.scale.map(t)??null:null,payload:e.payload}:{x:t==null?null:c.scale.map(t)??null,y:e.y,payload:e.payload}}):v?l.scale.map(_):c.scale.map(_))??0,isRange:y}}function mn(e){var t=te(e,$t),n=pe();return K.createElement(u,{id:t.id,type:`area`},e=>K.createElement(K.Fragment,null,K.createElement(f,{legendPayload:tn(t)}),K.createElement(nn,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,formatter:t.formatter,tooltipType:t.tooltipType,id:e}),K.createElement(S,{type:`area`,id:e,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:_e(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),K.createElement(dn,Kt({},t,{id:e}))))}var hn=K.memo(mn,Le);hn.displayName=`Area`;var gn=[`axis`],_n=vt((e,t)=>K.createElement(i,{chartName:`AreaChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:gn,tooltipPayloadSearcher:ae,categoricalChartProps:e,ref:t})),vn=[`axis`],yn=vt((e,t)=>K.createElement(i,{chartName:`ComposedChart`,defaultTooltipEventType:`axis`,validateTooltipEventTypes:vn,tooltipPayloadSearcher:ae,categoricalChartProps:e,ref:t})),bn=53,Q=9,xn=2,Sn=X.div`
2
+ display: flex;
3
+ gap: ${xn}px;
4
+ `,Cn=X.div`
5
+ display: grid;
6
+ grid-template-rows: repeat(7, ${Q}px);
7
+ gap: ${xn}px;
8
+ padding-top: ${11}px;
9
+ font-size: 9px;
10
+ color: ${({theme:e})=>e.color.inkFaint};
11
+ `,wn=X.div`
12
+ line-height: ${Q}px;
13
+ padding-right: 2px;
14
+ text-align: right;
15
+ `,Tn=X.div`
16
+ display: grid;
17
+ grid-template-columns: repeat(${bn}, ${Q}px);
18
+ gap: ${xn}px;
19
+ height: ${Q}px;
20
+ font-size: 9px;
21
+ color: ${({theme:e})=>e.color.inkFaint};
22
+ `,En=X.div`
23
+ white-space: nowrap;
24
+ line-height: ${Q}px;
25
+ `,Dn=X.div`
26
+ display: grid;
27
+ grid-template-columns: repeat(${bn}, ${Q}px);
28
+ gap: ${xn}px;
29
+ `,On=X.div`
30
+ display: grid;
31
+ grid-template-rows: repeat(7, ${Q}px);
32
+ gap: ${xn}px;
33
+ `,kn=X.div`
34
+ width: ${Q}px;
35
+ height: ${Q}px;
36
+ border-radius: 2px;
37
+ background: ${({$level:e})=>e===0?`var(--panel-sunk)`:`color-mix(in oklch, var(--accent) ${[0,24,46,70,100][e]??100}%, var(--panel-sunk))`};
38
+ border: 1px solid var(--rule);
39
+ visibility: ${({$future:e})=>e?`hidden`:`visible`};
40
+
41
+ &:hover,
42
+ &:focus-visible {
43
+ outline: 1px solid var(--ink-dim);
44
+ outline-offset: 1px;
45
+ }
46
+ `,An=X(tt)`
47
+ gap: ${xn}px;
48
+ `,jn=X(R)`
49
+ color: ${({theme:e})=>e.color.inkDim};
50
+ font-size: 11px;
51
+ `;function Mn(e){let t=e.filter(e=>e>0).sort((e,t)=>e-t);if(t.length===0)return[0,0,0];let n=e=>t[Math.min(t.length-1,Math.floor(t.length*e))]??0;return[n(.25),n(.5),n(.75)]}function Nn(e,[t,n,r]){return e<=0?0:e<=t?1:e<=n?2:e<=r?3:4}function Pn({days:e,now:t}){let[n,r]=bt(`tokens`),[i,a]=bt(null),o=me(n),s=q(()=>{let n=new Map;for(let t of e){let e=Number(t.key);Number.isFinite(e)&&n.set(qe(e),{requests:t.requests,errors:t.errors,costUsd:t.costUsd,inputTokens:t.inputTokens,outputTokens:t.outputTokens,cacheReadTokens:t.cacheReadTokens,cacheWriteTokens:t.cacheWriteTokens,rtkSavedTokens:t.rtkSavedTokens,rtkAppliedRequests:t.rtkAppliedRequests,durationMsSum:t.durationMsSum})}let r=new Date(qe(t));r.setDate(r.getDate()+(6-r.getDay())-370);let i=qe(t);return Array.from({length:bn},()=>Array.from({length:7},()=>{let e=r.getTime();return r.setDate(r.getDate()+1),{at:e,totals:n.get(e)??we,future:e>i}}))},[e,t]),c=s.flat(),l=Mn(c.map(e=>o.of({key:``,...e.totals}))),u=c.reduce((e,t)=>Be(e,N(t.totals)),we),d=c.reduce((e,t)=>e+ +(t.totals.requests>0),0),f=(e,t)=>`${e}: ${H(t.requests)} requests, ${H(ue(t))} tokens, ${V(t.costUsd)}`;return J(ut,{legend:`Activity`,meta:i===null?`${H(d)} active days`:void 0,actions:J(Oe,{children:ve.map(e=>J(Ae,{type:`button`,$size:`sm`,$on:e.id===n,"aria-pressed":e.id===n,onClick:()=>r(e.id),children:e.label},e.id))}),children:Y(L,{$gap:2,children:[J(rt,{children:J(L,{$gap:1,style:{width:611},children:Y(Sn,{children:[J(Cn,{"aria-hidden":`true`,children:[``,`Mon`,``,`Wed`,``,`Fri`,``].map((e,t)=>J(wn,{children:e},t))}),Y(L,{$gap:1,children:[J(Tn,{"aria-hidden":`true`,children:s.map((e,t)=>{let n=e[0],r=s[t-1]?.[0],i=n!==void 0&&(r===void 0||new Date(r.at).getMonth()!==new Date(n.at).getMonth());return J(En,{children:i&&n!==void 0?new Date(n.at).toLocaleDateString(`en-GB`,{month:`short`}):``},n?.at??t)})}),J(Dn,{role:`grid`,"aria-label":`${o.label} per day over the last year`,children:s.map(e=>J(On,{role:`row`,children:e.map(e=>J(kn,{role:`gridcell`,tabIndex:-1,"aria-label":f(Ee(e.at),e.totals),title:f(Ee(e.at),e.totals),$future:e.future,$level:e.future?0:Nn(o.of({key:``,...e.totals}),l),onMouseEnter:()=>a(e),onMouseLeave:()=>a(null)},e.at))},e[0]?.at))})]})]})})}),Y(tt,{$justify:`space-between`,$wrap:!0,children:[J(jn,{children:i===null?f(`Last 12 months`,u):f(Ee(i.at),i.totals)}),Y(tt,{$gap:1,children:[J(Xe,{children:`Less`}),J(An,{"aria-hidden":`true`,children:[0,1,2,3,4].map(e=>J(kn,{$level:e,$future:!1},e))}),J(Xe,{children:`More`})]})]})]})})}function Fn({buckets:e,by:t,since:n,until:r,metric:i,names:a}){let o=F(n,r,t),s=new Map,c=new Map;for(let n of e){let e=n.split??`unknown`;s.set(e,Be(s.get(e)??we,n));let r=c.get(e)??new Map,a=ge(n.key,t);r.set(a,(r.get(a)??0)+i.of(n)),c.set(e,r)}let l=[...s.entries()].sort((e,t)=>i.of(N(t[1]))-i.of(N(e[1])));return J(rt,{children:Y(ht,{children:[J(`thead`,{children:Y(`tr`,{children:[J(W,{children:`Key`}),J(W,{children:`Trend`}),J(W,{$align:`right`,children:`Requests`}),J(W,{$align:`right`,children:`Failed`}),J(W,{$align:`right`,children:`Tokens`}),J(W,{$align:`right`,children:`Mean`}),J(W,{$align:`right`,children:`Cost`})]})}),J(`tbody`,{children:l.map(([e,t])=>{let n=c.get(e)??new Map,r=e===`unknown`?`Unattributed`:a.get(e)??e;return Y(mt,{children:[J(U,{children:J(nt,{style:{display:`block`,maxWidth:`28ch`},children:r})}),J(U,{style:{width:120},children:J(z,{values:o.map(e=>n.get(e)??0),height:20,label:`${r}: ${i.format(i.of(N(t)))} over the window`})}),J(U,{$align:`right`,$mono:!0,children:H(t.requests)}),J(U,{$align:`right`,$mono:!0,style:t.errors>0?{color:`var(--down)`}:void 0,children:B(t.requests===0?0:t.errors/t.requests,0)}),J(U,{$align:`right`,$mono:!0,children:H(ue(t))}),J(U,{$align:`right`,$mono:!0,children:lt(t.requests===0?null:t.durationMsSum/t.requests)}),J(U,{$align:`right`,$mono:!0,children:V(t.costUsd)})]},e)})})]})})}var In=6,Ln=`__other__`,Rn=`unknown`;function zn(e,t){let n=t.get(e);return n===void 0?at.find(t=>gt[t].models.some(t=>t.id===e))??null:n}function Bn(e,t){return e===null?`var(--ink-faint)`:`color-mix(in oklch, ${it(e)} ${Math.max(30,100-t*22)}%, var(--panel))`}function Vn({buckets:e,by:n,since:r,until:i,metric:a,providers:o}){let s=[...Me(e,a).entries()],c=s.slice(0,In),l=s.slice(In),u=[];for(let e of[...at,null])c.filter(([t])=>zn(t,o)===e).forEach(([t,n],r)=>{u.push({name:t,label:t===Rn?`Unresolved`:t,color:Bn(e,r),totals:n})});l.length>0&&u.push({name:Ln,label:`${l.length} more`,color:`var(--ink-faint)`,totals:l.reduce((e,[,t])=>Be(e,N(t)),we)});let d=new Set(c.map(([e])=>e)),f=new Map;for(let t of e){let e=t.split??Rn,r=`${ge(t.key,n)} ${d.has(e)?e:Ln}`;f.set(r,(f.get(r)??0)+a.of(t))}let p=F(r,i,n).map(e=>{let t={at:e};for(let n of u)t[n.name]=f.get(`${e} ${n.name}`)??0;return t}),h=new Map(u.map(e=>[e.name,e.label]));return Y(L,{$gap:2,children:[J(Re,{$height:220,children:J(de,{width:`100%`,height:`100%`,children:Y(_n,{data:p,margin:{top:4,right:4,bottom:4,left:4},children:[J(t,{stroke:`var(--rule)`,vertical:!1}),J(T,{dataKey:`at`,tickFormatter:e=>k(e,n),tick:{fill:`var(--ink-faint)`,fontSize:10},stroke:`var(--rule-strong)`,interval:`preserveStartEnd`,minTickGap:28}),J(We,{tickFormatter:e=>a.format(e),tick:{fill:`var(--ink-faint)`,fontSize:10},stroke:`var(--rule-strong)`,width:40}),J(m,{cursor:{stroke:`var(--rule-strong)`},content:({active:e,payload:t,label:r})=>{if(e!==!0||t===void 0||t.length===0)return null;let i=t.filter(e=>Number(e.value??0)>0);return Y(j,{children:[J(`div`,{children:k(Number(r),n)}),i.length===0?J(`div`,{children:`No ${a.label.toLowerCase()}`}):i.map(e=>Y(`div`,{children:[h.get(String(e.dataKey))??String(e.dataKey),` `,a.format(Number(e.value??0))]},String(e.dataKey)))]})}}),u.map(e=>J(hn,{type:`monotone`,dataKey:e.name,stackId:`models`,stroke:e.color,strokeWidth:2,fill:e.color,fillOpacity:.22,isAnimationActive:!1},e.name))]})})}),J(Fe,{children:u.map(e=>Y(`span`,{children:[J(P,{$color:e.color}),` `,J(nt,{title:`${e.label}: ${a.format(a.of(N(e.totals)))} ${a.label.toLowerCase()}`,style:{display:`inline-block`,maxWidth:`24ch`,verticalAlign:`bottom`},children:e.label})]},e.name))})]})}var Hn=`unknown`;function Un(e){let t=at.find(t=>t===e);return t===void 0?`var(--ink-faint)`:it(t)}function Wn(e){let t=at.find(t=>t===e);return t===void 0?`Unresolved`:ot[t]}function Gn({buckets:e,by:n,since:r,until:i,metric:a}){let o=Me(e,a),s=[...at,Hn].map(e=>({name:e,totals:o.get(e)})).filter(e=>e.totals!==void 0),c=s.map(e=>e.name),l=F(r,i,n),u=He(e,l,n,a),d=[...o.values()].reduce((e,t)=>e+t.requests,0);return Y(L,{$gap:3,children:[J(Re,{$height:200,children:J(de,{width:`100%`,height:`100%`,children:Y(_n,{data:u,margin:{top:4,right:4,bottom:4,left:4},children:[J(t,{stroke:`var(--rule)`,vertical:!1}),J(T,{dataKey:`at`,tickFormatter:e=>k(e,n),tick:{fill:`var(--ink-faint)`,fontSize:10},stroke:`var(--rule-strong)`,interval:`preserveStartEnd`,minTickGap:28}),J(We,{tickFormatter:e=>a.format(e),tick:{fill:`var(--ink-faint)`,fontSize:10},stroke:`var(--rule-strong)`,width:48}),J(m,{cursor:{stroke:`var(--rule-strong)`},content:({active:e,payload:t,label:r})=>e!==!0||t===void 0||t.length===0?null:Y(j,{children:[J(`div`,{children:k(Number(r),n)}),t.map(e=>Y(`div`,{children:[Wn(String(e.dataKey)),` `,a.format(Number(e.value??0))]},String(e.dataKey)))]})}),c.map(e=>J(hn,{type:`monotone`,dataKey:e,stackId:`providers`,stroke:Un(e),strokeWidth:2,fill:Un(e),fillOpacity:.22,isAnimationActive:!1},e))]})})}),J(Fe,{children:c.map(e=>Y(`span`,{children:[J(P,{$color:Un(e)}),` `,Wn(e)]},e))}),Y(ht,{children:[J(`thead`,{children:Y(`tr`,{children:[J(W,{children:`Provider`}),J(W,{$align:`right`,children:`Share`}),J(W,{$align:`right`,children:`Requests`}),J(W,{$align:`right`,children:`Failed`}),J(W,{$align:`right`,children:`Tokens`}),J(W,{$align:`right`,children:`Cost`})]})}),J(`tbody`,{children:s.map(({name:e,totals:t})=>Y(mt,{children:[Y(U,{children:[J(P,{$color:Un(e)}),` `,Wn(e)]}),J(U,{$align:`right`,$mono:!0,children:B(d===0?0:t.requests/d,0)}),J(U,{$align:`right`,$mono:!0,children:H(t.requests)}),J(U,{$align:`right`,$mono:!0,style:t.errors>0?{color:`var(--down)`}:void 0,children:H(t.errors)}),J(U,{$align:`right`,$mono:!0,children:H(ue(t))}),J(U,{$align:`right`,$mono:!0,children:V(t.costUsd)})]},e))})]})]})}var Kn=X.li`
52
+ display: grid;
53
+ grid-template-columns: minmax(0, 20ch) 1fr auto;
54
+ align-items: center;
55
+ gap: ${({theme:e})=>e.space(2)};
56
+ `,qn=X.ol`
57
+ display: flex;
58
+ flex-direction: column;
59
+ gap: ${({theme:e})=>e.space(2)};
60
+ `,Jn=X.div`
61
+ height: 8px;
62
+ border-radius: 2px;
63
+ background: ${({theme:e})=>e.color.panelSunk};
64
+ border: 1px solid ${({theme:e})=>e.color.rule};
65
+ overflow: hidden;
66
+ `,Yn=X.div`
67
+ width: ${({$share:e})=>`${Math.max(1.5,e*100)}%`};
68
+ height: 100%;
69
+ border-radius: 0 2px 2px 0;
70
+ background: ${({theme:e,$fault:t})=>t?e.color.down:e.color.accent};
71
+ opacity: 0.85;
72
+ `,Xn=X(nt)`
73
+ display: block;
74
+ font-family: ${({theme:e})=>e.font.mono};
75
+ font-size: 12px;
76
+ `,Zn=12;function Qn({buckets:e,metric:t,names:n,unknownLabel:r}){let i=new Map;for(let t of e)i.set(t.key,Be(i.get(t.key)??we,t));let a=e=>e===`unknown`?r??`Unattributed`:n?.get(e)??e,o=[...i.entries()].map(([e,n])=>({name:a(e),entry:n,value:t.of(N(n))})).sort((e,t)=>t.value-e.value),s=o.slice(0,Zn),c=o.slice(Zn),l=s[0]?.value??0;return Y(L,{$gap:3,children:[J(qn,{children:s.map(({name:e,entry:n,value:r})=>Y(Kn,{children:[J(Xn,{title:e,children:e}),J(Jn,{children:J(Yn,{$share:l===0?0:r/l,$fault:n.requests>0&&n.errors===n.requests})}),Y(tt,{$gap:2,children:[J(R,{$size:`12px`,children:t.format(r)}),J(R,{$size:`11px`,$dim:!0,children:V(n.costUsd)})]})]},e))}),c.length===0?null:J(R,{$size:`11px`,$dim:!0,children:`+ ${c.length} more, ${H(c.reduce((e,t)=>e+t.entry.requests,0))} requests`})]})}function $({legend:e,meta:t,actions:n,query:r,empty:i,isEmpty:a,children:o}){return J(ut,{legend:e,meta:t,actions:n,children:r.isError?J(dt,{error:r.error,onRetry:r.refetch}):r.isLoading?J(ft,{rows:4}):a?J(pt,{legend:i.legend,message:i.message}):o})}var $n=[{id:`inputTokens`,label:`Uncached input`,opacity:.95},{id:`outputTokens`,label:`Output`,opacity:.7},{id:`cacheReadTokens`,label:`Cache read`,opacity:.45},{id:`cacheWriteTokens`,label:`Cache write`,opacity:.22}];function er({buckets:e,by:n,since:r,until:i}){let a=new Map;for(let t of e)a.set(ge(t.key,n),t);let o=F(r,i,n).map(e=>{let t=a.get(e);return{at:e,inputTokens:t?.inputTokens??0,outputTokens:t?.outputTokens??0,cacheReadTokens:t?.cacheReadTokens??0,cacheWriteTokens:t?.cacheWriteTokens??0}}),s=$n.map(e=>({...e,value:o.reduce((t,n)=>t+n[e.id],0)})),c=s.reduce((e,t)=>e+t.value,0);return Y(L,{$gap:3,children:[J(Re,{$height:200,children:J(de,{width:`100%`,height:`100%`,children:Y(_n,{data:o,margin:{top:4,right:4,bottom:4,left:4},children:[J(t,{stroke:`var(--rule)`,vertical:!1}),J(T,{dataKey:`at`,tickFormatter:e=>k(e,n),tick:{fill:`var(--ink-faint)`,fontSize:10},stroke:`var(--rule-strong)`,interval:`preserveStartEnd`,minTickGap:28}),J(We,{tick:{fill:`var(--ink-faint)`,fontSize:10},stroke:`var(--rule-strong)`,width:44,tickFormatter:e=>H(e)}),J(m,{cursor:{stroke:`var(--rule-strong)`},content:({active:e,payload:t,label:r})=>e!==!0||t===void 0||t.length===0?null:Y(j,{children:[J(`div`,{children:k(Number(r),n)}),$n.map(e=>Y(`div`,{children:[e.label,` `,H(Number(t.find(t=>t.dataKey===e.id)?.value??0))]},e.id))]})}),$n.map(e=>J(hn,{type:`monotone`,dataKey:e.id,stackId:`tokens`,stroke:`var(--accent)`,strokeOpacity:e.opacity,strokeWidth:1.5,fill:`var(--accent)`,fillOpacity:e.opacity*.5,isAnimationActive:!1},e.id))]})})}),J(Fe,{children:s.map(e=>Y(tt,{$gap:1,children:[J(P,{$color:`var(--accent)`,style:{opacity:e.opacity}}),J(`span`,{children:e.label}),J(R,{$size:`11px`,children:H(e.value)}),J(R,{$size:`11px`,$dim:!0,children:B(c===0?0:e.value/c,0)})]},e.id))})]})}function tr({buckets:e,by:n,since:r,until:i}){let a=new Map;for(let t of e)a.set(ge(t.key,n),t);let o=F(r,i,n).map(e=>{let t=a.get(e);return{at:e,label:k(e,n),requests:t?.requests??0,errors:t?.errors??0,costUsd:t?.costUsd??0,tokens:t===void 0?0:ue(t)}});return Y(L,{$gap:2,children:[J(Re,{$height:220,children:J(de,{width:`100%`,height:`100%`,children:Y(yn,{data:o,margin:{top:4,right:4,bottom:4,left:4},children:[J(t,{stroke:`var(--rule)`,vertical:!1}),J(T,{dataKey:`label`,tick:{fill:`var(--ink-faint)`,fontSize:10},stroke:`var(--rule-strong)`,interval:`preserveStartEnd`,minTickGap:28}),J(We,{tick:{fill:`var(--ink-faint)`,fontSize:10},stroke:`var(--rule-strong)`,width:40}),J(m,{cursor:{stroke:`var(--rule-strong)`},content:({active:e,payload:t})=>{if(e!==!0||t===void 0||t.length===0)return null;let n=t[0]?.payload;return n===void 0?null:Y(j,{children:[J(`div`,{children:n.label}),Y(`div`,{children:[H(n.requests),` requests`]}),Y(`div`,{children:[H(n.errors),` failed`]}),Y(`div`,{children:[H(n.tokens),` tokens`]}),J(`div`,{children:V(n.costUsd)})]})}}),J(hn,{type:`monotone`,dataKey:`requests`,stroke:`none`,fill:`var(--accent)`,fillOpacity:.12,isAnimationActive:!1}),J(c,{type:`monotone`,dataKey:`requests`,stroke:`var(--accent)`,strokeWidth:2,dot:!1,activeDot:{r:4,stroke:`var(--panel)`,strokeWidth:2},isAnimationActive:!1}),J(c,{type:`monotone`,dataKey:`errors`,stroke:`var(--down)`,strokeWidth:2,dot:!1,activeDot:{r:4,stroke:`var(--panel)`,strokeWidth:2},isAnimationActive:!1})]})})}),Y(Fe,{children:[Y(`span`,{children:[J(P,{$color:`var(--accent)`}),` Requests`]}),Y(`span`,{children:[J(P,{$color:`var(--down)`}),` Failed`]})]})]})}var nr=X.div`
77
+ display: grid;
78
+ grid-template-columns: repeat(
79
+ auto-fit,
80
+ minmax(max(180px, calc((100% - 4 * ${({theme:e})=>e.space(3)}) / 5)), 1fr)
81
+ );
82
+ gap: ${({theme:e})=>e.space(3)};
83
+ `,rr=864e5,ir=[{id:`requestedModel`,label:`As requested`,column:`Virtual model`},{id:`model`,label:`As served`,column:`Upstream model`}];function ar(){let{cadence:e}=st(),[t,n]=bt(`24h`),[r,i]=bt(`tokens`),[a,o]=bt(`model`),s=se(t),c=me(r),l=q(()=>s.grain===`daily`?qe(Date.now()-s.ms):Math.floor((Date.now()-s.ms)/6e4)*6e4,[s]),u=q(()=>l+s.ms,[l,s]),d=q(()=>qe(Date.now()-371*rr),[]),f={since:l,grain:s.grain},p=I({...f,groupBy:s.by},e(6e4)),m=I({...f,groupBy:s.by,splitBy:`provider`},e(6e4)),h=I({...f,groupBy:s.by,splitBy:`model`},e(6e4)),g=I({...f,groupBy:s.by,splitBy:`apiKey`},e(6e4)),_=I({...f,groupBy:a},e(6e4)),v=I({...f,groupBy:`credential`},e(6e4)),y=I({since:d,grain:`daily`,groupBy:`day`},e(3e5)),b=Ze(),x=et(),S=Qe(),C=q(()=>{let e=new Map;for(let t of S.data??[])for(let n of t.targets)e.set(n.model,n.provider);return e},[S.data]),ee=q(()=>{let e=new Map;for(let t of b.data??[])e.set(t.id,t.label);return e},[b.data]),te=q(()=>{let e=new Map;for(let t of x.data??[])e.set(t.id,t.label);return e},[x.data]),T=p.data??[],E=w(T),D=E.inputTokens+E.cacheReadTokens+E.cacheWriteTokens,ne=ue(E),re=E.requests===0?0:E.outputTokens/E.requests,ie=D===0?0:E.cacheReadTokens/D,ae=D===0?0:E.cacheWriteTokens/D,oe=E.requests===0?0:E.costUsd/E.requests,ce=F(l,u,s.by),O=new Map(T.map(e=>[ge(e.key,s.by),e])),k=e=>ce.map(e),A=e=>e>=.25?`down`:e>=.05?`warn`:`ok`,j=E.requests===0?0:E.errors/E.requests,M={legend:`Nothing recorded`,message:`No requests landed in this window. Widen the range, or send traffic through the gateway.`};return Y(L,{$gap:4,children:[J(ct,{legend:`Usage`,title:`Requests, tokens, and spend`,summary:p.isLoading?`Reading usage…`:`${H(E.requests)} requests and ${V(E.costUsd)} over the last ${s.label}.`,actions:J(Oe,{children:le.map(e=>J(Ae,{type:`button`,$size:`sm`,$on:e.id===t,"aria-pressed":e.id===t,onClick:()=>n(e.id),children:e.id},e.id))})}),Y(nr,{"data-testid":`usage-summary-deck`,children:[J(G,{legend:`Requests`,value:H(E.requests),unit:s.label,trace:J(z,{values:k(e=>O.get(e)?.requests??0),overlay:k(e=>O.get(e)?.errors??0),label:`${E.requests} requests, ${E.errors} of them failed`})}),J(G,{legend:`Error rate`,value:B(j),unit:`${H(E.errors)} failed`,tone:E.requests===0?`ink`:A(j),trace:J(z,{values:k(e=>{let t=O.get(e);return t===void 0||t.requests===0?0:t.errors/t.requests}),color:`var(--down)`,label:`${E.errors} failed requests against ${E.requests} total`})}),J(G,{legend:`Prompt input`,value:H(D),unit:`${H(E.inputTokens)} uncached`,trace:J(z,{values:k(e=>{let t=O.get(e);return(t?.inputTokens??0)+(t?.cacheReadTokens??0)+(t?.cacheWriteTokens??0)}),label:`${D} prompt input tokens over the window`})}),J(G,{legend:`Output`,value:H(E.outputTokens),unit:`mean ${H(re)}/request`,trace:J(z,{values:k(e=>O.get(e)?.outputTokens??0),label:`${E.outputTokens} output tokens over the window`})}),J(G,{legend:`Cache reads`,value:H(E.cacheReadTokens),unit:`${B(ie,0)} of prompt`,trace:J(z,{values:k(e=>O.get(e)?.cacheReadTokens??0),label:`${E.cacheReadTokens} cache-read tokens over the window`})}),J(G,{legend:`Cache writes`,value:H(E.cacheWriteTokens),unit:`${B(ae,0)} of prompt`,trace:J(z,{values:k(e=>O.get(e)?.cacheWriteTokens??0),label:`${E.cacheWriteTokens} cache-write tokens over the window`})}),J(G,{legend:`RTK saved`,value:H(E.rtkSavedTokens),unit:`${H(E.rtkAppliedRequests)} requests`,trace:J(z,{values:k(e=>O.get(e)?.rtkSavedTokens??0),label:`${E.rtkSavedTokens} estimated tokens saved by RTK over the window`})}),J(G,{legend:`Mean duration`,value:lt(E.requests===0?null:E.durationMsSum/E.requests),unit:`per request`,trace:J(z,{values:k(e=>{let t=O.get(e);return t===void 0||t.requests===0?0:t.durationMsSum/t.requests}),color:`var(--ok)`,label:`mean request duration over the window`})}),J(G,{legend:`Spend`,value:V(E.costUsd),unit:s.label,trace:J(z,{values:k(e=>O.get(e)?.costUsd??0),color:`var(--warn)`,label:`spend over the window, ${V(E.costUsd)} total`})}),J(G,{legend:`Cost / request`,value:V(oe),unit:`mean`,trace:J(z,{values:k(e=>{let t=O.get(e);return t===void 0||t.requests===0?0:t.costUsd/t.requests}),color:`var(--warn)`,label:`${V(oe)} mean cost per request over the window`})})]}),J($,{legend:`Traffic`,meta:s.by===`hour`?`By hour`:`By day`,query:p,isEmpty:T.length===0,empty:M,children:J(tr,{buckets:T,by:s.by,since:l,until:u})}),J(Oe,{children:ve.map(e=>J(Ae,{type:`button`,$size:`sm`,$on:e.id===r,"aria-pressed":e.id===r,onClick:()=>i(e.id),children:`Rank by ${e.label.toLowerCase()}`},e.id))}),J($,{legend:`Traffic by upstream model`,meta:`${c.label}, ${s.by===`hour`?`by hour`:`by day`}`,query:h,isEmpty:(h.data??[]).length===0,empty:M,children:J(Vn,{buckets:h.data??[],by:s.by,since:l,until:u,metric:c,providers:C})}),Y($e,{$min:`480px`,$gap:4,children:[Y(L,{$gap:4,children:[J($,{legend:`Providers`,meta:c.label,query:m,isEmpty:(m.data??[]).length===0,empty:M,children:J(Gn,{buckets:m.data??[],by:s.by,since:l,until:u,metric:c})}),J(Pn,{days:y.data??[],now:Date.now()})]}),Y(L,{$gap:4,children:[J($,{legend:`Token mix`,meta:H(ne),query:p,isEmpty:T.length===0,empty:M,children:J(er,{buckets:T,by:s.by,since:l,until:u})}),J($,{legend:`Models`,meta:ir.find(e=>e.id===a)?.column,query:_,isEmpty:(_.data??[]).length===0,empty:M,actions:J(Oe,{children:ir.map(e=>J(Ae,{type:`button`,$size:`sm`,$on:e.id===a,"aria-pressed":e.id===a,onClick:()=>o(e.id),children:e.label},e.id))}),children:J(Qn,{buckets:_.data??[],metric:c})}),J($,{legend:`Accounts`,meta:c.label,query:v,isEmpty:(v.data??[]).length===0,empty:M,children:J(Qn,{buckets:v.data??[],metric:c,names:te,unknownLabel:`No account`})})]})]}),J($,{legend:`API keys`,meta:c.label,query:g,isEmpty:(g.data??[]).length===0,empty:M,children:J(Fn,{buckets:g.data??[],by:s.by,since:l,until:u,metric:c,names:ee})})]})}var or=ar;export{or as component};
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/_app-Dx_xnlud.js","assets/Match-CgNxphvS.js","assets/queries-CIOPbRcE.js","assets/matchContext-BOenO3J2.js","assets/Rack-B4c0dbIb.js","assets/Lamp-BDf7-dMa.js","assets/login-cCXnl34r.js","assets/Field-D-14HF0x.js","assets/States-CxLDlCaw.js","assets/reasons-Cb8yF4Oy.js","assets/_app.index-DwOZe1A-.js","assets/TokenBreakdown-BySwFK6Q.js","assets/Chip-BltJSw8A.js","assets/Meter-stpt3vQu.js","assets/Table-CVDZ69Zx.js","assets/Readout-Du15WYx0.js","assets/_app.accounts-DvBYnbfS.js","assets/CopyValue-Dds-Ow9a.js","assets/plus-fXfUTt6_.js","assets/trash-2-ZPh3619D.js","assets/Modal-Dj3LvMS9.js","assets/dist-9ps0Qd15.js","assets/Toggle-DMk46RX2.js","assets/Confirm-gd8Y6snu.js","assets/catalog-BBKm8Ih8.js","assets/shared-B4o-2quR.js","assets/_app.console-CoaRdkB1.js","assets/_app.database-CES5ec5g.js","assets/_app.keys-B5HrAu2U.js","assets/_app.logs-NbfIexz0.js","assets/_app.models-B1MdFRtQ.js","assets/_app.settings-BkDkGkKF.js","assets/_app.usage-DNpM8Nub.js","assets/_app.plugins._pluginId-ByMziW8p.js"])))=>i.map(i=>d[i]);
2
- import{$ as e,At as t,Bt as n,Ct as r,Dt as i,Et as a,Ft as o,Gt as s,Ht as c,It as l,Kt as u,Lt as d,Mt as f,Nt as p,Ot as m,Pt as h,Rt as g,St as _,Tt as v,Ut as y,Vt as b,Wt as x,Y as S,at as C,bt as ee,dt as w,ft as T,gt as E,ht as D,i as te,jt as ne,kt as re,lt as ie,pt as ae,q as oe,qt as se,vt as ce,wt as le,xt as ue,yt as de,zt as fe}from"./queries-CIOPbRcE.js";import{a as pe,i as me,n as he,o as ge,r as _e,t as ve}from"./Match-CgNxphvS.js";import{n as ye,r as be,t as xe}from"./matchContext-BOenO3J2.js";import{MutationCache as Se,QueryCache as Ce,QueryClient as we,QueryClientProvider as Te}from"@tanstack/react-query";import*as O from"react";import Ee,{StrictMode as De,createContext as Oe,use as ke,useCallback as Ae,useEffect as je,useState as Me}from"react";import{Fragment as Ne,jsx as k,jsxs as Pe}from"react/jsx-runtime";import{createRoot as Fe}from"react-dom/client";import Ie,{ThemeProvider as Le,createGlobalStyle as Re}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 ze(){try{return sessionStorage}catch{return}}var Be=`tsr-scroll-restoration-v1_3`,Ve=ze();function He(){try{return JSON.parse(Ve?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}function Ue(){try{Ve?.setItem(Be,JSON.stringify(A))}catch{}}var A=He(),We=`data-scroll-restoration-id`,Ge=e=>e.state.__TSR_key||e.href;function Ke(e){let t=e.getAttribute(We);if(t)return`[${We}="${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 qe=!1,Je=`window`;function Ye(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function Xe(e){let t=new Set;for(let n of e){if(n===Je)continue;let e=Ye(n);e&&t.add(e)}return t}function Ze(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);let i=e.options.getScrollRestorationKey||Ge,a=new Set,o=e=>{let t=A[e]||={};for(let e of a)e===document?t[Je]={scrollX,scrollY}:e.isConnected&&(t[Ke(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.restoration&&(r.restoration=!0,qe=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{qe||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())),Ue()})),!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=A[d];if(e){let t=A[u];for(let n in e){if(n===Je){if(s)continue}else{let e=Ye(n);if(!e||s&&o&&(l??=Xe(o),l.has(e)))continue}t||=A[u]={},t[n]??=e[n]}}}qe=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=Xe(o));let t=e&&i&&c,s=r.restoring?A[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===Je){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=Ye(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{qe=!1}}))}function Qe(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 $e(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function et(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]=$e(r):Array.isArray(t)?t.push($e(r)):n[e]=[t,$e(r)]}return n}var tt=/^(?:\s|["[{\d-]|fa|nu|tr)/,nt=it(JSON.parse),rt=at(JSON.stringify,JSON.parse);function it(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=et(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function at(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&&!tt.test(r))return r;try{return t(r),e(r)}catch{}}return r}return e=>{let t=Qe(e,r);return t?`?${t}`:``}}function ot(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function st(e){return e instanceof Response&&!!e.options}function ct(e){return{input:({url:t})=>{for(let n of e)t=ut(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=dt(e[n],t);return t}}}function lt(e){let t=r(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=ue([`/`,t,e.pathname]),e)}}function ut(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 dt(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 ft(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i}=t,a=new Map,s=n(`idle`),c=n(e),l=n(void 0),u=n([]),d=r(()=>u.get().map(e=>a.get(e).get())),f=r(()=>({status:s.get(),isLoading:s.get()===`pending`,matches:d.get(),location:c.get(),resolvedLocation:l.get()}));function p(e){let t=a.get(e);return t||(t=n(void 0),a.set(e,t)),t}let m={status:s,location:c,resolvedLocation:l,ids:u,matches:d,byRoute:a,__store:f,getMatchStore:p,setMatches:h};function h(e){let t=u.get(),n=e.map(e=>e.routeId);i(()=>{o(t,n)||u.set(n);for(let e of t)n.includes(e)||a.get(e).set(()=>void 0);for(let t of e){let e=p(t.routeId);e.get()!==t&&e.set(t)}})}return m}var j=`__TSR_index`,pt=`popstate`,mt=`beforeunload`;function ht(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=yt(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[j];i=gt(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[j];i=gt(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[j]!==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 gt(e,t){t||={};let n=bt();return{...t,key:n,__TSR_key:n,[j]:e}}function _t(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??(()=>yt(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=bt();t.history.replaceState({[j]: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=yt(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[j]-l.state[j],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=ht({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(mt,x,{capture:!0}),t.removeEventListener(pt,b)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(mt,x,{capture:!0}),t.addEventListener(pt,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 vt(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function yt(e,t){let n=vt(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=bt();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||{[j]:0,key:a,__TSR_key:a}}}function bt(){return(Math.random()+1).toString(36).substring(7)}function xt(e){return e.options.loader||e.options.beforeLoad||e.lazyFn||e.options.component?.preload||e.options.pendingComponent?.preload}function St(e,t){return{fromLocation:t,toLocation:e,pathChanged:t?.pathname!==e.pathname,hrefChanged:t?.href!==e.href,hashChanged:t?.hash!==e.hash}}function Ct({key:e,__TSR_key:t,__TSR_index:n,__hashScrollIntoViewOptions:r,...i}){return i}function wt(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 Tt=class{constructor(e,a){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??`/`,i=this.basepath===void 0,a=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=de(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history?this.options.history:_t()),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=f(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=ft(this.latestLocation,e),Ze(this)}let o=this.options.basepath??`/`,s=this.options.rewrite;if(i||n!==o||a!==s){this.basepath=o;let e=[],t=r(o);t&&t!==`/`&&e.push(lt({basepath:o})),s&&e.push(s),this.rewrite=e.length===0?void 0:e.length===1?e[0]:ct(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=ne(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&t(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:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:l(e).path,external:!1,searchStr:o,search:x(t?.search,i),hash:l(r.slice(1)).path,state:s(t?.state,a)}}let o=new URL(i,this.origin),c=ut(this.rewrite,o),u=this.options.parseSearch(c.search),d=this.options.stringifySearch(u);return c.search=d,{href:c.href.replace(c.origin,``),publicHref:i,pathname:l(c.pathname).path,external:!!this.rewrite&&c.origin!==this.origin,searchStr:d,search:x(t?.search,u),hash:l(c.hash.slice(1)).path,state:s(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);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=(e,t)=>_({base:e,to:t.includes(`//`)?ce(t):t,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=m(v(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 r=t._fromLocation||this._pendingLocation||this.latestLocation,i=this.matchRoutesLightweight(r);t.from;let a=t.unsafeRelative===`path`?r.pathname:t.from??i[1],o=t.to?`${t.to}`:void 0,c=i[2],u=Object.assign(Object.create(null),i[3]),d=o?.charCodeAt(0)===47?`/`:this.resolvePathWithBase(a,`.`),f=o?this.resolvePathWithBase(d,o):d,p=jt(t.params,u),m=this.routesByPath[v(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&&n(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 _=e.leaveParams?f:l(ee({path:f,params:p,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,y=c;if(e._includeValidateSearch&&this.options.search?.strict){let e={};h.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,Ot(t.options.validateSearch,{...e,...y}))}catch{}}),y=e}y=kt(y,t,h,e._includeValidateSearch),y=x(c,y);let b=this.options.stringifySearch(y),S=t.hash===!0?r.hash:t.hash?fe(t.hash,r.hash):void 0,C=S?`#${S}`:``,w=t.state===!0?r.state:t.state?fe(t.state,r.state):{};w=s(r.state,w);let T=`${_}${b}${C}`,E,D,te=!1;if(this.rewrite){let e=new URL(T,this.origin),t=dt(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=g(T),D=E;return{publicHref:D,href:E,pathname:_,search:y,searchStr:b,state:w,hash:S??``,external:te,unmaskOnReload:t.unmaskOnReload}},r=(n={},r)=>{let a=t(n),o=r?t(r):void 0;if(!o){let n=Object.create(null);if(this.options.routeMasks){let s=i(a.pathname,this.processedTree);if(s){Object.assign(n,s.rawParams);let{from:i,params:a,...c}=s.route,l=jt(a,n);r={from:e.from,...c,params:l},o=t(r)}}}return o&&(a.maskedLocation=o),a};return e.mask?r(e,{from:e.from,...e.mask}):r(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r,i=v(this.latestLocation.href)===v(n.href)&&d(Ct(n.state),Ct(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=yt(o,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);s.to=ut(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(b(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 ln(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(St(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`)&&xt(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&&b(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=M,this.preloadRoute=e=>un(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=re(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,a.pathname,this.processedTree);return!o||e.params&&!d(o.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?d(a.search,r.search,{partial:!0})?o.rawParams:!1:o.rawParams},this.getStoreConfig=a,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??rt,parseSearch:e.parseSearch??nt,protocolAllowlist:e.protocolAllowlist??h}),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=a(e),this.routeBranchCache.set(e,t)),t}matchRoutesInternal(e,t){let[n,r,i]=this.getMatchedRoutes(e.pathname),a=n,o=!1;(i?i.path!==`/`&&r[`**`]:v(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let c=o?At(this.options.notFoundMode,a):void 0,l=Array(a.length),u=this._committed,d=(e,t)=>{let n=u[t];return n?.routeId===e.id?n:e===this.options.notFoundRoute?u.find(t=>t.routeId===e.id):void 0},f;for(let n=0;n<a.length;n++){let i=a[n],o=l[n-1],u,p,m;{let n=o?.search??e.search,r=o?._strictSearch??void 0;try{let e=Ot(i.options.validateSearch,{...n})??void 0;u={...n,...e},p={...r,...e}}catch(e){let r=e;if(e instanceof Et||(r=new Et(e.message,{cause:e})),t?.throwOnError)throw r;u=n,p={},m=r}}let h=``,g=``;try{h=i.options.loaderDeps?.({search:u})??``,g=h&&JSON.stringify(h)||``}catch(e){if(t?.throwOnError)throw e;m??=e}let{interpolatedPath:_,usedParams:v}=ee({path:i.fullPath,params:r,decoder:this.pathParamsDecoder,server:this.isServer}),y=i.id+_+g,b=d(i,n),S=this._cache.get(y)??(b?.id===y?b:void 0);f=S?._strictParams??Object.assign(v,f);let C;if(!S)try{Mt(i,f)}catch(e){if(C=ge(e)||st(e)?e:new Dt(e.message,{cause:e}),t?.throwOnError)throw C}let w=b?`stay`:`enter`,T;if(S)T={...S,cause:w,search:x(b?b.search:S.search,u),_strictSearch:p,searchError:m};else{let e=xt(i)?`pending`:`success`;T={id:y,ssr:i.options.ssr,index:n,routeId:i.id,params:b?.params??f,_strictParams:f,pathname:_,updatedAt:Date.now(),search:b?x(b.search,u):u,_strictSearch:p,searchError:m,status:e,isFetching:!1,error:void 0,paramsError:C,context:{},abortController:t?._controller??new AbortController,cause:w,loaderDeps:b?s(b.loaderDeps,h):h,invalid:!1,preload:!1,staticData:i.options.staticData||{},fullPath:i.fullPath}}let E=c===i.id;T._notFound&&!E&&(T.error=void 0),T._notFound=E,l[n]=T}for(let e=0;e<l.length;e++){let n=l[e];n.params=n.cause===`stay`?x(n.params,f):f,t?._controller&&(n.context={})}return l}matchRoutesLightweight(e){let t=y(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=y(a),c={...e.search};for(let e of a)try{Object.assign(c,Ot(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{Mt(t,e)}catch{}u=e}let d=[a,s.fullPath,c,u];return this.lightweightCache.set(e,[r,d]),d}},Et=class extends Error{},Dt=class extends Error{};function Ot(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new Et(`Async validation not supported`);if(n.issues)throw new Et(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 kt(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=Ot(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=fe(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 At(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 be}function jt(e,t){return e===!1||e===null?Object.create(null):(e??!0)===!0?t:Object.assign(t,fe(e,t))}function Mt(e,t){let n=e.options.params?.parse??e.options.parseParams;n&&Object.assign(t,n(t))}function Nt(e,t){return e.options[t]?.preload?.()}function Pt(e,t){let n=Nt(e,`component`),r=Nt(e,`pendingComponent`),i=t&&r?r.then(t):r;return t&&!r&&t(),n&&i?Promise.all([n,i]).then(()=>{}):n??i}function M(e,t,n){let r=()=>t===!1?void 0:t?Nt(e,t):Pt(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 Ft(e){let t=e.findIndex(e=>e.status!==`success`||e._notFound)+1;return t&&t<e.length?e.slice(0,t):e}var N=0,P=1,It=2,F=3,I=4;function L(e){return typeof e[0]==`number`}function R(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 z(e,t){return e.routesById[t.routeId]}function B(e,t,n){return st(e)?[F,e]:ge(e)?(e.routeId||=n,[It,e]):(t&&typeof e?.then==`function`&&(e=Error(`A Promise was thrown`,{cause:e})),t?[P,e]:[N,e])}function Lt(e,t){let n=B(t,!0,e.id);if(n[0]!==P)return n;try{e.options.onError?.(n[1])}catch(t){n=B(t,!0,e.id)}return n}function V(e,t,n){return n[0].signal.aborted||!n[2]()?(n[0].abort(),[I]):Lt(e,t)}function Rt(e,t){return n=>e.navigate({...n,_fromLocation:t})}async function zt(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=z(e,r);r.abortController=n[0];let u=s[t-1]?.context??e.options.context??{},d={params:r.params,location:o,navigate:Rt(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 H(e,r),[t,V(i,a,n)]}if(c.aborted||!n[2]())return n[0].abort(),[t,[I]];let p=r.paramsError??r.searchError;if(p!==void 0)return H(e,r),[t,V(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{W(e,r,`beforeLoad`,n[0]);let a=await R(m(h),c);if(!n[2]())return n[0].abort(),[t,[I]];let o=B(a,!1,i.id);if(o[0]!==N)return H(e,r),[t,o];r.context={...f,...a}}catch(a){return H(e,r),[t,V(i,a,n)]}finally{g===`success`&&r.status===`pending`&&(r.status=`success`),W(e,r,!1,n[0])}}i()}function Bt(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 H(e,t){let n=t._flight;t._flight=void 0,Bt(e,t,n)?.abort()}function U(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=Bt(e,a,t);n&&i.push(n)}}for(let e of i)e.abort()}function Vt(e){for(let t of e){let e=t._flight;e&&e[2]++}}function W(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 Ht(e,t,n,r,i,a,o){let s=t[0];return{params:n.params,location:s,navigate:Rt(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 Ut(e,t,n,r,i,a,o,s){let c=s.signal;if(c.aborted)return[I];if(!i)return[N,void 0];let l=n._flight;W(e,n,`loader`,s);try{if(!l){let s=new AbortController;l=[Promise.resolve().then(()=>i(Ht(e,t,n,r,s,a,o))).then(e=>B(e,!1,r.id),e=>B(e,!0,r.id)).then(t=>(t[0]!==N&&e._flights?.get(n.id)===l&&(e._flights.delete(n.id),l[2]||s.abort()),t[0]===P&&l[2]?Lt(r,t[1]):t)),s,1],(e._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],await R(l[0],c)}catch(t){if(t!==c)throw t;return H(e,n),[I]}finally{W(e,n,!1,s)}}function Wt(e,t,n){t[0]===N?(e.loaderData=t[1],e.error=void 0,e.status=`success`,e.invalid=!1,e.updatedAt=Date.now(),e.preload=n):t[0]!==F&&(e.status=`success`,e.error=void 0,e.invalid=!0)}function Gt(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&&H(e,r)}function Kt(e,t){return t[0]===P||t[0]===It?{...e,status:t[0]===P?`error`:`notFound`,error:t[1],_flight:void 0}:e}function qt(e,t,n,r,i,a,o){let s=t[1][n],c=z(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(Ht(e,t,s,c,a[0],i,l))),a[2]()||(a[0].abort(),p=[I])),!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,H(e,s),p=V(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,Bt(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?Ut(e,t,s,c,h,i,l,a[0]):Promise.resolve([N,s.loaderData])).then(t=>(y&&(Wt(s,t,l),t[0]===N&&(l&&m&&!a[0].signal.aborted&&Gt(e,s,u),s.status=`pending`)),t)),S=R(Promise.resolve().then(()=>M(c,void 0,b)),a[0].signal).then(()=>void 0,e=>[n,V(c,e,a)]).then(e=>x.then(t=>(y&&!e&&t[0]===N&&s.status===`pending`&&a[2]()&&(s.status=`success`,a[8]?.()),e)));if(r.push([n,x,S]),!_)return x.then(e=>Kt(s,e));let C={...s,status:`pending`,preload:!1,_flight:g};s.invalid=!1,s.isFetching=`loader`;let ee=Ut(e,t,C,c,h,i,!1,a[0]).then(e=>(s.isFetching=!1,Wt(C,e,!1),e));return(t[2]??=[]).push([n,ee,S,C]),ee.then(e=>Kt(C,e))}async function Jt(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=z(e,t[n]),a=M(i,!1);if(a)try{await R(a,r)}catch(e){if(e===r)throw e}if(i.options.notFoundComponent)return n}return a?.routeId?o:i}function G(e,t){t[2]&&=(U(e,t[2].map(e=>e[3])),void 0)}async function Yt(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]>=F)throw[a,t];!i&&t[0]!==N&&(i=[a,t],await Promise.all((n??[]).map(e=>{if(!(e[0]<=a))return e[1].then(t=>{if(t[0]===F)throw[e[0],t]})})))}})))}catch(e){return e}return t??i}async function Xt(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]===It?Jt(e,s,t,r.signal):t[0],f=u<0?s.length:u;if((c?.[1][0]??0)>=F)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]!==N&&t[0]<F&&!(`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)>=F){let n=c[1];if(n[0]!==F||n[1].options.reloadDocument||i<20)return G(e,t),n;l=!0,c=[0,[P,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===P?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=z(e,u);try{await R(i?Promise.resolve().then(()=>M(m,a===P?`errorComponent`:`notFoundComponent`)):Promise.all([M(m),M(m,`notFoundComponent`)]),r.signal)}catch(n){if(n===r.signal)return G(e,t),[I]}i?l&&(r.abort(),await Promise.all([...n.map(e=>e[1]),...n.map(e=>e[2]),...(t[2]??[]).map(e=>e[1])]),G(e,t),U(e,s),f()):(u.status=`success`,o?.())}return t}async function Zt(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=z(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 R(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 Qt(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 Jt(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=qt(e,i,t,l,d,r,c)},p=await zt(e,i,r,s,f,c);if(p&&(r[5]=!0,s=p[0],p[1][0]===It?(p[2]=await Jt(e,i[1],p,r[0].signal),s=Math.min(s,p[2]+1)):p[1][0]>=F&&(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=Xt(e,i,l,r[0],r[1],Yt(l,p,i[2]),r[8]);i[2]?.length&&(i[3]=Yt(i[2],void 0,void 0,t.then(e=>L(e)?0:Ft(e[1]).length,()=>0))),m=await t}catch(t){throw G(e,i),t}return L(m)?m:Zt(e,m,r[0].signal,r[7]===m[1].length?r[7]:0)}function $t(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=z(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(()=>$t(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 en(e,t){let n=e._pending;n?.[0]===t&&(clearTimeout(n[3]),e._pending=void 0)}function tn(e,t){e._committed=t,e.stores.setMatches(t)}function nn(e,t){U(e,t[1]),G(e,t)}function rn(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=Ft(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=z(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,tn(e,n),U(e,[...a.values(),...i],[...n,...s.values()]),wt(e,i,n,()=>e._tx===t)}async function K(e,t){let n=e._tx;for(;n&&n!==t;){if(await n[5],e._tx===n)return;n=e._tx}}async function an(e,t,n){await e.navigate({...n.options,replace:!0,ignoreBlocker:!0,_redirects:t[1]+1})}function on(e,t){en(e,t),t[0].abort(),U(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 sn(e,t,n,r,i){let a=n.map(e=>({...e}));Vt(a);for(let t of r)H(e,a[t[0]]),a[t[0]]=t[3];let o=[t[2],a],s;try{s=await Xt(e,o,r,t[0],t[1],i)}catch(t){throw U(e,a),t}if(L(s)){U(e,a),s[0]===F&&e._tx===t&&e._committed===n&&await an(e,t,s[1]);return}let c=await Zt(e,s,t[0].signal);if(e._tx!==t||e._committed!==n){U(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),H(e,n))}tn(e,c[1]),U(e,n,c[1])}async function cn(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 Qt(e,t[2],t[3],o);if(L(s)){s[0]===F&&e._tx===t?(en(e,t),U(e,t[3]),t[3]=[],e._tx===t&&await an(e,t,s[1])):on(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 R(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 R(new Promise(t=>{c[3]=setTimeout(t,e)}),n)}catch{}clearTimeout(c[3])}}}if(e._tx!==t){en(e,t),nn(e,s);return}let l=t[2],u=St(l,e.stores.resolvedLocation.get()),d=s[2];await e.startViewTransition(async()=>{if(e._tx!==t){nn(e,s);return}let n=await e.startTransition(()=>{en(e,t),rn(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){G(e,s);return}d?.length&&sn(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 ln(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 K(e,n);return}let f=St(a,r);if(e.emit({type:`onBeforeNavigate`,...f}),u.signal.aborted||e.emit({type:`onBeforeLoad`,...f}),u.signal.aborted){await K(e,n);return}let p=i.href===a.href,m,h=u;try{m=e.matchRoutes(a,{_controller:u}),Vt(m)}catch(t){if(u.abort(),!st(t)){await K(e),e._commitPromise?.resolve(),e._commitPromise=void 0;return}await e.navigate({...t.options,replace:!0,ignoreBlocker:!0}),await K(e,n);return}let g=l?c[1](m):void 0;if(g?h=l:l?.abort(),u.signal.aborted){U(e,m),await K(e,n);return}e._preflight=void 0;let _=[h,s,a,m,Date.now(),Promise.resolve().then(()=>cn(e,_,p,()=>$t(e,_),t?.sync,g)).catch(()=>{e._tx===_&&on(e,_)})];if(e._tx=_,n){for(let t of e.stores.matches.get()){if(e._tx!==_)break;t.isFetching&&W(e,t,!1)}n[0].abort(),U(e,n[3],_[3],!0)}if(e._tx!==_){U(e,_[3]),_[3]=[],await K(e,_);return}e.batch(()=>{e.stores.status.set(`pending`),e.stores.location.set(a)}),!r&&!m.some(e=>e._notFound)&&$t(e,_);try{await _[5]}finally{await K(e,_)}}async function un(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}),Vt(o)}catch(e){a.abort(),ge(e)||console.error(e);return}(e._preloads??=new Map).set(a,o);let s;try{let t;try{t=await Qt(e,r,o,[a,n,()=>!0,i,!0])}finally{s=e._preloads.delete(a),U(e,o),a.abort()}if(!L(t))return t[1];if(s&&t[0]===F&&!t[1].options.reloadDocument)return un(e,{...t[1].options,_fromLocation:r},n+1)}catch(e){ge(e)||console.error(e)}}var dn=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=be:this.parentRoute||p();let r=n?be:t?.path;r&&r!==`/`&&(r=le(r));let i=t?.id||r,a=n?be:ue([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=ue([`/`,a]));let o=a===`__root__`?`/`:ue([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=v(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>ot({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},fn=class extends dn{constructor(e){super(e)}},q=(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))(q||{});function pn({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 mn(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 hn=[],gn=0,{link:_n,unlink:vn,propagate:yn,checkDirty:bn,shallowPropagate:xn}=pn({update(e){return e._update()},notify(e){hn[Cn++]=e,e.flags&=~q.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=q.Mutable|q.Dirty,En(e))}}),Sn=0,Cn=0,J,wn=0;function Tn(e){try{++wn,e()}finally{--wn||Dn()}}function En(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=vn(n,e)}function Dn(){if(!(wn>0)){for(;Sn<Cn;){let e=hn[Sn];hn[Sn++]=void 0,e.notify()}Sn=0,Cn=0}}function On(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?q.None:q.Mutable,get(){return J!==void 0&&_n(i,J,gn),i._snapshot},subscribe(e){let t=mn(e),n={current:!1},r=kn(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=J,o=t?.compare??Object.is;if(n)J=i,++gn,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=q.Mutable|q.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{J=a,n&&(i.flags&=~q.RecursedCheck),En(i)}}};return n?(i.flags=q.Mutable|q.Dirty,i.get=function(){let e=i.flags;if(e&q.Dirty||e&q.Pending&&bn(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&xn(e)}}else e&q.Pending&&(i.flags=e&~q.Pending);return J!==void 0&&_n(i,J,gn),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(yn(e),xn(e),Dn())}},i}function kn(e){let t=()=>{let t=J;J=n,++gn,n.depsTail=void 0,n.flags=q.Watching|q.RecursedCheck;try{return e()}finally{J=t,n.flags&=~q.RecursedCheck,En(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:q.Watching|q.RecursedCheck,notify(){let e=this.flags;e&q.Dirty||e&q.Pending&&bn(this.deps,this)?t():this.flags=q.Watching},stop(){this.flags=q.None,this.depsTail=void 0,En(this)}};return t(),n}var An={};function jn(e,t){let n=O.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=s(n.current,i):i}}function Y(e){let t=D(),n=O.useContext(e.from?xe:ye),r=e.from??n,i=t.stores.getMatchStore(r),a=jn(e,t),o=ae(i,e=>e?a(e):An);if(o!==An)return o;(e.shouldThrow??!0)&&p()}function Mn(e){return Y({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Nn(e){let{select:t,...n}=e;return Y({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function Pn(e){return Y({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Fn(e){return Y({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function In(e){return Y({...e,select:t=>e.select?e.select(t.context):t.context})}var Ln=class extends dn{constructor(e){super(e),this.useMatch=e=>Y({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>In({...e,from:this.id}),this.useSearch=e=>Fn({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Pn({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Nn({...e,from:this.id}),this.useLoaderData=e=>Mn({...e,from:this.id}),this.useNavigate=()=>T({from:this.fullPath}),this.Link=Ee.forwardRef((e,t)=>k(w,{ref:t,from:this.fullPath,...e}))}};function Rn(e){return new Ln(e)}function zn(){return e=>Vn(e)}var Bn=class extends fn{constructor(e){super(e),this.useMatch=e=>Y({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>In({...e,from:this.id}),this.useSearch=e=>Fn({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Pn({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Nn({...e,from:this.id}),this.useLoaderData=e=>Mn({...e,from:this.id}),this.useNavigate=()=>T({from:this.fullPath}),this.Link=Ee.forwardRef((e,t)=>k(w,{ref:t,from:this.fullPath,...e}))}};function Vn(e){return new Bn(e)}function X(e){return e=>{let t=Rn(e);return t.isRoot=!1,t}}function Z(e,t){let n,r,i,a=()=>(n||=(i=void 0,e().then(e=>{n=void 0,r=e[t??`default`]}).catch(e=>{n=void 0,i=e})),n),o=function(e){if(i){if(c(i)&&typeof sessionStorage<`u`){let e=`tanstack_router_reload:${i.message}`;if(!sessionStorage.getItem(e))throw sessionStorage.setItem(e,`1`),window.location.reload(),new Promise(()=>{})}throw i}if(!r)if(u)u(a());else throw a();return O.createElement(r,e)};return o.preload=a,o}function Hn(e,t){let n=e[1];e.length=0,n?.(t)}function Un({t:e}){let t=D(),n=t._rendered??=[];return t.startTransition=(r,i)=>new Promise((a,o)=>{Hn(n,!1),n.push(i,a),e(t),O.startTransition(()=>{try{r()}catch(e){n[1]===a&&(n.length=0),o(e)}})}),se(()=>{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(v(r.publicHref)!==v(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`,...St(a,a)})}):t._tx||t.load().catch(console.error),e},[t,t.history]),null}function Wn(){let e=D(),t=e.routesById[be],n=_e(e,t),r=e.ssr?me:O.Suspense,i=Pe(Ne,{children:[k(Un,{t:O.useState()[1]}),k(r,{fallback:n,children:k(Gn,{})})]});return e.options.InnerWrap?k(e.options.InnerWrap,{children:i}):i}function Gn(){let e=D(),t=e._rendered,n=ae(e.stores.matches,e=>t[0]??e),r=n[0],i=r?.routeId;se(()=>{t[0]===n&&Hn(t,!0)},[t,n]);let a=i?k(ve,{routeId:i}):null;return k(ye.Provider,{value:i,children:e.options.disableGlobalCatchBoundary?a:k(pe,{getResetKey:()=>r,onCatch:void 0,children:a})})}var Kn=e=>({createMutableStore:On,createReadonlyStore:On,batch:Tn}),qn=e=>new Jn(e),Jn=class extends Tt{constructor(e){super(e,Kn)}};function Yn({router:e,children:t,...r}){n(r)&&e.update({...e.options,...r,context:{...e.options.context,...r.context}});let i=k(E.Provider,{value:e,children:t});return e.options.Wrap?k(e.options.Wrap,{children:i}):i}function Xn({router:e,...t}){return k(Yn,{router:e,...t,children:k(Wn,{})})}var Zn=Ie.div`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/_app-ChlUa_Ov.js","assets/Match-B2ZxNor3.js","assets/queries-BOAAI06M.js","assets/matchContext-BOenO3J2.js","assets/Rack-DhVnjAjC.js","assets/Lamp-BDf7-dMa.js","assets/login-CJz2YA-O.js","assets/Field-b0ohzqzR.js","assets/States-6G9NsYha.js","assets/reasons-Cb8yF4Oy.js","assets/_app.index-C1vtrxnM.js","assets/TokenBreakdown-B9RanXin.js","assets/Chip-BltJSw8A.js","assets/Meter-stpt3vQu.js","assets/Table-CVDZ69Zx.js","assets/Readout-VYnpaTMg.js","assets/_app.accounts-CJ6lFXIx.js","assets/shared-Rzhx6i7s.js","assets/CopyValue-BiiqC_Z2.js","assets/plus-C7a0RuII.js","assets/trash-2-C7-QrCg5.js","assets/Modal-OALemCh6.js","assets/dist-9ps0Qd15.js","assets/Toggle-DMk46RX2.js","assets/Confirm-BO1xS6uH.js","assets/catalog-BBKm8Ih8.js","assets/_app.console-eFiUh-OA.js","assets/_app.database-BHaMpXld.js","assets/_app.keys-Bz6-VVJi.js","assets/_app.logs-DV7O6ZUp.js","assets/_app.models-KIctkivt.js","assets/_app.settings-B8zjCira.js","assets/_app.usage-C4GR06sI.js","assets/_app.plugins._pluginId-BbqXEJUB.js"])))=>i.map(i=>d[i]);
2
+ import{$ as e,At as t,Bt as n,Ct as r,Dt as i,Et as a,Ft as o,Gt as s,Ht as c,It as l,Kt as u,Lt as d,Mt as f,Nt as p,Ot as m,Pt as h,Rt as g,St as _,Tt as v,Ut as y,Vt as b,Wt as x,Y as S,at as C,bt as ee,dt as w,ft as T,gt as E,ht as D,i as te,jt as ne,kt as re,lt as ie,pt as ae,q as oe,qt as se,vt as ce,wt as le,xt as ue,yt as de,zt as fe}from"./queries-BOAAI06M.js";import{a as pe,i as me,n as he,o as ge,r as _e,t as ve}from"./Match-B2ZxNor3.js";import{n as ye,r as be,t as xe}from"./matchContext-BOenO3J2.js";import{MutationCache as Se,QueryCache as Ce,QueryClient as we,QueryClientProvider as Te}from"@tanstack/react-query";import*as O from"react";import Ee,{StrictMode as De,createContext as Oe,use as ke,useCallback as Ae,useEffect as je,useState as Me}from"react";import{Fragment as Ne,jsx as k,jsxs as Pe}from"react/jsx-runtime";import{createRoot as Fe}from"react-dom/client";import Ie,{ThemeProvider as Le,createGlobalStyle as Re}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 ze(){try{return sessionStorage}catch{return}}var Be=`tsr-scroll-restoration-v1_3`,Ve=ze();function He(){try{return JSON.parse(Ve?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}function Ue(){try{Ve?.setItem(Be,JSON.stringify(A))}catch{}}var A=He(),We=`data-scroll-restoration-id`,Ge=e=>e.state.__TSR_key||e.href;function Ke(e){let t=e.getAttribute(We);if(t)return`[${We}="${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 qe=!1,Je=`window`;function Ye(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function Xe(e){let t=new Set;for(let n of e){if(n===Je)continue;let e=Ye(n);e&&t.add(e)}return t}function Ze(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);let i=e.options.getScrollRestorationKey||Ge,a=new Set,o=e=>{let t=A[e]||={};for(let e of a)e===document?t[Je]={scrollX,scrollY}:e.isConnected&&(t[Ke(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.restoration&&(r.restoration=!0,qe=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{qe||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())),Ue()})),!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=A[d];if(e){let t=A[u];for(let n in e){if(n===Je){if(s)continue}else{let e=Ye(n);if(!e||s&&o&&(l??=Xe(o),l.has(e)))continue}t||=A[u]={},t[n]??=e[n]}}}qe=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=Xe(o));let t=e&&i&&c,s=r.restoring?A[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===Je){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=Ye(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{qe=!1}}))}function Qe(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 $e(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function et(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]=$e(r):Array.isArray(t)?t.push($e(r)):n[e]=[t,$e(r)]}return n}var tt=/^(?:\s|["[{\d-]|fa|nu|tr)/,nt=it(JSON.parse),rt=at(JSON.stringify,JSON.parse);function it(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=et(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function at(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&&!tt.test(r))return r;try{return t(r),e(r)}catch{}}return r}return e=>{let t=Qe(e,r);return t?`?${t}`:``}}function ot(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function st(e){return e instanceof Response&&!!e.options}function ct(e){return{input:({url:t})=>{for(let n of e)t=ut(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=dt(e[n],t);return t}}}function lt(e){let t=r(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=ue([`/`,t,e.pathname]),e)}}function ut(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 dt(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 ft(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i}=t,a=new Map,s=n(`idle`),c=n(e),l=n(void 0),u=n([]),d=r(()=>u.get().map(e=>a.get(e).get())),f=r(()=>({status:s.get(),isLoading:s.get()===`pending`,matches:d.get(),location:c.get(),resolvedLocation:l.get()}));function p(e){let t=a.get(e);return t||(t=n(void 0),a.set(e,t)),t}let m={status:s,location:c,resolvedLocation:l,ids:u,matches:d,byRoute:a,__store:f,getMatchStore:p,setMatches:h};function h(e){let t=u.get(),n=e.map(e=>e.routeId);i(()=>{o(t,n)||u.set(n);for(let e of t)n.includes(e)||a.get(e).set(()=>void 0);for(let t of e){let e=p(t.routeId);e.get()!==t&&e.set(t)}})}return m}var j=`__TSR_index`,pt=`popstate`,mt=`beforeunload`;function ht(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=yt(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[j];i=gt(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[j];i=gt(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[j]!==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 gt(e,t){t||={};let n=bt();return{...t,key:n,__TSR_key:n,[j]:e}}function _t(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??(()=>yt(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=bt();t.history.replaceState({[j]: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=yt(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[j]-l.state[j],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=ht({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(mt,x,{capture:!0}),t.removeEventListener(pt,b)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(mt,x,{capture:!0}),t.addEventListener(pt,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 vt(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function yt(e,t){let n=vt(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=bt();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||{[j]:0,key:a,__TSR_key:a}}}function bt(){return(Math.random()+1).toString(36).substring(7)}function xt(e){return e.options.loader||e.options.beforeLoad||e.lazyFn||e.options.component?.preload||e.options.pendingComponent?.preload}function St(e,t){return{fromLocation:t,toLocation:e,pathChanged:t?.pathname!==e.pathname,hrefChanged:t?.href!==e.href,hashChanged:t?.hash!==e.hash}}function Ct({key:e,__TSR_key:t,__TSR_index:n,__hashScrollIntoViewOptions:r,...i}){return i}function wt(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 Tt=class{constructor(e,a){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??`/`,i=this.basepath===void 0,a=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=de(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history?this.options.history:_t()),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=f(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=ft(this.latestLocation,e),Ze(this)}let o=this.options.basepath??`/`,s=this.options.rewrite;if(i||n!==o||a!==s){this.basepath=o;let e=[],t=r(o);t&&t!==`/`&&e.push(lt({basepath:o})),s&&e.push(s),this.rewrite=e.length===0?void 0:e.length===1?e[0]:ct(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=ne(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&t(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:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:l(e).path,external:!1,searchStr:o,search:x(t?.search,i),hash:l(r.slice(1)).path,state:s(t?.state,a)}}let o=new URL(i,this.origin),c=ut(this.rewrite,o),u=this.options.parseSearch(c.search),d=this.options.stringifySearch(u);return c.search=d,{href:c.href.replace(c.origin,``),publicHref:i,pathname:l(c.pathname).path,external:!!this.rewrite&&c.origin!==this.origin,searchStr:d,search:x(t?.search,u),hash:l(c.hash.slice(1)).path,state:s(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);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=(e,t)=>_({base:e,to:t.includes(`//`)?ce(t):t,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=m(v(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 r=t._fromLocation||this._pendingLocation||this.latestLocation,i=this.matchRoutesLightweight(r);t.from;let a=t.unsafeRelative===`path`?r.pathname:t.from??i[1],o=t.to?`${t.to}`:void 0,c=i[2],u=Object.assign(Object.create(null),i[3]),d=o?.charCodeAt(0)===47?`/`:this.resolvePathWithBase(a,`.`),f=o?this.resolvePathWithBase(d,o):d,p=jt(t.params,u),m=this.routesByPath[v(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&&n(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 _=e.leaveParams?f:l(ee({path:f,params:p,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,y=c;if(e._includeValidateSearch&&this.options.search?.strict){let e={};h.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,Ot(t.options.validateSearch,{...e,...y}))}catch{}}),y=e}y=kt(y,t,h,e._includeValidateSearch),y=x(c,y);let b=this.options.stringifySearch(y),S=t.hash===!0?r.hash:t.hash?fe(t.hash,r.hash):void 0,C=S?`#${S}`:``,w=t.state===!0?r.state:t.state?fe(t.state,r.state):{};w=s(r.state,w);let T=`${_}${b}${C}`,E,D,te=!1;if(this.rewrite){let e=new URL(T,this.origin),t=dt(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=g(T),D=E;return{publicHref:D,href:E,pathname:_,search:y,searchStr:b,state:w,hash:S??``,external:te,unmaskOnReload:t.unmaskOnReload}},r=(n={},r)=>{let a=t(n),o=r?t(r):void 0;if(!o){let n=Object.create(null);if(this.options.routeMasks){let s=i(a.pathname,this.processedTree);if(s){Object.assign(n,s.rawParams);let{from:i,params:a,...c}=s.route,l=jt(a,n);r={from:e.from,...c,params:l},o=t(r)}}}return o&&(a.maskedLocation=o),a};return e.mask?r(e,{from:e.from,...e.mask}):r(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r,i=v(this.latestLocation.href)===v(n.href)&&d(Ct(n.state),Ct(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=yt(o,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);s.to=ut(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(b(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 ln(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(St(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`)&&xt(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&&b(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=M,this.preloadRoute=e=>un(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=re(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,a.pathname,this.processedTree);return!o||e.params&&!d(o.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?d(a.search,r.search,{partial:!0})?o.rawParams:!1:o.rawParams},this.getStoreConfig=a,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??rt,parseSearch:e.parseSearch??nt,protocolAllowlist:e.protocolAllowlist??h}),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=a(e),this.routeBranchCache.set(e,t)),t}matchRoutesInternal(e,t){let[n,r,i]=this.getMatchedRoutes(e.pathname),a=n,o=!1;(i?i.path!==`/`&&r[`**`]:v(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let c=o?At(this.options.notFoundMode,a):void 0,l=Array(a.length),u=this._committed,d=(e,t)=>{let n=u[t];return n?.routeId===e.id?n:e===this.options.notFoundRoute?u.find(t=>t.routeId===e.id):void 0},f;for(let n=0;n<a.length;n++){let i=a[n],o=l[n-1],u,p,m;{let n=o?.search??e.search,r=o?._strictSearch??void 0;try{let e=Ot(i.options.validateSearch,{...n})??void 0;u={...n,...e},p={...r,...e}}catch(e){let r=e;if(e instanceof Et||(r=new Et(e.message,{cause:e})),t?.throwOnError)throw r;u=n,p={},m=r}}let h=``,g=``;try{h=i.options.loaderDeps?.({search:u})??``,g=h&&JSON.stringify(h)||``}catch(e){if(t?.throwOnError)throw e;m??=e}let{interpolatedPath:_,usedParams:v}=ee({path:i.fullPath,params:r,decoder:this.pathParamsDecoder,server:this.isServer}),y=i.id+_+g,b=d(i,n),S=this._cache.get(y)??(b?.id===y?b:void 0);f=S?._strictParams??Object.assign(v,f);let C;if(!S)try{Mt(i,f)}catch(e){if(C=ge(e)||st(e)?e:new Dt(e.message,{cause:e}),t?.throwOnError)throw C}let w=b?`stay`:`enter`,T;if(S)T={...S,cause:w,search:x(b?b.search:S.search,u),_strictSearch:p,searchError:m};else{let e=xt(i)?`pending`:`success`;T={id:y,ssr:i.options.ssr,index:n,routeId:i.id,params:b?.params??f,_strictParams:f,pathname:_,updatedAt:Date.now(),search:b?x(b.search,u):u,_strictSearch:p,searchError:m,status:e,isFetching:!1,error:void 0,paramsError:C,context:{},abortController:t?._controller??new AbortController,cause:w,loaderDeps:b?s(b.loaderDeps,h):h,invalid:!1,preload:!1,staticData:i.options.staticData||{},fullPath:i.fullPath}}let E=c===i.id;T._notFound&&!E&&(T.error=void 0),T._notFound=E,l[n]=T}for(let e=0;e<l.length;e++){let n=l[e];n.params=n.cause===`stay`?x(n.params,f):f,t?._controller&&(n.context={})}return l}matchRoutesLightweight(e){let t=y(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=y(a),c={...e.search};for(let e of a)try{Object.assign(c,Ot(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{Mt(t,e)}catch{}u=e}let d=[a,s.fullPath,c,u];return this.lightweightCache.set(e,[r,d]),d}},Et=class extends Error{},Dt=class extends Error{};function Ot(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new Et(`Async validation not supported`);if(n.issues)throw new Et(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 kt(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=Ot(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=fe(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 At(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 be}function jt(e,t){return e===!1||e===null?Object.create(null):(e??!0)===!0?t:Object.assign(t,fe(e,t))}function Mt(e,t){let n=e.options.params?.parse??e.options.parseParams;n&&Object.assign(t,n(t))}function Nt(e,t){return e.options[t]?.preload?.()}function Pt(e,t){let n=Nt(e,`component`),r=Nt(e,`pendingComponent`),i=t&&r?r.then(t):r;return t&&!r&&t(),n&&i?Promise.all([n,i]).then(()=>{}):n??i}function M(e,t,n){let r=()=>t===!1?void 0:t?Nt(e,t):Pt(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 Ft(e){let t=e.findIndex(e=>e.status!==`success`||e._notFound)+1;return t&&t<e.length?e.slice(0,t):e}var N=0,P=1,It=2,F=3,I=4;function L(e){return typeof e[0]==`number`}function R(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 z(e,t){return e.routesById[t.routeId]}function B(e,t,n){return st(e)?[F,e]:ge(e)?(e.routeId||=n,[It,e]):(t&&typeof e?.then==`function`&&(e=Error(`A Promise was thrown`,{cause:e})),t?[P,e]:[N,e])}function Lt(e,t){let n=B(t,!0,e.id);if(n[0]!==P)return n;try{e.options.onError?.(n[1])}catch(t){n=B(t,!0,e.id)}return n}function V(e,t,n){return n[0].signal.aborted||!n[2]()?(n[0].abort(),[I]):Lt(e,t)}function Rt(e,t){return n=>e.navigate({...n,_fromLocation:t})}async function zt(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=z(e,r);r.abortController=n[0];let u=s[t-1]?.context??e.options.context??{},d={params:r.params,location:o,navigate:Rt(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 H(e,r),[t,V(i,a,n)]}if(c.aborted||!n[2]())return n[0].abort(),[t,[I]];let p=r.paramsError??r.searchError;if(p!==void 0)return H(e,r),[t,V(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{W(e,r,`beforeLoad`,n[0]);let a=await R(m(h),c);if(!n[2]())return n[0].abort(),[t,[I]];let o=B(a,!1,i.id);if(o[0]!==N)return H(e,r),[t,o];r.context={...f,...a}}catch(a){return H(e,r),[t,V(i,a,n)]}finally{g===`success`&&r.status===`pending`&&(r.status=`success`),W(e,r,!1,n[0])}}i()}function Bt(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 H(e,t){let n=t._flight;t._flight=void 0,Bt(e,t,n)?.abort()}function U(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=Bt(e,a,t);n&&i.push(n)}}for(let e of i)e.abort()}function Vt(e){for(let t of e){let e=t._flight;e&&e[2]++}}function W(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 Ht(e,t,n,r,i,a,o){let s=t[0];return{params:n.params,location:s,navigate:Rt(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 Ut(e,t,n,r,i,a,o,s){let c=s.signal;if(c.aborted)return[I];if(!i)return[N,void 0];let l=n._flight;W(e,n,`loader`,s);try{if(!l){let s=new AbortController;l=[Promise.resolve().then(()=>i(Ht(e,t,n,r,s,a,o))).then(e=>B(e,!1,r.id),e=>B(e,!0,r.id)).then(t=>(t[0]!==N&&e._flights?.get(n.id)===l&&(e._flights.delete(n.id),l[2]||s.abort()),t[0]===P&&l[2]?Lt(r,t[1]):t)),s,1],(e._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],await R(l[0],c)}catch(t){if(t!==c)throw t;return H(e,n),[I]}finally{W(e,n,!1,s)}}function Wt(e,t,n){t[0]===N?(e.loaderData=t[1],e.error=void 0,e.status=`success`,e.invalid=!1,e.updatedAt=Date.now(),e.preload=n):t[0]!==F&&(e.status=`success`,e.error=void 0,e.invalid=!0)}function Gt(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&&H(e,r)}function Kt(e,t){return t[0]===P||t[0]===It?{...e,status:t[0]===P?`error`:`notFound`,error:t[1],_flight:void 0}:e}function qt(e,t,n,r,i,a,o){let s=t[1][n],c=z(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(Ht(e,t,s,c,a[0],i,l))),a[2]()||(a[0].abort(),p=[I])),!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,H(e,s),p=V(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,Bt(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?Ut(e,t,s,c,h,i,l,a[0]):Promise.resolve([N,s.loaderData])).then(t=>(y&&(Wt(s,t,l),t[0]===N&&(l&&m&&!a[0].signal.aborted&&Gt(e,s,u),s.status=`pending`)),t)),S=R(Promise.resolve().then(()=>M(c,void 0,b)),a[0].signal).then(()=>void 0,e=>[n,V(c,e,a)]).then(e=>x.then(t=>(y&&!e&&t[0]===N&&s.status===`pending`&&a[2]()&&(s.status=`success`,a[8]?.()),e)));if(r.push([n,x,S]),!_)return x.then(e=>Kt(s,e));let C={...s,status:`pending`,preload:!1,_flight:g};s.invalid=!1,s.isFetching=`loader`;let ee=Ut(e,t,C,c,h,i,!1,a[0]).then(e=>(s.isFetching=!1,Wt(C,e,!1),e));return(t[2]??=[]).push([n,ee,S,C]),ee.then(e=>Kt(C,e))}async function Jt(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=z(e,t[n]),a=M(i,!1);if(a)try{await R(a,r)}catch(e){if(e===r)throw e}if(i.options.notFoundComponent)return n}return a?.routeId?o:i}function G(e,t){t[2]&&=(U(e,t[2].map(e=>e[3])),void 0)}async function Yt(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]>=F)throw[a,t];!i&&t[0]!==N&&(i=[a,t],await Promise.all((n??[]).map(e=>{if(!(e[0]<=a))return e[1].then(t=>{if(t[0]===F)throw[e[0],t]})})))}})))}catch(e){return e}return t??i}async function Xt(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]===It?Jt(e,s,t,r.signal):t[0],f=u<0?s.length:u;if((c?.[1][0]??0)>=F)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]!==N&&t[0]<F&&!(`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)>=F){let n=c[1];if(n[0]!==F||n[1].options.reloadDocument||i<20)return G(e,t),n;l=!0,c=[0,[P,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===P?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=z(e,u);try{await R(i?Promise.resolve().then(()=>M(m,a===P?`errorComponent`:`notFoundComponent`)):Promise.all([M(m),M(m,`notFoundComponent`)]),r.signal)}catch(n){if(n===r.signal)return G(e,t),[I]}i?l&&(r.abort(),await Promise.all([...n.map(e=>e[1]),...n.map(e=>e[2]),...(t[2]??[]).map(e=>e[1])]),G(e,t),U(e,s),f()):(u.status=`success`,o?.())}return t}async function Zt(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=z(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 R(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 Qt(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 Jt(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=qt(e,i,t,l,d,r,c)},p=await zt(e,i,r,s,f,c);if(p&&(r[5]=!0,s=p[0],p[1][0]===It?(p[2]=await Jt(e,i[1],p,r[0].signal),s=Math.min(s,p[2]+1)):p[1][0]>=F&&(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=Xt(e,i,l,r[0],r[1],Yt(l,p,i[2]),r[8]);i[2]?.length&&(i[3]=Yt(i[2],void 0,void 0,t.then(e=>L(e)?0:Ft(e[1]).length,()=>0))),m=await t}catch(t){throw G(e,i),t}return L(m)?m:Zt(e,m,r[0].signal,r[7]===m[1].length?r[7]:0)}function $t(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=z(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(()=>$t(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 en(e,t){let n=e._pending;n?.[0]===t&&(clearTimeout(n[3]),e._pending=void 0)}function tn(e,t){e._committed=t,e.stores.setMatches(t)}function nn(e,t){U(e,t[1]),G(e,t)}function rn(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=Ft(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=z(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,tn(e,n),U(e,[...a.values(),...i],[...n,...s.values()]),wt(e,i,n,()=>e._tx===t)}async function K(e,t){let n=e._tx;for(;n&&n!==t;){if(await n[5],e._tx===n)return;n=e._tx}}async function an(e,t,n){await e.navigate({...n.options,replace:!0,ignoreBlocker:!0,_redirects:t[1]+1})}function on(e,t){en(e,t),t[0].abort(),U(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 sn(e,t,n,r,i){let a=n.map(e=>({...e}));Vt(a);for(let t of r)H(e,a[t[0]]),a[t[0]]=t[3];let o=[t[2],a],s;try{s=await Xt(e,o,r,t[0],t[1],i)}catch(t){throw U(e,a),t}if(L(s)){U(e,a),s[0]===F&&e._tx===t&&e._committed===n&&await an(e,t,s[1]);return}let c=await Zt(e,s,t[0].signal);if(e._tx!==t||e._committed!==n){U(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),H(e,n))}tn(e,c[1]),U(e,n,c[1])}async function cn(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 Qt(e,t[2],t[3],o);if(L(s)){s[0]===F&&e._tx===t?(en(e,t),U(e,t[3]),t[3]=[],e._tx===t&&await an(e,t,s[1])):on(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 R(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 R(new Promise(t=>{c[3]=setTimeout(t,e)}),n)}catch{}clearTimeout(c[3])}}}if(e._tx!==t){en(e,t),nn(e,s);return}let l=t[2],u=St(l,e.stores.resolvedLocation.get()),d=s[2];await e.startViewTransition(async()=>{if(e._tx!==t){nn(e,s);return}let n=await e.startTransition(()=>{en(e,t),rn(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){G(e,s);return}d?.length&&sn(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 ln(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 K(e,n);return}let f=St(a,r);if(e.emit({type:`onBeforeNavigate`,...f}),u.signal.aborted||e.emit({type:`onBeforeLoad`,...f}),u.signal.aborted){await K(e,n);return}let p=i.href===a.href,m,h=u;try{m=e.matchRoutes(a,{_controller:u}),Vt(m)}catch(t){if(u.abort(),!st(t)){await K(e),e._commitPromise?.resolve(),e._commitPromise=void 0;return}await e.navigate({...t.options,replace:!0,ignoreBlocker:!0}),await K(e,n);return}let g=l?c[1](m):void 0;if(g?h=l:l?.abort(),u.signal.aborted){U(e,m),await K(e,n);return}e._preflight=void 0;let _=[h,s,a,m,Date.now(),Promise.resolve().then(()=>cn(e,_,p,()=>$t(e,_),t?.sync,g)).catch(()=>{e._tx===_&&on(e,_)})];if(e._tx=_,n){for(let t of e.stores.matches.get()){if(e._tx!==_)break;t.isFetching&&W(e,t,!1)}n[0].abort(),U(e,n[3],_[3],!0)}if(e._tx!==_){U(e,_[3]),_[3]=[],await K(e,_);return}e.batch(()=>{e.stores.status.set(`pending`),e.stores.location.set(a)}),!r&&!m.some(e=>e._notFound)&&$t(e,_);try{await _[5]}finally{await K(e,_)}}async function un(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}),Vt(o)}catch(e){a.abort(),ge(e)||console.error(e);return}(e._preloads??=new Map).set(a,o);let s;try{let t;try{t=await Qt(e,r,o,[a,n,()=>!0,i,!0])}finally{s=e._preloads.delete(a),U(e,o),a.abort()}if(!L(t))return t[1];if(s&&t[0]===F&&!t[1].options.reloadDocument)return un(e,{...t[1].options,_fromLocation:r},n+1)}catch(e){ge(e)||console.error(e)}}var dn=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=be:this.parentRoute||p();let r=n?be:t?.path;r&&r!==`/`&&(r=le(r));let i=t?.id||r,a=n?be:ue([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=ue([`/`,a]));let o=a===`__root__`?`/`:ue([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=v(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>ot({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},fn=class extends dn{constructor(e){super(e)}},q=(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))(q||{});function pn({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 mn(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 hn=[],gn=0,{link:_n,unlink:vn,propagate:yn,checkDirty:bn,shallowPropagate:xn}=pn({update(e){return e._update()},notify(e){hn[Cn++]=e,e.flags&=~q.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=q.Mutable|q.Dirty,En(e))}}),Sn=0,Cn=0,J,wn=0;function Tn(e){try{++wn,e()}finally{--wn||Dn()}}function En(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=vn(n,e)}function Dn(){if(!(wn>0)){for(;Sn<Cn;){let e=hn[Sn];hn[Sn++]=void 0,e.notify()}Sn=0,Cn=0}}function On(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?q.None:q.Mutable,get(){return J!==void 0&&_n(i,J,gn),i._snapshot},subscribe(e){let t=mn(e),n={current:!1},r=kn(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=J,o=t?.compare??Object.is;if(n)J=i,++gn,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=q.Mutable|q.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{J=a,n&&(i.flags&=~q.RecursedCheck),En(i)}}};return n?(i.flags=q.Mutable|q.Dirty,i.get=function(){let e=i.flags;if(e&q.Dirty||e&q.Pending&&bn(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&xn(e)}}else e&q.Pending&&(i.flags=e&~q.Pending);return J!==void 0&&_n(i,J,gn),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(yn(e),xn(e),Dn())}},i}function kn(e){let t=()=>{let t=J;J=n,++gn,n.depsTail=void 0,n.flags=q.Watching|q.RecursedCheck;try{return e()}finally{J=t,n.flags&=~q.RecursedCheck,En(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:q.Watching|q.RecursedCheck,notify(){let e=this.flags;e&q.Dirty||e&q.Pending&&bn(this.deps,this)?t():this.flags=q.Watching},stop(){this.flags=q.None,this.depsTail=void 0,En(this)}};return t(),n}var An={};function jn(e,t){let n=O.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=s(n.current,i):i}}function Y(e){let t=D(),n=O.useContext(e.from?xe:ye),r=e.from??n,i=t.stores.getMatchStore(r),a=jn(e,t),o=ae(i,e=>e?a(e):An);if(o!==An)return o;(e.shouldThrow??!0)&&p()}function Mn(e){return Y({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Nn(e){let{select:t,...n}=e;return Y({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function Pn(e){return Y({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Fn(e){return Y({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function In(e){return Y({...e,select:t=>e.select?e.select(t.context):t.context})}var Ln=class extends dn{constructor(e){super(e),this.useMatch=e=>Y({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>In({...e,from:this.id}),this.useSearch=e=>Fn({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Pn({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Nn({...e,from:this.id}),this.useLoaderData=e=>Mn({...e,from:this.id}),this.useNavigate=()=>T({from:this.fullPath}),this.Link=Ee.forwardRef((e,t)=>k(w,{ref:t,from:this.fullPath,...e}))}};function Rn(e){return new Ln(e)}function zn(){return e=>Vn(e)}var Bn=class extends fn{constructor(e){super(e),this.useMatch=e=>Y({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>In({...e,from:this.id}),this.useSearch=e=>Fn({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Pn({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Nn({...e,from:this.id}),this.useLoaderData=e=>Mn({...e,from:this.id}),this.useNavigate=()=>T({from:this.fullPath}),this.Link=Ee.forwardRef((e,t)=>k(w,{ref:t,from:this.fullPath,...e}))}};function Vn(e){return new Bn(e)}function X(e){return e=>{let t=Rn(e);return t.isRoot=!1,t}}function Z(e,t){let n,r,i,a=()=>(n||=(i=void 0,e().then(e=>{n=void 0,r=e[t??`default`]}).catch(e=>{n=void 0,i=e})),n),o=function(e){if(i){if(c(i)&&typeof sessionStorage<`u`){let e=`tanstack_router_reload:${i.message}`;if(!sessionStorage.getItem(e))throw sessionStorage.setItem(e,`1`),window.location.reload(),new Promise(()=>{})}throw i}if(!r)if(u)u(a());else throw a();return O.createElement(r,e)};return o.preload=a,o}function Hn(e,t){let n=e[1];e.length=0,n?.(t)}function Un({t:e}){let t=D(),n=t._rendered??=[];return t.startTransition=(r,i)=>new Promise((a,o)=>{Hn(n,!1),n.push(i,a),e(t),O.startTransition(()=>{try{r()}catch(e){n[1]===a&&(n.length=0),o(e)}})}),se(()=>{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(v(r.publicHref)!==v(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`,...St(a,a)})}):t._tx||t.load().catch(console.error),e},[t,t.history]),null}function Wn(){let e=D(),t=e.routesById[be],n=_e(e,t),r=e.ssr?me:O.Suspense,i=Pe(Ne,{children:[k(Un,{t:O.useState()[1]}),k(r,{fallback:n,children:k(Gn,{})})]});return e.options.InnerWrap?k(e.options.InnerWrap,{children:i}):i}function Gn(){let e=D(),t=e._rendered,n=ae(e.stores.matches,e=>t[0]??e),r=n[0],i=r?.routeId;se(()=>{t[0]===n&&Hn(t,!0)},[t,n]);let a=i?k(ve,{routeId:i}):null;return k(ye.Provider,{value:i,children:e.options.disableGlobalCatchBoundary?a:k(pe,{getResetKey:()=>r,onCatch:void 0,children:a})})}var Kn=e=>({createMutableStore:On,createReadonlyStore:On,batch:Tn}),qn=e=>new Jn(e),Jn=class extends Tt{constructor(e){super(e,Kn)}};function Yn({router:e,children:t,...r}){n(r)&&e.update({...e.options,...r,context:{...e.options.context,...r.context}});let i=k(E.Provider,{value:e,children:t});return e.options.Wrap?k(e.options.Wrap,{children:i}):i}function Xn({router:e,...t}){return k(Yn,{router:e,...t,children:k(Wn,{})})}var Zn=Ie.div`
3
3
  display: flex;
4
4
  align-items: center;
5
5
  justify-content: center;
@@ -10,7 +10,7 @@ import{$ as e,At as t,Bt as n,Ct as r,Dt as i,Et as a,Ft as o,Gt as s,Ht as c,It
10
10
  font-size: 13px;
11
11
  color: ${({theme:e})=>e.color.inkDim};
12
12
  max-width: 48ch;
13
- `,$n=zn()({component:he,notFoundComponent:()=>k(Zn,{children:Pe(C,{$gap:3,style:{alignItems:`center`},children:[k(e,{children:`Not found`}),k(Qn,{children:`This console has no screen at that address.`}),k(ie,{as:`a`,href:`/`,$variant:`primary`,$size:`sm`,children:`Back to the rack`})]})})}),er=`modulepreload`,tr=function(e){return`/`+e},nr={},Q=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=tr(t,n),t=s(t),t in nr)return;nr[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:er,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},rr=X(`/_app`)({beforeLoad:async({context:e,location:t})=>{if(!(await e.queryClient.ensureQueryData({queryKey:te.status,queryFn:()=>S(`/api/status`),revalidateIfStale:!0})).authenticated)throw ot({to:`/login`,search:{next:t.href}})},component:Z(()=>Q(()=>import(`./_app-Dx_xnlud.js`),__vite__mapDeps([0,1,2,3,4,5])),`component`)}),ir=X(`/login`)({validateSearch:e=>({...typeof e.next==`string`?{next:e.next}:{},...typeof e.reason==`string`?{reason:e.reason}:{}}),component:Z(()=>Q(()=>import(`./login-cCXnl34r.js`),__vite__mapDeps([6,2,5,7,8,9])),`component`)}),ar=X(`/_app/`)({component:Z(()=>Q(()=>import(`./_app.index-DwOZe1A-.js`),__vite__mapDeps([10,2,4,5,11,12,13,8,14,15])),`component`)}),or=X(`/_app/accounts`)({component:Z(()=>Q(()=>import(`./_app.accounts-DvBYnbfS.js`),__vite__mapDeps([16,2,4,5,17,18,19,20,21,22,23,12,7,13,8,14,24,25])),`component`)}),sr=X(`/_app/console`)({component:Z(()=>Q(()=>import(`./_app.console-CoaRdkB1.js`),__vite__mapDeps([26,2,4,5,7,8])),`component`)}),cr=X(`/_app/database`)({component:Z(()=>Q(()=>import(`./_app.database-CES5ec5g.js`),__vite__mapDeps([27,2,4,5,23,20,21,7,13,8,14,15,9])),`component`)}),lr=X(`/_app/keys`)({component:Z(()=>Q(()=>import(`./_app.keys-B5HrAu2U.js`),__vite__mapDeps([28,2,4,5,17,18,20,21,22,23,12,7,13,8,14])),`component`)}),ur=X(`/_app/logs`)({component:Z(()=>Q(()=>import(`./_app.logs-NbfIexz0.js`),__vite__mapDeps([29,2,4,5,11,20,21,12,7,8,14])),`component`)}),dr=X(`/_app/models`)({component:Z(()=>Q(()=>import(`./_app.models-B1MdFRtQ.js`),__vite__mapDeps([30,2,4,5,18,19,22,21,23,20,12,7,13,8,24])),`component`)}),fr=X(`/_app/settings`)({component:Z(()=>Q(()=>import(`./_app.settings-BkDkGkKF.js`),__vite__mapDeps([31,2,4,5,22,21,7,13,8])),`component`)}),pr=X(`/_app/usage`)({component:Z(()=>Q(()=>import(`./_app.usage-DNpM8Nub.js`),__vite__mapDeps([32,2,4,5,8,14,24,25,15])),`component`)}),mr=X(`/_app/plugins/$pluginId`)({component:Z(()=>Q(()=>import(`./_app.plugins._pluginId-ByMziW8p.js`),__vite__mapDeps([33,2,4,5,8])),`component`)}),$=rr.update({id:`/_app`,getParentRoute:()=>$n}),hr=ir.update({id:`/login`,path:`/login`,getParentRoute:()=>$n}),gr=ar.update({id:`/`,path:`/`,getParentRoute:()=>$}),_r={AppAccountsRoute:or.update({id:`/accounts`,path:`/accounts`,getParentRoute:()=>$}),AppConsoleRoute:sr.update({id:`/console`,path:`/console`,getParentRoute:()=>$}),AppDatabaseRoute:cr.update({id:`/database`,path:`/database`,getParentRoute:()=>$}),AppKeysRoute:lr.update({id:`/keys`,path:`/keys`,getParentRoute:()=>$}),AppLogsRoute:ur.update({id:`/logs`,path:`/logs`,getParentRoute:()=>$}),AppModelsRoute:dr.update({id:`/models`,path:`/models`,getParentRoute:()=>$}),AppSettingsRoute:fr.update({id:`/settings`,path:`/settings`,getParentRoute:()=>$}),AppUsageRoute:pr.update({id:`/usage`,path:`/usage`,getParentRoute:()=>$}),AppIndexRoute:gr,AppPluginsPluginIdRoute:mr.update({id:`/plugins/$pluginId`,path:`/plugins/$pluginId`,getParentRoute:()=>$})},vr={AppRoute:$._addFileChildren(_r),LoginRoute:hr},yr=$n._addFileChildren(vr)._addFileTypes();function br(e){let t=t=>{!(t instanceof oe)||!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 oe&&t.isUnauthenticated?!1:e<2,staleTime:5e3,refetchOnWindowFocus:!0},mutations:{retry:!1}}})}var xr=Re`
13
+ `,$n=zn()({component:he,notFoundComponent:()=>k(Zn,{children:Pe(C,{$gap:3,style:{alignItems:`center`},children:[k(e,{children:`Not found`}),k(Qn,{children:`This console has no screen at that address.`}),k(ie,{as:`a`,href:`/`,$variant:`primary`,$size:`sm`,children:`Back to the rack`})]})})}),er=`modulepreload`,tr=function(e){return`/`+e},nr={},Q=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=tr(t,n),t=s(t),t in nr)return;nr[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:er,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},rr=X(`/_app`)({beforeLoad:async({context:e,location:t})=>{if(!(await e.queryClient.ensureQueryData({queryKey:te.status,queryFn:()=>S(`/api/status`),revalidateIfStale:!0})).authenticated)throw ot({to:`/login`,search:{next:t.href}})},component:Z(()=>Q(()=>import(`./_app-ChlUa_Ov.js`),__vite__mapDeps([0,1,2,3,4,5])),`component`)}),ir=X(`/login`)({validateSearch:e=>({...typeof e.next==`string`?{next:e.next}:{},...typeof e.reason==`string`?{reason:e.reason}:{}}),component:Z(()=>Q(()=>import(`./login-CJz2YA-O.js`),__vite__mapDeps([6,2,5,7,8,9])),`component`)}),ar=X(`/_app/`)({component:Z(()=>Q(()=>import(`./_app.index-C1vtrxnM.js`),__vite__mapDeps([10,2,4,5,11,12,13,8,14,15])),`component`)}),or=X(`/_app/accounts`)({component:Z(()=>Q(()=>import(`./_app.accounts-CJ6lFXIx.js`),__vite__mapDeps([16,17,2,5,4,18,19,20,21,22,23,24,12,7,13,8,14,25])),`component`)}),sr=X(`/_app/console`)({component:Z(()=>Q(()=>import(`./_app.console-eFiUh-OA.js`),__vite__mapDeps([26,2,4,5,7,8])),`component`)}),cr=X(`/_app/database`)({component:Z(()=>Q(()=>import(`./_app.database-BHaMpXld.js`),__vite__mapDeps([27,2,4,5,24,21,22,7,13,8,14,15,9])),`component`)}),lr=X(`/_app/keys`)({component:Z(()=>Q(()=>import(`./_app.keys-Bz6-VVJi.js`),__vite__mapDeps([28,2,4,5,18,19,21,22,23,24,12,7,13,8,14])),`component`)}),ur=X(`/_app/logs`)({component:Z(()=>Q(()=>import(`./_app.logs-DV7O6ZUp.js`),__vite__mapDeps([29,2,4,5,11,21,22,12,7,8,14])),`component`)}),dr=X(`/_app/models`)({component:Z(()=>Q(()=>import(`./_app.models-KIctkivt.js`),__vite__mapDeps([30,2,4,5,19,20,23,22,24,21,12,7,13,8,25])),`component`)}),fr=X(`/_app/settings`)({component:Z(()=>Q(()=>import(`./_app.settings-B8zjCira.js`),__vite__mapDeps([31,2,4,5,23,22,7,13,8])),`component`)}),pr=X(`/_app/usage`)({component:Z(()=>Q(()=>import(`./_app.usage-C4GR06sI.js`),__vite__mapDeps([32,17,2,5,4,8,14,25,15])),`component`)}),mr=X(`/_app/plugins/$pluginId`)({component:Z(()=>Q(()=>import(`./_app.plugins._pluginId-BbqXEJUB.js`),__vite__mapDeps([33,2,4,5,8])),`component`)}),$=rr.update({id:`/_app`,getParentRoute:()=>$n}),hr=ir.update({id:`/login`,path:`/login`,getParentRoute:()=>$n}),gr=ar.update({id:`/`,path:`/`,getParentRoute:()=>$}),_r={AppAccountsRoute:or.update({id:`/accounts`,path:`/accounts`,getParentRoute:()=>$}),AppConsoleRoute:sr.update({id:`/console`,path:`/console`,getParentRoute:()=>$}),AppDatabaseRoute:cr.update({id:`/database`,path:`/database`,getParentRoute:()=>$}),AppKeysRoute:lr.update({id:`/keys`,path:`/keys`,getParentRoute:()=>$}),AppLogsRoute:ur.update({id:`/logs`,path:`/logs`,getParentRoute:()=>$}),AppModelsRoute:dr.update({id:`/models`,path:`/models`,getParentRoute:()=>$}),AppSettingsRoute:fr.update({id:`/settings`,path:`/settings`,getParentRoute:()=>$}),AppUsageRoute:pr.update({id:`/usage`,path:`/usage`,getParentRoute:()=>$}),AppIndexRoute:gr,AppPluginsPluginIdRoute:mr.update({id:`/plugins/$pluginId`,path:`/plugins/$pluginId`,getParentRoute:()=>$})},vr={AppRoute:$._addFileChildren(_r),LoginRoute:hr},yr=$n._addFileChildren(vr)._addFileTypes();function br(e){let t=t=>{!(t instanceof oe)||!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 oe&&t.isUnauthenticated?!1:e<2,staleTime:5e3,refetchOnWindowFocus:!0},mutations:{retry:!1}}})}var xr=Re`
14
14
  :root {
15
15
  color-scheme: light;
16
16
 
@@ -1,4 +1,4 @@
1
- import{$ as e,B as t,T as n,U as r,at as i,ct as a,ft as o,lt as s,nt as c}from"./queries-CIOPbRcE.js";import{o as l}from"./index-gMv8Qs7m.js";import{t as u}from"./Lamp-BDf7-dMa.js";import{n as d,t as f}from"./Field-D-14HF0x.js";import{i as p,o as m}from"./States-CxLDlCaw.js";import{t as h}from"./reasons-Cb8yF4Oy.js";import{useState as g}from"react";import{jsx as _,jsxs as v}from"react/jsx-runtime";import y from"styled-components";var b=y.div`
1
+ import{$ as e,B as t,T as n,U as r,at as i,ct as a,ft as o,lt as s,nt as c}from"./queries-BOAAI06M.js";import{o as l}from"./index-B2twwe7y.js";import{t as u}from"./Lamp-BDf7-dMa.js";import{n as d,t as f}from"./Field-b0ohzqzR.js";import{i as p,o as m}from"./States-6G9NsYha.js";import{t as h}from"./reasons-Cb8yF4Oy.js";import{useState as g}from"react";import{jsx as _,jsxs as v}from"react/jsx-runtime";import y from"styled-components";var b=y.div`
2
2
  display: flex;
3
3
  align-items: center;
4
4
  justify-content: center;
@@ -0,0 +1 @@
1
+ import{c as e}from"./Rack-DhVnjAjC.js";var t=e(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]);export{t};