import{r as fo,a as ee,g as Ne,b as po}from"./react-vendor-Dtc2IqVY.js";function mo(t,o){for(var e=0;es[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var g=fo(),R=ee();const rt=Ne(R),hn=mo({__proto__:null,default:rt},[R]),Yt=new WeakMap,go=new WeakMap,bt={current:[]};let Nt=!1,mt=0;const pt=new Set,Pt=new Map;function Ue(t){for(const o of t){if(bt.current.includes(o))continue;bt.current.push(o),o.recompute();const e=go.get(o);if(e)for(const s of e){const n=Yt.get(s);n?.length&&Ue(n)}}}function yo(t){const o={prevVal:t.prevState,currentVal:t.state};for(const e of t.listeners)e(o)}function vo(t){const o={prevVal:t.prevState,currentVal:t.state};for(const e of t.listeners)e(o)}function Ve(t){if(mt>0&&!Pt.has(t)&&Pt.set(t,t.prevState),pt.add(t),!(mt>0)&&!Nt)try{for(Nt=!0;pt.size>0;){const o=Array.from(pt);pt.clear();for(const e of o){const s=Pt.get(e)??e.prevState;e.prevState=s,yo(e)}for(const e of o){const s=Yt.get(e);s&&(bt.current.push(e),Ue(s))}for(const e of o){const s=Yt.get(e);if(s)for(const n of s)vo(n)}}}finally{Nt=!1,bt.current=[],Pt.clear()}}function gt(t){mt++;try{t()}finally{if(mt--,mt===0){const o=pt.values().next().value;o&&Ve(o)}}}function So(t){return typeof t=="function"}class _o{constructor(o,e){this.listeners=new Set,this.subscribe=s=>{var n,r;this.listeners.add(s);const i=(r=(n=this.options)==null?void 0:n.onSubscribe)==null?void 0:r.call(n,s,this);return()=>{this.listeners.delete(s),i?.()}},this.prevState=o,this.state=o,this.options=e}setState(o){var e,s,n;this.prevState=this.state,(e=this.options)!=null&&e.updateFn?this.state=this.options.updateFn(this.prevState)(o):So(o)?this.state=o(this.prevState):this.state=o,(n=(s=this.options)==null?void 0:s.onUpdate)==null||n.call(s),Ve(this)}}const G="__TSR_index",ve="popstate",Se="beforeunload";function Ro(t){let o=t.getLocation();const e=new Set,s=i=>{o=t.getLocation(),e.forEach(c=>c({location:o,action:i}))},n=i=>{t.notifyOnIndexChange??!0?s(i):o=t.getLocation()},r=async({task:i,navigateOpts:c,...a})=>{if(c?.ignoreBlocker??!1){i();return}const u=t.getBlockers?.()??[],h=a.type==="PUSH"||a.type==="REPLACE";if(typeof document<"u"&&u.length&&h)for(const f of u){const d=Et(a.path,a.state);if(await f.blockerFn({currentLocation:o,nextLocation:d,action:a.type})){t.onBlocked?.();return}}i()};return{get location(){return o},get length(){return t.getLength()},subscribers:e,subscribe:i=>(e.add(i),()=>{e.delete(i)}),push:(i,c,a)=>{const l=o.state[G];c=_e(l+1,c),r({task:()=>{t.pushState(i,c),s({type:"PUSH"})},navigateOpts:a,type:"PUSH",path:i,state:c})},replace:(i,c,a)=>{const l=o.state[G];c=_e(l,c),r({task:()=>{t.replaceState(i,c),s({type:"REPLACE"})},navigateOpts:a,type:"REPLACE",path:i,state:c})},go:(i,c)=>{r({task:()=>{t.go(i),n({type:"GO",index:i})},navigateOpts:c,type:"GO"})},back:i=>{r({task:()=>{t.back(i?.ignoreBlocker??!1),n({type:"BACK"})},navigateOpts:i,type:"BACK"})},forward:i=>{r({task:()=>{t.forward(i?.ignoreBlocker??!1),n({type:"FORWARD"})},navigateOpts:i,type:"FORWARD"})},canGoBack:()=>o.state[G]!==0,createHref:i=>t.createHref(i),block:i=>{if(!t.setBlockers)return()=>{};const c=t.getBlockers?.()??[];return t.setBlockers([...c,i]),()=>{const a=t.getBlockers?.()??[];t.setBlockers?.(a.filter(l=>l!==i))}},flush:()=>t.flush?.(),destroy:()=>t.destroy?.(),notify:s}}function _e(t,o){o||(o={});const e=oe();return{...o,key:e,__TSR_key:e,[G]:t}}function Po(t){const o=typeof document<"u"?window:void 0,e=o.history.pushState,s=o.history.replaceState;let n=[];const r=()=>n,i=v=>n=v,c=(v=>v),a=(()=>Et(`${o.location.pathname}${o.location.search}${o.location.hash}`,o.history.state));if(!o.history.state?.__TSR_key&&!o.history.state?.key){const v=oe();o.history.replaceState({[G]:0,key:v,__TSR_key:v},"")}let l=a(),u,h=!1,f=!1,d=!1,p=!1;const m=()=>l;let y,_;const x=()=>{y&&(S._ignoreSubscribers=!0,(y.isPush?o.history.pushState:o.history.replaceState)(y.state,"",y.href),S._ignoreSubscribers=!1,y=void 0,_=void 0,u=void 0)},P=(v,C,M)=>{const T=c(C);_||(u=l),l=Et(C,M),y={href:T,state:M,isPush:y?.isPush||v==="push"},_||(_=Promise.resolve().then(()=>x()))},L=v=>{l=a(),S.notify({type:v})},E=async()=>{if(f){f=!1;return}const v=a(),C=v.state[G]-l.state[G],M=C===1,T=C===-1,I=!M&&!T||h;h=!1;const Y=I?"GO":T?"BACK":"FORWARD",D=I?{type:"GO",index:C}:{type:T?"BACK":"FORWARD"};if(d)d=!1;else{const X=r();if(typeof document<"u"&&X.length){for(const he of X)if(await he.blockerFn({currentLocation:l,nextLocation:v,action:Y})){f=!0,o.history.go(1),S.notify(D);return}}}l=a(),S.notify(D)},w=v=>{if(p){p=!1;return}let C=!1;const M=r();if(typeof document<"u"&&M.length)for(const T of M){const I=T.enableBeforeUnload??!0;if(I===!0){C=!0;break}if(typeof I=="function"&&I()===!0){C=!0;break}}if(C)return v.preventDefault(),v.returnValue=""},S=Ro({getLocation:m,getLength:()=>o.history.length,pushState:(v,C)=>P("push",v,C),replaceState:(v,C)=>P("replace",v,C),back:v=>(v&&(d=!0),p=!0,o.history.back()),forward:v=>{v&&(d=!0),p=!0,o.history.forward()},go:v=>{h=!0,o.history.go(v)},createHref:v=>c(v),flush:x,destroy:()=>{o.history.pushState=e,o.history.replaceState=s,o.removeEventListener(Se,w,{capture:!0}),o.removeEventListener(ve,E)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:r,setBlockers:i,notifyOnIndexChange:!1});return o.addEventListener(Se,w,{capture:!0}),o.addEventListener(ve,E),o.history.pushState=function(...v){const C=e.apply(o.history,v);return S._ignoreSubscribers||L("PUSH"),C},o.history.replaceState=function(...v){const C=s.apply(o.history,v);return S._ignoreSubscribers||L("REPLACE"),C},S}function Et(t,o){const e=t.indexOf("#"),s=t.indexOf("?"),n=oe();return{href:t,pathname:t.substring(0,e>0?s>0?Math.min(e,s):e:s>0?s:t.length),hash:e>-1?t.substring(e):"",search:s>-1?t.slice(s,e===-1?void 0:e):"",state:o||{[G]:0,key:n,__TSR_key:n}}}function oe(){return(Math.random()+1).toString(36).substring(7)}function Xt(t){return t[t.length-1]}function wo(t){return typeof t=="function"}function Q(t,o){return wo(t)?t(o):t}const xo=Object.prototype.hasOwnProperty;function B(t,o){if(t===o)return t;const e=o,s=we(t)&&we(e);if(!s&&!(Tt(t)&&Tt(e)))return e;const n=s?t:Re(t);if(!n)return e;const r=s?e:Re(e);if(!r)return e;const i=n.length,c=r.length,a=s?new Array(c):{};let l=0;for(let u=0;u"u")return!0;const e=o.prototype;return!(!Pe(e)||!e.hasOwnProperty("isPrototypeOf"))}function Pe(t){return Object.prototype.toString.call(t)==="[object Object]"}function we(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function tt(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,n=t.length;sn||!tt(t[i],o[i],e)))return!1;return n===r}return!1}function it(t){let o,e;const s=new Promise((n,r)=>{o=n,e=r});return s.status="pending",s.resolve=n=>{s.status="resolved",s.value=n,o(n),t?.(n)},s.reject=n=>{s.status="rejected",e(n)},s}function q(t){return!!(t&&typeof t=="object"&&typeof t.then=="function")}const Lo=Array.from(new Map([["%","%25"],["\\","%5C"]]).values());function xe(t,o=Lo){function e(n,r,i=0){for(let c=i;c{try{return decodeURI(c)}catch{return c}})}}if(t===""||!/%[0-9A-Fa-f]{2}/g.test(t))return t;const s=t.replaceAll(/%[0-9a-f]{2}/g,n=>n.toUpperCase());return e(s,o)}var Co="Invariant failed";function K(t,o){if(!t)throw new Error(Co)}const U=0,ot=1,at=2,ct=3;function z(t){return se(t.filter(o=>o!==void 0).join("/"))}function se(t){return t.replace(/\/{2,}/g,"/")}function ne(t){return t==="/"?t:t.replace(/^\/{1,}/,"")}function J(t){return t==="/"?t:t.replace(/\/{1,}$/,"")}function Ct(t){return J(ne(t))}function It(t,o){return t?.endsWith("/")&&t!=="/"&&t!==`${o}/`?t.slice(0,-1):t}function Mo(t,o,e){return It(t,e)===It(o,e)}function bo(t){const{type:o,value:e}=t;if(o===U)return e;const{prefixSegment:s,suffixSegment:n}=t;if(o===ot){const r=e.substring(1);if(s&&n)return`${s}{$${r}}${n}`;if(s)return`${s}{$${r}}`;if(n)return`{$${r}}${n}`}if(o===ct){const r=e.substring(1);return s&&n?`${s}{-$${r}}${n}`:s?`${s}{-$${r}}`:n?`{-$${r}}${n}`:`{-$${r}}`}if(o===at){if(s&&n)return`${s}{$}${n}`;if(s)return`${s}{$}`;if(n)return`{$}${n}`}return e}function Eo({base:t,to:o,trailingSlash:e="never",parseCache:s}){let n=ut(t,s).slice();const r=ut(o,s);n.length>1&&Xt(n)?.value==="/"&&n.pop();for(let a=0,l=r.length;a1&&(Xt(n).value==="/"?e==="never"&&n.pop():e==="always"&&n.push({type:U,value:"/"}));const i=n.map(bo);return z(i)}const ut=(t,o)=>{if(!t)return[];const e=o?.get(t);if(e)return e;const s=Ao(t);return o?.set(t,s),s},To=/^\$.{1,}$/,Io=/^(.*?)\{(\$[a-zA-Z_$][a-zA-Z0-9_$]*)\}(.*)$/,ko=/^(.*?)\{-(\$[a-zA-Z_$][a-zA-Z0-9_$]*)\}(.*)$/,Oo=/^\$$/,Fo=/^(.*?)\{\$\}(.*)$/;function Ao(t){t=se(t);const o=[];if(t.slice(0,1)==="/"&&(t=t.substring(1),o.push({type:U,value:"/"})),!t)return o;const e=t.split("/").filter(Boolean);return o.push(...e.map(s=>{const n=s.match(Fo);if(n){const c=n[1],a=n[2];return{type:at,value:"$",prefixSegment:c||void 0,suffixSegment:a||void 0}}const r=s.match(ko);if(r){const c=r[1],a=r[2],l=r[3];return{type:ct,value:a,prefixSegment:c||void 0,suffixSegment:l||void 0}}const i=s.match(Io);if(i){const c=i[1],a=i[2],l=i[3];return{type:ot,value:""+a,prefixSegment:c||void 0,suffixSegment:l||void 0}}if(To.test(s)){const c=s.substring(1);return{type:ot,value:"$"+c,prefixSegment:void 0,suffixSegment:void 0}}return Oo.test(s)?{type:at,value:"$",prefixSegment:void 0,suffixSegment:void 0}:{type:U,value:s}})),t.slice(-1)==="/"&&(t=t.substring(1),o.push({type:U,value:"/"})),o}function Ut({path:t,params:o,decodeCharMap:e,parseCache:s}){const n=ut(t,s);function r(l){const u=o[l],h=typeof u=="string";return l==="*"||l==="_splat"?h?encodeURI(u):u:h?Bo(u,e):u}let i=!1;const c={},a=z(n.map(l=>{if(l.type===U)return l.value;if(l.type===at){c._splat=o._splat,c["*"]=o._splat;const u=l.prefixSegment||"",h=l.suffixSegment||"";if(!o._splat)return i=!0,u||h?`${u}${h}`:void 0;const f=r("_splat");return`${u}${f}${h}`}if(l.type===ot){const u=l.value.substring(1);!i&&!(u in o)&&(i=!0),c[u]=o[u];const h=l.prefixSegment||"",f=l.suffixSegment||"";return`${h}${r(u)??"undefined"}${f}`}if(l.type===ct){const u=l.value.substring(1),h=l.prefixSegment||"",f=l.suffixSegment||"";return!(u in o)||o[u]==null?h||f?`${h}${f}`:void 0:(c[u]=o[u],`${h}${r(u)??""}${f}`)}return l.value}));return{usedParams:c,interpolatedPath:a,isMissingParams:i}}function Bo(t,o){let e=encodeURIComponent(t);if(o)for(const[s,n]of o)e=e.replaceAll(s,n);return e}function Zt(t,o,e){const s=Do(t,o,e);if(!(o.to&&!s))return s??{}}function Do(t,{to:o,fuzzy:e,caseSensitive:s},n){const r=o,i=ut(t.startsWith("/")?t:`/${t}`,n),c=ut(r.startsWith("/")?r:`/${r}`,n),a={};return $o(i,c,a,e,s)?a:void 0}function $o(t,o,e,s,n){let r=0,i=0;for(;rm.value)));h&&p.startsWith(h)&&(p=p.slice(h.length)),f&&p.endsWith(f)&&(p=p.slice(0,p.length-f.length)),u=p}else u=decodeURI(z(l.map(h=>h.value)));return e["*"]=u,e._splat=u,!0}if(a.type===U){if(a.value==="/"&&!c?.value){i++;continue}if(c){if(n){if(a.value!==c.value)return!1}else if(a.value.toLowerCase()!==c.value.toLowerCase())return!1;r++,i++;continue}else return!1}if(a.type===ot){if(!c||c.value==="/")return!1;let l="",u=!1;if(a.prefixSegment||a.suffixSegment){const h=a.prefixSegment||"",f=a.suffixSegment||"",d=c.value;if(h&&!d.startsWith(h)||f&&!d.endsWith(f))return!1;let p=d;h&&p.startsWith(h)&&(p=p.slice(h.length)),f&&p.endsWith(f)&&(p=p.slice(0,p.length-f.length)),l=decodeURIComponent(p),u=!0}else l=decodeURIComponent(c.value),u=!0;u&&(e[a.value.substring(1)]=l,r++),i++;continue}if(a.type===ct){if(!c){i++;continue}if(c.value==="/"){i++;continue}let l="",u=!1;if(a.prefixSegment||a.suffixSegment){const h=a.prefixSegment||"",f=a.suffixSegment||"",d=c.value;if((!h||d.startsWith(h))&&(!f||d.endsWith(f))){let p=d;h&&p.startsWith(h)&&(p=p.slice(h.length)),f&&p.endsWith(f)&&(p=p.slice(0,p.length-f.length)),l=decodeURIComponent(p),u=!0}}else{let h=!0;for(let f=i+1;f=o.length)return e["**"]=z(t.slice(r).map(l=>l.value)),!!s&&o[o.length-1]?.value!=="/";if(i=t.length){for(let l=i;l{if(s.isRoot||!s.path)return;const r=ne(s.fullPath);let i=ut(r),c=0;for(;i.length>c+1&&i[c]?.value==="/";)c++;c>0&&(i=i.slice(c));let a=0,l=!1;const u=i.map((h,f)=>{if(h.value==="/")return jo;if(h.type===U)return No;let d;h.type===ot?d=Uo:h.type===ct?(d=Vo,a++):d=Wo;for(let p=f+1;p{const r=Math.min(s.scores.length,n.scores.length);for(let i=0;in.parsed[i].value?1:-1;return s.index-n.index}).map((s,n)=>(s.child.rank=n,s.child))}function Jo({routeTree:t,initRoute:o}){const e={},s={},n=i=>{i.forEach((c,a)=>{o?.(c,a);const l=e[c.id];if(K(!l,`Duplicate routes found with id: ${String(c.id)}`),e[c.id]=c,!c.isRoot&&c.path){const h=J(c.fullPath);(!s[h]||c.fullPath.endsWith("/"))&&(s[h]=c)}const u=c.children;u?.length&&n(u)})};n([t]);const r=qo(Object.values(e));return{routesById:e,routesByPath:s,flatRoutes:r}}function j(t){return!!t?.isNotFound}function Yo(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const kt="tsr-scroll-restoration-v1_3",Xo=(t,o)=>{let e;return(...s)=>{e||(e=setTimeout(()=>{t(...s),e=null},o))}};function Zo(){const t=Yo();if(!t)return null;const o=t.getItem(kt);let e=o?JSON.parse(o):{};return{state:e,set:s=>(e=Q(s,e)||e,t.setItem(kt,JSON.stringify(e)))}}const wt=Zo(),Qt=t=>t.state.__TSR_key||t.href;function Qo(t){const o=[];let e;for(;e=t.parentNode;)o.push(`${t.tagName}:nth-child(${Array.prototype.indexOf.call(e.children,t)+1})`),t=e;return`${o.reverse().join(" > ")}`.toLowerCase()}let Ot=!1;function We({storageKey:t,key:o,behavior:e,shouldScrollRestoration:s,scrollToTopSelectors:n,location:r}){let i;try{i=JSON.parse(sessionStorage.getItem(t)||"{}")}catch(l){console.error(l);return}const c=o||window.history.state?.__TSR_key,a=i[c];Ot=!0;t:{if(s&&a&&Object.keys(a).length>0){for(const h in a){const f=a[h];if(h==="window")window.scrollTo({top:f.scrollY,left:f.scrollX,behavior:e});else if(h){const d=document.querySelector(h);d&&(d.scrollLeft=f.scrollX,d.scrollTop=f.scrollY)}}break t}const l=(r??window.location).hash.split("#",2)[1];if(l){const h=window.history.state?.__hashScrollIntoViewOptions??!0;if(h){const f=document.getElementById(l);f&&f.scrollIntoView(h)}break t}const u={top:0,left:0,behavior:e};if(window.scrollTo(u),n)for(const h of n){if(h==="window")continue;const f=typeof h=="function"?h():document.querySelector(h);f&&f.scrollTo(u)}}Ot=!1}function ts(t,o){if(!wt&&!t.isServer||((t.options.scrollRestoration??!1)&&(t.isScrollRestoring=!0),t.isServer||t.isScrollRestorationSetup||!wt))return;t.isScrollRestorationSetup=!0,Ot=!1;const s=t.options.getScrollRestorationKey||Qt;window.history.scrollRestoration="manual";const n=r=>{if(Ot||!t.isScrollRestoring)return;let i="";if(r.target===document||r.target===window)i="window";else{const a=r.target.getAttribute("data-scroll-restoration-id");a?i=`[data-scroll-restoration-id="${a}"]`:i=Qo(r.target)}const c=s(t.state.location);wt.set(a=>{const l=a[c]||={},u=l[i]||={};if(i==="window")u.scrollX=window.scrollX||0,u.scrollY=window.scrollY||0;else if(i){const h=document.querySelector(i);h&&(u.scrollX=h.scrollLeft||0,u.scrollY=h.scrollTop||0)}return a})};typeof document<"u"&&document.addEventListener("scroll",Xo(n,100),!0),t.subscribe("onRendered",r=>{const i=s(r.toLocation);if(!t.resetNextScroll){t.resetNextScroll=!0;return}typeof t.options.scrollRestoration=="function"&&!t.options.scrollRestoration({location:t.latestLocation})||(We({storageKey:kt,key:i,behavior:t.options.scrollRestorationBehavior,shouldScrollRestoration:t.isScrollRestoring,scrollToTopSelectors:t.options.scrollToTopSelectors,location:t.history.location}),t.isScrollRestoring&&wt.set(c=>(c[i]||={},c)))})}function es(t){if(typeof document<"u"&&document.querySelector){const o=t.state.location.state.__hashScrollIntoViewOptions??!0;if(o&&t.state.location.hash!==""){const e=document.getElementById(t.state.location.hash);e&&e.scrollIntoView(o)}}}function os(t,o=String){const e=new URLSearchParams;for(const s in t){const n=t[s];n!==void 0&&e.set(s,o(n))}return e.toString()}function Vt(t){return t?t==="false"?!1:t==="true"?!0:+t*0===0&&+t+""===t?+t:t:""}function ss(t){const o=new URLSearchParams(t),e={};for(const[s,n]of o.entries()){const r=e[s];r==null?e[s]=Vt(n):Array.isArray(r)?r.push(Vt(n)):e[s]=[r,Vt(n)]}return e}const ns=is(JSON.parse),rs=as(JSON.stringify,JSON.parse);function is(t){return o=>{o[0]==="?"&&(o=o.substring(1));const e=ss(o);for(const s in e){const n=e[s];if(typeof n=="string")try{e[s]=t(n)}catch{}}return e}}function as(t,o){const e=typeof o=="function";function s(n){if(typeof n=="object"&&n!==null)try{return t(n)}catch{}else if(e&&typeof n=="string")try{return o(n),t(n)}catch{}return n}return n=>{const r=os(n,s);return r?`?${r}`:""}}const A="__root__";function cs(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 o=new Headers(t.headers);t.href&&o.get("Location")===null&&o.set("Location",t.href);const e=new Response(null,{status:t.statusCode,headers:o});if(e.options=t,t.throw)throw e;return e}function N(t){return t instanceof Response&&!!t.options}function us(t){const o=new Map;let e,s;const n=r=>{r.next&&(r.prev?(r.prev.next=r.next,r.next.prev=r.prev,r.next=void 0,s&&(s.next=r,r.prev=s)):(r.next.prev=void 0,e=r.next,r.next=void 0,s&&(r.prev=s,s.next=r)),s=r)};return{get(r){const i=o.get(r);if(i)return n(i),i.value},set(r,i){if(o.size>=t&&e){const a=e;o.delete(a.key),a.next&&(e=a.next,a.next.prev=void 0),a===s&&(s=void 0)}const c=o.get(r);if(c)c.value=i,n(c);else{const a={key:r,value:i,prev:s};s&&(s.next=a),s=a,e||(e=a),o.set(r,a)}}}}const Mt=t=>{if(!t.rendered)return t.rendered=!0,t.onReady?.()},At=(t,o)=>!!(t.preload&&!t.router.state.matches.some(e=>e.id===o)),ze=(t,o)=>{const e=t.router.routesById[o.routeId??""]??t.router.routeTree;!e.options.notFoundComponent&&t.router.options?.defaultNotFoundComponent&&(e.options.notFoundComponent=t.router.options.defaultNotFoundComponent),K(e.options.notFoundComponent);const s=t.matches.find(n=>n.routeId===e.id);K(s,"Could not find match for route: "+e.id),t.updateMatch(s.id,n=>({...n,status:"notFound",error:o,isFetching:!1})),o.routerCode==="BEFORE_LOAD"&&e.parentRoute&&(o.routeId=e.parentRoute.id,ze(t,o))},H=(t,o,e)=>{if(!(!N(e)&&!j(e))){if(N(e)&&e.redirectHandled&&!e.options.reloadDocument)throw e;if(o){o._nonReactive.beforeLoadPromise?.resolve(),o._nonReactive.loaderPromise?.resolve(),o._nonReactive.beforeLoadPromise=void 0,o._nonReactive.loaderPromise=void 0;const s=N(e)?"redirected":"notFound";o._nonReactive.error=e,t.updateMatch(o.id,n=>({...n,status:s,isFetching:!1,error:e})),j(e)&&!e.routeId&&(e.routeId=o.routeId),o._nonReactive.loadPromise?.resolve()}throw N(e)?(t.rendered=!0,e.options._fromLocation=t.location,e.redirectHandled=!0,e=t.router.resolveRedirect(e),e):(ze(t,e),e)}},Ke=(t,o)=>{const e=t.router.getMatch(o);return!!(!t.router.isServer&&e._nonReactive.dehydrated||t.router.isServer&&e.ssr===!1)},ht=(t,o,e,s)=>{const{id:n,routeId:r}=t.matches[o],i=t.router.looseRoutesById[r];if(e instanceof Promise)throw e;e.routerCode=s,t.firstBadMatchIndex??=o,H(t,t.router.getMatch(n),e);try{i.options.onError?.(e)}catch(c){e=c,H(t,t.router.getMatch(n),e)}t.updateMatch(n,c=>(c._nonReactive.beforeLoadPromise?.resolve(),c._nonReactive.beforeLoadPromise=void 0,c._nonReactive.loadPromise?.resolve(),{...c,error:e,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},ls=(t,o,e,s)=>{const n=t.router.getMatch(o),r=t.matches[e-1]?.id,i=r?t.router.getMatch(r):void 0;if(t.router.isShell()){n.ssr=s.id===A;return}if(i?.ssr===!1){n.ssr=!1;return}const c=d=>d===!0&&i?.ssr==="data-only"?"data-only":d,a=t.router.options.defaultSsr??!0;if(s.options.ssr===void 0){n.ssr=c(a);return}if(typeof s.options.ssr!="function"){n.ssr=c(s.options.ssr);return}const{search:l,params:u}=n,h={search:xt(l,n.searchError),params:xt(u,n.paramsError),location:t.location,matches:t.matches.map(d=>({index:d.index,pathname:d.pathname,fullPath:d.fullPath,staticData:d.staticData,id:d.id,routeId:d.routeId,search:xt(d.search,d.searchError),params:xt(d.params,d.paramsError),ssr:d.ssr}))},f=s.options.ssr(h);if(q(f))return f.then(d=>{n.ssr=c(d??a)});n.ssr=c(f??a)},He=(t,o,e,s)=>{if(s._nonReactive.pendingTimeout!==void 0)return;const n=e.options.pendingMs??t.router.options.defaultPendingMs;if(!!(t.onReady&&!t.router.isServer&&!At(t,o)&&(e.options.loader||e.options.beforeLoad||Je(e))&&typeof n=="number"&&n!==1/0&&(e.options.pendingComponent??t.router.options?.defaultPendingComponent))){const i=setTimeout(()=>{Mt(t)},n);s._nonReactive.pendingTimeout=i}},hs=(t,o,e)=>{const s=t.router.getMatch(o);if(!s._nonReactive.beforeLoadPromise&&!s._nonReactive.loaderPromise)return;He(t,o,e,s);const n=()=>{const r=t.router.getMatch(o);r.preload&&(r.status==="redirected"||r.status==="notFound")&&H(t,r,r.error)};return s._nonReactive.beforeLoadPromise?s._nonReactive.beforeLoadPromise.then(n):n()},fs=(t,o,e,s)=>{const n=t.router.getMatch(o),r=n._nonReactive.loadPromise;n._nonReactive.loadPromise=it(()=>{r?.resolve()});const{paramsError:i,searchError:c}=n;i&&ht(t,e,i,"PARSE_PARAMS"),c&&ht(t,e,c,"VALIDATE_SEARCH"),He(t,o,s,n);const a=new AbortController,l=t.matches[e-1]?.id,f={...(l?t.router.getMatch(l):void 0)?.context??t.router.options.context??void 0,...n.__routeContext};let d=!1;const p=()=>{d||(d=!0,t.updateMatch(o,S=>({...S,isFetching:"beforeLoad",fetchCount:S.fetchCount+1,abortController:a,context:f})))},m=()=>{n._nonReactive.beforeLoadPromise?.resolve(),n._nonReactive.beforeLoadPromise=void 0,t.updateMatch(o,S=>({...S,isFetching:!1}))};if(!s.options.beforeLoad){gt(()=>{p(),m()});return}n._nonReactive.beforeLoadPromise=it();const{search:y,params:_,cause:x}=n,P=At(t,o),L={search:y,abortController:a,params:_,preload:P,context:f,location:t.location,navigate:S=>t.router.navigate({...S,_fromLocation:t.location}),buildLocation:t.router.buildLocation,cause:P?"preload":x,matches:t.matches,...t.router.options.additionalContext},E=S=>{if(S===void 0){gt(()=>{p(),m()});return}(N(S)||j(S))&&(p(),ht(t,e,S,"BEFORE_LOAD")),gt(()=>{p(),t.updateMatch(o,v=>({...v,__beforeLoadContext:S,context:{...v.context,...S}})),m()})};let w;try{if(w=s.options.beforeLoad(L),q(w))return p(),w.catch(S=>{ht(t,e,S,"BEFORE_LOAD")}).then(E)}catch(S){p(),ht(t,e,S,"BEFORE_LOAD")}E(w)},ds=(t,o)=>{const{id:e,routeId:s}=t.matches[o],n=t.router.looseRoutesById[s],r=()=>{if(t.router.isServer){const a=ls(t,e,o,n);if(q(a))return a.then(c)}return c()},i=()=>fs(t,e,o,n),c=()=>{if(Ke(t,e))return;const a=hs(t,e,n);return q(a)?a.then(i):i()};return r()},yt=(t,o,e)=>{const s=t.router.getMatch(o);if(!s||!e.options.head&&!e.options.scripts&&!e.options.headers)return;const n={matches:t.matches,match:s,params:s.params,loaderData:s.loaderData};return Promise.all([e.options.head?.(n),e.options.scripts?.(n),e.options.headers?.(n)]).then(([r,i,c])=>{const a=r?.meta,l=r?.links,u=r?.scripts,h=r?.styles;return{meta:a,links:l,headScripts:u,headers:c,scripts:i,styles:h}})},Ge=(t,o,e,s)=>{const n=t.matchPromises[e-1],{params:r,loaderDeps:i,abortController:c,cause:a}=t.router.getMatch(o);let l=t.router.options.context??{};for(let h=0;h<=e;h++){const f=t.matches[h];if(!f)continue;const d=t.router.getMatch(f.id);d&&(l={...l,...d.__routeContext??{},...d.__beforeLoadContext??{}})}const u=At(t,o);return{params:r,deps:i,preload:!!u,parentMatchPromise:n,abortController:c,context:l,location:t.location,navigate:h=>t.router.navigate({...h,_fromLocation:t.location}),cause:u?"preload":a,route:s,...t.router.options.additionalContext}},be=async(t,o,e,s)=>{try{const n=t.router.getMatch(o);try{(!t.router.isServer||n.ssr===!0)&&qe(s);const r=s.options.loader?.(Ge(t,o,e,s)),i=s.options.loader&&q(r);if(!!(i||s._lazyPromise||s._componentsPromise||s.options.head||s.options.scripts||s.options.headers||n._nonReactive.minPendingPromise)&&t.updateMatch(o,h=>({...h,isFetching:"loader"})),s.options.loader){const h=i?await r:r;H(t,t.router.getMatch(o),h),h!==void 0&&t.updateMatch(o,f=>({...f,loaderData:h}))}s._lazyPromise&&await s._lazyPromise;const a=yt(t,o,s),l=a?await a:void 0,u=n._nonReactive.minPendingPromise;u&&await u,s._componentsPromise&&await s._componentsPromise,t.updateMatch(o,h=>({...h,error:void 0,status:"success",isFetching:!1,updatedAt:Date.now(),...l}))}catch(r){let i=r;const c=n._nonReactive.minPendingPromise;c&&await c,j(r)&&await s.options.notFoundComponent?.preload?.(),H(t,t.router.getMatch(o),r);try{s.options.onError?.(r)}catch(u){i=u,H(t,t.router.getMatch(o),u)}const a=yt(t,o,s),l=a?await a:void 0;t.updateMatch(o,u=>({...u,error:i,status:"error",isFetching:!1,...l}))}}catch(n){const r=t.router.getMatch(o);if(r){const i=yt(t,o,s);if(i){const c=await i;t.updateMatch(o,a=>({...a,...c}))}r._nonReactive.loaderPromise=void 0}H(t,r,n)}},ps=async(t,o)=>{const{id:e,routeId:s}=t.matches[o];let n=!1,r=!1;const i=t.router.looseRoutesById[s];if(Ke(t,e)){if(t.router.isServer){const l=yt(t,e,i);if(l){const u=await l;t.updateMatch(e,h=>({...h,...u}))}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 u=t.router.getMatch(e),h=u._nonReactive.error||u.error;h&&H(t,u,h)}else{const u=Date.now()-l.updatedAt,h=At(t,e),f=h?i.options.preloadStaleTime??t.router.options.defaultPreloadStaleTime??3e4:i.options.staleTime??t.router.options.defaultStaleTime??0,d=i.options.shouldReload,p=typeof d=="function"?d(Ge(t,e,o,i)):d,m=!!h&&!t.router.state.matches.some(P=>P.id===e),y=t.router.getMatch(e);y._nonReactive.loaderPromise=it(),m!==y.preload&&t.updateMatch(e,P=>({...P,preload:m}));const{status:_,invalid:x}=y;if(n=_==="success"&&(x||(p??u>f)),!(h&&i.options.preload===!1))if(n&&!t.sync)r=!0,(async()=>{try{await be(t,e,o,i);const P=t.router.getMatch(e);P._nonReactive.loaderPromise?.resolve(),P._nonReactive.loadPromise?.resolve(),P._nonReactive.loaderPromise=void 0}catch(P){N(P)&&await t.router.navigate(P.options)}})();else if(_!=="success"||n&&t.sync)await be(t,e,o,i);else{const P=yt(t,e,i);if(P){const L=await P;t.updateMatch(e,E=>({...E,...L}))}}}}const c=t.router.getMatch(e);r||(c._nonReactive.loaderPromise?.resolve(),c._nonReactive.loadPromise?.resolve()),clearTimeout(c._nonReactive.pendingTimeout),c._nonReactive.pendingTimeout=void 0,r||(c._nonReactive.loaderPromise=void 0),c._nonReactive.dehydrated=void 0;const a=r?c.isFetching:!1;return a!==c.isFetching||c.invalid!==!1?(t.updateMatch(e,l=>({...l,isFetching:a,invalid:!1})),t.router.getMatch(e)):c};async function Ee(t){const o=Object.assign(t,{matchPromises:[]});!o.router.isServer&&o.router.state.matches.some(e=>e._forcePending)&&Mt(o);try{for(let n=0;n{const{id:e,...s}=o.options;Object.assign(t.options,s),t._lazyLoaded=!0,t._lazyPromise=void 0}):t._lazyLoaded=!0),!t._componentsLoaded&&t._componentsPromise===void 0){const o=()=>{const e=[];for(const s of Ye){const n=t.options[s]?.preload;n&&e.push(n())}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(o):o()}return t._componentsPromise}function xt(t,o){return o?{status:"error",error:o}:{status:"success",value:t}}function Je(t){for(const o of Ye)if(t.options[o]?.preload)return!0;return!1}const Ye=["component","errorComponent","pendingComponent","notFoundComponent"];function ms(t){return{input:({url:o})=>{for(const e of t)o=Xe(e,o);return o},output:({url:o})=>{for(let e=t.length-1;e>=0;e--)o=Ze(t[e],o);return o}}}function gs(t){const o=Ct(t.basepath),e=`/${o}`,s=`${e}/`,n=t.caseSensitive?e:e.toLowerCase(),r=t.caseSensitive?s:s.toLowerCase();return{input:({url:i})=>{const c=t.caseSensitive?i.pathname:i.pathname.toLowerCase();return c===n?i.pathname="/":c.startsWith(r)&&(i.pathname=i.pathname.slice(e.length)),i},output:({url:i})=>(i.pathname=z(["/",o,i.pathname]),i)}}function Xe(t,o){const e=t?.input?.({url:o});if(e){if(typeof e=="string")return new URL(e);if(e instanceof URL)return e}return o}function Ze(t,o){const e=t?.output?.({url:o});if(e){if(typeof e=="string")return new URL(e);if(e instanceof URL)return e}return o}function et(t){const o=t.resolvedLocation,e=t.location,s=o?.pathname!==e.pathname,n=o?.href!==e.href,r=o?.hash!==e.hash;return{fromLocation:o,toLocation:e,pathChanged:s,hrefChanged:n,hashChanged:r}}class ys{constructor(o){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 s=this.options,n=this.basepath??s?.basepath??"/",r=this.basepath===void 0,i=s?.rewrite;this.options={...s,...e},this.isServer=this.options.isServer??typeof document>"u",this.pathParamsDecodeCharMap=this.options.pathParamsAllowedCharacters?new Map(this.options.pathParamsAllowedCharacters.map(f=>[encodeURIComponent(f),f])):void 0,(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.isServer||(this.history=Po())),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 _o(Ss(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(f=>!["redirected"].includes(f.status))}}}),ts(this));let c=!1;const a=this.options.basepath??"/",l=this.options.rewrite;if(r||n!==a||i!==l){this.basepath=a;const f=[];Ct(a)!==""&&f.push(gs({basepath:a})),l&&f.push(l),this.rewrite=f.length===0?void 0:f.length===1?f[0]:ms(f),this.history&&this.updateLatestLocation(),c=!0}c&&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:s,flatRoutes:n}=Jo({routeTree:this.routeTree,initRoute:(i,c)=>{i.init({originalIndex:c})}});this.routesById=e,this.routesByPath=s,this.flatRoutes=n;const r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)},this.subscribe=(e,s)=>{const n={eventType:e,fn:s};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{this.subscribers.forEach(s=>{s.eventType===e.type&&s.fn(e)})},this.parseLocation=(e,s)=>{const n=({href:a,state:l})=>{const u=new URL(a,this.origin),h=Xe(this.rewrite,u),f=this.options.parseSearch(h.search),d=this.options.stringifySearch(f);h.search=d;const p=h.href.replace(h.origin,""),{pathname:m,hash:y}=h;return{href:p,publicHref:a,url:h.href,pathname:xe(m),searchStr:d,search:B(s?.search,f),hash:y.split("#").reverse()[0]??"",state:B(s?.state,l)}},r=n(e),{__tempLocation:i,__tempKey:c}=r.state;if(i&&(!c||c===this.tempLocationKey)){const a=n(i);return a.state.key=r.state.key,a.state.__TSR_key=r.state.__TSR_key,delete a.state.__tempLocation,{...a,maskedLocation:r}}return r},this.resolvePathWithBase=(e,s)=>Eo({base:e,to:se(s),trailingSlash:this.options.trailingSlash,parseCache:this.parsePathnameCache}),this.matchRoutes=(e,s,n)=>typeof e=="string"?this.matchRoutesInternal({pathname:e,search:s},n):this.matchRoutesInternal(e,s),this.parsePathnameCache=us(1e3),this.getMatchedRoutes=(e,s)=>_s({pathname:e,routePathname:s,caseSensitive:this.options.caseSensitive,routesByPath:this.routesByPath,routesById:this.routesById,flatRoutes:this.flatRoutes,parseCache:this.parsePathnameCache}),this.cancelMatch=e=>{const s=this.getMatch(e);s&&(s.abortController.abort(),clearTimeout(s._nonReactive.pendingTimeout),s._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const e=this.state.matches.filter(r=>r.status==="pending"),s=this.state.matches.filter(r=>r.isFetching==="loader");new Set([...this.state.pendingMatches??[],...e,...s]).forEach(r=>{this.cancelMatch(r.id)})},this.buildLocation=e=>{const s=(r={})=>{const i=r._fromLocation||this.pendingBuiltLocation||this.latestLocation,c=this.matchRoutes(i,{_buildLocation:!0}),a=Xt(c);r.from;const l=r.unsafeRelative==="path"?i.pathname:r.from??a.fullPath,u=this.resolvePathWithBase(l,"."),h=a.search,f={...a.params},d=r.to?this.resolvePathWithBase(u,`${r.to}`):this.resolvePathWithBase(u,"."),p=r.params===!1||r.params===null?{}:(r.params??!0)===!0?f:Object.assign(f,Q(r.params,f)),m=Ut({path:d,params:p,parseCache:this.parsePathnameCache}).interpolatedPath,y=this.matchRoutes(m,void 0,{_buildLocation:!0}).map(M=>this.looseRoutesById[M.routeId]);if(Object.keys(p).length>0)for(const M of y){const T=M.options.params?.stringify??M.options.stringifyParams;T&&Object.assign(p,T(p))}const _=e.leaveParams?d:xe(Ut({path:d,params:p,decodeCharMap:this.pathParamsDecodeCharMap,parseCache:this.parsePathnameCache}).interpolatedPath);let x=h;if(e._includeValidateSearch&&this.options.search?.strict){const M={};y.forEach(T=>{if(T.options.validateSearch)try{Object.assign(M,te(T.options.validateSearch,{...M,...x}))}catch{}}),x=M}x=Rs({search:x,dest:r,destRoutes:y,_includeValidateSearch:e._includeValidateSearch}),x=B(h,x);const P=this.options.stringifySearch(x),L=r.hash===!0?i.hash:r.hash?Q(r.hash,i.hash):void 0,E=L?`#${L}`:"";let w=r.state===!0?i.state:r.state?Q(r.state,i.state):{};w=B(i.state,w);const S=`${_}${P}${E}`,v=new URL(S,this.origin),C=Ze(this.rewrite,v);return{publicHref:C.pathname+C.search+C.hash,href:S,url:C.href,pathname:_,search:x,searchStr:P,state:w,hash:L??"",unmaskOnReload:r.unmaskOnReload}},n=(r={},i)=>{const c=s(r);let a=i?s(i):void 0;if(!a){let l={};const u=this.options.routeMasks?.find(h=>{const f=Zt(c.pathname,{to:h.from,caseSensitive:!1,fuzzy:!1},this.parsePathnameCache);return f?(l=f,!0):!1});if(u){const{from:h,...f}=u;i={from:e.from,...f,params:l},a=s(i)}}return a&&(c.maskedLocation=a),c};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=({viewTransition:e,ignoreBlocker:s,...n})=>{const r=()=>{const a=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];a.forEach(u=>{n.state[u]=this.latestLocation.state[u]});const l=tt(n.state,this.latestLocation.state);return a.forEach(u=>{delete n.state[u]}),l},i=J(this.latestLocation.href)===J(n.href),c=this.commitLocationPromise;if(this.commitLocationPromise=it(()=>{c?.resolve()}),i&&r())this.load();else{let{maskedLocation:a,hashScrollIntoView:l,...u}=n;a&&(u={...a,state:{...a.state,__tempKey:void 0,__tempLocation:{...u,search:u.searchStr,state:{...u.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(u.unmaskOnReload??this.options.unmaskOnReload??!1)&&(u.state.__tempKey=this.tempLocationKey)),u.state.__hashScrollIntoViewOptions=l??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,this.history[n.replace?"replace":"push"](u.publicHref,u.state,{ignoreBlocker:s})}return this.resetNextScroll=n.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:s,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,href:c,...a}={})=>{if(c){const h=this.history.location.state.__TSR_index,f=Et(c,{__TSR_index:e?h:h+1});a.to=f.pathname,a.search=this.options.parseSearch(f.search),a.hash=f.hash.slice(1)}const l=this.buildLocation({...a,_includeValidateSearch:!0});this.pendingBuiltLocation=l;const u=this.commitLocation({...l,viewTransition:r,replace:e,resetScroll:s,hashScrollIntoView:n,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===l&&(this.pendingBuiltLocation=void 0)}),u},this.navigate=({to:e,reloadDocument:s,href:n,...r})=>{if(!s&&n)try{new URL(`${n}`),s=!0}catch{}return s?(n||(n=this.buildLocation({to:e,...r}).url),r.replace?window.location.replace(n):window.location.href=n,Promise.resolve()):this.buildAndCommitLocation({...r,href:n,to:e,_isNavigate:!0})},this.beforeLoad=()=>{if(this.cancelMatches(),this.updateLatestLocation(),this.isServer){const s=this.buildLocation({to:this.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0}),n=r=>{try{return encodeURI(decodeURI(r))}catch{return r}};if(Ct(n(this.latestLocation.href))!==Ct(n(s.href))){let r=s.url;throw this.origin&&r.startsWith(this.origin)&&(r=r.replace(this.origin,"")||"/"),cs({href:r})}}const e=this.matchRoutes(this.latestLocation);this.__store.setState(s=>({...s,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:e,cachedMatches:s.cachedMatches.filter(n=>!e.some(r=>r.id===n.id))}))},this.load=async e=>{let s,n,r;for(r=new Promise(c=>{this.startTransition(async()=>{try{this.beforeLoad();const a=this.latestLocation,l=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...et({resolvedLocation:l,location:a})}),this.emit({type:"onBeforeLoad",...et({resolvedLocation:l,location:a})}),await Ee({router:this,sync:e?.sync,matches:this.state.pendingMatches,location:a,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let u=[],h=[],f=[];gt(()=>{this.__store.setState(d=>{const p=d.matches,m=d.pendingMatches||d.matches;return u=p.filter(y=>!m.some(_=>_.id===y.id)),h=m.filter(y=>!p.some(_=>_.id===y.id)),f=m.filter(y=>p.some(_=>_.id===y.id)),{...d,isLoading:!1,loadedAt:Date.now(),matches:m,pendingMatches:void 0,cachedMatches:[...d.cachedMatches,...u.filter(y=>y.status!=="error")]}}),this.clearExpiredCache()}),[[u,"onLeave"],[h,"onEnter"],[f,"onStay"]].forEach(([d,p])=>{d.forEach(m=>{this.looseRoutesById[m.routeId].options[p]?.(m)})})})})}})}catch(a){N(a)?(s=a,this.isServer||this.navigate({...s.options,replace:!0,ignoreBlocker:!0})):j(a)&&(n=a),this.__store.setState(l=>({...l,statusCode:s?s.status:n?404:l.matches.some(u=>u.status==="error")?500:200,redirect:s}))}this.latestLoadPromise===r&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),c()})}),this.latestLoadPromise=r,await r;this.latestLoadPromise&&r!==this.latestLoadPromise;)await this.latestLoadPromise;let i;this.hasNotFoundMatch()?i=404:this.__store.state.matches.some(c=>c.status==="error")&&(i=500),i!==void 0&&this.__store.setState(c=>({...c,statusCode:i}))},this.startViewTransition=e=>{const s=this.shouldViewTransition??this.options.defaultViewTransition;if(delete this.shouldViewTransition,s&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let n;if(typeof s=="object"&&this.isViewTransitionTypesSupported){const r=this.latestLocation,i=this.state.resolvedLocation,c=typeof s.types=="function"?s.types(et({resolvedLocation:i,location:r})):s.types;if(c===!1){e();return}n={update:e,types:c}}else n=e;document.startViewTransition(n)}else e()},this.updateMatch=(e,s)=>{this.startTransition(()=>{const n=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":"";n&&this.__store.setState(r=>({...r,[n]:r[n]?.map(i=>i.id===e?s(i):i)}))})},this.getMatch=e=>{const s=n=>n.id===e;return this.state.cachedMatches.find(s)??this.state.pendingMatches?.find(s)??this.state.matches.find(s)},this.invalidate=e=>{const s=n=>e?.filter?.(n)??!0?{...n,invalid:!0,...e?.forcePending||n.status==="error"?{status:"pending",error:void 0}:void 0}:n;return this.__store.setState(n=>({...n,matches:n.matches.map(s),cachedMatches:n.cachedMatches.map(s),pendingMatches:n.pendingMatches?.map(s)})),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.resolveRedirect=e=>{if(!e.options.href){const s=this.buildLocation(e.options);let n=s.url;this.origin&&n.startsWith(this.origin)&&(n=n.replace(this.origin,"")||"/"),e.options.href=s.href,e.headers.set("Location",n)}return e.headers.get("Location")||e.headers.set("Location",e.options.href),e},this.clearCache=e=>{const s=e?.filter;s!==void 0?this.__store.setState(n=>({...n,cachedMatches:n.cachedMatches.filter(r=>!s(r))})):this.__store.setState(n=>({...n,cachedMatches:[]}))},this.clearExpiredCache=()=>{const e=s=>{const n=this.looseRoutesById[s.routeId];if(!n.options.loader)return!0;const r=(s.preload?n.options.preloadGcTime??this.options.defaultPreloadGcTime:n.options.gcTime??this.options.defaultGcTime)??300*1e3;return s.status==="error"?!0:Date.now()-s.updatedAt>=r};this.clearCache({filter:e})},this.loadRouteChunk=qe,this.preloadRoute=async e=>{const s=this.buildLocation(e);let n=this.matchRoutes(s,{throwOnError:!0,preload:!0,dest:e});const r=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(c=>c.id)),i=new Set([...r,...this.state.cachedMatches.map(c=>c.id)]);gt(()=>{n.forEach(c=>{i.has(c.id)||this.__store.setState(a=>({...a,cachedMatches:[...a.cachedMatches,c]}))})});try{return n=await Ee({router:this,matches:n,location:s,preload:!0,updateMatch:(c,a)=>{r.has(c)?n=n.map(l=>l.id===c?a(l):l):this.updateMatch(c,a)}}),n}catch(c){if(N(c))return c.options.reloadDocument?void 0:await this.preloadRoute({...c.options,_fromLocation:s});j(c)||console.error(c);return}},this.matchRoute=(e,s)=>{const n={...e,to:e.to?this.resolvePathWithBase(e.from||"",e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n);if(s?.pending&&this.state.status!=="pending")return!1;const c=(s?.pending===void 0?!this.state.isLoading:s.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,a=Zt(c.pathname,{...s,to:r.pathname},this.parsePathnameCache);return!a||e.params&&!tt(a,e.params,{partial:!0})?!1:a&&(s?.includeSearch??!0)?tt(c.search,r.search,{partial:!0})?a:!1:a},this.hasNotFoundMatch=()=>this.__store.state.matches.some(e=>e.status==="notFound"||e.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...o,caseSensitive:o.caseSensitive??!1,notFoundMode:o.notFoundMode??"fuzzy",stringifySearch:o.stringifySearch??rs,parseSearch:o.parseSearch??ns}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}get looseRoutesById(){return this.routesById}matchRoutesInternal(o,e){const{foundRoute:s,matchedRoutes:n,routeParams:r}=this.getMatchedRoutes(o.pathname,e?.dest?.to);let i=!1;(s?s.path!=="/"&&r["**"]:J(o.pathname))&&(this.options.notFoundRoute?n.push(this.options.notFoundRoute):i=!0);const c=(()=>{if(i){if(this.options.notFoundMode!=="root")for(let u=n.length-1;u>=0;u--){const h=n[u];if(h.children)return h.id}return A}})(),a=[],l=u=>u?.id?u.context??this.options.context??void 0:this.options.context??void 0;return n.forEach((u,h)=>{const f=a[h-1],[d,p,m]=(()=>{const I=f?.search??o.search,Y=f?._strictSearch??void 0;try{const D=te(u.options.validateSearch,{...I})??void 0;return[{...I,...D},{...Y,...D},void 0]}catch(D){let X=D;if(D instanceof Ft||(X=new Ft(D.message,{cause:D})),e?.throwOnError)throw X;return[I,{},X]}})(),y=u.options.loaderDeps?.({search:d})??"",_=y?JSON.stringify(y):"",{interpolatedPath:x,usedParams:P}=Ut({path:u.fullPath,params:r,decodeCharMap:this.pathParamsDecodeCharMap}),L=u.id+x+_,E=this.getMatch(L),w=this.state.matches.find(I=>I.routeId===u.id),S=E?._strictParams??P;let v;if(!E){const I=u.options.params?.parse??u.options.parseParams;if(I)try{Object.assign(S,I(S))}catch(Y){if(v=new vs(Y.message,{cause:Y}),e?.throwOnError)throw v}}Object.assign(r,S);const C=w?"stay":"enter";let M;if(E)M={...E,cause:C,params:w?B(w.params,r):r,_strictParams:S,search:B(w?w.search:E.search,d),_strictSearch:p};else{const I=u.options.loader||u.options.beforeLoad||u.lazyFn||Je(u)?"pending":"success";M={id:L,index:h,routeId:u.id,params:w?B(w.params,r):r,_strictParams:S,pathname:x,updatedAt:Date.now(),search:w?B(w.search,d):d,_strictSearch:p,searchError:void 0,status:I,isFetching:!1,error:void 0,paramsError:v,__routeContext:void 0,_nonReactive:{loadPromise:it()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:C,loaderDeps:w?B(w.loaderDeps,y):y,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:u.options.staticData||{},fullPath:u.fullPath}}e?.preload||(M.globalNotFound=c===u.id),M.searchError=m;const T=l(f);M.context={...T,...M.__routeContext,...M.__beforeLoadContext},a.push(M)}),a.forEach((u,h)=>{const f=this.looseRoutesById[u.routeId];if(!this.getMatch(u.id)&&e?._buildLocation!==!0){const p=a[h-1],m=l(p);if(f.options.context){const y={deps:u.loaderDeps,params:u.params,context:m??{},location:o,navigate:_=>this.navigate({..._,_fromLocation:o}),buildLocation:this.buildLocation,cause:u.cause,abortController:u.abortController,preload:!!u.preload,matches:a};u.__routeContext=f.options.context(y)??void 0}u.context={...m,...u.__routeContext,...u.__beforeLoadContext}}}),a}}class Ft extends Error{}class vs extends Error{}function Ss(t){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:t,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function te(t,o){if(t==null)return{};if("~standard"in t){const e=t["~standard"].validate(o);if(e instanceof Promise)throw new Ft("Async validation not supported");if(e.issues)throw new Ft(JSON.stringify(e.issues,void 0,2),{cause:e});return e.value}return"parse"in t?t.parse(o):typeof t=="function"?t(o):{}}function _s({pathname:t,routePathname:o,caseSensitive:e,routesByPath:s,routesById:n,flatRoutes:r,parseCache:i}){let c={};const a=J(t),l=d=>Zt(a,{to:d.fullPath,caseSensitive:d.options?.caseSensitive??e,fuzzy:!0},i);let u=o!==void 0?s[o]:void 0;if(u)c=l(u);else{let d;for(const p of r){const m=l(p);if(m)if(p.path!=="/"&&m["**"])d||(d={foundRoute:p,routeParams:m});else{u=p,c=m;break}}!u&&d&&(u=d.foundRoute,c=d.routeParams)}let h=u||n[A];const f=[h];for(;h.parentRoute;)h=h.parentRoute,f.push(h);return f.reverse(),{matchedRoutes:f,routeParams:c,foundRoute:u}}function Rs({search:t,dest:o,destRoutes:e,_includeValidateSearch:s}){const n=e.reduce((c,a)=>{const l=[];if("search"in a.options)a.options.search?.middlewares&&l.push(...a.options.search.middlewares);else if(a.options.preSearchFilters||a.options.postSearchFilters){const u=({search:h,next:f})=>{let d=h;"preSearchFilters"in a.options&&a.options.preSearchFilters&&(d=a.options.preSearchFilters.reduce((m,y)=>y(m),h));const p=f(d);return"postSearchFilters"in a.options&&a.options.postSearchFilters?a.options.postSearchFilters.reduce((m,y)=>y(m),p):p};l.push(u)}if(s&&a.options.validateSearch){const u=({search:h,next:f})=>{const d=f(h);try{return{...d,...te(a.options.validateSearch,d)??void 0}}catch{return d}};l.push(u)}return c.concat(l)},[])??[],r=({search:c})=>o.search?o.search===!0?c:Q(o.search,c):{};n.push(r);const i=(c,a)=>{if(c>=n.length)return a;const l=n[c];return l({search:a,next:h=>i(c+1,h)})};return i(0,t)}const Ps="Error preloading route! ☝️";class Qe{constructor(o){if(this.init=e=>{this.originalIndex=e.originalIndex;const s=this.options,n=!s?.path&&!s?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=A:this.parentRoute||K(!1);let r=n?A:s?.path;r&&r!=="/"&&(r=ne(r));const i=s?.id||r;let c=n?A:z([this.parentRoute.id===A?"":this.parentRoute.id,i]);r===A&&(r="/"),c!==A&&(c=z(["/",c]));const a=c===A?"/":z([this.parentRoute.fullPath,r]);this._path=r,this._id=c,this._fullPath=a,this._to=a},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e=="object"&&e!==null&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.options=o||{},this.isRoot=!o?.getParentRoute,o?.id&&o?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class ws extends Qe{constructor(o){super(o)}}function re(t){const o=t.errorComponent??Bt;return g.jsx(xs,{getResetKey:t.getResetKey,onCatch:t.onCatch,children:({error:e,reset:s})=>e?R.createElement(o,{error:e,reset:s}):t.children})}class xs extends R.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(o){return{resetKey:o.getResetKey()}}static getDerivedStateFromError(o){return{error:o}}reset(){this.setState({error:null})}componentDidUpdate(o,e){e.error&&e.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(o,e){this.props.onCatch&&this.props.onCatch(o,e)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function Bt({error:t}){const[o,e]=R.useState(!1);return g.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[g.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[g.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),g.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>e(s=>!s),children:o?"Hide Error":"Show Error"})]}),g.jsx("div",{style:{height:".25rem"}}),o?g.jsx("div",{children:g.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:t.message?g.jsx("code",{children:t.message}):null})}):null]})}function Ls({children:t,fallback:o=null}){return Cs()?g.jsx(rt.Fragment,{children:t}):g.jsx(rt.Fragment,{children:o})}function Cs(){return rt.useSyncExternalStore(Ms,()=>!0,()=>!1)}function Ms(){return()=>{}}var Wt={exports:{}},zt={},Kt={exports:{}},Ht={};var Te;function bs(){if(Te)return Ht;Te=1;var t=ee();function o(h,f){return h===f&&(h!==0||1/h===1/f)||h!==h&&f!==f}var e=typeof Object.is=="function"?Object.is:o,s=t.useState,n=t.useEffect,r=t.useLayoutEffect,i=t.useDebugValue;function c(h,f){var d=f(),p=s({inst:{value:d,getSnapshot:f}}),m=p[0].inst,y=p[1];return r(function(){m.value=d,m.getSnapshot=f,a(m)&&y({inst:m})},[h,d,f]),n(function(){return a(m)&&y({inst:m}),h(function(){a(m)&&y({inst:m})})},[h]),i(d),d}function a(h){var f=h.getSnapshot;h=h.value;try{var d=f();return!e(h,d)}catch{return!0}}function l(h,f){return f()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:c;return Ht.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:u,Ht}var Ie;function Es(){return Ie||(Ie=1,Kt.exports=bs()),Kt.exports}var ke;function Ts(){if(ke)return zt;ke=1;var t=ee(),o=Es();function e(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var s=typeof Object.is=="function"?Object.is:e,n=o.useSyncExternalStore,r=t.useRef,i=t.useEffect,c=t.useMemo,a=t.useDebugValue;return zt.useSyncExternalStoreWithSelector=function(l,u,h,f,d){var p=r(null);if(p.current===null){var m={hasValue:!1,value:null};p.current=m}else m=p.current;p=c(function(){function _(w){if(!x){if(x=!0,P=w,w=f(w),d!==void 0&&m.hasValue){var S=m.value;if(d(S,w))return L=S}return L=w}if(S=L,s(P,w))return S;var v=f(w);return d!==void 0&&d(S,v)?(P=w,S):(P=w,L=v)}var x=!1,P,L,E=h===void 0?null:h;return[function(){return _(u())},E===null?void 0:function(){return _(E())}]},[u,h,f,d]);var y=n(l,p[0],p[1]);return i(function(){m.hasValue=!0,m.value=y},[y]),a(y),y},zt}var Oe;function Is(){return Oe||(Oe=1,Wt.exports=Ts()),Wt.exports}var ks=Is();function Os(t,o=s=>s,e={}){const s=e.equal??Fs;return ks.useSyncExternalStoreWithSelector(t.subscribe,()=>t.state,()=>t.state,o,s)}function Fs(t,o){if(Object.is(t,o))return!0;if(typeof t!="object"||t===null||typeof o!="object"||o===null)return!1;if(t instanceof Map&&o instanceof Map){if(t.size!==o.size)return!1;for(const[s,n]of t)if(!o.has(s)||!Object.is(n,o.get(s)))return!1;return!0}if(t instanceof Set&&o instanceof Set){if(t.size!==o.size)return!1;for(const s of t)if(!o.has(s))return!1;return!0}if(t instanceof Date&&o instanceof Date)return t.getTime()===o.getTime();const e=Fe(t);if(e.length!==Fe(o).length)return!1;for(let s=0;s"u"?Gt:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=Gt,Gt)}function F(t){const o=R.useContext(to());return t?.warn,o}function O(t){const o=F({warn:t?.router===void 0}),e=t?.router||o,s=R.useRef(void 0);return Os(e.__store,n=>{if(t?.select){if(t.structuralSharing??e.options.defaultStructuralSharing){const r=B(s.current,t.select(n));return s.current=r,r}return t.select(n)}return n})}const Dt=R.createContext(void 0),As=R.createContext(void 0);function V(t){const o=R.useContext(t.from?As:Dt);return O({select:s=>{const n=s.matches.find(r=>t.from?t.from===r.routeId:r.id===o);if(K(!((t.shouldThrow??!0)&&!n),`Could not find ${t.from?`an active match from "${t.from}"`:"a nearest match!"}`),n!==void 0)return t.select?t.select(n):n},structuralSharing:t.structuralSharing})}function ie(t){return V({from:t.from,strict:t.strict,structuralSharing:t.structuralSharing,select:o=>t.select?t.select(o.loaderData):o.loaderData})}function ae(t){const{select:o,...e}=t;return V({...e,select:s=>o?o(s.loaderDeps):s.loaderDeps})}function ce(t){return V({from:t.from,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,strict:t.strict,select:o=>{const e=t.strict===!1?o.params:o._strictParams;return t.select?t.select(e):e}})}function ue(t){return V({from:t.from,strict:t.strict,shouldThrow:t.shouldThrow,structuralSharing:t.structuralSharing,select:o=>t.select?t.select(o.search):o.search})}function le(t){const o=F();return R.useCallback(e=>o.navigate({...e,from:e.from??t?.from}),[t?.from,o])}var eo=po();const fn=Ne(eo),Lt=typeof window<"u"?R.useLayoutEffect:R.useEffect;function qt(t){const o=R.useRef({value:t,prev:null}),e=o.current.value;return t!==e&&(o.current={value:t,prev:e}),o.current.prev}function Bs(t,o,e={},s={}){R.useEffect(()=>{if(!t.current||s.disabled||typeof IntersectionObserver!="function")return;const n=new IntersectionObserver(([r])=>{o(r)},e);return n.observe(t.current),()=>{n.disconnect()}},[o,e,s.disabled,t])}function Ds(t){const o=R.useRef(null);return R.useImperativeHandle(t,()=>o.current,[]),o}function $s(t,o){const e=F(),[s,n]=R.useState(!1),r=R.useRef(!1),i=Ds(o),{activeProps:c,inactiveProps:a,activeOptions:l,to:u,preload:h,preloadDelay:f,hashScrollIntoView:d,replace:p,startTransition:m,resetScroll:y,viewTransition:_,children:x,target:P,disabled:L,style:E,className:w,onClick:S,onFocus:v,onMouseEnter:C,onMouseLeave:M,onTouchStart:T,ignoreBlocker:I,params:Y,search:D,hash:X,state:he,mask:ro,reloadDocument:rn,unsafeRelative:an,from:cn,_fromLocation:un,...fe}=t,io=O({select:b=>b.location.search,structuralSharing:!0}),de=t.from,lt=R.useMemo(()=>({...t,from:de}),[e,io,de,t._fromLocation,t.hash,t.to,t.search,t.params,t.state,t.mask,t.unsafeRelative]),W=R.useMemo(()=>e.buildLocation({...lt}),[e,lt]),vt=R.useMemo(()=>{if(L)return;let b=W.maskedLocation?W.maskedLocation.url:W.url,k=!1;return e.origin&&(b.startsWith(e.origin)?b=e.history.createHref(b.replace(e.origin,""))||"/":k=!0),{href:b,external:k}},[L,W.maskedLocation,W.url,e.origin,e.history]),St=R.useMemo(()=>{if(vt?.external)return vt.href;try{return new URL(u),u}catch{}},[u,vt]),st=t.reloadDocument||St?!1:h??e.options.defaultPreload,$t=f??e.options.defaultPreloadDelay??0,jt=O({select:b=>{if(St)return!1;if(l?.exact){if(!Mo(b.location.pathname,W.pathname,e.basepath))return!1}else{const k=It(b.location.pathname,e.basepath),$=It(W.pathname,e.basepath);if(!(k.startsWith($)&&(k.length===$.length||k[$.length]==="/")))return!1}return(l?.includeSearch??!0)&&!tt(b.location.search,W.search,{partial:!l?.exact,ignoreUndefined:!l?.explicitUndefined})?!1:l?.includeHash?b.location.hash===W.hash:!0}}),Z=R.useCallback(()=>{e.preloadRoute({...lt}).catch(b=>{console.warn(b),console.warn(Ps)})},[e,lt]),ao=R.useCallback(b=>{b?.isIntersecting&&Z()},[Z]);Bs(i,ao,Ws,{disabled:!!L||st!=="viewport"}),R.useEffect(()=>{r.current||!L&&st==="render"&&(Z(),r.current=!0)},[L,Z,st]);const co=b=>{const k=b.currentTarget.getAttribute("target"),$=P!==void 0?P:k;if(!L&&!zs(b)&&!b.defaultPrevented&&(!$||$==="_self")&&b.button===0){b.preventDefault(),eo.flushSync(()=>{n(!0)});const ye=e.subscribe("onResolved",()=>{ye(),n(!1)});e.navigate({...lt,replace:p,resetScroll:y,hashScrollIntoView:d,startTransition:m,viewTransition:_,ignoreBlocker:I})}};if(St)return{...fe,ref:i,href:St,...x&&{children:x},...P&&{target:P},...L&&{disabled:L},...E&&{style:E},...w&&{className:w},...S&&{onClick:S},...v&&{onFocus:v},...C&&{onMouseEnter:C},...M&&{onMouseLeave:M},...T&&{onTouchStart:T}};const pe=b=>{L||st&&Z()},uo=pe,lo=b=>{if(!(L||!st))if(!$t)Z();else{const k=b.target;if(ft.has(k))return;const $=setTimeout(()=>{ft.delete(k),Z()},$t);ft.set(k,$)}},ho=b=>{if(L||!st||!$t)return;const k=b.target,$=ft.get(k);$&&(clearTimeout($),ft.delete(k))},_t=jt?Q(c,{})??js:Jt,Rt=jt?Jt:Q(a,{})??Jt,me=[w,_t.className,Rt.className].filter(Boolean).join(" "),ge=(E||_t.style||Rt.style)&&{...E,..._t.style,...Rt.style};return{...fe,..._t,...Rt,href:vt?.href,ref:i,onClick:dt([S,co]),onFocus:dt([v,pe]),onMouseEnter:dt([C,lo]),onMouseLeave:dt([M,ho]),onTouchStart:dt([T,uo]),disabled:!!L,target:P,...ge&&{style:ge},...me&&{className:me},...L&&Ns,...jt&&Us,...s&&Vs}}const Jt={},js={className:"active"},Ns={role:"link","aria-disabled":!0},Us={"data-status":"active","aria-current":"page"},Vs={"data-transitioning":"transitioning"},ft=new WeakMap,Ws={rootMargin:"100px"},dt=t=>o=>{for(const e of t)if(e){if(o.defaultPrevented)return;e(o)}},oo=R.forwardRef((t,o)=>{const{_asChild:e,...s}=t,{type:n,ref:r,...i}=$s(s,o),c=typeof s.children=="function"?s.children({isActive:i["data-status"]==="active"}):s.children;return e===void 0&&delete i.disabled,R.createElement(e||"a",{...i,ref:r},c)});function zs(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}class Ks extends Qe{constructor(o){super(o),this.useMatch=e=>V({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>V({...e,from:this.id,select:s=>e?.select?e.select(s.context):s.context}),this.useSearch=e=>ue({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>ce({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>ae({...e,from:this.id}),this.useLoaderData=e=>ie({...e,from:this.id}),this.useNavigate=()=>le({from:this.fullPath}),this.Link=rt.forwardRef((e,s)=>g.jsx(oo,{ref:s,from:this.fullPath,...e})),this.$$typeof=Symbol.for("react.memo")}}function Hs(t){return new Ks(t)}class Gs extends ws{constructor(o){super(o),this.useMatch=e=>V({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>V({...e,from:this.id,select:s=>e?.select?e.select(s.context):s.context}),this.useSearch=e=>ue({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>ce({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>ae({...e,from:this.id}),this.useLoaderData=e=>ie({...e,from:this.id}),this.useNavigate=()=>le({from:this.fullPath}),this.Link=rt.forwardRef((e,s)=>g.jsx(oo,{ref:s,from:this.fullPath,...e})),this.$$typeof=Symbol.for("react.memo")}}function dn(t){return new Gs(t)}function Ae(t){return typeof t=="object"?new Be(t,{silent:!0}).createRoute(t):new Be(t,{silent:!0}).createRoute}class Be{constructor(o,e){this.path=o,this.createRoute=s=>{this.silent;const n=Hs(s);return n.isRoot=!1,n},this.silent=e?.silent}}class De{constructor(o){this.useMatch=e=>V({select:e?.select,from:this.options.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>V({from:this.options.id,select:s=>e?.select?e.select(s.context):s.context}),this.useSearch=e=>ue({select:e?.select,structuralSharing:e?.structuralSharing,from:this.options.id}),this.useParams=e=>ce({select:e?.select,structuralSharing:e?.structuralSharing,from:this.options.id}),this.useLoaderDeps=e=>ae({...e,from:this.options.id}),this.useLoaderData=e=>ie({...e,from:this.options.id}),this.useNavigate=()=>{const e=F();return le({from:e.routesById[this.options.id].fullPath})},this.options=o,this.$$typeof=Symbol.for("react.memo")}}function $e(t){return typeof t=="object"?new De(t):o=>new De({id:t,...o})}function qs(){const t=F(),o=R.useRef({router:t,mounted:!1}),[e,s]=R.useState(!1),{hasPendingMatches:n,isLoading:r}=O({select:h=>({isLoading:h.isLoading,hasPendingMatches:h.matches.some(f=>f.status==="pending")}),structuralSharing:!0}),i=qt(r),c=r||e||n,a=qt(c),l=r||n,u=qt(l);return t.startTransition=h=>{s(!0),R.startTransition(()=>{h(),s(!1)})},R.useEffect(()=>{const h=t.history.subscribe(t.load),f=t.buildLocation({to:t.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return J(t.latestLocation.href)!==J(f.href)&&t.commitLocation({...f,replace:!0}),()=>{h()}},[t,t.history]),Lt(()=>{if(typeof window<"u"&&t.ssr||o.current.router===t&&o.current.mounted)return;o.current={router:t,mounted:!0},(async()=>{try{await t.load()}catch(f){console.error(f)}})()},[t]),Lt(()=>{i&&!r&&t.emit({type:"onLoad",...et(t.state)})},[i,t,r]),Lt(()=>{u&&!l&&t.emit({type:"onBeforeRouteMount",...et(t.state)})},[l,u,t]),Lt(()=>{a&&!c&&(t.emit({type:"onResolved",...et(t.state)}),t.__store.setState(h=>({...h,status:"idle",resolvedLocation:h.location})),es(t))},[c,a,t]),null}function Js(t){const o=O({select:e=>`not-found-${e.location.pathname}-${e.status}`});return g.jsx(re,{getResetKey:()=>o,onCatch:(e,s)=>{if(j(e))t.onCatch?.(e,s);else throw e},errorComponent:({error:e})=>{if(j(e))return t.fallback?.(e);throw e},children:t.children})}function Ys(){return g.jsx("p",{children:"Not Found"})}function nt(t){return g.jsx(g.Fragment,{children:t.children})}function so(t,o,e){return o.options.notFoundComponent?g.jsx(o.options.notFoundComponent,{data:e}):t.options.defaultNotFoundComponent?g.jsx(t.options.defaultNotFoundComponent,{data:e}):g.jsx(Ys,{})}function Xs({children:t}){const o=F();return o.isServer?g.jsx("script",{nonce:o.options.ssr?.nonce,className:"$tsr",dangerouslySetInnerHTML:{__html:[t].filter(Boolean).join(` `)+";$_TSR.c()"}}):null}function Zs(){const t=F();if(!t.isScrollRestoring||!t.isServer||typeof t.options.scrollRestoration=="function"&&!t.options.scrollRestoration({location:t.latestLocation}))return null;const e=(t.options.getScrollRestorationKey||Qt)(t.latestLocation),s=e!==Qt(t.latestLocation)?e:void 0,n={storageKey:kt,shouldScrollRestoration:!0};return s&&(n.key=s),g.jsx(Xs,{children:`(${We.toString()})(${JSON.stringify(n)})`})}const no=R.memo(function({matchId:o}){const e=F(),s=O({select:_=>{const x=_.matches.find(P=>P.id===o);return K(x),{routeId:x.routeId,ssr:x.ssr,_displayPending:x._displayPending}},structuralSharing:!0}),n=e.routesById[s.routeId],r=n.options.pendingComponent??e.options.defaultPendingComponent,i=r?g.jsx(r,{}):null,c=n.options.errorComponent??e.options.defaultErrorComponent,a=n.options.onCatch??e.options.defaultOnCatch,l=n.isRoot?n.options.notFoundComponent??e.options.notFoundRoute?.options.component:n.options.notFoundComponent,u=s.ssr===!1||s.ssr==="data-only",h=(!n.isRoot||n.options.wrapInSuspense||u)&&(n.options.wrapInSuspense??r??(n.options.errorComponent?.preload||u))?R.Suspense:nt,f=c?re:nt,d=l?Js:nt,p=O({select:_=>_.loadedAt}),m=O({select:_=>{const x=_.matches.findIndex(P=>P.id===o);return _.matches[x-1]?.routeId}}),y=n.isRoot?n.options.shellComponent??nt:nt;return g.jsxs(y,{children:[g.jsx(Dt.Provider,{value:o,children:g.jsx(h,{fallback:i,children:g.jsx(f,{getResetKey:()=>p,errorComponent:c||Bt,onCatch:(_,x)=>{if(j(_))throw _;a?.(_,x)},children:g.jsx(d,{fallback:_=>{if(!l||_.routeId&&_.routeId!==s.routeId||!_.routeId&&!n.isRoot)throw _;return R.createElement(l,_)},children:u||s._displayPending?g.jsx(Ls,{fallback:i,children:g.jsx(je,{matchId:o})}):g.jsx(je,{matchId:o})})})})}),m===A&&e.options.scrollRestoration?g.jsxs(g.Fragment,{children:[g.jsx(Qs,{}),g.jsx(Zs,{})]}):null]})});function Qs(){const t=F(),o=R.useRef(void 0);return g.jsx("script",{suppressHydrationWarning:!0,ref:e=>{e&&(o.current===void 0||o.current.href!==t.latestLocation.href)&&(t.emit({type:"onRendered",...et(t.state)}),o.current=t.latestLocation)}},t.latestLocation.state.__TSR_key)}const je=R.memo(function({matchId:o}){const e=F(),{match:s,key:n,routeId:r}=O({select:a=>{const l=a.matches.find(p=>p.id===o),u=l.routeId,f=(e.routesById[u].options.remountDeps??e.options.defaultRemountDeps)?.({routeId:u,loaderDeps:l.loaderDeps,params:l._strictParams,search:l._strictSearch});return{key:f?JSON.stringify(f):void 0,routeId:u,match:{id:l.id,status:l.status,error:l.error,_forcePending:l._forcePending,_displayPending:l._displayPending}}},structuralSharing:!0}),i=e.routesById[r],c=R.useMemo(()=>{const a=i.options.component??e.options.defaultComponent;return a?g.jsx(a,{},n):g.jsx(tn,{})},[n,i.options.component,e.options.defaultComponent]);if(s._displayPending)throw e.getMatch(s.id)?._nonReactive.displayPendingPromise;if(s._forcePending)throw e.getMatch(s.id)?._nonReactive.minPendingPromise;if(s.status==="pending"){const a=i.options.pendingMinMs??e.options.defaultPendingMinMs;if(a){const l=e.getMatch(s.id);if(l&&!l._nonReactive.minPendingPromise&&!e.isServer){const u=it();l._nonReactive.minPendingPromise=u,setTimeout(()=>{u.resolve(),l._nonReactive.minPendingPromise=void 0},a)}}throw e.getMatch(s.id)?._nonReactive.loadPromise}if(s.status==="notFound")return K(j(s.error)),so(e,i,s.error);if(s.status==="redirected")throw K(N(s.error)),e.getMatch(s.id)?._nonReactive.loadPromise;if(s.status==="error"){if(e.isServer){const a=(i.options.errorComponent??e.options.defaultErrorComponent)||Bt;return g.jsx(a,{error:s.error,reset:void 0,info:{componentStack:""}})}throw s.error}return c}),tn=R.memo(function(){const o=F(),e=R.useContext(Dt),s=O({select:l=>l.matches.find(u=>u.id===e)?.routeId}),n=o.routesById[s],r=O({select:l=>{const h=l.matches.find(f=>f.id===e);return K(h),h.globalNotFound}}),i=O({select:l=>{const u=l.matches,h=u.findIndex(f=>f.id===e);return u[h+1]?.id}}),c=o.options.defaultPendingComponent?g.jsx(o.options.defaultPendingComponent,{}):null;if(r)return so(o,n,void 0);if(!i)return null;const a=g.jsx(no,{matchId:i});return s===A?g.jsx(R.Suspense,{fallback:c,children:a}):a});function en(){const t=F(),e=t.routesById[A].options.pendingComponent??t.options.defaultPendingComponent,s=e?g.jsx(e,{}):null,n=t.isServer||typeof document<"u"&&t.ssr?nt:R.Suspense,r=g.jsxs(n,{fallback:s,children:[!t.isServer&&g.jsx(qs,{}),g.jsx(on,{})]});return t.options.InnerWrap?g.jsx(t.options.InnerWrap,{children:r}):r}function on(){const t=F(),o=O({select:n=>n.matches[0]?.id}),e=O({select:n=>n.loadedAt}),s=o?g.jsx(no,{matchId:o}):null;return g.jsx(Dt.Provider,{value:o,children:t.options.disableGlobalCatchBoundary?s:g.jsx(re,{getResetKey:()=>e,errorComponent:Bt,onCatch:n=>{n.message||n.toString()},children:s})})}function pn(){const t=F();return O({select:o=>[o.location.href,o.resolvedLocation?.href,o.status],structuralSharing:!0}),R.useCallback(o=>{const{pending:e,caseSensitive:s,fuzzy:n,includeSearch:r,...i}=o;return t.matchRoute(i,{pending:e,caseSensitive:s,fuzzy:n,includeSearch:r})},[t])}const mn=t=>new sn(t);class sn extends ys{constructor(o){super(o)}}typeof globalThis<"u"?(globalThis.createFileRoute=Ae,globalThis.createLazyFileRoute=$e):typeof window<"u"&&(window.createFileRoute=Ae,window.createLazyFileRoute=$e);function nn({router:t,children:o,...e}){Object.keys(e).length>0&&t.update({...t.options,...e,context:{...t.options.context,...e.context}});const s=to(),n=g.jsx(s.Provider,{value:t,children:o});return t.options.Wrap?g.jsx(t.options.Wrap,{children:n}):n}function gn({router:t,...o}){return g.jsx(nn,{router:t,...o,children:g.jsx(en,{})})}export{oo as L,tn as O,rt as R,hn as a,eo as b,fn as c,pn as d,dn as e,Hs as f,mn as g,cs as h,K as i,g as j,gn as k,R as r,le as u};