PageSourceSearch

https://trading.giaodich24.vn/assets/Match-CWiCU2ct.js

js giaodich24.vn collected 2026-10-01 23:59:56 UTC 49,530 bytes, 1 lines download raw bytes

1import{ca as e,ha as t,ua as n}from"./utils-C0Fs_WZ6.js";import{C as r,_ as i,a,c as o,d as s,f as c,g as l,h as u,l as d,o as f,p,r as m,s as h,t as g,u as _,v,y}from"./useStore-BA45BNJO.js";import{a as b,c as x,d as S,f as C,g as w,h as T,i as E,m as D,n as O,o as ee,p as k,r as A,s as te,u as j}from"./link-C2ToTJDk.js";import{i as M,r as ne,t as N}from"./redirect-DmM8sbEt.js";import{n as re}from"./matchContext-BMaAFQPA.js";function ie(){try{return typeof window<`u`&&typeof window.sessionStorage==`object`?window.sessionStorage:void 0}catch{return}}var ae=`tsr-scroll-restoration-v1_3`;function oe(){let e=ie();if(!e)return null;let t={};try{let n=JSON.parse(e.getItem(`tsr-scroll-restoration-v1_3`)||`{}`);u(n)&&(t=n)}catch{}return{get state(){return t},set:e=>{t=c(e,t)||t},persist:()=>{try{e.setItem(ae,JSON.stringify(t))}catch{}}}}var se=oe(),ce=e=>e.state.__TSR_key||e.href;function le(e){let t=[],n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(` > `)}`.toLowerCase()}var P=!1,F=`window`,ue=`data-scroll-restoration-id`;function de(e,t){if(!se)return;let n=se;if((t??e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!n)return;e.isScrollRestorationSetup=!0,P=!1;let r=e.options.getScrollRestorationKey||ce,i=new Map;window.history.scrollRestoration=`manual`;let a=t=>{if(!(P||!e.isScrollRestoring))if(t.target===document||t.target===window)i.set(F,{scrollX:window.scrollX||0,scrollY:window.scrollY||0});else{let e=t.target;i.set(e,{scrollX:e.scrollLeft||0,scrollY:e.scrollTop||0})}},o=t=>{if(!e.isScrollRestoring||!t||i.size===0||!n)return;let r=n.state[t]||={};for(let[e,t]of i){let n;if(e===F)n=F;else if(e.isConnected){let t=e.getAttribute(ue);n=t?`[${ue}="${t}"]`:le(e)}n&&(r[n]=t)}};document.addEventListener(`scroll`,a,!0),e.subscribe(`onBeforeLoad`,e=>{o(e.fromLocation?r(e.fromLocation):void 0),i.clear()}),window.addEventListener(`pagehide`,()=>{o(r(e.stores.resolvedLocation.state??e.stores.location.state)),n.persist()}),e.subscribe(`onRendered`,t=>{let a=r(t.toLocation),o=e.options.scrollRestorationBehavior,s=e.options.scrollToTopSelectors;if(i.clear(),!e.resetNextScroll){e.resetNextScroll=!0;return}if(!(typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))){P=!0;try{let t=e.isScrollRestoring?n.state[a]:void 0,r=!1;if(t)for(let e in t){let n=t[e];if(!u(n))continue;let{scrollX:i,scrollY:a}=n;if(!(!Number.isFinite(i)||!Number.isFinite(a))){if(e===F)window.scrollTo({top:a,left:i,behavior:o}),r=!0;else if(e){let t;try{t=document.querySelector(e)}catch{continue}t&&(t.scrollLeft=i,t.scrollTop=a,r=!0)}}}if(!r){let t=e.history.location.hash.slice(1);if(t){let e=window.history.state?.__hashScrollIntoViewOptions??!0;if(e){let n=document.getElementById(t);n&&n.scrollIntoView(e)}}else{let e={top:0,left:0,behavior:o};if(window.scrollTo(e),s)for(let t of s){if(t===F)continue;let n=typeof t==`function`?t():document.querySelector(t);n&&n.scrollTo(e)}}}}finally{P=!1}e.isScrollRestoring&&n.set(e=>(e[a]||={},e))}})}function fe(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function pe(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function me(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=pe(r):Array.isArray(t)?t.push(pe(r)):n[e]=[t,pe(r)]}return n}var he=_e(JSON.parse),ge=ve(JSON.stringify,JSON.parse);function _e(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=me(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function ve(e,t){let n=typeof t==`function`;function r(r){if(typeof r==`object`&&r)try{return e(r)}catch{}else if(n&&typeof r==`string`)try{return t(r),e(r)}catch{}return r}return e=>{let t=fe(e,r);return t?`?${t}`:``}}function ye(e){return{input:({url:t})=>{for(let n of e)t=I(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=xe(e[n],t);return t}}}function be(e){let t=x(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),a=e.caseSensitive?r:r.toLowerCase();return{input:({url:t})=>{let r=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return r===i?t.pathname=`/`:r.startsWith(a)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=ee([`/`,t,e.pathname]),e)}}function I(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function xe(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function Se(e){let t=e;return{get state(){return t},setState(e){t=e(t)}}}function Ce(e){return{get state(){return e()}}}function we(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i,init:a}=t,o=new Map,s=new Map,c=new Map,l=n(e.status),u=n(e.loadedAt),d=n(e.isLoading),f=n(e.isTransitioning),p=n(e.location),m=n(e.resolvedLocation),h=n(e.statusCode),g=n(e.redirect),_=n([]),v=n([]),y=n([]),b=r(()=>L(o,_.state)),x=r(()=>L(s,v.state)),S=r(()=>L(c,y.state)),C=r(()=>_.state[0]),T=r(()=>_.state.some(e=>
1o.get(e)?.state.status===`pending`)),E=r(()=>({locationHref:p.state.href,resolvedLocationHref:m.state?.href,status:l.state})),D=r(()=>({status:l.state,loadedAt:u.state,isLoading:d.state,isTransitioning:f.state,matches:b.state,location:p.state,resolvedLocation:m.state,statusCode:h.state,redirect:g.state})),O=w(64);function ee(e){let t=O.get(e);return t||(t=r(()=>{let t=_.state;for(let n of t){let t=o.get(n);if(t&&t.routeId===e)return t.state}}),O.set(e,t)),t}let k={status:l,loadedAt:u,isLoading:d,isTransitioning:f,location:p,resolvedLocation:m,statusCode:h,redirect:g,matchesId:_,pendingMatchesId:v,cachedMatchesId:y,activeMatchesSnapshot:b,pendingMatchesSnapshot:x,cachedMatchesSnapshot:S,firstMatchId:C,hasPendingMatches:T,matchRouteReactivity:E,activeMatchStoresById:o,pendingMatchStoresById:s,cachedMatchStoresById:c,__store:D,getMatchStoreByRouteId:ee,setActiveMatches:A,setPendingMatches:te,setCachedMatches:j};A(e.matches),a?.(k);function A(e){R(e,o,_,n,i)}function te(e){R(e,s,v,n,i)}function j(e){R(e,c,y,n,i)}return k}function L(e,t){let n=[];for(let r of t){let t=e.get(r);t&&n.push(t.state)}return n}function R(e,t,n,r,i){let a=e.map(e=>e.id),o=new Set(a);i(()=>{for(let e of t.keys())o.has(e)||t.delete(e);for(let n of e){let e=t.get(n.id);if(!e){let e=r(n);e.routeId=n.routeId,t.set(n.id,e);continue}e.routeId=n.routeId,e.state!==n&&e.setState(()=>n)}h(n.state,a)||n.setState(()=>a)})}var z=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Te=e=>e.stores.matchesId.state.some(t=>e.stores.activeMatchStoresById.get(t)?.state._forcePending),B=(e,t)=>!!(e.preload&&!e.router.stores.activeMatchStoresById.has(t)),V=(e,t,n=!0)=>{let r={...e.router.options.context??{}},i=n?t:t-1;for(let t=0;t<=i;t++){let n=e.matches[t];if(!n)continue;let i=e.router.getMatch(n.id);
1i&&Object.assign(r,i.__routeContext,i.__beforeLoadContext)}return r},Ee=(e,t)=>{if(!e.matches.length)return;let n=t.routeId,r=e.matches.findIndex(t=>t.routeId===e.router.routeTree.id),i=r>=0?r:0,a=n?e.matches.findIndex(e=>e.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let t=a;t>=0;t--){let n=e.matches[t];if(e.router.looseRoutesById[n.routeId].options.notFoundComponent)return t}return n?a:i},H=(e,t,n)=>{if(!(!N(n)&&!M(n)))throw N(n)&&n.redirectHandled&&!n.options.reloadDocument?n:(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:N(n)?`redirected`:r.status===`pending`?`success`:r.status,context:V(e,t.index),isFetching:!1,error:n})),M(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),N(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n)),n)},De=(e,t)=>{let n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},Oe=(e,t,n)=>{let r=V(e,n);e.updateMatch(t,e=>({...e,context:r}))},U=(e,t,n,r)=>{let{id:i,routeId:a}=e.matches[t],o=e.router.looseRoutesById[a];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,H(e,e.router.getMatch(i),n);try{o.options.onError?.(n)}catch(t){n=t,H(e,e.router.getMatch(i),n)}e.updateMatch(i,e=>(e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loadPromise?.resolve(),{...e,error:n,status:`error`,isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!N(n)&&!M(n)&&(e.serialError??=n)},ke=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;let i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!B(e,t)&&(n.options.loader||n.options.beforeLoad||ze(n))&&typeof i==`number`&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){let t=setTimeout(()=>{z(e)},i);r._nonReactive.pendingTimeout=t}},Ae=(e,t,n)=>{let r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;ke(e,t,n,r);let i=()=>{let n=e.router.getMatch(t);n.preload&&(n.status===`redirected`||n.status===`notFound`)&&H(e,n,n.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},je=(e,t,n,r)=>{let i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=o(()=>{a?.resolve(),a=void 0});let{paramsError:s,searchError:c}=i;s&&U(e,n,s,`PARSE_PARAMS`),c&&U(e,n,c,`VALIDATE_SEARCH`),ke(e,t,r,i);let u=new AbortController,d=!1,f=()=>{d||(d=!0,e.updateMatch(t,e=>({...e,isFetching:`beforeLoad`,fetchCount:e.fetchCount+1,abortController:u})))},p=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,e=>({...e,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{f(),p()});return}i._nonReactive.beforeLoadPromise=o();let m={...V(e,n,!1),...i.__routeContext},{search:h,params:g,cause:_}=i,v=B(e,t),y={search:h,abortController:u,params:g,preload:v,context:m,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:v?`preload`:_,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},b=r=>{if(r===void 0){e.router.batch(()=>{f(),p()});return}(N(r)||M(r))&&(f(),U(e,n,r,`BEFORE_LOAD`)),e.router.batch(()=>{f(),e.updateMatch(t,e=>({...e,__beforeLoadContext:r})),p()})},x;try{if(x=r.options.beforeLoad(y),l(x))return f(),x.catch(t=>{U(e,n,t,`BEFORE_LOAD`)}).then(b)}catch(t){f(),U(e,n,t,`BEFORE_LOAD`)}b(x)},Me=(e,t)=>{let{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>s(),o=()=>je(e,n,t,i),s=()=>{if(De(e,n))return;let t=Ae(e,n,i);return l(t)?t.then(o):o()};return a()},Ne=(e,t,n)=>{let r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;let i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([e,t,n])=>({meta:e?.meta,links:e?.links,headScripts:e?.scripts,headers:n,scripts:t,styles:e?.styles}))},Pe=(e,t,n,r,i)=>{let a=t[r-1],{params:o,loaderDeps:s,abortController:c,cause:l}=e.router.getMatch(n),u=V(e,r),d=B(e,n);return{params:o,deps:s,preload:!!d,parentMatchPromise:a,abortController:c,context:u,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),cause:d?`preload`:l,route:i,...e.router.options.additionalContext}},Fe=async(e,t,n,r,i)=>{try{let a=e.router.getMatch(n);try{W(i);let o=i.options.loader,s=typeof o==`function`?o:o?.handler,c=s?.(Pe(e,t,n,r,i)),u=!!s&&l(c);if((u||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,e=>({...e,isFetching:`loader`})),s){let t=u?await c:c;H(e,e.router.getMatch(n),t),t!==void 0&&e.updateMatch(n,e=>({...e,loaderData:t}))}i._lazyPromise&&await i._lazyPromise;let d=a._nonReactive.minPendingPromise;d&&await d,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,t=>({...t,error:void 0,context:V(e,r),status:`success`,isFetching:!1,updatedAt:Date.now()}))}catch(t){let o=t;if(o?.name===`AbortError`){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,t=>
1({...t,status:t.status===`pending`?`success`:t.status,isFetching:!1,context:V(e,r)}));return}let s=a._nonReactive.minPendingPromise;s&&await s,M(t)&&await i.options.notFoundComponent?.preload?.(),H(e,e.router.getMatch(n),t);try{i.options.onError?.(t)}catch(t){o=t,H(e,e.router.getMatch(n),t)}!N(o)&&!M(o)&&await W(i,[`errorComponent`]),e.updateMatch(n,t=>({...t,error:o,context:V(e,r),status:`error`,isFetching:!1}))}}catch(t){let r=e.router.getMatch(n);r&&(r._nonReactive.loaderPromise=void 0),H(e,r,t)}},Ie=async(e,t,n)=>{async function r(r,a,o,l,u){let f=Date.now()-a.updatedAt,p=r?u.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:u.options.staleTime??e.router.options.defaultStaleTime??0,m=u.options.shouldReload,h=typeof m==`function`?m(Pe(e,t,i,n,u)):m,{status:g,invalid:_}=l,v=f>=p&&(!!e.forceStaleReload||l.cause===`enter`||o!==void 0&&o!==l.id);s=g===`success`&&(_||(h??v)),r&&u.options.preload===!1||(s&&!e.sync&&d?(c=!0,(async()=>{try{await Fe(e,t,i,n,u);let r=e.router.getMatch(i);r._nonReactive.loaderPromise?.resolve(),r._nonReactive.loadPromise?.resolve(),r._nonReactive.loaderPromise=void 0,r._nonReactive.loadPromise=void 0}catch(t){N(t)&&await e.router.navigate(t.options)}})()):g!==`success`||s?await Fe(e,t,i,n,u):Oe(e,i,n))}let{id:i,routeId:a}=e.matches[n],s=!1,c=!1,l=e.router.looseRoutesById[a],u=l.options.loader,d=((typeof u==`function`?void 0:u?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!==`blocking`;if(De(e,i)){if(!e.router.getMatch(i))return e.matches[n];Oe(e,i,n)}else{let t=e.router.getMatch(i),s=e.router.stores.matchesId.state[n],c=(s&&e.router.stores.activeMatchStoresById.get(s)||null)?.routeId===a?s:e.router.stores.activeMatchesSnapshot.state.find(e=>e.routeId===a)?.id,u=B(e,i);if(t._nonReactive.loaderPromise){if(t.status===`success`&&!e.sync&&!t.preload&&d)return t;await t._nonReactive.loaderPromise;let n=e.router.getMatch(i),a=n._nonReactive.error||n.error;a&&H(e,n,a),n.status===`pending`&&await r(u,t,c,n,l)}else{let n=u&&!e.router.stores.activeMatchStoresById.has(i),a=e.router.getMatch(i);a._nonReactive.loaderPromise=o(),n!==a.preload&&e.updateMatch(i,e=>({...e,preload:n})),await r(u,t,c,a,l)}}let f=e.router.getMatch(i);c||(f._nonReactive.loaderPromise?.resolve(),f._nonReactive.loadPromise?.resolve(),f._nonReactive.loadPromise=void 0),clearTimeout(f._nonReactive.pendingTimeout),f._nonReactive.pendingTimeout=void 0,c||(f._nonReactive.loaderPromise=void 0),f._nonReactive.dehydrated=void 0;let p=c?f.isFetching:!1;return p!==f.isFetching||f.invalid!==!1?(e.updateMatch(i,e=>({...e,isFetching:p,invalid:!1})),e.router.getMatch(i)):f};async function Le(e){let t=e,n=[];Te(t.router)&&z(t);let r;for(let e=0;e<t.matches.length;e++){try{let n=Me(t,e);l(n)&&await n}catch(e){if(N(e))throw e;if(M(e))r=e;else if(!t.preload)throw e;break}if(t.serialError||t.firstBadMatchIndex!=null)break}let i=t.firstBadMatchIndex??t.matches.length,o=r&&!t.preload?Ee(t,r):void 0,s=r&&t.preload?0:o===void 0?i:Math.min(o+1,i),c,u;for(let e=0;e<s;e++)n.push(Ie(t,n,e));try{await Promise.all(n)}catch{let e=await Promise.allSettled(n);for(let t of e){if(t.status!==`rejected`)continue;let e=t.reason;if(N(e))throw e;M(e)?c??=e:u??=e}if(u!==void 0)throw u}let d=c??(r&&!t.preload?r:void 0),f=t.firstBadMatchIndex===void 0?t.matches.length-1:t.firstBadMatchIndex;if(!d&&r&&t.preload)return t.matches;if(d){let e=Ee(t,d);e===void 0&&a();let n=t.matches[e],r=t.router.looseRoutesById[n.routeId],i=t.router.options?.defaultNotFoundComponent;!r.options.notFoundComponent&&i&&(r.options.notFoundComponent=i),d.routeId=n.routeId;let o=n.routeId===t.router.routeTree.id;t.updateMatch(n.id,e=>({...e,...o?{status:`success`,globalNotFound:!0,error:void 0}:{status:`notFound`,error:d},isFetching:!1})),f=e,await W(r,[`notFoundComponent`])}else if(!t.preload){let e=t.matches[0];e.globalNotFound||t.router.getMatch(e.id)?.globalNotFound&&t.updateMatch(e.id,e=>({...e,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){let e=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await W(e,[`errorComponent`])}for(let e=0;e<=f;e++){let{id:n,routeId:r}=t.matches[e],i=t.router.looseRoutesById[r];try{let e=Ne(t,n,i);if(e){let r=await e;t.updateMatch(n,e=>({...e,...r}))}}catch(e){console.error(`Error executing head for route ${r}:`,e)}}let p=z(t);if(l(p)&&await p,d)throw d;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function Re(e,t){let n=t.map(t=>
1e.options[t]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function W(e,t=G){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);let n=()=>e._componentsLoaded?void 0:t===G?(()=>{if(e._componentsPromise===void 0){let t=Re(e,G);t?e._componentsPromise=t.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():Re(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function ze(e){for(let t of G)if(e.options[t]?.preload)return!0;return!1}var G=[`component`,`errorComponent`,`pendingComponent`,`notFoundComponent`],K=`__TSR_index`,Be=`popstate`,Ve=`beforeunload`;function He(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=q(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[K];i=Ue(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[K];i=Ue(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[K]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function Ue(e,t){t||={};let n=Ke();return{...t,key:n,__TSR_key:n,[K]:e}}function We(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>q(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=Ke();t.history.replaceState({[K]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_,v=()=>{g&&(C._ignoreSubscribers=!0,(g.isPush?t.history.pushState:t.history.replaceState)(g.state,``,g.href),C._ignoreSubscribers=!1,g=void 0,_=void 0,u=void 0)},y=(e,t,n)=>{let r=s(t);_||(u=l),l=q(t,n),g={href:r,state:n,isPush:g?.isPush||e===`push`},_||=Promise.resolve().then(()=>v())},b=e=>{l=c(),C.notify({type:e})},x=async()=>{if(f){f=!1;return}let e=c(),n=e.state[K]-l.state[K],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),C.notify(u);return}}}l=c(),C.notify(u)},S=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},C=He({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>y(`push`,e,t),replaceState:(e,t)=>y(`replace`,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:v,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Ve,S,{capture:!0}),t.removeEventListener(Be,x)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(Ve,S,{capture:!0}),t.addEventListener(Be,x),t.history.pushState=function(...e){let r=n.apply(t.history,e);return C._ignoreSubscribers||b(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return C._ignoreSubscribers||b(`REPLACE`),n},C}function Ge(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function q(e,t){let n=Ge(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=Ke();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[K]:0,key:a,__TSR_key:a}}}function Ke(){return(Math.random()+1).toString(36).substring(7)}function J(e,t){let n=t,r=e;return{fromLocation:n,toLocation:r,pathChanged:n?.pathname!==r.pathname,hrefChanged:n?.href!==r.href,hashChanged:n?.hash!==r.hash}}var qe=class{constructor(e,t){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=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=E(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=We()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!==`null`?this.origin=window.origin:this.origin=`http://localhost`),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=w(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=we(Ye(this.latestLocation),e),de(this)}let a=!1,o=this.options.basepath??`/`,s=this.options.rewrite;if(r||n!==o||i!==s){this.basepath=o;let e=[],t=x(o);t&&t!==`/`&&e.push(be({basepath:o})),s&&e.push(s),this.rewrite=e.length===0?void 0:e.length===1?e[0]:ye(e),this.history&&this.updateLatestLocation(),a=!0}a&&this.stores&&this.stores.location.setState(()=>this.latestLocation),typeof window<`u`&&`CSS`in window&&typeof window.CSS?.supports==`function`&&(this.isViewTransitionTypesSupported=window.CSS.supports(`selector(:active-view-transition-type(a)`))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=T(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&D(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>
1{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{this.subscribers.forEach(t=>{t.eventType===e.type&&t.fn(e)})},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:d(e).path,external:!1,searchStr:o,search:v(t?.search,i),hash:d(r.slice(1)).path,state:y(t?.state,a)}}let o=new URL(i,this.origin),s=I(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:d(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:v(t?.search,c),hash:d(s.hash.slice(1)).path,state:y(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>te({base:e,to:A(t),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>Xe({pathname:e,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=e=>{let t=this.getMatch(e);t&&(t.abortController.abort(),clearTimeout(t._nonReactive.pendingTimeout),t._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingMatchesId.state.forEach(e=>{this.cancelMatch(e)}),this.stores.matchesId.state.forEach(e=>{if(this.stores.pendingMatchStoresById.has(e))return;let t=this.stores.activeMatchStoresById.get(e)?.state;t&&(t.status===`pending`||t.isFetching===`loader`)&&this.cancelMatch(e)})},this.buildLocation=e=>{let t=(t={})=>{let n=t._fromLocation||this.pendingBuiltLocation||this.latestLocation,r=this.matchRoutesLightweight(n);t.from;let i=t.unsafeRelative===`path`?n.pathname:t.from??r.fullPath,a=this.resolvePathWithBase(i,`.`),o=r.search,l=Object.assign(Object.create(null),r.params),u=t.to?this.resolvePathWithBase(a,`${t.to}`):this.resolvePathWithBase(a,`.`),f=t.params===!1||t.params===null?Object.create(null):(t.params??!0)===!0?l:Object.assign(l,c(t.params,l)),p=this.getMatchedRoutes(u),m=p.matchedRoutes;if((!p.foundRoute||p.foundRoute.path!==`/`&&p.routeParams[`**`])&&this.options.notFoundRoute&&(m=[...m,this.options.notFoundRoute]),Object.keys(f).length>0)for(let e of m){let t=e.options.params?.stringify??e.options.stringifyParams;if(t)try{Object.assign(f,t(f))}catch{}}let h=e.leaveParams?u:d(b({path:u,params:f,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,g=o;if(e._includeValidateSearch&&this.options.search?.strict){let e={};m.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,X(t.options.validateSearch,{...e,...g}))}catch{}}),g=e}g=Ze({search:g,dest:t,destRoutes:m,_includeValidateSearch:e._includeValidateSearch}),g=v(o,g);let _=this.options.stringifySearch(g),x=t.hash===!0?n.hash:t.hash?c(t.hash,n.hash):void 0,S=x?`#${x}`:``,C=t.state===!0?n.state:t.state?c(t.state,n.state):{};C=y(n.state,C);let w=`${h}${_}${S}`,T,E,D=!1;if(this.rewrite){let e=new URL(w,this.origin),t=xe(this.rewrite,e);T=e.href.replace(e.origin,``),t.origin===this.origin?E=t.pathname+t.search+t.hash:(E=t.href,D=!0)}else T=s(w),E=T;return{publicHref:E,href:T,pathname:h,search:g,searchStr:_,state:C,hash:x??``,external:D,unmaskOnReload:t.unmaskOnReload}},n=(n={},r)=>{let i=t(n),a=r?t(r):void 0;if(!a){let n=Object.create(null);if(this.options.routeMasks){let o=S(i.pathname,this.processedTree);if(o){Object.assign(n,o.rawParams);let{from:i,params:s,...l}=o.route,u=s===!1||s===null?Object.create(null):(s??!0)===!0?n:Object.assign(n,c(s,n));r={from:e.from,...l,params:u},a=t(r)}}}return a&&(i.maskedLocation=a),i};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r=()=>{let e=[`key`,`__TSR_key`,`__TSR_index`,`__hashScrollIntoViewOptions`];
1e.forEach(e=>{n.state[e]=this.latestLocation.state[e]});let t=_(n.state,this.latestLocation.state);return e.forEach(e=>{delete n.state[e]}),t},i=j(this.latestLocation.href)===j(n.href),a=this.commitLocationPromise;if(this.commitLocationPromise=o(()=>{a?.resolve(),a=void 0}),i&&r())this.load();else{let{maskedLocation:r,hashScrollIntoView:i,...a}=n;r&&(a={...r,state:{...r.state,__tempKey:void 0,__tempLocation:{...a,search:a.searchStr,state:{...a.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(a.unmaskOnReload??this.options.unmaskOnReload??!1)&&(a.state.__tempKey=this.tempLocationKey)),a.state.__hashScrollIntoViewOptions=i??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,this.history[n.replace?`replace`:`push`](a.publicHref,a.state,{ignoreBlocker:t})}return this.resetNextScroll=n.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,href:a,...o}={})=>{if(a){let t=this.history.location.state.__TSR_index,n=q(a,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);o.to=I(this.rewrite,r).pathname,o.search=this.options.parseSearch(n.search),o.hash=n.hash.slice(1)}let s=this.buildLocation({...o,_includeValidateSearch:!0});this.pendingBuiltLocation=s;let c=this.commitLocation({...s,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===s&&(this.pendingBuiltLocation=void 0)}),c},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(p(t,this.protocolAllowlist))return Promise.resolve();if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return Promise.resolve()}return i.replace?window.location.replace(t):window.location.href=t,Promise.resolve()}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();let e=this.matchRoutes(this.latestLocation),t=this.stores.cachedMatchesSnapshot.state.filter(t=>!e.some(e=>e.id===t.id));this.batch(()=>{this.stores.status.setState(()=>`pending`),this.stores.statusCode.setState(()=>200),this.stores.isLoading.setState(()=>!0),this.stores.location.setState(()=>this.latestLocation),this.stores.setPendingMatches(e),this.stores.setCachedMatches(t)})},this.load=async e=>{let t,n,r,i=this.stores.resolvedLocation.state??this.stores.location.state;for(r=new Promise(a=>{this.startTransition(async()=>{try{this.beforeLoad();let t=this.latestLocation,n=this.stores.resolvedLocation.state,r=J(t,n);this.stores.redirect.state||this.emit({type:`onBeforeNavigate`,...r}),this.emit({type:`onBeforeLoad`,...r}),await Le({router:this,sync:e?.sync,forceStaleReload:i.href===t.href,matches:this.stores.pendingMatchesSnapshot.state,location:t,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let e=null,t=null,n=null,r=null;this.batch(()=>{let i=this.stores.pendingMatchesSnapshot.state,a=i.length,o=this.stores.activeMatchesSnapshot.state;e=a?o.filter(e=>!this.stores.pendingMatchStoresById.has(e.id)):null;let s=new Set;for(let e of this.stores.pendingMatchStoresById.values())e.routeId&&s.add(e.routeId);let c=new Set;for(let e of this.stores.activeMatchStoresById.values())e.routeId&&c.add(e.routeId);t=a?o.filter(e=>!s.has(e.routeId)):null,n=a?i.filter(e=>!c.has(e.routeId)):null,r=a?i.filter(e=>c.has(e.routeId)):o,this.stores.isLoading.setState(()=>!1),this.stores.loadedAt.setState(()=>Date.now()),a&&(this.stores.setActiveMatches(i),this.stores.setPendingMatches([]),this.stores.setCachedMatches([...this.stores.cachedMatchesSnapshot.state,...e.filter(e=>e.status!==`error`&&e.status!==`notFound`&&e.status!==`redirected`)]),this.clearExpiredCache())});for(let[e,i]of[[t,`onLeave`],[n,`onEnter`],[r,`onStay`]])if(e)for(let t of e)this.looseRoutesById[t.routeId].options[i]?.(t)})})}})}catch(e){N(e)?(t=e,this.navigate({...t.options,replace:!0,ignoreBlocker:!0})):M(e)&&(n=e);
1let r=t?t.status:n?404:this.stores.activeMatchesSnapshot.state.some(e=>e.status===`error`)?500:200;this.batch(()=>{this.stores.statusCode.setState(()=>r),this.stores.redirect.setState(()=>t)})}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 a;this.hasNotFoundMatch()?a=404:this.stores.activeMatchesSnapshot.state.some(e=>e.status===`error`)&&(a=500),a!==void 0&&this.stores.statusCode.setState(()=>a)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document<`u`&&`startViewTransition`in document&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&this.isViewTransitionTypesSupported){let r=this.latestLocation,i=this.stores.resolvedLocation.state,a=typeof t.types==`function`?t.types(J(r,i)):t.types;if(a===!1){e();return}n={update:e,types:a}}else n=e;document.startViewTransition(n)}else e()},this.updateMatch=(e,t)=>{this.startTransition(()=>{let n=this.stores.pendingMatchStoresById.get(e);if(n){n.setState(t);return}let r=this.stores.activeMatchStoresById.get(e);if(r){r.setState(t);return}let i=this.stores.cachedMatchStoresById.get(e);if(i){let n=t(i.state);n.status===`redirected`?this.stores.cachedMatchStoresById.delete(e)&&this.stores.cachedMatchesId.setState(t=>t.filter(t=>t!==e)):i.setState(()=>n)}})},this.getMatch=e=>this.stores.cachedMatchStoresById.get(e)?.state??this.stores.pendingMatchStoresById.get(e)?.state??this.stores.activeMatchStoresById.get(e)?.state,this.invalidate=e=>{let t=t=>e?.filter?.(t)??!0?{...t,invalid:!0,...e?.forcePending||t.status===`error`||t.status===`notFound`?{status:`pending`,error:void 0}:void 0}:t;return this.batch(()=>{this.stores.setActiveMatches(this.stores.activeMatchesSnapshot.state.map(t)),this.stores.setCachedMatches(this.stores.cachedMatchesSnapshot.state.map(t)),this.stores.setPendingMatches(this.stores.pendingMatchesSnapshot.state.map(t))}),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.getParsedLocationHref=e=>e.publicHref||`/`,this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href||e.options._builtLocation){let t=e.options._builtLocation??this.buildLocation(e.options),n=this.getParsedLocationHref(t);e.options.href=n,e.headers.set(`Location`,n)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&!e.options._builtLocation&&p(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=e?.filter;t===void 0?this.stores.setCachedMatches([]):this.stores.setCachedMatches(this.stores.cachedMatchesSnapshot.state.filter(e=>!t(e)))},this.clearExpiredCache=()=>{let e=Date.now();this.clearCache({filter:t=>{let n=this.looseRoutesById[t.routeId];if(!n.options.loader)return!0;let r=(t.preload?n.options.preloadGcTime??this.options.defaultPreloadGcTime:n.options.gcTime??this.options.defaultGcTime)??300*1e3;return t.status===`error`?!0:e-t.updatedAt>=r}})},this.loadRouteChunk=W,this.preloadRoute=async e=>{let t=e._builtLocation??this.buildLocation(e),n=this.matchRoutes(t,{throwOnError:!0,preload:!0,dest:e}),r=new Set([...this.stores.matchesId.state,...this.stores.pendingMatchesId.state]),i=new Set([...r,...this.stores.cachedMatchesId.state]),a=n.filter(e=>!i.has(e.id));if(a.length){let e=this.stores.cachedMatchesSnapshot.state;this.stores.setCachedMatches([...e,...a])}try{return n=await Le({router:this,matches:n,location:t,preload:!0,updateMatch:(e,t)=>{r.has(e)?n=n.map(n=>n.id===e?t(n):n):this.updateMatch(e,t)}}),n}catch(e){if(N(e))return e.options.reloadDocument?void 0:await this.preloadRoute({...e.options,_fromLocation:t});M(e)||console.error(e);return}},this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{}
1,leaveParams:!0},r=this.buildLocation(n);if(t?.pending&&this.stores.status.state!==`pending`)return!1;let i=(t?.pending===void 0?!this.stores.isLoading.state:t.pending)?this.latestLocation:this.stores.resolvedLocation.state||this.stores.location.state,a=k(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,i.pathname,this.processedTree);return!a||e.params&&!_(a.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?_(i.search,r.search,{partial:!0})?a.rawParams:!1:a.rawParams},this.hasNotFoundMatch=()=>this.stores.activeMatchesSnapshot.state.some(e=>e.status===`notFound`||e.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??ge,parseSearch:e.parseSearch??he,protocolAllowlist:e.protocolAllowlist??f}),typeof document<`u`&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.state}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){let n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i,parsedParams:a}=n,{matchedRoutes:s}=n,c=!1;(r?r.path!==`/`&&i[`**`]:j(e.pathname))&&(this.options.notFoundRoute?s=[...s,this.options.notFoundRoute]:c=!0);let l=c?$e(this.options.notFoundMode,s):void 0,u=Array(s.length),d=new Map;for(let e of this.stores.activeMatchStoresById.values())e.routeId&&d.set(e.routeId,e.state);for(let n=0;n<s.length;n++){let r=s[n],c=u[n-1],f,p,m;{let n=c?.search??e.search,i=c?._strictSearch??void 0;try{let e=X(r.options.validateSearch,{...n})??void 0;f={...n,...e},p={...i,...e},m=void 0}catch(e){let r=e;if(e instanceof Y||(r=new Y(e.message,{cause:e})),t?.throwOnError)throw r;f=n,p={},m=r}}let h=r.options.loaderDeps?.({search:f})??``,g=h?JSON.stringify(h):``,{interpolatedPath:_,usedParams:x}=b({path:r.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),S=r.id+_+g,C=this.getMatch(S),w=d.get(r.id),T=C?._strictParams??x,E;if(!C)try{et(r,x,a,T)}catch(e){if(E=M(e)||N(e)?e:new Je(e.message,{cause:e}),t?.throwOnError)throw E}Object.assign(i,T);let D=w?`stay`:`enter`,O;if(C)O={...C,cause:D,params:w?.params??i,_strictParams:T,search:v(w?w.search:C.search,f),_strictSearch:p};else{let e=r.options.loader||r.options.beforeLoad||r.lazyFn||ze(r)?`pending`:`success`;O={id:S,ssr:r.options.ssr,index:n,routeId:r.id,params:w?.params??i,_strictParams:T,pathname:_,updatedAt:Date.now(),search:w?v(w.search,f):f,_strictSearch:p,searchError:void 0,status:e,isFetching:!1,error:void 0,paramsError:E,__routeContext:void 0,_nonReactive:{loadPromise:o()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:D,loaderDeps:w?y(w.loaderDeps,h):h,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:r.options.staticData||{},fullPath:r.fullPath}}t?.preload||(O.globalNotFound=l===r.id),O.searchError=m;let ee=this.getParentContext(c);O.context={...ee,...O.__routeContext,...O.__beforeLoadContext},u[n]=O}for(let t=0;t<u.length;t++){let n=u[t],r=this.looseRoutesById[n.routeId],a=this.getMatch(n.id),o=d.get(n.routeId);if(n.params=o?v(o.params,i):i,!a){let i=u[t-1],a=this.getParentContext(i);if(r.options.context){let t={deps:n.loaderDeps,params:n.params,context:a??{},location:e,navigate:t=>this.navigate({...t,_fromLocation:e}),buildLocation:this.buildLocation,cause:n.cause,abortController:n.abortController,preload:!!n.preload,matches:u,routeId:r.id};n.__routeContext=r.options.context(t)??void 0}n.context={...a,...n.__routeContext,...n.__beforeLoadContext}}}return u}matchRoutesLightweight(e){let{matchedRoutes:t,routeParams:n,parsedParams:r}=this.getMatchedRoutes(e.pathname),a=i(t),o={...e.search};for(let e of t)try{Object.assign(o,X(e.options.validateSearch,o))}catch{}let s=i(this.stores.matchesId.state),c=s&&this.stores.activeMatchStoresById.get(s)?.state,l=c&&c.routeId===a.id&&c.pathname===e.pathname,u;if(l)u=c.params;else{let e=Object.assign(Object.create(null),n);for(let i of t)try{et(i,n,r??{},e)}catch{}u=e}return{matchedRoutes:t,fullPath:a.fullPath,search:o,params:u}}}
1,Y=class extends Error{},Je=class extends Error{};function Ye(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:`idle`,resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function X(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new Y(`Async validation not supported`);if(n.issues)throw new Y(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function Xe({pathname:e,routesById:t,processedTree:n}){let r=Object.create(null),i=j(e),a,o,s=C(i,n,!0);return s&&(a=s.route,Object.assign(r,s.rawParams),o=Object.assign(Object.create(null),s.parsedParams)),{matchedRoutes:s?.branch||[t.__root__],routeParams:r,foundRoute:a,parsedParams:o}}function Ze({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return Qe(n)(e,t,r??!1)}function Qe(e){let t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(let n of e)`search`in n.options?n.options.search?.middlewares&&t.middlewares.push(...n.options.search.middlewares):(n.options.preSearchFilters||n.options.postSearchFilters)&&t.middlewares.push(({search:e,next:t})=>{let r=e;`preSearchFilters`in n.options&&n.options.preSearchFilters&&(r=n.options.preSearchFilters.reduce((e,t)=>t(e),e));let i=t(r);return`postSearchFilters`in n.options&&n.options.postSearchFilters?n.options.postSearchFilters.reduce((e,t)=>t(e),i):i}),n.options.validateSearch&&t.middlewares.push(({search:e,next:r})=>{let i=r(e);if(!t._includeValidateSearch)return i;try{return{...i,...X(n.options.validateSearch,i)??void 0}}catch{return i}});t.middlewares.push(({search:e})=>{let n=t.dest;return n.search?n.search===!0?e:c(n.search,e):{}});let n=(e,t,r)=>{if(e>=r.length)return t;let i=r[e];return i({search:t,next:t=>n(e+1,t,r)})};return function(e,r,i){return t.dest=r,t._includeValidateSearch=i,n(0,e,t.middlewares)}}function $e(e,t){if(e!==`root`)for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.children)return n.id}return ne}function et(e,t,n,r){let i=e.options.params?.parse??e.options.parseParams;if(i)if(e.options.skipRouteOnParseError)for(let e in t)e in n&&(r[e]=n[e]);else{let e=i(r);Object.assign(r,e)}}var Z=t(n(),1),Q=e();function tt(e){let t=e.errorComponent??rt;return(0,Q.jsx)(nt,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?Z.createElement(t,{error:n,reset:r}):e.children})}var nt=class extends Z.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e){return{resetKey:e.getResetKey()}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidUpdate(e,t){t.error&&t.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.resetKey===this.props.getResetKey()?this.state.error:null,reset:()=>{this.reset()}})}};function rt({error:e}){let[t,n]=Z.useState(!1);return(0,Q.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,Q.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,Q.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,Q.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,Q.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,Q.jsx)(`div`,{children:(0,Q.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,Q.jsx)(`code`,{children:e.message}):null})}):null]})}function it(e){let t=m(),n=`not-found-${g(t.stores.location,e=>e.pathname)}-${g(t.stores.status,e=>e)}`;return(0,Q.jsx)(tt,{getResetKey:()=>n,onCatch:(t,n)=>{if(M(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(M(t))return e.fallback?.(t);throw t},children:e.children})}function at(){return(0,Q.jsx)(`p`,{children:`Not Found`})}function $(e){return(0,Q.jsx)(Q.Fragment,{children:e.children})}function ot(e,t,n){return t.options.notFoundComponent?(0,Q.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,Q.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,Q.jsx)(at,{})}
1var st=Z.memo(function({matchId:e}){let t=m(),n=t.stores.activeMatchStoresById.get(e);n||a();let r=g(t.stores.loadedAt,e=>e),i=g(n,e=>e);return(0,Q.jsx)(ct,{router:t,matchId:e,resetKey:r,matchState:Z.useMemo(()=>{let e=i.routeId,n=t.routesById[e].parentRoute?.id;return{routeId:e,ssr:i.ssr,_displayPending:i._displayPending,parentRouteId:n}},[i._displayPending,i.routeId,i.ssr,t.routesById])})});function ct({router:e,matchId:t,resetKey:n,matchState:r}){let i=e.routesById[r.routeId],a=i.options.pendingComponent??e.options.defaultPendingComponent,o=a?(0,Q.jsx)(a,{}):null,s=i.options.errorComponent??e.options.defaultErrorComponent,c=i.options.onCatch??e.options.defaultOnCatch,l=i.isRoot?i.options.notFoundComponent??e.options.notFoundRoute?.options.component:i.options.notFoundComponent,u=r.ssr===!1||r.ssr===`data-only`,d=(!i.isRoot||i.options.wrapInSuspense||u)&&(i.options.wrapInSuspense??a??(i.options.errorComponent?.preload||u))?Z.Suspense:$,f=s?tt:$,p=l?it:$;return(0,Q.jsxs)(i.isRoot?i.options.shellComponent??$:$,{children:[(0,Q.jsx)(re.Provider,{value:t,children:(0,Q.jsx)(d,{fallback:o,children:(0,Q.jsx)(f,{getResetKey:()=>n,errorComponent:s||rt,onCatch:(e,t)=>{if(M(e))throw e.routeId??=r.routeId,e;c?.(e,t)},children:(0,Q.jsx)(p,{fallback:e=>{if(e.routeId??=r.routeId,!l||e.routeId&&e.routeId!==r.routeId||!e.routeId&&!i.isRoot)throw e;return Z.createElement(l,e)},children:u||r._displayPending?(0,Q.jsx)(O,{fallback:o,children:(0,Q.jsx)(ut,{matchId:t})}):(0,Q.jsx)(ut,{matchId:t})})})})}),r.parentRouteId===`__root__`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(lt,{resetKey:n}),(e.options.scrollRestoration,null)]}):null]})}function lt({resetKey:e}){let t=m(),n=Z.useRef(void 0);return r(()=>{let e=t.latestLocation.href;(n.current===void 0||n.current!==e)&&(t.emit({type:`onRendered`,...J(t.stores.location.state,t.stores.resolvedLocation.state)}),n.current=e)},[t.latestLocation.state.__TSR_key,e,t]),null}var ut=Z.memo(function({matchId:e}){let t=m(),n=t.stores.activeMatchStoresById.get(e);n||a();let r=g(n,e=>e),i=r.routeId,s=t.routesById[i],c=Z.useMemo(()=>{let e=(t.routesById[i].options.remountDeps??t.options.defaultRemountDeps)?.({routeId:i,loaderDeps:r.loaderDeps,params:r._strictParams,search:r._strictSearch});return e?JSON.stringify(e):void 0},[i,r.loaderDeps,r._strictParams,r._strictSearch,t.options.defaultRemountDeps,t.routesById]),l=Z.useMemo(()=>{let e=s.options.component??t.options.defaultComponent;return e?(0,Q.jsx)(e,{},c):(0,Q.jsx)(dt,{})},[c,s.options.component,t.options.defaultComponent]);if(r._displayPending)throw t.getMatch(r.id)?._nonReactive.displayPendingPromise;if(r._forcePending)throw t.getMatch(r.id)?._nonReactive.minPendingPromise;if(r.status===`pending`){let e=s.options.pendingMinMs??t.options.defaultPendingMinMs;if(e){let n=t.getMatch(r.id);if(n&&!n._nonReactive.minPendingPromise){let t=o();n._nonReactive.minPendingPromise=t,setTimeout(()=>{t.resolve(),n._nonReactive.minPendingPromise=void 0},e)}}throw t.getMatch(r.id)?._nonReactive.loadPromise}if(r.status===`notFound`)return M(r.error)||a(),ot(t,s,r.error);if(r.status===`redirected`)throw N(r.error)||a(),t.getMatch(r.id)?._nonReactive.loadPromise;if(r.status===`error`)throw r.error;return l}),dt=Z.memo(function(){let e=m(),t=Z.useContext(re),n,r=!1,i;{let a=t?e.stores.activeMatchStoresById.get(t):void 0;[n,r]=g(a,e=>[e?.routeId,e?.globalNotFound??!1]),i=g(e.stores.matchesId,e=>e[e.findIndex(e=>e===t)+1])}let o=n?e.routesById[n]:void 0,s=e.options.defaultPendingComponent?(0,Q.jsx)(e.options.defaultPendingComponent,{}):null;if(r)return o||a(),ot(e,o,void 0);if(!i)return null;let c=(0,Q.jsx)(st,{matchId:i});return n===`__root__`?(0,Q.jsx)(Z.Suspense,{fallback:s,children:c}):c});export{rt as a,Se as c,tt as i,Ce as l,dt as n,qe as o,$ as r,J as s,st as t};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.