Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

@tanstack/router

Package Overview
Dependencies
Maintainers
2
Versions
104
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tanstack/router - npm Package Compare versions

Comparing version 0.0.1-beta.144 to 0.0.1-beta.145

99

build/cjs/index.js

@@ -13,98 +13,5 @@ /**

Object.defineProperty(exports, '__esModule', { value: true });
var invariant = require('tiny-invariant');
var warning = require('tiny-warning');
var history = require('./history.js');
var path = require('./path.js');
var qss = require('./qss.js');
var route = require('./route.js');
var router = require('./router.js');
var searchParams = require('./searchParams.js');
var utils = require('./utils.js');
var react = require('./react.js');
var reactStore = require('@tanstack/react-store');
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
var invariant__default = /*#__PURE__*/_interopDefaultLegacy(invariant);
var warning__default = /*#__PURE__*/_interopDefaultLegacy(warning);
Object.defineProperty(exports, 'invariant', {
enumerable: true,
get: function () { return invariant__default["default"]; }
});
Object.defineProperty(exports, 'warning', {
enumerable: true,
get: function () { return warning__default["default"]; }
});
exports.createBrowserHistory = history.createBrowserHistory;
exports.createHashHistory = history.createHashHistory;
exports.createMemoryHistory = history.createMemoryHistory;
exports.cleanPath = path.cleanPath;
exports.interpolatePath = path.interpolatePath;
exports.joinPaths = path.joinPaths;
exports.matchByPath = path.matchByPath;
exports.matchPathname = path.matchPathname;
exports.parsePathname = path.parsePathname;
exports.resolvePath = path.resolvePath;
exports.trimPath = path.trimPath;
exports.trimPathLeft = path.trimPathLeft;
exports.trimPathRight = path.trimPathRight;
exports.decode = qss.decode;
exports.encode = qss.encode;
exports.RootRoute = route.RootRoute;
exports.Route = route.Route;
exports.RouterContext = route.RouterContext;
exports.rootRouteId = route.rootRouteId;
exports.PathParamError = router.PathParamError;
exports.Router = router.Router;
exports.SearchParamError = router.SearchParamError;
exports.componentTypes = router.componentTypes;
exports.isRedirect = router.isRedirect;
exports.lazyFn = router.lazyFn;
exports.redirect = router.redirect;
exports.defaultParseSearch = searchParams.defaultParseSearch;
exports.defaultStringifySearch = searchParams.defaultStringifySearch;
exports.parseSearchWith = searchParams.parseSearchWith;
exports.stringifySearchWith = searchParams.stringifySearchWith;
exports.functionalUpdate = utils.functionalUpdate;
exports.isPlainObject = utils.isPlainObject;
exports.last = utils.last;
exports.partialDeepEqual = utils.partialDeepEqual;
exports.pick = utils.pick;
exports.replaceEqualDeep = utils.replaceEqualDeep;
exports.Block = react.Block;
exports.ErrorComponent = react.ErrorComponent;
exports.Link = react.Link;
exports.MatchRoute = react.MatchRoute;
exports.Navigate = react.Navigate;
exports.Outlet = react.Outlet;
exports.RouterProvider = react.RouterProvider;
exports.lazyRouteComponent = react.lazyRouteComponent;
exports.matchIdsContext = react.matchIdsContext;
exports.routerContext = react.routerContext;
exports.shallow = react.shallow;
exports.useBlocker = react.useBlocker;
exports.useDehydrate = react.useDehydrate;
exports.useHydrate = react.useHydrate;
exports.useInjectHtml = react.useInjectHtml;
exports.useLinkProps = react.useLinkProps;
exports.useLoader = react.useLoader;
exports.useMatch = react.useMatch;
exports.useMatchRoute = react.useMatchRoute;
exports.useMatches = react.useMatches;
exports.useNavigate = react.useNavigate;
exports.useParams = react.useParams;
exports.useRouteContext = react.useRouteContext;
exports.useRouter = react.useRouter;
exports.useRouterContext = react.useRouterContext;
exports.useRouterState = react.useRouterState;
exports.useSearch = react.useSearch;
Object.defineProperty(exports, 'useStore', {
enumerable: true,
get: function () { return reactStore.useStore; }
});
(() => {
console.error('@tanstack/router is not intended to be used directly. Please use @tanstack/[framework]-router packages or @tanstack/router-core instead.');
})();
//# sourceMappingURL=index.js.map

@@ -10,71 +10,4 @@ {

{
"name": "node_modules/.pnpm",
"children": [
{
"name": "tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js",
"uid": "f922-47"
},
{
"name": "tiny-warning@1.0.3/node_modules/tiny-warning/dist/tiny-warning.esm.js",
"uid": "f922-49"
}
]
},
{
"name": "packages",
"children": [
{
"name": "router/src",
"children": [
{
"uid": "f922-51",
"name": "history.ts"
},
{
"uid": "f922-53",
"name": "utils.ts"
},
{
"uid": "f922-55",
"name": "path.ts"
},
{
"uid": "f922-57",
"name": "qss.ts"
},
{
"uid": "f922-65",
"name": "react.tsx"
},
{
"uid": "f922-67",
"name": "route.ts"
},
{
"uid": "f922-69",
"name": "searchParams.ts"
},
{
"uid": "f922-71",
"name": "router.ts"
},
{
"uid": "f922-73",
"name": "index.ts"
}
]
},
{
"name": "store/build/esm/index.js",
"uid": "f922-61"
},
{
"name": "react-store/build/esm/index.js",
"uid": "f922-63"
}
]
},
{
"uid": "f922-59",
"name": "\u0000rollupPluginBabelHelpers.js"
"name": "packages/router/src/index.ts",
"uid": "1efb-145"
}

@@ -87,436 +20,18 @@ ]

