react-router 7.18.6 → 7.18.7
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 +14 -0
- package/dist/development/{browser-7x6a6gQP.d.ts → browser-QWJf_b8Q.d.ts} +2 -2
- package/dist/development/{browser-CiGxXXOl.d.mts → browser-yuOIt-hO.d.mts} +2 -2
- package/dist/{production/chunk-2WUBOUFU.js → development/chunk-6VUODQWR.js} +105 -105
- package/dist/development/{chunk-S47XUPN5.js → chunk-EYW3HBBI.js} +12 -2
- package/dist/{production/chunk-3IBQ4CTZ.js → development/chunk-FLL7MJ4N.js} +7 -7
- package/dist/{production/chunk-JRCXCPLA.mjs → development/chunk-IXMWVLYF.mjs} +2 -2
- package/dist/development/{chunk-YDNE64FV.mjs → chunk-Z7SQORRT.mjs} +13 -3
- package/dist/{production/context-BlYKn1tE.d.mts → development/context-BbKau8k8.d.mts} +1 -1
- package/dist/development/{data-DEjBmEfD.d.mts → data-BfpvlkTw.d.mts} +2 -0
- package/dist/{production/data-CjO11-hU.d.ts → development/data-DNyB6ouY.d.ts} +2 -0
- package/dist/development/dom-export.d.mts +3 -3
- package/dist/development/dom-export.d.ts +3 -3
- package/dist/development/dom-export.js +35 -35
- package/dist/development/dom-export.mjs +4 -4
- package/dist/development/{index-react-server-client-KK-TR-t7.d.mts → index-react-server-client-DF1LPF_n.d.mts} +2 -2
- package/dist/development/{index-react-server-client-BaaZU3sM.d.ts → index-react-server-client-DxC4rwQS.d.ts} +2 -2
- package/dist/development/index-react-server-client.d.mts +3 -3
- package/dist/development/index-react-server-client.d.ts +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 +59 -57
- package/dist/development/index-react-server.mjs +59 -57
- package/dist/development/index.d.mts +10 -10
- package/dist/development/index.d.ts +10 -10
- package/dist/development/index.js +92 -92
- package/dist/development/index.mjs +3 -3
- package/dist/{production/instrumentation-CPkMwccd.d.ts → development/instrumentation-z0GQ7yJ2.d.ts} +1 -1
- package/dist/development/lib/types/internal.d.mts +2 -2
- package/dist/development/lib/types/internal.d.ts +2 -2
- package/dist/development/lib/types/internal.js +1 -1
- package/dist/development/lib/types/internal.mjs +1 -1
- package/dist/development/{register-CmkRspdl.d.mts → register-B8pHflrz.d.mts} +1 -1
- package/dist/development/{register-roq_0qYo.d.ts → register-Dnr_kGGI.d.ts} +1 -1
- package/dist/production/{browser-7x6a6gQP.d.ts → browser-QWJf_b8Q.d.ts} +2 -2
- package/dist/production/{browser-CiGxXXOl.d.mts → browser-yuOIt-hO.d.mts} +2 -2
- package/dist/{development/chunk-QM7ETCUK.js → production/chunk-6AFDAMLF.js} +105 -105
- package/dist/{development/chunk-E2PF4K4Z.mjs → production/chunk-D2GT6IUW.mjs} +2 -2
- package/dist/production/{chunk-AC65NKOP.js → chunk-JAAIXHP6.js} +12 -2
- package/dist/production/{chunk-HEAXLYUI.mjs → chunk-OCNYVWSN.mjs} +13 -3
- package/dist/{development/chunk-3QTLHDUO.js → production/chunk-RFC7P4DG.js} +7 -7
- package/dist/{development/context-BlYKn1tE.d.mts → production/context-BbKau8k8.d.mts} +1 -1
- package/dist/production/{data-DEjBmEfD.d.mts → data-BfpvlkTw.d.mts} +2 -0
- package/dist/{development/data-CjO11-hU.d.ts → production/data-DNyB6ouY.d.ts} +2 -0
- package/dist/production/dom-export.d.mts +3 -3
- package/dist/production/dom-export.d.ts +3 -3
- package/dist/production/dom-export.js +35 -35
- package/dist/production/dom-export.mjs +4 -4
- package/dist/production/{index-react-server-client-KK-TR-t7.d.mts → index-react-server-client-DF1LPF_n.d.mts} +2 -2
- package/dist/production/{index-react-server-client-BaaZU3sM.d.ts → index-react-server-client-DxC4rwQS.d.ts} +2 -2
- package/dist/production/index-react-server-client.d.mts +3 -3
- package/dist/production/index-react-server-client.d.ts +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 +59 -57
- package/dist/production/index-react-server.mjs +59 -57
- package/dist/production/index.d.mts +10 -10
- package/dist/production/index.d.ts +10 -10
- package/dist/production/index.js +92 -92
- package/dist/production/index.mjs +3 -3
- package/dist/{development/instrumentation-CPkMwccd.d.ts → production/instrumentation-z0GQ7yJ2.d.ts} +1 -1
- package/dist/production/lib/types/internal.d.mts +2 -2
- package/dist/production/lib/types/internal.d.ts +2 -2
- package/dist/production/lib/types/internal.js +1 -1
- package/dist/production/lib/types/internal.mjs +1 -1
- package/dist/production/{register-CmkRspdl.d.mts → register-B8pHflrz.d.mts} +1 -1
- package/dist/production/{register-roq_0qYo.d.ts → register-Dnr_kGGI.d.ts} +1 -1
- package/package.json +5 -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.18.
|
|
2
|
+
* react-router v7.18.7
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
|
|
57
|
-
var
|
|
57
|
+
var _chunkJAAIXHP6js = require('./chunk-JAAIXHP6.js');
|
|
58
58
|
|
|
59
59
|
// lib/dom/dom.ts
|
|
60
60
|
var defaultMethod = "get";
|
|
@@ -125,7 +125,7 @@ var supportedFormEncTypes = /* @__PURE__ */ new Set([
|
|
|
125
125
|
]);
|
|
126
126
|
function getFormEncType(encType) {
|
|
127
127
|
if (encType != null && !supportedFormEncTypes.has(encType)) {
|
|
128
|
-
|
|
128
|
+
_chunkJAAIXHP6js.warning.call(void 0,
|
|
129
129
|
false,
|
|
130
130
|
`"${encType}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${defaultEncType}"`
|
|
131
131
|
);
|
|
@@ -141,7 +141,7 @@ function getFormSubmissionInfo(target, basename) {
|
|
|
141
141
|
let body;
|
|
142
142
|
if (isFormElement(target)) {
|
|
143
143
|
let attr = target.getAttribute("action");
|
|
144
|
-
action = attr ?
|
|
144
|
+
action = attr ? _chunkJAAIXHP6js.stripBasename.call(void 0, attr, basename) : null;
|
|
145
145
|
method = target.getAttribute("method") || defaultMethod;
|
|
146
146
|
encType = getFormEncType(target.getAttribute("enctype")) || defaultEncType;
|
|
147
147
|
formData = new FormData(target);
|
|
@@ -153,7 +153,7 @@ function getFormSubmissionInfo(target, basename) {
|
|
|
153
153
|
);
|
|
154
154
|
}
|
|
155
155
|
let attr = target.getAttribute("formaction") || form.getAttribute("action");
|
|
156
|
-
action = attr ?
|
|
156
|
+
action = attr ? _chunkJAAIXHP6js.stripBasename.call(void 0, attr, basename) : null;
|
|
157
157
|
method = target.getAttribute("formmethod") || form.getAttribute("method") || defaultMethod;
|
|
158
158
|
encType = getFormEncType(target.getAttribute("formenctype")) || getFormEncType(form.getAttribute("enctype")) || defaultEncType;
|
|
159
159
|
formData = new FormData(form, target);
|
|
@@ -190,20 +190,20 @@ var isBrowser = typeof window !== "undefined" && typeof window.document !== "und
|
|
|
190
190
|
try {
|
|
191
191
|
if (isBrowser) {
|
|
192
192
|
window.__reactRouterVersion = // @ts-expect-error
|
|
193
|
-
"7.18.
|
|
193
|
+
"7.18.7";
|
|
194
194
|
}
|
|
195
195
|
} catch (e) {
|
|
196
196
|
}
|
|
197
197
|
function createBrowserRouter(routes, opts) {
|
|
198
|
-
return
|
|
198
|
+
return _chunkJAAIXHP6js.createRouter.call(void 0, {
|
|
199
199
|
basename: _optionalChain([opts, 'optionalAccess', _2 => _2.basename]),
|
|
200
200
|
getContext: _optionalChain([opts, 'optionalAccess', _3 => _3.getContext]),
|
|
201
201
|
future: _optionalChain([opts, 'optionalAccess', _4 => _4.future]),
|
|
202
|
-
history:
|
|
202
|
+
history: _chunkJAAIXHP6js.createBrowserHistory.call(void 0, { window: _optionalChain([opts, 'optionalAccess', _5 => _5.window]) }),
|
|
203
203
|
hydrationData: _optionalChain([opts, 'optionalAccess', _6 => _6.hydrationData]) || parseHydrationData(),
|
|
204
204
|
routes,
|
|
205
|
-
mapRouteProperties:
|
|
206
|
-
hydrationRouteProperties:
|
|
205
|
+
mapRouteProperties: _chunkJAAIXHP6js.mapRouteProperties,
|
|
206
|
+
hydrationRouteProperties: _chunkJAAIXHP6js.hydrationRouteProperties,
|
|
207
207
|
dataStrategy: _optionalChain([opts, 'optionalAccess', _7 => _7.dataStrategy]),
|
|
208
208
|
patchRoutesOnNavigation: _optionalChain([opts, 'optionalAccess', _8 => _8.patchRoutesOnNavigation]),
|
|
209
209
|
window: _optionalChain([opts, 'optionalAccess', _9 => _9.window]),
|
|
@@ -211,15 +211,15 @@ function createBrowserRouter(routes, opts) {
|
|
|
211
211
|
}).initialize();
|
|
212
212
|
}
|
|
213
213
|
function createHashRouter(routes, opts) {
|
|
214
|
-
return
|
|
214
|
+
return _chunkJAAIXHP6js.createRouter.call(void 0, {
|
|
215
215
|
basename: _optionalChain([opts, 'optionalAccess', _11 => _11.basename]),
|
|
216
216
|
getContext: _optionalChain([opts, 'optionalAccess', _12 => _12.getContext]),
|
|
217
217
|
future: _optionalChain([opts, 'optionalAccess', _13 => _13.future]),
|
|
218
|
-
history:
|
|
218
|
+
history: _chunkJAAIXHP6js.createHashHistory.call(void 0, { window: _optionalChain([opts, 'optionalAccess', _14 => _14.window]) }),
|
|
219
219
|
hydrationData: _optionalChain([opts, 'optionalAccess', _15 => _15.hydrationData]) || parseHydrationData(),
|
|
220
220
|
routes,
|
|
221
|
-
mapRouteProperties:
|
|
222
|
-
hydrationRouteProperties:
|
|
221
|
+
mapRouteProperties: _chunkJAAIXHP6js.mapRouteProperties,
|
|
222
|
+
hydrationRouteProperties: _chunkJAAIXHP6js.hydrationRouteProperties,
|
|
223
223
|
dataStrategy: _optionalChain([opts, 'optionalAccess', _16 => _16.dataStrategy]),
|
|
224
224
|
patchRoutesOnNavigation: _optionalChain([opts, 'optionalAccess', _17 => _17.patchRoutesOnNavigation]),
|
|
225
225
|
window: _optionalChain([opts, 'optionalAccess', _18 => _18.window]),
|
|
@@ -242,14 +242,14 @@ function deserializeErrors(errors) {
|
|
|
242
242
|
let serialized = {};
|
|
243
243
|
for (let [key, val] of entries) {
|
|
244
244
|
if (val && val.__type === "RouteErrorResponse") {
|
|
245
|
-
serialized[key] = new (0,
|
|
245
|
+
serialized[key] = new (0, _chunkJAAIXHP6js.ErrorResponseImpl)(
|
|
246
246
|
val.status,
|
|
247
247
|
val.statusText,
|
|
248
248
|
val.data,
|
|
249
249
|
val.internal === true
|
|
250
250
|
);
|
|
251
251
|
} else if (val && val.__type === "Error") {
|
|
252
|
-
if (typeof val.__subType === "string" &&
|
|
252
|
+
if (typeof val.__subType === "string" && _chunkJAAIXHP6js.SUPPORTED_ERROR_TYPES.includes(val.__subType)) {
|
|
253
253
|
let ErrorConstructor = window[val.__subType];
|
|
254
254
|
if (typeof ErrorConstructor === "function") {
|
|
255
255
|
try {
|
|
@@ -279,7 +279,7 @@ function BrowserRouter({
|
|
|
279
279
|
}) {
|
|
280
280
|
let historyRef = React.useRef();
|
|
281
281
|
if (historyRef.current == null) {
|
|
282
|
-
historyRef.current =
|
|
282
|
+
historyRef.current = _chunkJAAIXHP6js.createBrowserHistory.call(void 0, { window: window2, v5Compat: true });
|
|
283
283
|
}
|
|
284
284
|
let history = historyRef.current;
|
|
285
285
|
let [state, setStateImpl] = React.useState({
|
|
@@ -298,7 +298,7 @@ function BrowserRouter({
|
|
|
298
298
|
);
|
|
299
299
|
React.useLayoutEffect(() => history.listen(setState), [history, setState]);
|
|
300
300
|
return /* @__PURE__ */ React.createElement(
|
|
301
|
-
|
|
301
|
+
_chunkJAAIXHP6js.Router,
|
|
302
302
|
{
|
|
303
303
|
basename,
|
|
304
304
|
children,
|
|
@@ -317,7 +317,7 @@ function HashRouter({
|
|
|
317
317
|
}) {
|
|
318
318
|
let historyRef = React.useRef();
|
|
319
319
|
if (historyRef.current == null) {
|
|
320
|
-
historyRef.current =
|
|
320
|
+
historyRef.current = _chunkJAAIXHP6js.createHashHistory.call(void 0, { window: window2, v5Compat: true });
|
|
321
321
|
}
|
|
322
322
|
let history = historyRef.current;
|
|
323
323
|
let [state, setStateImpl] = React.useState({
|
|
@@ -336,7 +336,7 @@ function HashRouter({
|
|
|
336
336
|
);
|
|
337
337
|
React.useLayoutEffect(() => history.listen(setState), [history, setState]);
|
|
338
338
|
return /* @__PURE__ */ React.createElement(
|
|
339
|
-
|
|
339
|
+
_chunkJAAIXHP6js.Router,
|
|
340
340
|
{
|
|
341
341
|
basename,
|
|
342
342
|
children,
|
|
@@ -369,7 +369,7 @@ function HistoryRouter({
|
|
|
369
369
|
);
|
|
370
370
|
React.useLayoutEffect(() => history.listen(setState), [history, setState]);
|
|
371
371
|
return /* @__PURE__ */ React.createElement(
|
|
372
|
-
|
|
372
|
+
_chunkJAAIXHP6js.Router,
|
|
373
373
|
{
|
|
374
374
|
basename,
|
|
375
375
|
children,
|
|
@@ -398,26 +398,26 @@ var Link = React.forwardRef(
|
|
|
398
398
|
defaultShouldRevalidate,
|
|
399
399
|
...rest
|
|
400
400
|
}, forwardedRef) {
|
|
401
|
-
let { basename, navigator, useTransitions } = React.useContext(
|
|
402
|
-
let isAbsolute = typeof to === "string" &&
|
|
403
|
-
let parsed =
|
|
401
|
+
let { basename, navigator, useTransitions } = React.useContext(_chunkJAAIXHP6js.NavigationContext);
|
|
402
|
+
let isAbsolute = typeof to === "string" && _chunkJAAIXHP6js.ABSOLUTE_URL_REGEX.test(to);
|
|
403
|
+
let parsed = _chunkJAAIXHP6js.parseToInfo.call(void 0, to, basename);
|
|
404
404
|
to = parsed.to;
|
|
405
|
-
let href =
|
|
406
|
-
let location =
|
|
405
|
+
let href = _chunkJAAIXHP6js.useHref.call(void 0, to, { relative });
|
|
406
|
+
let location = _chunkJAAIXHP6js.useLocation.call(void 0, );
|
|
407
407
|
let maskedHref = null;
|
|
408
408
|
if (mask) {
|
|
409
|
-
let resolved =
|
|
409
|
+
let resolved = _chunkJAAIXHP6js.resolveTo.call(void 0,
|
|
410
410
|
mask,
|
|
411
411
|
[],
|
|
412
412
|
location.mask ? location.mask.pathname : "/",
|
|
413
413
|
true
|
|
414
414
|
);
|
|
415
415
|
if (basename !== "/") {
|
|
416
|
-
resolved.pathname = resolved.pathname === "/" ? basename :
|
|
416
|
+
resolved.pathname = resolved.pathname === "/" ? basename : _chunkJAAIXHP6js.joinPaths.call(void 0, [basename, resolved.pathname]);
|
|
417
417
|
}
|
|
418
418
|
maskedHref = navigator.createHref(resolved);
|
|
419
419
|
}
|
|
420
|
-
let [shouldPrefetch, prefetchRef, prefetchHandlers] =
|
|
420
|
+
let [shouldPrefetch, prefetchRef, prefetchHandlers] = _chunkJAAIXHP6js.usePrefetchBehavior.call(void 0,
|
|
421
421
|
prefetch,
|
|
422
422
|
rest
|
|
423
423
|
);
|
|
@@ -440,7 +440,7 @@ var Link = React.forwardRef(
|
|
|
440
440
|
}
|
|
441
441
|
let isSpaLink = !(parsed.isExternal || reloadDocument);
|
|
442
442
|
let renderedHref = (isSpaLink ? maskedHref : void 0) || parsed.absoluteURL || href;
|
|
443
|
-
|
|
443
|
+
_chunkJAAIXHP6js.validateDocumentNavigationTarget.call(void 0, renderedHref);
|
|
444
444
|
let link = (
|
|
445
445
|
// eslint-disable-next-line jsx-a11y/anchor-has-content
|
|
446
446
|
/* @__PURE__ */ React.createElement(
|
|
@@ -450,13 +450,13 @@ var Link = React.forwardRef(
|
|
|
450
450
|
...prefetchHandlers,
|
|
451
451
|
href: renderedHref,
|
|
452
452
|
onClick: isSpaLink ? handleClick : onClick,
|
|
453
|
-
ref:
|
|
453
|
+
ref: _chunkJAAIXHP6js.mergeRefs.call(void 0, forwardedRef, prefetchRef),
|
|
454
454
|
target,
|
|
455
455
|
"data-discover": !isAbsolute && discover === "render" ? "true" : void 0
|
|
456
456
|
}
|
|
457
457
|
)
|
|
458
458
|
);
|
|
459
|
-
return shouldPrefetch && !isAbsolute ? /* @__PURE__ */ React.createElement(React.Fragment, null, link, /* @__PURE__ */ React.createElement(
|
|
459
|
+
return shouldPrefetch && !isAbsolute ? /* @__PURE__ */ React.createElement(React.Fragment, null, link, /* @__PURE__ */ React.createElement(_chunkJAAIXHP6js.PrefetchPageLinks, { page: href })) : link;
|
|
460
460
|
}
|
|
461
461
|
);
|
|
462
462
|
Link.displayName = "Link";
|
|
@@ -472,10 +472,10 @@ var NavLink = React.forwardRef(
|
|
|
472
472
|
children,
|
|
473
473
|
...rest
|
|
474
474
|
}, ref) {
|
|
475
|
-
let path =
|
|
476
|
-
let location =
|
|
477
|
-
let routerState = React.useContext(
|
|
478
|
-
let { navigator, basename } = React.useContext(
|
|
475
|
+
let path = _chunkJAAIXHP6js.useResolvedPath.call(void 0, to, { relative: rest.relative });
|
|
476
|
+
let location = _chunkJAAIXHP6js.useLocation.call(void 0, );
|
|
477
|
+
let routerState = React.useContext(_chunkJAAIXHP6js.DataRouterStateContext);
|
|
478
|
+
let { navigator, basename } = React.useContext(_chunkJAAIXHP6js.NavigationContext);
|
|
479
479
|
let isTransitioning = routerState != null && // Conditional usage is OK here because the usage of a data router is static
|
|
480
480
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
481
481
|
useViewTransitionState(path) && viewTransition === true;
|
|
@@ -488,7 +488,7 @@ var NavLink = React.forwardRef(
|
|
|
488
488
|
toPathname = toPathname.toLowerCase();
|
|
489
489
|
}
|
|
490
490
|
if (nextLocationPathname && basename) {
|
|
491
|
-
nextLocationPathname =
|
|
491
|
+
nextLocationPathname = _chunkJAAIXHP6js.stripBasename.call(void 0, nextLocationPathname, basename) || nextLocationPathname;
|
|
492
492
|
}
|
|
493
493
|
const endSlashPosition = toPathname !== "/" && toPathname.endsWith("/") ? toPathname.length - 1 : toPathname.length;
|
|
494
494
|
let isActive = locationPathname === toPathname || !end && locationPathname.startsWith(toPathname) && locationPathname.charAt(endSlashPosition) === "/";
|
|
@@ -544,11 +544,11 @@ var Form = React.forwardRef(
|
|
|
544
544
|
defaultShouldRevalidate,
|
|
545
545
|
...props
|
|
546
546
|
}, forwardedRef) => {
|
|
547
|
-
let { useTransitions } = React.useContext(
|
|
547
|
+
let { useTransitions } = React.useContext(_chunkJAAIXHP6js.NavigationContext);
|
|
548
548
|
let submit = useSubmit();
|
|
549
549
|
let formAction = useFormAction(action, { relative });
|
|
550
550
|
let formMethod = method.toLowerCase() === "get" ? "get" : "post";
|
|
551
|
-
let isAbsolute = typeof action === "string" &&
|
|
551
|
+
let isAbsolute = typeof action === "string" && _chunkJAAIXHP6js.ABSOLUTE_URL_REGEX.test(action);
|
|
552
552
|
let submitHandler = (event) => {
|
|
553
553
|
onSubmit && onSubmit(event);
|
|
554
554
|
if (event.defaultPrevented) return;
|
|
@@ -591,10 +591,10 @@ function ScrollRestoration({
|
|
|
591
591
|
storageKey,
|
|
592
592
|
...props
|
|
593
593
|
}) {
|
|
594
|
-
let remixContext = React.useContext(
|
|
595
|
-
let { basename } = React.useContext(
|
|
596
|
-
let location =
|
|
597
|
-
let matches =
|
|
594
|
+
let remixContext = React.useContext(_chunkJAAIXHP6js.FrameworkContext);
|
|
595
|
+
let { basename } = React.useContext(_chunkJAAIXHP6js.NavigationContext);
|
|
596
|
+
let location = _chunkJAAIXHP6js.useLocation.call(void 0, );
|
|
597
|
+
let matches = _chunkJAAIXHP6js.useMatches.call(void 0, );
|
|
598
598
|
useScrollRestoration({ getKey, storageKey });
|
|
599
599
|
let ssrKey = React.useMemo(
|
|
600
600
|
() => {
|
|
@@ -639,9 +639,9 @@ function ScrollRestoration({
|
|
|
639
639
|
...props,
|
|
640
640
|
suppressHydrationWarning: true,
|
|
641
641
|
dangerouslySetInnerHTML: {
|
|
642
|
-
__html: `(${restoreScroll})(${
|
|
642
|
+
__html: `(${restoreScroll})(${_chunkJAAIXHP6js.escapeHtml.call(void 0,
|
|
643
643
|
JSON.stringify(storageKey || SCROLL_RESTORATION_STORAGE_KEY)
|
|
644
|
-
)}, ${
|
|
644
|
+
)}, ${_chunkJAAIXHP6js.escapeHtml.call(void 0, JSON.stringify(ssrKey))})`
|
|
645
645
|
}
|
|
646
646
|
}
|
|
647
647
|
);
|
|
@@ -651,13 +651,13 @@ function getDataRouterConsoleError(hookName) {
|
|
|
651
651
|
return `${hookName} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
|
|
652
652
|
}
|
|
653
653
|
function useDataRouterContext(hookName) {
|
|
654
|
-
let ctx = React.useContext(
|
|
655
|
-
|
|
654
|
+
let ctx = React.useContext(_chunkJAAIXHP6js.DataRouterContext);
|
|
655
|
+
_chunkJAAIXHP6js.invariant.call(void 0, ctx, getDataRouterConsoleError(hookName));
|
|
656
656
|
return ctx;
|
|
657
657
|
}
|
|
658
658
|
function useDataRouterState(hookName) {
|
|
659
|
-
let state = React.useContext(
|
|
660
|
-
|
|
659
|
+
let state = React.useContext(_chunkJAAIXHP6js.DataRouterStateContext);
|
|
660
|
+
_chunkJAAIXHP6js.invariant.call(void 0, state, getDataRouterConsoleError(hookName));
|
|
661
661
|
return state;
|
|
662
662
|
}
|
|
663
663
|
function useLinkClickHandler(to, {
|
|
@@ -671,14 +671,14 @@ function useLinkClickHandler(to, {
|
|
|
671
671
|
defaultShouldRevalidate,
|
|
672
672
|
useTransitions
|
|
673
673
|
} = {}) {
|
|
674
|
-
let navigate =
|
|
675
|
-
let location =
|
|
676
|
-
let path =
|
|
674
|
+
let navigate = _chunkJAAIXHP6js.useNavigate.call(void 0, );
|
|
675
|
+
let location = _chunkJAAIXHP6js.useLocation.call(void 0, );
|
|
676
|
+
let path = _chunkJAAIXHP6js.useResolvedPath.call(void 0, to, { relative });
|
|
677
677
|
return React.useCallback(
|
|
678
678
|
(event) => {
|
|
679
679
|
if (shouldProcessLinkClick(event, target)) {
|
|
680
680
|
event.preventDefault();
|
|
681
|
-
let replace = replaceProp !== void 0 ? replaceProp :
|
|
681
|
+
let replace = replaceProp !== void 0 ? replaceProp : _chunkJAAIXHP6js.createPath.call(void 0, location) === _chunkJAAIXHP6js.createPath.call(void 0, path);
|
|
682
682
|
let doNavigate = () => navigate(to, {
|
|
683
683
|
replace,
|
|
684
684
|
mask,
|
|
@@ -713,13 +713,13 @@ function useLinkClickHandler(to, {
|
|
|
713
713
|
);
|
|
714
714
|
}
|
|
715
715
|
function useSearchParams(defaultInit) {
|
|
716
|
-
|
|
716
|
+
_chunkJAAIXHP6js.warning.call(void 0,
|
|
717
717
|
typeof URLSearchParams !== "undefined",
|
|
718
718
|
`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.`
|
|
719
719
|
);
|
|
720
720
|
let defaultSearchParamsRef = React.useRef(createSearchParams(defaultInit));
|
|
721
721
|
let hasSetSearchParamsRef = React.useRef(false);
|
|
722
|
-
let location =
|
|
722
|
+
let location = _chunkJAAIXHP6js.useLocation.call(void 0, );
|
|
723
723
|
let searchParams = React.useMemo(
|
|
724
724
|
() => (
|
|
725
725
|
// Only merge in the defaults if we haven't yet called setSearchParams.
|
|
@@ -732,7 +732,7 @@ function useSearchParams(defaultInit) {
|
|
|
732
732
|
),
|
|
733
733
|
[location.search]
|
|
734
734
|
);
|
|
735
|
-
let navigate =
|
|
735
|
+
let navigate = _chunkJAAIXHP6js.useNavigate.call(void 0, );
|
|
736
736
|
let setSearchParams = React.useCallback(
|
|
737
737
|
(nextInit, navigateOptions) => {
|
|
738
738
|
const newSearchParams = createSearchParams(
|
|
@@ -749,8 +749,8 @@ var fetcherId = 0;
|
|
|
749
749
|
var getUniqueFetcherId = () => `__${String(++fetcherId)}__`;
|
|
750
750
|
function useSubmit() {
|
|
751
751
|
let { router } = useDataRouterContext("useSubmit" /* UseSubmit */);
|
|
752
|
-
let { basename } = React.useContext(
|
|
753
|
-
let currentRouteId =
|
|
752
|
+
let { basename } = React.useContext(_chunkJAAIXHP6js.NavigationContext);
|
|
753
|
+
let currentRouteId = _chunkJAAIXHP6js.useRouteId.call(void 0, );
|
|
754
754
|
let routerFetch = router.fetch;
|
|
755
755
|
let routerNavigate = router.navigate;
|
|
756
756
|
return React.useCallback(
|
|
@@ -790,12 +790,12 @@ function useSubmit() {
|
|
|
790
790
|
);
|
|
791
791
|
}
|
|
792
792
|
function useFormAction(action, { relative } = {}) {
|
|
793
|
-
let { basename } = React.useContext(
|
|
794
|
-
let routeContext = React.useContext(
|
|
795
|
-
|
|
793
|
+
let { basename } = React.useContext(_chunkJAAIXHP6js.NavigationContext);
|
|
794
|
+
let routeContext = React.useContext(_chunkJAAIXHP6js.RouteContext);
|
|
795
|
+
_chunkJAAIXHP6js.invariant.call(void 0, routeContext, "useFormAction must be used inside a RouteContext");
|
|
796
796
|
let [match] = routeContext.matches.slice(-1);
|
|
797
|
-
let path = { ...
|
|
798
|
-
let location =
|
|
797
|
+
let path = { ..._chunkJAAIXHP6js.useResolvedPath.call(void 0, action ? action : ".", { relative }) };
|
|
798
|
+
let location = _chunkJAAIXHP6js.useLocation.call(void 0, );
|
|
799
799
|
if (action == null) {
|
|
800
800
|
path.search = location.search;
|
|
801
801
|
let params = new URLSearchParams(path.search);
|
|
@@ -812,10 +812,10 @@ function useFormAction(action, { relative } = {}) {
|
|
|
812
812
|
path.search = path.search ? path.search.replace(/^\?/, "?index&") : "?index";
|
|
813
813
|
}
|
|
814
814
|
if (basename !== "/") {
|
|
815
|
-
path.pathname = path.pathname === "/" ? basename :
|
|
815
|
+
path.pathname = path.pathname === "/" ? basename : _chunkJAAIXHP6js.joinPaths.call(void 0, [basename, path.pathname]);
|
|
816
816
|
}
|
|
817
|
-
let formAction =
|
|
818
|
-
|
|
817
|
+
let formAction = _chunkJAAIXHP6js.createPath.call(void 0, path);
|
|
818
|
+
_chunkJAAIXHP6js.validateDocumentNavigationTarget.call(void 0, formAction);
|
|
819
819
|
return formAction;
|
|
820
820
|
}
|
|
821
821
|
function useFetcher({
|
|
@@ -823,12 +823,12 @@ function useFetcher({
|
|
|
823
823
|
} = {}) {
|
|
824
824
|
let { router } = useDataRouterContext("useFetcher" /* UseFetcher */);
|
|
825
825
|
let state = useDataRouterState("useFetcher" /* UseFetcher */);
|
|
826
|
-
let fetcherData = React.useContext(
|
|
827
|
-
let route = React.useContext(
|
|
826
|
+
let fetcherData = React.useContext(_chunkJAAIXHP6js.FetchersContext);
|
|
827
|
+
let route = React.useContext(_chunkJAAIXHP6js.RouteContext);
|
|
828
828
|
let routeId = _optionalChain([route, 'access', _24 => _24.matches, 'access', _25 => _25[route.matches.length - 1], 'optionalAccess', _26 => _26.route, 'access', _27 => _27.id]);
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
829
|
+
_chunkJAAIXHP6js.invariant.call(void 0, fetcherData, `useFetcher must be used inside a FetchersContext`);
|
|
830
|
+
_chunkJAAIXHP6js.invariant.call(void 0, route, `useFetcher must be used inside a RouteContext`);
|
|
831
|
+
_chunkJAAIXHP6js.invariant.call(void 0,
|
|
832
832
|
routeId != null,
|
|
833
833
|
`useFetcher can only be used on routes that contain a unique "id"`
|
|
834
834
|
);
|
|
@@ -844,7 +844,7 @@ function useFetcher({
|
|
|
844
844
|
}, [deleteFetcher, getFetcher, fetcherKey]);
|
|
845
845
|
let load = React.useCallback(
|
|
846
846
|
async (href, opts) => {
|
|
847
|
-
|
|
847
|
+
_chunkJAAIXHP6js.invariant.call(void 0, routeId, "No routeId available for fetcher.load()");
|
|
848
848
|
await routerFetch(fetcherKey, routeId, href, opts);
|
|
849
849
|
},
|
|
850
850
|
[fetcherKey, routeId, routerFetch]
|
|
@@ -873,7 +873,7 @@ function useFetcher({
|
|
|
873
873
|
FetcherForm2.displayName = "fetcher.Form";
|
|
874
874
|
return FetcherForm2;
|
|
875
875
|
}, [fetcherKey]);
|
|
876
|
-
let fetcher = state.fetchers.get(fetcherKey) ||
|
|
876
|
+
let fetcher = state.fetchers.get(fetcherKey) || _chunkJAAIXHP6js.IDLE_FETCHER;
|
|
877
877
|
let data = fetcherData.get(fetcherKey);
|
|
878
878
|
let fetcherWithComponents = React.useMemo(
|
|
879
879
|
() => ({
|
|
@@ -907,7 +907,7 @@ function getScrollRestorationKey(location, matches, basename, getKey) {
|
|
|
907
907
|
key = getKey(
|
|
908
908
|
{
|
|
909
909
|
...location,
|
|
910
|
-
pathname:
|
|
910
|
+
pathname: _chunkJAAIXHP6js.stripBasename.call(void 0, location.pathname, basename) || location.pathname
|
|
911
911
|
},
|
|
912
912
|
matches
|
|
913
913
|
);
|
|
@@ -928,10 +928,10 @@ function useScrollRestoration({
|
|
|
928
928
|
let { restoreScrollPosition, preventScrollReset } = useDataRouterState(
|
|
929
929
|
"useScrollRestoration" /* UseScrollRestoration */
|
|
930
930
|
);
|
|
931
|
-
let { basename } = React.useContext(
|
|
932
|
-
let location =
|
|
933
|
-
let matches =
|
|
934
|
-
let navigation =
|
|
931
|
+
let { basename } = React.useContext(_chunkJAAIXHP6js.NavigationContext);
|
|
932
|
+
let location = _chunkJAAIXHP6js.useLocation.call(void 0, );
|
|
933
|
+
let matches = _chunkJAAIXHP6js.useMatches.call(void 0, );
|
|
934
|
+
let navigation = _chunkJAAIXHP6js.useNavigation.call(void 0, );
|
|
935
935
|
React.useEffect(() => {
|
|
936
936
|
window.history.scrollRestoration = "manual";
|
|
937
937
|
return () => {
|
|
@@ -950,7 +950,7 @@ function useScrollRestoration({
|
|
|
950
950
|
JSON.stringify(savedScrollPositions)
|
|
951
951
|
);
|
|
952
952
|
} catch (error) {
|
|
953
|
-
|
|
953
|
+
_chunkJAAIXHP6js.warning.call(void 0,
|
|
954
954
|
false,
|
|
955
955
|
`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${error}).`
|
|
956
956
|
);
|
|
@@ -997,7 +997,7 @@ function useScrollRestoration({
|
|
|
997
997
|
}
|
|
998
998
|
}
|
|
999
999
|
} catch (e2) {
|
|
1000
|
-
|
|
1000
|
+
_chunkJAAIXHP6js.warning.call(void 0,
|
|
1001
1001
|
false,
|
|
1002
1002
|
`"${location.hash.slice(
|
|
1003
1003
|
1
|
|
@@ -1035,7 +1035,7 @@ function usePrompt({
|
|
|
1035
1035
|
when,
|
|
1036
1036
|
message
|
|
1037
1037
|
}) {
|
|
1038
|
-
let blocker =
|
|
1038
|
+
let blocker = _chunkJAAIXHP6js.useBlocker.call(void 0, when);
|
|
1039
1039
|
React.useEffect(() => {
|
|
1040
1040
|
if (blocker.state === "blocked") {
|
|
1041
1041
|
let proceed = window.confirm(message);
|
|
@@ -1053,21 +1053,21 @@ function usePrompt({
|
|
|
1053
1053
|
}, [blocker, when]);
|
|
1054
1054
|
}
|
|
1055
1055
|
function useViewTransitionState(to, { relative } = {}) {
|
|
1056
|
-
let vtContext = React.useContext(
|
|
1057
|
-
|
|
1056
|
+
let vtContext = React.useContext(_chunkJAAIXHP6js.ViewTransitionContext);
|
|
1057
|
+
_chunkJAAIXHP6js.invariant.call(void 0,
|
|
1058
1058
|
vtContext != null,
|
|
1059
1059
|
"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"
|
|
1060
1060
|
);
|
|
1061
1061
|
let { basename } = useDataRouterContext(
|
|
1062
1062
|
"useViewTransitionState" /* useViewTransitionState */
|
|
1063
1063
|
);
|
|
1064
|
-
let path =
|
|
1064
|
+
let path = _chunkJAAIXHP6js.useResolvedPath.call(void 0, to, { relative });
|
|
1065
1065
|
if (!vtContext.isTransitioning) {
|
|
1066
1066
|
return false;
|
|
1067
1067
|
}
|
|
1068
|
-
let currentPath =
|
|
1069
|
-
let nextPath =
|
|
1070
|
-
return
|
|
1068
|
+
let currentPath = _chunkJAAIXHP6js.stripBasename.call(void 0, vtContext.currentLocation.pathname, basename) || vtContext.currentLocation.pathname;
|
|
1069
|
+
let nextPath = _chunkJAAIXHP6js.stripBasename.call(void 0, vtContext.nextLocation.pathname, basename) || vtContext.nextLocation.pathname;
|
|
1070
|
+
return _chunkJAAIXHP6js.matchPath.call(void 0, path.pathname, nextPath) != null || _chunkJAAIXHP6js.matchPath.call(void 0, path.pathname, currentPath) != null;
|
|
1071
1071
|
}
|
|
1072
1072
|
|
|
1073
1073
|
// lib/dom/server.tsx
|
|
@@ -1078,7 +1078,7 @@ function StaticRouter({
|
|
|
1078
1078
|
location: locationProp = "/"
|
|
1079
1079
|
}) {
|
|
1080
1080
|
if (typeof locationProp === "string") {
|
|
1081
|
-
locationProp =
|
|
1081
|
+
locationProp = _chunkJAAIXHP6js.parsePath.call(void 0, locationProp);
|
|
1082
1082
|
}
|
|
1083
1083
|
let action = "POP" /* Pop */;
|
|
1084
1084
|
let location = {
|
|
@@ -1091,7 +1091,7 @@ function StaticRouter({
|
|
|
1091
1091
|
};
|
|
1092
1092
|
let staticNavigator = getStatelessNavigator();
|
|
1093
1093
|
return /* @__PURE__ */ React2.createElement(
|
|
1094
|
-
|
|
1094
|
+
_chunkJAAIXHP6js.Router,
|
|
1095
1095
|
{
|
|
1096
1096
|
basename,
|
|
1097
1097
|
children,
|
|
@@ -1109,7 +1109,7 @@ function StaticRouterProvider({
|
|
|
1109
1109
|
hydrate = true,
|
|
1110
1110
|
nonce
|
|
1111
1111
|
}) {
|
|
1112
|
-
|
|
1112
|
+
_chunkJAAIXHP6js.invariant.call(void 0,
|
|
1113
1113
|
router && context,
|
|
1114
1114
|
"You must provide `router` and `context` to <StaticRouterProvider>"
|
|
1115
1115
|
);
|
|
@@ -1128,12 +1128,12 @@ function StaticRouterProvider({
|
|
|
1128
1128
|
actionData: context.actionData,
|
|
1129
1129
|
errors: serializeErrors(context.errors)
|
|
1130
1130
|
};
|
|
1131
|
-
let json =
|
|
1131
|
+
let json = _chunkJAAIXHP6js.escapeHtml.call(void 0, JSON.stringify(JSON.stringify(data)));
|
|
1132
1132
|
hydrateScript = `window.__staticRouterHydrationData = JSON.parse(${json});`;
|
|
1133
1133
|
}
|
|
1134
1134
|
let { state } = dataRouterContext.router;
|
|
1135
|
-
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(
|
|
1136
|
-
|
|
1135
|
+
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(_chunkJAAIXHP6js.DataRouterContext.Provider, { value: dataRouterContext }, /* @__PURE__ */ React2.createElement(_chunkJAAIXHP6js.DataRouterStateContext.Provider, { value: state }, /* @__PURE__ */ React2.createElement(_chunkJAAIXHP6js.FetchersContext.Provider, { value: fetchersContext }, /* @__PURE__ */ React2.createElement(_chunkJAAIXHP6js.ViewTransitionContext.Provider, { value: { isTransitioning: false } }, /* @__PURE__ */ React2.createElement(
|
|
1136
|
+
_chunkJAAIXHP6js.Router,
|
|
1137
1137
|
{
|
|
1138
1138
|
basename: dataRouterContext.basename,
|
|
1139
1139
|
location: state.location,
|
|
@@ -1143,7 +1143,7 @@ function StaticRouterProvider({
|
|
|
1143
1143
|
useTransitions: false
|
|
1144
1144
|
},
|
|
1145
1145
|
/* @__PURE__ */ React2.createElement(
|
|
1146
|
-
|
|
1146
|
+
_chunkJAAIXHP6js.DataRoutes,
|
|
1147
1147
|
{
|
|
1148
1148
|
manifest: router.manifest,
|
|
1149
1149
|
routes: router.routes,
|
|
@@ -1166,7 +1166,7 @@ function serializeErrors(errors) {
|
|
|
1166
1166
|
let entries = Object.entries(errors);
|
|
1167
1167
|
let serialized = {};
|
|
1168
1168
|
for (let [key, val] of entries) {
|
|
1169
|
-
if (
|
|
1169
|
+
if (_chunkJAAIXHP6js.isRouteErrorResponse.call(void 0, val)) {
|
|
1170
1170
|
serialized[key] = { ...val, __type: "RouteErrorResponse" };
|
|
1171
1171
|
} else if (val instanceof Error) {
|
|
1172
1172
|
serialized[key] = {
|
|
@@ -1216,16 +1216,16 @@ function getStatelessNavigator() {
|
|
|
1216
1216
|
};
|
|
1217
1217
|
}
|
|
1218
1218
|
function createStaticHandler2(routes, opts) {
|
|
1219
|
-
return
|
|
1219
|
+
return _chunkJAAIXHP6js.createStaticHandler.call(void 0, routes, {
|
|
1220
1220
|
...opts,
|
|
1221
|
-
mapRouteProperties:
|
|
1221
|
+
mapRouteProperties: _chunkJAAIXHP6js.mapRouteProperties
|
|
1222
1222
|
});
|
|
1223
1223
|
}
|
|
1224
1224
|
function createStaticRouter(routes, context, opts = {}) {
|
|
1225
1225
|
let manifest = {};
|
|
1226
|
-
let dataRoutes =
|
|
1226
|
+
let dataRoutes = _chunkJAAIXHP6js.convertRoutesToDataRoutes.call(void 0,
|
|
1227
1227
|
routes,
|
|
1228
|
-
|
|
1228
|
+
_chunkJAAIXHP6js.mapRouteProperties,
|
|
1229
1229
|
void 0,
|
|
1230
1230
|
manifest
|
|
1231
1231
|
);
|
|
@@ -1259,7 +1259,7 @@ function createStaticRouter(routes, context, opts = {}) {
|
|
|
1259
1259
|
errors: context.errors,
|
|
1260
1260
|
initialized: true,
|
|
1261
1261
|
renderFallback: false,
|
|
1262
|
-
navigation:
|
|
1262
|
+
navigation: _chunkJAAIXHP6js.IDLE_NAVIGATION,
|
|
1263
1263
|
restoreScrollPosition: null,
|
|
1264
1264
|
preventScrollReset: false,
|
|
1265
1265
|
revalidation: "idle",
|
|
@@ -1300,7 +1300,7 @@ function createStaticRouter(routes, context, opts = {}) {
|
|
|
1300
1300
|
createHref,
|
|
1301
1301
|
encodeLocation,
|
|
1302
1302
|
getFetcher() {
|
|
1303
|
-
return
|
|
1303
|
+
return _chunkJAAIXHP6js.IDLE_FETCHER;
|
|
1304
1304
|
},
|
|
1305
1305
|
deleteFetcher() {
|
|
1306
1306
|
throw msg("deleteFetcher");
|
|
@@ -1312,7 +1312,7 @@ function createStaticRouter(routes, context, opts = {}) {
|
|
|
1312
1312
|
throw msg("dispose");
|
|
1313
1313
|
},
|
|
1314
1314
|
getBlocker() {
|
|
1315
|
-
return
|
|
1315
|
+
return _chunkJAAIXHP6js.IDLE_BLOCKER;
|
|
1316
1316
|
},
|
|
1317
1317
|
deleteBlocker() {
|
|
1318
1318
|
throw msg("deleteBlocker");
|
|
@@ -1330,12 +1330,12 @@ function createStaticRouter(routes, context, opts = {}) {
|
|
|
1330
1330
|
};
|
|
1331
1331
|
}
|
|
1332
1332
|
function createHref(to) {
|
|
1333
|
-
return typeof to === "string" ? to :
|
|
1333
|
+
return typeof to === "string" ? to : _chunkJAAIXHP6js.createPath.call(void 0, to);
|
|
1334
1334
|
}
|
|
1335
1335
|
function encodeLocation(to) {
|
|
1336
|
-
let href = typeof to === "string" ? to :
|
|
1336
|
+
let href = typeof to === "string" ? to : _chunkJAAIXHP6js.createPath.call(void 0, to);
|
|
1337
1337
|
href = href.replace(/ $/, "%20");
|
|
1338
|
-
let encoded =
|
|
1338
|
+
let encoded = _chunkJAAIXHP6js.ABSOLUTE_URL_REGEX.test(href) ? new URL(href) : new URL(href, "http://localhost");
|
|
1339
1339
|
return {
|
|
1340
1340
|
pathname: encoded.pathname,
|
|
1341
1341
|
search: encoded.search,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* react-router v7.18.
|
|
2
|
+
* react-router v7.18.7
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -59,7 +59,7 @@ import {
|
|
|
59
59
|
withComponentProps,
|
|
60
60
|
withErrorBoundaryProps,
|
|
61
61
|
withHydrateFallbackProps
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-OCNYVWSN.mjs";
|
|
63
63
|
|
|
64
64
|
// lib/dom/ssr/server.tsx
|
|
65
65
|
import * as React from "react";
|
|
@@ -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 _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } 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.18.
|
|
2
|
+
* react-router v7.18.7
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|
|
5
5
|
*
|
|
@@ -835,12 +835,22 @@ function generatePath(originalPath, params = {}) {
|
|
|
835
835
|
validateDocumentNavigationTarget(result);
|
|
836
836
|
return result;
|
|
837
837
|
}
|
|
838
|
+
var MAX_OPTIONAL_PATH_SEGMENTS = 12;
|
|
838
839
|
function matchPath(pattern, pathname) {
|
|
839
840
|
if (typeof pattern === "string") {
|
|
840
841
|
pattern = { path: pattern, caseSensitive: false, end: true };
|
|
841
842
|
}
|
|
843
|
+
let { path } = pattern;
|
|
844
|
+
let optionalSegments = 0;
|
|
845
|
+
for (let index = path.indexOf("?"); index !== -1; index = path.indexOf("?", index + 1)) {
|
|
846
|
+
if (++optionalSegments > MAX_OPTIONAL_PATH_SEGMENTS) {
|
|
847
|
+
throw new Error(
|
|
848
|
+
`Path pattern ${JSON.stringify(path)} exceeds the limit of ${MAX_OPTIONAL_PATH_SEGMENTS} optional segments.`
|
|
849
|
+
);
|
|
850
|
+
}
|
|
851
|
+
}
|
|
842
852
|
let [matcher, compiledParams] = compilePath(
|
|
843
|
-
|
|
853
|
+
path,
|
|
844
854
|
pattern.caseSensitive,
|
|
845
855
|
pattern.end
|
|
846
856
|
);
|