@lunora/studio 1.0.0-alpha.53 → 1.0.0-alpha.55
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/dist/index.d.ts +680 -780
- package/dist/index.js +8 -8
- package/dist/mount.d.ts +10 -10
- package/dist/mount.js +1 -1
- package/dist/packem_chunks/ApiTab.js +1 -1
- package/dist/packem_chunks/AuditPanel.js +2 -2
- package/dist/packem_chunks/ExportImportPanel.js +2 -2
- package/dist/packem_chunks/FileBrowser.js +3 -3
- package/dist/packem_chunks/FunctionRunner.js +1 -1
- package/dist/packem_chunks/FunctionStatsPanel.js +2 -2
- package/dist/packem_chunks/HealthPanel.js +2 -2
- package/dist/packem_chunks/InsightsPanel.js +2 -2
- package/dist/packem_chunks/LogsPanel.js +81 -53
- package/dist/packem_chunks/MailPanel.js +1 -1
- package/dist/packem_chunks/MetricsPanel.js +392 -7
- package/dist/packem_chunks/MigrationsPanel.js +2 -2
- package/dist/packem_chunks/PitrPanel.js +1 -1
- package/dist/packem_chunks/SchemaViewer.js +2 -2
- package/dist/packem_chunks/SecurityAdvisorPanel.js +2 -2
- package/dist/packem_chunks/SettingsPanel.js +3 -3
- package/dist/packem_chunks/SqlEditorPanel.js +1 -1
- package/dist/packem_chunks/TableEditor.js +2 -2
- package/dist/packem_chunks/agents-panel.js +2 -2
- package/dist/packem_chunks/analytics-panel.js +1 -1
- package/dist/packem_chunks/auth-config-panel.js +1 -1
- package/dist/packem_chunks/auth-sessions-panel.js +1 -1
- package/dist/packem_chunks/containers-panel.js +2 -2
- package/dist/packem_chunks/dashboards-panel.js +2 -2
- package/dist/packem_chunks/fanout-panel.js +2 -2
- package/dist/packem_chunks/flags-panel.js +2 -2
- package/dist/packem_chunks/issues-panel.js +2 -2
- package/dist/packem_chunks/kv-browser.js +2 -2
- package/dist/packem_chunks/log-drains-panel.js +2 -2
- package/dist/packem_chunks/organizations-panel.js +1 -1
- package/dist/packem_chunks/payments-panel.js +2 -2
- package/dist/packem_chunks/permissions-panel.js +2 -2
- package/dist/packem_chunks/queues-panel.js +2 -2
- package/dist/packem_chunks/rls-panel.js +2 -2
- package/dist/packem_chunks/schedule-panel.js +2 -2
- package/dist/packem_chunks/storage-rules-panel.js +2 -2
- package/dist/packem_chunks/subscriptions-panel.js +2 -2
- package/dist/packem_chunks/traces-panel.js +734 -0
- package/dist/packem_chunks/users-panel.js +1 -1
- package/dist/packem_chunks/vector-browser.js +1 -1
- package/dist/packem_chunks/workflows-panel.js +2 -2
- package/dist/packem_shared/{ADMIN_FUNCTIONS-DNeyYtUN.js → ADMIN_FUNCTIONS-C6TEeUiJ.js} +2 -0
- package/dist/packem_shared/{ApiDocsPanel-_aEZxAMX.js → ApiDocsPanel-CcC6ucbp.js} +1 -1
- package/dist/packem_shared/{DataBrowser-C8hejnub.js → DataBrowser-BuFEPTiv.js} +1 -1
- package/dist/packem_shared/{GlobalDataBrowser-f5Ll2AQK.js → GlobalDataBrowser-D8h1fTL1.js} +1 -1
- package/dist/packem_shared/{HomePanel-Ye8PaqQL.js → HomePanel-2I1YZm0A.js} +3 -3
- package/dist/packem_shared/{ScheduledJobs-dHMgnJbx.js → ScheduledJobs-Cz5Tr-M6.js} +1 -1
- package/dist/packem_shared/{Studio-BNGjxLVo.js → Studio-CCJBI2wP.js} +2 -2
- package/dist/packem_shared/{StudioApp-K9dn1Q9d.js → StudioApp-Daeqxw2h.js} +1 -1
- package/dist/packem_shared/{advisor-view-Cx21PS_T.js → advisor-view-1RaDWED7.js} +1 -1
- package/dist/packem_shared/app.d-C-kxb-1T.d.ts +254 -0
- package/dist/packem_shared/{card-DURq3ElK.js → card-F2vH_aj2.js} +1 -1
- package/dist/packem_shared/{cf-links-BZfRdxSE.js → cf-links-SIbyi4Y1.js} +1 -1
- package/dist/packem_shared/{home-panel-D62G8108.js → home-panel-DHHUtnKU.js} +2 -2
- package/dist/packem_shared/log-fields-jEH83H2G.js +18 -0
- package/dist/packem_shared/{studio-Cd21fp4v.js → studio-0479nrrm.js} +551 -524
- package/dist/standalone/{chunk-SDQE2IUJ.js → chunk-3W4CSGDO.js} +1 -1
- package/dist/standalone/{chunk-FFVSSWU2.js → chunk-4AZYW2PI.js} +1 -1
- package/dist/standalone/{chunk-ZQQ3MFEQ.js → chunk-4F72YCTU.js} +1 -1
- package/dist/standalone/{chunk-IZN4TYMN.js → chunk-5IGHDPEP.js} +1 -1
- package/dist/standalone/{chunk-T7FHIJ2T.js → chunk-6LLFTVEI.js} +1 -1
- package/dist/standalone/{chunk-JPILGFXT.js → chunk-7YGTGBP7.js} +1 -1
- package/dist/standalone/{chunk-OETK333R.js → chunk-AE3AKGOW.js} +1 -1
- package/dist/standalone/{chunk-TO6D2PJC.js → chunk-CHNXZYAC.js} +1 -1
- package/dist/standalone/{chunk-R2MAZ2OH.js → chunk-CW7LZ4SR.js} +1 -1
- package/dist/standalone/{chunk-WUFVFVHJ.js → chunk-D73WYMRU.js} +1 -1
- package/dist/standalone/{chunk-YFZ27MEC.js → chunk-DVBY6YQK.js} +1 -1
- package/dist/standalone/chunk-EBTLTGG3.js +1 -0
- package/dist/standalone/chunk-EIZG4GOM.js +1 -0
- package/dist/standalone/{chunk-DMFVDMUJ.js → chunk-EPDC422O.js} +1 -1
- package/dist/standalone/{chunk-ISOUWAPB.js → chunk-FBGC3RSU.js} +1 -1
- package/dist/standalone/{chunk-LUP4YTBS.js → chunk-FDWXYXOM.js} +1 -1
- package/dist/standalone/{chunk-XXAW7V4T.js → chunk-FPKTXKPE.js} +1 -1
- package/dist/standalone/{chunk-AITOCPML.js → chunk-FQUNSQLG.js} +1 -1
- package/dist/standalone/{chunk-HRHG4HOZ.js → chunk-FXNS5NBY.js} +1 -1
- package/dist/standalone/{chunk-3GVA2ROQ.js → chunk-G4GGGHEV.js} +1 -1
- package/dist/standalone/{chunk-C4QK2DJN.js → chunk-G5CMK5GY.js} +1 -1
- package/dist/standalone/{chunk-GPQX3AEO.js → chunk-G5RC7USY.js} +1 -1
- package/dist/standalone/{chunk-PWKD5FTM.js → chunk-GVFODXW2.js} +1 -1
- package/dist/standalone/{chunk-MDTNVR3G.js → chunk-HNIDN3RX.js} +1 -1
- package/dist/standalone/{chunk-XXXNY3DK.js → chunk-IKVZUVHJ.js} +1 -1
- package/dist/standalone/{chunk-3C3CU2DS.js → chunk-JGCRBFFO.js} +1 -1
- package/dist/standalone/chunk-JHR3HKT5.js +3 -0
- package/dist/standalone/{chunk-WXUUGXDV.js → chunk-JQPHZL2A.js} +1 -1
- package/dist/standalone/{chunk-CRY26DNY.js → chunk-LJE6PGHD.js} +1 -1
- package/dist/standalone/{chunk-5JB7FDCA.js → chunk-LTCX3QOE.js} +1 -1
- package/dist/standalone/{chunk-ALL4U2C5.js → chunk-MWH5LBNF.js} +1 -1
- package/dist/standalone/{chunk-CZGILAZI.js → chunk-N5FMEYSL.js} +1 -1
- package/dist/standalone/chunk-N7SVJOHN.js +1 -0
- package/dist/standalone/{chunk-7KSXHCUD.js → chunk-NAFKYFBZ.js} +1 -1
- package/dist/standalone/{chunk-3XBP6RRG.js → chunk-OVSBLTAA.js} +1 -1
- package/dist/standalone/chunk-OXHHSUXO.js +1 -0
- package/dist/standalone/chunk-PIB7VUVM.js +1 -0
- package/dist/standalone/{chunk-IC7XYSER.js → chunk-Q3X7IMLF.js} +1 -1
- package/dist/standalone/{chunk-LAK5VSPI.js → chunk-QVIPA6UJ.js} +1 -1
- package/dist/standalone/{chunk-NXAKNU3L.js → chunk-RCSULEDU.js} +1 -1
- package/dist/standalone/{chunk-6TMEOFZC.js → chunk-RDA4VTHI.js} +1 -1
- package/dist/standalone/{chunk-VY6AI3RI.js → chunk-RG4HLPM2.js} +1 -1
- package/dist/standalone/{chunk-LOYE7OU2.js → chunk-S2G7OH5T.js} +1 -1
- package/dist/standalone/{chunk-7N5KFSSB.js → chunk-SP7GSPKX.js} +1 -1
- package/dist/standalone/{chunk-W6JKUZKD.js → chunk-SPACAIAR.js} +1 -1
- package/dist/standalone/{chunk-X4QFAAZ5.js → chunk-SWMBBYJU.js} +1 -1
- package/dist/standalone/{chunk-HZKFL2M7.js → chunk-TTEEPVCN.js} +1 -1
- package/dist/standalone/{chunk-SXAFEREK.js → chunk-VC2VDAUO.js} +1 -1
- package/dist/standalone/{chunk-USYCKPUK.js → chunk-VQ3YOUZB.js} +1 -1
- package/dist/standalone/chunk-VXM5H542.js +4 -0
- package/dist/standalone/{chunk-3MAQAOUA.js → chunk-W7ND56KZ.js} +1 -1
- package/dist/standalone/{chunk-43F677PE.js → chunk-WA3DGSC2.js} +1 -1
- package/dist/standalone/{chunk-75LPCQ77.js → chunk-WCLFE2ZB.js} +1 -1
- package/dist/standalone/{chunk-EEWKIQUE.js → chunk-WOYQG5AM.js} +1 -1
- package/dist/standalone/{chunk-JM7XBQVK.js → chunk-XCNYUUD6.js} +1 -1
- package/dist/standalone/{chunk-ZVT4GJEI.js → chunk-XG4TZSP4.js} +1 -1
- package/dist/standalone/{chunk-A3ZJACVT.js → chunk-XZWFP2GI.js} +1 -1
- package/dist/standalone/chunk-YNSFQKMM.js +1 -0
- package/dist/standalone/{chunk-CODD62OJ.js → chunk-YRE6TGXH.js} +1 -1
- package/dist/standalone/{chunk-S7RKDQPS.js → chunk-YS7NUMAN.js} +1 -1
- package/dist/standalone/{chunk-IEKK5GO6.js → chunk-ZUTFDG76.js} +1 -1
- package/dist/standalone/{chunk-22C6COGE.js → chunk-ZXLEXF4X.js} +2 -2
- package/dist/standalone/studio.js +1 -1
- package/dist/styles.css +2 -2
- package/package.json +8 -8
- package/dist/packem_shared/app.d-CGdOmLTm.d.ts +0 -300
- package/dist/standalone/chunk-G7ZBM54M.js +0 -1
- package/dist/standalone/chunk-I7Y7ST5Y.js +0 -1
- package/dist/standalone/chunk-KJJ3WM6H.js +0 -4
- package/dist/standalone/chunk-LT7IG26L.js +0 -1
- package/dist/standalone/chunk-TC4KPQJ7.js +0 -3
- package/dist/standalone/chunk-WI7GWFEG.js +0 -1
- /package/dist/standalone/{chunk-ITQKVEP7.js → chunk-5XO36X4C.js} +0 -0
- /package/dist/standalone/{chunk-TQ36RWOP.js → chunk-IYHPYY4A.js} +0 -0
- /package/dist/standalone/{chunk-SEU5V7I6.js → chunk-Y572GMZE.js} +0 -0
|
@@ -1 +0,0 @@
|
|
|
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};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|