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

react-router

Package Overview
Dependencies
Maintainers
3
Versions
539
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-router - npm Package Compare versions

Comparing version 6.0.0-beta.8 to 6.0.0

22

index.d.ts
import * as React from "react";
import { Action } from "history";
import type { History, InitialEntry, Location, Path, State, To } from "history";
import type { History, InitialEntry, Location, Path, To } from "history";
import { Action as NavigationType } from "history";
export type { Location, Path, To, NavigationType };
/**

@@ -21,4 +22,4 @@ * A Navigator is a "location changer"; it's how you get to different locations.

interface LocationContextObject {
action: Action;
location: Location;
navigationType: NavigationType;
}

@@ -46,3 +47,3 @@ declare const LocationContext: React.Context<LocationContextObject>;

replace?: boolean;
state?: State;
state?: any;
}

@@ -96,6 +97,6 @@ /**

export interface RouterProps {
action?: Action;
basename?: string;
children?: React.ReactNode;
location: Partial<Location> | string;
navigationType?: NavigationType;
navigator: Navigator;

@@ -113,3 +114,3 @@ static?: boolean;

*/
export declare function Router({ action, basename: basenameProp, children, location: locationProp, navigator, static: staticProp }: RouterProps): React.ReactElement | null;
export declare function Router({ basename: basenameProp, children, location: locationProp, navigationType, navigator, static: staticProp }: RouterProps): React.ReactElement | null;
export interface RoutesProps {

@@ -151,2 +152,9 @@ children?: React.ReactNode;

/**
* Returns the current navigation action which describes how the router came to
* the current location, either by a pop, push, or replace on the history stack.
*
* @see https://reactrouter.com/api/useNavigationType
*/
export declare function useNavigationType(): NavigationType;
/**
* Returns true if the URL for the given "to" value matches the current URL.

@@ -168,3 +176,3 @@ * This is useful for components that need to know "active" state, e.g.

replace?: boolean;
state?: State;
state?: any;
}

@@ -171,0 +179,0 @@ /**

/**
* React Router v6.0.0-beta.8
* React Router v6.0.0
*

@@ -110,4 +110,4 @@ * Copyright (c) Remix Software Inc.

children: children,
action: state.action,
location: state.location,
navigationType: state.action,
navigator: history

@@ -175,6 +175,6 @@ });

let {
action = Action.Pop,
basename: basenameProp = "/",
children = null,
location: locationProp,
navigationType = Action.Pop,
navigator,

@@ -228,4 +228,4 @@ static: staticProp = false

value: {
action,
location
location,
navigationType
}

@@ -280,5 +280,5 @@ }));

return navigator.createHref({
hash,
pathname: joinedPathname,
search
search,
hash
});

@@ -313,2 +313,12 @@ }

/**
* Returns the current navigation action which describes how the router came to
* the current location, either by a pop, push, or replace on the history stack.
*
* @see https://reactrouter.com/api/useNavigationType
*/
function useNavigationType() {
return useContext(LocationContext).navigationType;
}
/**
* Returns true if the URL for the given "to" value matches the current URL.

@@ -487,3 +497,3 @@ * This is useful for components that need to know "active" state, e.g.

process.env.NODE_ENV !== "production" ? warning(parentRoute || matches != null, "No routes matched location \"" + location.pathname + location.search + location.hash + "\" ") : void 0;
process.env.NODE_ENV !== "production" ? warning(matches == null || matches[matches.length - 1].route.element != null, "Matched leaf route at location \"" + location.pathname + location.search + location.hash + "\" does not have an element. " + "This means it will render an <Outlet /> with a null value by default resulting in an \"empty\" page.") : void 0;
process.env.NODE_ENV !== "production" ? warning(matches == null || matches[matches.length - 1].route.element !== undefined, "Matched leaf route at location \"" + location.pathname + location.search + location.hash + "\" does not have an element. " + "This means it will render an <Outlet /> with a null value by default resulting in an \"empty\" page.") : void 0;
}

@@ -494,3 +504,3 @@

pathname: joinPaths([parentPathnameBase, match.pathname]),
pathnameBase: joinPaths([parentPathnameBase, match.pathnameBase])
pathnameBase: match.pathnameBase === "/" ? parentPathnameBase : joinPaths([parentPathnameBase, match.pathnameBase])
})), parentMatches);

@@ -735,3 +745,3 @@ } ///////////////////////////////////////////////////////////////////////////////

return /*#__PURE__*/createElement(RouteContext.Provider, {
children: match.route.element || /*#__PURE__*/createElement(Outlet, null),
children: match.route.element !== undefined ? match.route.element : /*#__PURE__*/createElement(Outlet, null),
value: {

@@ -945,3 +955,3 @@ outlet,

export { MemoryRouter, Navigate, Outlet, Route, Router, Routes, LocationContext as UNSAFE_LocationContext, NavigationContext as UNSAFE_NavigationContext, RouteContext as UNSAFE_RouteContext, createRoutesFromChildren, generatePath, matchPath, matchRoutes, renderMatches, resolvePath, useHref, useInRouterContext, useLocation, useMatch, useNavigate, useOutlet, useParams, useResolvedPath, useRoutes };
export { MemoryRouter, Navigate, Outlet, Route, Router, Routes, LocationContext as UNSAFE_LocationContext, NavigationContext as UNSAFE_NavigationContext, RouteContext as UNSAFE_RouteContext, createRoutesFromChildren, generatePath, matchPath, matchRoutes, renderMatches, resolvePath, useHref, useInRouterContext, useLocation, useMatch, useNavigate, useNavigationType, useOutlet, useParams, useResolvedPath, useRoutes };
//# sourceMappingURL=index.js.map
/**
* React Router v6.0.0-beta.8
* React Router v6.0.0
*

@@ -4,0 +4,0 @@ * Copyright (c) Remix Software Inc.

{
"name": "react-router",
"version": "6.0.0-beta.8",
"version": "6.0.0",
"author": "Remix Software <hello@remix.run>",

@@ -17,5 +17,7 @@ "description": "Declarative routing for React",

"peerDependencies": {
"history": ">=5",
"react": ">=16.8"
},
"dependencies": {
"history": "^5.0.3"
},
"sideEffects": false,

@@ -22,0 +24,0 @@ "keywords": [

/**
* React Router v6.0.0-beta.8
* React Router v6.0.0
*

@@ -109,4 +109,4 @@ * Copyright (c) Remix Software Inc.

children: children,
action: state.action,
location: state.location,
navigationType: state.action,
navigator: history

@@ -172,6 +172,6 @@ });

function Router({
action = Action.Pop,
basename: basenameProp = "/",
children = null,
location: locationProp,
navigationType = Action.Pop,
navigator,

@@ -225,4 +225,4 @@ static: staticProp = false

value: {
action,
location
location,
navigationType
}

@@ -276,5 +276,5 @@ }));

return navigator.createHref({
hash,
pathname: joinedPathname,
search
search,
hash
});

@@ -309,2 +309,12 @@ }

/**
* Returns the current navigation action which describes how the router came to
* the current location, either by a pop, push, or replace on the history stack.
*
* @see https://reactrouter.com/api/useNavigationType
*/
function useNavigationType() {
return useContext(LocationContext).navigationType;
}
/**
* Returns true if the URL for the given "to" value matches the current URL.

@@ -477,3 +487,3 @@ * This is useful for components that need to know "active" state, e.g.

warning(parentRoute || matches != null, `No routes matched location "${location.pathname}${location.search}${location.hash}" `) ;
warning(matches == null || matches[matches.length - 1].route.element != null, `Matched leaf route at location "${location.pathname}${location.search}${location.hash}" does not have an element. ` + `This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`) ;
warning(matches == null || matches[matches.length - 1].route.element !== undefined, `Matched leaf route at location "${location.pathname}${location.search}${location.hash}" does not have an element. ` + `This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`) ;
}

@@ -484,3 +494,3 @@

pathname: joinPaths([parentPathnameBase, match.pathname]),
pathnameBase: joinPaths([parentPathnameBase, match.pathnameBase])
pathnameBase: match.pathnameBase === "/" ? parentPathnameBase : joinPaths([parentPathnameBase, match.pathnameBase])
})), parentMatches);

@@ -701,3 +711,3 @@ } ///////////////////////////////////////////////////////////////////////////////

return /*#__PURE__*/createElement(RouteContext.Provider, {
children: match.route.element || /*#__PURE__*/createElement(Outlet, null),
children: match.route.element !== undefined ? match.route.element : /*#__PURE__*/createElement(Outlet, null),
value: {

@@ -899,3 +909,3 @@ outlet,

export { MemoryRouter, Navigate, Outlet, Route, Router, Routes, LocationContext as UNSAFE_LocationContext, NavigationContext as UNSAFE_NavigationContext, RouteContext as UNSAFE_RouteContext, createRoutesFromChildren, generatePath, matchPath, matchRoutes, renderMatches, resolvePath, useHref, useInRouterContext, useLocation, useMatch, useNavigate, useOutlet, useParams, useResolvedPath, useRoutes };
export { MemoryRouter, Navigate, Outlet, Route, Router, Routes, LocationContext as UNSAFE_LocationContext, NavigationContext as UNSAFE_NavigationContext, RouteContext as UNSAFE_RouteContext, createRoutesFromChildren, generatePath, matchPath, matchRoutes, renderMatches, resolvePath, useHref, useInRouterContext, useLocation, useMatch, useNavigate, useNavigationType, useOutlet, useParams, useResolvedPath, useRoutes };
//# sourceMappingURL=react-router.development.js.map
/**
* React Router v6.0.0-beta.8
* React Router v6.0.0
*

@@ -11,3 +11,3 @@ * Copyright (c) Remix Software Inc.

*/
import{createContext as e,useRef as t,useState as n,useLayoutEffect as a,createElement as r,useContext as l,useEffect as i,useMemo as s,useCallback as c,Children as h,isValidElement as o,Fragment as u}from"react";import{createMemoryHistory as p,Action as m,parsePath as f}from"history";function d(e,t){if(!e)throw new Error(t)}const g=e(null),v=e(null),y=e({outlet:null,matches:[]});function x({basename:e,children:l,initialEntries:i,initialIndex:s}){let c=t();null==c.current&&(c.current=p({initialEntries:i,initialIndex:s}));let h=c.current,[o,u]=n({action:h.action,location:h.location});return a((()=>h.listen(u)),[h]),r(b,{basename:e,children:l,action:o.action,location:o.location,navigator:h})}function S({to:e,replace:t,state:n}){E()||d(!1);let a=I();return i((()=>{a(e,{replace:t,state:n})})),null}function $(e){return O()}function W(e){d(!1)}function b({action:e=m.Pop,basename:t="/",children:n=null,location:a,navigator:l,static:i=!1}){E()&&d(!1);let c=T(t),h=s((()=>({basename:c,navigator:l,static:i})),[c,l,i]);"string"==typeof a&&(a=f(a));let{pathname:o="/",search:u="",hash:p="",state:y=null,key:x="default"}=a,S=s((()=>{let e=K(o,c);return null==e?null:{pathname:e,search:u,hash:p,state:y,key:x}}),[c,o,u,p,y,x]);return null==S?null:r(g.Provider,{value:h},r(v.Provider,{children:n,value:{action:e,location:S}}))}function P({children:e,location:t}){return A(J(e),t)}function B(e){E()||d(!1);let{basename:t,navigator:n}=l(g),{hash:a,pathname:r,search:i}=C(e),s=r;if("/"!==t){let n=function(e){return""===e||""===e.pathname?"/":"string"==typeof e?f(e).pathname:e.pathname}(e),a=null!=n&&n.endsWith("/");s="/"===r?t+(a?"/":""):Q([t,r])}return n.createHref({hash:a,pathname:s,search:i})}function E(){return null!=l(v)}function w(){return E()||d(!1),l(v).location}function N(e){return E()||d(!1),z(e,w().pathname)}function I(){E()||d(!1);let{basename:e,navigator:n}=l(g),{matches:a}=l(y),{pathname:r}=w(),s=JSON.stringify(a.map((e=>e.pathnameBase))),h=t(!1);return i((()=>{h.current=!0})),c(((t,a={})=>{if(!h.current)return;if("number"==typeof t)return void n.go(t);let l=G(t,JSON.parse(s),r);"/"!==e&&(l.pathname=Q([e,l.pathname])),(a.replace?n.replace:n.push)(l,a.state)}),[e,n,s,r])}function O(){return l(y).outlet}function j(){let{matches:e}=l(y),t=e[e.length-1];return t?t.params:{}}function C(e){let{matches:t}=l(y),{pathname:n}=w(),a=JSON.stringify(t.map((e=>e.pathnameBase)));return s((()=>G(e,JSON.parse(a),n)),[e,a,n])}function A(e,t){E()||d(!1);let n,{matches:a}=l(y),r=a[a.length-1],i=r?r.params:{},s=(r&&r.pathname,r?r.pathnameBase:"/"),c=(r&&r.route,w());if(t){let e="string"==typeof t?f(t):t;"/"===s||e.pathname?.startsWith(s)||d(!1),n=e}else n=c;let h=n.pathname||"/",o=R(e,{pathname:"/"===s?h:h.slice(s.length)||"/"});return q(o&&o.map((e=>Object.assign({},e,{params:Object.assign({},i,e.params),pathname:Q([s,e.pathname]),pathnameBase:Q([s,e.pathnameBase])}))),a)}function J(e){let t=[];return h.forEach(e,(e=>{if(!o(e))return;if(e.type===u)return void t.push.apply(t,J(e.props.children));let n={caseSensitive:e.props.caseSensitive,element:e.props.element,index:e.props.index,path:e.props.path};e.props.children&&(n.children=J(e.props.children)),t.push(n)})),t}function M(e,t={}){return e.replace(/:(\w+)/g,((e,n)=>(null==t[n]&&d(!1),t[n]))).replace(/\/*\*$/,(e=>null==t["*"]?"":t["*"].replace(/^\/*/,"/")))}function R(e,t,n="/"){let a=K(("string"==typeof t?f(t):t).pathname||"/",n);if(null==a)return null;let r=U(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){return e.length===t.length&&e.slice(0,-1).every(((e,n)=>e===t[n]))?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(r);let l=null;for(let i=0;null==l&&i<r.length;++i)l=k(r[i],e,a);return l}function U(e,t=[],n=[],a=""){return e.forEach(((e,r)=>{let l={relativePath:e.path||"",caseSensitive:!0===e.caseSensitive,childrenIndex:r};l.relativePath.startsWith("/")&&(l.relativePath.startsWith(a)||d(!1),l.relativePath=l.relativePath.slice(a.length));let i=Q([a,l.relativePath]),s=n.concat(l);e.children&&e.children.length>0&&(!0===e.index&&d(!1),U(e.children,t,s,i)),(null!=e.path||e.index)&&t.push({path:i,score:_(i,e.index),routesMeta:s})})),t}const F=/^:\w+$/,L=e=>"*"===e;function _(e,t){let n=e.split("/"),a=n.length;return n.some(L)&&(a+=-2),t&&(a+=2),n.filter((e=>!L(e))).reduce(((e,t)=>e+(F.test(t)?3:""===t?1:10)),a)}function k(e,t,n){let a=t,{routesMeta:r}=e,l={},i="/",s=[];for(let c=0;c<r.length;++c){let e=r[c],t=c===r.length-1,h="/"===i?n:n.slice(i.length)||"/",o=z({path:e.relativePath,caseSensitive:e.caseSensitive,end:t},h);if(!o)return null;Object.assign(l,o.params);let u=a[e.childrenIndex];s.push({params:l,pathname:Q([i,o.pathname]),pathnameBase:Q([i,o.pathnameBase]),route:u}),"/"!==o.pathnameBase&&(i=Q([i,o.pathnameBase])),a=u.children}return s}function H(e){return q(e)}function q(e,t=[]){return null==e?null:e.reduceRight(((n,a,l)=>r(y.Provider,{children:a.route.element||r($,null),value:{outlet:n,matches:t.concat(e.slice(0,l+1))}})),null)}function z(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=function(e,t=!1,n=!0){let a=[],r="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/:(\w+)/g,((e,t)=>(a.push(t),"([^\\/]+)")));e.endsWith("*")?(a.push("*"),r+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r+=n?"\\/*$":"(?:\\b|$)";return[new RegExp(r,t?void 0:"i"),a]}(e.path,e.caseSensitive,e.end),r=t.match(n);if(!r)return null;let l=r[0],i=l.replace(/(.)\/+$/,"$1"),s=r.slice(1);return{params:a.reduce(((e,t,n)=>{if("*"===t){let e=s[n]||"";i=l.slice(0,l.length-e.length).replace(/(.)\/+$/,"$1")}return e[t]=function(e,t){try{return decodeURIComponent(e)}catch(n){return e}}(s[n]||""),e}),{}),pathname:l,pathnameBase:i,pattern:e}}function D(e,t="/"){let{pathname:n,search:a="",hash:r=""}="string"==typeof e?f(e):e,l=n?n.startsWith("/")?n:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(n,t):t;return{pathname:l,search:V(a),hash:X(r)}}function G(e,t,n){let a,r="string"==typeof e?f(e):e,l=""===e||""===r.pathname?"/":r.pathname;if(null==l)a=n;else{let e=t.length-1;if(l.startsWith("..")){let t=l.split("/");for(;".."===t[0];)t.shift(),e-=1;r.pathname=t.join("/")}a=e>=0?t[e]:"/"}let i=D(r,a);return l&&"/"!==l&&l.endsWith("/")&&!i.pathname.endsWith("/")&&(i.pathname+="/"),i}function K(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=e.charAt(t.length);return n&&"/"!==n?null:e.slice(t.length)||"/"}const Q=e=>e.join("/").replace(/\/\/+/g,"/"),T=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),V=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",X=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";export{x as MemoryRouter,S as Navigate,$ as Outlet,W as Route,b as Router,P as Routes,v as UNSAFE_LocationContext,g as UNSAFE_NavigationContext,y as UNSAFE_RouteContext,J as createRoutesFromChildren,M as generatePath,z as matchPath,R as matchRoutes,H as renderMatches,D as resolvePath,B as useHref,E as useInRouterContext,w as useLocation,N as useMatch,I as useNavigate,O as useOutlet,j as useParams,C as useResolvedPath,A as useRoutes};
import{createContext as e,useRef as t,useState as n,useLayoutEffect as a,createElement as r,useContext as l,useEffect as i,useMemo as s,useCallback as h,Children as c,isValidElement as o,Fragment as u}from"react";import{createMemoryHistory as p,Action as m,parsePath as f}from"history";function g(e,t){if(!e)throw new Error(t)}const d=e(null),v=e(null),y=e({outlet:null,matches:[]});function x({basename:e,children:l,initialEntries:i,initialIndex:s}){let h=t();null==h.current&&(h.current=p({initialEntries:i,initialIndex:s}));let c=h.current,[o,u]=n({action:c.action,location:c.location});return a((()=>c.listen(u)),[c]),r(b,{basename:e,children:l,location:o.location,navigationType:o.action,navigator:c})}function S({to:e,replace:t,state:n}){E()||g(!1);let a=O();return i((()=>{a(e,{replace:t,state:n})})),null}function $(e){return j()}function W(e){g(!1)}function b({basename:e="/",children:t=null,location:n,navigationType:a=m.Pop,navigator:l,static:i=!1}){E()&&g(!1);let h=V(e),c=s((()=>({basename:h,navigator:l,static:i})),[h,l,i]);"string"==typeof n&&(n=f(n));let{pathname:o="/",search:u="",hash:p="",state:y=null,key:x="default"}=n,S=s((()=>{let e=K(o,h);return null==e?null:{pathname:e,search:u,hash:p,state:y,key:x}}),[h,o,u,p,y,x]);return null==S?null:r(d.Provider,{value:c},r(v.Provider,{children:t,value:{location:S,navigationType:a}}))}function B({children:e,location:t}){return J(M(e),t)}function P(e){E()||g(!1);let{basename:t,navigator:n}=l(d),{hash:a,pathname:r,search:i}=A(e),s=r;if("/"!==t){let n=function(e){return""===e||""===e.pathname?"/":"string"==typeof e?f(e).pathname:e.pathname}(e),a=null!=n&&n.endsWith("/");s="/"===r?t+(a?"/":""):Q([t,r])}return n.createHref({pathname:s,search:i,hash:a})}function E(){return null!=l(v)}function w(){return E()||g(!1),l(v).location}function N(){return l(v).navigationType}function I(e){return E()||g(!1),z(e,w().pathname)}function O(){E()||g(!1);let{basename:e,navigator:n}=l(d),{matches:a}=l(y),{pathname:r}=w(),s=JSON.stringify(a.map((e=>e.pathnameBase))),c=t(!1);return i((()=>{c.current=!0})),h(((t,a={})=>{if(!c.current)return;if("number"==typeof t)return void n.go(t);let l=G(t,JSON.parse(s),r);"/"!==e&&(l.pathname=Q([e,l.pathname])),(a.replace?n.replace:n.push)(l,a.state)}),[e,n,s,r])}function j(){return l(y).outlet}function C(){let{matches:e}=l(y),t=e[e.length-1];return t?t.params:{}}function A(e){let{matches:t}=l(y),{pathname:n}=w(),a=JSON.stringify(t.map((e=>e.pathnameBase)));return s((()=>G(e,JSON.parse(a),n)),[e,a,n])}function J(e,t){E()||g(!1);let n,{matches:a}=l(y),r=a[a.length-1],i=r?r.params:{},s=(r&&r.pathname,r?r.pathnameBase:"/"),h=(r&&r.route,w());if(t){let e="string"==typeof t?f(t):t;"/"===s||e.pathname?.startsWith(s)||g(!1),n=e}else n=h;let c=n.pathname||"/",o=T(e,{pathname:"/"===s?c:c.slice(s.length)||"/"});return q(o&&o.map((e=>Object.assign({},e,{params:Object.assign({},i,e.params),pathname:Q([s,e.pathname]),pathnameBase:"/"===e.pathnameBase?s:Q([s,e.pathnameBase])}))),a)}function M(e){let t=[];return c.forEach(e,(e=>{if(!o(e))return;if(e.type===u)return void t.push.apply(t,M(e.props.children));let n={caseSensitive:e.props.caseSensitive,element:e.props.element,index:e.props.index,path:e.props.path};e.props.children&&(n.children=M(e.props.children)),t.push(n)})),t}function R(e,t={}){return e.replace(/:(\w+)/g,((e,n)=>(null==t[n]&&g(!1),t[n]))).replace(/\/*\*$/,(e=>null==t["*"]?"":t["*"].replace(/^\/*/,"/")))}function T(e,t,n="/"){let a=K(("string"==typeof t?f(t):t).pathname||"/",n);if(null==a)return null;let r=U(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){return e.length===t.length&&e.slice(0,-1).every(((e,n)=>e===t[n]))?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(r);let l=null;for(let i=0;null==l&&i<r.length;++i)l=k(r[i],e,a);return l}function U(e,t=[],n=[],a=""){return e.forEach(((e,r)=>{let l={relativePath:e.path||"",caseSensitive:!0===e.caseSensitive,childrenIndex:r};l.relativePath.startsWith("/")&&(l.relativePath.startsWith(a)||g(!1),l.relativePath=l.relativePath.slice(a.length));let i=Q([a,l.relativePath]),s=n.concat(l);e.children&&e.children.length>0&&(!0===e.index&&g(!1),U(e.children,t,s,i)),(null!=e.path||e.index)&&t.push({path:i,score:_(i,e.index),routesMeta:s})})),t}const F=/^:\w+$/,L=e=>"*"===e;function _(e,t){let n=e.split("/"),a=n.length;return n.some(L)&&(a+=-2),t&&(a+=2),n.filter((e=>!L(e))).reduce(((e,t)=>e+(F.test(t)?3:""===t?1:10)),a)}function k(e,t,n){let a=t,{routesMeta:r}=e,l={},i="/",s=[];for(let h=0;h<r.length;++h){let e=r[h],t=h===r.length-1,c="/"===i?n:n.slice(i.length)||"/",o=z({path:e.relativePath,caseSensitive:e.caseSensitive,end:t},c);if(!o)return null;Object.assign(l,o.params);let u=a[e.childrenIndex];s.push({params:l,pathname:Q([i,o.pathname]),pathnameBase:Q([i,o.pathnameBase]),route:u}),"/"!==o.pathnameBase&&(i=Q([i,o.pathnameBase])),a=u.children}return s}function H(e){return q(e)}function q(e,t=[]){return null==e?null:e.reduceRight(((n,a,l)=>r(y.Provider,{children:void 0!==a.route.element?a.route.element:r($,null),value:{outlet:n,matches:t.concat(e.slice(0,l+1))}})),null)}function z(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=function(e,t=!1,n=!0){let a=[],r="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/:(\w+)/g,((e,t)=>(a.push(t),"([^\\/]+)")));e.endsWith("*")?(a.push("*"),r+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r+=n?"\\/*$":"(?:\\b|$)";return[new RegExp(r,t?void 0:"i"),a]}(e.path,e.caseSensitive,e.end),r=t.match(n);if(!r)return null;let l=r[0],i=l.replace(/(.)\/+$/,"$1"),s=r.slice(1);return{params:a.reduce(((e,t,n)=>{if("*"===t){let e=s[n]||"";i=l.slice(0,l.length-e.length).replace(/(.)\/+$/,"$1")}return e[t]=function(e,t){try{return decodeURIComponent(e)}catch(n){return e}}(s[n]||""),e}),{}),pathname:l,pathnameBase:i,pattern:e}}function D(e,t="/"){let{pathname:n,search:a="",hash:r=""}="string"==typeof e?f(e):e,l=n?n.startsWith("/")?n:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(n,t):t;return{pathname:l,search:X(a),hash:Y(r)}}function G(e,t,n){let a,r="string"==typeof e?f(e):e,l=""===e||""===r.pathname?"/":r.pathname;if(null==l)a=n;else{let e=t.length-1;if(l.startsWith("..")){let t=l.split("/");for(;".."===t[0];)t.shift(),e-=1;r.pathname=t.join("/")}a=e>=0?t[e]:"/"}let i=D(r,a);return l&&"/"!==l&&l.endsWith("/")&&!i.pathname.endsWith("/")&&(i.pathname+="/"),i}function K(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=e.charAt(t.length);return n&&"/"!==n?null:e.slice(t.length)||"/"}const Q=e=>e.join("/").replace(/\/\/+/g,"/"),V=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),X=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",Y=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";export{x as MemoryRouter,S as Navigate,$ as Outlet,W as Route,b as Router,B as Routes,v as UNSAFE_LocationContext,d as UNSAFE_NavigationContext,y as UNSAFE_RouteContext,M as createRoutesFromChildren,R as generatePath,z as matchPath,T as matchRoutes,H as renderMatches,D as resolvePath,P as useHref,E as useInRouterContext,w as useLocation,I as useMatch,O as useNavigate,N as useNavigationType,j as useOutlet,C as useParams,A as useResolvedPath,J as useRoutes};
//# sourceMappingURL=react-router.production.min.js.map
/**
* React Router v6.0.0-beta.8
* React Router v6.0.0
*

@@ -113,4 +113,4 @@ * Copyright (c) Remix Software Inc.

children: children,
action: state.action,
location: state.location,
navigationType: state.action,
navigator: history$1

@@ -178,6 +178,6 @@ });

let {
action = history.Action.Pop,
basename: basenameProp = "/",
children = null,
location: locationProp,
navigationType = history.Action.Pop,
navigator,

@@ -231,4 +231,4 @@ static: staticProp = false

value: {
action,
location
location,
navigationType
}

@@ -283,5 +283,5 @@ }));

return navigator.createHref({
hash,
pathname: joinedPathname,
search
search,
hash
});

@@ -316,2 +316,12 @@ }

/**
* Returns the current navigation action which describes how the router came to
* the current location, either by a pop, push, or replace on the history stack.
*
* @see https://reactrouter.com/api/useNavigationType
*/
function useNavigationType() {
return React.useContext(LocationContext).navigationType;
}
/**
* Returns true if the URL for the given "to" value matches the current URL.

@@ -490,3 +500,3 @@ * This is useful for components that need to know "active" state, e.g.

warning(parentRoute || matches != null, "No routes matched location \"" + location.pathname + location.search + location.hash + "\" ") ;
warning(matches == null || matches[matches.length - 1].route.element != null, "Matched leaf route at location \"" + location.pathname + location.search + location.hash + "\" does not have an element. " + "This means it will render an <Outlet /> with a null value by default resulting in an \"empty\" page.") ;
warning(matches == null || matches[matches.length - 1].route.element !== undefined, "Matched leaf route at location \"" + location.pathname + location.search + location.hash + "\" does not have an element. " + "This means it will render an <Outlet /> with a null value by default resulting in an \"empty\" page.") ;
}

@@ -497,3 +507,3 @@

pathname: joinPaths([parentPathnameBase, match.pathname]),
pathnameBase: joinPaths([parentPathnameBase, match.pathnameBase])
pathnameBase: match.pathnameBase === "/" ? parentPathnameBase : joinPaths([parentPathnameBase, match.pathnameBase])
})), parentMatches);

@@ -738,3 +748,3 @@ } ///////////////////////////////////////////////////////////////////////////////

return /*#__PURE__*/React.createElement(RouteContext.Provider, {
children: match.route.element || /*#__PURE__*/React.createElement(Outlet, null),
children: match.route.element !== undefined ? match.route.element : /*#__PURE__*/React.createElement(Outlet, null),
value: {

@@ -968,2 +978,3 @@ outlet,

exports.useNavigate = useNavigate;
exports.useNavigationType = useNavigationType;
exports.useOutlet = useOutlet;

@@ -970,0 +981,0 @@ exports.useParams = useParams;

/**
* React Router v6.0.0-beta.8
* React Router v6.0.0
*

@@ -11,3 +11,3 @@ * Copyright (c) Remix Software Inc.

*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("history")):"function"==typeof define&&define.amd?define(["exports","react","history"],t):t((e=e||self).ReactRouter={},e.React,e.HistoryLibrary)}(this,(function(e,t,n){"use strict";function a(e,t){if(!e)throw new Error(t)}const r=t.createContext(null),l=t.createContext(null),i=t.createContext({outlet:null,matches:[]});function s(e){return p()}function o(e){let{action:i=n.Action.Pop,basename:s="/",children:o=null,location:c,navigator:h,static:p=!1}=e;u()&&a(!1);let f=W(s),m=t.useMemo((()=>({basename:f,navigator:h,static:p})),[f,h,p]);"string"==typeof c&&(c=n.parsePath(c));let{pathname:d="/",search:g="",hash:v="",state:x=null,key:y="default"}=c,P=t.useMemo((()=>{let e=$(d,f);return null==e?null:{pathname:e,search:g,hash:v,state:x,key:y}}),[f,d,g,v,x,y]);return null==P?null:t.createElement(r.Provider,{value:m},t.createElement(l.Provider,{children:o,value:{action:i,location:P}}))}function u(){return null!=t.useContext(l)}function c(){return u()||a(!1),t.useContext(l).location}function h(){u()||a(!1);let{basename:e,navigator:n}=t.useContext(r),{matches:l}=t.useContext(i),{pathname:s}=c(),o=JSON.stringify(l.map((e=>e.pathnameBase))),h=t.useRef(!1);return t.useEffect((()=>{h.current=!0})),t.useCallback((function(t,a){if(void 0===a&&(a={}),!h.current)return;if("number"==typeof t)return void n.go(t);let r=b(t,JSON.parse(o),s);"/"!==e&&(r.pathname=M([e,r.pathname])),(a.replace?n.replace:n.push)(r,a.state)}),[e,n,o,s])}function p(){return t.useContext(i).outlet}function f(e){let{matches:n}=t.useContext(i),{pathname:a}=c(),r=JSON.stringify(n.map((e=>e.pathnameBase)));return t.useMemo((()=>b(e,JSON.parse(r),a)),[e,r,a])}function m(e,r){u()||a(!1);let l,{matches:s}=t.useContext(i),o=s[s.length-1],h=o?o.params:{},p=(o&&o.pathname,o?o.pathnameBase:"/"),f=(o&&o.route,c());if(r){var m;let e="string"==typeof r?n.parsePath(r):r;"/"===p||(null==(m=e.pathname)?void 0:m.startsWith(p))||a(!1),l=e}else l=f;let d=l.pathname||"/",v=g(e,{pathname:"/"===p?d:d.slice(p.length)||"/"});return E(v&&v.map((e=>Object.assign({},e,{params:Object.assign({},h,e.params),pathname:M([p,e.pathname]),pathnameBase:M([p,e.pathnameBase])}))),s)}function d(e){let n=[];return t.Children.forEach(e,(e=>{if(!t.isValidElement(e))return;if(e.type===t.Fragment)return void n.push.apply(n,d(e.props.children));let a={caseSensitive:e.props.caseSensitive,element:e.props.element,index:e.props.index,path:e.props.path};e.props.children&&(a.children=d(e.props.children)),n.push(a)})),n}function g(e,t,a){void 0===a&&(a="/");let r=$(("string"==typeof t?n.parsePath(t):t).pathname||"/",a);if(null==r)return null;let l=v(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){return e.length===t.length&&e.slice(0,-1).every(((e,n)=>e===t[n]))?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(l);let i=null;for(let t=0;null==i&&t<l.length;++t)i=C(l[t],e,r);return i}function v(e,t,n,r){return void 0===t&&(t=[]),void 0===n&&(n=[]),void 0===r&&(r=""),e.forEach(((e,l)=>{let i={relativePath:e.path||"",caseSensitive:!0===e.caseSensitive,childrenIndex:l};i.relativePath.startsWith("/")&&(i.relativePath.startsWith(r)||a(!1),i.relativePath=i.relativePath.slice(r.length));let s=M([r,i.relativePath]),o=n.concat(i);e.children&&e.children.length>0&&(!0===e.index&&a(!1),v(e.children,t,o,s)),(null!=e.path||e.index)&&t.push({path:s,score:P(s,e.index),routesMeta:o})})),t}const x=/^:\w+$/,y=e=>"*"===e;function P(e,t){let n=e.split("/"),a=n.length;return n.some(y)&&(a+=-2),t&&(a+=2),n.filter((e=>!y(e))).reduce(((e,t)=>e+(x.test(t)?3:""===t?1:10)),a)}function C(e,t,n){let a=t,{routesMeta:r}=e,l={},i="/",s=[];for(let e=0;e<r.length;++e){let t=r[e],o=e===r.length-1,u="/"===i?n:n.slice(i.length)||"/",c=R({path:t.relativePath,caseSensitive:t.caseSensitive,end:o},u);if(!c)return null;Object.assign(l,c.params);let h=a[t.childrenIndex];s.push({params:l,pathname:M([i,c.pathname]),pathnameBase:M([i,c.pathnameBase]),route:h}),"/"!==c.pathnameBase&&(i=M([i,c.pathnameBase])),a=h.children}return s}function E(e,n){return void 0===n&&(n=[]),null==e?null:e.reduceRight(((a,r,l)=>t.createElement(i.Provider,{children:r.route.element||t.createElement(s,null),value:{outlet:a,matches:n.concat(e.slice(0,l+1))}})),null)}function R(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=function(e,t,n){void 0===t&&(t=!1);void 0===n&&(n=!0);let a=[],r="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/:(\w+)/g,((e,t)=>(a.push(t),"([^\\/]+)")));e.endsWith("*")?(a.push("*"),r+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r+=n?"\\/*$":"(?:\\b|$)";return[new RegExp(r,t?void 0:"i"),a]}(e.path,e.caseSensitive,e.end),r=t.match(n);if(!r)return null;let l=r[0],i=l.replace(/(.)\/+$/,"$1"),s=r.slice(1);return{params:a.reduce(((e,t,n)=>{if("*"===t){let e=s[n]||"";i=l.slice(0,l.length-e.length).replace(/(.)\/+$/,"$1")}return e[t]=function(e,t){try{return decodeURIComponent(e)}catch(t){return e}}(s[n]||""),e}),{}),pathname:l,pathnameBase:i,pattern:e}}function S(e,t){void 0===t&&(t="/");let{pathname:a,search:r="",hash:l=""}="string"==typeof e?n.parsePath(e):e,i=a?a.startsWith("/")?a:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(a,t):t;return{pathname:i,search:B(r),hash:N(l)}}function b(e,t,a){let r,l="string"==typeof e?n.parsePath(e):e,i=""===e||""===l.pathname?"/":l.pathname;if(null==i)r=a;else{let e=t.length-1;if(i.startsWith("..")){let t=i.split("/");for(;".."===t[0];)t.shift(),e-=1;l.pathname=t.join("/")}r=e>=0?t[e]:"/"}let s=S(l,r);return i&&"/"!==i&&i.endsWith("/")&&!s.pathname.endsWith("/")&&(s.pathname+="/"),s}function $(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=e.charAt(t.length);return n&&"/"!==n?null:e.slice(t.length)||"/"}const M=e=>e.join("/").replace(/\/\/+/g,"/"),W=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),B=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",N=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";e.MemoryRouter=function(e){let{basename:a,children:r,initialEntries:l,initialIndex:i}=e,s=t.useRef();null==s.current&&(s.current=n.createMemoryHistory({initialEntries:l,initialIndex:i}));let u=s.current,[c,h]=t.useState({action:u.action,location:u.location});return t.useLayoutEffect((()=>u.listen(h)),[u]),t.createElement(o,{basename:a,children:r,action:c.action,location:c.location,navigator:u})},e.Navigate=function(e){let{to:n,replace:r,state:l}=e;u()||a(!1);let i=h();return t.useEffect((()=>{i(n,{replace:r,state:l})})),null},e.Outlet=s,e.Route=function(e){a(!1)},e.Router=o,e.Routes=function(e){let{children:t,location:n}=e;return m(d(t),n)},e.UNSAFE_LocationContext=l,e.UNSAFE_NavigationContext=r,e.UNSAFE_RouteContext=i,e.createRoutesFromChildren=d,e.generatePath=function(e,t){return void 0===t&&(t={}),e.replace(/:(\w+)/g,((e,n)=>(null==t[n]&&a(!1),t[n]))).replace(/\/*\*$/,(e=>null==t["*"]?"":t["*"].replace(/^\/*/,"/")))},e.matchPath=R,e.matchRoutes=g,e.renderMatches=function(e){return E(e)},e.resolvePath=S,e.useHref=function(e){u()||a(!1);let{basename:l,navigator:i}=t.useContext(r),{hash:s,pathname:o,search:c}=f(e),h=o;if("/"!==l){let t=function(e){return""===e||""===e.pathname?"/":"string"==typeof e?n.parsePath(e).pathname:e.pathname}(e),a=null!=t&&t.endsWith("/");h="/"===o?l+(a?"/":""):M([l,o])}return i.createHref({hash:s,pathname:h,search:c})},e.useInRouterContext=u,e.useLocation=c,e.useMatch=function(e){return u()||a(!1),R(e,c().pathname)},e.useNavigate=h,e.useOutlet=p,e.useParams=function(){let{matches:e}=t.useContext(i),n=e[e.length-1];return n?n.params:{}},e.useResolvedPath=f,e.useRoutes=m,Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("history")):"function"==typeof define&&define.amd?define(["exports","react","history"],t):t((e=e||self).ReactRouter={},e.React,e.HistoryLibrary)}(this,(function(e,t,n){"use strict";function a(e,t){if(!e)throw new Error(t)}const r=t.createContext(null),i=t.createContext(null),l=t.createContext({outlet:null,matches:[]});function s(e){return p()}function o(e){let{basename:l="/",children:s=null,location:o,navigationType:c=n.Action.Pop,navigator:h,static:p=!1}=e;u()&&a(!1);let f=W(l),m=t.useMemo((()=>({basename:f,navigator:h,static:p})),[f,h,p]);"string"==typeof o&&(o=n.parsePath(o));let{pathname:d="/",search:g="",hash:v="",state:y=null,key:x="default"}=o,C=t.useMemo((()=>{let e=$(d,f);return null==e?null:{pathname:e,search:g,hash:v,state:y,key:x}}),[f,d,g,v,y,x]);return null==C?null:t.createElement(r.Provider,{value:m},t.createElement(i.Provider,{children:s,value:{location:C,navigationType:c}}))}function u(){return null!=t.useContext(i)}function c(){return u()||a(!1),t.useContext(i).location}function h(){u()||a(!1);let{basename:e,navigator:n}=t.useContext(r),{matches:i}=t.useContext(l),{pathname:s}=c(),o=JSON.stringify(i.map((e=>e.pathnameBase))),h=t.useRef(!1);return t.useEffect((()=>{h.current=!0})),t.useCallback((function(t,a){if(void 0===a&&(a={}),!h.current)return;if("number"==typeof t)return void n.go(t);let r=b(t,JSON.parse(o),s);"/"!==e&&(r.pathname=M([e,r.pathname])),(a.replace?n.replace:n.push)(r,a.state)}),[e,n,o,s])}function p(){return t.useContext(l).outlet}function f(e){let{matches:n}=t.useContext(l),{pathname:a}=c(),r=JSON.stringify(n.map((e=>e.pathnameBase)));return t.useMemo((()=>b(e,JSON.parse(r),a)),[e,r,a])}function m(e,r){u()||a(!1);let i,{matches:s}=t.useContext(l),o=s[s.length-1],h=o?o.params:{},p=(o&&o.pathname,o?o.pathnameBase:"/"),f=(o&&o.route,c());if(r){var m;let e="string"==typeof r?n.parsePath(r):r;"/"===p||(null==(m=e.pathname)?void 0:m.startsWith(p))||a(!1),i=e}else i=f;let d=i.pathname||"/",v=g(e,{pathname:"/"===p?d:d.slice(p.length)||"/"});return E(v&&v.map((e=>Object.assign({},e,{params:Object.assign({},h,e.params),pathname:M([p,e.pathname]),pathnameBase:"/"===e.pathnameBase?p:M([p,e.pathnameBase])}))),s)}function d(e){let n=[];return t.Children.forEach(e,(e=>{if(!t.isValidElement(e))return;if(e.type===t.Fragment)return void n.push.apply(n,d(e.props.children));let a={caseSensitive:e.props.caseSensitive,element:e.props.element,index:e.props.index,path:e.props.path};e.props.children&&(a.children=d(e.props.children)),n.push(a)})),n}function g(e,t,a){void 0===a&&(a="/");let r=$(("string"==typeof t?n.parsePath(t):t).pathname||"/",a);if(null==r)return null;let i=v(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){return e.length===t.length&&e.slice(0,-1).every(((e,n)=>e===t[n]))?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(i);let l=null;for(let t=0;null==l&&t<i.length;++t)l=P(i[t],e,r);return l}function v(e,t,n,r){return void 0===t&&(t=[]),void 0===n&&(n=[]),void 0===r&&(r=""),e.forEach(((e,i)=>{let l={relativePath:e.path||"",caseSensitive:!0===e.caseSensitive,childrenIndex:i};l.relativePath.startsWith("/")&&(l.relativePath.startsWith(r)||a(!1),l.relativePath=l.relativePath.slice(r.length));let s=M([r,l.relativePath]),o=n.concat(l);e.children&&e.children.length>0&&(!0===e.index&&a(!1),v(e.children,t,o,s)),(null!=e.path||e.index)&&t.push({path:s,score:C(s,e.index),routesMeta:o})})),t}const y=/^:\w+$/,x=e=>"*"===e;function C(e,t){let n=e.split("/"),a=n.length;return n.some(x)&&(a+=-2),t&&(a+=2),n.filter((e=>!x(e))).reduce(((e,t)=>e+(y.test(t)?3:""===t?1:10)),a)}function P(e,t,n){let a=t,{routesMeta:r}=e,i={},l="/",s=[];for(let e=0;e<r.length;++e){let t=r[e],o=e===r.length-1,u="/"===l?n:n.slice(l.length)||"/",c=R({path:t.relativePath,caseSensitive:t.caseSensitive,end:o},u);if(!c)return null;Object.assign(i,c.params);let h=a[t.childrenIndex];s.push({params:i,pathname:M([l,c.pathname]),pathnameBase:M([l,c.pathnameBase]),route:h}),"/"!==c.pathnameBase&&(l=M([l,c.pathnameBase])),a=h.children}return s}function E(e,n){return void 0===n&&(n=[]),null==e?null:e.reduceRight(((a,r,i)=>t.createElement(l.Provider,{children:void 0!==r.route.element?r.route.element:t.createElement(s,null),value:{outlet:a,matches:n.concat(e.slice(0,i+1))}})),null)}function R(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=function(e,t,n){void 0===t&&(t=!1);void 0===n&&(n=!0);let a=[],r="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/:(\w+)/g,((e,t)=>(a.push(t),"([^\\/]+)")));e.endsWith("*")?(a.push("*"),r+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r+=n?"\\/*$":"(?:\\b|$)";return[new RegExp(r,t?void 0:"i"),a]}(e.path,e.caseSensitive,e.end),r=t.match(n);if(!r)return null;let i=r[0],l=i.replace(/(.)\/+$/,"$1"),s=r.slice(1);return{params:a.reduce(((e,t,n)=>{if("*"===t){let e=s[n]||"";l=i.slice(0,i.length-e.length).replace(/(.)\/+$/,"$1")}return e[t]=function(e,t){try{return decodeURIComponent(e)}catch(t){return e}}(s[n]||""),e}),{}),pathname:i,pathnameBase:l,pattern:e}}function S(e,t){void 0===t&&(t="/");let{pathname:a,search:r="",hash:i=""}="string"==typeof e?n.parsePath(e):e,l=a?a.startsWith("/")?a:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(a,t):t;return{pathname:l,search:B(r),hash:N(i)}}function b(e,t,a){let r,i="string"==typeof e?n.parsePath(e):e,l=""===e||""===i.pathname?"/":i.pathname;if(null==l)r=a;else{let e=t.length-1;if(l.startsWith("..")){let t=l.split("/");for(;".."===t[0];)t.shift(),e-=1;i.pathname=t.join("/")}r=e>=0?t[e]:"/"}let s=S(i,r);return l&&"/"!==l&&l.endsWith("/")&&!s.pathname.endsWith("/")&&(s.pathname+="/"),s}function $(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=e.charAt(t.length);return n&&"/"!==n?null:e.slice(t.length)||"/"}const M=e=>e.join("/").replace(/\/\/+/g,"/"),W=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),B=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",N=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";e.MemoryRouter=function(e){let{basename:a,children:r,initialEntries:i,initialIndex:l}=e,s=t.useRef();null==s.current&&(s.current=n.createMemoryHistory({initialEntries:i,initialIndex:l}));let u=s.current,[c,h]=t.useState({action:u.action,location:u.location});return t.useLayoutEffect((()=>u.listen(h)),[u]),t.createElement(o,{basename:a,children:r,location:c.location,navigationType:c.action,navigator:u})},e.Navigate=function(e){let{to:n,replace:r,state:i}=e;u()||a(!1);let l=h();return t.useEffect((()=>{l(n,{replace:r,state:i})})),null},e.Outlet=s,e.Route=function(e){a(!1)},e.Router=o,e.Routes=function(e){let{children:t,location:n}=e;return m(d(t),n)},e.UNSAFE_LocationContext=i,e.UNSAFE_NavigationContext=r,e.UNSAFE_RouteContext=l,e.createRoutesFromChildren=d,e.generatePath=function(e,t){return void 0===t&&(t={}),e.replace(/:(\w+)/g,((e,n)=>(null==t[n]&&a(!1),t[n]))).replace(/\/*\*$/,(e=>null==t["*"]?"":t["*"].replace(/^\/*/,"/")))},e.matchPath=R,e.matchRoutes=g,e.renderMatches=function(e){return E(e)},e.resolvePath=S,e.useHref=function(e){u()||a(!1);let{basename:i,navigator:l}=t.useContext(r),{hash:s,pathname:o,search:c}=f(e),h=o;if("/"!==i){let t=function(e){return""===e||""===e.pathname?"/":"string"==typeof e?n.parsePath(e).pathname:e.pathname}(e),a=null!=t&&t.endsWith("/");h="/"===o?i+(a?"/":""):M([i,o])}return l.createHref({pathname:h,search:c,hash:s})},e.useInRouterContext=u,e.useLocation=c,e.useMatch=function(e){return u()||a(!1),R(e,c().pathname)},e.useNavigate=h,e.useNavigationType=function(){return t.useContext(i).navigationType},e.useOutlet=p,e.useParams=function(){let{matches:e}=t.useContext(l),n=e[e.length-1];return n?n.params:{}},e.useResolvedPath=f,e.useRoutes=m,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=react-router.production.min.js.map

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 not supported yet

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