@lunora/studio 1.0.0-alpha.35 → 1.0.0-alpha.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +6 -0
- package/dist/standalone/{chunk-YV43BOP7.js → chunk-22W5VKZ6.js} +1 -1
- package/dist/standalone/{chunk-IODYGARQ.js → chunk-2THHW7BC.js} +1 -1
- package/dist/standalone/{chunk-6UGM5IHN.js → chunk-7SLSB2TS.js} +1 -1
- package/dist/standalone/{chunk-X6F22DBL.js → chunk-ATYUMPDM.js} +1 -1
- package/dist/standalone/chunk-DC72CQY4.js +76 -0
- package/dist/standalone/{chunk-EIQW6ACH.js → chunk-IOFMK4D7.js} +1 -1
- package/dist/standalone/chunk-KJJ3WM6H.js +4 -0
- package/dist/standalone/{chunk-O77VNUFD.js → chunk-LAK5VSPI.js} +1 -1
- package/dist/standalone/{chunk-XGMIDFUK.js → chunk-NKJDGOM3.js} +1 -1
- package/dist/standalone/{chunk-7WNJ4Q7Z.js → chunk-OIZ4CHPN.js} +1 -1
- package/dist/standalone/{chunk-JFSZIUZT.js → chunk-OY3GVYS7.js} +1 -1
- package/dist/standalone/{chunk-VSHUSN6T.js → chunk-Q52CHOSY.js} +1 -1
- package/dist/standalone/{chunk-25VHPD2I.js → chunk-SG3ALJJU.js} +1 -1
- package/dist/standalone/{chunk-474C2O7W.js → chunk-TOJ3TC35.js} +1 -1
- package/dist/standalone/chunk-WI7GWFEG.js +1 -0
- package/dist/standalone/{chunk-NJFMWO6P.js → chunk-X5P2WRYI.js} +1 -1
- package/dist/standalone/{chunk-XZE2RNDA.js → chunk-XLQ4BHBD.js} +1 -1
- package/dist/standalone/chunk-ZIGWVHCS.js +1 -0
- package/dist/standalone/{chunk-4H2OJBXO.js → chunk-ZYRGPDZB.js} +1 -1
- package/dist/standalone/studio.js +1 -1
- package/dist/styles.css +1 -1
- package/package.json +5 -5
- package/dist/standalone/chunk-55YA7ZZI.js +0 -76
- package/dist/standalone/chunk-FKO3HO6I.js +0 -4
- package/dist/standalone/chunk-SVR644RF.js +0 -1
- package/dist/standalone/chunk-UII66UVF.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as De,b as X,c as ve}from"./chunk-
|
|
1
|
+
import{a as De,b as X,c as ve}from"./chunk-ZYRGPDZB.js";import{a as Oe}from"./chunk-6GFEVKJP.js";import{a as Me}from"./chunk-7VF3IAAW.js";import"./chunk-PN5NCZDX.js";import"./chunk-QBAT52GB.js";import"./chunk-QAFAJBAW.js";import"./chunk-AHILM3ZP.js";import"./chunk-764T6X6X.js";import"./chunk-XUGSA2NG.js";import"./chunk-5OIBXYZM.js";import"./chunk-DC72CQY4.js";import"./chunk-BJGBHGK3.js";import"./chunk-ZIGWVHCS.js";import"./chunk-TDL7NEWA.js";import"./chunk-KEGAWN6Y.js";import{a as Ee}from"./chunk-XNJNSCLM.js";import{a as qe,b as Ie,c as Re,d as he,e as Le,f as Ae}from"./chunk-GTM65MVX.js";import"./chunk-4QHKBC77.js";import{a as we}from"./chunk-K3GNLVYK.js";import{b as ke}from"./chunk-TBMYIZIO.js";import"./chunk-3CJW6NWG.js";import"./chunk-UK64ZSUW.js";import"./chunk-O3NAGRTR.js";import"./chunk-HV7G6DFP.js";import{a as re}from"./chunk-BOXSWNXZ.js";import"./chunk-CKSHCYGC.js";import{f as be}from"./chunk-X7MMBSNW.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{d as G,e as se,f as le,g as Te,k as V}from"./chunk-PVZI3CXP.js";import"./chunk-GMSGZDDH.js";import{a as r,e as pe,f as Ct,g as Tt,h as kt,j as ne}from"./chunk-RRCPZMC2.js";var Y=pe(Tt(),1);var q=pe(Ct(),1);var s=pe(kt(),1);var wt=["ORDER BY","GROUP BY","LEFT JOIN","RIGHT JOIN","INNER JOIN","OUTER JOIN","CROSS JOIN","EXPLAIN QUERY PLAN","SELECT","DISTINCT","FROM","WHERE","HAVING","LIMIT","OFFSET","JOIN","ON","AND","OR","AS","ASC","DESC","WITH","UNION","EXPLAIN"],Et=["FROM","WHERE","ORDER BY","GROUP BY","HAVING","LIMIT","OFFSET","UNION","JOIN","LEFT JOIN","RIGHT JOIN","INNER JOIN","OUTER JOIN","CROSS JOIN"],ae=String.fromCodePoint(0),qt=new RegExp(`${ae}${String.raw`(\d+)`}${ae}`,"gu"),It=wt.map(n=>({pattern:new RegExp(String.raw`\b${n.replaceAll(" ",String.raw`\s+`)}\b`,"giu"),replacement:n})),Rt=Et.map(n=>({pattern:new RegExp(String.raw`\s+${n.replaceAll(" ",String.raw`\s+`)}\b`,"gu"),replacement:`
|
|
2
2
|
${n}`})),Lt=r(n=>{let e=[],t=n.replaceAll(/'(?:[^']|'')*'/gu,l=>(e.push(l),`${ae}${(e.length-1).toString()}${ae}`)).replaceAll(/\s+/gu," ").trim();for(let{pattern:l,replacement:a}of It)t=t.replaceAll(l,a);for(let{pattern:l,replacement:a}of Rt)t=t.replaceAll(l,a);return t=t.replaceAll(qt,(l,a)=>e[Number(a)]??""),t},"formatSql"),ie=8,At=["AND","ASC","AS","BY","COUNT","DESC","DISTINCT","EXPLAIN","FROM","GROUP","HAVING","INNER","JOIN","LEFT","LIKE","LIMIT","NOT","NULL","OFFSET","ON","ORDER","OR","QUERY","SELECT","WHERE","WITH"],Ot=new Set(["AND","BY","HAVING","ON","OR","SELECT","WHERE"]),Mt=/[\w$]/,Pe=r(n=>n!==void 0&&Mt.test(n),"isWordChar"),_e=r(n=>{let e=n.length;for(;e>0&&Pe(n[e-1]);)e-=1;return n.slice(e)},"trailingWord"),He=r((n,e)=>{let o=e;for(;o>0&&Pe(n[o-1]);)o-=1;return{end:e,start:o,text:n.slice(o,e)}},"tokenAt"),$e=r((n,e)=>{let o=n.slice(0,e).trimEnd();return o.endsWith(".")||Ot.has(_e(o).toUpperCase())},"prefersColumns"),Dt=r((n,e)=>{let o=n.slice(0,e);if(!o.endsWith("."))return;let t=_e(o.slice(0,-1));return t===""?void 0:t},"qualifierTable"),Ne=r((n,e)=>n.toLowerCase().startsWith(e.toLowerCase()),"matches"),Be=r((n,e,o,t)=>{let l=[];for(let a of n)if(Ne(a,e)&&(l.push(t(a)),l.length>=o))break;return l},"takeMatches"),$t=r((n,e,o)=>{let t=new Map;for(let[l,a]of Object.entries(n.columns))for(let d of a)if(Ne(d,e)&&!t.has(d)&&(t.set(d,l),t.size>=o))return[...t].map(([m,c])=>({detail:c,kind:"column",label:m}));return[...t].map(([l,a])=>({detail:a,kind:"column",label:l}))},"takeColumnMatches"),Bt=r((n,e,o)=>{let t=He(n,e),l=Dt(n,t.start);if(l!==void 0){let u=o.columns[l]??o.columns[l.toLowerCase()]??[];return Be(u,t.text,ie,y=>({detail:l,kind:"column",label:y}))}if(t.text===""&&!$e(n,t.start))return[];let a=Be(o.tables,t.text,ie,u=>({kind:"table",label:u})),d=$t(o,t.text,ie),m=At.filter(u=>t.text!==""&&Ne(u,t.text)&&u.toLowerCase()!==t.text.toLowerCase()).map(u=>({kind:"keyword",label:u}));return($e(n,t.start)?[...d,...a,...m]:[...a,...d,...m]).slice(0,ie)},"suggestionsFor"),Pt=r((n,e,o)=>{let t=He(n,e),l=n.slice(0,t.start)+o.label+n.slice(t.end);return{caret:t.start+o.label.length,value:l}},"acceptSuggestion"),_t=["boxSizing","borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textTransform","width","wordSpacing"],Ht=r((n,e)=>{let o=globalThis.getComputedStyle(n),t=globalThis.document.createElement("div"),{style:l}=t;l.position="absolute",l.visibility="hidden",l.whiteSpace="pre-wrap",l.overflowWrap="break-word";for(let c of _t)l[c]=o[c];t.textContent=n.value.slice(0,Math.max(0,e));let a=globalThis.document.createElement("span");a.textContent=n.value.slice(Math.max(0,e))||".",t.append(a),globalThis.document.body.append(t);let d=a.offsetLeft-n.scrollLeft,m=a.offsetTop-n.scrollTop;return t.remove(),{left:d,top:m}},"caretOffset"),Wt=r((n,e,o)=>{let t=(0,Y.c)(13),[l,a]=(0,q.useState)(null),d;t[0]!==n||t[1]!==e?(d=r((N,x)=>{let S=Bt(N,x,n);if(S.length===0){a(null);return}let h=e.current,{left:w,top:T}=h===null?{left:0,top:0}:Ht(h,x);a({active:0,left:w,suggestions:S,top:T})},"t0"),t[0]=n,t[1]=e,t[2]=d):d=t[2];let m=d,c;t[3]===Symbol.for("react.memo_cache_sentinel")?(c=r(()=>{a(null)},"t1"),t[3]=c):c=t[3];let u=c,y;t[4]===Symbol.for("react.memo_cache_sentinel")?(y=r(N=>{a(x=>{if(x===null)return x;let S=x.suggestions.length,h=(x.active+N+S)%S;return{...x,active:h}})},"t2"),t[4]=y):y=t[4];let g=y,v;t[5]!==o||t[6]!==l||t[7]!==e?(v=r(()=>{let N=e.current;if(l===null||N===null)return!1;let x=l.suggestions[l.active];if(x===void 0)return!1;let S=Pt(N.value,N.selectionStart,x);return o(S.value),a(null),requestAnimationFrame(()=>{let h=e.current;h!==null&&(h.focus(),h.setSelectionRange(S.caret,S.caret))}),!0},"t3"),t[5]=o,t[6]=l,t[7]=e,t[8]=v):v=t[8];let p=v,f;return t[9]!==p||t[10]!==m||t[11]!==l?(f={close:u,commit:p,move:g,refresh:m,state:l},t[9]=p,t[10]=m,t[11]=l,t[12]=f):f=t[12],f},"useSqlAutocomplete"),Ft={column:"column",keyword:"keyword",table:"table"},zt=20,Ut=r(n=>{let e=(0,Y.c)(17),{listboxId:o,onPick:t,state:l}=n,a=G(),d;e[0]!==l?(d=l===null?void 0:{left:l.left,top:l.top+zt},e[0]=l,e[1]=d):d=e[1];let m=d;if(l===null)return null;let c;if(e[2]!==o||e[3]!==t||e[4]!==l.active||e[5]!==l.suggestions||e[6]!==a){let y;e[8]!==o||e[9]!==t||e[10]!==l.active||e[11]!==a?(y=r((g,v)=>(0,s.jsxDEV)("li",{"aria-selected":v===l.active,className:ne("flex cursor-pointer items-center gap-2 px-2 py-1 text-[13px]",v===l.active?"bg-accent text-accent-foreground":"text-foreground"),"data-testid":"sql-autocomplete-item",id:`${o}-opt-${v.toString()}`,onMouseDown:r(p=>{p.preventDefault(),t(v)},"onMouseDown"),role:"option",children:[(0,s.jsxDEV)("span",{className:"truncate font-mono",children:g.label},void 0,!1),g.detail!==void 0&&(0,s.jsxDEV)("span",{className:"ms-auto truncate text-xs text-muted-foreground",children:g.detail},void 0,!1),(0,s.jsxDEV)("span",{className:"shrink-0 font-mono text-[10px] tracking-wide text-muted-foreground/70 uppercase",children:a(Ft[g.kind])},void 0,!1)]},`${g.kind}:${g.label}`,!0),"t32"),e[8]=o,e[9]=t,e[10]=l.active,e[11]=a,e[12]=y):y=e[12],c=l.suggestions.map(y),e[2]=o,e[3]=t,e[4]=l.active,e[5]=l.suggestions,e[6]=a,e[7]=c}else c=e[7];let u;return e[13]!==o||e[14]!==m||e[15]!==c?(u=(0,s.jsxDEV)("ul",{className:"absolute z-30 max-h-56 w-72 overflow-auto rounded-md border border-border bg-popover py-1 text-popover-foreground shadow-md","data-testid":"sql-autocomplete",id:o,role:"listbox",style:m,children:c},void 0,!1),e[13]=o,e[14]=m,e[15]=c,e[16]=u):u=e[16],u},"AutocompletePopover"),We=[{label:"List tables",sql:"SELECT name FROM sqlite_master WHERE type = 'table' ORDER BY name;"},{label:"Table row count",sql:"SELECT COUNT(*) AS rows FROM messages;"},{label:"Recent rows",sql:"SELECT id, _creationTime, __doc__ FROM messages ORDER BY _creationTime DESC LIMIT 50;"},{label:"Index list",sql:"SELECT name, tbl_name FROM sqlite_master WHERE type = 'index' ORDER BY tbl_name;"}],Yt=r(n=>{let e=(0,Y.c)(29),{active:o,onDelete:t,onSelect:l,query:a}=n,d=G(),m;e[0]!==l||e[1]!==a.id?(m=r(()=>{l(a.id)},"t1"),e[0]=l,e[1]=a.id,e[2]=m):m=e[2];let c=m,u;e[3]!==t||e[4]!==a.id?(u=r(O=>{O.stopPropagation(),t(a.id)},"t2"),e[3]=t,e[4]=a.id,e[5]=u):u=e[5];let y=u,g=o?"bg-sidebar-accent font-medium text-foreground":"text-muted-foreground",v;e[6]!==g?(v=ne("flex min-w-0 flex-1 items-center gap-2 rounded-md px-2 py-1.5 text-start text-[13px] outline-none transition-colors hover:bg-sidebar-accent focus-visible:bg-sidebar-accent",g),e[6]=g,e[7]=v):v=e[7];let p=`sql-query-${a.id}`,f;e[8]===Symbol.for("react.memo_cache_sentinel")?(f=(0,s.jsxDEV)("svg",{"aria-hidden":"true",className:"size-3.5 shrink-0 opacity-70",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,s.jsxDEV)("path",{d:"M4 6h16M4 12h10M4 18h7"},void 0,!1)},void 0,!1),e[8]=f):f=e[8];let N;e[9]!==a.name?(N=(0,s.jsxDEV)("span",{className:"truncate",children:a.name},void 0,!1),e[9]=a.name,e[10]=N):N=e[10];let x;e[11]!==o||e[12]!==c||e[13]!==v||e[14]!==p||e[15]!==N?(x=(0,s.jsxDEV)("button",{"aria-pressed":o,className:v,"data-testid":p,onClick:c,type:"button",children:[f,N]},void 0,!0),e[11]=o,e[12]=c,e[13]=v,e[14]=p,e[15]=N,e[16]=x):x=e[16];let S;e[17]!==d?(S=d("Delete query"),e[17]=d,e[18]=S):S=e[18];let h;e[19]!==d?(h=d("Delete query"),e[19]=d,e[20]=h):h=e[20];let w;e[21]===Symbol.for("react.memo_cache_sentinel")?(w=(0,s.jsxDEV)("svg",{"aria-hidden":"true",className:"size-3.5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,s.jsxDEV)("path",{d:"M5 7h14M9 7V5h6v2m-1 0v12H10V7M7 7v13h10V7"},void 0,!1)},void 0,!1),e[21]=w):w=e[21];let T;e[22]!==y||e[23]!==h||e[24]!==S?(T=(0,s.jsxDEV)("button",{"aria-label":S,className:"me-1 hidden size-6 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-destructive/10 hover:text-destructive group-hover/q:flex",onClick:y,title:h,type:"button",children:w},void 0,!1),e[22]=y,e[23]=h,e[24]=S,e[25]=T):T=e[25];let R;return e[26]!==T||e[27]!==x?(R=(0,s.jsxDEV)("li",{className:"group/q flex items-center",children:[x,T]},void 0,!0),e[26]=T,e[27]=x,e[28]=R):R=e[28],R},"QueryRow"),jt=r(n=>{let e=(0,Y.c)(58),{activeId:o,history:t,listRef:l,onClearHistory:a,onDelete:d,onLoadHistory:m,onLoadTemplate:c,onNew:u,onSearchChange:y,onSelect:g,queries:v,search:p}=n,f=G(),N;if(e[0]!==v||e[1]!==p){let k=p.trim().toLowerCase();N=k===""?[...v]:v.filter(j=>j.name.toLowerCase().includes(k)),e[0]=v,e[1]=p,e[2]=N}else N=e[2];let x=N,S;e[3]!==f?(S=f("Search queries\u2026"),e[3]=f,e[4]=S):S=e[4];let h;e[5]!==y||e[6]!==p||e[7]!==S?(h=(0,s.jsxDEV)("input",{className:"h-8 min-w-0 flex-1 rounded-md border border-border bg-background px-2 text-xs outline-none focus-visible:border-ring","data-testid":"sql-search",onChange:y,placeholder:S,type:"text",value:p},void 0,!1),e[5]=y,e[6]=p,e[7]=S,e[8]=h):h=e[8];let w;e[9]!==f?(w=f("New query"),e[9]=f,e[10]=w):w=e[10];let T;e[11]!==f?(T=f("New query"),e[11]=f,e[12]=T):T=e[12];let R;e[13]===Symbol.for("react.memo_cache_sentinel")?(R=(0,s.jsxDEV)("svg",{"aria-hidden":"true",className:"size-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.7,viewBox:"0 0 24 24",children:(0,s.jsxDEV)("path",{d:"M12 5v14M5 12h14"},void 0,!1)},void 0,!1),e[13]=R):R=e[13];let O;e[14]!==u||e[15]!==w||e[16]!==T?(O=(0,s.jsxDEV)("button",{"aria-label":w,className:"flex size-8 shrink-0 items-center justify-center rounded-md border border-border text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent","data-testid":"sql-new",onClick:u,title:T,type:"button",children:R},void 0,!1),e[14]=u,e[15]=w,e[16]=T,e[17]=O):O=e[17];let A;e[18]!==h||e[19]!==O?(A=(0,s.jsxDEV)("div",{className:"flex shrink-0 items-center gap-2 border-b border-border p-2",children:[h,O]},void 0,!0),e[18]=h,e[19]=O,e[20]=A):A=e[20];let M;e[21]!==f?(M=f("Private"),e[21]=f,e[22]=M):M=e[22];let z;e[23]!==M?(z=(0,s.jsxDEV)("p",{className:"px-1 pb-1 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:M},void 0,!1),e[23]=M,e[24]=z):z=e[24];let B;e[25]!==o||e[26]!==x||e[27]!==l||e[28]!==d||e[29]!==g||e[30]!==f?(B=x.length===0?(0,s.jsxDEV)("p",{className:"px-1 py-2 text-xs text-muted-foreground","data-testid":"sql-private-empty",children:f("No saved queries yet \u2014 they save to this browser as you type.")},void 0,!1):(0,s.jsxDEV)("ul",{className:"flex flex-col gap-px","data-testid":"sql-private",ref:l,children:x.map(k=>(0,s.jsxDEV)(Yt,{active:o===k.id,onDelete:d,onSelect:g,query:k},k.id,!1))},void 0,!1),e[25]=o,e[26]=x,e[27]=l,e[28]=d,e[29]=g,e[30]=f,e[31]=B):B=e[31];let P;e[32]!==z||e[33]!==B?(P=(0,s.jsxDEV)("div",{children:[z,B]},void 0,!0),e[32]=z,e[33]=B,e[34]=P):P=e[34];let H;e[35]!==f?(H=f("Reference"),e[35]=f,e[36]=H):H=e[36];let U;e[37]!==H?(U=(0,s.jsxDEV)("p",{className:"px-1 pb-1 font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:H},void 0,!1),e[37]=H,e[38]=U):U=e[38];let I;e[39]!==c?(I=We.map(k=>(0,s.jsxDEV)("li",{children:(0,s.jsxDEV)("button",{className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-start text-[13px] text-muted-foreground outline-none transition-colors hover:bg-sidebar-accent hover:text-foreground focus-visible:bg-sidebar-accent","data-sql":k.sql,onClick:c,type:"button",children:[(0,s.jsxDEV)("svg",{"aria-hidden":"true",className:"size-3.5 shrink-0 opacity-70",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,s.jsxDEV)("path",{d:"M7 4h7l4 4v12H7zM14 4v4h4"},void 0,!1)},void 0,!1),k.label]},void 0,!0)},k.label,!1)),e[39]=c,e[40]=I):I=e[40];let L;e[41]!==I?(L=(0,s.jsxDEV)("ul",{className:"flex flex-col gap-px",children:I},void 0,!1),e[41]=I,e[42]=L):L=e[42];let D;e[43]!==U||e[44]!==L?(D=(0,s.jsxDEV)("div",{children:[U,L]},void 0,!0),e[43]=U,e[44]=L,e[45]=D):D=e[45];let _;e[46]!==t||e[47]!==a||e[48]!==m||e[49]!==f?(_=t.length>0&&(0,s.jsxDEV)("div",{children:[(0,s.jsxDEV)("div",{className:"flex items-center justify-between px-1 pb-1",children:[(0,s.jsxDEV)("p",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:f("History")},void 0,!1),(0,s.jsxDEV)("button",{className:"rounded px-1 text-[11px] text-muted-foreground outline-none transition-colors hover:text-foreground focus-visible:text-foreground","data-testid":"sql-history-clear",onClick:a,type:"button",children:f("Clear history")},void 0,!1)]},void 0,!0),(0,s.jsxDEV)("ul",{className:"flex flex-col gap-px","data-testid":"sql-history",children:t.map(k=>(0,s.jsxDEV)("li",{children:(0,s.jsxDEV)("button",{className:"flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-start text-[13px] text-muted-foreground outline-none transition-colors hover:bg-sidebar-accent hover:text-foreground focus-visible:bg-sidebar-accent","data-sql":k.sql,"data-testid":"sql-history-item",onClick:m,title:k.sql,type:"button",children:[(0,s.jsxDEV)("svg",{"aria-hidden":"true",className:"size-3.5 shrink-0 opacity-70",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,s.jsxDEV)("path",{d:"M12 8v4l3 2M12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18Z"},void 0,!1)},void 0,!1),(0,s.jsxDEV)("span",{className:"truncate font-mono",children:k.sql},void 0,!1)]},void 0,!0)},`${k.at.toString()}:${k.sql}`,!1))},void 0,!1)]},void 0,!0),e[46]=t,e[47]=a,e[48]=m,e[49]=f,e[50]=_):_=e[50];let $;e[51]!==P||e[52]!==D||e[53]!==_?($=(0,s.jsxDEV)("div",{className:"flex flex-1 flex-col gap-4 overflow-y-auto p-2",children:[P,D,_]},void 0,!0),e[51]=P,e[52]=D,e[53]=_,e[54]=$):$=e[54];let E;return e[55]!==$||e[56]!==A?(E=(0,s.jsxDEV)("aside",{className:"flex h-full w-64 shrink-0 flex-col border-e border-border bg-sidebar",children:[A,$]},void 0,!0),e[55]=$,e[56]=A,e[57]=E):E=e[57],E},"SqlQuerySidebar"),Kt=se(re.listTables),Gt=se(re.readTablePage),Jt=r(n=>{let e=(0,Y.c)(16),o=be(),t;e[0]===Symbol.for("react.memo_cache_sentinel")?(t=[],e[0]=t):t=e[0];let[l,a]=(0,q.useState)(t),d;e[1]===Symbol.for("react.memo_cache_sentinel")?(d={},e[1]=d):d=e[1];let[m,c]=(0,q.useState)(d),u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=new Set,e[2]=u):u=e[2];let y=(0,q.useRef)(u),g,v;e[3]!==o||e[4]!==n?(g=r(()=>{let h={cancelled:!1};return V(r(async()=>{try{let T=await o.query(Kt,{},le(n));h.cancelled||(a(T.map(Vt)),c({}),y.current=new Set)}catch{h.cancelled||(a([]),c({}),y.current=new Set)}},"load")()),()=>{h.cancelled=!0}},"t3"),v=[o,n],e[3]=o,e[4]=n,e[5]=g,e[6]=v):(g=e[5],v=e[6]),(0,q.useEffect)(g,v);let p;e[7]!==o||e[8]!==n?(p=r(h=>{if(y.current.has(h))return;y.current.add(h),V(r(async()=>{try{let T=await o.query(Gt,{limit:1,offset:0,table:h},le(n));c(R=>({...R,[h]:T.columns}))}catch{y.current.delete(h)}},"fetchColumns")())},"t5"),e[7]=o,e[8]=n,e[9]=p):p=e[9];let f=p,N;e[10]!==m||e[11]!==l?(N={columns:m,tables:l},e[10]=m,e[11]=l,e[12]=N):N=e[12];let x=N,S;return e[13]!==f||e[14]!==x?(S={probe:f,schema:x},e[13]=f,e[14]=x,e[15]=S):S=e[15],S},"useSqlSchema"),ge=/\b(?:from|join|update|into)\s+([a-z_][\w$]*)|\b([a-z_][\w$]*)\s*\./gi,Qt=r(n=>{let e=new Set;ge.lastIndex=0;let o=ge.exec(n);for(;o!==null;)e.add(o[1]??o[2]),o=ge.exec(n);return[...e]},"referencedTables");function Vt(n){return n.name}r(Vt,"_temp$2");var Xt="lunora-studio-sql-tabs",Zt="lunora-studio-sql-active-tab",ye=12,Z=r((n="",e="")=>({activeId:null,id:ve("tab"),name:e,sql:n}),"makeTab"),eo=r(()=>{let n=(0,Y.c)(5),[e,o]=X(Zt),t;n[0]!==o?(t=r(m=>{o(c=>{let u=c[0]??"";return[typeof m=="function"?m(u):m]})},"t0"),n[0]=o,n[1]=t):t=n[1];let l=t,a=e[0]??"",d;return n[2]!==l||n[3]!==a?(d=[a,l],n[2]=l,n[3]=a,n[4]=d):d=n[4],d},"usePersistedActive"),to=r(n=>{let[e,o]=X(Xt),[t,l]=eo(),a=(0,q.useRef)(null);e.length===0&&a.current===null&&(a.current=n()),(0,q.useEffect)(()=>{if(e.length===0&&a.current!==null){let c=a.current;o([c])}},[o,e.length]);let d=e.length===0&&a.current!==null?[a.current]:e;return{activeId:d.some(c=>c.id===t)?t:d[0]?.id??"",setActiveId:l,setTabs:o,tabs:d}},"usePersistedTabs"),Fe=r(n=>n.activeId===null&&n.sql.trim()!=="","isDirty"),oo=r((n,e)=>[...n,e].slice(-ye),"addTab"),no=r((n,e,o)=>{let t=n.findIndex(d=>d.id===e);if(t===-1)return{activeId:n[0]?.id??"",tabs:[...n]};let l=n.filter(d=>d.id!==e);if(l.length===0){let d=o();return{activeId:d.id,tabs:[d]}}return{activeId:l[Math.min(t,l.length-1)].id,tabs:l}},"closeTab"),so=r((n,e)=>{let o=n.filter(t=>t.id===e);return o.length===0?{activeId:n[0]?.id??"",tabs:[...n]}:{activeId:e,tabs:o}},"closeOtherTabs"),lo=r((n,e,o)=>{let t=n.findIndex(a=>a.id===e);if(t===-1)return{activeId:o,tabs:[...n]};let l=n.slice(0,t+1);return{activeId:l.some(a=>a.id===o)?o:e,tabs:l}},"closeTabsToRight"),ro=r(n=>{let e=n();return{activeId:e.id,tabs:[e]}},"closeAllTabs"),io=r((n,e,o)=>{if(n==="others")return e.filter(t=>t.id!==o);if(n==="right"){let t=e.findIndex(l=>l.id===o);return t===-1?[]:e.slice(t+1)}return[...e]},"tabsClosedBy"),ao=r((n,e)=>n.trim()===""?e:(n.split(`
|
|
3
3
|
`)[0]??n).slice(0,24),"derivedTabLabel"),co=r(n=>{let e=(0,Y.c)(14),{initial:o,onCancel:t,onCommit:l,placeholder:a,testId:d}=n,m=G(),c=mo,u;e[0]!==l?(u=r(N=>{l(N.currentTarget.value.trim())},"t1"),e[0]=l,e[1]=u):u=e[1];let y=u,g;e[2]!==t||e[3]!==l?(g=r(N=>{N.key==="Enter"?l(N.currentTarget.value.trim()):N.key==="Escape"&&t()},"t2"),e[2]=t,e[3]=l,e[4]=g):g=e[4];let v=g,p;e[5]!==m?(p=m("Tab title"),e[5]=m,e[6]=p):p=e[6];let f;return e[7]!==o||e[8]!==y||e[9]!==v||e[10]!==a||e[11]!==p||e[12]!==d?(f=(0,s.jsxDEV)("input",{"aria-label":p,className:"w-40 rounded border border-ring bg-background px-1 py-0.5 text-xs outline-none","data-testid":d,defaultValue:o,onBlur:y,onKeyDown:v,placeholder:a,ref:c,type:"text"},void 0,!1),e[7]=o,e[8]=y,e[9]=v,e[10]=a,e[11]=p,e[12]=d,e[13]=f):f=e[13],f},"TabRenameInput"),uo=r(n=>{let e=(0,Y.c)(29),{idBase:o,onDiscard:t,onKeep:l}=n,a=G(),d=`sql-tab-close-prompt-${o}`,m;e[0]!==a?(m=a("Discard?"),e[0]=a,e[1]=m):m=e[1];let c;e[2]!==m?(c=(0,s.jsxDEV)("span",{className:"text-[11px] text-muted-foreground",children:m},void 0,!1),e[2]=m,e[3]=c):c=e[3];let u;e[4]!==a?(u=a("Discard changes"),e[4]=a,e[5]=u):u=e[5];let y=`sql-tab-close-confirm-${o}`,g;e[6]!==a?(g=a("Discard changes"),e[6]=a,e[7]=g):g=e[7];let v;e[8]===Symbol.for("react.memo_cache_sentinel")?(v=(0,s.jsxDEV)("svg",{"aria-hidden":"true",className:"size-3",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.4,viewBox:"0 0 24 24",children:(0,s.jsxDEV)("path",{d:"M5 13l4 4L19 7"},void 0,!1)},void 0,!1),e[8]=v):v=e[8];let p;e[9]!==t||e[10]!==u||e[11]!==y||e[12]!==g?(p=(0,s.jsxDEV)("button",{"aria-label":u,className:"flex size-5 items-center justify-center rounded text-destructive hover:bg-destructive/10","data-testid":y,onClick:t,title:g,type:"button",children:v},void 0,!1),e[9]=t,e[10]=u,e[11]=y,e[12]=g,e[13]=p):p=e[13];let f;e[14]!==a?(f=a("Keep editing"),e[14]=a,e[15]=f):f=e[15];let N=`sql-tab-close-cancel-${o}`,x;e[16]!==a?(x=a("Keep editing"),e[16]=a,e[17]=x):x=e[17];let S;e[18]===Symbol.for("react.memo_cache_sentinel")?(S=(0,s.jsxDEV)("svg",{"aria-hidden":"true",className:"size-3",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2.4,viewBox:"0 0 24 24",children:(0,s.jsxDEV)("path",{d:"M6 6l12 12M18 6 6 18"},void 0,!1)},void 0,!1),e[18]=S):S=e[18];let h;e[19]!==l||e[20]!==N||e[21]!==x||e[22]!==f?(h=(0,s.jsxDEV)("button",{"aria-label":f,className:"flex size-5 items-center justify-center rounded text-muted-foreground hover:bg-accent","data-testid":N,onClick:l,title:x,type:"button",children:S},void 0,!1),e[19]=l,e[20]=N,e[21]=x,e[22]=f,e[23]=h):h=e[23];let w;return e[24]!==d||e[25]!==h||e[26]!==c||e[27]!==p?(w=(0,s.jsxDEV)("span",{className:"flex shrink-0 items-center gap-1","data-testid":d,role:"group",children:[c,p,h]},void 0,!0),e[24]=d,e[25]=h,e[26]=c,e[27]=p,e[28]=w):w=e[28],w},"TabCloseConfirm"),fo=r(n=>{let e=(0,Y.c)(47),{active:o,canClose:t,onClose:l,onMenu:a,onRename:d,onSelect:m,tab:c}=n,u=G(),[y,g]=(0,q.useState)(!1),[v,p]=(0,q.useState)(!1),f;e[0]!==a||e[1]!==c.id?(f=r(W=>{a(c.id,W)},"t1"),e[0]=a,e[1]=c.id,e[2]=f):f=e[2];let N=f,x;e[3]!==m||e[4]!==c.id?(x=r(()=>{m(c.id)},"t2"),e[3]=m,e[4]=c.id,e[5]=x):x=e[5];let S=x,h;e[6]===Symbol.for("react.memo_cache_sentinel")?(h=r(()=>{g(!0)},"t3"),e[6]=h):h=e[6];let w=h,T;e[7]!==l||e[8]!==c?(T=r(W=>{W.stopPropagation(),Fe(c)?p(!0):l(c.id)},"t4"),e[7]=l,e[8]=c,e[9]=T):T=e[9];let R=T,O;e[10]!==l||e[11]!==c.id?(O=r(W=>{W.stopPropagation(),p(!1),l(c.id)},"t5"),e[10]=l,e[11]=c.id,e[12]=O):O=e[12];let A=O,M;e[13]===Symbol.for("react.memo_cache_sentinel")?(M=r(W=>{W.stopPropagation(),p(!1)},"t6"),e[13]=M):M=e[13];let z=M,B;e[14]!==d||e[15]!==c.id?(B=r(W=>{d(c.id,W),g(!1)},"t7"),e[14]=d,e[15]=c.id,e[16]=B):B=e[16];let P=B,H;e[17]===Symbol.for("react.memo_cache_sentinel")?(H=r(()=>{g(!1)},"t8"),e[17]=H):H=e[17];let U=H,I;e[18]!==c.name?(I=c.name.trim(),e[18]=c.name,e[19]=I):I=e[19];let L=I,D;e[20]!==u||e[21]!==c.sql?(D=ao(c.sql,u("Untitled")),e[20]=u,e[21]=c.sql,e[22]=D):D=e[22];let _=D,$=o?"bg-background text-foreground":"bg-muted/40 text-muted-foreground hover:text-foreground",E;e[23]!==$?(E=ne("group/tab flex shrink-0 items-center gap-1 border-e border-border ps-3 pe-1.5 text-xs",$),e[23]=$,e[24]=E):E=e[24];let k=`sql-tab-${c.id}`,j;e[25]!==o||e[26]!==P||e[27]!==L||e[28]!==_||e[29]!==y||e[30]!==S||e[31]!==u||e[32]!==c.id?(j=y?(0,s.jsxDEV)(co,{initial:L,onCancel:U,onCommit:P,placeholder:_,testId:`sql-tab-rename-${c.id}`},void 0,!1):(0,s.jsxDEV)("button",{"aria-pressed":o,className:"max-w-40 truncate py-1.5 outline-none","data-testid":`sql-tab-select-${c.id}`,onClick:S,onDoubleClick:w,title:u("Double-click to rename"),type:"button",children:L===""?_:L},void 0,!1),e[25]=o,e[26]=P,e[27]=L,e[28]=_,e[29]=y,e[30]=S,e[31]=u,e[32]=c.id,e[33]=j):j=e[33];let K;e[34]!==t||e[35]!==A||e[36]!==v||e[37]!==R||e[38]!==u||e[39]!==c.id?(K=t&&(v?(0,s.jsxDEV)(uo,{idBase:c.id,onDiscard:A,onKeep:z},void 0,!1):(0,s.jsxDEV)("button",{"aria-label":u("Close tab"),className:"flex size-5 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-destructive/10 hover:text-destructive","data-testid":`sql-tab-close-${c.id}`,onClick:R,title:u("Close tab"),type:"button",children:(0,s.jsxDEV)("svg",{"aria-hidden":"true",className:"size-3",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",children:(0,s.jsxDEV)("path",{d:"M6 6l12 12M18 6 6 18"},void 0,!1)},void 0,!1)},void 0,!1)),e[34]=t,e[35]=A,e[36]=v,e[37]=R,e[38]=u,e[39]=c.id,e[40]=K):K=e[40];let J;return e[41]!==N||e[42]!==E||e[43]!==k||e[44]!==j||e[45]!==K?(J=(0,s.jsxDEV)("div",{className:E,"data-testid":k,onContextMenu:N,children:[j,K]},void 0,!0),e[41]=N,e[42]=E,e[43]=k,e[44]=j,e[45]=K,e[46]=J):J=e[46],J},"TabButton");function mo(n){n?.focus(),n?.select()}r(mo,"_temp$1");var po=se(re.runSql),bo="lunora-studio-sql-queries",ho="lunora-studio-sql-history",vo=25,go={minWidth:"2.75rem",paddingInline:"0.5rem"},xe={error:null,pane:"results",result:null},xo=r(n=>{let e=(0,Y.c)(16),{result:o}=n;if(o.columns.length===0){let c=o.rowCount===0?"0 rows":"",u;return e[0]!==c?(u=(0,s.jsxDEV)("p",{className:"p-4 text-sm text-muted-foreground",children:c},void 0,!1),e[0]=c,e[1]=u):u=e[1],u}let t;e[2]!==o.columns?(t=o.columns.map(yo),e[2]=o.columns,e[3]=t):t=e[3];let l;e[4]!==t?(l=(0,s.jsxDEV)(Ie,{className:"sticky top-0 z-10 bg-muted",children:(0,s.jsxDEV)(he,{children:t},void 0,!1)},void 0,!1),e[4]=t,e[5]=l):l=e[5];let a;if(e[6]!==o.columns||e[7]!==o.rows){let c;e[9]!==o.columns?(c=r((u,y)=>(0,s.jsxDEV)(he,{"data-testid":"sql-row",children:o.columns.map(g=>(0,s.jsxDEV)(Ae,{className:"max-w-md truncate font-mono text-xs",children:(0,s.jsxDEV)(Oe,{value:u[g]},void 0,!1)},g,!1))},y,!1),"t42"),e[9]=o.columns,e[10]=c):c=e[10],a=o.rows.map(c),e[6]=o.columns,e[7]=o.rows,e[8]=a}else a=e[8];let d;e[11]!==a?(d=(0,s.jsxDEV)(Re,{children:a},void 0,!1),e[11]=a,e[12]=d):d=e[12];let m;return e[13]!==l||e[14]!==d?(m=(0,s.jsxDEV)(qe,{"data-testid":"sql-rows",children:[l,d]},void 0,!0),e[13]=l,e[14]=d,e[15]=m):m=e[15],m},"SqlResultTable"),Oo=r(({initialShardKey:n})=>{let e=be(),o=G(),[t,l]=X(bo),[a,d]=X(ho),[m,c]=(0,q.useState)(""),u=r(()=>Z(We[0]?.sql??""),"seedTab"),{activeId:y,setActiveId:g,setTabs:v,tabs:p}=to(u),[f,N]=(0,q.useState)({}),[x,S]=(0,q.useState)(n??""),[h,w]=(0,q.useState)(!1),[T,R]=(0,q.useState)(null),[O,A]=(0,q.useState)(null),M=(0,q.useRef)(null),z=(0,q.useRef)(null),B=(0,q.useRef)(null),P=(0,q.useId)(),{probe:H,schema:U}=Jt(x),I=p.find(i=>i.id===y)??p[0]??Z(),L=I.sql,{activeId:D}=I,_=f[I.id]??xe,{error:$,result:E}=_,k=_.pane,j=r(i=>{v(b=>b.map(C=>C.id===I.id?{...C,...i}:C))},"patchActiveTab"),K=r(i=>{N(b=>{let C=b[I.id]??xe;return{...b,[I.id]:{error:i.error,pane:i.pane??C.pane,result:i.result}}})},"setActiveOutput"),J=r(i=>{N(b=>{let C=b[I.id]??xe;return{...b,[I.id]:{...C,pane:i}}})},"setActivePane"),W=r(i=>{j({sql:i}),D!==null&&l(b=>b.map(C=>C.id===D?{...C,sql:i}:C))},"setDraft"),ze=Wt(U,z,W),{close:ce,commit:Se,move:de,refresh:ee,state:Q}=ze,Ue=r(i=>{de(i-(Q?.active??0)),Se()},"onPickSuggestion");(0,q.useEffect)(()=>{let i=z.current;i!==null&&i===document.activeElement&&ee(i.value,i.selectionStart)},[ee,U]);let Ye=r(i=>{d(b=>b[0]?.sql===i?b:[{at:Date.now(),sql:i},...b.filter(F=>F.sql!==i)].slice(0,vo))},"recordHistory"),ue=r(async i=>{if(L.trim()==="")return;w(!0);let b=i==="explain"?`EXPLAIN QUERY PLAN ${L}`:L;try{let C=await e.query(po,{sql:b},le(x));K({error:null,pane:i,result:C}),ke(x),Ye(b)}catch(C){K({error:Te(C),pane:i,result:null})}finally{w(!1)}},"run"),je=r(()=>{V(ue("results"))},"onRun"),Ke=r(i=>{let{selectionStart:b,value:C}=i.target;W(C);for(let F of Qt(C))H(F);ee(C,b)},"onDraftChange"),Ge=r(i=>{let b=i.currentTarget;ee(b.value,b.selectionStart)},"onEditorSelect"),Je=r(i=>{if(Q!==null){if(i.key==="ArrowDown"){i.preventDefault(),de(1);return}if(i.key==="ArrowUp"){i.preventDefault(),de(-1);return}if(i.key==="Escape"){i.preventDefault(),ce();return}if((i.key==="Enter"||i.key==="Tab")&&!i.metaKey&&!i.ctrlKey&&Se()){i.preventDefault();return}}(i.metaKey||i.ctrlKey)&&i.key==="Enter"&&(i.preventDefault(),V(ue(k)))},"onEditorKeyDown"),Qe=r(()=>{requestAnimationFrame(()=>{ce()})},"onEditorBlur"),Ve=r(i=>{M.current!==null&&(M.current.scrollTop=i.currentTarget.scrollTop)},"onEditorScroll"),te=r((i,b)=>{v(C=>C.map(F=>F.id===I.id?{...F,activeId:b,sql:i}:F)),K({error:null,result:null})},"loadIntoActiveTab"),Xe=r(()=>{let i={id:ve("q"),name:o("Untitled query"),sql:""};l(b=>[i,...b]),te("",i.id)},"newQuery"),Ze=r(i=>{let b=t.find(C=>C.id===i);b!==void 0&&(te(b.sql,i),B.current?.querySelector(`[data-testid="sql-query-${i}"]`)?.scrollIntoView({block:"nearest"}))},"selectQuery"),et=r(i=>{l(b=>b.filter(C=>C.id!==i)),v(b=>b.map(C=>C.activeId===i?{...C,activeId:null}:C))},"deleteQuery"),tt=r(i=>{te(i.currentTarget.dataset.sql??"",null)},"loadTemplate"),ot=r(i=>{te(i.currentTarget.dataset.sql??"",null)},"loadFromHistory"),nt=r(()=>{d([])},"clearHistory"),st=r(()=>{W(Lt(L))},"formatDraft"),lt=r(()=>{if(p.length>=ye)return;let i=Z();v(b=>oo(b,i)),g(i.id)},"addEditorTab"),oe=r(i=>{R(null),A(null),v(i.tabs),g(i.activeId);let b=new Set(i.tabs.map(C=>C.id));N(C=>Object.fromEntries(Object.entries(C).filter(([F])=>b.has(F))))},"commitTabs"),rt=r(i=>{oe(no(p,i,Z))},"closeEditorTab"),Ce=r((i,b)=>{oe(i==="others"?so(p,b):i==="right"?lo(p,b,y):ro(Z))},"applyBulk"),fe=r(i=>{T!==null&&(io(i,p,T.id).some(b=>Fe(b))?A(i):Ce(i,T.id))},"requestBulk"),it=r((i,b)=>{b.preventDefault(),A(null),R({id:i,x:b.clientX,y:b.clientY})},"openTabMenu"),at=r(()=>{R(null),A(null)},"closeTabMenu"),ct=r(i=>{i.preventDefault(),R(null),A(null)},"onBackdropContextMenu"),dt=r(()=>{fe("others")},"onCloseOthers"),ut=r(()=>{fe("right")},"onCloseToRight"),ft=r(()=>{fe("all")},"onCloseAll"),mt=r(()=>{T!==null&&O!==null&&Ce(O,T.id),A(null)},"confirmBulk"),pt=r(()=>{A(null)},"cancelBulk"),bt=T===null?void 0:{left:T.x,top:T.y},ht=r(i=>{ce(),g(i)},"selectTab"),vt=r((i,b)=>{v(C=>C.map(F=>F.id===i?{...F,name:b}:F))},"renameTab"),gt=r(()=>{J("results")},"showResults"),xt=r(()=>{V(ue("explain"))},"showExplain"),yt=r(()=>{J("chart")},"showChart"),Nt=L.split(`
|
|
4
4
|
`).length,St=r(i=>{c(i.target.value)},"onSearchChange"),me=r(i=>`border-b-2 px-3 py-2 text-sm outline-none transition-colors ${i?"border-foreground font-medium text-foreground":"border-transparent text-muted-foreground hover:text-foreground"}`,"tabClass");return(0,s.jsxDEV)("div",{className:"flex h-full min-w-0","data-testid":"lunora-sql-editor",children:[(0,s.jsxDEV)(jt,{activeId:D,history:a,listRef:B,onClearHistory:nt,onDelete:et,onLoadHistory:ot,onLoadTemplate:tt,onNew:Xe,onSearchChange:St,onSelect:Ze,queries:t,search:m},void 0,!1),(0,s.jsxDEV)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,s.jsxDEV)("div",{className:"flex shrink-0 items-stretch overflow-x-auto border-b border-border bg-muted/30","data-testid":"sql-tab-strip",role:"tablist",children:[p.map(i=>(0,s.jsxDEV)(fo,{active:i.id===I.id,canClose:p.length>1,onClose:rt,onMenu:it,onRename:vt,onSelect:ht,tab:i},i.id,!1)),(0,s.jsxDEV)("button",{"aria-label":o("New tab"),className:"flex size-8 shrink-0 items-center justify-center text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-40","data-testid":"sql-tab-add",disabled:p.length>=ye,onClick:lt,title:o("New tab"),type:"button",children:(0,s.jsxDEV)("svg",{"aria-hidden":"true",className:"size-4",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.7,viewBox:"0 0 24 24",children:(0,s.jsxDEV)("path",{d:"M12 5v14M5 12h14"},void 0,!1)},void 0,!1)},void 0,!1)]},void 0,!0),T!==null&&(0,s.jsxDEV)(s.Fragment,{children:[(0,s.jsxDEV)("div",{className:"fixed inset-0 z-40","data-testid":"sql-tab-menu-backdrop",onClick:at,onContextMenu:ct,role:"presentation"},void 0,!1),(0,s.jsxDEV)("div",{className:"fixed z-50 min-w-44 rounded-md border border-border bg-popover py-1 text-popover-foreground shadow-md","data-testid":"sql-tab-menu",role:"menu",style:bt,children:O===null?(0,s.jsxDEV)(s.Fragment,{children:[(0,s.jsxDEV)("button",{className:"flex w-full items-center px-3 py-1.5 text-start text-xs outline-none hover:bg-accent focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-40","data-testid":"sql-tab-menu-close-others",disabled:p.length<=1,onClick:dt,role:"menuitem",type:"button",children:o("Close other tabs")},void 0,!1),(0,s.jsxDEV)("button",{className:"flex w-full items-center px-3 py-1.5 text-start text-xs outline-none hover:bg-accent focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-40","data-testid":"sql-tab-menu-close-right",disabled:p.findIndex(i=>i.id===T.id)>=p.length-1,onClick:ut,role:"menuitem",type:"button",children:o("Close tabs to the right")},void 0,!1),(0,s.jsxDEV)("button",{className:"flex w-full items-center px-3 py-1.5 text-start text-xs outline-none hover:bg-accent focus-visible:bg-accent","data-testid":"sql-tab-menu-close-all",onClick:ft,role:"menuitem",type:"button",children:o("Close all tabs")},void 0,!1)]},void 0,!0):(0,s.jsxDEV)("div",{className:"px-3 py-1.5","data-testid":"sql-tab-menu-confirm",children:[(0,s.jsxDEV)("p",{className:"pb-1.5 text-xs text-muted-foreground",children:o("Discard unsaved tabs?")},void 0,!1),(0,s.jsxDEV)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsxDEV)("button",{className:"rounded px-2 py-1 text-xs font-medium text-destructive outline-none hover:bg-destructive/10 focus-visible:bg-destructive/10","data-testid":"sql-tab-menu-confirm-discard",onClick:mt,type:"button",children:o("Discard")},void 0,!1),(0,s.jsxDEV)("button",{className:"rounded px-2 py-1 text-xs text-muted-foreground outline-none hover:bg-accent focus-visible:bg-accent","data-testid":"sql-tab-menu-confirm-cancel",onClick:pt,type:"button",children:o("Cancel")},void 0,!1)]},void 0,!0)]},void 0,!0)},void 0,!1)]},void 0,!0),(0,s.jsxDEV)("div",{className:"flex min-h-0 flex-1",children:[(0,s.jsxDEV)("div",{"aria-hidden":"true",className:"shrink-0 select-none overflow-hidden border-e border-border bg-muted/30 py-3 text-end font-mono text-xs leading-5 text-muted-foreground/60",ref:M,style:go,children:Array.from({length:Nt},(i,b)=>(0,s.jsxDEV)("div",{children:b+1},b,!1))},void 0,!1),(0,s.jsxDEV)("div",{className:"relative min-w-0 flex-1",children:[(0,s.jsxDEV)("textarea",{"aria-activedescendant":Q===null?void 0:`${P}-opt-${Q.active.toString()}`,"aria-autocomplete":"list","aria-controls":Q===null?void 0:P,"aria-expanded":Q!==null,"aria-label":o("SQL query"),className:"size-full resize-none bg-background p-3 font-mono text-xs leading-5 outline-none","data-testid":"sql-input",onBlur:Qe,onChange:Ke,onKeyDown:Je,onScroll:Ve,onSelect:Ge,placeholder:"SELECT * FROM \u2026",ref:z,role:"combobox",spellCheck:!1,value:L},void 0,!1),(0,s.jsxDEV)(Ut,{listboxId:P,onPick:Ue,state:Q},void 0,!1)]},void 0,!0)]},void 0,!0),(0,s.jsxDEV)("div",{className:"flex h-2/5 min-h-0 shrink-0 flex-col border-t border-border",children:[(0,s.jsxDEV)("div",{className:"flex shrink-0 items-center gap-2 border-b border-border pe-2",children:[(0,s.jsxDEV)("button",{className:me(k==="results"),"data-testid":"sql-tab-results",onClick:gt,type:"button",children:o("Results")},void 0,!1),(0,s.jsxDEV)("button",{className:me(k==="chart"),"data-testid":"sql-tab-chart",onClick:yt,type:"button",children:o("Chart")},void 0,!1),(0,s.jsxDEV)("button",{className:me(k==="explain"),"data-testid":"sql-tab-explain",onClick:xt,type:"button",children:o("Explain")},void 0,!1),(0,s.jsxDEV)("div",{className:"ms-auto flex items-center gap-2",children:[E!==null&&E.columns.length>0&&(0,s.jsxDEV)(Me,{columns:E.columns,name:"query-result",rows:E.rows},void 0,!1),(0,s.jsxDEV)("button",{className:"inline-flex items-center rounded-md border border-border px-3 py-1.5 text-xs font-medium text-foreground outline-none transition-colors hover:bg-accent focus-visible:bg-accent disabled:pointer-events-none disabled:opacity-50","data-testid":"sql-format",disabled:h,onClick:st,type:"button",children:o("Format")},void 0,!1),(0,s.jsxDEV)(we,{onChange:S,testId:"sql-shard-input",value:x},void 0,!1),(0,s.jsxDEV)("button",{className:"inline-flex items-center gap-1.5 rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground outline-none transition-colors hover:bg-primary/90 focus-visible:bg-primary/90 disabled:pointer-events-none disabled:opacity-50","data-testid":"sql-run",disabled:h,onClick:je,type:"button",children:[o(h?"Running\u2026":"Run"),(0,s.jsxDEV)("kbd",{className:"rounded border border-primary-foreground/30 px-1 font-sans text-[10px]",children:"\u2318\u21B5"},void 0,!1)]},void 0,!0)]},void 0,!0)]},void 0,!0),(0,s.jsxDEV)("div",{className:"min-h-0 flex-1 overflow-auto",children:[$!==null&&(0,s.jsxDEV)(Ee,{className:"m-3 font-mono text-xs",testId:"sql-error",variant:"destructive",children:$},void 0,!1),$===null&&E===null&&(0,s.jsxDEV)("p",{className:"p-4 text-sm text-muted-foreground","data-testid":"sql-empty",children:o("Click Run to execute your query.")},void 0,!1),$===null&&E!==null&&(0,s.jsxDEV)("div",{"data-testid":"sql-result",children:[k==="chart"?(0,s.jsxDEV)(De,{result:E},void 0,!1):(0,s.jsxDEV)(xo,{result:E},void 0,!1),(0,s.jsxDEV)("p",{className:"border-t border-border px-3 py-1.5 text-xs text-muted-foreground","data-testid":"sql-count",children:E.truncated?o("Showing the first {max} of {count} rows.",{count:E.rowCount,max:E.rows.length}):o("{count} rows",{count:E.rowCount})},void 0,!1)]},void 0,!0)]},void 0,!0)]},void 0,!0)]},void 0,!0)]},void 0,!0)},"SqlEditorPanel");function yo(n){return(0,s.jsxDEV)(Le,{children:n},n,!1)}r(yo,"_temp");export{Oo as SqlEditorPanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as d,b as u}from"./chunk-
|
|
1
|
+
import{a as d,b as u}from"./chunk-DC72CQY4.js";import"./chunk-BJGBHGK3.js";import"./chunk-ZIGWVHCS.js";import"./chunk-KEGAWN6Y.js";import"./chunk-HV7G6DFP.js";import"./chunk-3OA7PECS.js";import"./chunk-GMSGZDDH.js";import{a as c,e as m,g as p,h as v}from"./chunk-RRCPZMC2.js";var h=m(p(),1);var o=m(v(),1);var y={value:{colors:{dark:["var(--foreground)"],light:["var(--foreground)"]},label:""}},g=c(n=>{let e=(0,h.c)(6),{data:i}=n,a,r;if(e[0]!==i){r=Symbol.for("react.early_return_sentinel");e:{let f=i.slice(-16);if(f.length<3){r=null;break e}a=f.map(_)}e[0]=i,e[1]=a,e[2]=r}else a=e[1],r=e[2];if(r!==Symbol.for("react.early_return_sentinel"))return r;let s=a,t;e[3]===Symbol.for("react.memo_cache_sentinel")?(t=(0,o.jsxDEV)(u,{dataKey:"value"},void 0,!1),e[3]=t):t=e[3];let l;return e[4]!==s?(l=(0,o.jsxDEV)("div",{"aria-hidden":"true",className:"h-8 w-28",children:(0,o.jsxDEV)(d,{animationType:"none",barCategoryGap:1,className:"h-8 w-full",config:y,data:s,children:t},void 0,!1)},void 0,!1),e[4]=s,e[5]=l):l=e[5],l},"Sparkline");function _(n,e){return{index:e,value:n}}c(_,"_temp");export{g as Sparkline};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as g,b as S}from"./chunk-
|
|
1
|
+
import{a as g,b as S}from"./chunk-DC72CQY4.js";import{a as i,e as m,g as v,h as C,j as d}from"./chunk-RRCPZMC2.js";var w=i(e=>{let t=0,n=0,o=0,r=0,s=0,l=0,c=0;for(let{metrics:a}of e){if(a===null){s+=1;continue}r+=1,t+=a.requests,n+=a.errors,o+=a.databaseSize??0,a.cache!==null&&(l+=a.cache.hits,c+=a.cache.hits+a.cache.misses)}return{failed:s,hitRate:c===0?null:l/c,reachable:r,totalDatabaseSize:o,totalErrors:n,totalRequests:t}},"aggregateMetrics"),E=i((e,t)=>{let n=new Set,o=[];for(let r of["",e.trim(),...t])n.has(r)||(n.add(r),o.push(r));return o},"shardsToAggregate"),x=i((e,t)=>{if(e.length===0)return 0;if(e.sort((o,r)=>o-r),t<=0)return e[0]??0;if(t>=100)return e.at(-1)??0;let n=Math.ceil(t/100*e.length)-1;return e[n]??0},"percentile"),N=i(e=>{let n=e.functions;if(!n||n.length===0)return{p90:0,p95:0};let o=1e3,r=[];for(let s of n){if(s.calls<=0)continue;let l=s.totalDurationMs/s.calls,c=Math.min(s.calls,o);for(let a=0;a<c;a+=1)r.push(l)}return r.length===0?{p90:0,p95:0}:{p90:x([...r],90),p95:x([...r],95)}},"computeLatencyPercentiles");var _=i(e=>e.map(t=>({...t,avgDurationMs:t.execCount>0?t.totalDurationMs/t.execCount:0})),"enrichQueryStats");var b=m(v(),1);var p=m(C(),1);var D={value:{colors:{dark:["var(--foreground)"],light:["var(--foreground)"]},label:""}},P=i(e=>{let t=(0,b.c)(12),{ariaLabel:n,className:o,series:r,testId:s}=e;if(r.length<2)return null;let l;t[0]!==r?(l=r.slice(-40).map(M),t[0]=r,t[1]=l):l=t[1];let c=l,a;t[2]!==o?(a=d("h-6 w-[120px]",o),t[2]=o,t[3]=a):a=t[3];let u;t[4]===Symbol.for("react.memo_cache_sentinel")?(u=(0,p.jsxDEV)(S,{dataKey:"value"},void 0,!1),t[4]=u):u=t[4];let f;t[5]!==c?(f=(0,p.jsxDEV)(g,{animationType:"none",barCategoryGap:1,className:"h-full w-full",config:D,data:c,children:u},void 0,!1),t[5]=c,t[6]=f):f=t[6];let h;return t[7]!==n||t[8]!==a||t[9]!==f||t[10]!==s?(h=(0,p.jsxDEV)("div",{"aria-label":n,className:a,"data-testid":s,role:"img",children:f},void 0,!1),t[7]=n,t[8]=a,t[9]=f,t[10]=s,t[11]=h):h=t[11],h},"Sparkline");function M(e,t){return{index:t,value:e}}i(M,"_temp");export{w as a,E as b,N as c,_ as d,P as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as k,b as j}from"./chunk-
|
|
1
|
+
import{a as k,b as j}from"./chunk-KJJ3WM6H.js";import{a as D}from"./chunk-WXPWVBIY.js";import{a as O}from"./chunk-2K47A3P6.js";import{a as V}from"./chunk-AJIUI7DD.js";import"./chunk-XNJNSCLM.js";import{a as _,b as z,c as B,d as f,e as l,f as n}from"./chunk-GTM65MVX.js";import{a as M}from"./chunk-K3GNLVYK.js";import"./chunk-TBMYIZIO.js";import{R as L}from"./chunk-3CJW6NWG.js";import"./chunk-O3NAGRTR.js";import"./chunk-HV7G6DFP.js";import{a as H}from"./chunk-BOXSWNXZ.js";import{a as I}from"./chunk-TAD43CG5.js";import{b as A}from"./chunk-DVKPRFIJ.js";import{a as y,e as E}from"./chunk-SEU5V7I6.js";import{b as T}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import"./chunk-X7MMBSNW.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{d as C,n as R}from"./chunk-PVZI3CXP.js";import"./chunk-GMSGZDDH.js";import{a as i,e as w,f as ee,h as te}from"./chunk-RRCPZMC2.js";var o=w(ee(),1);var e=w(te(),1);var K=80,ae=i(s=>{if(s===void 0)return"";let t=JSON.stringify(s);return t.length>K?`${t.slice(0,K)}\u2026`:t},"formatDetail"),re=41,F=480,U=5,oe=i((s,t)=>k(s,d=>{t(d.height>0?d:{height:F,width:d.width})}),"observeViewportRect"),Se=i(({initialShardKey:s})=>{let t=C(),[d,G]=(0,o.useState)(s??""),[m,W]=(0,o.useState)(""),q=O(d.trim(),400),{data:v,error:p,errorSource:J,isLoading:P,liveError:Q}=A(H.getAuditLog,{},{live:!0,shardKey:q}),u=(0,o.useMemo)(()=>v?.entries??[],[v]),c=(0,o.useMemo)(()=>{let r=m.trim().toLowerCase();return r===""?u:u.filter(a=>a.op.toLowerCase().includes(r)||(a.table??"").toLowerCase().includes(r)||(a.id??"").toLowerCase().includes(r))},[u,m]),g=(0,o.useRef)(null),x=j({count:c.length,estimateSize:i(()=>re,"estimateSize"),getScrollElement:i(()=>g.current,"getScrollElement"),initialRect:{height:F,width:800},observeElementRect:oe,overscan:8}),h=x.getVirtualItems(),X=x.getTotalSize(),S=h[0]?.start??0,b=X-(h.at(-1)?.end??0),Z={height:S},$={height:b},Y=i(r=>{W(r.target.value)},"onSearchChange");return(0,e.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"lunora-audit",children:[(0,e.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsxDEV)(M,{onChange:G,testId:"au-shard-input",value:d},void 0,!1),(0,e.jsxDEV)(D,{message:Q,prefix:"au"},void 0,!1),(0,e.jsxDEV)(L,{"aria-label":t("Filter audit log"),className:"h-8 w-48","data-testid":"au-search",onChange:Y,placeholder:t("filter op, table, id"),value:m},void 0,!1)]},void 0,!0),p!==null&&(0,e.jsxDEV)(V,{error:J,testId:"au-error"},void 0,!1),p===null&&!P&&c.length===0&&(0,e.jsxDEV)(I,{description:t("State-changing admin operations are recorded here."),icon:(0,e.jsxDEV)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,e.jsxDEV)("path",{d:"M8 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2h-2M9 3a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1h-4a1 1 0 0 1-1-1V3Zm-1 9h8m-8 4h5"},void 0,!1)},void 0,!1),testId:"au-empty",title:t("No audit entries.")},void 0,!1),c.length>0&&(0,e.jsxDEV)(y,{className:"overflow-hidden py-0",children:(0,e.jsxDEV)(E,{className:"max-h-[30rem] overflow-auto px-0",ref:g,children:(0,e.jsxDEV)(_,{"data-testid":"au-table",children:[(0,e.jsxDEV)(z,{children:(0,e.jsxDEV)(f,{children:[(0,e.jsxDEV)(l,{children:t("time")},void 0,!1),(0,e.jsxDEV)(l,{children:t("op")},void 0,!1),(0,e.jsxDEV)(l,{children:t("table")},void 0,!1),(0,e.jsxDEV)(l,{children:t("id")},void 0,!1),(0,e.jsxDEV)(l,{children:t("detail")},void 0,!1)]},void 0,!0)},void 0,!1),(0,e.jsxDEV)(B,{children:[S>0&&(0,e.jsxDEV)("tr",{"aria-hidden":"true",children:(0,e.jsxDEV)("td",{colSpan:U,style:Z},void 0,!1)},void 0,!1),h.map(r=>{let a=c[r.index],N=ae(a.detail);return(0,e.jsxDEV)(f,{"data-testid":"au-row",children:[(0,e.jsxDEV)(n,{className:"text-muted-foreground tabular-nums",children:R(a.ts,"\u2014")},void 0,!1),(0,e.jsxDEV)(n,{children:(0,e.jsxDEV)(T,{variant:"secondary",children:a.op},void 0,!1)},void 0,!1),(0,e.jsxDEV)(n,{className:"font-medium",children:a.table??(0,e.jsxDEV)("span",{className:"text-muted-foreground",children:"\u2014"},void 0,!1)},void 0,!1),(0,e.jsxDEV)(n,{className:"max-w-[20ch] truncate font-mono text-xs",children:a.id??(0,e.jsxDEV)("span",{className:"text-muted-foreground",children:"\u2014"},void 0,!1)},void 0,!1),(0,e.jsxDEV)(n,{className:"max-w-[32ch] truncate font-mono text-xs text-muted-foreground",title:N||void 0,children:N||(0,e.jsxDEV)("span",{className:"text-muted-foreground",children:"\u2014"},void 0,!1)},void 0,!1)]},a.seq,!0)}),b>0&&(0,e.jsxDEV)("tr",{"aria-hidden":"true",children:(0,e.jsxDEV)("td",{colSpan:U,style:$},void 0,!1)},void 0,!1)]},void 0,!0)]},void 0,!0)},void 0,!1)},void 0,!1)]},void 0,!0)},"AuditPanel");export{Se as AuditPanel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as ws}from"./chunk-KEGAWN6Y.js";import{a as xs}from"./chunk-HV7G6DFP.js";import{a as rt}from"./chunk-3OA7PECS.js";import{a as i,e as k,f as j}from"./chunk-RRCPZMC2.js";var Yo=k(j(),1),le=Yo.createContext(null);var Xo=k(j(),1);function D(t){let o=Xo.useContext(le);return(t?.warn??!0)&&!o&&console.warn("Warning: useRouter must be used inside a <RouterProvider> component!"),o}i(D,"useRouter");var Ke=k(j(),1),Mt=Ke.createContext(void 0),Zo=Ke.createContext(void 0);function pt(t){return t[t.length-1]}i(pt,"last");function _s(t){return typeof t=="function"}i(_s,"isFunction");function Y(t,o){return _s(t)?t(o):t}i(Y,"functionalUpdate");var rr=Object.prototype.hasOwnProperty,Qo=Object.prototype.propertyIsEnumerable;function mt(t){for(let o in t)if(rr.call(t,o))return!0;return!1}i(mt,"hasKeys");var Cs=i(()=>Object.create(null),"createNull"),gt=i((t,o)=>at(t,o,Cs),"nullReplaceEqualDeep");function at(t,o,e=()=>({}),s=0){if(!1)return o;if(t===o)return t;if(s>500)return o;let r=o,n=qe(t)&&qe(r);if(!n&&!(Xt(t)&&Xt(r)))return r;let a=n?t:tr(t);if(!a)return r;let f=n?r:tr(r);if(!f)return r;let u=a.length,d=f.length,l=n?new Array(d):e(),c=0;for(let p=0;p<d;p++){let h=n?p:f[p],m=t[h],y=r[h];if(m===y){l[h]=m,(n?p<u:rr.call(t,h))&&c++;continue}if(m===null||y===null||typeof m!="object"||typeof y!="object"){l[h]=y;continue}let g=at(m,y,e,s+1);l[h]=g,g===m&&c++}return u===d&&c===u?t:l}i(at,"replaceEqualDeep");function tr(t){let o=Object.getOwnPropertyNames(t);for(let r of o)if(!Qo.call(t,r))return!1;let e=Object.getOwnPropertySymbols(t);if(e.length===0)return o;let s=o;for(let r of e){if(!Qo.call(t,r))return!1;s.push(r)}return s}i(tr,"getEnumerableOwnKeys");function Xt(t){if(!er(t))return!1;let o=t.constructor;if(typeof o>"u")return!0;let e=o.prototype;return!(!er(e)||!e.hasOwnProperty("isPrototypeOf"))}i(Xt,"isPlainObject");function er(t){return Object.prototype.toString.call(t)==="[object Object]"}i(er,"hasObjectPrototype");function qe(t){return Array.isArray(t)&&t.length===Object.keys(t).length}i(qe,"isPlainArray");function st(t,o,e){if(t===o)return!0;if(typeof t!=typeof o)return!1;if(Array.isArray(t)&&Array.isArray(o)){if(t.length!==o.length)return!1;for(let s=0,r=t.length;s<r;s++)if(!st(t[s],o[s],e))return!1;return!0}if(Xt(t)&&Xt(o)){let s=e?.ignoreUndefined??!0;if(e?.partial){for(let a in o)if((!s||o[a]!==void 0)&&!st(t[a],o[a],e))return!1;return!0}let r=0;if(!s)r=Object.keys(t).length;else for(let a in t)t[a]!==void 0&&r++;let n=0;for(let a in o)if((!s||o[a]!==void 0)&&(n++,n>r||!st(t[a],o[a],e)))return!1;return r===n}return!1}i(st,"deepEqual");function ct(t){let o,e,s=new Promise((r,n)=>{o=r,e=n});return s.status="pending",s.resolve=r=>{s.status="resolved",s.value=r,o(r),t?.(r)},s.reject=r=>{s.status="rejected",e(r)},s}i(ct,"createControlledPromise");function vt(t){return!!(t&&typeof t=="object"&&typeof t.then=="function")}i(vt,"isPromise");function Ge(t,o){for(let e=t.length-1;e>=0;e--){let s=t[e];if(o(s))return s}}i(Ge,"findLast");var bs=/[\x00-\x1f\x7f"<>`{}]/g;function Ls(t){return t.replace(bs,o=>"%"+o.charCodeAt(0).toString(16).toUpperCase().padStart(2,"0"))}i(Ls,"sanitizePathSegment");function or(t){let o;try{o=decodeURI(t)}catch{o=t.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return Ls(o)}i(or,"decodeSegment");var Je=["http:","https:","mailto:","tel:"];function ut(t,o){if(!t)return!1;try{let e=new URL(t);return!o.has(e.protocol)}catch{return!1}}i(ut,"isDangerousProtocol");function Bt(t){if(!t)return{path:t,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(t)&&!t.startsWith("//"))return{path:t,handledProtocolRelativeURL:!1};let o=/%25|%5C/gi,e=0,s="",r;for(;(r=o.exec(t))!==null;)s+=or(t.slice(e,r.index))+r[0],e=o.lastIndex;s=s+or(e?t.slice(e):t);let n=!1;return s.startsWith("//")&&(n=!0,s="/"+s.replace(/^\/+/,"")),{path:s,handledProtocolRelativeURL:n}}i(Bt,"decodePath");function sr(t){return/\s|[^\u0000-\u007F]/.test(t)?t.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):t}i(sr,"encodePathLikeUrl");function nr(t,o){if(t===o)return!0;if(t.length!==o.length)return!1;for(let e=0;e<t.length;e++)if(t[e]!==o[e])return!1;return!0}i(nr,"arraysEqual");function $(){throw new Error("Invariant failed")}i($,"invariant");function yt(t){let o=new Map,e,s,r=i(n=>{n.next&&(n.prev?(n.prev.next=n.next,n.next.prev=n.prev,n.next=void 0,s&&(s.next=n,n.prev=s)):(n.next.prev=void 0,e=n.next,n.next=void 0,s&&(n.prev=s,s.next=n)),s=n)},"touch");return{get(n){let a=o.get(n);if(a)return r(a),a.value},set(n,a){if(o.size>=t&&e){let u=e;o.delete(u.key),u.next&&(e=u.next,u.next.prev=void 0),u===s&&(s=void 0)}let f=o.get(n);if(f)f.value=a,r(f);else{let u={key:n,value:a,prev:s};s&&(s.next=u),s=u,e||(e=u),o.set(n,u)}},clear(){o.clear(),e=void 0,s=void 0}}}i(yt,"createLRUCache");var St=4,ar=5;function Ms(t){let o=t.indexOf("{");if(o===-1)return null;let e=t.indexOf("}",o);return e===-1||o+1>=t.length?null:[o,e]}i(Ms,"getOpenAndCloseBraces");function Ze(t,o,e=new Uint16Array(6)){let s=t.indexOf("/",o),r=s===-1?t.length:s,n=t.substring(o,r);if(!n||!n.includes("$"))return e[0]=0,e[1]=o,e[2]=o,e[3]=r,e[4]=r,e[5]=r,e;if(n==="$"){let f=t.length;return e[0]=2,e[1]=o,e[2]=o,e[3]=f,e[4]=f,e[5]=f,e}if(n.charCodeAt(0)===36)return e[0]=1,e[1]=o,e[2]=o+1,e[3]=r,e[4]=r,e[5]=r,e;let a=Ms(n);if(a){let[f,u]=a,d=n.charCodeAt(f+1);if(d===45){if(f+2<n.length&&n.charCodeAt(f+2)===36){let l=f+3,c=u;if(l<c)return e[0]=3,e[1]=o+f,e[2]=o+l,e[3]=o+c,e[4]=o+u+1,e[5]=r,e}}else if(d===36){let l=f+1,c=f+2;return c===u?(e[0]=2,e[1]=o+f,e[2]=o+l,e[3]=o+c,e[4]=o+u+1,e[5]=t.length,e):(e[0]=1,e[1]=o+f,e[2]=o+c,e[3]=o+u,e[4]=o+u+1,e[5]=r,e)}}return e[0]=0,e[1]=o,e[2]=o,e[3]=r,e[4]=r,e[5]=r,e}i(Ze,"parseSegment");function he(t,o,e,s,r,n,a){a?.(e);let f=s;{let u=e.fullPath??e.from,d=u.length,l=e.options?.caseSensitive??t,c=e.options?.params?.parse??e.options?.parseParams;for(;f<d;){let h=Ze(u,f,o),m,y=f,g=h[5];switch(f=g+1,n++,h[0]){case 0:{let v=u.substring(h[2],h[3]);if(l){let R=r.static?.get(v);if(R)m=R;else{r.static??=new Map;let S=It(e.fullPath??e.from);S.parent=r,S.depth=n,m=S,r.static.set(v,S)}}else{let R=v.toLowerCase(),S=r.staticInsensitive?.get(R);if(S)m=S;else{r.staticInsensitive??=new Map;let P=It(e.fullPath??e.from);P.parent=r,P.depth=n,m=P,r.staticInsensitive.set(R,P)}}break}case 1:{let v=u.substring(y,h[1]),R=u.substring(h[4],g),S=l&&!!(v||R),P=v?S?v:v.toLowerCase():void 0,_=R?S?R:R.toLowerCase():void 0,b=!c&&r.dynamic?.find(x=>!x.parse&&x.caseSensitive===S&&x.prefix===P&&x.suffix===_);if(b)m=b;else{let x=Xe(1,e.fullPath??e.from,S,P,_);m=x,x.depth=n,x.parent=r,r.dynamic??=[],r.dynamic.push(x)}break}case 3:{let v=u.substring(y,h[1]),R=u.substring(h[4],g),S=l&&!!(v||R),P=v?S?v:v.toLowerCase():void 0,_=R?S?R:R.toLowerCase():void 0,b=!c&&r.optional?.find(x=>!x.parse&&x.caseSensitive===S&&x.prefix===P&&x.suffix===_);if(b)m=b;else{let x=Xe(3,e.fullPath??e.from,S,P,_);m=x,x.parent=r,x.depth=n,r.optional??=[],r.optional.push(x)}break}case 2:{let v=u.substring(y,h[1]),R=u.substring(h[4],g),S=l&&!!(v||R),P=v?S?v:v.toLowerCase():void 0,_=R?S?R:R.toLowerCase():void 0,b=Xe(2,e.fullPath??e.from,S,P,_);m=b,b.parent=r,b.depth=n,r.wildcard??=[],r.wildcard.push(b)}}r=m}if(c&&e.children&&!e.isRoot&&e.id&&e.id.charCodeAt(e.id.lastIndexOf("/")+1)===95){let h=It(e.fullPath??e.from);h.kind=ar,h.parent=r,n++,h.depth=n,r.pathless??=[],r.pathless.push(h),r=h}let p=(e.path||!e.children)&&!e.isRoot;if(p&&u.endsWith("/")){let h=It(e.fullPath??e.from);h.kind=St,h.parent=r,n++,h.depth=n,r.index=h,r=h}r.parse=c??null,r.priority=e.options?.params?.priority??0,p&&!r.route&&(r.route=e,r.fullPath=e.fullPath??e.from)}if(e.children)for(let u of e.children)he(t,o,u,f,r,n,a)}i(he,"parseSegments");function Ye(t,o){if(t.parse&&!o.parse)return-1;if(!t.parse&&o.parse)return 1;if(t.parse&&o.parse&&(t.priority||o.priority))return o.priority-t.priority;if(t.prefix&&o.prefix&&t.prefix!==o.prefix){if(t.prefix.startsWith(o.prefix))return-1;if(o.prefix.startsWith(t.prefix))return 1}if(t.suffix&&o.suffix&&t.suffix!==o.suffix){if(t.suffix.endsWith(o.suffix))return-1;if(o.suffix.endsWith(t.suffix))return 1}return t.prefix&&!o.prefix?-1:!t.prefix&&o.prefix?1:t.suffix&&!o.suffix?-1:!t.suffix&&o.suffix?1:t.caseSensitive&&!o.caseSensitive?-1:!t.caseSensitive&&o.caseSensitive?1:0}i(Ye,"sortDynamic");function Rt(t){if(t.pathless)for(let o of t.pathless)Rt(o);if(t.static)for(let o of t.static.values())Rt(o);if(t.staticInsensitive)for(let o of t.staticInsensitive.values())Rt(o);if(t.dynamic?.length){t.dynamic.sort(Ye);for(let o of t.dynamic)Rt(o)}if(t.optional?.length){t.optional.sort(Ye);for(let o of t.optional)Rt(o)}if(t.wildcard?.length){t.wildcard.sort(Ye);for(let o of t.wildcard)Rt(o)}}i(Rt,"sortTreeNodes");function It(t){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0}}i(It,"createStaticNode");function Xe(t,o,e,s,r){return{kind:t,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:o,parent:null,parse:null,priority:0,caseSensitive:e,prefix:s,suffix:r}}i(Xe,"createDynamicNode");function cr(t,o){let e=It("/"),s=new Uint16Array(6);for(let r of t)he(!1,s,r,1,e,0);Rt(e),o.masksTree=e,o.flatCache=yt(1e3)}i(cr,"processRouteMasks");function ur(t,o){t||="/";let e=o.flatCache.get(t);if(e)return e;let s=Qe(t,o.masksTree);return o.flatCache.set(t,s),s}i(ur,"findFlatMatch");function lr(t,o,e,s,r){t||="/",s||="/";let n=o?`case\0${t}`:t,a=r.singleCache.get(n);return a||(a=It("/"),he(o,new Uint16Array(6),{from:t},1,a,0),r.singleCache.set(n,a)),Qe(s,a,e)}i(lr,"findSingleMatch");function fr(t,o,e=!1){let s=e?t:`nofuzz\0${t}`,r=o.matchCache.get(s);if(r!==void 0)return r;t||="/";let n;try{n=Qe(t,o.segmentTree,e)}catch(a){if(a instanceof URIError)n=null;else throw a}return n&&(n.branch=to(n.route)),o.matchCache.set(s,n),n}i(fr,"findRouteMatch");function Is(t){return t==="/"?t:t.replace(/\/{1,}$/,"")}i(Is,"trimPathRight");function dr(t,o=!1,e){let s=It(t.fullPath),r=new Uint16Array(6),n={},a={},f=0;return he(o,r,t,1,s,0,u=>{if(e?.(u,f),u.id in n)throw new Error(`Invariant failed: Duplicate routes found with id: ${String(u.id)}`);if(n[u.id]=u,f!==0&&u.path){let d=Is(u.fullPath);(!a[d]||u.fullPath.endsWith("/"))&&(a[d]=u)}f++}),Rt(s),{processedTree:{segmentTree:s,singleCache:yt(1e3),matchCache:yt(1e3),flatCache:null,masksTree:null},routesById:n,routesByPath:a}}i(dr,"processRouteTree");function Qe(t,o,e=!1){let s=t.split("/"),r=ks(t,s,o,e);if(!r)return null;let[n]=hr(t,s,r);return{route:r.node.route,rawParams:n}}i(Qe,"findMatch");function hr(t,o,e){let s=Es(e.node),r=null,n=Object.create(null),a=e.extract?.part??0,f=e.extract?.node??0,u=e.extract?.path??0,d=e.extract?.segment??0;for(;f<s.length;a++,f++,u++,d++){let l=s[f];if(l.kind===St)break;if(l.kind===ar){d--,a--,u--;continue}let c=o[a],p=u;if(c&&(u+=c.length),l.kind===1){r??=e.node.fullPath.split("/");let h=r[d],m=l.prefix?.length??0;if(h.charCodeAt(m)===123){let y=l.suffix?.length??0,g=h.substring(m+2,h.length-y-1),v=c.substring(m,c.length-y);n[g]=decodeURIComponent(v)}else{let y=h.substring(1);n[y]=decodeURIComponent(c)}}else if(l.kind===3){if(e.skipped&1<<f){a--,u=p-1;continue}r??=e.node.fullPath.split("/");let h=r[d],m=l.prefix?.length??0,y=l.suffix?.length??0,g=h.substring(m+3,h.length-y-1),v=l.suffix||l.prefix?c.substring(m,c.length-y):c;v&&(n[g]=decodeURIComponent(v))}else if(l.kind===2){let h=l,m=t.substring(p+(h.prefix?.length??0),t.length-(h.suffix?.length??0)),y=decodeURIComponent(m);n["*"]=y,n._splat=y;break}}return e.rawParams&&Object.assign(n,e.rawParams),[n,{part:a,node:f,path:u,segment:d}]}i(hr,"extractParams");function to(t){let o=[t];for(;t.parentRoute;)t=t.parentRoute,o.push(t);return o.reverse(),o}i(to,"buildRouteBranch");function Es(t){let o=Array(t.depth+1);do o[t.depth]=t,t=t.parent;while(t);return o}i(Es,"buildBranch");function ks(t,o,e,s){if(t==="/"&&e.index)return{node:e.index,skipped:0};let r=!pt(o),n=r&&t!=="/",a=o.length-(r?1:0),f=[{node:e,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}],u=null,d=null;for(;f.length;){let l=f.pop(),{node:c,index:p,skipped:h,depth:m,statics:y,dynamics:g,optionals:v}=l,{extract:R,rawParams:S}=l;if(c.kind===2&&c.route&&!de(d,l))continue;if(c.parse){if(!ir(t,o,l))continue;S=l.rawParams,R=l.extract}s&&c.route&&c.kind!==St&&de(u,l)&&(u=l);let P=p===a;if(P&&(c.route&&(!n||c.kind===St||c.kind===2)&&de(d,l)&&(d=l),!c.optional&&!c.wildcard&&!c.index&&!c.pathless))continue;let _=P?void 0:o[p],b;if(P&&c.index){let x={node:c.index,index:p,skipped:h,depth:m+1,statics:y,dynamics:g,optionals:v,extract:R,rawParams:S},w=!0;if(c.index.parse&&(ir(t,o,x)||(w=!1)),w){if(!g&&!v&&!h&&Ts(y,a))return x;de(d,x)&&(d=x)}}if(c.wildcard)for(let x=c.wildcard.length-1;x>=0;x--){let w=c.wildcard[x],{prefix:C,suffix:I}=w;if(!(C&&(P||!(w.caseSensitive?_:b??=_.toLowerCase()).startsWith(C)))){if(I){if(P)continue;let L=o.slice(p).join("/").slice(-I.length);if((w.caseSensitive?L:L.toLowerCase())!==I)continue}f.push({node:w,index:a,skipped:h,depth:m+1,statics:y,dynamics:g,optionals:v,extract:R,rawParams:S})}}if(c.optional){let x=h|1<<m,w=m+1;for(let C=c.optional.length-1;C>=0;C--){let I=c.optional[C];f.push({node:I,index:p,skipped:x,depth:w,statics:y,dynamics:g,optionals:v,extract:R,rawParams:S})}if(!P)for(let C=c.optional.length-1;C>=0;C--){let I=c.optional[C],{prefix:L,suffix:M}=I;if(L||M){let et=I.caseSensitive?_:b??=_.toLowerCase();if(L&&!et.startsWith(L)||M&&!et.endsWith(M))continue}f.push({node:I,index:p+1,skipped:h,depth:w,statics:y,dynamics:g,optionals:v+fe(a,p),extract:R,rawParams:S})}}if(!P&&c.dynamic&&_)for(let x=c.dynamic.length-1;x>=0;x--){let w=c.dynamic[x],{prefix:C,suffix:I}=w;if(C||I){let L=w.caseSensitive?_:b??=_.toLowerCase();if(C&&!L.startsWith(C)||I&&!L.endsWith(I))continue}f.push({node:w,index:p+1,skipped:h,depth:m+1,statics:y,dynamics:g+fe(a,p),optionals:v,extract:R,rawParams:S})}if(!P&&c.staticInsensitive){let x=c.staticInsensitive.get(b??=_.toLowerCase());x&&f.push({node:x,index:p+1,skipped:h,depth:m+1,statics:y+fe(a,p),dynamics:g,optionals:v,extract:R,rawParams:S})}if(!P&&c.static){let x=c.static.get(_);x&&f.push({node:x,index:p+1,skipped:h,depth:m+1,statics:y+fe(a,p),dynamics:g,optionals:v,extract:R,rawParams:S})}if(c.pathless){let x=m+1;for(let w=c.pathless.length-1;w>=0;w--){let C=c.pathless[w];f.push({node:C,index:p,skipped:h,depth:x,statics:y,dynamics:g,optionals:v,extract:R,rawParams:S})}}}if(d)return d;if(s&&u){let l=u.index;for(let p=0;p<u.index;p++)l+=o[p].length;let c=l===t.length?"/":t.slice(l);return u.rawParams??=Object.create(null),u.rawParams["**"]=decodeURIComponent(c),u}return null}i(ks,"getNodeMatch");function fe(t,o){return 2**(t-o-1)}i(fe,"segmentScore");function Ts(t,o){return t===2**(o-1)-1}i(Ts,"isPerfectStaticMatch");function ir(t,o,e){let s,r;try{[s,r]=hr(t,o,e)}catch{return null}if(e.rawParams=s,e.extract=r,!e.node.parse)return!0;try{if(e.node.parse(s)===!1)return null}catch{}return!0}i(ir,"validateParseParams");function de(t,o){return t?o.statics>t.statics||o.statics===t.statics&&(o.dynamics>t.dynamics||o.dynamics===t.dynamics&&(o.optionals>t.optionals||o.optionals===t.optionals&&((o.node.kind===St)>(t.node.kind===St)||o.node.kind===St==(t.node.kind===St)&&o.depth>t.depth))):!0}i(de,"isFrameMoreSpecific");function Et(t){return Qt(t.filter(o=>o!==void 0).join("/"))}i(Et,"joinPaths");function Qt(t){return t.replace(/\/{2,}/g,"/")}i(Qt,"cleanPath");function pe(t){return t==="/"?t:t.replace(/^\/{1,}/,"")}i(pe,"trimPathLeft");function Q(t){let o=t.length;return o>1&&t[o-1]==="/"?t.replace(/\/{1,}$/,""):t}i(Q,"trimPathRight");function te(t){return Q(pe(t))}i(te,"trimPath");function Pt(t,o){return t?.endsWith("/")&&t!=="/"&&t!==`${o}/`?t.slice(0,-1):t}i(Pt,"removeTrailingSlash");function me(t,o,e){return Pt(t,e)===Pt(o,e)}i(me,"exactPathTest");function eo({base:t,to:o,trailingSlash:e="never",cache:s}){let r=o.startsWith("/"),n=!r&&o===".",a;if(s){a=r?o:n?t:t+"\0"+o;let d=s.get(a);if(d)return d}let f;if(n)f=t.split("/");else if(r)f=o.split("/");else{for(f=t.split("/");f.length>1&&pt(f)==="";)f.pop();let d=o.split("/");for(let l=0,c=d.length;l<c;l++){let p=d[l];p===""?l?l===c-1&&f.push(p):f=[p]:p===".."?f.pop():p==="."||f.push(p)}}f.length>1&&(pt(f)===""?e==="never"&&f.pop():e==="always"&&f.push(""));let u=Qt(f.join("/"))||"/";return a&&s&&s.set(a,u),u}i(eo,"resolvePath");function mr(t){let o=new Map(t.map(r=>[encodeURIComponent(r),r])),e=Array.from(o.keys()).map(r=>r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),s=new RegExp(e,"g");return r=>r.replace(s,n=>o.get(n)??n)}i(mr,"compileDecodeCharMap");function Zt(t,o,e){let s=o[t];return typeof s!="string"?s:t==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(s)?s:s.split("/").map(r=>pr(r,e)).join("/"):pr(s,e)}i(Zt,"encodeParam");function ge({path:t,params:o,decoder:e,...s}){let r=!1,n=Object.create(null);if(!t||t==="/")return{interpolatedPath:"/",usedParams:n,isMissingParams:r};if(!t.includes("$"))return{interpolatedPath:t,usedParams:n,isMissingParams:r};if(!1){let l=t.length,c=0,p="";for(;c<l;){for(;c<l&&t.charCodeAt(c)===47;)c++;if(c>=l)break;let h=c,m=t.indexOf("/",c);m===-1&&(m=l),c=m;let y=t.substring(h,m);if(y)if(y.charCodeAt(0)===36)if(y.length===1){let g=o._splat;if(n._splat=g,n["*"]=g,!g){r=!0;continue}let v=Zt("_splat",o,e);p+="/"+v}else{let g=y.substring(1);!r&&!(g in o)&&(r=!0),n[g]=o[g];let v=Zt(g,o,e)??"undefined";p+="/"+v}else p+="/"+y}return t.endsWith("/")&&(p+="/"),{usedParams:n,interpolatedPath:p||"/",isMissingParams:r}}let a=t.length,f=0,u,d="";for(;f<a;){let l=f;u=Ze(t,l,u);let c=u[5];if(f=c+1,l===c)continue;let p=u[0];if(p===0){d+="/"+t.substring(l,c);continue}if(p===2){let h=o._splat;n._splat=h,n["*"]=h;let m=t.substring(l,u[1]),y=t.substring(u[4],c);if(!h){r=!0,(m||y)&&(d+="/"+m+y);continue}let g=Zt("_splat",o,e);d+="/"+m+g+y;continue}if(p===1){let h=t.substring(u[2],u[3]);!r&&!(h in o)&&(r=!0),n[h]=o[h];let m=t.substring(l,u[1]),y=t.substring(u[4],c),g=Zt(h,o,e)??"undefined";d+="/"+m+g+y;continue}if(p===3){let h=t.substring(u[2],u[3]),m=o[h];if(m==null)continue;n[h]=m;let y=t.substring(l,u[1]),g=t.substring(u[4],c),v=Zt(h,o,e)??"";d+="/"+y+v+g;continue}}return t.endsWith("/")&&(d+="/"),{usedParams:n,interpolatedPath:d||"/",isMissingParams:r}}i(ge,"interpolatePath");function pr(t,o){let e=encodeURIComponent(t);return o?.(e)??e}i(pr,"encodePathParam");function A(t){return t?.isNotFound===!0}i(A,"isNotFound");function gr(t,o=String){let e=new URLSearchParams;for(let s in t){let r=t[s];r!==void 0&&e.set(s,o(r))}return e.toString()}i(gr,"encode");function oo(t){return t?t==="false"?!1:t==="true"?!0:+t*0===0&&+t+""===t?+t:t:""}i(oo,"toValue");function vr(t){let o=new URLSearchParams(t),e=Object.create(null);for(let[s,r]of o.entries()){let n=e[s];n==null?e[s]=oo(r):Array.isArray(n)?n.push(oo(r)):e[s]=[n,oo(r)]}return e}i(vr,"decode");var yr=Os(JSON.parse),Rr=Ns(JSON.stringify,JSON.parse);function Os(t){return o=>{o[0]==="?"&&(o=o.substring(1));let e=vr(o);for(let s in e){let r=e[s];if(typeof r=="string")try{e[s]=t(r)}catch{}}return e}}i(Os,"parseSearchWith");function Ns(t,o){let e=typeof o=="function";function s(r){if(typeof r=="object"&&r!==null)try{return t(r)}catch{}else if(e&&typeof r=="string")try{return o(r),t(r)}catch{}return r}return i(s,"stringifyValue"),r=>{let n=gr(r,s);return n?`?${n}`:""}}i(Ns,"stringifySearchWith");var X="__root__";function $t(t){if(t.statusCode=t.statusCode||t.code||307,!t._builtLocation&&!t.reloadDocument&&typeof t.href=="string")try{new URL(t.href),t.reloadDocument=!0}catch{}let o=new Headers(t.headers);t.href&&o.get("Location")===null&&o.set("Location",t.href);let e=new Response(null,{status:t.statusCode,headers:o});if(e.options=t,t.throw)throw e;return e}i($t,"redirect");function H(t){return t instanceof Response&&!!t.options}i(H,"isRedirect");var ro=i(t=>{if(!t.rendered)return t.rendered=!0,t.onReady?.()},"triggerOnReady"),Ds=i(t=>t.stores.matchesId.get().some(o=>t.stores.matchStores.get(o)?.get()._forcePending),"hasForcePendingActiveMatch"),Re=i((t,o)=>!!(t.preload&&!t.router.stores.matchStores.has(o)),"resolvePreload"),kt=i((t,o,e=!0)=>{let s={...t.router.options.context??{}},r=e?o:o-1;for(let n=0;n<=r;n++){let a=t.matches[n];if(!a)continue;let f=t.router.getMatch(a.id);f&&Object.assign(s,f.__routeContext,f.__beforeLoadContext)}return s},"buildMatchContext"),Sr=i((t,o)=>{if(!t.matches.length)return;let e=o.routeId,s=t.matches.findIndex(a=>a.routeId===t.router.routeTree.id),r=s>=0?s:0,n=e?t.matches.findIndex(a=>a.routeId===e):t.firstBadMatchIndex??t.matches.length-1;n<0&&(n=r);for(let a=n;a>=0;a--){let f=t.matches[a];if(t.router.looseRoutesById[f.routeId].options.notFoundComponent)return a}return e?n:r},"getNotFoundBoundaryIndex"),xt=i((t,o,e)=>{if(!(!H(e)&&!A(e)))throw H(e)&&e.redirectHandled&&!e.options.reloadDocument||(o&&(o._nonReactive.beforeLoadPromise?.resolve(),o._nonReactive.loaderPromise?.resolve(),o._nonReactive.beforeLoadPromise=void 0,o._nonReactive.loaderPromise=void 0,o._nonReactive.error=e,t.updateMatch(o.id,s=>({...s,status:H(e)?"redirected":A(e)?"notFound":s.status==="pending"?"success":s.status,context:kt(t,o.index),isFetching:!1,error:e})),A(e)&&!e.routeId&&(e.routeId=o.routeId),o._nonReactive.loadPromise?.resolve()),H(e)&&(t.rendered=!0,e.options._fromLocation=t.location,e.redirectHandled=!0,e=t.router.resolveRedirect(e))),e},"handleRedirectAndNotFound"),_r=i((t,o)=>{let e=t.router.getMatch(o);return!!(!e||!!1&&e._nonReactive.dehydrated||!1)},"shouldSkipLoader"),Pr=i((t,o,e)=>{let s=kt(t,e);t.updateMatch(o,r=>({...r,context:s}))},"syncMatchContext"),ee=i((t,o,e)=>{let{id:s,routeId:r}=t.matches[o],n=t.router.looseRoutesById[r];if(e instanceof Promise)throw e;t.firstBadMatchIndex??=o,xt(t,t.router.getMatch(s),e);try{n.options.onError?.(e)}catch(a){e=a,xt(t,t.router.getMatch(s),e)}t.updateMatch(s,a=>(a._nonReactive.beforeLoadPromise?.resolve(),a._nonReactive.beforeLoadPromise=void 0,a._nonReactive.loadPromise?.resolve(),{...a,error:e,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!t.preload&&!H(e)&&!A(e)&&(t.serialError??=e)},"handleSerialError"),Fs=i((t,o,e,s)=>{let r=t.router.getMatch(o),n=t.matches[e-1]?.id,a=n?t.router.getMatch(n):void 0;if(t.router.isShell()){r.ssr=s.id===X;return}if(a?.ssr===!1){r.ssr=!1;return}let f=i(h=>h===!0&&a?.ssr==="data-only"?"data-only":h,"parentOverride"),u=t.router.options.defaultSsr??!0;if(s.options.ssr===void 0){r.ssr=f(u);return}if(typeof s.options.ssr!="function"){r.ssr=f(s.options.ssr);return}let{search:d,params:l}=r,c={search:ve(d,r.searchError),params:ve(l,r.paramsError),location:t.location,matches:t.matches.map(h=>({index:h.index,pathname:h.pathname,fullPath:h.fullPath,staticData:h.staticData,id:h.id,routeId:h.routeId,search:ve(h.search,h.searchError),params:ve(h.params,h.paramsError),ssr:h.ssr}))},p=s.options.ssr(c);if(vt(p))return p.then(h=>{r.ssr=f(h??u)});r.ssr=f(p??u)},"isBeforeLoadSsr"),Cr=i((t,o,e,s)=>{if(s._nonReactive.pendingTimeout!==void 0)return;let r=e.options.pendingMs??t.router.options.defaultPendingMs;if(t.onReady&&!!1&&!Re(t,o)&&(e.options.loader||e.options.beforeLoad||no(e))&&typeof r=="number"&&r!==1/0&&(e.options.pendingComponent??t.router.options?.defaultPendingComponent)){let n=setTimeout(()=>{ro(t)},r);s._nonReactive.pendingTimeout=n}},"setupPendingTimeout"),As=i((t,o,e)=>{let s=t.router.getMatch(o);if(!s._nonReactive.beforeLoadPromise&&!s._nonReactive.loaderPromise)return;Cr(t,o,e,s);let r=i(()=>{let n=t.router.getMatch(o);n.preload&&(n.status==="redirected"||n.status==="notFound")&&xt(t,n,n.error)},"then");return s._nonReactive.beforeLoadPromise?s._nonReactive.beforeLoadPromise.then(r):r()},"preBeforeLoadSetup"),Bs=i((t,o,e,s)=>{let r=t.router.getMatch(o),n=r._nonReactive.loadPromise;r._nonReactive.loadPromise=ct(()=>{n?.resolve(),n=void 0});let{paramsError:a,searchError:f}=r;a&&ee(t,e,a),f&&ee(t,e,f),Cr(t,o,s,r);let u=new AbortController,d=!1,l=i(()=>{d||(d=!0,t.updateMatch(o,P=>({...P,isFetching:"beforeLoad",fetchCount:P.fetchCount+1,abortController:u})))},"pending"),c=i(()=>{r._nonReactive.beforeLoadPromise?.resolve(),r._nonReactive.beforeLoadPromise=void 0,t.updateMatch(o,P=>({...P,isFetching:!1}))},"resolve");if(!s.options.beforeLoad){t.router.batch(()=>{l(),c()});return}r._nonReactive.beforeLoadPromise=ct();let p={...kt(t,e,!1),...r.__routeContext},{search:h,params:m,cause:y}=r,g=Re(t,o),v={search:h,abortController:u,params:m,preload:g,context:p,location:t.location,navigate:i(P=>t.router.navigate({...P,_fromLocation:t.location}),"navigate"),buildLocation:t.router.buildLocation,cause:g?"preload":y,matches:t.matches,routeId:s.id,...t.router.options.additionalContext},R=i(P=>{if(P===void 0){t.router.batch(()=>{l(),c()});return}(H(P)||A(P))&&(l(),ee(t,e,P)),t.router.batch(()=>{l(),t.updateMatch(o,_=>({..._,__beforeLoadContext:P})),c()})},"updateContext"),S;try{if(S=s.options.beforeLoad(v),vt(S))return l(),S.catch(P=>{ee(t,e,P)}).then(R)}catch(P){l(),ee(t,e,P)}R(S)},"executeBeforeLoad"),$s=i((t,o)=>{let{id:e,routeId:s}=t.matches[o],r=t.router.looseRoutesById[s],n=i(()=>{if(!1){let u=Fs(t,e,o,r);if(vt(u))return u.then(f)}return f()},"serverSsr"),a=i(()=>Bs(t,e,o,r),"execute"),f=i(()=>{if(_r(t,e))return;let u=As(t,e,r);return vt(u)?u.then(a):a()},"queueExecution");return n()},"handleBeforeLoad"),Us=i((t,o,e)=>{let s=t.router.getMatch(o);if(!s||!e.options.head&&!e.options.scripts&&!e.options.headers)return;let r={ssr:t.router.options.ssr,matches:t.matches,match:s,params:s.params,loaderData:s.loaderData};return Promise.all([e.options.head?.(r),e.options.scripts?.(r),e.options.headers?.(r)]).then(([n,a,f])=>({meta:n?.meta,links:n?.links,headScripts:n?.scripts,headers:f,scripts:a,styles:n?.styles}))},"executeHead"),br=i((t,o,e,s,r)=>{let n=o[s-1],{params:a,loaderDeps:f,abortController:u,cause:d}=t.router.getMatch(e),l=kt(t,s),c=Re(t,e);return{params:a,deps:f,preload:!!c,parentMatchPromise:n,abortController:u,context:l,location:t.location,navigate:i(p=>t.router.navigate({...p,_fromLocation:t.location}),"navigate"),cause:c?"preload":d,route:r,...t.router.options.additionalContext}},"getLoaderContext"),xr=i(async(t,o,e,s,r)=>{try{let n=t.router.getMatch(e);try{(!!1||n.ssr===!0)&&Ut(r);let a=r.options.loader,f=typeof a=="function"?a:a?.handler,u=f?.(br(t,o,e,s,r)),d=!!f&&vt(u);if((d||r._lazyPromise||r._componentsPromise||r.options.head||r.options.scripts||r.options.headers||n._nonReactive.minPendingPromise)&&t.updateMatch(e,c=>({...c,isFetching:"loader"})),f){let c=d?await u:u;xt(t,t.router.getMatch(e),c),c!==void 0&&t.updateMatch(e,p=>({...p,loaderData:c}))}r._lazyPromise&&await r._lazyPromise;let l=n._nonReactive.minPendingPromise;l&&await l,r._componentsPromise&&await r._componentsPromise,t.updateMatch(e,c=>({...c,error:void 0,context:kt(t,s),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(a){let f=a;if(f?.name==="AbortError"){if(n.abortController.signal.aborted){n._nonReactive.loaderPromise?.resolve(),n._nonReactive.loaderPromise=void 0;return}t.updateMatch(e,d=>({...d,status:d.status==="pending"?"success":d.status,isFetching:!1,context:kt(t,s)}));return}let u=n._nonReactive.minPendingPromise;u&&await u,A(a)&&await r.options.notFoundComponent?.preload?.(),xt(t,t.router.getMatch(e),a);try{r.options.onError?.(a)}catch(d){f=d,xt(t,t.router.getMatch(e),d)}!H(f)&&!A(f)&&await Ut(r,["errorComponent"]),t.updateMatch(e,d=>({...d,error:f,context:kt(t,s),status:"error",isFetching:!1}))}}catch(n){let a=t.router.getMatch(e);a&&(a._nonReactive.loaderPromise=void 0),xt(t,a,n)}},"runLoader"),Hs=i(async(t,o,e)=>{async function s(h,m,y,g,v){let R=Date.now()-m.updatedAt,S=h?v.options.preloadStaleTime??t.router.options.defaultPreloadStaleTime??3e4:v.options.staleTime??t.router.options.defaultStaleTime??0,P=v.options.shouldReload,_=typeof P=="function"?P(br(t,o,r,e,v)):P,{status:b,invalid:x}=g,w=R>=S&&(!!t.forceStaleReload||g.cause==="enter"||y!==void 0&&y!==g.id);a=b==="success"&&(x||(_??w)),h&&v.options.preload===!1||(a&&!t.sync&&l?(f=!0,(async()=>{try{await xr(t,o,r,e,v);let C=t.router.getMatch(r);C._nonReactive.loaderPromise?.resolve(),C._nonReactive.loadPromise?.resolve(),C._nonReactive.loaderPromise=void 0,C._nonReactive.loadPromise=void 0}catch(C){H(C)&&await t.router.navigate(C.options)}})()):b!=="success"||a?await xr(t,o,r,e,v):Pr(t,r,e))}i(s,"handleLoader");let{id:r,routeId:n}=t.matches[e],a=!1,f=!1,u=t.router.looseRoutesById[n],d=u.options.loader,l=((typeof d=="function"?void 0:d?.staleReloadMode)??t.router.options.defaultStaleReloadMode)!=="blocking";if(_r(t,r)){if(!t.router.getMatch(r))return t.matches[e];if(Pr(t,r,e),!1)return t.router.getMatch(r)}else{let h=t.router.getMatch(r),m=t.router.stores.matchesId.get()[e],y=(m&&t.router.stores.matchStores.get(m)||null)?.routeId===n?m:t.router.stores.matches.get().find(v=>v.routeId===n)?.id,g=Re(t,r);if(h._nonReactive.loaderPromise){if(h.status==="success"&&!t.sync&&!h.preload&&l)return h;await h._nonReactive.loaderPromise;let v=t.router.getMatch(r),R=v._nonReactive.error||v.error;R&&xt(t,v,R),v.status==="pending"&&await s(g,h,y,v,u)}else{let v=g&&!t.router.stores.matchStores.has(r),R=t.router.getMatch(r);R._nonReactive.loaderPromise=ct(),v!==R.preload&&t.updateMatch(r,S=>({...S,preload:v})),await s(g,h,y,R,u)}}let c=t.router.getMatch(r);f||(c._nonReactive.loaderPromise?.resolve(),c._nonReactive.loadPromise?.resolve(),c._nonReactive.loadPromise=void 0),clearTimeout(c._nonReactive.pendingTimeout),c._nonReactive.pendingTimeout=void 0,f||(c._nonReactive.loaderPromise=void 0),c._nonReactive.dehydrated=void 0;let p=f?c.isFetching:!1;return p!==c.isFetching||c.invalid!==!1?(t.updateMatch(r,h=>({...h,isFetching:p,invalid:!1})),t.router.getMatch(r)):c},"loadRouteMatch");async function so(t){let o=t,e=[];!!1&&Ds(o.router)&&ro(o);let s;for(let p=0;p<o.matches.length;p++){try{let h=$s(o,p);vt(h)&&await h}catch(h){if(H(h))throw h;if(A(h))s=h;else if(!o.preload)throw h;break}if(o.serialError||o.firstBadMatchIndex!=null)break}let r=o.firstBadMatchIndex??o.matches.length,n=s&&!o.preload?Sr(o,s):void 0,a=s&&o.preload?0:n!==void 0?Math.min(n+1,r):r,f,u;for(let p=0;p<a;p++)e.push(Hs(o,e,p));try{await Promise.all(e)}catch{let p=await Promise.allSettled(e);for(let h of p){if(h.status!=="rejected")continue;let m=h.reason;if(H(m))throw m;A(m)?f??=m:u??=m}if(u!==void 0)throw u}let d=f??(s&&!o.preload?s:void 0),l=o.firstBadMatchIndex!==void 0?o.firstBadMatchIndex:o.matches.length-1;if(!d&&s&&o.preload)return o.matches;if(d){let p=Sr(o,d);if(p===void 0)throw new Error("Invariant failed: Could not find match for notFound boundary");let h=o.matches[p],m=o.router.looseRoutesById[h.routeId],y=o.router.options?.defaultNotFoundComponent;!m.options.notFoundComponent&&y&&(m.options.notFoundComponent=y),d.routeId=h.routeId;let g=h.routeId===o.router.routeTree.id;o.updateMatch(h.id,v=>({...v,...g?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:d},isFetching:!1})),l=p,await Ut(m,["notFoundComponent"])}else if(!o.preload){let p=o.matches[0];p.globalNotFound||o.router.getMatch(p.id)?.globalNotFound&&o.updateMatch(p.id,h=>({...h,globalNotFound:!1,error:void 0}))}if(o.serialError&&o.firstBadMatchIndex!==void 0){let p=o.router.looseRoutesById[o.matches[o.firstBadMatchIndex].routeId];await Ut(p,["errorComponent"])}for(let p=0;p<=l;p++){let{id:h,routeId:m}=o.matches[p],y=o.router.looseRoutesById[m];try{let g=Us(o,h,y);if(g){let v=await g;o.updateMatch(h,R=>({...R,...v}))}}catch(g){console.error(`Error executing head for route ${m}:`,g)}}let c=ro(o);if(vt(c)&&await c,d)throw d;if(o.serialError&&!o.preload&&!o.onReady)throw o.serialError;return o.matches}i(so,"loadMatches");function wr(t,o){let e=o.map(s=>t.options[s]?.preload?.()).filter(Boolean);if(e.length!==0)return Promise.all(e)}i(wr,"preloadRouteComponents");function Ut(t,o=ye){!t._lazyLoaded&&t._lazyPromise===void 0&&(t.lazyFn?t._lazyPromise=t.lazyFn().then(s=>{let{id:r,...n}=s.options;Object.assign(t.options,n),t._lazyLoaded=!0,t._lazyPromise=void 0}):t._lazyLoaded=!0);let e=i(()=>t._componentsLoaded?void 0:o===ye?(()=>{if(t._componentsPromise===void 0){let s=wr(t,ye);s?t._componentsPromise=s.then(()=>{t._componentsLoaded=!0,t._componentsPromise=void 0}):t._componentsLoaded=!0}return t._componentsPromise})():wr(t,o),"runAfterLazy");return t._lazyPromise?t._lazyPromise.then(e):e()}i(Ut,"loadRouteChunk");function ve(t,o){return o?{status:"error",error:o}:{status:"success",value:t}}i(ve,"makeMaybe");function no(t){for(let o of ye)if(t.options[o]?.preload)return!0;return!1}i(no,"routeNeedsPreload");var ye=["component","errorComponent","pendingComponent","notFoundComponent"];function Lr(t){return{input:i(({url:o})=>{for(let e of t)o=Se(e,o);return o},"input"),output:i(({url:o})=>{for(let e=t.length-1;e>=0;e--)o=io(t[e],o);return o},"output")}}i(Lr,"composeRewrites");function Mr(t){let o=te(t.basepath),e=`/${o}`,s=t.caseSensitive?e:e.toLowerCase(),r=`${s}/`;return{input:i(({url:n})=>{let a=t.caseSensitive?n.pathname:n.pathname.toLowerCase();return a===s?n.pathname="/":a.startsWith(r)&&(n.pathname=n.pathname.slice(e.length)),n},"input"),output:i(({url:n})=>(n.pathname=Et(["/",o,n.pathname]),n),"output")}}i(Mr,"rewriteBasepath");function Se(t,o){let e=t?.input?.({url:o});if(e){if(typeof e=="string")return new URL(e);if(e instanceof URL)return e}return o}i(Se,"executeRewriteInput");function io(t,o){let e=t?.output?.({url:o});if(e){if(typeof e=="string")return new URL(e);if(e instanceof URL)return e}return o}i(io,"executeRewriteOutput");function uo(t){let o=t;return{get(){return o},set(e){o=Y(e,o)}}}i(uo,"createNonReactiveMutableStore");function lo(t){return{get(){return t()}}}i(lo,"createNonReactiveReadonlyStore");function Ir(t,o){let{createMutableStore:e,createReadonlyStore:s,batch:r,init:n}=o,a=new Map,f=new Map,u=new Map,d=e(t.status),l=e(t.loadedAt),c=e(t.isLoading),p=e(t.isTransitioning),h=e(t.location),m=e(t.resolvedLocation),y=e(t.statusCode),g=e(t.redirect),v=e([]),R=e([]),S=e([]),P=s(()=>ao(a,v.get())),_=s(()=>ao(f,R.get())),b=s(()=>ao(u,S.get())),x=s(()=>v.get()[0]),w=s(()=>v.get().some(ot=>a.get(ot)?.get().status==="pending")),C=s(()=>({locationHref:h.get().href,resolvedLocationHref:m.get()?.href,status:d.get()})),I=s(()=>({status:d.get(),loadedAt:l.get(),isLoading:c.get(),isTransitioning:p.get(),matches:P.get(),location:h.get(),resolvedLocation:m.get(),statusCode:y.get(),redirect:g.get()})),L=yt(64);function M(ot){let qt=L.get(ot);return qt||(qt=s(()=>{let Bo=v.get();for(let $o of Bo){let ae=a.get($o);if(ae&&ae.routeId===ot)return ae.get()}}),L.set(ot,qt)),qt}i(M,"getRouteMatchStore");let et={status:d,loadedAt:l,isLoading:c,isTransitioning:p,location:h,resolvedLocation:m,statusCode:y,redirect:g,matchesId:v,pendingIds:R,cachedIds:S,matches:P,pendingMatches:_,cachedMatches:b,firstId:x,hasPending:w,matchRouteDeps:C,matchStores:a,pendingMatchStores:f,cachedMatchStores:u,__store:I,getRouteMatchStore:M,setMatches:W,setPending:dt,setCached:ie};W(t.matches),n?.(et);function W(ot){co(ot,a,v,e,r)}i(W,"setMatches");function dt(ot){co(ot,f,R,e,r)}i(dt,"setPending");function ie(ot){co(ot,u,S,e,r)}return i(ie,"setCached"),et}i(Ir,"createRouterStores");function ao(t,o){let e=[];for(let s of o){let r=t.get(s);r&&e.push(r.get())}return e}i(ao,"readPoolMatches");function co(t,o,e,s,r){let n=t.map(f=>f.id),a=new Set(n);r(()=>{for(let f of o.keys())a.has(f)||o.delete(f);for(let f of t){let u=o.get(f.id);if(!u){let d=s(f);d.routeId=f.routeId,o.set(f.id,d);continue}u.routeId=f.routeId,u.get()!==f&&u.set(f)}nr(e.get(),n)||e.set(n)})}i(co,"reconcileMatchPool");var wt="__TSR_index",Er="popstate",kr="beforeunload";function ho(t){let o=t.getLocation(),e=new Set,s=i(a=>{o=t.getLocation(),e.forEach(f=>f({location:o,action:a}))},"notify"),r=i(a=>{t.notifyOnIndexChange??!0?s(a):o=t.getLocation()},"handleIndexChange"),n=i(async({task:a,navigateOpts:f,...u})=>{if(f?.ignoreBlocker??!1){a();return}let d=t.getBlockers?.()??[],l=u.type==="PUSH"||u.type==="REPLACE";if(typeof document<"u"&&d.length&&l)for(let c of d){let p=Ht(u.path,u.state);if(await c.blockerFn({currentLocation:o,nextLocation:p,action:u.type})){t.onBlocked?.();return}}a()},"tryNavigation");return{get location(){return o},get length(){return t.getLength()},subscribers:e,subscribe:i(a=>(e.add(a),()=>{e.delete(a)}),"subscribe"),push:i((a,f,u)=>{let d=o.state[wt];f=fo(d+1,f),n({task:i(()=>{t.pushState(a,f),s({type:"PUSH"})},"task"),navigateOpts:u,type:"PUSH",path:a,state:f})},"push"),replace:i((a,f,u)=>{let d=o.state[wt];f=fo(d,f),n({task:i(()=>{t.replaceState(a,f),s({type:"REPLACE"})},"task"),navigateOpts:u,type:"REPLACE",path:a,state:f})},"replace"),go:i((a,f)=>{n({task:i(()=>{t.go(a),r({type:"GO",index:a})},"task"),navigateOpts:f,type:"GO"})},"go"),back:i(a=>{n({task:i(()=>{t.back(a?.ignoreBlocker??!1),r({type:"BACK"})},"task"),navigateOpts:a,type:"BACK"})},"back"),forward:i(a=>{n({task:i(()=>{t.forward(a?.ignoreBlocker??!1),r({type:"FORWARD"})},"task"),navigateOpts:a,type:"FORWARD"})},"forward"),canGoBack:i(()=>o.state[wt]!==0,"canGoBack"),createHref:i(a=>t.createHref(a),"createHref"),block:i(a=>{if(!t.setBlockers)return()=>{};let f=t.getBlockers?.()??[];return t.setBlockers([...f,a]),()=>{let u=t.getBlockers?.()??[];t.setBlockers?.(u.filter(d=>d!==a))}},"block"),flush:i(()=>t.flush?.(),"flush"),destroy:i(()=>t.destroy?.(),"destroy"),notify:s}}i(ho,"createHistory");function fo(t,o){o||(o={});let e=mo();return{...o,key:e,__TSR_key:e,[wt]:t}}i(fo,"assignKeyAndIndex");function po(t){let o=t?.window??(typeof document<"u"?window:void 0),e=o.history.pushState,s=o.history.replaceState,r=[],n=i(()=>r,"_getBlockers"),a=i(w=>r=w,"_setBlockers"),f=t?.createHref??(w=>w),u=t?.parseLocation??(()=>Ht(`${o.location.pathname}${o.location.search}${o.location.hash}`,o.history.state));if(!o.history.state?.__TSR_key&&!o.history.state?.key){let w=mo();o.history.replaceState({[wt]:0,key:w,__TSR_key:w},"")}let d=u(),l,c=!1,p=!1,h=!1,m=!1,y=i(()=>d,"getLocation"),g,v,R=i(()=>{g&&(x._ignoreSubscribers=!0,(g.isPush?o.history.pushState:o.history.replaceState)(g.state,"",g.href),x._ignoreSubscribers=!1,g=void 0,v=void 0,l=void 0)},"flush"),S=i((w,C,I)=>{let L=f(C);v||(l=d),d=Ht(C,I),g={href:L,state:I,isPush:g?.isPush||w==="push"},v||(v=Promise.resolve().then(()=>R()))},"queueHistoryAction"),P=i(w=>{d=u(),x.notify({type:w})},"onPushPop"),_=i(async()=>{if(p){p=!1;return}let w=u(),C=w.state[wt]-d.state[wt],I=C===1,L=C===-1,M=!I&&!L||c;c=!1;let et=M?"GO":L?"BACK":"FORWARD",W=M?{type:"GO",index:C}:{type:L?"BACK":"FORWARD"};if(h)h=!1;else{let dt=n();if(typeof document<"u"&&dt.length){for(let ie of dt)if(await ie.blockerFn({currentLocation:d,nextLocation:w,action:et})){p=!0,o.history.go(1),x.notify(W);return}}}d=u(),x.notify(W)},"onPushPopEvent"),b=i(w=>{if(m){m=!1;return}let C=!1,I=n();if(typeof document<"u"&&I.length)for(let L of I){let M=L.enableBeforeUnload??!0;if(M===!0){C=!0;break}if(typeof M=="function"&&M()===!0){C=!0;break}}if(C)return w.preventDefault(),w.returnValue=""},"onBeforeUnload"),x=ho({getLocation:y,getLength:i(()=>o.history.length,"getLength"),pushState:i((w,C)=>S("push",w,C),"pushState"),replaceState:i((w,C)=>S("replace",w,C),"replaceState"),back:i(w=>(w&&(h=!0),m=!0,o.history.back()),"back"),forward:i(w=>{w&&(h=!0),m=!0,o.history.forward()},"forward"),go:i(w=>{c=!0,o.history.go(w)},"go"),createHref:i(w=>f(w),"createHref"),flush:R,destroy:i(()=>{o.history.pushState=e,o.history.replaceState=s,o.removeEventListener(kr,b,{capture:!0}),o.removeEventListener(Er,_)},"destroy"),onBlocked:i(()=>{l&&d!==l&&(d=l)},"onBlocked"),getBlockers:n,setBlockers:a,notifyOnIndexChange:!1});return o.addEventListener(kr,b,{capture:!0}),o.addEventListener(Er,_),o.history.pushState=function(...w){let C=e.apply(o.history,w);return x._ignoreSubscribers||P("PUSH"),C},o.history.replaceState=function(...w){let C=s.apply(o.history,w);return x._ignoreSubscribers||P("REPLACE"),C},x}i(po,"createBrowserHistory");function Ws(t={initialEntries:["/"]}){let o=t.initialEntries,e=t.initialIndex?Math.min(Math.max(t.initialIndex,0),o.length-1):o.length-1,s=o.map((u,d)=>fo(d,void 0)),r=i(()=>Ht(o[e],s[e]),"getLocation"),n=[];return ho({getLocation:r,getLength:i(()=>o.length,"getLength"),pushState:i((u,d)=>{e<o.length-1&&(o.splice(e+1),s.splice(e+1)),s.push(d),o.push(u),e=Math.max(o.length-1,0)},"pushState"),replaceState:i((u,d)=>{s[e]=d,o[e]=u},"replaceState"),back:i(()=>{e=Math.max(e-1,0)},"back"),forward:i(()=>{e=Math.min(e+1,o.length-1)},"forward"),go:i(u=>{e=Math.min(Math.max(e+u,0),o.length-1)},"go"),createHref:i(u=>u,"createHref"),getBlockers:i(()=>n,"_getBlockers"),setBlockers:i(u=>n=u,"_setBlockers")})}i(Ws,"createMemoryHistory");function Vs(t){let o=t.replace(/[\x00-\x1f\x7f]/g,"");return o.startsWith("//")&&(o="/"+o.replace(/^\/+/,"")),o}i(Vs,"sanitizePath");function Ht(t,o){let e=Vs(t),s=e.indexOf("#"),r=e.indexOf("?"),n=mo();return{href:e,pathname:e.substring(0,s>0?r>0?Math.min(s,r):s:r>0?r:e.length),hash:s>-1?e.substring(s):"",search:r>-1?e.slice(r,s===-1?void 0:s):"",state:o||{[wt]:0,key:n,__TSR_key:n}}}i(Ht,"parseHref");function mo(){return(Math.random()+1).toString(36).substring(7)}i(mo,"createRandomKey");function ht(t,o){let e=o,s=t;return{fromLocation:e,toLocation:s,pathChanged:e?.pathname!==s.pathname,hrefChanged:e?.href!==s.href,hashChanged:e?.hash!==s.hash}}i(ht,"getLocationChangeInfo");var xe=new WeakMap,go=class{static{i(this,"RouterCore")}constructor(t,o){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=e=>e(),this.update=e=>{e.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");let s=this.options,r=this.basepath??s?.basepath??"/",n=this.basepath===void 0,a=s?.rewrite;if(this.options={...s,...e},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=mr(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=po()),this.origin=this.options.origin,this.origin||(!!1&&window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let l;!1,this.resolvePathCache=yt(1e3),l=this.buildRouteTree(),!1,this.setRoutes(l)}if(!this.stores&&this.latestLocation){let l=this.getStoreConfig(this);this.batch=l.batch,this.stores=Ir(Fr(this.latestLocation),l),Br(this)}let f=!1,u=this.options.basepath??"/",d=this.options.rewrite;if(n||r!==u||a!==d){this.basepath=u;let l=[],c=te(u);c&&c!=="/"&&l.push(Mr({basepath:u})),d&&l.push(d),this.rewrite=l.length===0?void 0:l.length===1?l[0]:Lr(l),this.history&&this.updateLatestLocation(),f=!0}f&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a))"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=dr(this.routeTree,this.options.caseSensitive,(s,r)=>{s.init({originalIndex:r})});return this.options.routeMasks&&cr(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,s)=>{let r={eventType:e,fn:s};return this.subscribers.add(r),()=>{this.subscribers.delete(r)}},this.emit=e=>{this.subscribers.forEach(s=>{s.eventType===e.type&&s.fn(e)})},this.parseLocation=(e,s)=>{let r=i(({pathname:u,search:d,hash:l,href:c,state:p})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(u)){let v=this.options.parseSearch(d),R=this.options.stringifySearch(v);return{href:u+R+l,publicHref:u+R+l,pathname:Bt(u).path,external:!1,searchStr:R,search:gt(s?.search,v),hash:Bt(l.slice(1)).path,state:at(s?.state,p)}}let h=new URL(c,this.origin),m=Se(this.rewrite,h),y=this.options.parseSearch(m.search),g=this.options.stringifySearch(y);return m.search=g,{href:m.href.replace(m.origin,""),publicHref:c,pathname:Bt(m.pathname).path,external:!!this.rewrite&&m.origin!==this.origin,searchStr:g,search:gt(s?.search,y),hash:Bt(m.hash.slice(1)).path,state:at(s?.state,p)}},"parse"),n=r(e),{__tempLocation:a,__tempKey:f}=n.state;if(a&&(!f||f===this.tempLocationKey)){let u=r(a);return u.state.key=n.state.key,u.state.__TSR_key=n.state.__TSR_key,delete u.state.__tempLocation,{...u,maskedLocation:n}}return n},this.resolvePathWithBase=(e,s)=>eo({base:e,to:s.includes("//")?Qt(s):s,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,s,r)=>typeof e=="string"?this.matchRoutesInternal({pathname:e,search:s},r):this.matchRoutesInternal(e,s),this.getMatchedRoutes=e=>Ar({pathname:e,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=e=>{let s=this.getMatch(e);s&&(s.abortController.abort(),clearTimeout(s._nonReactive.pendingTimeout),s._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(e=>{this.cancelMatch(e)}),this.stores.matchesId.get().forEach(e=>{if(this.stores.pendingMatchStores.has(e))return;let s=this.stores.matchStores.get(e)?.get();s&&(s.status==="pending"||s.isFetching==="loader")&&this.cancelMatch(e)})},this.buildLocation=e=>{let s=i((n={})=>{let a=n._fromLocation||this.pendingBuiltLocation||this.latestLocation,f=this.matchRoutesLightweight(a);if(n.from&&n._isNavigate){let L=this.getMatchedRoutes(n.from).matchedRoutes,M=Ge(f.matchedRoutes,W=>Or(W.fullPath,n.from)),et=Ge(L,W=>Or(W.fullPath,f.fullPath));!M&&!et&&console.warn(`Could not find match for from: ${n.from}`)}let u=n.unsafeRelative==="path"?a.pathname:n.from??f.fullPath,d=n.to?`${n.to}`:void 0,l=f.search,c=Object.assign(Object.create(null),f.params),p=d?.charCodeAt(0)===47?"/":this.resolvePathWithBase(u,"."),h=d?this.resolvePathWithBase(p,d):p,m=n.params===!1||n.params===null?Object.create(null):(n.params??!0)===!0?c:Object.assign(c,Y(n.params,c)),y=this.routesByPath[Q(h)],g;if(y)g=this.getRouteBranch(y);else if(h.includes("$"))g=[];else{let L=this.getMatchedRoutes(h);g=L.matchedRoutes,this.options.notFoundRoute&&(!L.foundRoute||L.foundRoute.path!=="/"&&L.routeParams["**"])&&(g=[...g,this.options.notFoundRoute])}if(g.length&&mt(m))for(let L of g){let M=L.options.params?.stringify??L.options.stringifyParams;if(M)try{Object.assign(m,M(m))}catch{}}let v=e.leaveParams?h:Bt(ge({path:h,params:m,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;if(y&&!e.leaveParams)try{let L=this.getMatchedRoutes(v);L.foundRoute?.id!==y.id&&console.warn(`Generated path "${v}" for route "${y.id}" matched route "${L.foundRoute?.id}" instead. This can happen when multiple route templates resolve to the same URL. Use the route template that matches the intended route, or adjust params.stringify if it changed the target path.`)}catch{}let R=l;if(e._includeValidateSearch&&this.options.search?.strict){let L={};g.forEach(M=>{if(M.options.validateSearch)try{Object.assign(L,Pe(M.options.validateSearch,{...L,...R}))}catch{}}),R=L}R=js({search:R,dest:n,destRoutes:g,_includeValidateSearch:e._includeValidateSearch}),R=gt(l,R);let S=this.options.stringifySearch(R),P=n.hash===!0?a.hash:n.hash?Y(n.hash,a.hash):void 0,_=P?`#${P}`:"",b=n.state===!0?a.state:n.state?Y(n.state,a.state):{};b=at(a.state,b);let x=`${v}${S}${_}`,w,C,I=!1;if(this.rewrite){let L=new URL(x,this.origin),M=io(this.rewrite,L);w=L.href.replace(L.origin,""),M.origin!==this.origin?(C=M.href,I=!0):C=M.pathname+M.search+M.hash}else w=sr(x),C=w;return{publicHref:C,href:w,pathname:v,search:R,searchStr:S,state:b,hash:P??"",external:I,unmaskOnReload:n.unmaskOnReload}},"build"),r=i((n={},a)=>{let f=s(n),u=a?s(a):void 0;if(!u){let d=Object.create(null);if(this.options.routeMasks){let l=ur(f.pathname,this.processedTree);if(l){Object.assign(d,l.rawParams);let{from:c,params:p,...h}=l.route,m=p===!1||p===null?Object.create(null):(p??!0)===!0?d:Object.assign(d,Y(p,d));a={from:e.from,...h,params:m},u=s(a)}}}return u&&(f.maskedLocation=u),f},"buildWithMatches");return e.mask?r(e,{from:e.from,...e.mask}):r(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:s,...r})=>{let n,a=i(()=>{let d=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];d.forEach(c=>{r.state[c]=this.latestLocation.state[c]});let l=st(r.state,this.latestLocation.state);return d.forEach(c=>{delete r.state[c]}),l},"isSameState"),f=Q(this.latestLocation.href)===Q(r.href),u=this.commitLocationPromise;if(this.commitLocationPromise=ct(()=>{u?.resolve(),u=void 0}),f&&a())this.load();else{let{maskedLocation:d,hashScrollIntoView:l,...c}=r;d&&(c={...d,state:{...d.state,__tempKey:void 0,__tempLocation:{...c,search:c.searchStr,state:{...c.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(c.unmaskOnReload??this.options.unmaskOnReload??!1)&&(c.state.__tempKey=this.tempLocationKey)),c.state.__hashScrollIntoViewOptions=l??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,n=r.replace?"REPLACE":"PUSH",this.history[n==="REPLACE"?"replace":"push"](c.publicHref,c.state,{ignoreBlocker:s})}return this._scroll.next=r.resetScroll??!0,this.history.subscribers.size||this.load(n?{action:{type:n}}:void 0),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:s,hashScrollIntoView:r,viewTransition:n,ignoreBlocker:a,href:f,...u}={})=>{if(f){let c=this.history.location.state.__TSR_index,p=Ht(f,{__TSR_index:e?c:c+1}),h=new URL(p.pathname,this.origin);u.to=Se(this.rewrite,h).pathname,u.search=this.options.parseSearch(p.search),u.hash=p.hash.slice(1)}let d=this.buildLocation({...u,_includeValidateSearch:!0});this.pendingBuiltLocation=d;let l=this.commitLocation({...d,viewTransition:n,replace:e,resetScroll:s,hashScrollIntoView:r,ignoreBlocker:a});return queueMicrotask(()=>{this.pendingBuiltLocation===d&&(this.pendingBuiltLocation=void 0)}),l},this.navigate=async({to:e,reloadDocument:s,href:r,publicHref:n,...a})=>{let f=!1;if(r)try{new URL(`${r}`),f=!0}catch{}if(f&&!s&&(s=!0),s){if(e!==void 0||!r){let d=this.buildLocation({to:e,...a});r=r??d.publicHref,n=n??d.publicHref}let u=!f&&n?n:r;if(ut(u,this.protocolAllowlist)){console.warn(`Blocked navigation to dangerous protocol: ${u}`);return}if(!a.ignoreBlocker){let d=this.history.getBlockers?.()??[];for(let l of d)if(l?.blockerFn&&await l.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return}a.replace?window.location.replace(u):window.location.href=u;return}return this.buildAndCommitLocation({...a,href:r,to:e,_isNavigate:!0})},this.beforeLoad=()=>{if(this.cancelMatches(),this.updateLatestLocation(),!1){let r=this.buildLocation({to:this.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(this.latestLocation.publicHref!==r.publicHref){let n=this.getParsedLocationHref(r);throw r.external?$t({href:n}):$t({href:n,_builtLocation:r})}}let e=this.matchRoutes(this.latestLocation),s=this.stores.cachedMatches.get().filter(r=>!e.some(n=>n.id===r.id));this.batch(()=>{this.stores.status.set("pending"),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(e),this.stores.setCached(s)})},this.load=async e=>{let s=e?.action?.type,r,n,a,f=this.stores.resolvedLocation.get()??this.stores.location.get();for(a=new Promise(d=>{this.startTransition(async()=>{try{this.beforeLoad(),s?xe.set(this.latestLocation,s):xe.delete(this.latestLocation);let l=this.latestLocation,c=ht(l,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...c}),this.emit({type:"onBeforeLoad",...c}),await so({router:this,sync:e?.sync,forceStaleReload:f.href===l.href,matches:this.stores.pendingMatches.get(),location:l,updateMatch:this.updateMatch,onReady:i(async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let p=null,h=null,m=null,y=null;this.batch(()=>{let g=this.stores.pendingMatches.get(),v=g.length,R=this.stores.matches.get();p=v?R.filter(_=>!this.stores.pendingMatchStores.has(_.id)):null;let S=new Set;for(let _ of this.stores.pendingMatchStores.values())_.routeId&&S.add(_.routeId);let P=new Set;for(let _ of this.stores.matchStores.values())_.routeId&&P.add(_.routeId);h=v?R.filter(_=>!S.has(_.routeId)):null,m=v?g.filter(_=>!P.has(_.routeId)):null,y=v?g.filter(_=>P.has(_.routeId)):R,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),v&&(this.stores.setMatches(g),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...p.filter(_=>_.status!=="error"&&_.status!=="notFound"&&_.status!=="redirected")]),this.clearExpiredCache())});for(let[g,v]of[[h,"onLeave"],[m,"onEnter"],[y,"onStay"]])if(g)for(let R of g)this.looseRoutesById[R.routeId].options[v]?.(R)})})},"onReady")})}catch(l){H(l)?(r=l,this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):A(l)&&(n=l);let c=r?r.status:n?404:this.stores.matches.get().some(p=>p.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.set(c),this.stores.redirect.set(r)})}this.latestLoadPromise===a&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),d()})}),this.latestLoadPromise=a,await a;this.latestLoadPromise&&a!==this.latestLoadPromise;)await this.latestLoadPromise;let u;this.hasNotFoundMatch()?u=404:this.stores.matches.get().some(d=>d.status==="error")&&(u=500),u!==void 0&&this.stores.statusCode.set(u)},this.startViewTransition=e=>{let s=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,s&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let r;if(typeof s=="object"&&this.isViewTransitionTypesSupported){let n=this.latestLocation,a=this.stores.resolvedLocation.get(),f=typeof s.types=="function"?s.types(ht(n,a)):s.types;if(f===!1){e();return}r={update:e,types:f}}else r=e;document.startViewTransition(r)}else e()},this.updateMatch=(e,s)=>{this.startTransition(()=>{let r=this.stores.pendingMatchStores.get(e);if(r){r.set(s);return}let n=this.stores.matchStores.get(e);if(n){n.set(s);return}let a=this.stores.cachedMatchStores.get(e);if(a){let f=s(a.get());f.status==="redirected"?this.stores.cachedMatchStores.delete(e)&&this.stores.cachedIds.set(u=>u.filter(d=>d!==e)):a.set(f)}})},this.getMatch=e=>this.stores.cachedMatchStores.get(e)?.get()??this.stores.pendingMatchStores.get(e)?.get()??this.stores.matchStores.get(e)?.get(),this.invalidate=e=>{let s=i(r=>e?.filter?.(r)??!0?{...r,invalid:!0,...e?.forcePending||r.status==="error"||r.status==="notFound"?{status:"pending",error:void 0}:void 0}:r,"invalidate");return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(s)),this.stores.setCached(this.stores.cachedMatches.get().map(s)),this.stores.setPending(this.stores.pendingMatches.get().map(s))}),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.getParsedLocationHref=e=>e.publicHref||"/",this.resolveRedirect=e=>{let s=e.headers.get("Location");if(!e.options.href||e.options._builtLocation){let r=e.options._builtLocation??this.buildLocation(e.options),n=this.getParsedLocationHref(r);e.options.href=n,e.headers.set("Location",n)}else if(s)try{let r=new URL(s);if(this.origin&&r.origin===this.origin){let n=r.pathname+r.search+r.hash;e.options.href=n,e.headers.set("Location",n)}}catch{}if(e.options.href&&!e.options._builtLocation&&ut(e.options.href,this.protocolAllowlist))throw new Error(`Redirect blocked: unsafe protocol in href "${e.options.href}". Allowed protocols: ${Array.from(this.protocolAllowlist).join(", ")}.`);return e.headers.get("Location")||e.headers.set("Location",e.options.href),e},this.clearCache=e=>{let s=e?.filter;s!==void 0?this.stores.setCached(this.stores.cachedMatches.get().filter(r=>!s(r))):this.stores.setCached([])},this.clearExpiredCache=()=>{let e=Date.now(),s=i(r=>{let n=this.looseRoutesById[r.routeId];if(!n.options.loader)return!0;let a=(r.preload?n.options.preloadGcTime??this.options.defaultPreloadGcTime:n.options.gcTime??this.options.defaultGcTime)??300*1e3;return r.status==="error"?!0:e-r.updatedAt>=a},"filter");this.clearCache({filter:s})},this.loadRouteChunk=Ut,this.preloadRoute=async e=>{let s=e._builtLocation??this.buildLocation(e),r=this.matchRoutes(s,{throwOnError:!0,preload:!0,dest:e}),n=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),a=new Set([...n,...this.stores.cachedIds.get()]),f=r.filter(u=>!a.has(u.id));if(f.length){let u=this.stores.cachedMatches.get();this.stores.setCached([...u,...f])}try{return r=await so({router:this,matches:r,location:s,preload:!0,updateMatch:i((u,d)=>{n.has(u)?r=r.map(l=>l.id===u?d(l):l):this.updateMatch(u,d)},"updateMatch")}),r}catch(u){if(H(u))return u.options.reloadDocument?void 0:await this.preloadRoute({...u.options,_fromLocation:s});A(u)||console.error(u);return}},this.matchRoute=(e,s)=>{let r={...e,to:e.to?this.resolvePathWithBase(e.from||"",e.to):void 0,params:e.params||{},leaveParams:!0},n=this.buildLocation(r);if(s?.pending&&this.stores.status.get()!=="pending")return!1;let a=(s?.pending===void 0?!this.stores.isLoading.get():s.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),f=lr(n.pathname,s?.caseSensitive??!1,s?.fuzzy??!1,a.pathname,this.processedTree);return!f||e.params&&!st(f.rawParams,e.params,{partial:!0})?!1:s?.includeSearch??!0?st(a.search,n.search,{partial:!0})?f.rawParams:!1:f.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(e=>e.status==="notFound"||e.globalNotFound),this.getStoreConfig=o,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??Rr,parseSearch:t.parseSearch??yr,protocolAllowlist:t.protocolAllowlist??Je}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:t,routesByPath:o,processedTree:e}){this.routesById=t,this.routesByPath=o,this.processedTree=e;let s=this.options.notFoundRoute;s&&(s.init({originalIndex:99999999999}),this.routesById[s.id]=s)}getRouteBranch(t){let o=this.routeBranchCache.get(t);return o||(o=to(t),this.routeBranchCache.set(t,o)),o}get looseRoutesById(){return this.routesById}getParentContext(t){return t?.id?t.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(t,o){let e=this.getMatchedRoutes(t.pathname),{foundRoute:s,routeParams:r}=e,{matchedRoutes:n}=e,a=!1;(s?s.path!=="/"&&r["**"]:Q(t.pathname))&&(this.options.notFoundRoute?n=[...n,this.options.notFoundRoute]:a=!0);let f=a?Ks(this.options.notFoundMode,n):void 0,u=new Array(n.length),d=new Map;for(let l of this.stores.matchStores.values())l.routeId&&d.set(l.routeId,l.get());for(let l=0;l<n.length;l++){let c=n[l],p=u[l-1],h,m,y;{let M=p?.search??t.search,et=p?._strictSearch??void 0;try{let W=Pe(c.options.validateSearch,{...M})??void 0;h={...M,...W},m={...et,...W},y=void 0}catch(W){let dt=W;if(W instanceof oe||(dt=new oe(W.message,{cause:W})),o?.throwOnError)throw dt;h=M,m={},y=dt}}let g=c.options.loaderDeps?.({search:h})??"",v=g?JSON.stringify(g):"",{interpolatedPath:R,usedParams:S}=ge({path:c.fullPath,params:r,decoder:this.pathParamsDecoder,server:this.isServer}),P=c.id+R+v,_=this.getMatch(P),b=d.get(c.id),x=_?._strictParams??S,w;if(!_)try{Nr(c,x)}catch(M){if(A(M)||H(M)?w=M:w=new Dr(M.message,{cause:M}),o?.throwOnError)throw w}Object.assign(r,x);let C=b?"stay":"enter",I;if(_)I={..._,cause:C,params:b?.params??r,_strictParams:x,search:b?gt(b.search,h):gt(_.search,h),_strictSearch:m};else{let M=c.options.loader||c.options.beforeLoad||c.lazyFn||no(c)?"pending":"success";I={id:P,ssr:c.options.ssr,index:l,routeId:c.id,params:b?.params??r,_strictParams:x,pathname:R,updatedAt:Date.now(),search:b?gt(b.search,h):h,_strictSearch:m,searchError:void 0,status:M,isFetching:!1,error:void 0,paramsError:w,__routeContext:void 0,_nonReactive:{loadPromise:ct()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:C,loaderDeps:b?at(b.loaderDeps,g):g,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:c.options.staticData||{},fullPath:c.fullPath}}o?.preload||(I.globalNotFound=f===c.id),I.searchError=y;let L=this.getParentContext(p);I.context={...L,...I.__routeContext,...I.__beforeLoadContext},u[l]=I}for(let l=0;l<u.length;l++){let c=u[l],p=this.looseRoutesById[c.routeId],h=this.getMatch(c.id),m=d.get(c.routeId);if(c.params=m?gt(m.params,r):r,!h){let y=u[l-1],g=this.getParentContext(y);if(p.options.context){let v={deps:c.loaderDeps,params:c.params,context:g??{},location:t,navigate:i(R=>this.navigate({...R,_fromLocation:t}),"navigate"),buildLocation:this.buildLocation,cause:c.cause,abortController:c.abortController,preload:!!c.preload,matches:u,routeId:p.id};c.__routeContext=p.options.context(v)??void 0}c.context={...g,...c.__routeContext,...c.__beforeLoadContext}}}return u}matchRoutesLightweight(t){let o=pt(this.stores.matchesId.get()),e=this.lightweightCache.get(t);if(e&&e[0]===o)return e[1];let{matchedRoutes:s,routeParams:r}=this.getMatchedRoutes(t.pathname),n=pt(s),a={...t.search};for(let c of s)try{Object.assign(a,Pe(c.options.validateSearch,a))}catch{}let f=o&&this.stores.matchStores.get(o)?.get(),u=f&&f.routeId===n.id&&f.pathname===t.pathname,d;if(u)d=f.params;else{let c=Object.assign(Object.create(null),r);for(let p of s)try{Nr(p,c)}catch{}d=c}let l={matchedRoutes:s,fullPath:n.fullPath,search:a,params:d};return this.lightweightCache.set(t,[o,l]),l}},oe=class extends Error{static{i(this,"SearchParamError")}},Dr=class extends Error{static{i(this,"PathParamError")}},Tr=i(t=>t.endsWith("/")&&t.length>1?t.slice(0,-1):t,"normalize");function Or(t,o){return Tr(t)===Tr(o)}i(Or,"comparePaths");function Fr(t){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:t,matches:[],statusCode:200}}i(Fr,"getInitialRouterState");function Pe(t,o){if(t==null)return{};if("~standard"in t){let e=t["~standard"].validate(o);if(e instanceof Promise)throw new oe("Async validation not supported");if(e.issues)throw new oe(JSON.stringify(e.issues,void 0,2),{cause:e});return e.value}return"parse"in t?t.parse(o):typeof t=="function"?t(o):{}}i(Pe,"validateSearch");function Ar({pathname:t,routesById:o,processedTree:e}){let s=Object.create(null),r=Q(t),n,a=fr(r,e,!0);return a&&(n=a.route,Object.assign(s,a.rawParams)),{matchedRoutes:a?.branch||[o.__root__],routeParams:s,foundRoute:n}}i(Ar,"getMatchedRoutes");function js({search:t,dest:o,destRoutes:e,_includeValidateSearch:s}){return zs(e)(t,o,s??!1)}i(js,"applySearchMiddleware");function zs(t){let o,e,s=[];for(let n of t){let a=n.options;if("search"in a)a.search?.middlewares&&s.push(...a.search.middlewares);else if(a.preSearchFilters||a.postSearchFilters){let u=i(({search:d,next:l})=>{let c=l(a.preSearchFilters?a.preSearchFilters.reduce((p,h)=>h(p),d):d);return a.postSearchFilters?a.postSearchFilters.reduce((p,h)=>h(p),c):c},"legacyMiddleware");s.push(u)}let f=a.validateSearch;if(f){let u=i(({search:d,next:l,meta:c})=>{let p=l(d);if(e)try{let h=Pe(f,p);if(c&&h)for(let m in h)m in p||(c.defaulted||=new Map).set(m,h[m]);return{...p,...h}}catch{}return p},"validate");s.push(u)}}let r=i((n,a,f)=>{if(n>=s.length){if(!o.search)return{};if(o.search===!0)return a;let d=Y(o.search,a);return f&&(f.explicit=d),d}let u=i((d,l)=>{if(l){let c=f||{};return{search:r(n+1,d,c),meta:c}}return r(n+1,d,f)},"next");return s[n]({search:a,next:u,meta:f})},"applyNext");return i(function(a,f,u){return o=f,e=u,r(0,a)},"middleware")}i(zs,"buildMiddlewareChain");function Ks(t,o){if(t!=="root")for(let e=o.length-1;e>=0;e--){let s=o[e];if(s.children)return s.id}return X}i(Ks,"findGlobalNotFoundRouteId");function Nr(t,o){let e=t.options.params?.parse??t.options.parseParams;if(e){let s=e(o);if(s===!1)throw new Error("Route params.parse returned false for a matched route");Object.assign(o,s)}}i(Nr,"extractStrictParams");function qs(){try{return sessionStorage}catch{return}}i(qs,"getSafeSessionStorage");var Gs="tsr-scroll-restoration-v1_3",Hr=qs();function Js(){try{return JSON.parse(Hr?.getItem("tsr-scroll-restoration-v1_3")||"{}")}catch{return{}}}i(Js,"createScrollRestorationCache");function Ys(){try{Hr?.setItem(Gs,JSON.stringify(Wt))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}i(Ys,"persistScrollRestorationCache");var Wt=Js(),$r="data-scroll-restoration-id",Xs=i(t=>t.state.__TSR_key||t.href,"defaultGetScrollRestorationKey");function Zs(t){let o=t.getAttribute($r);if(o)return`[${$r}="${o}"]`;let e="",s=t,r;for(;r=s.parentNode;){let n=1,a=s;for(;a=a.previousElementSibling;)n++;let f=`${s.localName}:nth-child(${n})`;e=e?`${f} > ${e}`:f,s=r}return e}i(Zs,"getScrollRestorationSelector");var we=!1,Vt="window";function vo(t){try{return typeof t=="function"?t():document.querySelector(t)}catch{}}i(vo,"getElement");function Ur(t){let o=[];for(let e of t){if(e===Vt)continue;let s=vo(e);s&&o.push(s)}return o}i(Ur,"getScrollToTopElements");function Br(t,o){let e=o??t.options.scrollRestoration,s=t._scroll;if(e&&(s.restoring=!0),!1)return;let r=t.options.getScrollRestorationKey||Xs,n=new Map,a=i((d,l,c)=>{let p=n.get(d)||{};p.scrollX=l,p.scrollY=c,n.set(d,p)},"setTrackedScrollEntry"),f=i(d=>{if(!(we||!s.restoring))if(d.target===document)a(Vt,scrollX,scrollY);else{let l=d.target;a(l,l.scrollLeft,l.scrollTop)}},"onScroll"),u=i(d=>{if(!s.restoring)return;let l=Wt[d]||={};for(let[c,p]of n)c===Vt?l[Vt]=p:c.isConnected&&(l[Zs(c)]=p)},"snapshotCurrentScrollTargets");e&&!s.restoration&&(s.restoration=!0,we=!1,history.scrollRestoration="manual",document.addEventListener("scroll",f,!0),t.subscribe("onBeforeLoad",d=>{d.fromLocation&&u(r(d.fromLocation)),n.clear()}),addEventListener("pagehide",()=>{u(r(t.stores.resolvedLocation.get()??t.stores.location.get())),Ys()})),!s.reset&&(s.reset=!0,t.subscribe("onRendered",d=>{let l=t.options.scrollRestorationBehavior,c=t.options.scrollToTopSelectors,p=s.next,h;if(n.clear(),p||(s.next=!0),typeof t.options.scrollRestoration=="function"&&!t.options.scrollRestoration({location:t.latestLocation}))return;let m=r(d.toLocation),y=d.fromLocation&&r(d.fromLocation);if(s.restoring&&y&&y!==m){let g=Wt[y];if(g){let v=Wt[m];for(let R in g){if(R===Vt){if(p)continue}else{let S=vo(R);if(!S||p&&c&&(h??=Ur(c),h.includes(S)))continue}v||(v=Wt[m]={}),v[R]??=g[R]}}}we=!0;try{let g=d.toLocation.hash,v=d.toLocation.state.__hashScrollIntoViewOptions??!0,R=!1;if(p){let S=xe.get(d.toLocation),P=g&&v&&(S==="PUSH"||S==="REPLACE"),_=s.restoring?Wt[m]:void 0;if(_)for(let b in _){let{scrollX:x,scrollY:w}=_[b];if(b===Vt){if(P)continue;scrollTo({top:w,left:x,behavior:l}),R=!0}else{let C=vo(b);C&&(C.scrollLeft=x,C.scrollTop=w)}}if(!R&&!g){let b={top:0,left:0,behavior:l};if(scrollTo(b),c){h??=Ur(c);for(let x of h)x.scrollTo(b)}}}!R&&g&&v&&document.getElementById(g)?.scrollIntoView(v)}finally{we=!1}}))}i(Br,"setupScrollRestoration");var yo="Error preloading route! \u261D\uFE0F";var _e=class{static{i(this,"BaseRoute")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(t){if(this.init=o=>{this.originalIndex=o.originalIndex;let e=this.options,s=!e?.path&&!e?.id;if(this.parentRoute=this.options.getParentRoute?.(),s)this._path=X;else if(!this.parentRoute)throw new Error("Invariant failed: Child Route instances must pass a 'getParentRoute: () => ParentRoute' option that returns a Route instance.");let r=s?X:e?.path;r&&r!=="/"&&(r=pe(r));let n=e?.id||r,a=s?X:Et([this.parentRoute.id==="__root__"?"":this.parentRoute.id,n]);r==="__root__"&&(r="/"),a!=="__root__"&&(a=Et(["/",a]));let f=a==="__root__"?"/":Et([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=f,this._to=Q(f)},this.addChildren=o=>this._addFileChildren(o),this._addFileChildren=o=>(Array.isArray(o)&&(this.children=o),typeof o=="object"&&o!==null&&(this.children=Object.values(o)),this),this._addFileTypes=()=>this,this.updateLoader=o=>(Object.assign(this.options,o),this),this.update=o=>(Object.assign(this.options,o),this),this.lazy=o=>(this.lazyFn=o,this),this.redirect=o=>$t({from:this.fullPath,...o}),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}};var Ro=class extends _e{static{i(this,"BaseRootRoute")}constructor(t){super(t)}};var Ie=k(j(),1);var F=(t=>(t[t.None=0]="None",t[t.Mutable=1]="Mutable",t[t.Watching=2]="Watching",t[t.RecursedCheck=4]="RecursedCheck",t[t.Recursed=8]="Recursed",t[t.Dirty=16]="Dirty",t[t.Pending=32]="Pending",t))(F||{});function Wr({update:t,notify:o,unwatched:e}){return{link:s,unlink:r,propagate:n,checkDirty:a,shallowPropagate:f};function s(d,l,c){let p=l.depsTail;if(p!==void 0&&p.dep===d)return;let h=p!==void 0?p.nextDep:l.deps;if(h!==void 0&&h.dep===d){h.version=c,l.depsTail=h;return}let m=d.subsTail;if(m!==void 0&&m.version===c&&m.sub===l)return;let y=l.depsTail=d.subsTail={version:c,dep:d,sub:l,prevDep:p,nextDep:h,prevSub:m,nextSub:void 0};h!==void 0&&(h.prevDep=y),p!==void 0?p.nextDep=y:l.deps=y,m!==void 0?m.nextSub=y:d.subs=y}function r(d,l=d.sub){let c=d.dep,p=d.prevDep,h=d.nextDep,m=d.nextSub,y=d.prevSub;return h!==void 0?h.prevDep=p:l.depsTail=p,p!==void 0?p.nextDep=h:l.deps=h,m!==void 0?m.prevSub=y:c.subsTail=y,y!==void 0?y.nextSub=m:(c.subs=m)===void 0&&e(c),h}function n(d){let l=d.nextSub,c;t:do{let p=d.sub,h=p.flags;if(h&60?h&12?h&4?!(h&48)&&u(d,p)?(p.flags=h|40,h&=1):h=0:p.flags=h&-9|32:h=0:p.flags=h|32,h&2&&o(p),h&1){let m=p.subs;if(m!==void 0){let y=(d=m).nextSub;y!==void 0&&(c={value:l,prev:c},l=y);continue}}if((d=l)!==void 0){l=d.nextSub;continue}for(;c!==void 0;)if(d=c.value,c=c.prev,d!==void 0){l=d.nextSub;continue t}break}while(!0)}function a(d,l){let c,p=0,h=!1;t:do{let m=d.dep,y=m.flags;if(l.flags&16)h=!0;else if((y&17)===17){if(t(m)){let g=m.subs;g.nextSub!==void 0&&f(g),h=!0}}else if((y&33)===33){(d.nextSub!==void 0||d.prevSub!==void 0)&&(c={value:d,prev:c}),d=m.deps,l=m,++p;continue}if(!h){let g=d.nextDep;if(g!==void 0){d=g;continue}}for(;p--;){let g=l.subs,v=g.nextSub!==void 0;if(v?(d=c.value,c=c.prev):d=g,h){if(t(l)){v&&f(g),l=d.sub;continue}h=!1}else l.flags&=-33;l=d.sub;let R=d.nextDep;if(R!==void 0){d=R;continue t}}return h}while(!0)}function f(d){do{let l=d.sub,c=l.flags;(c&48)===32&&(l.flags=c|16,(c&6)===2&&o(l))}while((d=d.nextSub)!==void 0)}function u(d,l){let c=l.depsTail;for(;c!==void 0;){if(c===d)return!0;c=c.prevDep}return!1}}i(Wr,"createReactiveSystem");function zr(t,o,e){let s=typeof t=="object",r=s?t:void 0;return{next:(s?t.next:t)?.bind(r),error:(s?t.error:o)?.bind(r),complete:(s?t.complete:e)?.bind(r)}}i(zr,"toObserver");var So=[],be=0,{link:Vr,unlink:en,propagate:on,checkDirty:Kr,shallowPropagate:jr}=Wr({update(t){return t._update()},notify(t){So[Po++]=t,t.flags&=~F.Watching},unwatched(t){t.depsTail!==void 0&&(t.depsTail=void 0,t.flags=F.Mutable|F.Dirty,Le(t))}}),Ce=0,Po=0,lt,xo=0;function re(t){try{++xo,t()}finally{--xo||wo()}}i(re,"batch");function Le(t){let o=t.depsTail,e=o!==void 0?o.nextDep:t.deps;for(;e!==void 0;)e=en(e,t)}i(Le,"purgeDeps");function wo(){if(!(xo>0)){for(;Ce<Po;){let t=So[Ce];So[Ce++]=void 0,t.notify()}Ce=0,Po=0}}i(wo,"flush");function Me(t,o){let e=typeof t=="function",s=t,r={_snapshot:e?void 0:t,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:e?F.None:F.Mutable,get(){return lt!==void 0&&Vr(r,lt,be),r._snapshot},subscribe(n){let a=zr(n),f={current:!1},u=rn(()=>{r.get(),f.current?a.next?.(r._snapshot):f.current=!0});return{unsubscribe:i(()=>{u.stop()},"unsubscribe")}},_update(n){let a=lt,f=o?.compare??Object.is;if(e)lt=r,++be,r.depsTail=void 0;else if(n===void 0)return!1;e&&(r.flags=F.Mutable|F.RecursedCheck);try{let u=r._snapshot,d=typeof n=="function"?n(u):n===void 0&&e?s(u):n;return u===void 0||!f(u,d)?(r._snapshot=d,!0):!1}finally{lt=a,e&&(r.flags&=~F.RecursedCheck),Le(r)}}};return e?(r.flags=F.Mutable|F.Dirty,r.get=function(){let n=r.flags;if(n&F.Dirty||n&F.Pending&&Kr(r.deps,r)){if(r._update()){let a=r.subs;a!==void 0&&jr(a)}}else n&F.Pending&&(r.flags=n&~F.Pending);return lt!==void 0&&Vr(r,lt,be),r._snapshot}):r.set=function(n){if(r._update(n)){let a=r.subs;a!==void 0&&(on(a),jr(a),wo())}},r}i(Me,"createAtom");function rn(t){let o=i(()=>{let s=lt;lt=e,++be,e.depsTail=void 0,e.flags=F.Watching|F.RecursedCheck;try{return t()}finally{lt=s,e.flags&=~F.RecursedCheck,Le(e)}},"run"),e={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:F.Watching|F.RecursedCheck,notify(){let s=this.flags;s&F.Dirty||s&F.Pending&&Kr(this.deps,this)?o():this.flags=F.Watching},stop(){this.flags=F.None,this.depsTail=void 0,Le(this)}};return o(),e}i(rn,"effect");var _o=k(j(),1),qr=k(ws(),1);function sn(t,o){return t===o}i(sn,"defaultCompare");function B(t,o,e=sn){let s=(0,_o.useCallback)(a=>{if(!t)return()=>{};let{unsubscribe:f}=t.subscribe(a);return f},[t]),r=(0,_o.useCallback)(()=>t?.get(),[t]);return(0,qr.useSyncExternalStoreWithSelector)(s,r,r,o,e)}i(B,"useStore");var Co={get(){},subscribe(){return{unsubscribe(){}}}};function bo(t,o){let e=Ie.useRef();return s=>{let r=t?.select?t.select(s):s;return t?.structuralSharing??o.options.defaultStructuralSharing?e.current=at(e.current,r):r}}i(bo,"useStructuralSharing");function tt(t){let o=D(),e=Ie.useContext(t.from?Zo:Mt),s=t.from?o.stores.getRouteMatchStore(t.from):o.stores.matchStores.get(e);if(!1){let a=s?.get();if(!a){if(t.shouldThrow??!0)throw new Error(`Invariant failed: Could not find ${t.from?`an active match from "${t.from}"`:"a nearest match!"}`);return}return t.select?t.select(a):a}let r=bo(t,o),n=B(s??Co,a=>a?r(a):Co);if(n!==Co)return n;if(t.shouldThrow??!0)throw new Error(`Invariant failed: Could not find ${t.from?`an active match from "${t.from}"`:"a nearest match!"}`)}i(tt,"useMatch");function Ee(t){return tt({from:t.from,strict:t.strict,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,select:i(o=>t.select?t.select(o.search):o.search,"select")})}i(Ee,"useSearch");var nt=k(j(),1);var Tt=typeof window<"u"?nt.useLayoutEffect:nt.useEffect;function ke(t){let o=nt.useRef({value:t,prev:null}),e=o.current.value;return t!==e&&(o.current={value:t,prev:e}),o.current.prev}i(ke,"usePrevious");function Gr(t,o,e={},s={}){nt.useEffect(()=>{if(!t.current||s.disabled||typeof IntersectionObserver!="function")return;let r=new IntersectionObserver(([n])=>{o(n)},e);return r.observe(t.current),()=>{r.disconnect()}},[o,e,s.disabled,t])}i(Gr,"useIntersectionObserver");function Jr(t){let o=nt.useRef(null);return nt.useImperativeHandle(t,()=>o.current,[]),o}i(Jr,"useForwardedRef");var Lo=k(j(),1);function Te(t){let o=D();return Lo.useCallback(e=>o.navigate({...e,from:e.from??t?.from}),[t?.from,o])}i(Te,"useNavigate");var jt=k(j(),1),it=k(rt(),1);function Ot(t){let o=t.errorComponent??Nt;return(0,it.jsx)(nn,{getResetKey:t.getResetKey,onCatch:t.onCatch,children:i(({error:e,reset:s})=>e?jt.createElement(o,{error:e,reset:s}):t.children,"children")})}i(Ot,"CatchBoundary");var nn=class extends jt.Component{static{i(this,"CatchBoundaryImpl")}constructor(...t){super(...t),this.state={error:null}}static getDerivedStateFromProps(t,o){let e=t.getResetKey();return o.error&&o.resetKey!==e?{resetKey:e,error:null}:{resetKey:e}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidCatch(t,o){this.props.onCatch&&this.props.onCatch(t,o)}render(){return this.props.children({error:this.state.error,reset:i(()=>{this.reset()},"reset")})}};function Nt({error:t}){let[o,e]=jt.useState(!0);return(0,it.jsxs)("div",{style:{padding:".5rem",maxWidth:"100%"},children:[(0,it.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[(0,it.jsx)("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),(0,it.jsx)("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:i(()=>e(s=>!s),"onClick"),children:o?"Hide Error":"Show Error"})]}),(0,it.jsx)("div",{style:{height:".25rem"}}),o?(0,it.jsx)("div",{children:(0,it.jsx)("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:t.message?(0,it.jsx)("code",{children:t.message}):null})}):null]})}i(Nt,"ErrorComponent");var Oe=k(j(),1),Mo=k(rt(),1);function Yr({children:t,fallback:o=null}){return Io()?(0,Mo.jsx)(Oe.default.Fragment,{children:t}):(0,Mo.jsx)(Oe.default.Fragment,{children:o})}i(Yr,"ClientOnly");function Io(){return Oe.default.useSyncExternalStore(an,()=>!0,()=>!1)}i(Io,"useHydrated");function an(){return()=>{}}i(an,"subscribe");function Eo(t){return tt({from:t.from,strict:t.strict,structuralSharing:t.structuralSharing,select:i(o=>t.select?t.select(o.loaderData):o.loaderData,"select")})}i(Eo,"useLoaderData");function ko(t){let{select:o,...e}=t;return tt({...e,select:i(s=>o?o(s.loaderDeps):s.loaderDeps,"select")})}i(ko,"useLoaderDeps");function To(t){return tt({from:t.from,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,strict:t.strict,select:i(o=>{let e=t.strict===!1?o.params:o._strictParams;return t.select?t.select(e):e},"select")})}i(To,"useParams");function Oo(t){return tt({...t,select:i(o=>t.select?t.select(o.context):o.context,"select")})}i(Oo,"useRouteContext");var U=k(j(),1),cn=k(rt(),1);var os=k(xs(),1);function un(t,o){let e=D(),s=Jr(o),r=!1,{activeProps:n,inactiveProps:a,activeOptions:f,to:u,preload:d,preloadDelay:l,preloadIntentProximity:c,hashScrollIntoView:p,replace:h,startTransition:m,resetScroll:y,viewTransition:g,children:v,target:R,disabled:S,style:P,className:_,onClick:b,onBlur:x,onFocus:w,onMouseEnter:C,onMouseLeave:I,onTouchStart:L,ignoreBlocker:M,params:et,search:W,hash:dt,state:ie,mask:ot,reloadDocument:qt,unsafeRelative:Bo,from:$o,_fromLocation:ae,...Dt}=t;if(r){let O=es(u);if(typeof u=="string"&&!O&&u.indexOf(":")>-1)try{return new URL(u),ut(u,e.protocolAllowlist)?(console.warn(`Blocked Link with dangerous protocol: ${u}`),{...Dt,ref:s,href:void 0,...v&&{children:v},...R&&{target:R},...S&&{disabled:S},...P&&{style:P},..._&&{className:_}}):{...Dt,ref:s,href:u,...v&&{children:v},...R&&{target:R},...S&&{disabled:S},...P&&{style:P},..._&&{className:_}}}catch{}let T=e.buildLocation({...t,from:t.from}),Z=ts(T.maskedLocation?T.maskedLocation.publicHref:T.publicHref,T.maskedLocation?T.maskedLocation.external:T.external,e.history,S),Yt=(()=>{if(Z?.external){if(ut(Z.href,e.protocolAllowlist)){console.warn(`Blocked Link with dangerous protocol: ${Z.href}`);return}return Z.href}if(!O&&typeof u=="string"&&u.indexOf(":")>-1)try{if(new URL(u),ut(u,e.protocolAllowlist)){console.warn(`Blocked Link with dangerous protocol: ${u}`);return}return u}catch{}})(),Ve=(()=>{if(Yt)return!1;let V=e.stores.location.get(),G=f?.exact??!1;if(G){if(!me(V.pathname,T.pathname,e.basepath))return!1}else{let z=Pt(V.pathname,e.basepath),J=Pt(T.pathname,e.basepath);if(!(z.startsWith(J)&&(z.length===J.length||z[J.length]==="/")))return!1}if((f?.includeSearch??!0)&&V.search!==T.search){let z=!V.search||typeof V.search=="object"&&!mt(V.search),J=!T.search||typeof T.search=="object"&&!mt(T.search);if(!(z&&J)&&!st(V.search,T.search,{partial:!G,ignoreUndefined:!f?.explicitUndefined}))return!1}return!f?.includeHash})();if(Yt)return{...Dt,ref:s,href:Yt,...v&&{children:v},...R&&{target:R},...S&&{disabled:S},...P&&{style:P},..._&&{className:_}};let je=Ve?Y(n,{})??Xr:zt,ze=Ve?zt:Y(a,{})??zt,Go=(()=>{let V=P,G=je.style,z=ze.style;if(!(!V&&!G&&!z))return V&&!G&&!z?V:!V&&G&&!z?G:!V&&!G&&z?z:{...V,...G,...z}})(),Jo=(()=>{let V=_,G=je.className,z=ze.className;if(!V&&!G&&!z)return"";let J="";return V&&(J=V),G&&(J=J?`${J} ${G}`:G),z&&(J=J?`${J} ${z}`:z),J})();return{...Dt,...je,...ze,href:Z?.href,ref:s,disabled:!!S,target:R,...Go&&{style:Go},...Jo&&{className:Jo},...S&&Zr,...Ve&&Qr}}let Ue=Io(),Gt=U.useMemo(()=>t,[e,t.from,t._fromLocation,t.hash,t.to,t.search,t.params,t.state,t.mask,t.unsafeRelative]),bt=B(e.stores.location,O=>O,(O,T)=>O.href===T.href),q=U.useMemo(()=>{let O={_fromLocation:bt,...Gt};return e.buildLocation(O)},[e,bt,Gt]),Uo=q.maskedLocation?q.maskedLocation.publicHref:q.publicHref,Ho=q.maskedLocation?q.maskedLocation.external:q.external,Ft=U.useMemo(()=>ts(Uo,Ho,e.history,S),[S,Ho,Uo,e.history]),Jt=U.useMemo(()=>{if(Ft?.external){if(ut(Ft.href,e.protocolAllowlist)){console.warn(`Blocked Link with dangerous protocol: ${Ft.href}`);return}return Ft.href}if(!es(u)&&!(typeof u!="string"||u.indexOf(":")===-1))try{if(new URL(u),ut(u,e.protocolAllowlist)){console.warn(`Blocked Link with dangerous protocol: ${u}`);return}return u}catch{}},[u,Ft,e.protocolAllowlist]),He=U.useMemo(()=>{if(Jt)return!1;if(f?.exact){if(!me(bt.pathname,q.pathname,e.basepath))return!1}else{let O=Pt(bt.pathname,e.basepath),T=Pt(q.pathname,e.basepath);if(!(O.startsWith(T)&&(O.length===T.length||O[T.length]==="/")))return!1}return(f?.includeSearch??!0)&&!st(bt.search,q.search,{partial:!f?.exact,ignoreUndefined:!f?.explicitUndefined})?!1:f?.includeHash?Ue&&bt.hash===q.hash:!0},[f?.exact,f?.explicitUndefined,f?.includeHash,f?.includeSearch,bt,Jt,Ue,q.hash,q.pathname,q.search,e.basepath]),ce=He?Y(n,{})??Xr:zt,ue=He?zt:Y(a,{})??zt,Wo=[_,ce.className,ue.className].filter(Boolean).join(" "),Vo=(P||ce.style||ue.style)&&{...P,...ce.style,...ue.style},[Rs,jo]=U.useState(!1),zo=U.useRef(!1),At=t.reloadDocument||Jt?!1:d??e.options.defaultPreload,We=l??e.options.defaultPreloadDelay??0,Lt=U.useCallback(()=>{e.preloadRoute({...Gt,_builtLocation:q}).catch(O=>{console.warn(O),console.warn(yo)})},[e,Gt,q]);Gr(s,U.useCallback(O=>{O?.isIntersecting&&Lt()},[Lt]),fn,{disabled:!!S||At!=="viewport"}),U.useEffect(()=>{zo.current||!S&&At==="render"&&(Lt(),zo.current=!0)},[S,Lt,At]);let Ss=i(O=>{let T=O.currentTarget.getAttribute("target"),Z=R!==void 0?R:T;if(!S&&!dn(O)&&!O.defaultPrevented&&(!Z||Z==="_self")&&O.button===0){O.preventDefault(),(0,os.flushSync)(()=>{jo(!0)});let Yt=e.subscribe("onResolved",()=>{Yt(),jo(!1)});e.navigate({...Gt,replace:h,resetScroll:y,hashScrollIntoView:p,startTransition:m,viewTransition:g,ignoreBlocker:M})}},"handleClick");if(Jt)return{...Dt,ref:s,href:Jt,...v&&{children:v},...R&&{target:R},...S&&{disabled:S},...P&&{style:P},..._&&{className:_},...b&&{onClick:b},...x&&{onBlur:x},...w&&{onFocus:w},...C&&{onMouseEnter:C},...I&&{onMouseLeave:I},...L&&{onTouchStart:L}};let Ko=i(O=>{if(S||At!=="intent")return;if(!We){Lt();return}let T=O.currentTarget;if(se.has(T))return;let Z=setTimeout(()=>{se.delete(T),Lt()},We);se.set(T,Z)},"enqueueIntentPreload"),Ps=i(O=>{S||At!=="intent"||Lt()},"handleTouchStart"),qo=i(O=>{if(S||!At||!We)return;let T=O.currentTarget,Z=se.get(T);Z&&(clearTimeout(Z),se.delete(T))},"handleLeave");return{...Dt,...ce,...ue,href:Ft?.href,ref:s,onClick:Kt([b,Ss]),onBlur:Kt([x,qo]),onFocus:Kt([w,Ko]),onMouseEnter:Kt([C,Ko]),onMouseLeave:Kt([I,qo]),onTouchStart:Kt([L,Ps]),disabled:!!S,target:R,...Vo&&{style:Vo},...Wo&&{className:Wo},...S&&Zr,...He&&Qr,...Ue&&Rs&&ln}}i(un,"useLinkProps");var zt={},Xr={className:"active"},Zr={role:"link","aria-disabled":!0},Qr={"data-status":"active","aria-current":"page"},ln={"data-transitioning":"transitioning"},se=new WeakMap,fn={rootMargin:"100px"},Kt=i(t=>o=>{for(let e of t)if(e){if(o.defaultPrevented)return;e(o)}},"composeHandlers");function ts(t,o,e,s){if(!s)return o?{href:t,external:!0}:{href:e.createHref(t)||"/",external:!1}}i(ts,"getHrefOption");function es(t){if(typeof t!="string")return!1;let o=t.charCodeAt(0);return o===47?t.charCodeAt(1)!==47:o===46}i(es,"isSafeInternal");var No=U.forwardRef((t,o)=>{let{_asChild:e,...s}=t,{type:r,...n}=un(s,o),a=typeof s.children=="function"?s.children({isActive:n["data-status"]==="active"}):s.children;if(!e){let{disabled:f,...u}=n;return U.createElement("a",u,a)}return U.createElement(e,n,a)});function dn(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}i(dn,"isCtrlEvent");var Do=k(j(),1),Fo=k(rt(),1);var rs=class extends _e{static{i(this,"Route")}constructor(t){super(t),this.useMatch=o=>tt({select:o?.select,from:this.id,structuralSharing:o?.structuralSharing}),this.useRouteContext=o=>Oo({...o,from:this.id}),this.useSearch=o=>Ee({select:o?.select,structuralSharing:o?.structuralSharing,from:this.id}),this.useParams=o=>To({select:o?.select,structuralSharing:o?.structuralSharing,from:this.id}),this.useLoaderDeps=o=>ko({...o,from:this.id}),this.useLoaderData=o=>Eo({...o,from:this.id}),this.useNavigate=()=>Te({from:this.fullPath}),this.Link=Do.default.forwardRef((o,e)=>(0,Fo.jsx)(No,{ref:e,from:this.fullPath,...o}))}};function hn(t){return new rs(t)}i(hn,"createRoute");var ss=class extends Ro{static{i(this,"RootRoute")}constructor(t){super(t),this.useMatch=o=>tt({select:o?.select,from:this.id,structuralSharing:o?.structuralSharing}),this.useRouteContext=o=>Oo({...o,from:this.id}),this.useSearch=o=>Ee({select:o?.select,structuralSharing:o?.structuralSharing,from:this.id}),this.useParams=o=>To({select:o?.select,structuralSharing:o?.structuralSharing,from:this.id}),this.useLoaderDeps=o=>ko({...o,from:this.id}),this.useLoaderData=o=>Eo({...o,from:this.id}),this.useNavigate=()=>Te({from:this.fullPath}),this.Link=Do.default.forwardRef((o,e)=>(0,Fo.jsx)(No,{ref:e,from:this.fullPath,...o}))}};function pn(t){return new ss(t)}i(pn,"createRootRoute");var wc=k(j(),1),Ne=k(rt(),1);function ns(t){let o=D();if(!1){let s=`not-found-${o.stores.location.get().pathname}-${o.stores.status.get()}`;return(0,Ne.jsx)(Ot,{getResetKey:i(()=>s,"getResetKey"),onCatch:i((r,n)=>{if(A(r))t.onCatch?.(r,n);else throw r},"onCatch"),errorComponent:i(({error:r})=>{if(A(r))return t.fallback?.(r);throw r},"errorComponent"),children:t.children})}let e=`not-found-${B(o.stores.location,s=>s.pathname)}-${B(o.stores.status,s=>s)}`;return(0,Ne.jsx)(Ot,{getResetKey:i(()=>e,"getResetKey"),onCatch:i((s,r)=>{if(A(s))t.onCatch?.(s,r);else throw s},"onCatch"),errorComponent:i(({error:s})=>{if(A(s))return t.fallback?.(s);throw s},"errorComponent"),children:t.children})}i(ns,"CatchNotFound");function is(){return(0,Ne.jsx)("p",{children:"Not Found"})}i(is,"DefaultGlobalNotFound");var as=k(rt(),1);function cs({children:t}){let o=D();return null}i(cs,"ScriptOnce");var Ec=k(j(),1),De=k(rt(),1);function _t(t){return(0,De.jsx)(De.Fragment,{children:t.children})}i(_t,"SafeFragment");var Nc=k(j(),1),Fe=k(rt(),1);function Ae(t,o,e){return o.options.notFoundComponent?(0,Fe.jsx)(o.options.notFoundComponent,{...e}):t.options.defaultNotFoundComponent?(0,Fe.jsx)(t.options.defaultNotFoundComponent,{...e}):(o.options.notFoundComponent||console.warn(`Warning: A notFoundError was encountered on the route with ID "${o.id}", but a notFoundComponent option was not configured, nor was a router level defaultNotFoundComponent configured. Consider configuring at least one of these to avoid TanStack Router's overly generic defaultNotFoundComponent (<p>Not Found</p>)`),(0,Fe.jsx)(is,{}))}i(Ae,"renderRouteNotFound");var ls=k(rt(),1);function us(t){return null}i(us,"getScrollRestorationScriptForRouter");function fs(){let t=us(D());return t?(0,ls.jsx)(cs,{children:t}):null}i(fs,"ScrollRestoration");var K=k(j(),1),N=k(rt(),1);var mn=i((t,o)=>t.routeId===o.routeId&&t._displayPending===o._displayPending,"matchViewFieldsEqual"),gn=i((t,o)=>t[0]===o[0]&&t[1]===o[1],"outletMatchSelectionEqual"),Be=K.memo(i(function({matchId:o}){let e=D();if(!1){let a=e.stores.matchStores.get(o)?.get();if(!a)throw new Error(`Invariant failed: Could not find match for matchId "${o}". Please file an issue!`);let f=a.routeId,u=e.routesById[f].parentRoute?.id;return(0,N.jsx)(ds,{router:e,matchId:o,resetKey:e.stores.loadedAt.get(),matchState:{routeId:f,ssr:a.ssr,_displayPending:a._displayPending,parentRouteId:u}})}let s=e.stores.matchStores.get(o);if(!s)throw new Error(`Invariant failed: Could not find match for matchId "${o}". Please file an issue!`);let r=B(e.stores.loadedAt,a=>a),n=B(s,a=>a,mn);return(0,N.jsx)(ds,{router:e,matchId:o,resetKey:r,matchState:K.useMemo(()=>{let a=n.routeId,f=e.routesById[a].parentRoute?.id;return{routeId:a,ssr:n.ssr,_displayPending:n._displayPending,parentRouteId:f}},[n._displayPending,n.routeId,n.ssr,e.routesById])})},"MatchImpl"));function ds({router:t,matchId:o,resetKey:e,matchState:s}){let r=t.routesById[s.routeId],n=r.options.pendingComponent??t.options.defaultPendingComponent,a=n?(0,N.jsx)(n,{}):null,f=r.options.errorComponent??t.options.defaultErrorComponent,u=r.options.onCatch??t.options.defaultOnCatch,d=r.isRoot?r.options.notFoundComponent??t.options.notFoundRoute?.options.component:r.options.notFoundComponent,l=s.ssr===!1||s.ssr==="data-only",c=(!r.isRoot||r.options.wrapInSuspense||l)&&(r.options.wrapInSuspense??n??(r.options.errorComponent?.preload||l))?K.Suspense:_t,p=f?Ot:_t,h=d?ns:_t;return(0,N.jsxs)(r.isRoot?r.options.shellComponent??_t:_t,{children:[(0,N.jsx)(Mt.Provider,{value:o,children:(0,N.jsx)(c,{fallback:a,children:(0,N.jsx)(p,{getResetKey:i(()=>e,"getResetKey"),errorComponent:f||Nt,onCatch:i((m,y)=>{if(A(m))throw m.routeId??=s.routeId,m;console.warn(`Warning: Error in route match: ${o}`),u?.(m,y)},"onCatch"),children:(0,N.jsx)(h,{fallback:i(m=>{if(m.routeId??=s.routeId,!d||m.routeId&&m.routeId!==s.routeId||!m.routeId&&!r.isRoot)throw m;return K.createElement(d,m)},"fallback"),children:l||s._displayPending?(0,N.jsx)(Yr,{fallback:a,children:(0,N.jsx)(hs,{matchId:o})}):(0,N.jsx)(hs,{matchId:o})})})})}),s.parentRouteId===X?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(vn,{}),t.options.scrollRestoration&&!1?(0,N.jsx)(fs,{}):null]}):null]})}i(ds,"MatchView");function vn(){let t=D();if(!1)return null;let o=K.useRef();return Tt(()=>{let e=t.stores.resolvedLocation.get(),s=o.current;e&&(!s||s.href!==e.href)&&t.emit({type:"onRendered",...ht(t.stores.location.get(),s??e)}),o.current=e},[B(t.stores.resolvedLocation,e=>e?.state.__TSR_key),t]),null}i(vn,"OnRendered");var hs=K.memo(i(function({matchId:o}){let e=D(),s=i((l,c)=>e.getMatch(l.id)?._nonReactive[c]??l._nonReactive[c],"getMatchPromise");if(!1){let l=e.stores.matchStores.get(o)?.get();if(!l)throw new Error(`Invariant failed: Could not find match for matchId "${o}". Please file an issue!`);let c=l.routeId,p=e.routesById[c],h=(e.routesById[c].options.remountDeps??e.options.defaultRemountDeps)?.({routeId:c,loaderDeps:l.loaderDeps,params:l._strictParams,search:l._strictSearch}),m=h?JSON.stringify(h):void 0,y=p.options.component??e.options.defaultComponent,g=y?(0,N.jsx)(y,{},m):(0,N.jsx)(Ao,{});if(l._displayPending)throw s(l,"displayPendingPromise");if(l._forcePending)throw s(l,"minPendingPromise");if(l.status==="pending")throw s(l,"loadPromise");if(l.status==="notFound"){if(!A(l.error))throw new Error("Invariant failed: Expected a notFound error");return Ae(e,p,l.error)}if(l.status==="redirected")throw H(l.error)?s(l,"loadPromise"):new Error("Invariant failed: Expected a redirect error");return l.status==="error"?(0,N.jsx)((p.options.errorComponent??e.options.defaultErrorComponent)||Nt,{error:l.error,reset:void 0,info:{componentStack:""}}):g}let r=e.stores.matchStores.get(o);if(!r)throw new Error(`Invariant failed: Could not find match for matchId "${o}". Please file an issue!`);let n=B(r,l=>l),a=n.routeId,f=e.routesById[a],u=K.useMemo(()=>{let l=(e.routesById[a].options.remountDeps??e.options.defaultRemountDeps)?.({routeId:a,loaderDeps:n.loaderDeps,params:n._strictParams,search:n._strictSearch});return l?JSON.stringify(l):void 0},[a,n.loaderDeps,n._strictParams,n._strictSearch,e.options.defaultRemountDeps,e.routesById]),d=K.useMemo(()=>{let l=f.options.component??e.options.defaultComponent;return l?(0,N.jsx)(l,{},u):(0,N.jsx)(Ao,{})},[u,f.options.component,e.options.defaultComponent]);if(n._displayPending)throw s(n,"displayPendingPromise");if(n._forcePending)throw s(n,"minPendingPromise");if(n.status==="pending"){let l=f.options.pendingMinMs??e.options.defaultPendingMinMs;if(l){let c=e.getMatch(n.id);if(c&&!c._nonReactive.minPendingPromise&&!!1){let p=ct();c._nonReactive.minPendingPromise=p,setTimeout(()=>{p.resolve(),c._nonReactive.minPendingPromise=void 0},l)}}throw s(n,"loadPromise")}if(n.status==="notFound"){if(!A(n.error))throw new Error("Invariant failed: Expected a notFound error");return Ae(e,f,n.error)}if(n.status==="redirected")throw H(n.error)?s(n,"loadPromise"):new Error("Invariant failed: Expected a redirect error");if(n.status==="error"){if(!1)return(0,N.jsx)((f.options.errorComponent??e.options.defaultErrorComponent)||Nt,{error:n.error,reset:void 0,info:{componentStack:""}});throw n.error}return d},"MatchInnerImpl")),Ao=K.memo(i(function(){let o=D(),e=K.useContext(Mt),s,r=!1,n;if(!1){let d=o.stores.matches.get(),l=e?d.findIndex(p=>p.id===e):-1,c=l>=0?d[l]:void 0;s=c?.routeId,r=c?.globalNotFound??!1,n=l>=0?d[l+1]?.id:void 0}else{let d=e?o.stores.matchStores.get(e):void 0;[s,r]=B(d,l=>[l?.routeId,l?.globalNotFound??!1],gn),n=B(o.stores.matchesId,l=>l[l.findIndex(c=>c===e)+1])}let a=s?o.routesById[s]:void 0,f=o.options.defaultPendingComponent?(0,N.jsx)(o.options.defaultPendingComponent,{}):null;if(r){if(!a)throw new Error("Invariant failed: Could not resolve route for Outlet render");return Ae(o,a,void 0)}if(!n)return null;let u=(0,N.jsx)(Be,{matchId:n});return s===X?(0,N.jsx)(K.Suspense,{fallback:f,children:u}):u},"OutletImpl"));var Ct=k(j(),1);function ps(){let t=D(),o=Ct.useRef({router:t,mounted:!1}),[e,s]=Ct.useState(!1),r=B(t.stores.isLoading,c=>c),n=B(t.stores.hasPending,c=>c),a=ke(r),f=r||e||n,u=ke(f),d=r||n,l=ke(d);return t.startTransition=c=>{s(!0),Ct.startTransition(()=>{c(),s(!1)})},Ct.useEffect(()=>{let c=t.history.subscribe(t.load),p=t.buildLocation({to:t.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Q(t.latestLocation.publicHref)!==Q(p.publicHref)&&t.commitLocation({...p,replace:!0}),()=>{c()}},[t,t.history]),Tt(()=>{if(typeof window<"u"&&t.ssr||o.current.router===t&&o.current.mounted)return;o.current={router:t,mounted:!0},i(async()=>{try{await t.load()}catch(p){console.error(p)}},"tryLoad")()},[t]),Tt(()=>{a&&!r&&t.emit({type:"onLoad",...ht(t.stores.location.get(),t.stores.resolvedLocation.get())})},[a,t,r]),Tt(()=>{l&&!d&&t.emit({type:"onBeforeRouteMount",...ht(t.stores.location.get(),t.stores.resolvedLocation.get())})},[d,l,t]),Tt(()=>{if(u&&!f){let c=ht(t.stores.location.get(),t.stores.resolvedLocation.get());t.emit({type:"onResolved",...c}),re(()=>{t.stores.status.set("idle"),t.stores.resolvedLocation.set(t.stores.location.get())})}},[f,u,t]),null}i(ps,"Transitioner");var $e=k(j(),1),ft=k(rt(),1);function ms(){let t=D(),o=t.routesById[X].options.pendingComponent??t.options.defaultPendingComponent,e=o?(0,ft.jsx)(o,{}):null,s=(0,ft.jsxs)(typeof document<"u"&&t.ssr?_t:$e.Suspense,{fallback:e,children:[!!1&&(0,ft.jsx)(ps,{}),(0,ft.jsx)(yn,{})]});return t.options.InnerWrap?(0,ft.jsx)(t.options.InnerWrap,{children:s}):s}i(ms,"Matches");function yn(){let t=D(),o=!1,e=o?t.stores.firstId.get():B(t.stores.firstId,n=>n),s=o?t.stores.loadedAt.get():B(t.stores.loadedAt,n=>n),r=e?(0,ft.jsx)(Be,{matchId:e}):null;return(0,ft.jsx)(Mt.Provider,{value:e,children:t.options.disableGlobalCatchBoundary?r:(0,ft.jsx)(Ot,{getResetKey:i(()=>s,"getResetKey"),errorComponent:Nt,onCatch:n=>{console.warn("Warning: The following error wasn't caught by any route! At the very least, consider setting an 'errorComponent' in your RootRoute!"),console.warn(`Warning: ${n.message||n.toString()}`)},children:r})})}i(yn,"MatchesInner");var gs=i(t=>({createMutableStore:Me,createReadonlyStore:Me,batch:re}),"getStoreFactory");var Rn=i(t=>new vs(t),"createRouter"),vs=class extends go{static{i(this,"Router")}constructor(t){super(t,gs)}};var ku=k(j(),1),ne=k(rt(),1);function ys({router:t,children:o,...e}){mt(e)&&t.update({...t.options,...e,context:{...t.options.context,...e.context}});let s=(0,ne.jsx)(le.Provider,{value:t,children:o});return t.options.Wrap?(0,ne.jsx)(t.options.Wrap,{children:s}):s}i(ys,"RouterContextProvider");function Sn({router:t,...o}){return(0,ne.jsx)(ys,{router:t,...o,children:(0,ne.jsx)(ms,{})})}i(Sn,"RouterProvider");function Pn(t){let o=D({warn:t?.router===void 0}),e=t?.router||o;if(!1){let s=e.stores.__store.get();return t?.select?t.select(s):s}return B(e.stores.__store,bo(t,e))}i(Pn,"useRouterState");export{po as a,Ws as b,D as c,Ee as d,Te as e,hn as f,pn as g,Ao as h,Rn as i,Sn as j,Pn as k};
|