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