react-router 7.8.2-pre.1 → 7.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -10
- package/dist/development/{chunk-7QFLQWWN.mjs → chunk-5UALIXAM.mjs} +2 -2
- package/dist/development/{chunk-IVOVRAK2.js → chunk-CSDGKXLR.js} +131 -131
- package/dist/development/{chunk-ZVD2KUIM.mjs → chunk-PVWAREVJ.mjs} +2 -2
- package/dist/development/{chunk-ZVMYUFGA.js → chunk-ZO66TDGB.js} +1 -1
- package/dist/development/dom-export.js +3 -3
- package/dist/development/dom-export.mjs +3 -3
- package/dist/development/index-react-server-client.js +4 -4
- package/dist/development/index-react-server-client.mjs +2 -2
- package/dist/development/index-react-server.js +1 -1
- package/dist/development/index-react-server.mjs +1 -1
- package/dist/development/index.js +95 -95
- package/dist/development/index.mjs +3 -3
- package/dist/development/lib/types/internal.js +1 -1
- package/dist/development/lib/types/internal.mjs +1 -1
- package/dist/production/{chunk-IK7IYG3O.js → chunk-JNT5PWCQ.js} +131 -131
- package/dist/production/{chunk-LR4OTIMG.mjs → chunk-KWHRV2I7.mjs} +2 -2
- package/dist/production/{chunk-VHBXOG2Z.mjs → chunk-REDRD2MB.mjs} +2 -2
- package/dist/production/{chunk-5WPGWA23.js → chunk-Z56HUDN5.js} +1 -1
- package/dist/production/dom-export.js +3 -3
- package/dist/production/dom-export.mjs +3 -3
- package/dist/production/index-react-server-client.js +4 -4
- package/dist/production/index-react-server-client.mjs +2 -2
- package/dist/production/index-react-server.js +1 -1
- package/dist/production/index-react-server.mjs +1 -1
- package/dist/production/index.js +95 -95
- package/dist/production/index.mjs +3 -3
- package/dist/production/lib/types/internal.js +1 -1
- package/dist/production/lib/types/internal.mjs +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }/**
|
|
2
|
-
* react-router v7.8.2
|
|
2
|
+
* react-router v7.8.2
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
|
|
62
62
|
|
|
63
63
|
|
|
64
|
-
var
|
|
64
|
+
var _chunkZO66TDGBjs = require('./chunk-ZO66TDGB.js');
|
|
65
65
|
|
|
66
66
|
// lib/components.tsx
|
|
67
67
|
var _react = require('react'); var React = _interopRequireWildcard(_react); var React2 = _interopRequireWildcard(_react); var React3 = _interopRequireWildcard(_react);
|
|
@@ -72,9 +72,9 @@ function mapRouteProperties(route) {
|
|
|
72
72
|
hasErrorBoundary: route.hasErrorBoundary || route.ErrorBoundary != null || route.errorElement != null
|
|
73
73
|
};
|
|
74
74
|
if (route.Component) {
|
|
75
|
-
if (
|
|
75
|
+
if (_chunkZO66TDGBjs.ENABLE_DEV_WARNINGS) {
|
|
76
76
|
if (route.element) {
|
|
77
|
-
|
|
77
|
+
_chunkZO66TDGBjs.warning.call(void 0,
|
|
78
78
|
false,
|
|
79
79
|
"You should not include both `Component` and `element` on your route - `Component` will be used."
|
|
80
80
|
);
|
|
@@ -86,9 +86,9 @@ function mapRouteProperties(route) {
|
|
|
86
86
|
});
|
|
87
87
|
}
|
|
88
88
|
if (route.HydrateFallback) {
|
|
89
|
-
if (
|
|
89
|
+
if (_chunkZO66TDGBjs.ENABLE_DEV_WARNINGS) {
|
|
90
90
|
if (route.hydrateFallbackElement) {
|
|
91
|
-
|
|
91
|
+
_chunkZO66TDGBjs.warning.call(void 0,
|
|
92
92
|
false,
|
|
93
93
|
"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."
|
|
94
94
|
);
|
|
@@ -100,9 +100,9 @@ function mapRouteProperties(route) {
|
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
102
|
if (route.ErrorBoundary) {
|
|
103
|
-
if (
|
|
103
|
+
if (_chunkZO66TDGBjs.ENABLE_DEV_WARNINGS) {
|
|
104
104
|
if (route.errorElement) {
|
|
105
|
-
|
|
105
|
+
_chunkZO66TDGBjs.warning.call(void 0,
|
|
106
106
|
false,
|
|
107
107
|
"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."
|
|
108
108
|
);
|
|
@@ -120,11 +120,11 @@ var hydrationRouteProperties = [
|
|
|
120
120
|
"hydrateFallbackElement"
|
|
121
121
|
];
|
|
122
122
|
function createMemoryRouter(routes, opts) {
|
|
123
|
-
return
|
|
123
|
+
return _chunkZO66TDGBjs.createRouter.call(void 0, {
|
|
124
124
|
basename: _optionalChain([opts, 'optionalAccess', _2 => _2.basename]),
|
|
125
125
|
unstable_getContext: _optionalChain([opts, 'optionalAccess', _3 => _3.unstable_getContext]),
|
|
126
126
|
future: _optionalChain([opts, 'optionalAccess', _4 => _4.future]),
|
|
127
|
-
history:
|
|
127
|
+
history: _chunkZO66TDGBjs.createMemoryHistory.call(void 0, {
|
|
128
128
|
initialEntries: _optionalChain([opts, 'optionalAccess', _5 => _5.initialEntries]),
|
|
129
129
|
initialIndex: _optionalChain([opts, 'optionalAccess', _6 => _6.initialIndex])
|
|
130
130
|
}),
|
|
@@ -192,12 +192,12 @@ function RouterProvider({
|
|
|
192
192
|
}
|
|
193
193
|
});
|
|
194
194
|
deletedFetchers.forEach((key) => fetcherData.current.delete(key));
|
|
195
|
-
|
|
195
|
+
_chunkZO66TDGBjs.warnOnce.call(void 0,
|
|
196
196
|
flushSync === false || reactDomFlushSyncImpl != null,
|
|
197
197
|
'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.'
|
|
198
198
|
);
|
|
199
199
|
let isViewTransitionAvailable = router.window != null && router.window.document != null && typeof router.window.document.startViewTransition === "function";
|
|
200
|
-
|
|
200
|
+
_chunkZO66TDGBjs.warnOnce.call(void 0,
|
|
201
201
|
viewTransitionOpts == null || isViewTransitionAvailable,
|
|
202
202
|
"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."
|
|
203
203
|
);
|
|
@@ -329,7 +329,7 @@ function RouterProvider({
|
|
|
329
329
|
}),
|
|
330
330
|
[router, navigator, basename, unstable_onError]
|
|
331
331
|
);
|
|
332
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
|
332
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(_chunkZO66TDGBjs.DataRouterContext.Provider, { value: dataRouterContext }, /* @__PURE__ */ React.createElement(_chunkZO66TDGBjs.DataRouterStateContext.Provider, { value: state }, /* @__PURE__ */ React.createElement(_chunkZO66TDGBjs.FetchersContext.Provider, { value: fetcherData.current }, /* @__PURE__ */ React.createElement(_chunkZO66TDGBjs.ViewTransitionContext.Provider, { value: vtContext }, /* @__PURE__ */ React.createElement(
|
|
333
333
|
Router,
|
|
334
334
|
{
|
|
335
335
|
basename,
|
|
@@ -355,7 +355,7 @@ function DataRoutes({
|
|
|
355
355
|
state,
|
|
356
356
|
unstable_onError
|
|
357
357
|
}) {
|
|
358
|
-
return
|
|
358
|
+
return _chunkZO66TDGBjs.useRoutesImpl.call(void 0, routes, void 0, state, unstable_onError, future);
|
|
359
359
|
}
|
|
360
360
|
function MemoryRouter({
|
|
361
361
|
basename,
|
|
@@ -365,7 +365,7 @@ function MemoryRouter({
|
|
|
365
365
|
}) {
|
|
366
366
|
let historyRef = React.useRef();
|
|
367
367
|
if (historyRef.current == null) {
|
|
368
|
-
historyRef.current =
|
|
368
|
+
historyRef.current = _chunkZO66TDGBjs.createMemoryHistory.call(void 0, {
|
|
369
369
|
initialEntries,
|
|
370
370
|
initialIndex,
|
|
371
371
|
v5Compat: true
|
|
@@ -400,23 +400,23 @@ function Navigate({
|
|
|
400
400
|
state,
|
|
401
401
|
relative
|
|
402
402
|
}) {
|
|
403
|
-
|
|
404
|
-
|
|
403
|
+
_chunkZO66TDGBjs.invariant.call(void 0,
|
|
404
|
+
_chunkZO66TDGBjs.useInRouterContext.call(void 0, ),
|
|
405
405
|
// TODO: This error is probably because they somehow have 2 versions of
|
|
406
406
|
// the router loaded. We can help them understand how to avoid that.
|
|
407
407
|
`<Navigate> may be used only in the context of a <Router> component.`
|
|
408
408
|
);
|
|
409
|
-
let { static: isStatic } = React.useContext(
|
|
410
|
-
|
|
409
|
+
let { static: isStatic } = React.useContext(_chunkZO66TDGBjs.NavigationContext);
|
|
410
|
+
_chunkZO66TDGBjs.warning.call(void 0,
|
|
411
411
|
!isStatic,
|
|
412
412
|
`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`
|
|
413
413
|
);
|
|
414
|
-
let { matches } = React.useContext(
|
|
415
|
-
let { pathname: locationPathname } =
|
|
416
|
-
let navigate =
|
|
417
|
-
let path =
|
|
414
|
+
let { matches } = React.useContext(_chunkZO66TDGBjs.RouteContext);
|
|
415
|
+
let { pathname: locationPathname } = _chunkZO66TDGBjs.useLocation.call(void 0, );
|
|
416
|
+
let navigate = _chunkZO66TDGBjs.useNavigate.call(void 0, );
|
|
417
|
+
let path = _chunkZO66TDGBjs.resolveTo.call(void 0,
|
|
418
418
|
to,
|
|
419
|
-
|
|
419
|
+
_chunkZO66TDGBjs.getResolveToMatches.call(void 0, matches),
|
|
420
420
|
locationPathname,
|
|
421
421
|
relative === "path"
|
|
422
422
|
);
|
|
@@ -427,10 +427,10 @@ function Navigate({
|
|
|
427
427
|
return null;
|
|
428
428
|
}
|
|
429
429
|
function Outlet(props) {
|
|
430
|
-
return
|
|
430
|
+
return _chunkZO66TDGBjs.useOutlet.call(void 0, props.context);
|
|
431
431
|
}
|
|
432
432
|
function Route(props) {
|
|
433
|
-
|
|
433
|
+
_chunkZO66TDGBjs.invariant.call(void 0,
|
|
434
434
|
false,
|
|
435
435
|
`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`
|
|
436
436
|
);
|
|
@@ -443,8 +443,8 @@ function Router({
|
|
|
443
443
|
navigator,
|
|
444
444
|
static: staticProp = false
|
|
445
445
|
}) {
|
|
446
|
-
|
|
447
|
-
!
|
|
446
|
+
_chunkZO66TDGBjs.invariant.call(void 0,
|
|
447
|
+
!_chunkZO66TDGBjs.useInRouterContext.call(void 0, ),
|
|
448
448
|
`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`
|
|
449
449
|
);
|
|
450
450
|
let basename = basenameProp.replace(/^\/*/, "/");
|
|
@@ -458,7 +458,7 @@ function Router({
|
|
|
458
458
|
[basename, navigator, staticProp]
|
|
459
459
|
);
|
|
460
460
|
if (typeof locationProp === "string") {
|
|
461
|
-
locationProp =
|
|
461
|
+
locationProp = _chunkZO66TDGBjs.parsePath.call(void 0, locationProp);
|
|
462
462
|
}
|
|
463
463
|
let {
|
|
464
464
|
pathname = "/",
|
|
@@ -468,7 +468,7 @@ function Router({
|
|
|
468
468
|
key = "default"
|
|
469
469
|
} = locationProp;
|
|
470
470
|
let locationContext = React.useMemo(() => {
|
|
471
|
-
let trailingPathname =
|
|
471
|
+
let trailingPathname = _chunkZO66TDGBjs.stripBasename.call(void 0, pathname, basename);
|
|
472
472
|
if (trailingPathname == null) {
|
|
473
473
|
return null;
|
|
474
474
|
}
|
|
@@ -483,27 +483,27 @@ function Router({
|
|
|
483
483
|
navigationType
|
|
484
484
|
};
|
|
485
485
|
}, [basename, pathname, search, hash, state, key, navigationType]);
|
|
486
|
-
|
|
486
|
+
_chunkZO66TDGBjs.warning.call(void 0,
|
|
487
487
|
locationContext != null,
|
|
488
488
|
`<Router basename="${basename}"> is not able to match the URL "${pathname}${search}${hash}" because it does not start with the basename, so the <Router> won't render anything.`
|
|
489
489
|
);
|
|
490
490
|
if (locationContext == null) {
|
|
491
491
|
return null;
|
|
492
492
|
}
|
|
493
|
-
return /* @__PURE__ */ React.createElement(
|
|
493
|
+
return /* @__PURE__ */ React.createElement(_chunkZO66TDGBjs.NavigationContext.Provider, { value: navigationContext }, /* @__PURE__ */ React.createElement(_chunkZO66TDGBjs.LocationContext.Provider, { children, value: locationContext }));
|
|
494
494
|
}
|
|
495
495
|
function Routes({
|
|
496
496
|
children,
|
|
497
497
|
location
|
|
498
498
|
}) {
|
|
499
|
-
return
|
|
499
|
+
return _chunkZO66TDGBjs.useRoutes.call(void 0, createRoutesFromChildren(children), location);
|
|
500
500
|
}
|
|
501
501
|
function Await({
|
|
502
502
|
children,
|
|
503
503
|
errorElement,
|
|
504
504
|
resolve
|
|
505
505
|
}) {
|
|
506
|
-
let dataRouterContext = React.useContext(
|
|
506
|
+
let dataRouterContext = React.useContext(_chunkZO66TDGBjs.DataRouterContext);
|
|
507
507
|
return /* @__PURE__ */ React.createElement(
|
|
508
508
|
AwaitErrorBoundary,
|
|
509
509
|
{
|
|
@@ -567,10 +567,10 @@ var AwaitErrorBoundary = class extends React.Component {
|
|
|
567
567
|
throw promise._error;
|
|
568
568
|
}
|
|
569
569
|
if (status === 2 /* error */) {
|
|
570
|
-
return /* @__PURE__ */ React.createElement(
|
|
570
|
+
return /* @__PURE__ */ React.createElement(_chunkZO66TDGBjs.AwaitContext.Provider, { value: promise, children: errorElement });
|
|
571
571
|
}
|
|
572
572
|
if (status === 1 /* success */) {
|
|
573
|
-
return /* @__PURE__ */ React.createElement(
|
|
573
|
+
return /* @__PURE__ */ React.createElement(_chunkZO66TDGBjs.AwaitContext.Provider, { value: promise, children });
|
|
574
574
|
}
|
|
575
575
|
throw promise;
|
|
576
576
|
}
|
|
@@ -578,7 +578,7 @@ var AwaitErrorBoundary = class extends React.Component {
|
|
|
578
578
|
function ResolveAwait({
|
|
579
579
|
children
|
|
580
580
|
}) {
|
|
581
|
-
let data =
|
|
581
|
+
let data = _chunkZO66TDGBjs.useAsyncValue.call(void 0, );
|
|
582
582
|
let toRender = typeof children === "function" ? children(data) : children;
|
|
583
583
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, toRender);
|
|
584
584
|
}
|
|
@@ -596,11 +596,11 @@ function createRoutesFromChildren(children, parentPath = []) {
|
|
|
596
596
|
);
|
|
597
597
|
return;
|
|
598
598
|
}
|
|
599
|
-
|
|
599
|
+
_chunkZO66TDGBjs.invariant.call(void 0,
|
|
600
600
|
element.type === Route,
|
|
601
601
|
`[${typeof element.type === "string" ? element.type : element.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`
|
|
602
602
|
);
|
|
603
|
-
|
|
603
|
+
_chunkZO66TDGBjs.invariant.call(void 0,
|
|
604
604
|
!element.props.index || !element.props.children,
|
|
605
605
|
"An index route cannot have child routes."
|
|
606
606
|
);
|
|
@@ -634,14 +634,14 @@ function createRoutesFromChildren(children, parentPath = []) {
|
|
|
634
634
|
}
|
|
635
635
|
var createRoutesFromElements = createRoutesFromChildren;
|
|
636
636
|
function renderMatches(matches) {
|
|
637
|
-
return
|
|
637
|
+
return _chunkZO66TDGBjs._renderMatches.call(void 0, matches);
|
|
638
638
|
}
|
|
639
639
|
function useRouteComponentProps() {
|
|
640
640
|
return {
|
|
641
|
-
params:
|
|
642
|
-
loaderData:
|
|
643
|
-
actionData:
|
|
644
|
-
matches:
|
|
641
|
+
params: _chunkZO66TDGBjs.useParams.call(void 0, ),
|
|
642
|
+
loaderData: _chunkZO66TDGBjs.useLoaderData.call(void 0, ),
|
|
643
|
+
actionData: _chunkZO66TDGBjs.useActionData.call(void 0, ),
|
|
644
|
+
matches: _chunkZO66TDGBjs.useMatches.call(void 0, )
|
|
645
645
|
};
|
|
646
646
|
}
|
|
647
647
|
function WithComponentProps({
|
|
@@ -658,9 +658,9 @@ function withComponentProps(Component2) {
|
|
|
658
658
|
}
|
|
659
659
|
function useHydrateFallbackProps() {
|
|
660
660
|
return {
|
|
661
|
-
params:
|
|
662
|
-
loaderData:
|
|
663
|
-
actionData:
|
|
661
|
+
params: _chunkZO66TDGBjs.useParams.call(void 0, ),
|
|
662
|
+
loaderData: _chunkZO66TDGBjs.useLoaderData.call(void 0, ),
|
|
663
|
+
actionData: _chunkZO66TDGBjs.useActionData.call(void 0, )
|
|
664
664
|
};
|
|
665
665
|
}
|
|
666
666
|
function WithHydrateFallbackProps({
|
|
@@ -677,10 +677,10 @@ function withHydrateFallbackProps(HydrateFallback) {
|
|
|
677
677
|
}
|
|
678
678
|
function useErrorBoundaryProps() {
|
|
679
679
|
return {
|
|
680
|
-
params:
|
|
681
|
-
loaderData:
|
|
682
|
-
actionData:
|
|
683
|
-
error:
|
|
680
|
+
params: _chunkZO66TDGBjs.useParams.call(void 0, ),
|
|
681
|
+
loaderData: _chunkZO66TDGBjs.useLoaderData.call(void 0, ),
|
|
682
|
+
actionData: _chunkZO66TDGBjs.useActionData.call(void 0, ),
|
|
683
|
+
error: _chunkZO66TDGBjs.useRouteError.call(void 0, )
|
|
684
684
|
};
|
|
685
685
|
}
|
|
686
686
|
function WithErrorBoundaryProps({
|
|
@@ -765,7 +765,7 @@ var supportedFormEncTypes = /* @__PURE__ */ new Set([
|
|
|
765
765
|
]);
|
|
766
766
|
function getFormEncType(encType) {
|
|
767
767
|
if (encType != null && !supportedFormEncTypes.has(encType)) {
|
|
768
|
-
|
|
768
|
+
_chunkZO66TDGBjs.warning.call(void 0,
|
|
769
769
|
false,
|
|
770
770
|
`"${encType}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${defaultEncType}"`
|
|
771
771
|
);
|
|
@@ -781,7 +781,7 @@ function getFormSubmissionInfo(target, basename) {
|
|
|
781
781
|
let body;
|
|
782
782
|
if (isFormElement(target)) {
|
|
783
783
|
let attr = target.getAttribute("action");
|
|
784
|
-
action = attr ?
|
|
784
|
+
action = attr ? _chunkZO66TDGBjs.stripBasename.call(void 0, attr, basename) : null;
|
|
785
785
|
method = target.getAttribute("method") || defaultMethod;
|
|
786
786
|
encType = getFormEncType(target.getAttribute("enctype")) || defaultEncType;
|
|
787
787
|
formData = new FormData(target);
|
|
@@ -793,7 +793,7 @@ function getFormSubmissionInfo(target, basename) {
|
|
|
793
793
|
);
|
|
794
794
|
}
|
|
795
795
|
let attr = target.getAttribute("formaction") || form.getAttribute("action");
|
|
796
|
-
action = attr ?
|
|
796
|
+
action = attr ? _chunkZO66TDGBjs.stripBasename.call(void 0, attr, basename) : null;
|
|
797
797
|
method = target.getAttribute("formmethod") || form.getAttribute("method") || defaultMethod;
|
|
798
798
|
encType = getFormEncType(target.getAttribute("formenctype")) || getFormEncType(form.getAttribute("enctype")) || defaultEncType;
|
|
799
799
|
formData = new FormData(form, target);
|
|
@@ -830,16 +830,16 @@ var isBrowser = typeof window !== "undefined" && typeof window.document !== "und
|
|
|
830
830
|
try {
|
|
831
831
|
if (isBrowser) {
|
|
832
832
|
window.__reactRouterVersion = // @ts-expect-error
|
|
833
|
-
"7.8.2
|
|
833
|
+
"7.8.2";
|
|
834
834
|
}
|
|
835
835
|
} catch (e) {
|
|
836
836
|
}
|
|
837
837
|
function createBrowserRouter(routes, opts) {
|
|
838
|
-
return
|
|
838
|
+
return _chunkZO66TDGBjs.createRouter.call(void 0, {
|
|
839
839
|
basename: _optionalChain([opts, 'optionalAccess', _18 => _18.basename]),
|
|
840
840
|
unstable_getContext: _optionalChain([opts, 'optionalAccess', _19 => _19.unstable_getContext]),
|
|
841
841
|
future: _optionalChain([opts, 'optionalAccess', _20 => _20.future]),
|
|
842
|
-
history:
|
|
842
|
+
history: _chunkZO66TDGBjs.createBrowserHistory.call(void 0, { window: _optionalChain([opts, 'optionalAccess', _21 => _21.window]) }),
|
|
843
843
|
hydrationData: _optionalChain([opts, 'optionalAccess', _22 => _22.hydrationData]) || parseHydrationData(),
|
|
844
844
|
routes,
|
|
845
845
|
mapRouteProperties,
|
|
@@ -850,11 +850,11 @@ function createBrowserRouter(routes, opts) {
|
|
|
850
850
|
}).initialize();
|
|
851
851
|
}
|
|
852
852
|
function createHashRouter(routes, opts) {
|
|
853
|
-
return
|
|
853
|
+
return _chunkZO66TDGBjs.createRouter.call(void 0, {
|
|
854
854
|
basename: _optionalChain([opts, 'optionalAccess', _26 => _26.basename]),
|
|
855
855
|
unstable_getContext: _optionalChain([opts, 'optionalAccess', _27 => _27.unstable_getContext]),
|
|
856
856
|
future: _optionalChain([opts, 'optionalAccess', _28 => _28.future]),
|
|
857
|
-
history:
|
|
857
|
+
history: _chunkZO66TDGBjs.createHashHistory.call(void 0, { window: _optionalChain([opts, 'optionalAccess', _29 => _29.window]) }),
|
|
858
858
|
hydrationData: _optionalChain([opts, 'optionalAccess', _30 => _30.hydrationData]) || parseHydrationData(),
|
|
859
859
|
routes,
|
|
860
860
|
mapRouteProperties,
|
|
@@ -880,7 +880,7 @@ function deserializeErrors(errors) {
|
|
|
880
880
|
let serialized = {};
|
|
881
881
|
for (let [key, val] of entries) {
|
|
882
882
|
if (val && val.__type === "RouteErrorResponse") {
|
|
883
|
-
serialized[key] = new (0,
|
|
883
|
+
serialized[key] = new (0, _chunkZO66TDGBjs.ErrorResponseImpl)(
|
|
884
884
|
val.status,
|
|
885
885
|
val.statusText,
|
|
886
886
|
val.data,
|
|
@@ -916,7 +916,7 @@ function BrowserRouter({
|
|
|
916
916
|
}) {
|
|
917
917
|
let historyRef = React2.useRef();
|
|
918
918
|
if (historyRef.current == null) {
|
|
919
|
-
historyRef.current =
|
|
919
|
+
historyRef.current = _chunkZO66TDGBjs.createBrowserHistory.call(void 0, { window: window2, v5Compat: true });
|
|
920
920
|
}
|
|
921
921
|
let history = historyRef.current;
|
|
922
922
|
let [state, setStateImpl] = React2.useState({
|
|
@@ -944,7 +944,7 @@ function BrowserRouter({
|
|
|
944
944
|
function HashRouter({ basename, children, window: window2 }) {
|
|
945
945
|
let historyRef = React2.useRef();
|
|
946
946
|
if (historyRef.current == null) {
|
|
947
|
-
historyRef.current =
|
|
947
|
+
historyRef.current = _chunkZO66TDGBjs.createHashHistory.call(void 0, { window: window2, v5Compat: true });
|
|
948
948
|
}
|
|
949
949
|
let history = historyRef.current;
|
|
950
950
|
let [state, setStateImpl] = React2.useState({
|
|
@@ -1013,7 +1013,7 @@ var Link = React2.forwardRef(
|
|
|
1013
1013
|
viewTransition,
|
|
1014
1014
|
...rest
|
|
1015
1015
|
}, forwardedRef) {
|
|
1016
|
-
let { basename } = React2.useContext(
|
|
1016
|
+
let { basename } = React2.useContext(_chunkZO66TDGBjs.NavigationContext);
|
|
1017
1017
|
let isAbsolute = typeof to === "string" && ABSOLUTE_URL_REGEX.test(to);
|
|
1018
1018
|
let absoluteHref;
|
|
1019
1019
|
let isExternal = false;
|
|
@@ -1023,22 +1023,22 @@ var Link = React2.forwardRef(
|
|
|
1023
1023
|
try {
|
|
1024
1024
|
let currentUrl = new URL(window.location.href);
|
|
1025
1025
|
let targetUrl = to.startsWith("//") ? new URL(currentUrl.protocol + to) : new URL(to);
|
|
1026
|
-
let path =
|
|
1026
|
+
let path = _chunkZO66TDGBjs.stripBasename.call(void 0, targetUrl.pathname, basename);
|
|
1027
1027
|
if (targetUrl.origin === currentUrl.origin && path != null) {
|
|
1028
1028
|
to = path + targetUrl.search + targetUrl.hash;
|
|
1029
1029
|
} else {
|
|
1030
1030
|
isExternal = true;
|
|
1031
1031
|
}
|
|
1032
1032
|
} catch (e) {
|
|
1033
|
-
|
|
1033
|
+
_chunkZO66TDGBjs.warning.call(void 0,
|
|
1034
1034
|
false,
|
|
1035
1035
|
`<Link to="${to}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`
|
|
1036
1036
|
);
|
|
1037
1037
|
}
|
|
1038
1038
|
}
|
|
1039
1039
|
}
|
|
1040
|
-
let href =
|
|
1041
|
-
let [shouldPrefetch, prefetchRef, prefetchHandlers] =
|
|
1040
|
+
let href = _chunkZO66TDGBjs.useHref.call(void 0, to, { relative });
|
|
1041
|
+
let [shouldPrefetch, prefetchRef, prefetchHandlers] = _chunkZO66TDGBjs.usePrefetchBehavior.call(void 0,
|
|
1042
1042
|
prefetch,
|
|
1043
1043
|
rest
|
|
1044
1044
|
);
|
|
@@ -1065,13 +1065,13 @@ var Link = React2.forwardRef(
|
|
|
1065
1065
|
...prefetchHandlers,
|
|
1066
1066
|
href: absoluteHref || href,
|
|
1067
1067
|
onClick: isExternal || reloadDocument ? onClick : handleClick,
|
|
1068
|
-
ref:
|
|
1068
|
+
ref: _chunkZO66TDGBjs.mergeRefs.call(void 0, forwardedRef, prefetchRef),
|
|
1069
1069
|
target,
|
|
1070
1070
|
"data-discover": !isAbsolute && discover === "render" ? "true" : void 0
|
|
1071
1071
|
}
|
|
1072
1072
|
)
|
|
1073
1073
|
);
|
|
1074
|
-
return shouldPrefetch && !isAbsolute ? /* @__PURE__ */ React2.createElement(React2.Fragment, null, link, /* @__PURE__ */ React2.createElement(
|
|
1074
|
+
return shouldPrefetch && !isAbsolute ? /* @__PURE__ */ React2.createElement(React2.Fragment, null, link, /* @__PURE__ */ React2.createElement(_chunkZO66TDGBjs.PrefetchPageLinks, { page: href })) : link;
|
|
1075
1075
|
}
|
|
1076
1076
|
);
|
|
1077
1077
|
Link.displayName = "Link";
|
|
@@ -1087,10 +1087,10 @@ var NavLink = React2.forwardRef(
|
|
|
1087
1087
|
children,
|
|
1088
1088
|
...rest
|
|
1089
1089
|
}, ref) {
|
|
1090
|
-
let path =
|
|
1091
|
-
let location =
|
|
1092
|
-
let routerState = React2.useContext(
|
|
1093
|
-
let { navigator, basename } = React2.useContext(
|
|
1090
|
+
let path = _chunkZO66TDGBjs.useResolvedPath.call(void 0, to, { relative: rest.relative });
|
|
1091
|
+
let location = _chunkZO66TDGBjs.useLocation.call(void 0, );
|
|
1092
|
+
let routerState = React2.useContext(_chunkZO66TDGBjs.DataRouterStateContext);
|
|
1093
|
+
let { navigator, basename } = React2.useContext(_chunkZO66TDGBjs.NavigationContext);
|
|
1094
1094
|
let isTransitioning = routerState != null && // Conditional usage is OK here because the usage of a data router is static
|
|
1095
1095
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
1096
1096
|
useViewTransitionState(path) && viewTransition === true;
|
|
@@ -1103,7 +1103,7 @@ var NavLink = React2.forwardRef(
|
|
|
1103
1103
|
toPathname = toPathname.toLowerCase();
|
|
1104
1104
|
}
|
|
1105
1105
|
if (nextLocationPathname && basename) {
|
|
1106
|
-
nextLocationPathname =
|
|
1106
|
+
nextLocationPathname = _chunkZO66TDGBjs.stripBasename.call(void 0, nextLocationPathname, basename) || nextLocationPathname;
|
|
1107
1107
|
}
|
|
1108
1108
|
const endSlashPosition = toPathname !== "/" && toPathname.endsWith("/") ? toPathname.length - 1 : toPathname.length;
|
|
1109
1109
|
let isActive = locationPathname === toPathname || !end && locationPathname.startsWith(toPathname) && locationPathname.charAt(endSlashPosition) === "/";
|
|
@@ -1198,10 +1198,10 @@ function ScrollRestoration({
|
|
|
1198
1198
|
storageKey,
|
|
1199
1199
|
...props
|
|
1200
1200
|
}) {
|
|
1201
|
-
let remixContext = React2.useContext(
|
|
1202
|
-
let { basename } = React2.useContext(
|
|
1203
|
-
let location =
|
|
1204
|
-
let matches =
|
|
1201
|
+
let remixContext = React2.useContext(_chunkZO66TDGBjs.FrameworkContext);
|
|
1202
|
+
let { basename } = React2.useContext(_chunkZO66TDGBjs.NavigationContext);
|
|
1203
|
+
let location = _chunkZO66TDGBjs.useLocation.call(void 0, );
|
|
1204
|
+
let matches = _chunkZO66TDGBjs.useMatches.call(void 0, );
|
|
1205
1205
|
useScrollRestoration({ getKey, storageKey });
|
|
1206
1206
|
let ssrKey = React2.useMemo(
|
|
1207
1207
|
() => {
|
|
@@ -1255,13 +1255,13 @@ function getDataRouterConsoleError(hookName) {
|
|
|
1255
1255
|
return `${hookName} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
|
|
1256
1256
|
}
|
|
1257
1257
|
function useDataRouterContext(hookName) {
|
|
1258
|
-
let ctx = React2.useContext(
|
|
1259
|
-
|
|
1258
|
+
let ctx = React2.useContext(_chunkZO66TDGBjs.DataRouterContext);
|
|
1259
|
+
_chunkZO66TDGBjs.invariant.call(void 0, ctx, getDataRouterConsoleError(hookName));
|
|
1260
1260
|
return ctx;
|
|
1261
1261
|
}
|
|
1262
1262
|
function useDataRouterState(hookName) {
|
|
1263
|
-
let state = React2.useContext(
|
|
1264
|
-
|
|
1263
|
+
let state = React2.useContext(_chunkZO66TDGBjs.DataRouterStateContext);
|
|
1264
|
+
_chunkZO66TDGBjs.invariant.call(void 0, state, getDataRouterConsoleError(hookName));
|
|
1265
1265
|
return state;
|
|
1266
1266
|
}
|
|
1267
1267
|
function useLinkClickHandler(to, {
|
|
@@ -1272,14 +1272,14 @@ function useLinkClickHandler(to, {
|
|
|
1272
1272
|
relative,
|
|
1273
1273
|
viewTransition
|
|
1274
1274
|
} = {}) {
|
|
1275
|
-
let navigate =
|
|
1276
|
-
let location =
|
|
1277
|
-
let path =
|
|
1275
|
+
let navigate = _chunkZO66TDGBjs.useNavigate.call(void 0, );
|
|
1276
|
+
let location = _chunkZO66TDGBjs.useLocation.call(void 0, );
|
|
1277
|
+
let path = _chunkZO66TDGBjs.useResolvedPath.call(void 0, to, { relative });
|
|
1278
1278
|
return React2.useCallback(
|
|
1279
1279
|
(event) => {
|
|
1280
1280
|
if (shouldProcessLinkClick(event, target)) {
|
|
1281
1281
|
event.preventDefault();
|
|
1282
|
-
let replace = replaceProp !== void 0 ? replaceProp :
|
|
1282
|
+
let replace = replaceProp !== void 0 ? replaceProp : _chunkZO66TDGBjs.createPath.call(void 0, location) === _chunkZO66TDGBjs.createPath.call(void 0, path);
|
|
1283
1283
|
navigate(to, {
|
|
1284
1284
|
replace,
|
|
1285
1285
|
state,
|
|
@@ -1304,13 +1304,13 @@ function useLinkClickHandler(to, {
|
|
|
1304
1304
|
);
|
|
1305
1305
|
}
|
|
1306
1306
|
function useSearchParams(defaultInit) {
|
|
1307
|
-
|
|
1307
|
+
_chunkZO66TDGBjs.warning.call(void 0,
|
|
1308
1308
|
typeof URLSearchParams !== "undefined",
|
|
1309
1309
|
`You cannot use the \`useSearchParams\` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.`
|
|
1310
1310
|
);
|
|
1311
1311
|
let defaultSearchParamsRef = React2.useRef(createSearchParams(defaultInit));
|
|
1312
1312
|
let hasSetSearchParamsRef = React2.useRef(false);
|
|
1313
|
-
let location =
|
|
1313
|
+
let location = _chunkZO66TDGBjs.useLocation.call(void 0, );
|
|
1314
1314
|
let searchParams = React2.useMemo(
|
|
1315
1315
|
() => (
|
|
1316
1316
|
// Only merge in the defaults if we haven't yet called setSearchParams.
|
|
@@ -1323,7 +1323,7 @@ function useSearchParams(defaultInit) {
|
|
|
1323
1323
|
),
|
|
1324
1324
|
[location.search]
|
|
1325
1325
|
);
|
|
1326
|
-
let navigate =
|
|
1326
|
+
let navigate = _chunkZO66TDGBjs.useNavigate.call(void 0, );
|
|
1327
1327
|
let setSearchParams = React2.useCallback(
|
|
1328
1328
|
(nextInit, navigateOptions) => {
|
|
1329
1329
|
const newSearchParams = createSearchParams(
|
|
@@ -1340,8 +1340,8 @@ var fetcherId = 0;
|
|
|
1340
1340
|
var getUniqueFetcherId = () => `__${String(++fetcherId)}__`;
|
|
1341
1341
|
function useSubmit() {
|
|
1342
1342
|
let { router } = useDataRouterContext("useSubmit" /* UseSubmit */);
|
|
1343
|
-
let { basename } = React2.useContext(
|
|
1344
|
-
let currentRouteId =
|
|
1343
|
+
let { basename } = React2.useContext(_chunkZO66TDGBjs.NavigationContext);
|
|
1344
|
+
let currentRouteId = _chunkZO66TDGBjs.useRouteId.call(void 0, );
|
|
1345
1345
|
return React2.useCallback(
|
|
1346
1346
|
async (target, options = {}) => {
|
|
1347
1347
|
let { action, method, encType, formData, body } = getFormSubmissionInfo(
|
|
@@ -1377,12 +1377,12 @@ function useSubmit() {
|
|
|
1377
1377
|
);
|
|
1378
1378
|
}
|
|
1379
1379
|
function useFormAction(action, { relative } = {}) {
|
|
1380
|
-
let { basename } = React2.useContext(
|
|
1381
|
-
let routeContext = React2.useContext(
|
|
1382
|
-
|
|
1380
|
+
let { basename } = React2.useContext(_chunkZO66TDGBjs.NavigationContext);
|
|
1381
|
+
let routeContext = React2.useContext(_chunkZO66TDGBjs.RouteContext);
|
|
1382
|
+
_chunkZO66TDGBjs.invariant.call(void 0, routeContext, "useFormAction must be used inside a RouteContext");
|
|
1383
1383
|
let [match] = routeContext.matches.slice(-1);
|
|
1384
|
-
let path = { ...
|
|
1385
|
-
let location =
|
|
1384
|
+
let path = { ..._chunkZO66TDGBjs.useResolvedPath.call(void 0, action ? action : ".", { relative }) };
|
|
1385
|
+
let location = _chunkZO66TDGBjs.useLocation.call(void 0, );
|
|
1386
1386
|
if (action == null) {
|
|
1387
1387
|
path.search = location.search;
|
|
1388
1388
|
let params = new URLSearchParams(path.search);
|
|
@@ -1399,21 +1399,21 @@ function useFormAction(action, { relative } = {}) {
|
|
|
1399
1399
|
path.search = path.search ? path.search.replace(/^\?/, "?index&") : "?index";
|
|
1400
1400
|
}
|
|
1401
1401
|
if (basename !== "/") {
|
|
1402
|
-
path.pathname = path.pathname === "/" ? basename :
|
|
1402
|
+
path.pathname = path.pathname === "/" ? basename : _chunkZO66TDGBjs.joinPaths.call(void 0, [basename, path.pathname]);
|
|
1403
1403
|
}
|
|
1404
|
-
return
|
|
1404
|
+
return _chunkZO66TDGBjs.createPath.call(void 0, path);
|
|
1405
1405
|
}
|
|
1406
1406
|
function useFetcher({
|
|
1407
1407
|
key
|
|
1408
1408
|
} = {}) {
|
|
1409
1409
|
let { router } = useDataRouterContext("useFetcher" /* UseFetcher */);
|
|
1410
1410
|
let state = useDataRouterState("useFetcher" /* UseFetcher */);
|
|
1411
|
-
let fetcherData = React2.useContext(
|
|
1412
|
-
let route = React2.useContext(
|
|
1411
|
+
let fetcherData = React2.useContext(_chunkZO66TDGBjs.FetchersContext);
|
|
1412
|
+
let route = React2.useContext(_chunkZO66TDGBjs.RouteContext);
|
|
1413
1413
|
let routeId = _optionalChain([route, 'access', _37 => _37.matches, 'access', _38 => _38[route.matches.length - 1], 'optionalAccess', _39 => _39.route, 'access', _40 => _40.id]);
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1414
|
+
_chunkZO66TDGBjs.invariant.call(void 0, fetcherData, `useFetcher must be used inside a FetchersContext`);
|
|
1415
|
+
_chunkZO66TDGBjs.invariant.call(void 0, route, `useFetcher must be used inside a RouteContext`);
|
|
1416
|
+
_chunkZO66TDGBjs.invariant.call(void 0,
|
|
1417
1417
|
routeId != null,
|
|
1418
1418
|
`useFetcher can only be used on routes that contain a unique "id"`
|
|
1419
1419
|
);
|
|
@@ -1428,7 +1428,7 @@ function useFetcher({
|
|
|
1428
1428
|
}, [router, fetcherKey]);
|
|
1429
1429
|
let load = React2.useCallback(
|
|
1430
1430
|
async (href, opts) => {
|
|
1431
|
-
|
|
1431
|
+
_chunkZO66TDGBjs.invariant.call(void 0, routeId, "No routeId available for fetcher.load()");
|
|
1432
1432
|
await router.fetch(fetcherKey, routeId, href, opts);
|
|
1433
1433
|
},
|
|
1434
1434
|
[fetcherKey, routeId, router]
|
|
@@ -1453,7 +1453,7 @@ function useFetcher({
|
|
|
1453
1453
|
FetcherForm2.displayName = "fetcher.Form";
|
|
1454
1454
|
return FetcherForm2;
|
|
1455
1455
|
}, [fetcherKey]);
|
|
1456
|
-
let fetcher = state.fetchers.get(fetcherKey) ||
|
|
1456
|
+
let fetcher = state.fetchers.get(fetcherKey) || _chunkZO66TDGBjs.IDLE_FETCHER;
|
|
1457
1457
|
let data = fetcherData.get(fetcherKey);
|
|
1458
1458
|
let fetcherWithComponents = React2.useMemo(
|
|
1459
1459
|
() => ({
|
|
@@ -1483,7 +1483,7 @@ function getScrollRestorationKey(location, matches, basename, getKey) {
|
|
|
1483
1483
|
key = getKey(
|
|
1484
1484
|
{
|
|
1485
1485
|
...location,
|
|
1486
|
-
pathname:
|
|
1486
|
+
pathname: _chunkZO66TDGBjs.stripBasename.call(void 0, location.pathname, basename) || location.pathname
|
|
1487
1487
|
},
|
|
1488
1488
|
matches
|
|
1489
1489
|
);
|
|
@@ -1504,10 +1504,10 @@ function useScrollRestoration({
|
|
|
1504
1504
|
let { restoreScrollPosition, preventScrollReset } = useDataRouterState(
|
|
1505
1505
|
"useScrollRestoration" /* UseScrollRestoration */
|
|
1506
1506
|
);
|
|
1507
|
-
let { basename } = React2.useContext(
|
|
1508
|
-
let location =
|
|
1509
|
-
let matches =
|
|
1510
|
-
let navigation =
|
|
1507
|
+
let { basename } = React2.useContext(_chunkZO66TDGBjs.NavigationContext);
|
|
1508
|
+
let location = _chunkZO66TDGBjs.useLocation.call(void 0, );
|
|
1509
|
+
let matches = _chunkZO66TDGBjs.useMatches.call(void 0, );
|
|
1510
|
+
let navigation = _chunkZO66TDGBjs.useNavigation.call(void 0, );
|
|
1511
1511
|
React2.useEffect(() => {
|
|
1512
1512
|
window.history.scrollRestoration = "manual";
|
|
1513
1513
|
return () => {
|
|
@@ -1526,7 +1526,7 @@ function useScrollRestoration({
|
|
|
1526
1526
|
JSON.stringify(savedScrollPositions)
|
|
1527
1527
|
);
|
|
1528
1528
|
} catch (error) {
|
|
1529
|
-
|
|
1529
|
+
_chunkZO66TDGBjs.warning.call(void 0,
|
|
1530
1530
|
false,
|
|
1531
1531
|
`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${error}).`
|
|
1532
1532
|
);
|
|
@@ -1573,7 +1573,7 @@ function useScrollRestoration({
|
|
|
1573
1573
|
}
|
|
1574
1574
|
}
|
|
1575
1575
|
} catch (e2) {
|
|
1576
|
-
|
|
1576
|
+
_chunkZO66TDGBjs.warning.call(void 0,
|
|
1577
1577
|
false,
|
|
1578
1578
|
`"${location.hash.slice(
|
|
1579
1579
|
1
|
|
@@ -1611,7 +1611,7 @@ function usePrompt({
|
|
|
1611
1611
|
when,
|
|
1612
1612
|
message
|
|
1613
1613
|
}) {
|
|
1614
|
-
let blocker =
|
|
1614
|
+
let blocker = _chunkZO66TDGBjs.useBlocker.call(void 0, when);
|
|
1615
1615
|
React2.useEffect(() => {
|
|
1616
1616
|
if (blocker.state === "blocked") {
|
|
1617
1617
|
let proceed = window.confirm(message);
|
|
@@ -1629,21 +1629,21 @@ function usePrompt({
|
|
|
1629
1629
|
}, [blocker, when]);
|
|
1630
1630
|
}
|
|
1631
1631
|
function useViewTransitionState(to, { relative } = {}) {
|
|
1632
|
-
let vtContext = React2.useContext(
|
|
1633
|
-
|
|
1632
|
+
let vtContext = React2.useContext(_chunkZO66TDGBjs.ViewTransitionContext);
|
|
1633
|
+
_chunkZO66TDGBjs.invariant.call(void 0,
|
|
1634
1634
|
vtContext != null,
|
|
1635
1635
|
"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"
|
|
1636
1636
|
);
|
|
1637
1637
|
let { basename } = useDataRouterContext(
|
|
1638
1638
|
"useViewTransitionState" /* useViewTransitionState */
|
|
1639
1639
|
);
|
|
1640
|
-
let path =
|
|
1640
|
+
let path = _chunkZO66TDGBjs.useResolvedPath.call(void 0, to, { relative });
|
|
1641
1641
|
if (!vtContext.isTransitioning) {
|
|
1642
1642
|
return false;
|
|
1643
1643
|
}
|
|
1644
|
-
let currentPath =
|
|
1645
|
-
let nextPath =
|
|
1646
|
-
return
|
|
1644
|
+
let currentPath = _chunkZO66TDGBjs.stripBasename.call(void 0, vtContext.currentLocation.pathname, basename) || vtContext.currentLocation.pathname;
|
|
1645
|
+
let nextPath = _chunkZO66TDGBjs.stripBasename.call(void 0, vtContext.nextLocation.pathname, basename) || vtContext.nextLocation.pathname;
|
|
1646
|
+
return _chunkZO66TDGBjs.matchPath.call(void 0, path.pathname, nextPath) != null || _chunkZO66TDGBjs.matchPath.call(void 0, path.pathname, currentPath) != null;
|
|
1647
1647
|
}
|
|
1648
1648
|
|
|
1649
1649
|
// lib/dom/server.tsx
|
|
@@ -1654,7 +1654,7 @@ function StaticRouter({
|
|
|
1654
1654
|
location: locationProp = "/"
|
|
1655
1655
|
}) {
|
|
1656
1656
|
if (typeof locationProp === "string") {
|
|
1657
|
-
locationProp =
|
|
1657
|
+
locationProp = _chunkZO66TDGBjs.parsePath.call(void 0, locationProp);
|
|
1658
1658
|
}
|
|
1659
1659
|
let action = "POP" /* Pop */;
|
|
1660
1660
|
let location = {
|
|
@@ -1683,7 +1683,7 @@ function StaticRouterProvider({
|
|
|
1683
1683
|
hydrate = true,
|
|
1684
1684
|
nonce
|
|
1685
1685
|
}) {
|
|
1686
|
-
|
|
1686
|
+
_chunkZO66TDGBjs.invariant.call(void 0,
|
|
1687
1687
|
router && context,
|
|
1688
1688
|
"You must provide `router` and `context` to <StaticRouterProvider>"
|
|
1689
1689
|
);
|
|
@@ -1706,7 +1706,7 @@ function StaticRouterProvider({
|
|
|
1706
1706
|
hydrateScript = `window.__staticRouterHydrationData = JSON.parse(${json});`;
|
|
1707
1707
|
}
|
|
1708
1708
|
let { state } = dataRouterContext.router;
|
|
1709
|
-
return /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(
|
|
1709
|
+
return /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement(_chunkZO66TDGBjs.DataRouterContext.Provider, { value: dataRouterContext }, /* @__PURE__ */ React3.createElement(_chunkZO66TDGBjs.DataRouterStateContext.Provider, { value: state }, /* @__PURE__ */ React3.createElement(_chunkZO66TDGBjs.FetchersContext.Provider, { value: fetchersContext }, /* @__PURE__ */ React3.createElement(_chunkZO66TDGBjs.ViewTransitionContext.Provider, { value: { isTransitioning: false } }, /* @__PURE__ */ React3.createElement(
|
|
1710
1710
|
Router,
|
|
1711
1711
|
{
|
|
1712
1712
|
basename: dataRouterContext.basename,
|
|
@@ -1737,14 +1737,14 @@ function DataRoutes2({
|
|
|
1737
1737
|
future,
|
|
1738
1738
|
state
|
|
1739
1739
|
}) {
|
|
1740
|
-
return
|
|
1740
|
+
return _chunkZO66TDGBjs.useRoutesImpl.call(void 0, routes, void 0, state, void 0, future);
|
|
1741
1741
|
}
|
|
1742
1742
|
function serializeErrors(errors) {
|
|
1743
1743
|
if (!errors) return null;
|
|
1744
1744
|
let entries = Object.entries(errors);
|
|
1745
1745
|
let serialized = {};
|
|
1746
1746
|
for (let [key, val] of entries) {
|
|
1747
|
-
if (
|
|
1747
|
+
if (_chunkZO66TDGBjs.isRouteErrorResponse.call(void 0, val)) {
|
|
1748
1748
|
serialized[key] = { ...val, __type: "RouteErrorResponse" };
|
|
1749
1749
|
} else if (val instanceof Error) {
|
|
1750
1750
|
serialized[key] = {
|
|
@@ -1794,14 +1794,14 @@ function getStatelessNavigator() {
|
|
|
1794
1794
|
};
|
|
1795
1795
|
}
|
|
1796
1796
|
function createStaticHandler2(routes, opts) {
|
|
1797
|
-
return
|
|
1797
|
+
return _chunkZO66TDGBjs.createStaticHandler.call(void 0, routes, {
|
|
1798
1798
|
...opts,
|
|
1799
1799
|
mapRouteProperties
|
|
1800
1800
|
});
|
|
1801
1801
|
}
|
|
1802
1802
|
function createStaticRouter(routes, context, opts = {}) {
|
|
1803
1803
|
let manifest = {};
|
|
1804
|
-
let dataRoutes =
|
|
1804
|
+
let dataRoutes = _chunkZO66TDGBjs.convertRoutesToDataRoutes.call(void 0,
|
|
1805
1805
|
routes,
|
|
1806
1806
|
mapRouteProperties,
|
|
1807
1807
|
void 0,
|
|
@@ -1834,7 +1834,7 @@ function createStaticRouter(routes, context, opts = {}) {
|
|
|
1834
1834
|
actionData: context.actionData,
|
|
1835
1835
|
errors: context.errors,
|
|
1836
1836
|
initialized: true,
|
|
1837
|
-
navigation:
|
|
1837
|
+
navigation: _chunkZO66TDGBjs.IDLE_NAVIGATION,
|
|
1838
1838
|
restoreScrollPosition: null,
|
|
1839
1839
|
preventScrollReset: false,
|
|
1840
1840
|
revalidation: "idle",
|
|
@@ -1869,7 +1869,7 @@ function createStaticRouter(routes, context, opts = {}) {
|
|
|
1869
1869
|
createHref,
|
|
1870
1870
|
encodeLocation,
|
|
1871
1871
|
getFetcher() {
|
|
1872
|
-
return
|
|
1872
|
+
return _chunkZO66TDGBjs.IDLE_FETCHER;
|
|
1873
1873
|
},
|
|
1874
1874
|
deleteFetcher() {
|
|
1875
1875
|
throw msg("deleteFetcher");
|
|
@@ -1878,7 +1878,7 @@ function createStaticRouter(routes, context, opts = {}) {
|
|
|
1878
1878
|
throw msg("dispose");
|
|
1879
1879
|
},
|
|
1880
1880
|
getBlocker() {
|
|
1881
|
-
return
|
|
1881
|
+
return _chunkZO66TDGBjs.IDLE_BLOCKER;
|
|
1882
1882
|
},
|
|
1883
1883
|
deleteBlocker() {
|
|
1884
1884
|
throw msg("deleteBlocker");
|
|
@@ -1896,10 +1896,10 @@ function createStaticRouter(routes, context, opts = {}) {
|
|
|
1896
1896
|
};
|
|
1897
1897
|
}
|
|
1898
1898
|
function createHref(to) {
|
|
1899
|
-
return typeof to === "string" ? to :
|
|
1899
|
+
return typeof to === "string" ? to : _chunkZO66TDGBjs.createPath.call(void 0, to);
|
|
1900
1900
|
}
|
|
1901
1901
|
function encodeLocation(to) {
|
|
1902
|
-
let href = typeof to === "string" ? to :
|
|
1902
|
+
let href = typeof to === "string" ? to : _chunkZO66TDGBjs.createPath.call(void 0, to);
|
|
1903
1903
|
href = href.replace(/ $/, "%20");
|
|
1904
1904
|
let encoded = ABSOLUTE_URL_REGEX2.test(href) ? new URL(href) : new URL(href, "http://localhost");
|
|
1905
1905
|
return {
|