@baseplate-dev/project-builder-web
Version:
Web interface for constructing project builder JSON
9 lines • 91 kB
JavaScript
import{i as F}from"../_virtual___federation_fn_import-DOo8C-zl.js";import{j as S}from"../jsx-runtime-D_zvdyIk.js";import{r as on}from"../index-c0qeY2gs.js";var ae={exports:{}},ce={};/**
* @license React
* use-sync-external-store-shim.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var $e;function Dn(){if($e)return ce;$e=1;var t=on();function n(u,d){return u===d&&(u!==0||1/u===1/d)||u!==u&&d!==d}var e=typeof Object.is=="function"?Object.is:n,o=t.useState,s=t.useEffect,r=t.useLayoutEffect,i=t.useDebugValue;function a(u,d){var f=d(),p=o({inst:{value:f,getSnapshot:d}}),g=p[0].inst,m=p[1];return r(function(){g.value=f,g.getSnapshot=d,c(g)&&m({inst:g})},[u,f,d]),s(function(){return c(g)&&m({inst:g}),u(function(){c(g)&&m({inst:g})})},[u]),i(f),f}function c(u){var d=u.getSnapshot;u=u.value;try{var f=d();return!e(u,f)}catch{return!0}}function l(u,d){return d()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:a;return ce.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:h,ce}var Ne;function Wn(){return Ne||(Ne=1,ae.exports=Dn()),ae.exports}const Re=new WeakMap,Un=new WeakMap,Wt={current:[]};let le=!1,wt=0;const St=new Set,Tt=new Map;function sn(t){for(const n of t){if(Wt.current.includes(n))continue;Wt.current.push(n),n.recompute();const e=Un.get(n);if(e)for(const o of e){const s=Re.get(o);s?.length&&sn(s)}}}function zn(t){const n={prevVal:t.prevState,currentVal:t.state};for(const e of t.listeners)e(n)}function Vn(t){const n={prevVal:t.prevState,currentVal:t.state};for(const e of t.listeners)e(n)}function rn(t){if(wt>0&&!Tt.has(t)&&Tt.set(t,t.prevState),St.add(t),!(wt>0)&&!le)try{for(le=!0;St.size>0;){const n=Array.from(St);St.clear();for(const e of n){const o=Tt.get(e)??e.prevState;e.prevState=o,zn(e)}for(const e of n){const o=Re.get(e);o&&(Wt.current.push(e),sn(o))}for(const e of n){const o=Re.get(e);if(o)for(const s of o)Vn(s)}}}finally{le=!1,Wt.current=[],Tt.clear()}}function xt(t){wt++;try{t()}finally{if(wt--,wt===0){const n=St.values().next().value;n&&rn(n)}}}function Hn(t){return typeof t=="function"}class Kn{constructor(n,e){this.listeners=new Set,this.subscribe=o=>{var s,r;this.listeners.add(o);const i=(r=(s=this.options)==null?void 0:s.onSubscribe)==null?void 0:r.call(s,o,this);return()=>{this.listeners.delete(o),i?.()}},this.prevState=n,this.state=n,this.options=e}setState(n){var e,o,s;this.prevState=this.state,(e=this.options)!=null&&e.updateFn?this.state=this.options.updateFn(this.prevState)(n):Hn(n)?this.state=n(this.prevState):this.state=n,(s=(o=this.options)==null?void 0:o.onUpdate)==null||s.call(o),rn(this)}}const X="__TSR_index",De="popstate",We="beforeunload";function an(t){let n=t.getLocation();const e=new Set,o=i=>{n=t.getLocation(),e.forEach(a=>a({location:n,action:i}))},s=i=>{t.notifyOnIndexChange??!0?o(i):n=t.getLocation()},r=async({task:i,navigateOpts:a,...c})=>{if(a?.ignoreBlocker??!1){i();return}const h=t.getBlockers?.()??[],u=c.type==="PUSH"||c.type==="REPLACE";if(typeof document<"u"&&h.length&&u)for(const d of h){const f=dt(c.path,c.state);if(await d.blockerFn({currentLocation:n,nextLocation:f,action:c.type})){t.onBlocked?.();return}}i()};return{get location(){return n},get length(){return t.getLength()},subscribers:e,subscribe:i=>(e.add(i),()=>{e.delete(i)}),push:(i,a,c)=>{const l=n.state[X];a=_e(l+1,a),r({task:()=>{t.pushState(i,a),o({type:"PUSH"})},navigateOpts:c,type:"PUSH",path:i,state:a})},replace:(i,a,c)=>{const l=n.state[X];a=_e(l,a),r({task:()=>{t.replaceState(i,a),o({type:"REPLACE"})},navigateOpts:c,type:"REPLACE",path:i,state:a})},go:(i,a)=>{r({task:()=>{t.go(i),s({type:"GO",index:i})},navigateOpts:a,type:"GO"})},back:i=>{r({task:()=>{t.back(i?.ignoreBlocker??!1),s({type:"BACK"})},navigateOpts:i,type:"BACK"})},forward:i=>{r({task:()=>{t.forward(i?.ignoreBlocker??!1),s({type:"FORWARD"})},navigateOpts:i,type:"FORWARD"})},canGoBack:()=>n.state[X]!==0,createHref:i=>t.createHref(i),block:i=>{if(!t.setBlockers)return()=>{};const a=t.getBlockers?.()??[];return t.setBlockers([...a,i]),()=>{const c=t.getBlockers?.()??[];t.setBlockers?.(c.filter(l=>l!==i))}},flush:()=>t.flush?.(),destroy:()=>t.destroy?.(),notify:o}}function _e(t,n){n||(n={});const e=Le();return{...n,key:e,__TSR_key:e,[X]:t}}function cn(t){const n=t?.window??(typeof document<"u"?window:void 0),e=n.history.pushState,o=n.history.replaceState;let s=[];const r=()=>s,i=w=>s=w,a=t?.createHref??(w=>w),c=t?.parseLocation??(()=>dt(`${n.location.pathname}${n.location.search}${n.location.hash}`,n.history.state));if(!n.history.state?.__TSR_key&&!n.history.state?.key){const w=Le();n.history.replaceState({[X]:0,key:w,__TSR_key:w},"")}let l=c(),h,u=!1,d=!1,f=!1,p=!1;const g=()=>l;let m,y;const v=()=>{m&&(x._ignoreSubscribers=!0,(m.isPush?n.history.pushState:n.history.replaceState)(m.state,"",m.href),x._ignoreSubscribers=!1,m=void 0,y=void 0,h=void 0)},R=(w,L,C)=>{const M=a(L);y||(h=l),l=dt(L,C),m={href:M,state:C,isPush:m?.isPush||w==="push"},y||(y=Promise.resolve().then(()=>v()))},P=w=>{l=c(),x.notify({type:w})},b=async()=>{if(d){d=!1;return}const w=c(),L=w.state[X]-l.state[X],C=L===1,M=L===-1,O=!C&&!M||u;u=!1;const A=O?"GO":M?"BACK":"FORWARD",U=O?{type:"GO",index:L}:{type:M?"BACK":"FORWARD"};if(f)f=!1;else{const z=r();if(typeof document<"u"&&z.length){for(const ct of z)if(await ct.blockerFn({currentLocation:l,nextLocation:w,action:A})){d=!0,n.history.go(1),x.notify(U);return}}}l=c(),x.notify(U)},_=w=>{if(p){p=!1;return}let L=!1;const C=r();if(typeof document<"u"&&C.length)for(const M of C){const O=M.enableBeforeUnload??!0;if(O===!0){L=!0;break}if(typeof O=="function"&&O()===!0){L=!0;break}}if(L)return w.preventDefault(),w.returnValue=""},x=an({getLocation:g,getLength:()=>n.history.length,pushState:(w,L)=>R("push",w,L),replaceState:(w,L)=>R("replace",w,L),back:w=>(w&&(f=!0),p=!0,n.history.back()),forward:w=>{w&&(f=!0),p=!0,n.history.forward()},go:w=>{u=!0,n.history.go(w)},createHref:w=>a(w),flush:v,destroy:()=>{n.history.pushState=e,n.history.replaceState=o,n.removeEventListener(We,_,{capture:!0}),n.removeEventListener(De,b)},onBlocked:()=>{h&&l!==h&&(l=h)},getBlockers:r,setBlockers:i,notifyOnIndexChange:!1});return n.addEventListener(We,_,{capture:!0}),n.addEventListener(De,b),n.history.pushState=function(...w){const L=e.apply(n.history,w);return x._ignoreSubscribers||P("PUSH"),L},n.history.replaceState=function(...w){const L=o.apply(n.history,w);return x._ignoreSubscribers||P("REPLACE"),L},x}function or(t){const n=t?.window??(typeof document<"u"?window:void 0);return cn({window:n,parseLocation:()=>{const e=n.location.hash.split("#").slice(1),o=e[0]??"/",s=n.location.search,r=e.slice(1),i=r.length===0?"":`#${r.join("#")}`,a=`${o}${s}${i}`;return dt(a,n.history.state)},createHref:e=>`${n.location.pathname}${n.location.search}#${e}`})}function sr(t={initialEntries:["/"]}){const n=t.initialEntries;let e=t.initialIndex?Math.min(Math.max(t.initialIndex,0),n.length-1):n.length-1;const o=n.map((r,i)=>_e(i,void 0));return an({getLocation:()=>dt(n[e],o[e]),getLength:()=>n.length,pushState:(r,i)=>{e<n.length-1&&(n.splice(e+1),o.splice(e+1)),o.push(i),n.push(r),e=Math.max(n.length-1,0)},replaceState:(r,i)=>{o[e]=i,n[e]=r},back:()=>{e=Math.max(e-1,0)},forward:()=>{e=Math.min(e+1,n.length-1)},go:r=>{e=Math.min(Math.max(e+r,0),n.length-1)},createHref:r=>r})}function dt(t,n){const e=t.indexOf("#"),o=t.indexOf("?"),s=Le();return{href:t,pathname:t.substring(0,e>0?o>0?Math.min(e,o):e:o>0?o:t.length),hash:e>-1?t.substring(e):"",search:o>-1?t.slice(o,e===-1?void 0:e):"",state:n||{[X]:0,key:s,__TSR_key:s}}}function Le(){return(Math.random()+1).toString(36).substring(7)}function Ut(t){return t[t.length-1]}function qn(t){return typeof t=="function"}function ot(t,n){return qn(t)?t(n):t}const Gn=Object.prototype.hasOwnProperty;function N(t,n){if(t===n)return t;const e=n,o=Ve(t)&&Ve(e);if(!o&&!(zt(t)&&zt(e)))return e;const s=o?t:Ue(t);if(!s)return e;const r=o?e:Ue(e);if(!r)return e;const i=s.length,a=r.length,c=o?new Array(a):{};let l=0;for(let h=0;h<a;h++){const u=o?h:r[h],d=t[u],f=e[u];if(d===f){c[u]=d,(o?h<i:Gn.call(t,u))&&l++;continue}if(d===null||f===null||typeof d!="object"||typeof f!="object"){c[u]=f;continue}const p=N(d,f);c[u]=p,p===d&&l++}return i===a&&l===i?t:c}function Ue(t){const n=[],e=Object.getOwnPropertyNames(t);for(const s of e){if(!Object.prototype.propertyIsEnumerable.call(t,s))return!1;n.push(s)}const o=Object.getOwnPropertySymbols(t);for(const s of o){if(!Object.prototype.propertyIsEnumerable.call(t,s))return!1;n.push(s)}return n}function zt(t){if(!ze(t))return!1;const n=t.constructor;if(typeof n>"u")return!0;const e=n.prototype;return!(!ze(e)||!e.hasOwnProperty("isPrototypeOf"))}function ze(t){return Object.prototype.toString.call(t)==="[object Object]"}function Ve(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Z(t,n,e){if(t===n)return!0;if(typeof t!=typeof n)return!1;if(Array.isArray(t)&&Array.isArray(n)){if(t.length!==n.length)return!1;for(let o=0,s=t.length;o<s;o++)if(!Z(t[o],n[o],e))return!1;return!0}if(zt(t)&&zt(n)){const o=e?.ignoreUndefined??!0;if(e?.partial){for(const i in n)if((!o||n[i]!==void 0)&&!Z(t[i],n[i],e))return!1;return!0}let s=0;if(!o)s=Object.keys(t).length;else for(const i in t)t[i]!==void 0&&s++;let r=0;for(const i in n)if((!o||n[i]!==void 0)&&(r++,r>s||!Z(t[i],n[i],e)))return!1;return s===r}return!1}function ht(t){let n,e;const o=new Promise((s,r)=>{n=s,e=r});return o.status="pending",o.resolve=s=>{o.status="resolved",o.value=s,n(s),t?.(s)},o.reject=s=>{o.status="rejected",e(s)},o}function Jn(t){return typeof t?.message!="string"?!1:t.message.startsWith("Failed to fetch dynamically imported module")||t.message.startsWith("error loading dynamically imported module")||t.message.startsWith("Importing a module script failed")}function Q(t){return!!(t&&typeof t=="object"&&typeof t.then=="function")}function He(t){try{return decodeURI(t)}catch{return t.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}}function Ke(t,n){if(!t)return t;const e=/%25|%5C/gi;let o=0,s="",r;for(;(r=e.exec(t))!==null;)s+=He(t.slice(o,r.index))+r[0],o=e.lastIndex;return s+He(o?t.slice(o):t)}var Yn="Invariant failed";function J(t,n){if(!t)throw new Error(Yn)}function Vt(t){const n=new Map;let e,o;const s=r=>{r.next&&(r.prev?(r.prev.next=r.next,r.next.prev=r.prev,r.next=void 0,o&&(o.next=r,r.prev=o)):(r.next.prev=void 0,e=r.next,r.next=void 0,o&&(r.prev=o,o.next=r)),o=r)};return{get(r){const i=n.get(r);if(i)return s(i),i.value},set(r,i){if(n.size>=t&&e){const c=e;n.delete(c.key),c.next&&(e=c.next,c.next.prev=void 0),c===o&&(o=void 0)}const a=n.get(r);if(a)a.value=i,s(a);else{const c={key:r,value:i,prev:o};o&&(o.next=c),o=c,e||(e=c),n.set(r,c)}},clear(){n.clear(),e=void 0,o=void 0}}}const ft=0,it=1,at=2,Lt=3,Xn=/^([^{]*)\{\$([a-zA-Z_$][a-zA-Z0-9_$]*)\}([^}]*)$/,Zn=/^([^{]*)\{-\$([a-zA-Z_$][a-zA-Z0-9_$]*)\}([^}]*)$/,Qn=/^([^{]*)\{\$\}([^}]*)$/;function be(t,n,e=new Uint16Array(6)){const o=t.indexOf("/",n),s=o===-1?t.length:o,r=t.substring(n,s);if(!r||!r.includes("$"))return e[0]=ft,e[1]=n,e[2]=n,e[3]=s,e[4]=s,e[5]=s,e;if(r==="$"){const l=t.length;return e[0]=at,e[1]=n,e[2]=n,e[3]=l,e[4]=l,e[5]=l,e}if(r.charCodeAt(0)===36)return e[0]=it,e[1]=n,e[2]=n+1,e[3]=s,e[4]=s,e[5]=s,e;const i=r.match(Qn);if(i){const h=i[1].length;return e[0]=at,e[1]=n+h,e[2]=n+h+1,e[3]=n+h+2,e[4]=n+h+3,e[5]=t.length,e}const a=r.match(Zn);if(a){const l=a[1],h=a[2],u=a[3],d=l.length;return e[0]=Lt,e[1]=n+d,e[2]=n+d+3,e[3]=n+d+3+h.length,e[4]=s-u.length,e[5]=s,e}const c=r.match(Xn);if(c){const l=c[1],h=c[2],u=c[3],d=l.length;return e[0]=it,e[1]=n+d,e[2]=n+d+2,e[3]=n+d+2+h.length,e[4]=s-u.length,e[5]=s,e}return e[0]=ft,e[1]=n,e[2]=n,e[3]=s,e[4]=s,e[5]=s,e}function Yt(t,n,e,o,s,r,i){i?.(e);let a=o;{const c=e.fullPath??e.from,l=c.length,h=e.options?.caseSensitive??t;for(;a<l;){const u=be(c,a,n);let d;const f=a,p=u[5];switch(a=p+1,r++,u[0]){case ft:{const m=c.substring(u[2],u[3]);if(h){const y=s.static?.get(m);if(y)d=y;else{s.static??=new Map;const v=bt(e.fullPath??e.from);v.parent=s,v.depth=r,d=v,s.static.set(m,v)}}else{const y=m.toLowerCase(),v=s.staticInsensitive?.get(y);if(v)d=v;else{s.staticInsensitive??=new Map;const R=bt(e.fullPath??e.from);R.parent=s,R.depth=r,d=R,s.staticInsensitive.set(y,R)}}break}case it:{const m=c.substring(f,u[1]),y=c.substring(u[4],p),v=h&&!!(m||y),R=m?v?m:m.toLowerCase():void 0,P=y?v?y:y.toLowerCase():void 0,b=s.dynamic?.find(_=>_.caseSensitive===v&&_.prefix===R&&_.suffix===P);if(b)d=b;else{const _=de(it,e.fullPath??e.from,v,R,P);d=_,_.depth=r,_.parent=s,s.dynamic??=[],s.dynamic.push(_)}break}case Lt:{const m=c.substring(f,u[1]),y=c.substring(u[4],p),v=h&&!!(m||y),R=m?v?m:m.toLowerCase():void 0,P=y?v?y:y.toLowerCase():void 0,b=s.optional?.find(_=>_.caseSensitive===v&&_.prefix===R&&_.suffix===P);if(b)d=b;else{const _=de(Lt,e.fullPath??e.from,v,R,P);d=_,_.parent=s,_.depth=r,s.optional??=[],s.optional.push(_)}break}case at:{const m=c.substring(f,u[1]),y=c.substring(u[4],p),v=h&&!!(m||y),R=m?v?m:m.toLowerCase():void 0,P=y?v?y:y.toLowerCase():void 0,b=de(at,e.fullPath??e.from,v,R,P);d=b,b.parent=s,b.depth=r,s.wildcard??=[],s.wildcard.push(b)}}s=d}if((e.path||!e.children)&&!e.isRoot){const u=c.endsWith("/");u||(s.notFound=e),(!s.route||!s.isIndex&&u)&&(s.route=e),s.isIndex||=u}}if(e.children)for(const c of e.children)Yt(t,n,c,a,s,r,i)}function ue(t,n){if(t.prefix&&n.prefix&&t.prefix!==n.prefix){if(t.prefix.startsWith(n.prefix))return-1;if(n.prefix.startsWith(t.prefix))return 1}if(t.suffix&&n.suffix&&t.suffix!==n.suffix){if(t.suffix.endsWith(n.suffix))return-1;if(n.suffix.endsWith(t.suffix))return 1}return t.prefix&&!n.prefix?-1:!t.prefix&&n.prefix?1:t.suffix&&!n.suffix?-1:!t.suffix&&n.suffix?1:t.caseSensitive&&!n.caseSensitive?-1:!t.caseSensitive&&n.caseSensitive?1:0}function nt(t){if(t.static)for(const n of t.static.values())nt(n);if(t.staticInsensitive)for(const n of t.staticInsensitive.values())nt(n);if(t.dynamic?.length){t.dynamic.sort(ue);for(const n of t.dynamic)nt(n)}if(t.optional?.length){t.optional.sort(ue);for(const n of t.optional)nt(n)}if(t.wildcard?.length){t.wildcard.sort(ue);for(const n of t.wildcard)nt(n)}}function bt(t){return{kind:ft,depth:0,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,isIndex:!1,notFound:null}}function de(t,n,e,o,s){return{kind:t,depth:0,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:n,parent:null,isIndex:!1,notFound:null,caseSensitive:e,prefix:o,suffix:s}}function to(t,n){const e=bt("/"),o=new Uint16Array(6);for(const s of t)Yt(!1,o,s,1,e,0);nt(e),n.masksTree=e,n.flatCache=Vt(1e3)}function eo(t,n){t||="/";const e=n.flatCache.get(t);if(e)return e;const o=Ce(t,n.masksTree);return n.flatCache.set(t,o),o}function no(t,n,e,o,s){t||="/",o||="/";const r=n?`case\0${t}`:t;let i=s.singleCache.get(r);if(!i){i=bt("/");const a=new Uint16Array(6);Yt(n,a,{from:t},1,i,0),s.singleCache.set(r,i)}return Ce(o,i,e)}function oo(t,n,e=!1){const o=e?t:`nofuzz\0${t}`,s=n.matchCache.get(o);if(s!==void 0)return s;t||="/";const r=Ce(t,n.segmentTree,e);return r&&(r.branch=ao(r.route)),n.matchCache.set(o,r),r}function so(t){return t==="/"?t:t.replace(/\/{1,}$/,"")}function ro(t,n=!1,e){const o=bt(t.fullPath),s=new Uint16Array(6),r={},i={};let a=0;return Yt(n,s,t,1,o,0,l=>{if(e?.(l,a),J(!(l.id in r),`Duplicate routes found with id: ${String(l.id)}`),r[l.id]=l,a!==0&&l.path){const h=so(l.fullPath);(!i[h]||l.fullPath.endsWith("/"))&&(i[h]=l)}a++}),nt(o),{processedTree:{segmentTree:o,singleCache:Vt(1e3),matchCache:Vt(1e3),flatCache:null,masksTree:null},routesById:r,routesByPath:i}}function Ce(t,n,e=!1){const o=t.split("/"),s=lo(t,o,n,e);if(!s)return null;const r=io(t,o,s),i="**"in s;return i&&(r["**"]=s["**"]),{route:i?s.node.notFound??s.node.route:s.node.route,params:r}}function io(t,n,e){const o=co(e.node);let s=null;const r={};for(let i=0,a=0,c=0;a<o.length;i++,a++,c++){const l=o[a],h=n[i],u=c;if(h&&(c+=h.length),l.kind===it){s??=e.node.fullPath.split("/");const d=s[a],f=l.prefix?.length??0;if(d.charCodeAt(f)===123){const g=l.suffix?.length??0,m=d.substring(f+2,d.length-g-1),y=h.substring(f,h.length-g);r[m]=decodeURIComponent(y)}else{const g=d.substring(1);r[g]=decodeURIComponent(h)}}else if(l.kind===Lt){if(e.skipped&1<<a){i--;continue}s??=e.node.fullPath.split("/");const d=s[a],f=l.prefix?.length??0,p=l.suffix?.length??0,g=d.substring(f+3,d.length-p-1),m=l.suffix||l.prefix?h.substring(f,h.length-p):h;m&&(r[g]=decodeURIComponent(m))}else if(l.kind===at){const d=l,f=t.substring(u+(d.prefix?.length??0),t.length-(d.suffix?.length??0)),p=decodeURIComponent(f);r["*"]=p,r._splat=p;break}}return r}function ao(t){const n=[t];for(;t.parentRoute;)t=t.parentRoute,n.push(t);return n.reverse(),n}function co(t){const n=Array(t.depth+1);do n[t.depth]=t,t=t.parent;while(t);return n}function lo(t,n,e,o){const s=!Ut(n),r=s&&t!=="/",i=n.length-(s?1:0),a=[{node:e,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let c=null,l=null,h=null;for(;a.length;){const u=a.pop();let{node:d,index:f,skipped:p,depth:g,statics:m,dynamics:y,optionals:v}=u;o&&d.notFound&&Ft(l,u)&&(l=u);const R=f===i;if(R){if(d.route&&(!r||d.isIndex)&&(Ft(h,u)&&(h=u),m===i&&d.isIndex))return h;if(!d.optional&&!d.wildcard)continue}const P=R?void 0:n[f];let b;if(d.wildcard&&Ft(c,u))for(const _ of d.wildcard){const{prefix:x,suffix:w}=_;if(!(x&&(R||!(_.caseSensitive?P:b??=P.toLowerCase()).startsWith(x)))){if(w){if(R)continue;const L=n.slice(f).join("/").slice(-w.length);if((_.caseSensitive?L:L.toLowerCase())!==w)continue}c={node:_,index:f,skipped:p,depth:g,statics:m,dynamics:y,optionals:v};break}}if(d.optional){const _=p|1<<g,x=g+1;for(let w=d.optional.length-1;w>=0;w--){const L=d.optional[w];a.push({node:L,index:f,skipped:_,depth:x,statics:m,dynamics:y,optionals:v})}if(!R)for(let w=d.optional.length-1;w>=0;w--){const L=d.optional[w],{prefix:C,suffix:M}=L;if(C||M){const O=L.caseSensitive?P:b??=P.toLowerCase();if(C&&!O.startsWith(C)||M&&!O.endsWith(M))continue}a.push({node:L,index:f+1,skipped:p,depth:x,statics:m,dynamics:y,optionals:v+1})}}if(!R&&d.dynamic&&P)for(let _=d.dynamic.length-1;_>=0;_--){const x=d.dynamic[_],{prefix:w,suffix:L}=x;if(w||L){const C=x.caseSensitive?P:b??=P.toLowerCase();if(w&&!C.startsWith(w)||L&&!C.endsWith(L))continue}a.push({node:x,index:f+1,skipped:p,depth:g+1,statics:m,dynamics:y+1,optionals:v})}if(!R&&d.staticInsensitive){const _=d.staticInsensitive.get(b??=P.toLowerCase());_&&a.push({node:_,index:f+1,skipped:p,depth:g+1,statics:m+1,dynamics:y,optionals:v})}if(!R&&d.static){const _=d.static.get(P);_&&a.push({node:_,index:f+1,skipped:p,depth:g+1,statics:m+1,dynamics:y,optionals:v})}}if(h&&c)return Ft(c,h)?h:c;if(h)return h;if(c)return c;if(o&&l){let u=l.index;for(let f=0;f<l.index;f++)u+=n[f].length;const d=u===t.length?"/":t.slice(u);return{node:l.node,skipped:l.skipped,"**":decodeURIComponent(d)}}return null}function Ft(t,n){return t?n.statics>t.statics||n.statics===t.statics&&(n.dynamics>t.dynamics||n.dynamics===t.dynamics&&(n.optionals>t.optionals||n.optionals===t.optionals&&(n.node.isIndex>t.node.isIndex||n.node.isIndex===t.node.isIndex&&n.depth>t.depth))):!0}function $t(t){return Me(t.filter(n=>n!==void 0).join("/"))}function Me(t){return t.replace(/\/{2,}/g,"/")}function ln(t){return t==="/"?t:t.replace(/^\/{1,}/,"")}function st(t){const n=t.length;return n>1&&t[n-1]==="/"?t.replace(/\/{1,}$/,""):t}function Nt(t){return st(ln(t))}function Ht(t,n){return t?.endsWith("/")&&t!=="/"&&t!==`${n}/`?t.slice(0,-1):t}function uo(t,n,e){return Ht(t,e)===Ht(n,e)}function ho({base:t,to:n,trailingSlash:e="never",cache:o}){const s=n.startsWith("/"),r=!s&&n===".";let i;if(o){i=s?n:r?t:t+"\0"+n;const u=o.get(i);if(u)return u}let a;if(r)a=t.split("/");else if(s)a=n.split("/");else{for(a=t.split("/");a.length>1&&Ut(a)==="";)a.pop();const u=n.split("/");for(let d=0,f=u.length;d<f;d++){const p=u[d];p===""?d?d===f-1&&a.push(p):a=[p]:p===".."?a.pop():p==="."||a.push(p)}}a.length>1&&(Ut(a)===""?e==="never"&&a.pop():e==="always"&&a.push(""));let c,l="";for(let u=0;u<a.length;u++){u>0&&(l+="/");const d=a[u];if(!d)continue;c=be(d,0,c);const f=c[0];if(f===ft){l+=d;continue}const p=c[5],g=d.substring(0,c[1]),m=d.substring(c[4],p),y=d.substring(c[2],c[3]);f===it?l+=g||m?`${g}{$${y}}${m}`:`$${y}`:f===at?l+=g||m?`${g}{$}${m}`:"$":l+=`${g}{-$${y}}${m}`}l=Me(l);const h=l||"/";return i&&o&&o.set(i,h),h}function he(t,n,e){const o=n[t];return typeof o!="string"?o:t==="_splat"?encodeURI(o):fo(o,e)}function fe({path:t,params:n,decodeCharMap:e}){let o=!1;const s={};if(!t||t==="/")return{interpolatedPath:"/",usedParams:s,isMissingParams:o};if(!t.includes("$"))return{interpolatedPath:t,usedParams:s,isMissingParams:o};const r=t.length;let i=0,a,c="";for(;i<r;){const h=i;a=be(t,h,a);const u=a[5];if(i=u+1,h===u)continue;const d=a[0];if(d===ft){c+="/"+t.substring(h,u);continue}if(d===at){const f=n._splat;s._splat=f,s["*"]=f;const p=t.substring(h,a[1]),g=t.substring(a[4],u);if(!f){o=!0,(p||g)&&(c+="/"+p+g);continue}const m=he("_splat",n,e);c+="/"+p+m+g;continue}if(d===it){const f=t.substring(a[2],a[3]);!o&&!(f in n)&&(o=!0),s[f]=n[f];const p=t.substring(h,a[1]),g=t.substring(a[4],u),m=he(f,n,e)??"undefined";c+="/"+p+m+g;continue}if(d===Lt){const f=t.substring(a[2],a[3]),p=n[f];if(p==null)continue;s[f]=p;const g=t.substring(h,a[1]),m=t.substring(a[4],u),y=he(f,n,e)??"";c+="/"+g+y+m;continue}}return t.endsWith("/")&&(c+="/"),{usedParams:s,interpolatedPath:c||"/",isMissingParams:o}}function fo(t,n){let e=encodeURIComponent(t);if(n)for(const[o,s]of n)e=e.replaceAll(o,s);return e}function un(t={}){if(t.isNotFound=!0,t.throw)throw t;return t}function W(t){return!!t?.isNotFound}function po(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const Kt="tsr-scroll-restoration-v1_3",mo=(t,n)=>{let e;return(...o)=>{e||(e=setTimeout(()=>{t(...o),e=null},n))}};function go(){const t=po();if(!t)return null;const n=t.getItem(Kt);let e=n?JSON.parse(n):{};return{state:e,set:o=>(e=ot(o,e)||e,t.setItem(Kt,JSON.stringify(e)))}}const Rt=go(),qt=t=>t.state.__TSR_key||t.href;function dn(t){const n=[];let e;for(;e=t.parentNode;)n.push(`${t.tagName}:nth-child(${Array.prototype.indexOf.call(e.children,t)+1})`),t=e;return`${n.reverse().join(" > ")}`.toLowerCase()}let Gt=!1;function hn({storageKey:t,key:n,behavior:e,shouldScrollRestoration:o,scrollToTopSelectors:s,location:r}){let i;try{i=JSON.parse(sessionStorage.getItem(t)||"{}")}catch(l){console.error(l);return}const a=n||window.history.state?.__TSR_key,c=i[a];Gt=!0;t:{if(o&&c&&Object.keys(c).length>0){for(const u in c){const d=c[u];if(u==="window")window.scrollTo({top:d.scrollY,left:d.scrollX,behavior:e});else if(u){const f=document.querySelector(u);f&&(f.scrollLeft=d.scrollX,f.scrollTop=d.scrollY)}}break t}const l=(r??window.location).hash.split("#",2)[1];if(l){const u=window.history.state?.__hashScrollIntoViewOptions??!0;if(u){const d=document.getElementById(l);d&&d.scrollIntoView(u)}break t}const h={top:0,left:0,behavior:e};if(window.scrollTo(h),s)for(const u of s){if(u==="window")continue;const d=typeof u=="function"?u():document.querySelector(u);d&&d.scrollTo(h)}}Gt=!1}function fn(t,n){if(!Rt&&!t.isServer||((n??t.options.scrollRestoration??!1)&&(t.isScrollRestoring=!0),t.isServer||t.isScrollRestorationSetup||!Rt))return;t.isScrollRestorationSetup=!0,Gt=!1;const o=t.options.getScrollRestorationKey||qt;window.history.scrollRestoration="manual";const s=r=>{if(Gt||!t.isScrollRestoring)return;let i="";if(r.target===document||r.target===window)i="window";else{const c=r.target.getAttribute("data-scroll-restoration-id");c?i=`[data-scroll-restoration-id="${c}"]`:i=dn(r.target)}const a=o(t.state.location);Rt.set(c=>{const l=c[a]||={},h=l[i]||={};if(i==="window")h.scrollX=window.scrollX||0,h.scrollY=window.scrollY||0;else if(i){const u=document.querySelector(i);u&&(h.scrollX=u.scrollLeft||0,h.scrollY=u.scrollTop||0)}return c})};typeof document<"u"&&document.addEventListener("scroll",mo(s,100),!0),t.subscribe("onRendered",r=>{const i=o(r.toLocation);if(!t.resetNextScroll){t.resetNextScroll=!0;return}typeof t.options.scrollRestoration=="function"&&!t.options.scrollRestoration({location:t.latestLocation})||(hn({storageKey:Kt,key:i,behavior:t.options.scrollRestorationBehavior,shouldScrollRestoration:t.isScrollRestoring,scrollToTopSelectors:t.options.scrollToTopSelectors,location:t.history.location}),t.isScrollRestoring&&Rt.set(a=>(a[i]||={},a)))})}function yo(t){if(typeof document<"u"&&document.querySelector){const n=t.state.location.state.__hashScrollIntoViewOptions??!0;if(n&&t.state.location.hash!==""){const e=document.getElementById(t.state.location.hash);e&&e.scrollIntoView(n)}}}function vo(t,n=String){const e=new URLSearchParams;for(const o in t){const s=t[o];s!==void 0&&e.set(o,n(s))}return e.toString()}function pe(t){return t?t==="false"?!1:t==="true"?!0:+t*0===0&&+t+""===t?+t:t:""}function So(t){const n=new URLSearchParams(t),e={};for(const[o,s]of n.entries()){const r=e[o];r==null?e[o]=pe(s):Array.isArray(r)?r.push(pe(s)):e[o]=[r,pe(s)]}return e}const Ro=wo(JSON.parse),_o=xo(JSON.stringify,JSON.parse);function wo(t){return n=>{n[0]==="?"&&(n=n.substring(1));const e=So(n);for(const o in e){const s=e[o];if(typeof s=="string")try{e[o]=t(s)}catch{}}return e}}function xo(t,n){const e=typeof n=="function";function o(s){if(typeof s=="object"&&s!==null)try{return t(s)}catch{}else if(e&&typeof s=="string")try{return n(s),t(s)}catch{}return s}return s=>{const r=vo(s,o);return r?`?${r}`:""}}const j="__root__";function Po(t){if(t.statusCode=t.statusCode||t.code||307,!t.reloadDocument&&typeof t.href=="string")try{new URL(t.href),t.reloadDocument=!0}catch{}const n=new Headers(t.headers);t.href&&n.get("Location")===null&&n.set("Location",t.href);const e=new Response(null,{status:t.statusCode,headers:n});if(e.options=t,t.throw)throw e;return e}function H(t){return t instanceof Response&&!!t.options}const Dt=t=>{if(!t.rendered)return t.rendered=!0,t.onReady?.()},Xt=(t,n)=>!!(t.preload&&!t.router.state.matches.some(e=>e.id===n)),pn=(t,n)=>{const e=t.router.routesById[n.routeId??""]??t.router.routeTree;!e.options.notFoundComponent&&t.router.options?.defaultNotFoundComponent&&(e.options.notFoundComponent=t.router.options.defaultNotFoundComponent),J(e.options.notFoundComponent);const o=t.matches.find(s=>s.routeId===e.id);J(o,"Could not find match for route: "+e.id),t.updateMatch(o.id,s=>({...s,status:"notFound",error:n,isFetching:!1})),n.routerCode==="BEFORE_LOAD"&&e.parentRoute&&(n.routeId=e.parentRoute.id,pn(t,n))},Y=(t,n,e)=>{if(!(!H(e)&&!W(e))){if(H(e)&&e.redirectHandled&&!e.options.reloadDocument)throw e;if(n){n._nonReactive.beforeLoadPromise?.resolve(),n._nonReactive.loaderPromise?.resolve(),n._nonReactive.beforeLoadPromise=void 0,n._nonReactive.loaderPromise=void 0;const o=H(e)?"redirected":"notFound";n._nonReactive.error=e,t.updateMatch(n.id,s=>({...s,status:o,isFetching:!1,error:e})),W(e)&&!e.routeId&&(e.routeId=n.routeId),n._nonReactive.loadPromise?.resolve()}throw H(e)?(t.rendered=!0,e.options._fromLocation=t.location,e.redirectHandled=!0,e=t.router.resolveRedirect(e),e):(pn(t,e),e)}},mn=(t,n)=>{const e=t.router.getMatch(n);return!!(!t.router.isServer&&e._nonReactive.dehydrated||t.router.isServer&&e.ssr===!1)},gt=(t,n,e,o)=>{const{id:s,routeId:r}=t.matches[n],i=t.router.looseRoutesById[r];if(e instanceof Promise)throw e;e.routerCode=o,t.firstBadMatchIndex??=n,Y(t,t.router.getMatch(s),e);try{i.options.onError?.(e)}catch(a){e=a,Y(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}))},Lo=(t,n,e,o)=>{const s=t.router.getMatch(n),r=t.matches[e-1]?.id,i=r?t.router.getMatch(r):void 0;if(t.router.isShell()){s.ssr=o.id===j;return}if(i?.ssr===!1){s.ssr=!1;return}const a=f=>f===!0&&i?.ssr==="data-only"?"data-only":f,c=t.router.options.defaultSsr??!0;if(o.options.ssr===void 0){s.ssr=a(c);return}if(typeof o.options.ssr!="function"){s.ssr=a(o.options.ssr);return}const{search:l,params:h}=s,u={search:Bt(l,s.searchError),params:Bt(h,s.paramsError),location:t.location,matches:t.matches.map(f=>({index:f.index,pathname:f.pathname,fullPath:f.fullPath,staticData:f.staticData,id:f.id,routeId:f.routeId,search:Bt(f.search,f.searchError),params:Bt(f.params,f.paramsError),ssr:f.ssr}))},d=o.options.ssr(u);if(Q(d))return d.then(f=>{s.ssr=a(f??c)});s.ssr=a(d??c)},gn=(t,n,e,o)=>{if(o._nonReactive.pendingTimeout!==void 0)return;const s=e.options.pendingMs??t.router.options.defaultPendingMs;if(!!(t.onReady&&!t.router.isServer&&!Xt(t,n)&&(e.options.loader||e.options.beforeLoad||Sn(e))&&typeof s=="number"&&s!==1/0&&(e.options.pendingComponent??t.router.options?.defaultPendingComponent))){const i=setTimeout(()=>{Dt(t)},s);o._nonReactive.pendingTimeout=i}},bo=(t,n,e)=>{const o=t.router.getMatch(n);if(!o._nonReactive.beforeLoadPromise&&!o._nonReactive.loaderPromise)return;gn(t,n,e,o);const s=()=>{const r=t.router.getMatch(n);r.preload&&(r.status==="redirected"||r.status==="notFound")&&Y(t,r,r.error)};return o._nonReactive.beforeLoadPromise?o._nonReactive.beforeLoadPromise.then(s):s()},Co=(t,n,e,o)=>{const s=t.router.getMatch(n),r=s._nonReactive.loadPromise;s._nonReactive.loadPromise=ht(()=>{r?.resolve()});const{paramsError:i,searchError:a}=s;i&>(t,e,i,"PARSE_PARAMS"),a&>(t,e,a,"VALIDATE_SEARCH"),gn(t,n,o,s);const c=new AbortController,l=t.matches[e-1]?.id,d={...(l?t.router.getMatch(l):void 0)?.context??t.router.options.context??void 0,...s.__routeContext};let f=!1;const p=()=>{f||(f=!0,t.updateMatch(n,x=>({...x,isFetching:"beforeLoad",fetchCount:x.fetchCount+1,abortController:c,context:d})))},g=()=>{s._nonReactive.beforeLoadPromise?.resolve(),s._nonReactive.beforeLoadPromise=void 0,t.updateMatch(n,x=>({...x,isFetching:!1}))};if(!o.options.beforeLoad){xt(()=>{p(),g()});return}s._nonReactive.beforeLoadPromise=ht();const{search:m,params:y,cause:v}=s,R=Xt(t,n),P={search:m,abortController:c,params:y,preload:R,context:d,location:t.location,navigate:x=>t.router.navigate({...x,_fromLocation:t.location}),buildLocation:t.router.buildLocation,cause:R?"preload":v,matches:t.matches,...t.router.options.additionalContext},b=x=>{if(x===void 0){xt(()=>{p(),g()});return}(H(x)||W(x))&&(p(),gt(t,e,x,"BEFORE_LOAD")),xt(()=>{p(),t.updateMatch(n,w=>({...w,__beforeLoadContext:x,context:{...w.context,...x}})),g()})};let _;try{if(_=o.options.beforeLoad(P),Q(_))return p(),_.catch(x=>{gt(t,e,x,"BEFORE_LOAD")}).then(b)}catch(x){p(),gt(t,e,x,"BEFORE_LOAD")}b(_)},Mo=(t,n)=>{const{id:e,routeId:o}=t.matches[n],s=t.router.looseRoutesById[o],r=()=>{if(t.router.isServer){const c=Lo(t,e,n,s);if(Q(c))return c.then(a)}return a()},i=()=>Co(t,e,n,s),a=()=>{if(mn(t,e))return;const c=bo(t,e,s);return Q(c)?c.then(i):i()};return r()},Pt=(t,n,e)=>{const o=t.router.getMatch(n);if(!o||!e.options.head&&!e.options.scripts&&!e.options.headers)return;const s={matches:t.matches,match:o,params:o.params,loaderData:o.loaderData};return Promise.all([e.options.head?.(s),e.options.scripts?.(s),e.options.headers?.(s)]).then(([r,i,a])=>{const c=r?.meta,l=r?.links,h=r?.scripts,u=r?.styles;return{meta:c,links:l,headScripts:h,headers:a,scripts:i,styles:u}})},yn=(t,n,e,o)=>{const s=t.matchPromises[e-1],{params:r,loaderDeps:i,abortController:a,cause:c}=t.router.getMatch(n);let l=t.router.options.context??{};for(let u=0;u<=e;u++){const d=t.matches[u];if(!d)continue;const f=t.router.getMatch(d.id);f&&(l={...l,...f.__routeContext??{},...f.__beforeLoadContext??{}})}const h=Xt(t,n);return{params:r,deps:i,preload:!!h,parentMatchPromise:s,abortController:a,context:l,location:t.location,navigate:u=>t.router.navigate({...u,_fromLocation:t.location}),cause:h?"preload":c,route:o,...t.router.options.additionalContext}},qe=async(t,n,e,o)=>{try{const s=t.router.getMatch(n);try{(!t.router.isServer||s.ssr===!0)&&vn(o);const r=o.options.loader?.(yn(t,n,e,o)),i=o.options.loader&&Q(r);if(!!(i||o._lazyPromise||o._componentsPromise||o.options.head||o.options.scripts||o.options.headers||s._nonReactive.minPendingPromise)&&t.updateMatch(n,u=>({...u,isFetching:"loader"})),o.options.loader){const u=i?await r:r;Y(t,t.router.getMatch(n),u),u!==void 0&&t.updateMatch(n,d=>({...d,loaderData:u}))}o._lazyPromise&&await o._lazyPromise;const c=Pt(t,n,o),l=c?await c:void 0,h=s._nonReactive.minPendingPromise;h&&await h,o._componentsPromise&&await o._componentsPromise,t.updateMatch(n,u=>({...u,error:void 0,status:"success",isFetching:!1,updatedAt:Date.now(),...l}))}catch(r){let i=r;const a=s._nonReactive.minPendingPromise;a&&await a,W(r)&&await o.options.notFoundComponent?.preload?.(),Y(t,t.router.getMatch(n),r);try{o.options.onError?.(r)}catch(h){i=h,Y(t,t.router.getMatch(n),h)}const c=Pt(t,n,o),l=c?await c:void 0;t.updateMatch(n,h=>({...h,error:i,status:"error",isFetching:!1,...l}))}}catch(s){const r=t.router.getMatch(n);if(r){const i=Pt(t,n,o);if(i){const a=await i;t.updateMatch(n,c=>({...c,...a}))}r._nonReactive.loaderPromise=void 0}Y(t,r,s)}},ko=async(t,n)=>{const{id:e,routeId:o}=t.matches[n];let s=!1,r=!1;const i=t.router.looseRoutesById[o];if(mn(t,e)){if(t.router.isServer){const l=Pt(t,e,i);if(l){const h=await l;t.updateMatch(e,u=>({...u,...h}))}return t.router.getMatch(e)}}else{const l=t.router.getMatch(e);if(l._nonReactive.loaderPromise){if(l.status==="success"&&!t.sync&&!l.preload)return l;await l._nonReactive.loaderPromise;const h=t.router.getMatch(e),u=h._nonReactive.error||h.error;u&&Y(t,h,u)}else{const h=Date.now()-l.updatedAt,u=Xt(t,e),d=u?i.options.preloadStaleTime??t.router.options.defaultPreloadStaleTime??3e4:i.options.staleTime??t.router.options.defaultStaleTime??0,f=i.options.shouldReload,p=typeof f=="function"?f(yn(t,e,n,i)):f,g=!!u&&!t.router.state.matches.some(R=>R.id===e),m=t.router.getMatch(e);m._nonReactive.loaderPromise=ht(),g!==m.preload&&t.updateMatch(e,R=>({...R,preload:g}));const{status:y,invalid:v}=m;if(s=y==="success"&&(v||(p??h>d)),!(u&&i.options.preload===!1))if(s&&!t.sync)r=!0,(async()=>{try{await qe(t,e,n,i);const R=t.router.getMatch(e);R._nonReactive.loaderPromise?.resolve(),R._nonReactive.loadPromise?.resolve(),R._nonReactive.loaderPromise=void 0}catch(R){H(R)&&await t.router.navigate(R.options)}})();else if(y!=="success"||s&&t.sync)await qe(t,e,n,i);else{const R=Pt(t,e,i);if(R){const P=await R;t.updateMatch(e,b=>({...b,...P}))}}}}const a=t.router.getMatch(e);r||(a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loadPromise?.resolve()),clearTimeout(a._nonReactive.pendingTimeout),a._nonReactive.pendingTimeout=void 0,r||(a._nonReactive.loaderPromise=void 0),a._nonReactive.dehydrated=void 0;const c=r?a.isFetching:!1;return c!==a.isFetching||a.invalid!==!1?(t.updateMatch(e,l=>({...l,isFetching:c,invalid:!1})),t.router.getMatch(e)):a};async function Ge(t){const n=Object.assign(t,{matchPromises:[]});!n.router.isServer&&n.router.state.matches.some(e=>e._forcePending)&&Dt(n);try{for(let s=0;s<n.matches.length;s++){const r=Mo(n,s);Q(r)&&await r}const e=n.firstBadMatchIndex??n.matches.length;for(let s=0;s<e;s++)n.matchPromises.push(ko(n,s));await Promise.all(n.matchPromises);const o=Dt(n);Q(o)&&await o}catch(e){if(W(e)&&!n.preload){const o=Dt(n);throw Q(o)&&await o,e}if(H(e))throw e}return n.matches}async function vn(t){if(!t._lazyLoaded&&t._lazyPromise===void 0&&(t.lazyFn?t._lazyPromise=t.lazyFn().then(n=>{const{id:e,...o}=n.options;Object.assign(t.options,o),t._lazyLoaded=!0,t._lazyPromise=void 0}):t._lazyLoaded=!0),!t._componentsLoaded&&t._componentsPromise===void 0){const n=()=>{const e=[];for(const o of Rn){const s=t.options[o]?.preload;s&&e.push(s())}if(e.length)return Promise.all(e).then(()=>{t._componentsLoaded=!0,t._componentsPromise=void 0});t._componentsLoaded=!0,t._componentsPromise=void 0};t._componentsPromise=t._lazyPromise?t._lazyPromise.then(n):n()}return t._componentsPromise}function Bt(t,n){return n?{status:"error",error:n}:{status:"success",value:t}}function Sn(t){for(const n of Rn)if(t.options[n]?.preload)return!0;return!1}const Rn=["component","errorComponent","pendingComponent","notFoundComponent"];function Io(t){return{input:({url:n})=>{for(const e of t)n=_n(e,n);return n},output:({url:n})=>{for(let e=t.length-1;e>=0;e--)n=wn(t[e],n);return n}}}function Eo(t){const n=Nt(t.basepath),e=`/${n}`,o=`${e}/`,s=t.caseSensitive?e:e.toLowerCase(),r=t.caseSensitive?o:o.toLowerCase();return{input:({url:i})=>{const a=t.caseSensitive?i.pathname:i.pathname.toLowerCase();return a===s?i.pathname="/":a.startsWith(r)&&(i.pathname=i.pathname.slice(e.length)),i},output:({url:i})=>(i.pathname=$t(["/",n,i.pathname]),i)}}function _n(t,n){const e=t?.input?.({url:n});if(e){if(typeof e=="string")return new URL(e);if(e instanceof URL)return e}return n}function wn(t,n){const e=t?.output?.({url:n});if(e){if(typeof e=="string")return new URL(e);if(e instanceof URL)return e}return n}function To(t){return t instanceof Error?{name:t.name,message:t.message}:{data:t}}function rt(t){const n=t.resolvedLocation,e=t.location,o=n?.pathname!==e.pathname,s=n?.href!==e.href,r=n?.hash!==e.hash;return{fromLocation:n,toLocation:e,pathChanged:o,hrefChanged:s,hashChanged:r}}class Fo{constructor(n){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,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.");const o=this.options,s=this.basepath??o?.basepath??"/",r=this.basepath===void 0,i=o?.rewrite;this.options={...o,...e},this.isServer=this.options.isServer??typeof document>"u",this.pathParamsDecodeCharMap=this.options.pathParamsAllowedCharacters?new Map(this.options.pathParamsAllowedCharacters.map(d=>[encodeURIComponent(d),d])):void 0,(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.isServer||(this.history=cn())),this.origin=this.options.origin,this.origin||(!this.isServer&&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,this.buildRouteTree()),!this.__store&&this.latestLocation&&(this.__store=new Kn(Oo(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(d=>!["redirected"].includes(d.status))}}}),fn(this));let a=!1;const c=this.options.basepath??"/",l=this.options.rewrite;if(r||s!==c||i!==l){this.basepath=c;const d=[];Nt(c)!==""&&d.push(Eo({basepath:c})),l&&d.push(l),this.rewrite=d.length===0?void 0:d.length===1?d[0]:Io(d),this.history&&this.updateLatestLocation(),a=!0}a&&this.__store&&(this.__store.state={...this.state,location: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=()=>{const{routesById:e,routesByPath:o,processedTree:s}=ro(this.routeTree,this.options.caseSensitive,(i,a)=>{i.init({originalIndex:a})});this.options.routeMasks&&to(this.options.routeMasks,s),this.routesById=e,this.routesByPath=o,this.processedTree=s;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)},this.subscribe=(e,o)=>{const s={eventType:e,fn:o};return this.subscribers.add(s),()=>{this.subscribers.delete(s)}},this.emit=e=>{this.subscribers.forEach(o=>{o.eventType===e.type&&o.fn(e)})},this.parseLocation=(e,o)=>{const s=({href:c,state:l})=>{const h=new URL(c,this.origin),u=_n(this.rewrite,h),d=this.options.parseSearch(u.search),f=this.options.stringifySearch(d);u.search=f;const p=u.href.replace(u.origin,""),{pathname:g,hash:m}=u;return{href:p,publicHref:c,url:u.href,pathname:Ke(g),searchStr:f,search:N(o?.search,d),hash:m.split("#").reverse()[0]??"",state:N(o?.state,l)}},r=s(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){const c=s(i);return c.state.key=r.state.key,c.state.__TSR_key=r.state.__TSR_key,delete c.state.__tempLocation,{...c,maskedLocation:r}}return r},this.resolvePathCache=Vt(1e3),this.resolvePathWithBase=(e,o)=>ho({base:e,to:Me(o),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,o,s)=>typeof e=="string"?this.matchRoutesInternal({pathname:e,search:o},s):this.matchRoutesInternal(e,o),this.getMatchedRoutes=e=>Ao({pathname:e,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=e=>{const o=this.getMatch(e);o&&(o.abortController.abort(),clearTimeout(o._nonReactive.pendingTimeout),o._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const e=this.state.matches.filter(r=>r.status==="pending"),o=this.state.matches.filter(r=>r.isFetching==="loader");new Set([...this.state.pendingMatches??[],...e,...o]).forEach(r=>{this.cancelMatch(r.id)})},this.buildLocation=e=>{const o=(r={})=>{const i=r._fromLocation||this.pendingBuiltLocation||this.latestLocation,a=this.matchRoutes(i,{_buildLocation:!0}),c=Ut(a);r.from;const l=r.unsafeRelative==="path"?i.pathname:r.from??c.fullPath,h=this.resolvePathWithBase(l,"."),u=c.search,d={...c.params},f=r.to?this.resolvePathWithBase(h,`${r.to}`):this.resolvePathWithBase(h,"."),p=r.params===!1||r.params===null?{}:(r.params??!0)===!0?d:Object.assign(d,ot(r.params,d)),g=fe({path:f,params:p}).interpolatedPath,m=this.matchRoutes(g,void 0,{_buildLocation:!0}).map(C=>this.looseRoutesById[C.routeId]);if(Object.keys(p).length>0)for(const C of m){const M=C.options.params?.stringify??C.options.stringifyParams;M&&Object.assign(p,M(p))}const y=e.leaveParams?f:Ke(fe({path:f,params:p,decodeCharMap:this.pathParamsDecodeCharMap}).interpolatedPath);let v=u;if(e._includeValidateSearch&&this.options.search?.strict){const C={};m.forEach(M=>{if(M.options.validateSearch)try{Object.assign(C,we(M.options.validateSearch,{...C,...v}))}catch{}}),v=C}v=jo({search:v,dest:r,destRoutes:m,_includeValidateSearch:e._includeValidateSearch}),v=N(u,v);const R=this.options.stringifySearch(v),P=r.hash===!0?i.hash:r.hash?ot(r.hash,i.hash):void 0,b=P?`#${P}`:"";let _=r.state===!0?i.state:r.state?ot(r.state,i.state):{};_=N(i.state,_);const x=`${y}${R}${b}`,w=new URL(x,this.origin),L=wn(this.rewrite,w);return{publicHref:L.pathname+L.search+L.hash,href:x,url:L.href,pathname:y,search:v,searchStr:R,state:_,hash:P??"",unmaskOnReload:r.unmaskOnReload}},s=(r={},i)=>{const a=o(r);let c=i?o(i):void 0;if(!c){const l={};if(this.options.routeMasks){const h=eo(a.pathname,this.processedTree);if(h){Object.assign(l,h.params);const{from:u,...d}=h.route;i={from:e.from,...d,params:l},c=o(i)}}}return c&&(a.maskedLocation=c),a};return e.mask?s(e,{from:e.from,...e.mask}):s(e)},this.commitLocation=({viewTransition:e,ignoreBlocker:o,...s})=>{const r=()=>{const c=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];c.forEach(h=>{s.state[h]=this.latestLocation.state[h]});const l=Z(s.state,this.latestLocation.state);return c.forEach(h=>{delete s.state[h]}),l},i=st(this.latestLocation.href)===st(s.href),a=this.commitLocationPromise;if(this.commitLocationPromise=ht(()=>{a?.resolve()}),i&&r())this.load();else{let{maskedLocation:c,hashScrollIntoView:l,...h}=s;c&&(h={...c,state:{...c.state,__tempKey:void 0,__tempLocation:{...h,search:h.searchStr,state:{...h.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(h.unmaskOnReload??this.options.unmaskOnReload??!1)&&(h.state.__tempKey=this.tempLocationKey)),h.state.__hashScrollIntoViewOptions=l??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,this.history[s.replace?"replace":"push"](h.publicHref,h.state,{ignoreBlocker:o})}return this.resetNextScroll=s.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:o,hashScrollIntoView:s,viewTransition:r,ignoreBlocker:i,href:a,...c}={})=>{if(a){const u=this.history.location.state.__TSR_index,d=dt(a,{__TSR_index:e?u:u+1});c.to=d.pathname,c.search=this.options.parseSearch(d.search),c.hash=d.hash.slice(1)}const l=this.buildLocation({...c,_includeValidateSearch:!0});this.pendingBuiltLocation=l;const h=this.commitLocation({...l,viewTransition:r,replace:e,resetScroll:o,hashScrollIntoView:s,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===l&&(this.pendingBuiltLocation=void 0)}),h},this.navigate=async({to:e,reloadDocument:o,href:s,...r})=>{if(!o&&s)try{new URL(`${s}`),o=!0}catch{}if(o){if(s||(s=this.buildLocation({to:e,...r}).url),!r.ignoreBlocker){const a=this.history.getBlockers?.()??[];for(const c of a)if(c?.blockerFn&&await c.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return r.replace?window.location.replace(s):window.location.href=s,Promise.resolve()}return this.buildAndCommitLocation({...r,href:s,to:e,_isNavigate:!0})},this.beforeLoad=()=>{if(this.cancelMatches(),this.updateLatestLocation(),this.isServer){const o=this.buildLocation({to:this.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0}),s=r=>{try{return encodeURI(decodeURI(r))}catch{return r}};if(Nt(s(this.latestLocation.href))!==Nt(s(o.href))){let r=o.url;throw this.origin&&r.startsWith(this.origin)&&(r=r.replace(this.origin,"")||"/"),Po({href:r})}}const e=this.matchRoutes(this.latestLocation);this.__store.setState(o=>({...o,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:e,cachedMatches:o.cachedMatches.filter(s=>!e.some(r=>r.id===s.id))}))},this.load=async e=>{let o,s,r;for(r=new Promise(a=>{this.startTransition(async()=>{try{this.beforeLoad();const c=this.latestLocation,l=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...rt({resolvedLocation:l,location:c})}),this.emit({type:"onBeforeLoad",...rt({resolvedLocation:l,location:c})}),await Ge({router:this,sync:e?.sync,matches:this.state.pendingMatches,location:c,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let h=[],u=[],d=[];xt(()=>{this.__store.setState(f=>{const p=f.matches,g=f.pendingMatches||f.matches;return h=p.filter(m=>!g.some(y=>y.id===m.id)),u=g.filter(m=>!p.some(y=>y.id===m.id)),d=g.filter(m=>p.some(y=>y.id===m.id)),{...f,isLoading:!1,loadedAt:Date.now(),matches:g,pendingMatches:void 0,cachedMatches:[...f.cachedMatches,...h.filter(m=>m.status!=="error"&&m.status!=="notFound")]}}),this.clearExpiredCache()}),[[h,"onLeave"],[u,"onEnter"],[d,"onStay"]].forEach(([f,p])=>{f.forEach(g=>{this.looseRoutesById[g.routeId].options[p]?.(g)})})})})}})}catch(c){H(c)?(o=c,this.isServer||this.navigate({...o.options,replace:!0,ignoreBlocker:!0})):W(c)&&(s=c),this.__store.setState(l=>({...l,statusCode:o?o.status:s?404:l.matches.some(h=>h.status==="error")?500:200,redirect:o}))}this.latestLoadPromise===r&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),a()})}),this.latestLoadPromise=r,await r;this.latestLoadPromise&&r!==this.latestLoadPromise;)await this.latestLoadPromise;let i;this.hasNotFoundMatch()?i=404:this.__store.state.matches.some(a=>a.status==="error")&&(i=500),i!==void 0&&this.__store.setState(a=>({...a,statusCode:i}))},this.startViewTransition=e=>{const o=this.shouldViewTransition??this.options.defaultViewTransition;if(delete this.shouldViewTransition,o&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let s;if(typeof o=="object"&&this.isViewTransitionTypesSupported){const r=this.latestLocation,i=this.state.resolvedLocation,a=typeof o.types=="function"?o.types(rt({resolvedLocation:i,location:r})):o.types;if(a===!1){e();return}s={update:e,types:a}}else s=e;document.startViewTransition(s)}else e()},this.updateMatch=(e,o)=>{this.startTransition(()=>{const s=this.state.pendingMatches?.some(r=>r.id===e)?"pendingMatches":this.state.matches.some(r=>r.id===e)?"matches":this.state.cachedMatches.some(r=>r.id===e)?"cachedMatches":"";s&&this.__store.setState(r=>({...r,[s]:r[s]?.map(i=>i.id===e?o(i):i)}))})},this.getMatch=e=>{const o=s=>s.id===e;return this.state.cachedMatches.find(o)??this.state.pendingMatches?.find(o)??this.state.matches.find(o)},this.invalidate=e=>{const o=s=>e?.filter?.(s)??!0?{...s,invalid:!0,...e?.forcePending||s.status==="error"||s.status==="notFound"?{status:"pending",error:void 0}:void 0}:s;return this.__store.setState(s=>({...s,matches:s.matches.map(o),cachedMatches:s.cachedMatches.map(o),pendingMatches:s.pendingMatches?.map(o)})),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.resolveRedirect=e=>{if(!e.options.href){const o=this.buildLocation(e.options);let s=o.url;this.origin&&s.startsWith(this.origin)&&(s=s.replace(this.origin,"")||"/"),e.options.href=o.href,e.headers.set("Location",s)}return e.headers.get("Location")||e.headers.set("Location",e.options.href),e},this.clearCache=e=>{const o=e?.filter;o!==void 0?this.__store.setState(s=>({...s,cachedMatches:s.cachedMatches.filter(r=>!o(r))})):this.__store.setState(s=>({...s,cachedMatches:[]}))},this.clearExpiredCache=()=>{const e=o=>{const s=this.looseRoutesById[o.routeId];if(!s.options.loader)return!0;const r=(o.pr