"nodeParts": {
"f922-47": {
"renderedLength": 199,
"gzipLength": 134,
"1efb-145": {
"renderedLength": 177,
"gzipLength": 148,
"brotliLength": 0,
"mainUid": "f922-46"
},
"f922-49": {
"renderedLength": 48,
"gzipLength": 65,
"brotliLength": 0,
"mainUid": "f922-48"
},
"f922-51": {
"renderedLength": 6426,
"gzipLength": 1539,
"brotliLength": 0,
"mainUid": "f922-50"
},
"f922-53": {
"renderedLength": 2821,
"gzipLength": 990,
"brotliLength": 0,
"mainUid": "f922-52"
},
"f922-55": {
"renderedLength": 6028,
"gzipLength": 1423,
"brotliLength": 0,
"mainUid": "f922-54"
},
"f922-57": {
"renderedLength": 1371,
"gzipLength": 552,
"brotliLength": 0,
"mainUid": "f922-56"
},
"f922-59": {
"renderedLength": 457,
"gzipLength": 241,
"brotliLength": 0,
"mainUid": "f922-58"
},
"f922-61": {
"renderedLength": 1969,
"gzipLength": 653,
"brotliLength": 0,
"mainUid": "f922-60"
},
"f922-63": {
"renderedLength": 1070,
"gzipLength": 485,
"brotliLength": 0,
"mainUid": "f922-62"
},
"f922-65": {
"renderedLength": 17156,
"gzipLength": 3732,
"brotliLength": 0,
"mainUid": "f922-64"
},
"f922-67": {
"renderedLength": 3937,
"gzipLength": 969,
"brotliLength": 0,
"mainUid": "f922-66"
},
"f922-69": {
"renderedLength": 1387,
"gzipLength": 483,
"brotliLength": 0,
"mainUid": "f922-68"
},
"f922-71": {
"renderedLength": 38274,
"gzipLength": 8514,
"brotliLength": 0,
"mainUid": "f922-70"
},
"f922-73": {
"renderedLength": 0,
"gzipLength": 0,
"brotliLength": 0,
"mainUid": "f922-72"
"mainUid": "1efb-144"
}
},
"nodeMetas": {
"f922-46": {
"id": "/node_modules/.pnpm/tiny-invariant@1.3.1/node_modules/tiny-invariant/dist/esm/tiny-invariant.js",
"1efb-144": {
"id": "/packages/router/src/index.ts",
"moduleParts": {
"index.production.js": "f922-47"
"index.production.js": "1efb-145"
},
"imported": [],
"importedBy": [
{
"uid": "f922-72"
},
{
"uid": "f922-66"
},
{
"uid": "f922-70"
},
{
"uid": "f922-64"
}
]
},
"f922-48": {
"id": "/node_modules/.pnpm/tiny-warning@1.0.3/node_modules/tiny-warning/dist/tiny-warning.esm.js",
"moduleParts": {
"index.production.js": "f922-49"
},
"imported": [],
"importedBy": [
{
"uid": "f922-72"
},
{
"uid": "f922-64"
}
]
},
"f922-50": {
"id": "/packages/router/src/history.ts",
"moduleParts": {
"index.production.js": "f922-51"
},
"imported": [],
"importedBy": [
{
"uid": "f922-72"
},
{
"uid": "f922-70"
}
]
},
"f922-52": {
"id": "/packages/router/src/utils.ts",
"moduleParts": {
"index.production.js": "f922-53"
},
"imported": [],
"importedBy": [
{
"uid": "f922-72"
},
{
"uid": "f922-54"
},
{
"uid": "f922-70"
},
{
"uid": "f922-64"
}
]
},
"f922-54": {
"id": "/packages/router/src/path.ts",
"moduleParts": {
"index.production.js": "f922-55"
},
"imported": [
{
"uid": "f922-52"
}
],
"importedBy": [
{
"uid": "f922-72"
},
{
"uid": "f922-66"
},
{
"uid": "f922-70"
}
]
},
"f922-56": {
"id": "/packages/router/src/qss.ts",
"moduleParts": {
"index.production.js": "f922-57"
},
"imported": [],
"importedBy": [
{
"uid": "f922-72"
},
{
"uid": "f922-68"
}
]
},
"f922-58": {
"id": "\u0000rollupPluginBabelHelpers.js",
"moduleParts": {
"index.production.js": "f922-59"
},
"imported": [],
"importedBy": [
{
"uid": "f922-64"
}
]
},
"f922-60": {
"id": "/packages/store/build/esm/index.js",
"moduleParts": {
"index.production.js": "f922-61"
},
"imported": [],
"importedBy": [
{
"uid": "f922-62"
}
]
},
"f922-62": {
"id": "/packages/react-store/build/esm/index.js",
"moduleParts": {
"index.production.js": "f922-63"
},
"imported": [
{
"uid": "f922-77"
},
{
"uid": "f922-60"
}
],
"importedBy": [
{
"uid": "f922-70"
},
{
"uid": "f922-64"
}
]
},
"f922-64": {
"id": "/packages/router/src/react.tsx",
"moduleParts": {
"index.production.js": "f922-65"
},
"imported": [
{
"uid": "f922-58"
},
{
"uid": "f922-76"
},
{
"uid": "f922-62"
},
{
"uid": "f922-46"
},
{
"uid": "f922-48"
},
{
"uid": "f922-52"
}
],
"importedBy": [
{
"uid": "f922-72"
},
{
"uid": "f922-66"
}
]
},
"f922-66": {
"id": "/packages/router/src/route.ts",
"moduleParts": {
"index.production.js": "f922-67"
},
"imported": [
{
"uid": "f922-46"
},
{
"uid": "f922-54"
},
{
"uid": "f922-64"
}
],
"importedBy": [
{
"uid": "f922-72"
}
]
},
"f922-68": {
"id": "/packages/router/src/searchParams.ts",
"moduleParts": {
"index.production.js": "f922-69"
},
"imported": [
{
"uid": "f922-56"
}
],
"importedBy": [
{
"uid": "f922-72"
},
{
"uid": "f922-70"
}
]
},
"f922-70": {
"id": "/packages/router/src/router.ts",
"moduleParts": {
"index.production.js": "f922-71"
},
"imported": [
{
"uid": "f922-62"
},
{
"uid": "f922-46"
},
{
"uid": "f922-54"
},
{
"uid": "f922-68"
},
{
"uid": "f922-52"
},
{
"uid": "f922-50"
}
],
"importedBy": [
{
"uid": "f922-72"
}
]
},
"f922-72": {
"id": "/packages/router/src/index.ts",
"moduleParts": {
"index.production.js": "f922-73"
},
"imported": [
{
"uid": "f922-46"
},
{
"uid": "f922-48"
},
{
"uid": "f922-50"
},
{
"uid": "f922-74"
},
{
"uid": "f922-54"
},
{
"uid": "f922-56"
},
{
"uid": "f922-66"
},
{
"uid": "f922-75"
},
{
"uid": "f922-70"
},
{
"uid": "f922-68"
},
{
"uid": "f922-52"
},
{
"uid": "f922-64"
}
],
"importedBy": [],
"isEntry": true
},
"f922-74": {
"id": "/packages/router/src/link.ts",
"moduleParts": {},
"imported": [],
"importedBy": [
{
"uid": "f922-72"
}
]
},
"f922-75": {
"id": "/packages/router/src/routeInfo.ts",
"moduleParts": {},
"imported": [],
"importedBy": [
{
"uid": "f922-72"
}
]
},
"f922-76": {
"id": "react",
"moduleParts": {},
"imported": [],
"importedBy": [
{
"uid": "f922-64"
}
],
"isExternal": true
},
"f922-77": {
"id": "use-sync-external-store/shim/with-selector",
"moduleParts": {},
"imported": [],
"importedBy": [
{
"uid": "f922-62"
}
],
"isExternal": true
}

@@ -523,0 +38,0 @@ },

22

build/types/index.d.ts

@@ -1,12 +0,10 @@

export { default as invariant } from 'tiny-invariant';
export { default as warning } from 'tiny-warning';
export * from './history';
export * from './link';
export * from './path';
export * from './qss';
export * from './route';
export * from './routeInfo';
export * from './router';
export * from './searchParams';
export * from './utils';
export * from './react';
/**
* @tanstack/router/src/index.ts
*
* Copyright (c) TanStack
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/

@@ -11,23 +11,3 @@ /**

*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("use-sync-external-store/shim/with-selector")):"function"==typeof define&&define.amd?define(["exports","react","use-sync-external-store/shim/with-selector"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).RouterCore={},t.React,t.withSelector)}(this,(function(t,e,r){"use strict";function s(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(r){if("default"!==r){var s=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,s.get?s:{enumerable:!0,get:function(){return t[r]}})}})),e.default=t,Object.freeze(e)}var o=s(e);function n(t,e){if(!t)throw new Error("Invariant failed")}const a="pushstate",i="popstate",c="beforeunload",h=t=>(t.preventDefault(),t.returnValue=""),u=()=>{removeEventListener(c,h,{capture:!0})};function l(t){let e=t.getLocation(),r=()=>{},s=new Set,o=[],n=[];const a=()=>{if(o.length)o[0]?.(a,(()=>{o=[],u()}));else{for(;n.length;)n.shift()?.();t.listener||l()}},i=t=>{n.push(t),a()},l=()=>{e=t.getLocation(),s.forEach((t=>t()))};return{get location(){return e},listen:e=>(0===s.size&&(r="function"==typeof t.listener?t.listener(l):()=>{}),s.add(e),()=>{s.delete(e),0===s.size&&r()}),push:(e,r)=>{i((()=>{t.pushState(e,r)}))},replace:(e,r)=>{i((()=>{t.replaceState(e,r)}))},go:e=>{i((()=>{t.go(e)}))},back:()=>{i((()=>{t.back()}))},forward:()=>{i((()=>{t.forward()}))},createHref:e=>t.createHref(e),block:t=>(o.push(t),1===o.length&&addEventListener(c,h,{capture:!0}),()=>{o=o.filter((e=>e!==t)),o.length||u()})}}function d(t){const e=t?.getHref??(()=>`${window.location.pathname}${window.location.search}${window.location.hash}`),r=t?.createHref??(t=>t);return l({getLocation:()=>f(e(),history.state),listener:t=>{window.addEventListener(a,t),window.addEventListener(i,t);var e=window.history.pushState;window.history.pushState=function(){let r=e.apply(history,arguments);return t(),r};var r=window.history.replaceState;return window.history.replaceState=function(){let e=r.apply(history,arguments);return t(),e},()=>{window.history.pushState=e,window.history.replaceState=r,window.removeEventListener(a,t),window.removeEventListener(i,t)}},pushState:(t,e)=>{window.history.pushState({...e,key:m()},"",r(t))},replaceState:(t,e)=>{window.history.replaceState({...e,key:m()},"",r(t))},back:()=>window.history.back(),forward:()=>window.history.forward(),go:t=>window.history.go(t),createHref:t=>r(t)})}function p(t={initialEntries:["/"]}){const e=t.initialEntries;let r=t.initialIndex??e.length-1,s={};return l({getLocation:()=>f(e[r],s),listener:!1,pushState:(t,o)=>{s={...o,key:m()},e.push(t),r++},replaceState:(t,o)=>{s={...o,key:m()},e[r]=t},back:()=>{r--},forward:()=>{r=Math.min(r+1,e.length-1)},go:t=>window.history.go(t),createHref:t=>t})}function f(t,e){let r=t.indexOf("#"),s=t.indexOf("?");return{href:t,pathname:t.substring(0,r>0?s>0?Math.min(r,s):r:s>0?s:t.length),hash:r>-1?t.substring(r):"",search:s>-1?t.slice(s,-1===r?void 0:r):"",state:e}}function m(){return(Math.random()+1).toString(36).substring(7)}function y(t){return t[t.length-1]}function g(t,e){return"function"==typeof t?t(e):t}function v(t,e){return e.reduce(((e,r)=>(e[r]=t[r],e)),{})}function w(t,e){if(t===e)return t;const r=e,s=Array.isArray(t)&&Array.isArray(r);if(s||b(t)&&b(r)){const e=s?t.length:Object.keys(t).length,o=s?r:Object.keys(r),n=o.length,a=s?[]:{};let i=0;for(let e=0;e<n;e++){const n=s?e:o[e];a[n]=w(t[n],r[n]),a[n]===t[n]&&i++}return e===n&&i===e?t:a}return r}function b(t){if(!S(t))return!1;const e=t.constructor;if(void 0===e)return!0;const r=e.prototype;return!!S(r)&&!!r.hasOwnProperty("isPrototypeOf")}function S(t){return"[object Object]"===Object.prototype.toString.call(t)}function x(t,e){return t===e||typeof t==typeof e&&(b(t)&&b(e)?!Object.keys(e).some((r=>!x(t[r],e[r]))):!(!Array.isArray(t)||!Array.isArray(e))&&(t.length===e.length&&t.every(((t,r)=>x(t,e[r])))))}function E(t){return R(t.filter(Boolean).join("/"))}function R(t){return t.replace(/\/{2,}/g,"/")}function I(t){return"/"===t?t:t.replace(/^\/{1,}/,"")}function P(t){return"/"===t?t:t.replace(/\/{1,}$/,"")}function _(t){return P(I(t))}function C(t,e,r){e=e.replace(new RegExp(`^${t}`),"/"),r=r.replace(new RegExp(`^${t}`),"/");let s=M(e);const o=M(r);o.forEach(((t,e)=>{if("/"===t.value)e?e===o.length-1&&s.push(t):s=[t];else if(".."===t.value)s.length>1&&"/"===y(s)?.value&&s.pop(),s.pop();else{if("."===t.value)return;s.push(t)}}));return R(E([t,...s.map((t=>t.value))]))}function M(t){if(!t)return[];const e=[];if("/"===(t=R(t)).slice(0,1)&&(t=t.substring(1),e.push({type:"pathname",value:"/"})),!t)return e;const r=t.split("/").filter(Boolean);return e.push(...r.map((t=>"$"===t||"*"===t?{type:"wildcard",value:t}:"$"===t.charAt(0)?{type:"param",value:t}:{type:"pathname",value:t}))),"/"===t.slice(-1)&&(t=t.substring(1),e.push({type:"pathname",value:"/"})),e}function L(t,e,r=!1){return E(M(t).map((t=>{if("wildcard"===t.type){const s=e[t.value];return r?`${t.value}${s??""}`:s}return"param"===t.type?e[t.value.substring(1)]??"":t.value})))}function O(t,e,r){const s=j(t,e,r);if(!r.to||s)return s??{}}function j(t,e,r){e="/"!=t?e.substring(t.length):e;const s=`${r.to??"$"}`,o=M(e),n=M(s);e.startsWith("/")||o.unshift({type:"pathname",value:"/"}),s.startsWith("/")||n.unshift({type:"pathname",value:"/"});const a={};return(()=>{for(let t=0;t<Math.max(o.length,n.length);t++){const e=o[t],s=n[t],i=t>=o.length-1,c=t>=n.length-1;if(s){if("wildcard"===s.type)return!!e?.value&&(a["*"]=E(o.slice(t).map((t=>t.value))),!0);if("pathname"===s.type){if("/"===s.value&&!e?.value)return!0;if(e)if(r.caseSensitive){if(s.value!==e.value)return!1}else if(s.value.toLowerCase()!==e.value.toLowerCase())return!1}if(!e)return!1;if("param"===s.type){if("/"===e?.value)return!1;"$"!==e.value.charAt(0)&&(a[s.value.substring(1)]=e.value)}}if(!i&&c)return!!r.fuzzy}return!0})()?a:void 0}function k(t,e){var r,s,o,n="";for(r in t)if(void 0!==(o=t[r]))if(Array.isArray(o))for(s=0;s<o.length;s++)n&&(n+="&"),n+=encodeURIComponent(r)+"="+encodeURIComponent(o[s]);else n&&(n+="&"),n+=encodeURIComponent(r)+"="+encodeURIComponent(o);return(e||"")+n}function A(t){if(!t)return"";var e=decodeURIComponent(t);return"false"!==e&&("true"===e||(0*+e==0&&+e+""===e?+e:e))}function D(t){for(var e,r,s={},o=t.split("&");e=o.shift();)void 0!==s[r=(e=e.split("=")).shift()]?s[r]=[].concat(s[r],A(e.shift())):s[r]=A(e.shift());return s}function B(){return B=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},B.apply(this,arguments)}
/**
* @tanstack/store/src/index.ts
*
* Copyright (c) TanStack
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/class ${listeners=new Set;_batching=!1;_flushing=0;_nextPriority=null;constructor(t,e){this.state=t,this.options=e}subscribe=t=>{this.listeners.add(t);const e=this.options?.onSubscribe?.(t,this);return()=>{this.listeners.delete(t),e?.()}};setState=(t,e)=>{const r=this.state;this.state=this.options?.updateFn?this.options.updateFn(r)(t):t(r);const s=e?.priority??this.options?.defaultPriority??"high";null===this._nextPriority||"high"===this._nextPriority?this._nextPriority=s:this._nextPriority=this.options?.defaultPriority??"high",this.options?.onUpdate?.({priority:this._nextPriority}),this._flush()};_flush=()=>{if(this._batching)return;const t=++this._flushing;this.listeners.forEach((e=>{this._flushing===t&&e({priority:this._nextPriority??"high"})}))};batch=t=>{if(this._batching)return t();this._batching=!0,t(),this._batching=!1,this._flush()}}
/**
* @tanstack/react-store/src/index.tsx
*
* Copyright (c) TanStack
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function T(t,e=(t=>t)){return r.useSyncExternalStoreWithSelector(t.subscribe,(()=>t.state),(()=>t.state),e,H)}function H(t,e){if(Object.is(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!1;for(let s=0;s<r.length;s++)if(!Object.prototype.hasOwnProperty.call(e,r[s])||!Object.is(t[r[s]],e[r[s]]))return!1;return!0}function F(t){const e=q(),{type:r,children:s,target:n,activeProps:a=(()=>({className:"active"})),inactiveProps:i=(()=>({})),activeOptions:c,disabled:h,hash:u,search:l,params:d,to:p=".",preload:f,preloadDelay:m,replace:y,style:v,className:w,onClick:b,onFocus:S,onMouseEnter:x,onMouseLeave:E,onTouchStart:R,...I}=t,P=e.buildLink(t);if("external"===P.type){const{href:t}=P;return{href:t}}const{handleClick:_,handleFocus:C,handleEnter:M,handleLeave:L,handleTouchStart:O,isActive:j,next:k}=P,A=t=>e=>{e.persist&&e.persist(),t.filter(Boolean).forEach((t=>{e.defaultPrevented||t(e)}))},D=j?g(a,{})??{}:{},B=j?{}:g(i,{})??{};return{...D,...B,...I,href:h?void 0:k.href,onClick:A([b,e=>{(t.startTransition??1)&&(o.startTransition||(t=>t))((()=>{_(e)}))}]),onFocus:A([S,C]),onMouseEnter:A([x,M]),onMouseLeave:A([E,L]),onTouchStart:A([R,O]),target:n,style:{...v,...D.style,...B.style},className:[w,D.className,B.className].filter(Boolean).join(" ")||void 0,...h?{role:"link","aria-disabled":!0}:void 0,"data-status":j?"active":void 0}}const N=o.forwardRef(((t,e)=>{const r=F(t);return o.createElement("a",B({ref:e},r,{children:"function"==typeof t.children?t.children({isActive:"active"===r["data-status"]}):t.children}))}));const U=o.createContext(null),z=o.createContext(null);function W(t){return T(q().__store,t?.select)}function J(){const t=q(),e=W({select:e=>e.pendingMatches.some((e=>!!t.getRoute(e.routeId)?.options.pendingComponent))?(console.log("hasPending"),e.pendingMatchIds):e.matchIds});return o.createElement(U.Provider,{value:[void 0,...e]},o.createElement(st,{errorComponent:nt,onCatch:()=>{}},o.createElement(X,null)))}function q(){return o.useContext(z)}function K(t){const e=q(),r=o.useContext(U)[0],s=e.getRouteMatch(r)?.routeId,a=W({select:e=>{const s=e.matches;return(t?.from?s.find((e=>e.routeId===t?.from)):s.find((t=>t.id===r))).routeId}});(t?.strict??1)&&n(s==a);return W({select:e=>{const s=e.matches,o=t?.from?s.find((e=>e.routeId===t?.from)):s.find((t=>t.id===r));return n(o,t?.from&&t.from),t?.select?.(o)??o}})}function Y(t){return K({...t,select:e=>t?.select?.(e.loaderData)??e.loaderData})}function V(t){return K({...t,select:e=>t?.select?.(e.search)??e.search})}function G(t){return W({select:e=>{const r=y(e.matches)?.params;return t?.select?.(r)??r}})}function Q(){const t=q();return o.useCallback((e=>{const{pending:r,caseSensitive:s,...o}=e;return t.matchRoute(o,{pending:r,caseSensitive:s})}),[])}function X(){const t=o.useContext(U).slice(1);return t[0]?o.createElement(tt,{matchIds:t}):null}const Z=()=>null;function tt({matchIds:t}){const e=q(),r=t[0],s=e.getRouteMatch(r).routeId,n=e.getRoute(s),a=n.options.pendingComponent??e.options.defaultPendingComponent??Z,i=n.options.errorComponent??e.options.defaultErrorComponent??nt,c=n.options.wrapInSuspense??!n.isRoot?o.Suspense:rt,h=i?st:rt;return o.createElement(U.Provider,{value:t},o.createElement(c,{fallback:o.createElement(a,{useLoader:n.useLoader,useMatch:n.useMatch,useContext:n.useContext,useRouteContext:n.useRouteContext,useSearch:n.useSearch,useParams:n.useParams})},o.createElement(h,{key:n.id,errorComponent:i,onCatch:()=>{}},o.createElement(et,{matchId:r,PendingComponent:a}))))}function et({matchId:t,PendingComponent:e}){const r=q(),s=W({select:e=>v(e.matchesById[t],["status","loadPromise","routeId","error"])}),a=r.getRoute(s.routeId);if("error"===s.status)throw s.error;if("pending"===s.status)return o.createElement(e,{useLoader:a.useLoader,useMatch:a.useMatch,useContext:a.useContext,useRouteContext:a.useRouteContext,useSearch:a.useSearch,useParams:a.useParams});if("success"===s.status){let t=a.options.component??r.options.defaultComponent;return t?o.createElement(t,{useLoader:a.useLoader,useMatch:a.useMatch,useContext:a.useContext,useRouteContext:a.useRouteContext,useSearch:a.useSearch,useParams:a.useParams}):o.createElement(X,null)}n(!1)}function rt(t){return o.createElement(o.Fragment,null,t.children)}class st extends o.Component{state={error:!1,info:void 0};componentDidCatch(t,e){this.props.onCatch(t,e),this.setState({error:t,info:e})}render(){return o.createElement(ot,B({},this.props,{errorState:this.state,reset:()=>this.setState({})}))}}function ot(t){const e=W({select:t=>t.resolvedLocation.key}),[r,s]=o.useState(t.errorState),n=t.errorComponent??nt,a=o.useRef("");return o.useEffect((()=>{r&&e!==a.current&&s({}),a.current=e}),[r,e]),o.useEffect((()=>{t.errorState.error&&s(t.errorState)}),[t.errorState.error]),t.errorState.error&&r.error?o.createElement(n,r):t.children}function nt({error:t}){const[e,r]=o.useState(!1);return o.createElement("div",{style:{padding:".5rem",maxWidth:"100%"}},o.createElement("div",{style:{display:"flex",alignItems:"center",gap:".5rem"}},o.createElement("strong",{style:{fontSize:"1rem"}},"Something went wrong!"),o.createElement("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>r((t=>!t))},e?"Hide Error":"Show Error")),o.createElement("div",{style:{height:".25rem"}}),e?o.createElement("div",null,o.createElement("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"}},t.message?o.createElement("code",null,t.message):null)):null)}function at(t,e=!0){const r=q();o.useEffect((()=>{if(!e)return;let s=r.history.block(((e,r)=>{window.confirm(t)&&(s(),e())}));return s}))}const it="__root__";class ct{constructor(t){this.options=t||{},this.isRoot=!t?.getParentRoute}init=t=>{this.originalIndex=t.originalIndex,this.router=t.router;const e=this.options,r=!e?.path&&!e?.id;this.parentRoute=this.options?.getParentRoute?.(),r?this.path=it:n(this.parentRoute);let s=r?it:e.path;s&&"/"!==s&&(s=_(s));const o=e?.id||s;let a=r?it:E([this.parentRoute.id===it?"":this.parentRoute.id,o]);s===it&&(s="/"),a!==it&&(a=E(["/",a]));const i=a===it?"/":E([this.parentRoute.fullPath,s]);this.path=s,this.id=a,this.fullPath=i,this.to=i};addChildren=t=>(this.children=t,this);update=t=>(Object.assign(this.options,t),this);useMatch=t=>K({...t,from:this.id});useLoader=t=>Y({...t,from:this.id});useContext=t=>K({...t,from:this.id,select:e=>t?.select?.(e.context)??e.context});useRouteContext=t=>K({...t,from:this.id,select:e=>t?.select?.(e.routeContext)??e.routeContext});useSearch=t=>V({...t,from:this.id});useParams=t=>G({...t,from:this.id})}class ht extends ct{constructor(t){super(t)}}const ut=dt(JSON.parse),lt=pt(JSON.stringify);function dt(t){return e=>{"?"===e.substring(0,1)&&(e=e.substring(1));let r=D(e);for(let e in r){const s=r[e];if("string"==typeof s)try{r[e]=t(s)}catch(t){}}return r}}function pt(t){return e=>{(e={...e})&&Object.keys(e).forEach((r=>{const s=e[r];if(void 0===s||void 0===s)delete e[r];else if(s&&"object"==typeof s&&null!==s)try{e[r]=t(s)}catch(t){}}));const r=k(e).toString();return r?`?${r}`:""}}const ft=["component","errorComponent","pendingComponent"];const mt="undefined"==typeof window||!window.document.createElement;function yt(){return{status:"idle",isFetching:!1,resolvedLocation:null,location:null,matchesById:{},matchIds:[],pendingMatchIds:[],matches:[],pendingMatches:[],lastUpdated:Date.now()}}function gt(t){return!!t?.isRedirect}class vt extends Error{}class wt extends Error{}t.Block=function({message:t,condition:e,children:r}){return at(t,e),r??null},t.ErrorComponent=nt,t.Link=N,t.MatchRoute=function(t){const e=Q()(t);return"function"==typeof t.children?t.children(e):e?t.children:null},t.Navigate=function(t){const e=q();return o.useLayoutEffect((()=>{e.navigate(t)}),[]),null},t.Outlet=X,t.PathParamError=wt,t.RootRoute=ht,t.Route=ct,t.Router=class{#t;constructor(t){this.options={defaultPreloadDelay:50,context:void 0,...t,stringifySearch:t?.stringifySearch??lt,parseSearch:t?.parseSearch??ut},this.__store=new $(yt(),{onUpdate:()=>{const t=this.state;this.state=this.__store.state;const e=t.matchesById!==this.state.matchesById;let r,s;e||(r=t.matchIds.length!==this.state.matchIds.length||t.matchIds.some(((t,e)=>t!==this.state.matchIds[e])),s=t.pendingMatchIds.length!==this.state.pendingMatchIds.length||t.pendingMatchIds.some(((t,e)=>t!==this.state.pendingMatchIds[e]))),(e||r)&&(this.state.matches=this.state.matchIds.map((t=>this.state.matchesById[t]))),(e||s)&&(this.state.pendingMatches=this.state.pendingMatchIds.map((t=>this.state.matchesById[t]))),this.state.isFetching=[...this.state.matches,...this.state.pendingMatches].some((t=>t.isFetching))},defaultPriority:"low"}),this.state=this.__store.state,this.update(t);const e=this.buildNext({hash:!0,fromCurrent:!0,search:!0,state:!0});this.state.location.href!==e.href&&this.#e({...e,replace:!0})}reset=()=>{this.__store.setState((t=>Object.assign(t,yt())))};mount=()=>{this.safeLoad()};update=t=>{if(this.options={...this.options,...t,context:{...this.options.context,...t?.context}},!this.history||this.options.history&&this.options.history!==this.history){this.#t&&this.#t(),this.history=this.options.history??(mt?p():d());const t=this.#r();this.__store.setState((e=>({...e,resolvedLocation:t,location:t}))),this.#t=this.history.listen((()=>{this.safeLoad({next:this.#r(this.state.location)})}))}const{basepath:e,routeTree:r}=this.options;return this.basepath=`/${_(e??"")??""}`,r&&r!==this.routeTree&&this.#s(r),this};buildNext=t=>{const e=this.#o(t),r=this.matchRoutes(e.pathname,e.search);return this.#o({...t,__matches:r})};cancelMatches=()=>{this.state.matches.forEach((t=>{this.cancelMatch(t.id)}))};cancelMatch=t=>{this.getRouteMatch(t)?.abortController?.abort()};safeLoad=t=>this.load(t).catch((t=>{}));latestLoadPromise=Promise.resolve();load=async t=>{const e=new Promise((async(r,s)=>{let o;const n=()=>this.latestLoadPromise!==e?this.latestLoadPromise:void 0;let a;this.__store.batch((()=>{t?.next&&this.__store.setState((e=>({...e,location:t.next}))),a=this.matchRoutes(this.state.location.pathname,this.state.location.search,{throwOnError:t?.throwOnError,debug:!0}),this.__store.setState((t=>({...t,status:"pending",pendingMatchIds:a.map((t=>t.id)),matchesById:this.#n(t.matchesById,a)})))}));try{if(await this.loadMatches(a),o=n())return await o;const t=this.state.resolvedLocation;this.__store.setState((t=>({...t,status:"idle",resolvedLocation:t.location,matchIds:t.pendingMatchIds,pendingMatchIds:[]}))),t.href!==this.state.location.href&&this.options.onRouteChange?.(),r()}catch(t){if(o=n())return await o;s(t)}}));return this.latestLoadPromise=e,this.latestLoadPromise};#n=(t,e)=>{const r={...t};let s=!1;return e.forEach((t=>{r[t.id]||(s=!0,r[t.id]=t)})),s?r:t};getRoute=t=>{const e=this.routesById[t];return n(e),e};preloadRoute=async(t=this.state.location)=>{const e=this.buildNext(t),r=this.matchRoutes(e.pathname,e.search,{throwOnError:!0});return this.__store.setState((t=>({...t,matchesById:this.#n(t.matchesById,r)}))),await this.loadMatches(r,{preload:!0,maxAge:t.maxAge}),r};cleanMatches=()=>{const t=Date.now(),e=Object.values(this.state.matchesById).filter((e=>{const r=this.getRoute(e.routeId);return!this.state.matchIds.includes(e.id)&&!this.state.pendingMatchIds.includes(e.id)&&e.preloadInvalidAt<t&&(!r.options.gcMaxAge||e.updatedAt+r.options.gcMaxAge<t)})).map((t=>t.id));e.length&&this.__store.setState((t=>{const r={...t.matchesById};return e.forEach((t=>{delete r[t]})),{...t,matchesById:r}}))};matchRoutes=(t,e,r)=>{let s={},o=this.flatRoutes.find((e=>{const r=O(this.basepath,t,{to:e.fullPath,caseSensitive:e.options.caseSensitive??this.options.caseSensitive});return!!r&&(s=r,!0)}))||this.routesById.__root__,n=[o];for(;o?.parentRoute;)o=o.parentRoute,o&&n.unshift(o);let a={};const i=n.map((t=>{let o,n;try{o=t.options.parseParams?.(s)??s}catch(t){if(n=new wt(t.message,{cause:t}),r?.throwOnError)throw n}Object.assign(a,o);const i=L(t.path,a),c=t.options.key?t.options.key({params:a,search:e})??"":"",h=c?JSON.stringify(c):"",u=L(t.id,a,!0)+h,l=this.getRouteMatch(u);if(l)return{...l};const d=!(!t.options.loader&&!ft.some((e=>t.options[e]?.preload)));return{id:u,key:h,routeId:t.id,params:a,pathname:E([this.basepath,i]),updatedAt:Date.now(),invalidAt:1/0,preloadInvalidAt:1/0,routeSearch:{},search:{},status:d?"idle":"success",isFetching:!1,invalid:!1,error:void 0,paramsError:n,searchError:void 0,loaderData:void 0,loadPromise:Promise.resolve(),routeContext:void 0,context:void 0,abortController:new AbortController,fetchedAt:0}}));return i.forEach(((t,s)=>{const o=i[s-1],n=this.getRoute(t.routeId),a=(()=>{const s={search:o?.search??e,routeSearch:o?.routeSearch??e};try{const e=("object"==typeof n.options.validateSearch?n.options.validateSearch.parse:n.options.validateSearch)?.(s.search)??{},r={...s.search,...e};return{routeSearch:w(t.routeSearch,e),search:w(t.search,r)}}catch(e){if(t.searchError=new vt(e.message,{cause:e}),r?.throwOnError)throw t.searchError;return s}})(),c=(()=>{try{const e=n.options.getContext?.({parentContext:o?.routeContext??{},context:o?.context??this?.options.context??{},params:t.params,search:t.search})||{};return{context:{...o?.context??this?.options.context,...e},routeContext:e}}catch(t){throw n.options.onError?.(t),t}})();Object.assign(t,{...a,...c})})),i};loadMatches=async(t,e)=>{let r;this.cleanMatches();try{await Promise.all(t.map((async(t,s)=>{const o=this.getRoute(t.routeId);e?.preload||this.setRouteMatch(t.id,(e=>({...e,routeSearch:t.routeSearch,search:t.search,routeContext:t.routeContext,context:t.context,error:t.error,paramsError:t.paramsError,searchError:t.searchError,params:t.params})));const n=(e,n)=>{if(r=r??s,n=n||o.options.onError,gt(e))throw e;try{n?.(e)}catch(t){if(e=t,gt(t))throw t}this.setRouteMatch(t.id,(t=>({...t,error:e,status:"error",updatedAt:Date.now()})))};t.paramsError&&n(t.paramsError,o.options.onParseParamsError),t.searchError&&n(t.searchError,o.options.onValidateSearchError);try{await(o.options.beforeLoad?.({...t,preload:!!e?.preload}))}catch(t){n(t,o.options.onBeforeLoadError)}})))}catch(t){throw e?.preload||this.navigate(t),t}const s=t.slice(0,r),o=[];s.forEach(((t,r)=>{o.push((async()=>{const s=o[r-1],n=this.getRoute(t.routeId);if(t.isFetching||"success"===t.status&&!this.getIsInvalid({matchId:t.id,preload:e?.preload}))return this.getRouteMatch(t.id)?.loadPromise;const a=Date.now(),i=()=>{const e=this.getRouteMatch(t.id);return e&&e.fetchedAt!==a?e.loadPromise:void 0},c=(async()=>{let r;const o=Promise.all(ft.map((async t=>{const e=n.options[t];e?.preload&&await e.preload()}))),a=n.options.loader?.({...t,preload:!!e?.preload,parentMatchPromise:s}),c=t=>!!gt(t)&&(e?.preload||this.navigate(t),!0);try{const[s,n]=await Promise.all([o,a]);if(r=i())return await r;this.setRouteMatchData(t.id,(()=>n),e)}catch(e){if(r=i())return await r;if(c(e))return;const s=n.options.onLoadError??n.options.onError;let o=e;try{s?.(e)}catch(t){if(o=t,c(t))return}this.setRouteMatch(t.id,(t=>({...t,error:o,status:"error",isFetching:!1,updatedAt:Date.now()})))}})();this.setRouteMatch(t.id,(t=>({...t,status:"success"!==t.status?"pending":t.status,isFetching:!0,loadPromise:c,fetchedAt:a,invalid:!1}))),await c})())})),await Promise.all(o)};reload=()=>this.navigate({fromCurrent:!0,replace:!0,search:!0});resolvePath=(t,e)=>C(this.basepath,t,R(e));navigate=async({from:t,to:e="",search:r,hash:s,replace:o,params:a})=>{const i=String(e),c=void 0===t?t:String(t);let h;try{new URL(`${i}`),h=!0}catch(t){}return n(!h),this.#e({from:c,to:i,search:r,hash:s,replace:o,params:a})};matchRoute=(t,e)=>{t={...t,to:t.to?this.resolvePath(t.from??"",t.to):void 0};const r=this.buildNext(t);if(e?.pending&&"pending"!==this.state.status)return!1;const s=e?.pending?this.state.location:this.state.resolvedLocation;if(!s)return!1;const o=O(this.basepath,s.pathname,{...e,to:r.pathname});return!!o&&(e?.includeSearch??1?!!x(s.search,r.search)&&o:o)};buildLink=({from:t,to:e=".",search:r,params:s,hash:o,target:n,replace:a,activeOptions:i,preload:c,preloadDelay:h,disabled:u})=>{try{return new URL(`${e}`),{type:"external",href:e}}catch(t){}const l={from:t,to:e,search:r,params:s,hash:o,replace:a},d=this.buildNext(l);c=c??this.options.defaultPreload;const p=h??this.options.defaultPreloadDelay??0,f=this.state.location.pathname.split("/"),m=d.pathname.split("/").every(((t,e)=>t===f[e])),y=i?.exact?this.state.location.pathname===d.pathname:m,g=!i?.includeHash||this.state.location.hash===d.hash,v=!(i?.includeSearch??1)||x(this.state.location.search,d.search);return{type:"internal",next:d,handleFocus:t=>{c&&this.preloadRoute(l).catch((t=>{console.warn(t),console.warn("Error preloading route! ☝️")}))},handleClick:t=>{u||function(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}(t)||t.defaultPrevented||n&&"_self"!==n||0!==t.button||(t.preventDefault(),this.#e(l))},handleEnter:t=>{const e=t.target||{};if(c){if(e.preloadTimeout)return;e.preloadTimeout=setTimeout((()=>{e.preloadTimeout=null,this.preloadRoute(l).catch((t=>{console.warn(t),console.warn("Error preloading route! ☝️")}))}),p)}},handleLeave:t=>{const e=t.target||{};e.preloadTimeout&&(clearTimeout(e.preloadTimeout),e.preloadTimeout=null)},handleTouchStart:t=>{this.preloadRoute(l).catch((t=>{console.warn(t),console.warn("Error preloading route! ☝️")}))},isActive:y&&g&&v,disabled:u}};dehydrate=()=>({state:v(this.state,["location","status","lastUpdated"])});hydrate=async t=>{let e=t;"undefined"!=typeof document&&(e=window.__TSR_DEHYDRATED__),n(e);const r=e;this.dehydratedData=r.payload,this.options.hydrate?.(r.payload),this.__store.setState((t=>({...t,...r.router.state,resolvedLocation:r.router.state.location}))),await this.load()};injectedHtml=[];injectHtml=async t=>{this.injectedHtml.push(t)};dehydrateData=(t,e)=>{if("undefined"==typeof document){const r="string"==typeof t?t:JSON.stringify(t);return this.injectHtml((async()=>{const t=`__TSR_DEHYDRATED__${r}`,s="function"==typeof e?await e():e;return`<script id='${t}' suppressHydrationWarning>window["__TSR_DEHYDRATED__${o=r,o.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(/"/g,'\\"')}"] = ${JSON.stringify(s)}\n ;(() => {\n var el = document.getElementById('${t}')\n el.parentElement.removeChild(el)\n })()\n <\/script>`;var o})),()=>this.hydrateData(t)}return()=>{}};hydrateData=t=>{if("undefined"!=typeof document){const e="string"==typeof t?t:JSON.stringify(t);return window[`__TSR_DEHYDRATED__${e}`]}};#s=t=>{this.routeTree=t,this.routesById={},this.routesByPath={},this.flatRoutes=[];const e=t=>{t.forEach(((t,r)=>{t.init({originalIndex:r,router:this});if(n(!this.routesById[t.id],String(t.id)),this.routesById[t.id]=t,!t.isRoot&&t.path){const e=P(t.fullPath);this.routesByPath[e]&&!t.fullPath.endsWith("/")||(this.routesByPath[e]=t)}const s=t.children;s?.length&&e(s)}))};e([t]),this.flatRoutes=Object.values(this.routesByPath).map(((t,e)=>{const r=_(t.fullPath),s=M(r);for(;s.length>1&&"/"===s[0]?.value;)s.shift();const o=s.map((t=>"param"===t.type?.5:"wildcard"===t.type?.25:1));return{child:t,trimmed:r,parsed:s,index:e,score:o}})).sort(((t,e)=>{let r="/"===t.trimmed?1:"/"===e.trimmed?-1:0;if(0!==r)return r;const s=Math.min(t.score.length,e.score.length);if(t.score.length!==e.score.length)return e.score.length-t.score.length;for(let r=0;r<s;r++)if(t.score[r]!==e.score[r])return e.score[r]-t.score[r];for(let r=0;r<s;r++)if(t.parsed[r].value!==e.parsed[r].value)return t.parsed[r].value>e.parsed[r].value?1:-1;return t.trimmed!==e.trimmed?t.trimmed>e.trimmed?1:-1:t.index-e.index})).map(((t,e)=>(t.child.rank=e,t.child)))};#r=t=>{let{pathname:e,search:r,hash:s,state:o}=this.history.location;const n=this.options.parseSearch(r);return{pathname:e,searchStr:r,search:w(t?.search,n),hash:s.split("#").reverse()[0]??"",href:`${e}${r}${s}`,state:o,key:o?.key||"__init__"}};#o=(t={})=>{t.fromCurrent=t.fromCurrent??""===t.to;const e=t.fromCurrent?this.state.location.pathname:t.from??this.state.location.pathname;let r=C(this.basepath??"/",e,`${t.to??""}`);const s={...y(this.matchRoutes(this.state.location.pathname,this.state.location.search))?.params};let o=!0===(t.params??!0)?s:g(t.params,s);o&&t.__matches?.map((t=>this.getRoute(t.routeId).options.stringifyParams)).filter(Boolean).forEach((t=>{o={...o,...t(o)}})),r=L(r,o??{});const n=t.__matches?.map((t=>this.getRoute(t.routeId).options.preSearchFilters??[])).flat().filter(Boolean)??[],a=t.__matches?.map((t=>this.getRoute(t.routeId).options.postSearchFilters??[])).flat().filter(Boolean)??[],i=n?.length?n?.reduce(((t,e)=>e(t)),this.state.location.search):this.state.location.search,c=!0===t.search?i:t.search?g(t.search,i)??{}:n?.length?i:{},h=a?.length?a.reduce(((t,e)=>e(t)),c):c,u=w(this.state.location.search,h),l=this.options.stringifySearch(u),d=!0===t.hash?this.state.location.hash:g(t.hash,this.state.location.hash),p=d?`#${d}`:"";return{pathname:r,search:u,searchStr:l,state:!0===t.state?this.state.location.state:g(t.state,this.state.location.state),hash:d,href:this.history.createHref(`${r}${l}${p}`),key:t.key}};#e=async t=>{const e=this.buildNext(t),r=""+Date.now()+Math.random();this.navigateTimeout&&clearTimeout(this.navigateTimeout);let s="replace";t.replace||(s="push");this.state.location.href===e.href&&!e.key&&(s="replace");const o=`${e.pathname}${e.searchStr}${e.hash?`#${e.hash}`:""}`;return this.history["push"===s?"push":"replace"](o,{id:r,...e.state}),this.latestLoadPromise};getRouteMatch=t=>this.state.matchesById[t];setRouteMatch=(t,e)=>{this.__store.setState((r=>({...r,matchesById:{...r.matchesById,[t]:e(r.matchesById[t])}})))};setRouteMatchData=(t,e,r)=>{const s=this.getRouteMatch(t);if(!s)return;const o=this.getRoute(s.routeId),n=r?.updatedAt??Date.now(),a=n+(r?.maxAge??o.options.preloadMaxAge??this.options.defaultPreloadMaxAge??5e3),i=n+(r?.maxAge??o.options.maxAge??this.options.defaultMaxAge??1/0);this.setRouteMatch(t,(t=>({...t,error:void 0,status:"success",isFetching:!1,updatedAt:Date.now(),loaderData:g(e,t.loaderData),preloadInvalidAt:a,invalidAt:i}))),this.state.matches.find((e=>e.id===t))};invalidate=async t=>{if(t?.matchId){this.setRouteMatch(t.matchId,(t=>({...t,invalid:!0})));const e=this.state.matches.findIndex((e=>e.id===t.matchId)),r=this.state.matches[e+1];if(r)return this.invalidate({matchId:r.id,reload:!1})}else this.__store.batch((()=>{Object.values(this.state.matchesById).forEach((t=>{this.setRouteMatch(t.id,(t=>({...t,invalid:!0})))}))}));if(t?.reload??1)return this.reload()};getIsInvalid=t=>{if(!t?.matchId)return!!this.state.matches.find((e=>this.getIsInvalid({matchId:e.id,preload:t?.preload})));const e=this.getRouteMatch(t?.matchId);if(!e)return!1;const r=Date.now();return e.invalid||(t?.preload?e.preloadInvalidAt:e.invalidAt)<r}},t.RouterContext=class{constructor(){}createRootRoute=t=>new ht(t)},t.RouterProvider=function({router:t,...e}){t.update(e),o.useEffect((()=>{let e;return o.startTransition((()=>{e=t.mount()})),e}),[t]);const r=t.options.Wrap||o.Fragment;return o.createElement(o.Suspense,{fallback:null},o.createElement(r,null,o.createElement(z.Provider,{value:t},o.createElement(J,null))))},t.SearchParamError=vt,t.cleanPath=R,t.componentTypes=ft,t.createBrowserHistory=d,t.createHashHistory=function(){return d({getHref:()=>window.location.hash.substring(1),createHref:t=>`#${t}`})},t.createMemoryHistory=p,t.decode=D,t.defaultParseSearch=ut,t.defaultStringifySearch=lt,t.encode=k,t.functionalUpdate=g,t.interpolatePath=L,t.invariant=n,t.isPlainObject=b,t.isRedirect=gt,t.joinPaths=E,t.last=y,t.lazyFn=function(t,e){return async(...r)=>(await t())[e||"default"](...r)},t.lazyRouteComponent=function(t,e){let r;const s=()=>(r||(r=t()),r),n=o.lazy((async()=>({default:(await s())[e??"default"]})));return n.preload=s,n},t.matchByPath=j,t.matchIdsContext=U,t.matchPathname=O,t.parsePathname=M,t.parseSearchWith=dt,t.partialDeepEqual=x,t.pick=v,t.redirect=function(t){return t.isRedirect=!0,t},t.replaceEqualDeep=w,t.resolvePath=C,t.rootRouteId=it,t.routerContext=z,t.shallow=function(t,e){if(Object.is(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!1;for(let s=0;s<r.length;s++)if(!Object.prototype.hasOwnProperty.call(e,r[s])||!Object.is(t[r[s]],e[r[s]]))return!1;return!0},t.stringifySearchWith=pt,t.trimPath=_,t.trimPathLeft=I,t.trimPathRight=P,t.useBlocker=at,t.useDehydrate=function(){const t=q();return o.useCallback((function(e,r){return t.dehydrateData(e,r)}),[])},t.useHydrate=function(){const t=q();return function(e){return t.hydrateData(e)}},t.useInjectHtml=function(){const t=q();return o.useCallback((e=>{t.injectHtml(e)}),[])},t.useLinkProps=F,t.useLoader=Y,t.useMatch=K,t.useMatchRoute=Q,t.useMatches=function(t){const e=o.useContext(U);return W({select:r=>{const s=r.matches.slice(r.matches.findIndex((t=>t.id===e[0])));return t?.select?.(s)??s}})},t.useNavigate=function(t){const e=q();return o.useCallback((r=>e.navigate({...t,...r})),[])},t.useParams=G,t.useRouteContext=function(t){return K({...t,select:e=>t?.select?.(e.routeContext)??e.routeContext})},t.useRouter=q,t.useRouterContext=function(t){return K({...t,select:e=>t?.select?.(e.context)??e.context})},t.useRouterState=W,t.useSearch=V,t.useStore=T,t.warning=function(t,e){},Object.defineProperty(t,"__esModule",{value:!0})}));
!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";console.error("@tanstack/router is not intended to be used directly. Please use @tanstack/[framework]-router packages or @tanstack/router-core instead.")}));
//# sourceMappingURL=index.production.js.map
{
"name": "@tanstack/router",
"author": "Tanner Linsley",
"version": "0.0.1-beta.144",
"version": "0.0.1-beta.145",
"license": "MIT",
"repository": "tanstack/router",
"homepage": "https://tanstack.com/router",
"description": "",
"description": "THIS PACKAGE HAS BEEN DEPRECATED. Please use @tanstack/[framework]-router packages instead.",
"publishConfig": {

@@ -37,18 +37,7 @@ "registry": "https://registry.npmjs.org/"

"sideEffects": false,
"peerDependencies": {
"react": ">=16",
"react-dom": ">=16"
},
"dependencies": {
"@babel/runtime": "^7.16.7",
"tiny-invariant": "^1.3.1",
"tiny-warning": "^1.0.3",
"@gisatcz/cross-package-react-context": "^0.2.0",
"@tanstack/react-store": "0.0.1-beta.134"
},
"peerDependencies": {},
"dependencies": {},
"scripts": {
"build": "rollup --config rollup.config.js",
"test": "vitest",
"test:dev": "vitest --watch"
"build": "rollup --config rollup.config.js"
}
}

@@ -1,12 +0,7 @@

export { default as invariant } from 'tiny-invariant'
export { default as warning } from 'tiny-warning'
export * from './history'
export * from './link'
export * from './path'
export * from './qss'
export * from './route'
export * from './routeInfo'
export * from './router'
export * from './searchParams'
export * from './utils'
export * from './react'
;(() => {
console.error(
'@tanstack/router is not intended to be used directly. Please use @tanstack/[framework]-router packages or @tanstack/router-core instead.',
)
})()
export {}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc