From 6e109e5f44d2d056e3202d14902e060e42edb316 Mon Sep 17 00:00:00 2001 From: nobody Date: Mon, 19 Jun 2023 17:35:38 +0200 Subject: [PATCH] react-router v6.11.2 -> v6.13.0 (#1444) --- THIRD_PARTY.txt | 2 +- modules/internal/targets.js | 2 +- pages/updates/updates.html | 1 + resources/react-router/6.11.2/react-router.min.jsm | 12 ------------ resources/react-router/{6.11.2 => 6.13.0}/note | 0 resources/react-router/6.13.0/react-router.min.jsm | 12 ++++++++++++ 6 files changed, 15 insertions(+), 14 deletions(-) delete mode 100644 resources/react-router/6.11.2/react-router.min.jsm rename resources/react-router/{6.11.2 => 6.13.0}/note (100%) create mode 100644 resources/react-router/6.13.0/react-router.min.jsm diff --git a/THIRD_PARTY.txt b/THIRD_PARTY.txt index 1f0cc2d1..baebb495 100644 --- a/THIRD_PARTY.txt +++ b/THIRD_PARTY.txt @@ -1492,7 +1492,7 @@ https://cdnjs.cloudflare.com/ajax/libs/react-dom/18.2.0/umd/react-dom.production https://cdnjs.cloudflare.com/ajax/libs/react-redux/7.2.8/react-redux.min.js https://cdnjs.cloudflare.com/ajax/libs/react-redux/8.0.5/react-redux.min.js https://cdnjs.cloudflare.com/ajax/libs/react-router/5.3.3/react-router.min.js -https://cdnjs.cloudflare.com/ajax/libs/react-router/6.11.2/react-router.production.min.js +https://cdnjs.cloudflare.com/ajax/libs/react-router/6.13.0/react-router.production.min.js https://cdnjs.cloudflare.com/ajax/libs/redux/4.2.1/redux.min.js https://cdnjs.cloudflare.com/ajax/libs/rickshaw/1.7.1/rickshaw.min.css https://cdnjs.cloudflare.com/ajax/libs/rickshaw/1.7.1/rickshaw.min.js diff --git a/modules/internal/targets.js b/modules/internal/targets.js index b3f0ec62..61b4e8da 100644 --- a/modules/internal/targets.js +++ b/modules/internal/targets.js @@ -400,7 +400,7 @@ targets.setLastVersion = function (type, version) { if (type.startsWith('/react-redux/7.')) return '7.2.8'; if (type.startsWith('/react-redux/8.')) return '8.0.5'; if (type.startsWith('/react-router/5.')) return '5.3.3'; - if (type.startsWith('/react-router/6.')) return '6.11.2'; + if (type.startsWith('/react-router/6.')) return '6.13.0'; if (type.startsWith('/react-side-effect/')) return '2.1.2'; if (type.startsWith('/react-lifecycles-compat/')) return '3.0.4'; if (type.startsWith('/redux/4.')) return '4.2.1'; diff --git a/pages/updates/updates.html b/pages/updates/updates.html index a8f1e07e..4be194e2 100644 --- a/pages/updates/updates.html +++ b/pages/updates/updates.html @@ -32,6 +32,7 @@
  • gsap v3.11.5 -> v3.12.1 (#1441)
  • d3 v7.8.4 -> v7.8.5 (#1442)
  • socket.io v4.6.1 -> v4.6.2 (#1443)
  • +
  • react-router v6.11.2 -> v6.13.0 (#1444)
  • diff --git a/resources/react-router/6.11.2/react-router.min.jsm b/resources/react-router/6.11.2/react-router.min.jsm deleted file mode 100644 index 4a0aa591..00000000 --- a/resources/react-router/6.11.2/react-router.min.jsm +++ /dev/null @@ -1,12 +0,0 @@ -/** - * React Router v6.11.2 - * - * Copyright (c) Remix Software Inc. - * - * 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(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("@remix-run/router")):"function"==typeof define&&define.amd?define(["exports","react","@remix-run/router"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactRouter={},e.React,e.RemixRouter)}(this,(function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var a=n(t);function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t{r.current=!0})),a.useCallback((function(n,a){void 0===a&&(a={}),r.current&&("number"==typeof n?e.navigate(n):e.navigate(n,o({fromRouteId:t},a)))}),[e,t])}():function(){m()||r.UNSAFE_invariant(!1);let e=a.useContext(i),{basename:t,navigator:n}=a.useContext(s),{matches:o}=a.useContext(d),{pathname:u}=h(),l=JSON.stringify(r.UNSAFE_getPathContributingMatches(o).map((e=>e.pathnameBase))),c=a.useRef(!1);return f((()=>{c.current=!0})),a.useCallback((function(a,o){if(void 0===o&&(o={}),!c.current)return;if("number"==typeof a)return void n.go(a);let i=r.resolveTo(a,JSON.parse(l),u,"path"===o.relative);null==e&&"/"!==t&&(i.pathname="/"===i.pathname?t:r.joinPaths([t,i.pathname])),(o.replace?n.replace:n.push)(i,o.state,o)}),[t,n,l,u,e])}()}const g=a.createContext(null);function E(e){let t=a.useContext(d).outlet;return t?a.createElement(g.Provider,{value:e},t):t}function y(e,t){let{relative:n}=void 0===t?{}:t,{matches:o}=a.useContext(d),{pathname:i}=h(),u=JSON.stringify(r.UNSAFE_getPathContributingMatches(o).map((e=>e.pathnameBase)));return a.useMemo((()=>r.resolveTo(e,JSON.parse(u),i,"path"===n)),[e,u,i,n])}function b(e,t){return R(e,t)}function R(e,t,n){m()||r.UNSAFE_invariant(!1);let{navigator:i}=a.useContext(s),{matches:u}=a.useContext(d),l=u[u.length-1],p=l?l.params:{};!l||l.pathname;let f=l?l.pathnameBase:"/";l&&l.route;let v,g=h();if(t){var E;let e="string"==typeof t?r.parsePath(t):t;"/"===f||(null==(E=e.pathname)?void 0:E.startsWith(f))||r.UNSAFE_invariant(!1),v=e}else v=g;let y=v.pathname||"/",b="/"===f?y:y.slice(f.length)||"/",R=r.matchRoutes(e,{pathname:b}),C=S(R&&R.map((e=>Object.assign({},e,{params:Object.assign({},p,e.params),pathname:r.joinPaths([f,i.encodeLocation?i.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?f:r.joinPaths([f,i.encodeLocation?i.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),u,n);return t&&C?a.createElement(c.Provider,{value:{location:o({pathname:"/",search:"",hash:"",state:null,key:"default"},v),navigationType:r.Action.Pop}},C):C}function C(){let e=F(),t=r.isRouteErrorResponse(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return a.createElement(a.Fragment,null,a.createElement("h2",null,"Unexpected Application Error!"),a.createElement("h3",{style:{fontStyle:"italic"}},t),n?a.createElement("pre",{style:o},n):null,null)}const P=a.createElement(C,null);class x extends a.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error||t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error?a.createElement(d.Provider,{value:this.props.routeContext},a.createElement(p.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function U(e){let{routeContext:t,match:r,children:n}=e,o=a.useContext(i);return o&&o.static&&o.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=r.route.id),a.createElement(d.Provider,{value:t},n)}function S(e,t,n){var o;if(void 0===t&&(t=[]),void 0===n&&(n=null),null==e){var i;if(null==(i=n)||!i.errors)return null;e=n.matches}let u=e,l=null==(o=n)?void 0:o.errors;if(null!=l){let e=u.findIndex((e=>e.route.id&&(null==l?void 0:l[e.route.id])));e>=0||r.UNSAFE_invariant(!1),u=u.slice(0,Math.min(u.length,e+1))}return u.reduceRight(((e,r,o)=>{let i=r.route.id?null==l?void 0:l[r.route.id]:null,s=null;n&&(s=r.route.errorElement||P);let c=t.concat(u.slice(0,o+1)),d=()=>{let t;return t=i?s:r.route.Component?a.createElement(r.route.Component,null):r.route.element?r.route.element:e,a.createElement(U,{match:r,routeContext:{outlet:e,matches:c,isDataRoute:null!=n},children:t})};return n&&(r.route.ErrorBoundary||r.route.errorElement||0===o)?a.createElement(x,{location:n.location,revalidation:n.revalidation,component:s,error:i,children:d(),routeContext:{outlet:null,matches:c,isDataRoute:!0}}):d()}),null)}var N,_;function O(e){let t=a.useContext(i);return t||r.UNSAFE_invariant(!1),t}function A(e){let t=a.useContext(u);return t||r.UNSAFE_invariant(!1),t}function j(e){let t=function(e){let t=a.useContext(d);return t||r.UNSAFE_invariant(!1),t}(),n=t.matches[t.matches.length-1];return n.route.id||r.UNSAFE_invariant(!1),n.route.id}function F(){var e;let t=a.useContext(p),r=A(_.UseRouteError),n=j(_.UseRouteError);return t||(null==(e=r.errors)?void 0:e[n])}function D(){let e=a.useContext(l);return null==e?void 0:e._data}!function(e){e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate"}(N||(N={})),function(e){e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId"}(_||(_={}));let B=0;function k(e){let{routes:t,state:r}=e;return R(t,void 0,r)}function M(e){r.UNSAFE_invariant(!1)}function L(e){let{basename:t="/",children:n=null,location:o,navigationType:i=r.Action.Pop,navigator:u,static:l=!1}=e;m()&&r.UNSAFE_invariant(!1);let d=t.replace(/^\/*/,"/"),p=a.useMemo((()=>({basename:d,navigator:u,static:l})),[d,u,l]);"string"==typeof o&&(o=r.parsePath(o));let{pathname:h="/",search:f="",hash:v="",state:g=null,key:E="default"}=o,y=a.useMemo((()=>{let e=r.stripBasename(h,d);return null==e?null:{location:{pathname:e,search:f,hash:v,state:g,key:E},navigationType:i}}),[d,h,f,v,g,E,i]);return null==y?null:a.createElement(s.Provider,{value:p},a.createElement(c.Provider,{children:n,value:y}))}var I;!function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"}(I||(I={}));const T=new Promise((()=>{}));class w extends a.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error(" caught the following error during render",e,t)}render(){let{children:e,errorElement:t,resolve:n}=this.props,o=null,i=I.pending;if(n instanceof Promise)if(this.state.error){i=I.error;let e=this.state.error;o=Promise.reject().catch((()=>{})),Object.defineProperty(o,"_tracked",{get:()=>!0}),Object.defineProperty(o,"_error",{get:()=>e})}else n._tracked?(o=n,i=void 0!==o._error?I.error:void 0!==o._data?I.success:I.pending):(i=I.pending,Object.defineProperty(n,"_tracked",{get:()=>!0}),o=n.then((e=>Object.defineProperty(n,"_data",{get:()=>e})),(e=>Object.defineProperty(n,"_error",{get:()=>e}))));else i=I.success,o=Promise.resolve(),Object.defineProperty(o,"_tracked",{get:()=>!0}),Object.defineProperty(o,"_data",{get:()=>n});if(i===I.error&&o._error instanceof r.AbortedDeferredError)throw T;if(i===I.error&&!t)throw o._error;if(i===I.error)return a.createElement(l.Provider,{value:o,children:t});if(i===I.success)return a.createElement(l.Provider,{value:o,children:e});throw o}}function J(e){let{children:t}=e,r=D(),n="function"==typeof t?t(r):t;return a.createElement(a.Fragment,null,n)}function H(e,t){void 0===t&&(t=[]);let n=[];return a.Children.forEach(e,((e,o)=>{if(!a.isValidElement(e))return;let i=[...t,o];if(e.type===a.Fragment)return void n.push.apply(n,H(e.props.children,i));e.type!==M&&r.UNSAFE_invariant(!1),e.props.index&&e.props.children&&r.UNSAFE_invariant(!1);let u={id:e.props.id||i.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(u.children=H(e.props.children,i)),n.push(u)})),n}function z(e){let t={hasErrorBoundary:null!=e.ErrorBoundary||null!=e.errorElement};return e.Component&&Object.assign(t,{element:a.createElement(e.Component),Component:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:a.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}Object.defineProperty(e,"AbortedDeferredError",{enumerable:!0,get:function(){return r.AbortedDeferredError}}),Object.defineProperty(e,"NavigationType",{enumerable:!0,get:function(){return r.Action}}),Object.defineProperty(e,"createPath",{enumerable:!0,get:function(){return r.createPath}}),Object.defineProperty(e,"defer",{enumerable:!0,get:function(){return r.defer}}),Object.defineProperty(e,"generatePath",{enumerable:!0,get:function(){return r.generatePath}}),Object.defineProperty(e,"isRouteErrorResponse",{enumerable:!0,get:function(){return r.isRouteErrorResponse}}),Object.defineProperty(e,"json",{enumerable:!0,get:function(){return r.json}}),Object.defineProperty(e,"matchPath",{enumerable:!0,get:function(){return r.matchPath}}),Object.defineProperty(e,"matchRoutes",{enumerable:!0,get:function(){return r.matchRoutes}}),Object.defineProperty(e,"parsePath",{enumerable:!0,get:function(){return r.parsePath}}),Object.defineProperty(e,"redirect",{enumerable:!0,get:function(){return r.redirect}}),Object.defineProperty(e,"resolvePath",{enumerable:!0,get:function(){return r.resolvePath}}),e.Await=function(e){let{children:t,errorElement:r,resolve:n}=e;return a.createElement(w,{resolve:n,errorElement:r},a.createElement(J,null,t))},e.MemoryRouter=function(e){let{basename:t,children:n,initialEntries:o,initialIndex:i}=e,u=a.useRef();null==u.current&&(u.current=r.createMemoryHistory({initialEntries:o,initialIndex:i,v5Compat:!0}));let l=u.current,[s,c]=a.useState({action:l.action,location:l.location});return a.useLayoutEffect((()=>l.listen(c)),[l]),a.createElement(L,{basename:t,children:n,location:s.location,navigationType:s.action,navigator:l})},e.Navigate=function(e){let{to:t,replace:n,state:o,relative:i}=e;m()||r.UNSAFE_invariant(!1);let{matches:u}=a.useContext(d),{pathname:l}=h(),s=v(),c=r.resolveTo(t,r.UNSAFE_getPathContributingMatches(u).map((e=>e.pathnameBase)),l,"path"===i),p=JSON.stringify(c);return a.useEffect((()=>s(JSON.parse(p),{replace:n,state:o,relative:i})),[s,p,i,n,o]),null},e.Outlet=function(e){return E(e.context)},e.Route=M,e.Router=L,e.RouterProvider=function(e){let{fallbackElement:t,router:r}=e,[n,o]=a.useState(r.state);a.useLayoutEffect((()=>r.subscribe(o)),[r,o]);let l=a.useMemo((()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:e=>r.navigate(e),push:(e,t,n)=>r.navigate(e,{state:t,preventScrollReset:null==n?void 0:n.preventScrollReset}),replace:(e,t,n)=>r.navigate(e,{replace:!0,state:t,preventScrollReset:null==n?void 0:n.preventScrollReset})})),[r]),s=r.basename||"/",c=a.useMemo((()=>({router:r,navigator:l,static:!1,basename:s})),[r,l,s]);return a.createElement(a.Fragment,null,a.createElement(i.Provider,{value:c},a.createElement(u.Provider,{value:n},a.createElement(L,{basename:r.basename,location:r.state.location,navigationType:r.state.historyAction,navigator:l},r.state.initialized?a.createElement(k,{routes:r.routes,state:n}):t))),null)},e.Routes=function(e){let{children:t,location:r}=e;return b(H(t),r)},e.UNSAFE_DataRouterContext=i,e.UNSAFE_DataRouterStateContext=u,e.UNSAFE_LocationContext=c,e.UNSAFE_NavigationContext=s,e.UNSAFE_RouteContext=d,e.UNSAFE_mapRouteProperties=z,e.UNSAFE_useRouteId=function(){return j(_.UseRouteId)},e.UNSAFE_useRoutesImpl=R,e.createMemoryRouter=function(e,t){return r.createRouter({basename:null==t?void 0:t.basename,future:o({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:r.createMemoryHistory({initialEntries:null==t?void 0:t.initialEntries,initialIndex:null==t?void 0:t.initialIndex}),hydrationData:null==t?void 0:t.hydrationData,routes:e,mapRouteProperties:z}).initialize()},e.createRoutesFromChildren=H,e.createRoutesFromElements=H,e.renderMatches=function(e){return S(e)},e.unstable_useBlocker=function(e){let{router:t}=O(N.UseBlocker),r=A(_.UseBlocker),[n]=a.useState((()=>String(++B))),o=a.useCallback((t=>"function"==typeof e?!!e(t):!!e),[e]),i=t.getBlocker(n,o);return a.useEffect((()=>()=>t.deleteBlocker(n)),[t,n]),r.blockers.get(n)||i},e.useActionData=function(){let e=A(_.UseActionData);return a.useContext(d)||r.UNSAFE_invariant(!1),Object.values((null==e?void 0:e.actionData)||{})[0]},e.useAsyncError=function(){let e=a.useContext(l);return null==e?void 0:e._error},e.useAsyncValue=D,e.useHref=function(e,t){let{relative:n}=void 0===t?{}:t;m()||r.UNSAFE_invariant(!1);let{basename:o,navigator:i}=a.useContext(s),{hash:u,pathname:l,search:c}=y(e,{relative:n}),d=l;return"/"!==o&&(d="/"===l?o:r.joinPaths([o,l])),i.createHref({pathname:d,search:c,hash:u})},e.useInRouterContext=m,e.useLoaderData=function(){let e=A(_.UseLoaderData),t=j(_.UseLoaderData);if(!e.errors||null==e.errors[t])return e.loaderData[t];console.error("You cannot `useLoaderData` in an errorElement (routeId: "+t+")")},e.useLocation=h,e.useMatch=function(e){m()||r.UNSAFE_invariant(!1);let{pathname:t}=h();return a.useMemo((()=>r.matchPath(e,t)),[t,e])},e.useMatches=function(){let{matches:e,loaderData:t}=A(_.UseMatches);return a.useMemo((()=>e.map((e=>{let{pathname:r,params:n}=e;return{id:e.route.id,pathname:r,params:n,data:t[e.route.id],handle:e.route.handle}}))),[e,t])},e.useNavigate=v,e.useNavigation=function(){return A(_.UseNavigation).navigation},e.useNavigationType=function(){return a.useContext(c).navigationType},e.useOutlet=E,e.useOutletContext=function(){return a.useContext(g)},e.useParams=function(){let{matches:e}=a.useContext(d),t=e[e.length-1];return t?t.params:{}},e.useResolvedPath=y,e.useRevalidator=function(){let e=O(N.UseRevalidator),t=A(_.UseRevalidator);return{revalidate:e.router.revalidate,state:t.revalidation}},e.useRouteError=F,e.useRouteLoaderData=function(e){return A(_.UseRouteLoaderData).loaderData[e]},e.useRoutes=b,Object.defineProperty(e,"__esModule",{value:!0})})); -//# sourceMappingURL=react-router.production.min.js.map diff --git a/resources/react-router/6.11.2/note b/resources/react-router/6.13.0/note similarity index 100% rename from resources/react-router/6.11.2/note rename to resources/react-router/6.13.0/note diff --git a/resources/react-router/6.13.0/react-router.min.jsm b/resources/react-router/6.13.0/react-router.min.jsm new file mode 100644 index 00000000..0db8b00d --- /dev/null +++ b/resources/react-router/6.13.0/react-router.min.jsm @@ -0,0 +1,12 @@ +/** + * React Router v6.13.0 + * + * Copyright (c) Remix Software Inc. + * + * 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(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("@remix-run/router")):"function"==typeof define&&define.amd?define(["exports","react","@remix-run/router"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactRouter={},e.React,e.RemixRouter)}(this,(function(e,t,r){"use strict";function n(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var a=n(t);function o(){return o=Object.assign?Object.assign.bind():function(e){for(var t=1;t{r.current=!0})),a.useCallback((function(n,a){void 0===a&&(a={}),r.current&&("number"==typeof n?e.navigate(n):e.navigate(n,o({fromRouteId:t},a)))}),[e,t])}():function(){h()||r.UNSAFE_invariant(!1);let e=a.useContext(u),{basename:t,navigator:n}=a.useContext(c),{matches:o}=a.useContext(p),{pathname:i}=f(),l=JSON.stringify(r.UNSAFE_getPathContributingMatches(o).map((e=>e.pathnameBase))),s=a.useRef(!1);return v((()=>{s.current=!0})),a.useCallback((function(a,o){if(void 0===o&&(o={}),!s.current)return;if("number"==typeof a)return void n.go(a);let u=r.resolveTo(a,JSON.parse(l),i,"path"===o.relative);null==e&&"/"!==t&&(u.pathname="/"===u.pathname?t:r.joinPaths([t,u.pathname])),(o.replace?n.replace:n.push)(u,o.state,o)}),[t,n,l,i,e])}()}const E=a.createContext(null);function y(e){let t=a.useContext(p).outlet;return t?a.createElement(E.Provider,{value:e},t):t}function b(e,t){let{relative:n}=void 0===t?{}:t,{matches:o}=a.useContext(p),{pathname:i}=f(),u=JSON.stringify(r.UNSAFE_getPathContributingMatches(o).map((e=>e.pathnameBase)));return a.useMemo((()=>r.resolveTo(e,JSON.parse(u),i,"path"===n)),[e,u,i,n])}function R(e,t){return C(e,t)}function C(e,t,n){h()||r.UNSAFE_invariant(!1);let{navigator:i}=a.useContext(c),{matches:u}=a.useContext(p),l=u[u.length-1],s=l?l.params:{};!l||l.pathname;let m=l?l.pathnameBase:"/";l&&l.route;let v,g=f();if(t){var E;let e="string"==typeof t?r.parsePath(t):t;"/"===m||(null==(E=e.pathname)?void 0:E.startsWith(m))||r.UNSAFE_invariant(!1),v=e}else v=g;let y=v.pathname||"/",b="/"===m?y:y.slice(m.length)||"/",R=r.matchRoutes(e,{pathname:b}),C=_(R&&R.map((e=>Object.assign({},e,{params:Object.assign({},s,e.params),pathname:r.joinPaths([m,i.encodeLocation?i.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?m:r.joinPaths([m,i.encodeLocation?i.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),u,n);return t&&C?a.createElement(d.Provider,{value:{location:o({pathname:"/",search:"",hash:"",state:null,key:"default"},v),navigationType:r.Action.Pop}},C):C}function P(){let e=D(),t=r.isRouteErrorResponse(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return a.createElement(a.Fragment,null,a.createElement("h2",null,"Unexpected Application Error!"),a.createElement("h3",{style:{fontStyle:"italic"}},t),n?a.createElement("pre",{style:o},n):null,null)}const x=a.createElement(P,null);class U extends a.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error||t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error?a.createElement(p.Provider,{value:this.props.routeContext},a.createElement(m.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function S(e){let{routeContext:t,match:r,children:n}=e,o=a.useContext(u);return o&&o.static&&o.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=r.route.id),a.createElement(p.Provider,{value:t},n)}function _(e,t,n){var o;if(void 0===t&&(t=[]),void 0===n&&(n=null),null==e){var i;if(null==(i=n)||!i.errors)return null;e=n.matches}let u=e,l=null==(o=n)?void 0:o.errors;if(null!=l){let e=u.findIndex((e=>e.route.id&&(null==l?void 0:l[e.route.id])));e>=0||r.UNSAFE_invariant(!1),u=u.slice(0,Math.min(u.length,e+1))}return u.reduceRight(((e,r,o)=>{let i=r.route.id?null==l?void 0:l[r.route.id]:null,s=null;n&&(s=r.route.errorElement||x);let c=t.concat(u.slice(0,o+1)),d=()=>{let t;return t=i?s:r.route.Component?a.createElement(r.route.Component,null):r.route.element?r.route.element:e,a.createElement(S,{match:r,routeContext:{outlet:e,matches:c,isDataRoute:null!=n},children:t})};return n&&(r.route.ErrorBoundary||r.route.errorElement||0===o)?a.createElement(U,{location:n.location,revalidation:n.revalidation,component:s,error:i,children:d(),routeContext:{outlet:null,matches:c,isDataRoute:!0}}):d()}),null)}var N,A;function O(e){let t=a.useContext(u);return t||r.UNSAFE_invariant(!1),t}function j(e){let t=a.useContext(l);return t||r.UNSAFE_invariant(!1),t}function F(e){let t=function(e){let t=a.useContext(p);return t||r.UNSAFE_invariant(!1),t}(),n=t.matches[t.matches.length-1];return n.route.id||r.UNSAFE_invariant(!1),n.route.id}function D(){var e;let t=a.useContext(m),r=j(A.UseRouteError),n=F(A.UseRouteError);return t||(null==(e=r.errors)?void 0:e[n])}function B(){let e=a.useContext(s);return null==e?void 0:e._data}!function(e){e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate"}(N||(N={})),function(e){e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId"}(A||(A={}));let k=0;function M(e){let{routes:t,state:r}=e;return C(t,void 0,r)}function L(e){r.UNSAFE_invariant(!1)}function T(e){let{basename:t="/",children:n=null,location:o,navigationType:i=r.Action.Pop,navigator:u,static:l=!1}=e;h()&&r.UNSAFE_invariant(!1);let s=t.replace(/^\/*/,"/"),p=a.useMemo((()=>({basename:s,navigator:u,static:l})),[s,u,l]);"string"==typeof o&&(o=r.parsePath(o));let{pathname:m="/",search:f="",hash:v="",state:g=null,key:E="default"}=o,y=a.useMemo((()=>{let e=r.stripBasename(m,s);return null==e?null:{location:{pathname:e,search:f,hash:v,state:g,key:E},navigationType:i}}),[s,m,f,v,g,E,i]);return null==y?null:a.createElement(c.Provider,{value:p},a.createElement(d.Provider,{children:n,value:y}))}var I;!function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"}(I||(I={}));const w=new Promise((()=>{}));class J extends a.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error(" caught the following error during render",e,t)}render(){let{children:e,errorElement:t,resolve:n}=this.props,o=null,i=I.pending;if(n instanceof Promise)if(this.state.error){i=I.error;let e=this.state.error;o=Promise.reject().catch((()=>{})),Object.defineProperty(o,"_tracked",{get:()=>!0}),Object.defineProperty(o,"_error",{get:()=>e})}else n._tracked?(o=n,i=void 0!==o._error?I.error:void 0!==o._data?I.success:I.pending):(i=I.pending,Object.defineProperty(n,"_tracked",{get:()=>!0}),o=n.then((e=>Object.defineProperty(n,"_data",{get:()=>e})),(e=>Object.defineProperty(n,"_error",{get:()=>e}))));else i=I.success,o=Promise.resolve(),Object.defineProperty(o,"_tracked",{get:()=>!0}),Object.defineProperty(o,"_data",{get:()=>n});if(i===I.error&&o._error instanceof r.AbortedDeferredError)throw w;if(i===I.error&&!t)throw o._error;if(i===I.error)return a.createElement(s.Provider,{value:o,children:t});if(i===I.success)return a.createElement(s.Provider,{value:o,children:e});throw o}}function H(e){let{children:t}=e,r=B(),n="function"==typeof t?t(r):t;return a.createElement(a.Fragment,null,n)}function z(e,t){void 0===t&&(t=[]);let n=[];return a.Children.forEach(e,((e,o)=>{if(!a.isValidElement(e))return;let i=[...t,o];if(e.type===a.Fragment)return void n.push.apply(n,z(e.props.children,i));e.type!==L&&r.UNSAFE_invariant(!1),e.props.index&&e.props.children&&r.UNSAFE_invariant(!1);let u={id:e.props.id||i.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(u.children=z(e.props.children,i)),n.push(u)})),n}function q(e){let t={hasErrorBoundary:null!=e.ErrorBoundary||null!=e.errorElement};return e.Component&&Object.assign(t,{element:a.createElement(e.Component),Component:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:a.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}Object.defineProperty(e,"AbortedDeferredError",{enumerable:!0,get:function(){return r.AbortedDeferredError}}),Object.defineProperty(e,"NavigationType",{enumerable:!0,get:function(){return r.Action}}),Object.defineProperty(e,"createPath",{enumerable:!0,get:function(){return r.createPath}}),Object.defineProperty(e,"defer",{enumerable:!0,get:function(){return r.defer}}),Object.defineProperty(e,"generatePath",{enumerable:!0,get:function(){return r.generatePath}}),Object.defineProperty(e,"isRouteErrorResponse",{enumerable:!0,get:function(){return r.isRouteErrorResponse}}),Object.defineProperty(e,"json",{enumerable:!0,get:function(){return r.json}}),Object.defineProperty(e,"matchPath",{enumerable:!0,get:function(){return r.matchPath}}),Object.defineProperty(e,"matchRoutes",{enumerable:!0,get:function(){return r.matchRoutes}}),Object.defineProperty(e,"parsePath",{enumerable:!0,get:function(){return r.parsePath}}),Object.defineProperty(e,"redirect",{enumerable:!0,get:function(){return r.redirect}}),Object.defineProperty(e,"resolvePath",{enumerable:!0,get:function(){return r.resolvePath}}),e.Await=function(e){let{children:t,errorElement:r,resolve:n}=e;return a.createElement(J,{resolve:n,errorElement:r},a.createElement(H,null,t))},e.MemoryRouter=function(e){let{basename:t,children:n,initialEntries:o,initialIndex:u,future:l}=e,s=a.useRef();null==s.current&&(s.current=r.createMemoryHistory({initialEntries:o,initialIndex:u,v5Compat:!0}));let c=s.current,[d,p]=a.useState({action:c.action,location:c.location}),{v7_startTransition:m}=l||{},h=a.useCallback((e=>{m&&i?i((()=>p(e))):p(e)}),[p,m]);return a.useLayoutEffect((()=>c.listen(h)),[c,h]),a.createElement(T,{basename:t,children:n,location:d.location,navigationType:d.action,navigator:c})},e.Navigate=function(e){let{to:t,replace:n,state:o,relative:i}=e;h()||r.UNSAFE_invariant(!1);let{matches:u}=a.useContext(p),{pathname:l}=f(),s=g(),c=r.resolveTo(t,r.UNSAFE_getPathContributingMatches(u).map((e=>e.pathnameBase)),l,"path"===i),d=JSON.stringify(c);return a.useEffect((()=>s(JSON.parse(d),{replace:n,state:o,relative:i})),[s,d,i,n,o]),null},e.Outlet=function(e){return y(e.context)},e.Route=L,e.Router=T,e.RouterProvider=function(e){let{fallbackElement:t,router:r,future:n}=e,[o,s]=a.useState(r.state),{v7_startTransition:c}=n||{},d=a.useCallback((e=>{c&&i?i((()=>s(e))):s(e)}),[s,c]);a.useLayoutEffect((()=>r.subscribe(d)),[r,d]);let p=a.useMemo((()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:e=>r.navigate(e),push:(e,t,n)=>r.navigate(e,{state:t,preventScrollReset:null==n?void 0:n.preventScrollReset}),replace:(e,t,n)=>r.navigate(e,{replace:!0,state:t,preventScrollReset:null==n?void 0:n.preventScrollReset})})),[r]),m=r.basename||"/",h=a.useMemo((()=>({router:r,navigator:p,static:!1,basename:m})),[r,p,m]);return a.createElement(a.Fragment,null,a.createElement(u.Provider,{value:h},a.createElement(l.Provider,{value:o},a.createElement(T,{basename:m,location:o.location,navigationType:o.historyAction,navigator:p},o.initialized?a.createElement(M,{routes:r.routes,state:o}):t))),null)},e.Routes=function(e){let{children:t,location:r}=e;return R(z(t),r)},e.UNSAFE_DataRouterContext=u,e.UNSAFE_DataRouterStateContext=l,e.UNSAFE_LocationContext=d,e.UNSAFE_NavigationContext=c,e.UNSAFE_RouteContext=p,e.UNSAFE_mapRouteProperties=q,e.UNSAFE_startTransitionImpl=i,e.UNSAFE_useRouteId=function(){return F(A.UseRouteId)},e.UNSAFE_useRoutesImpl=C,e.createMemoryRouter=function(e,t){return r.createRouter({basename:null==t?void 0:t.basename,future:o({},null==t?void 0:t.future,{v7_prependBasename:!0}),history:r.createMemoryHistory({initialEntries:null==t?void 0:t.initialEntries,initialIndex:null==t?void 0:t.initialIndex}),hydrationData:null==t?void 0:t.hydrationData,routes:e,mapRouteProperties:q}).initialize()},e.createRoutesFromChildren=z,e.createRoutesFromElements=z,e.renderMatches=function(e){return _(e)},e.unstable_useBlocker=function(e){let{router:t}=O(N.UseBlocker),r=j(A.UseBlocker),[n]=a.useState((()=>String(++k))),o=a.useCallback((t=>"function"==typeof e?!!e(t):!!e),[e]),i=t.getBlocker(n,o);return a.useEffect((()=>()=>t.deleteBlocker(n)),[t,n]),r.blockers.get(n)||i},e.useActionData=function(){let e=j(A.UseActionData);return a.useContext(p)||r.UNSAFE_invariant(!1),Object.values((null==e?void 0:e.actionData)||{})[0]},e.useAsyncError=function(){let e=a.useContext(s);return null==e?void 0:e._error},e.useAsyncValue=B,e.useHref=function(e,t){let{relative:n}=void 0===t?{}:t;h()||r.UNSAFE_invariant(!1);let{basename:o,navigator:i}=a.useContext(c),{hash:u,pathname:l,search:s}=b(e,{relative:n}),d=l;return"/"!==o&&(d="/"===l?o:r.joinPaths([o,l])),i.createHref({pathname:d,search:s,hash:u})},e.useInRouterContext=h,e.useLoaderData=function(){let e=j(A.UseLoaderData),t=F(A.UseLoaderData);if(!e.errors||null==e.errors[t])return e.loaderData[t];console.error("You cannot `useLoaderData` in an errorElement (routeId: "+t+")")},e.useLocation=f,e.useMatch=function(e){h()||r.UNSAFE_invariant(!1);let{pathname:t}=f();return a.useMemo((()=>r.matchPath(e,t)),[t,e])},e.useMatches=function(){let{matches:e,loaderData:t}=j(A.UseMatches);return a.useMemo((()=>e.map((e=>{let{pathname:r,params:n}=e;return{id:e.route.id,pathname:r,params:n,data:t[e.route.id],handle:e.route.handle}}))),[e,t])},e.useNavigate=g,e.useNavigation=function(){return j(A.UseNavigation).navigation},e.useNavigationType=function(){return a.useContext(d).navigationType},e.useOutlet=y,e.useOutletContext=function(){return a.useContext(E)},e.useParams=function(){let{matches:e}=a.useContext(p),t=e[e.length-1];return t?t.params:{}},e.useResolvedPath=b,e.useRevalidator=function(){let e=O(N.UseRevalidator),t=j(A.UseRevalidator);return{revalidate:e.router.revalidate,state:t.revalidation}},e.useRouteError=D,e.useRouteLoaderData=function(e){return j(A.UseRouteLoaderData).loaderData[e]},e.useRoutes=R,Object.defineProperty(e,"__esModule",{value:!0})})); +//# sourceMappingURL=react-router.production.min.js.map