react-router 7.11.0 → 7.12.0-pre.0

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 +46 -13
  2. package/dist/development/{browser-Cv4JZyZ5.d.mts → browser-BEPxnEBW.d.mts} +4 -2
  3. package/dist/{production/browser-Cv4JZyZ5.d.mts → development/browser-CJ9_du-U.d.ts} +4 -2
  4. package/dist/development/{chunk-YNUBSHFH.mjs → chunk-2RQJSHF5.mjs} +111 -11
  5. package/dist/development/{chunk-2JY4UAJA.js → chunk-AUGQXA25.js} +98 -108
  6. package/dist/{production/chunk-BEXOWXJO.js → development/chunk-JBLDGBX7.js} +7 -7
  7. package/dist/development/{chunk-JMJ3UQ3L.mjs → chunk-KYKH2NCS.mjs} +122 -50
  8. package/dist/development/{chunk-SZQUWNVJ.js → chunk-MNTWZBMV.js} +117 -35
  9. package/dist/development/dom-export.d.mts +2 -2
  10. package/dist/development/dom-export.d.ts +2 -2
  11. package/dist/development/dom-export.js +35 -30
  12. package/dist/development/dom-export.mjs +12 -7
  13. package/dist/development/{index-react-server-client-P7VgYu6T.d.mts → index-react-server-client-IoJGLOqV.d.mts} +3 -1
  14. package/dist/{production/index-react-server-client-Cv5Q9lf0.d.ts → development/index-react-server-client-gGyf-7Xp.d.ts} +3 -1
  15. package/dist/development/index-react-server-client.d.mts +2 -2
  16. package/dist/development/index-react-server-client.d.ts +2 -2
  17. package/dist/development/index-react-server-client.js +4 -4
  18. package/dist/development/index-react-server-client.mjs +2 -2
  19. package/dist/development/index-react-server.d.mts +3 -1
  20. package/dist/development/index-react-server.d.ts +3 -1
  21. package/dist/development/index-react-server.js +92 -7
  22. package/dist/development/index-react-server.mjs +92 -7
  23. package/dist/development/index.d.mts +9 -9
  24. package/dist/development/index.d.ts +9 -9
  25. package/dist/development/index.js +205 -101
  26. package/dist/development/index.mjs +7 -3
  27. package/dist/{production/instrumentation-BlrVzjbg.d.ts → development/instrumentation-DvHY1sgY.d.ts} +45 -1
  28. package/dist/development/lib/types/internal.d.mts +2 -2
  29. package/dist/development/lib/types/internal.d.ts +2 -2
  30. package/dist/development/lib/types/internal.js +1 -1
  31. package/dist/development/lib/types/internal.mjs +1 -1
  32. package/dist/development/{register-BGQUMCK4.d.ts → register-Bm80E9qL.d.ts} +1 -1
  33. package/dist/development/{register-DTJJbt1o.d.mts → register-CS_tiXsm.d.mts} +1 -1
  34. package/dist/development/{router-5fbeEIMQ.d.mts → router-5iOvts3c.d.mts} +45 -1
  35. package/dist/{development/browser-o-qhcuhA.d.ts → production/browser-BEPxnEBW.d.mts} +4 -2
  36. package/dist/production/{browser-o-qhcuhA.d.ts → browser-CJ9_du-U.d.ts} +4 -2
  37. package/dist/production/{chunk-TINMVEA2.mjs → chunk-HFQUWXEK.mjs} +122 -50
  38. package/dist/production/{chunk-E6GYEQUT.mjs → chunk-ILRYJQTC.mjs} +111 -11
  39. package/dist/{development/chunk-GNDLROV6.js → production/chunk-O6YLM5NB.js} +7 -7
  40. package/dist/production/{chunk-ZMYPVUNZ.js → chunk-QWJQISZK.js} +98 -108
  41. package/dist/production/{chunk-2HFJAX7U.js → chunk-ZR2NIBH2.js} +117 -35
  42. package/dist/production/dom-export.d.mts +2 -2
  43. package/dist/production/dom-export.d.ts +2 -2
  44. package/dist/production/dom-export.js +35 -30
  45. package/dist/production/dom-export.mjs +12 -7
  46. package/dist/production/{index-react-server-client-P7VgYu6T.d.mts → index-react-server-client-IoJGLOqV.d.mts} +3 -1
  47. package/dist/{development/index-react-server-client-Cv5Q9lf0.d.ts → production/index-react-server-client-gGyf-7Xp.d.ts} +3 -1
  48. package/dist/production/index-react-server-client.d.mts +2 -2
  49. package/dist/production/index-react-server-client.d.ts +2 -2
  50. package/dist/production/index-react-server-client.js +4 -4
  51. package/dist/production/index-react-server-client.mjs +2 -2
  52. package/dist/production/index-react-server.d.mts +3 -1
  53. package/dist/production/index-react-server.d.ts +3 -1
  54. package/dist/production/index-react-server.js +92 -7
  55. package/dist/production/index-react-server.mjs +92 -7
  56. package/dist/production/index.d.mts +9 -9
  57. package/dist/production/index.d.ts +9 -9
  58. package/dist/production/index.js +205 -101
  59. package/dist/production/index.mjs +7 -3
  60. package/dist/{development/instrumentation-BlrVzjbg.d.ts → production/instrumentation-DvHY1sgY.d.ts} +45 -1
  61. package/dist/production/lib/types/internal.d.mts +2 -2
  62. package/dist/production/lib/types/internal.d.ts +2 -2
  63. package/dist/production/lib/types/internal.js +1 -1
  64. package/dist/production/lib/types/internal.mjs +1 -1
  65. package/dist/production/{register-BGQUMCK4.d.ts → register-Bm80E9qL.d.ts} +1 -1
  66. package/dist/production/{register-DTJJbt1o.d.mts → register-CS_tiXsm.d.mts} +1 -1
  67. package/dist/production/{router-5fbeEIMQ.d.mts → router-5iOvts3c.d.mts} +45 -1
  68. 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.11.0
2
+ * react-router v7.12.0-pre.0
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -49,7 +49,8 @@
49
49
 
50
50
 
51
51
 
52
- var _chunk2HFJAX7Ujs = require('./chunk-2HFJAX7U.js');
52
+
53
+ var _chunkZR2NIBH2js = require('./chunk-ZR2NIBH2.js');
53
54
 
54
55
  // lib/dom/dom.ts
55
56
  var defaultMethod = "get";
@@ -120,7 +121,7 @@ var supportedFormEncTypes = /* @__PURE__ */ new Set([
120
121
  ]);
121
122
  function getFormEncType(encType) {
122
123
  if (encType != null && !supportedFormEncTypes.has(encType)) {
123
- _chunk2HFJAX7Ujs.warning.call(void 0,
124
+ _chunkZR2NIBH2js.warning.call(void 0,
124
125
  false,
125
126
  `"${encType}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${defaultEncType}"`
126
127
  );
@@ -136,7 +137,7 @@ function getFormSubmissionInfo(target, basename) {
136
137
  let body;
137
138
  if (isFormElement(target)) {
138
139
  let attr = target.getAttribute("action");
139
- action = attr ? _chunk2HFJAX7Ujs.stripBasename.call(void 0, attr, basename) : null;
140
+ action = attr ? _chunkZR2NIBH2js.stripBasename.call(void 0, attr, basename) : null;
140
141
  method = target.getAttribute("method") || defaultMethod;
141
142
  encType = getFormEncType(target.getAttribute("enctype")) || defaultEncType;
142
143
  formData = new FormData(target);
@@ -148,7 +149,7 @@ function getFormSubmissionInfo(target, basename) {
148
149
  );
149
150
  }
150
151
  let attr = target.getAttribute("formaction") || form.getAttribute("action");
151
- action = attr ? _chunk2HFJAX7Ujs.stripBasename.call(void 0, attr, basename) : null;
152
+ action = attr ? _chunkZR2NIBH2js.stripBasename.call(void 0, attr, basename) : null;
152
153
  method = target.getAttribute("formmethod") || form.getAttribute("method") || defaultMethod;
153
154
  encType = getFormEncType(target.getAttribute("formenctype")) || getFormEncType(form.getAttribute("enctype")) || defaultEncType;
154
155
  formData = new FormData(form, target);
@@ -185,20 +186,20 @@ var isBrowser = typeof window !== "undefined" && typeof window.document !== "und
185
186
  try {
186
187
  if (isBrowser) {
187
188
  window.__reactRouterVersion = // @ts-expect-error
188
- "7.11.0";
189
+ "7.12.0-pre.0";
189
190
  }
190
191
  } catch (e) {
191
192
  }
192
193
  function createBrowserRouter(routes, opts) {
193
- return _chunk2HFJAX7Ujs.createRouter.call(void 0, {
194
+ return _chunkZR2NIBH2js.createRouter.call(void 0, {
194
195
  basename: _optionalChain([opts, 'optionalAccess', _2 => _2.basename]),
195
196
  getContext: _optionalChain([opts, 'optionalAccess', _3 => _3.getContext]),
196
197
  future: _optionalChain([opts, 'optionalAccess', _4 => _4.future]),
197
- history: _chunk2HFJAX7Ujs.createBrowserHistory.call(void 0, { window: _optionalChain([opts, 'optionalAccess', _5 => _5.window]) }),
198
+ history: _chunkZR2NIBH2js.createBrowserHistory.call(void 0, { window: _optionalChain([opts, 'optionalAccess', _5 => _5.window]) }),
198
199
  hydrationData: _optionalChain([opts, 'optionalAccess', _6 => _6.hydrationData]) || parseHydrationData(),
199
200
  routes,
200
- mapRouteProperties: _chunk2HFJAX7Ujs.mapRouteProperties,
201
- hydrationRouteProperties: _chunk2HFJAX7Ujs.hydrationRouteProperties,
201
+ mapRouteProperties: _chunkZR2NIBH2js.mapRouteProperties,
202
+ hydrationRouteProperties: _chunkZR2NIBH2js.hydrationRouteProperties,
202
203
  dataStrategy: _optionalChain([opts, 'optionalAccess', _7 => _7.dataStrategy]),
203
204
  patchRoutesOnNavigation: _optionalChain([opts, 'optionalAccess', _8 => _8.patchRoutesOnNavigation]),
204
205
  window: _optionalChain([opts, 'optionalAccess', _9 => _9.window]),
@@ -206,15 +207,15 @@ function createBrowserRouter(routes, opts) {
206
207
  }).initialize();
207
208
  }
208
209
  function createHashRouter(routes, opts) {
209
- return _chunk2HFJAX7Ujs.createRouter.call(void 0, {
210
+ return _chunkZR2NIBH2js.createRouter.call(void 0, {
210
211
  basename: _optionalChain([opts, 'optionalAccess', _11 => _11.basename]),
211
212
  getContext: _optionalChain([opts, 'optionalAccess', _12 => _12.getContext]),
212
213
  future: _optionalChain([opts, 'optionalAccess', _13 => _13.future]),
213
- history: _chunk2HFJAX7Ujs.createHashHistory.call(void 0, { window: _optionalChain([opts, 'optionalAccess', _14 => _14.window]) }),
214
+ history: _chunkZR2NIBH2js.createHashHistory.call(void 0, { window: _optionalChain([opts, 'optionalAccess', _14 => _14.window]) }),
214
215
  hydrationData: _optionalChain([opts, 'optionalAccess', _15 => _15.hydrationData]) || parseHydrationData(),
215
216
  routes,
216
- mapRouteProperties: _chunk2HFJAX7Ujs.mapRouteProperties,
217
- hydrationRouteProperties: _chunk2HFJAX7Ujs.hydrationRouteProperties,
217
+ mapRouteProperties: _chunkZR2NIBH2js.mapRouteProperties,
218
+ hydrationRouteProperties: _chunkZR2NIBH2js.hydrationRouteProperties,
218
219
  dataStrategy: _optionalChain([opts, 'optionalAccess', _16 => _16.dataStrategy]),
219
220
  patchRoutesOnNavigation: _optionalChain([opts, 'optionalAccess', _17 => _17.patchRoutesOnNavigation]),
220
221
  window: _optionalChain([opts, 'optionalAccess', _18 => _18.window]),
@@ -237,7 +238,7 @@ function deserializeErrors(errors) {
237
238
  let serialized = {};
238
239
  for (let [key, val] of entries) {
239
240
  if (val && val.__type === "RouteErrorResponse") {
240
- serialized[key] = new (0, _chunk2HFJAX7Ujs.ErrorResponseImpl)(
241
+ serialized[key] = new (0, _chunkZR2NIBH2js.ErrorResponseImpl)(
241
242
  val.status,
242
243
  val.statusText,
243
244
  val.data,
@@ -274,7 +275,7 @@ function BrowserRouter({
274
275
  }) {
275
276
  let historyRef = React.useRef();
276
277
  if (historyRef.current == null) {
277
- historyRef.current = _chunk2HFJAX7Ujs.createBrowserHistory.call(void 0, { window: window2, v5Compat: true });
278
+ historyRef.current = _chunkZR2NIBH2js.createBrowserHistory.call(void 0, { window: window2, v5Compat: true });
278
279
  }
279
280
  let history = historyRef.current;
280
281
  let [state, setStateImpl] = React.useState({
@@ -293,7 +294,7 @@ function BrowserRouter({
293
294
  );
294
295
  React.useLayoutEffect(() => history.listen(setState), [history, setState]);
295
296
  return /* @__PURE__ */ React.createElement(
296
- _chunk2HFJAX7Ujs.Router,
297
+ _chunkZR2NIBH2js.Router,
297
298
  {
298
299
  basename,
299
300
  children,
@@ -312,7 +313,7 @@ function HashRouter({
312
313
  }) {
313
314
  let historyRef = React.useRef();
314
315
  if (historyRef.current == null) {
315
- historyRef.current = _chunk2HFJAX7Ujs.createHashHistory.call(void 0, { window: window2, v5Compat: true });
316
+ historyRef.current = _chunkZR2NIBH2js.createHashHistory.call(void 0, { window: window2, v5Compat: true });
316
317
  }
317
318
  let history = historyRef.current;
318
319
  let [state, setStateImpl] = React.useState({
@@ -331,7 +332,7 @@ function HashRouter({
331
332
  );
332
333
  React.useLayoutEffect(() => history.listen(setState), [history, setState]);
333
334
  return /* @__PURE__ */ React.createElement(
334
- _chunk2HFJAX7Ujs.Router,
335
+ _chunkZR2NIBH2js.Router,
335
336
  {
336
337
  basename,
337
338
  children,
@@ -364,7 +365,7 @@ function HistoryRouter({
364
365
  );
365
366
  React.useLayoutEffect(() => history.listen(setState), [history, setState]);
366
367
  return /* @__PURE__ */ React.createElement(
367
- _chunk2HFJAX7Ujs.Router,
368
+ _chunkZR2NIBH2js.Router,
368
369
  {
369
370
  basename,
370
371
  children,
@@ -393,12 +394,12 @@ var Link = React.forwardRef(
393
394
  unstable_defaultShouldRevalidate,
394
395
  ...rest
395
396
  }, forwardedRef) {
396
- let { basename, unstable_useTransitions } = React.useContext(_chunk2HFJAX7Ujs.NavigationContext);
397
+ let { basename, unstable_useTransitions } = React.useContext(_chunkZR2NIBH2js.NavigationContext);
397
398
  let isAbsolute = typeof to === "string" && ABSOLUTE_URL_REGEX.test(to);
398
- let parsed = _chunk2HFJAX7Ujs.parseToInfo.call(void 0, to, basename);
399
+ let parsed = _chunkZR2NIBH2js.parseToInfo.call(void 0, to, basename);
399
400
  to = parsed.to;
400
- let href = _chunk2HFJAX7Ujs.useHref.call(void 0, to, { relative });
401
- let [shouldPrefetch, prefetchRef, prefetchHandlers] = _chunk2HFJAX7Ujs.usePrefetchBehavior.call(void 0,
401
+ let href = _chunkZR2NIBH2js.useHref.call(void 0, to, { relative });
402
+ let [shouldPrefetch, prefetchRef, prefetchHandlers] = _chunkZR2NIBH2js.usePrefetchBehavior.call(void 0,
402
403
  prefetch,
403
404
  rest
404
405
  );
@@ -427,13 +428,13 @@ var Link = React.forwardRef(
427
428
  ...prefetchHandlers,
428
429
  href: parsed.absoluteURL || href,
429
430
  onClick: parsed.isExternal || reloadDocument ? onClick : handleClick,
430
- ref: _chunk2HFJAX7Ujs.mergeRefs.call(void 0, forwardedRef, prefetchRef),
431
+ ref: _chunkZR2NIBH2js.mergeRefs.call(void 0, forwardedRef, prefetchRef),
431
432
  target,
432
433
  "data-discover": !isAbsolute && discover === "render" ? "true" : void 0
433
434
  }
434
435
  )
435
436
  );
436
- return shouldPrefetch && !isAbsolute ? /* @__PURE__ */ React.createElement(React.Fragment, null, link, /* @__PURE__ */ React.createElement(_chunk2HFJAX7Ujs.PrefetchPageLinks, { page: href })) : link;
437
+ return shouldPrefetch && !isAbsolute ? /* @__PURE__ */ React.createElement(React.Fragment, null, link, /* @__PURE__ */ React.createElement(_chunkZR2NIBH2js.PrefetchPageLinks, { page: href })) : link;
437
438
  }
438
439
  );
439
440
  Link.displayName = "Link";
@@ -449,10 +450,10 @@ var NavLink = React.forwardRef(
449
450
  children,
450
451
  ...rest
451
452
  }, ref) {
452
- let path = _chunk2HFJAX7Ujs.useResolvedPath.call(void 0, to, { relative: rest.relative });
453
- let location = _chunk2HFJAX7Ujs.useLocation.call(void 0, );
454
- let routerState = React.useContext(_chunk2HFJAX7Ujs.DataRouterStateContext);
455
- let { navigator, basename } = React.useContext(_chunk2HFJAX7Ujs.NavigationContext);
453
+ let path = _chunkZR2NIBH2js.useResolvedPath.call(void 0, to, { relative: rest.relative });
454
+ let location = _chunkZR2NIBH2js.useLocation.call(void 0, );
455
+ let routerState = React.useContext(_chunkZR2NIBH2js.DataRouterStateContext);
456
+ let { navigator, basename } = React.useContext(_chunkZR2NIBH2js.NavigationContext);
456
457
  let isTransitioning = routerState != null && // Conditional usage is OK here because the usage of a data router is static
457
458
  // eslint-disable-next-line react-hooks/rules-of-hooks
458
459
  useViewTransitionState(path) && viewTransition === true;
@@ -465,7 +466,7 @@ var NavLink = React.forwardRef(
465
466
  toPathname = toPathname.toLowerCase();
466
467
  }
467
468
  if (nextLocationPathname && basename) {
468
- nextLocationPathname = _chunk2HFJAX7Ujs.stripBasename.call(void 0, nextLocationPathname, basename) || nextLocationPathname;
469
+ nextLocationPathname = _chunkZR2NIBH2js.stripBasename.call(void 0, nextLocationPathname, basename) || nextLocationPathname;
469
470
  }
470
471
  const endSlashPosition = toPathname !== "/" && toPathname.endsWith("/") ? toPathname.length - 1 : toPathname.length;
471
472
  let isActive = locationPathname === toPathname || !end && locationPathname.startsWith(toPathname) && locationPathname.charAt(endSlashPosition) === "/";
@@ -521,7 +522,7 @@ var Form = React.forwardRef(
521
522
  unstable_defaultShouldRevalidate,
522
523
  ...props
523
524
  }, forwardedRef) => {
524
- let { unstable_useTransitions } = React.useContext(_chunk2HFJAX7Ujs.NavigationContext);
525
+ let { unstable_useTransitions } = React.useContext(_chunkZR2NIBH2js.NavigationContext);
525
526
  let submit = useSubmit();
526
527
  let formAction = useFormAction(action, { relative });
527
528
  let formMethod = method.toLowerCase() === "get" ? "get" : "post";
@@ -568,10 +569,10 @@ function ScrollRestoration({
568
569
  storageKey,
569
570
  ...props
570
571
  }) {
571
- let remixContext = React.useContext(_chunk2HFJAX7Ujs.FrameworkContext);
572
- let { basename } = React.useContext(_chunk2HFJAX7Ujs.NavigationContext);
573
- let location = _chunk2HFJAX7Ujs.useLocation.call(void 0, );
574
- let matches = _chunk2HFJAX7Ujs.useMatches.call(void 0, );
572
+ let remixContext = React.useContext(_chunkZR2NIBH2js.FrameworkContext);
573
+ let { basename } = React.useContext(_chunkZR2NIBH2js.NavigationContext);
574
+ let location = _chunkZR2NIBH2js.useLocation.call(void 0, );
575
+ let matches = _chunkZR2NIBH2js.useMatches.call(void 0, );
575
576
  useScrollRestoration({ getKey, storageKey });
576
577
  let ssrKey = React.useMemo(
577
578
  () => {
@@ -613,9 +614,9 @@ function ScrollRestoration({
613
614
  ...props,
614
615
  suppressHydrationWarning: true,
615
616
  dangerouslySetInnerHTML: {
616
- __html: `(${restoreScroll})(${JSON.stringify(
617
- storageKey || SCROLL_RESTORATION_STORAGE_KEY
618
- )}, ${JSON.stringify(ssrKey)})`
617
+ __html: `(${restoreScroll})(${_chunkZR2NIBH2js.escapeHtml.call(void 0,
618
+ JSON.stringify(storageKey || SCROLL_RESTORATION_STORAGE_KEY)
619
+ )}, ${_chunkZR2NIBH2js.escapeHtml.call(void 0, JSON.stringify(ssrKey))})`
619
620
  }
620
621
  }
621
622
  );
@@ -625,13 +626,13 @@ function getDataRouterConsoleError(hookName) {
625
626
  return `${hookName} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
626
627
  }
627
628
  function useDataRouterContext(hookName) {
628
- let ctx = React.useContext(_chunk2HFJAX7Ujs.DataRouterContext);
629
- _chunk2HFJAX7Ujs.invariant.call(void 0, ctx, getDataRouterConsoleError(hookName));
629
+ let ctx = React.useContext(_chunkZR2NIBH2js.DataRouterContext);
630
+ _chunkZR2NIBH2js.invariant.call(void 0, ctx, getDataRouterConsoleError(hookName));
630
631
  return ctx;
631
632
  }
632
633
  function useDataRouterState(hookName) {
633
- let state = React.useContext(_chunk2HFJAX7Ujs.DataRouterStateContext);
634
- _chunk2HFJAX7Ujs.invariant.call(void 0, state, getDataRouterConsoleError(hookName));
634
+ let state = React.useContext(_chunkZR2NIBH2js.DataRouterStateContext);
635
+ _chunkZR2NIBH2js.invariant.call(void 0, state, getDataRouterConsoleError(hookName));
635
636
  return state;
636
637
  }
637
638
  function useLinkClickHandler(to, {
@@ -644,14 +645,14 @@ function useLinkClickHandler(to, {
644
645
  unstable_defaultShouldRevalidate,
645
646
  unstable_useTransitions
646
647
  } = {}) {
647
- let navigate = _chunk2HFJAX7Ujs.useNavigate.call(void 0, );
648
- let location = _chunk2HFJAX7Ujs.useLocation.call(void 0, );
649
- let path = _chunk2HFJAX7Ujs.useResolvedPath.call(void 0, to, { relative });
648
+ let navigate = _chunkZR2NIBH2js.useNavigate.call(void 0, );
649
+ let location = _chunkZR2NIBH2js.useLocation.call(void 0, );
650
+ let path = _chunkZR2NIBH2js.useResolvedPath.call(void 0, to, { relative });
650
651
  return React.useCallback(
651
652
  (event) => {
652
653
  if (shouldProcessLinkClick(event, target)) {
653
654
  event.preventDefault();
654
- let replace = replaceProp !== void 0 ? replaceProp : _chunk2HFJAX7Ujs.createPath.call(void 0, location) === _chunk2HFJAX7Ujs.createPath.call(void 0, path);
655
+ let replace = replaceProp !== void 0 ? replaceProp : _chunkZR2NIBH2js.createPath.call(void 0, location) === _chunkZR2NIBH2js.createPath.call(void 0, path);
655
656
  let doNavigate = () => navigate(to, {
656
657
  replace,
657
658
  state,
@@ -684,13 +685,13 @@ function useLinkClickHandler(to, {
684
685
  );
685
686
  }
686
687
  function useSearchParams(defaultInit) {
687
- _chunk2HFJAX7Ujs.warning.call(void 0,
688
+ _chunkZR2NIBH2js.warning.call(void 0,
688
689
  typeof URLSearchParams !== "undefined",
689
690
  `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.`
690
691
  );
691
692
  let defaultSearchParamsRef = React.useRef(createSearchParams(defaultInit));
692
693
  let hasSetSearchParamsRef = React.useRef(false);
693
- let location = _chunk2HFJAX7Ujs.useLocation.call(void 0, );
694
+ let location = _chunkZR2NIBH2js.useLocation.call(void 0, );
694
695
  let searchParams = React.useMemo(
695
696
  () => (
696
697
  // Only merge in the defaults if we haven't yet called setSearchParams.
@@ -703,7 +704,7 @@ function useSearchParams(defaultInit) {
703
704
  ),
704
705
  [location.search]
705
706
  );
706
- let navigate = _chunk2HFJAX7Ujs.useNavigate.call(void 0, );
707
+ let navigate = _chunkZR2NIBH2js.useNavigate.call(void 0, );
707
708
  let setSearchParams = React.useCallback(
708
709
  (nextInit, navigateOptions) => {
709
710
  const newSearchParams = createSearchParams(
@@ -720,8 +721,8 @@ var fetcherId = 0;
720
721
  var getUniqueFetcherId = () => `__${String(++fetcherId)}__`;
721
722
  function useSubmit() {
722
723
  let { router } = useDataRouterContext("useSubmit" /* UseSubmit */);
723
- let { basename } = React.useContext(_chunk2HFJAX7Ujs.NavigationContext);
724
- let currentRouteId = _chunk2HFJAX7Ujs.useRouteId.call(void 0, );
724
+ let { basename } = React.useContext(_chunkZR2NIBH2js.NavigationContext);
725
+ let currentRouteId = _chunkZR2NIBH2js.useRouteId.call(void 0, );
725
726
  let routerFetch = router.fetch;
726
727
  let routerNavigate = router.navigate;
727
728
  return React.useCallback(
@@ -761,12 +762,12 @@ function useSubmit() {
761
762
  );
762
763
  }
763
764
  function useFormAction(action, { relative } = {}) {
764
- let { basename } = React.useContext(_chunk2HFJAX7Ujs.NavigationContext);
765
- let routeContext = React.useContext(_chunk2HFJAX7Ujs.RouteContext);
766
- _chunk2HFJAX7Ujs.invariant.call(void 0, routeContext, "useFormAction must be used inside a RouteContext");
765
+ let { basename } = React.useContext(_chunkZR2NIBH2js.NavigationContext);
766
+ let routeContext = React.useContext(_chunkZR2NIBH2js.RouteContext);
767
+ _chunkZR2NIBH2js.invariant.call(void 0, routeContext, "useFormAction must be used inside a RouteContext");
767
768
  let [match] = routeContext.matches.slice(-1);
768
- let path = { ..._chunk2HFJAX7Ujs.useResolvedPath.call(void 0, action ? action : ".", { relative }) };
769
- let location = _chunk2HFJAX7Ujs.useLocation.call(void 0, );
769
+ let path = { ..._chunkZR2NIBH2js.useResolvedPath.call(void 0, action ? action : ".", { relative }) };
770
+ let location = _chunkZR2NIBH2js.useLocation.call(void 0, );
770
771
  if (action == null) {
771
772
  path.search = location.search;
772
773
  let params = new URLSearchParams(path.search);
@@ -783,21 +784,21 @@ function useFormAction(action, { relative } = {}) {
783
784
  path.search = path.search ? path.search.replace(/^\?/, "?index&") : "?index";
784
785
  }
785
786
  if (basename !== "/") {
786
- path.pathname = path.pathname === "/" ? basename : _chunk2HFJAX7Ujs.joinPaths.call(void 0, [basename, path.pathname]);
787
+ path.pathname = path.pathname === "/" ? basename : _chunkZR2NIBH2js.joinPaths.call(void 0, [basename, path.pathname]);
787
788
  }
788
- return _chunk2HFJAX7Ujs.createPath.call(void 0, path);
789
+ return _chunkZR2NIBH2js.createPath.call(void 0, path);
789
790
  }
790
791
  function useFetcher({
791
792
  key
792
793
  } = {}) {
793
794
  let { router } = useDataRouterContext("useFetcher" /* UseFetcher */);
794
795
  let state = useDataRouterState("useFetcher" /* UseFetcher */);
795
- let fetcherData = React.useContext(_chunk2HFJAX7Ujs.FetchersContext);
796
- let route = React.useContext(_chunk2HFJAX7Ujs.RouteContext);
796
+ let fetcherData = React.useContext(_chunkZR2NIBH2js.FetchersContext);
797
+ let route = React.useContext(_chunkZR2NIBH2js.RouteContext);
797
798
  let routeId = _optionalChain([route, 'access', _23 => _23.matches, 'access', _24 => _24[route.matches.length - 1], 'optionalAccess', _25 => _25.route, 'access', _26 => _26.id]);
798
- _chunk2HFJAX7Ujs.invariant.call(void 0, fetcherData, `useFetcher must be used inside a FetchersContext`);
799
- _chunk2HFJAX7Ujs.invariant.call(void 0, route, `useFetcher must be used inside a RouteContext`);
800
- _chunk2HFJAX7Ujs.invariant.call(void 0,
799
+ _chunkZR2NIBH2js.invariant.call(void 0, fetcherData, `useFetcher must be used inside a FetchersContext`);
800
+ _chunkZR2NIBH2js.invariant.call(void 0, route, `useFetcher must be used inside a RouteContext`);
801
+ _chunkZR2NIBH2js.invariant.call(void 0,
801
802
  routeId != null,
802
803
  `useFetcher can only be used on routes that contain a unique "id"`
803
804
  );
@@ -813,7 +814,7 @@ function useFetcher({
813
814
  }, [deleteFetcher, getFetcher, fetcherKey]);
814
815
  let load = React.useCallback(
815
816
  async (href, opts) => {
816
- _chunk2HFJAX7Ujs.invariant.call(void 0, routeId, "No routeId available for fetcher.load()");
817
+ _chunkZR2NIBH2js.invariant.call(void 0, routeId, "No routeId available for fetcher.load()");
817
818
  await routerFetch(fetcherKey, routeId, href, opts);
818
819
  },
819
820
  [fetcherKey, routeId, routerFetch]
@@ -842,7 +843,7 @@ function useFetcher({
842
843
  FetcherForm2.displayName = "fetcher.Form";
843
844
  return FetcherForm2;
844
845
  }, [fetcherKey]);
845
- let fetcher = state.fetchers.get(fetcherKey) || _chunk2HFJAX7Ujs.IDLE_FETCHER;
846
+ let fetcher = state.fetchers.get(fetcherKey) || _chunkZR2NIBH2js.IDLE_FETCHER;
846
847
  let data = fetcherData.get(fetcherKey);
847
848
  let fetcherWithComponents = React.useMemo(
848
849
  () => ({
@@ -873,7 +874,7 @@ function getScrollRestorationKey(location, matches, basename, getKey) {
873
874
  key = getKey(
874
875
  {
875
876
  ...location,
876
- pathname: _chunk2HFJAX7Ujs.stripBasename.call(void 0, location.pathname, basename) || location.pathname
877
+ pathname: _chunkZR2NIBH2js.stripBasename.call(void 0, location.pathname, basename) || location.pathname
877
878
  },
878
879
  matches
879
880
  );
@@ -894,10 +895,10 @@ function useScrollRestoration({
894
895
  let { restoreScrollPosition, preventScrollReset } = useDataRouterState(
895
896
  "useScrollRestoration" /* UseScrollRestoration */
896
897
  );
897
- let { basename } = React.useContext(_chunk2HFJAX7Ujs.NavigationContext);
898
- let location = _chunk2HFJAX7Ujs.useLocation.call(void 0, );
899
- let matches = _chunk2HFJAX7Ujs.useMatches.call(void 0, );
900
- let navigation = _chunk2HFJAX7Ujs.useNavigation.call(void 0, );
898
+ let { basename } = React.useContext(_chunkZR2NIBH2js.NavigationContext);
899
+ let location = _chunkZR2NIBH2js.useLocation.call(void 0, );
900
+ let matches = _chunkZR2NIBH2js.useMatches.call(void 0, );
901
+ let navigation = _chunkZR2NIBH2js.useNavigation.call(void 0, );
901
902
  React.useEffect(() => {
902
903
  window.history.scrollRestoration = "manual";
903
904
  return () => {
@@ -916,7 +917,7 @@ function useScrollRestoration({
916
917
  JSON.stringify(savedScrollPositions)
917
918
  );
918
919
  } catch (error) {
919
- _chunk2HFJAX7Ujs.warning.call(void 0,
920
+ _chunkZR2NIBH2js.warning.call(void 0,
920
921
  false,
921
922
  `Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${error}).`
922
923
  );
@@ -963,7 +964,7 @@ function useScrollRestoration({
963
964
  }
964
965
  }
965
966
  } catch (e2) {
966
- _chunk2HFJAX7Ujs.warning.call(void 0,
967
+ _chunkZR2NIBH2js.warning.call(void 0,
967
968
  false,
968
969
  `"${location.hash.slice(
969
970
  1
@@ -1001,7 +1002,7 @@ function usePrompt({
1001
1002
  when,
1002
1003
  message
1003
1004
  }) {
1004
- let blocker = _chunk2HFJAX7Ujs.useBlocker.call(void 0, when);
1005
+ let blocker = _chunkZR2NIBH2js.useBlocker.call(void 0, when);
1005
1006
  React.useEffect(() => {
1006
1007
  if (blocker.state === "blocked") {
1007
1008
  let proceed = window.confirm(message);
@@ -1019,21 +1020,21 @@ function usePrompt({
1019
1020
  }, [blocker, when]);
1020
1021
  }
1021
1022
  function useViewTransitionState(to, { relative } = {}) {
1022
- let vtContext = React.useContext(_chunk2HFJAX7Ujs.ViewTransitionContext);
1023
- _chunk2HFJAX7Ujs.invariant.call(void 0,
1023
+ let vtContext = React.useContext(_chunkZR2NIBH2js.ViewTransitionContext);
1024
+ _chunkZR2NIBH2js.invariant.call(void 0,
1024
1025
  vtContext != null,
1025
1026
  "`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"
1026
1027
  );
1027
1028
  let { basename } = useDataRouterContext(
1028
1029
  "useViewTransitionState" /* useViewTransitionState */
1029
1030
  );
1030
- let path = _chunk2HFJAX7Ujs.useResolvedPath.call(void 0, to, { relative });
1031
+ let path = _chunkZR2NIBH2js.useResolvedPath.call(void 0, to, { relative });
1031
1032
  if (!vtContext.isTransitioning) {
1032
1033
  return false;
1033
1034
  }
1034
- let currentPath = _chunk2HFJAX7Ujs.stripBasename.call(void 0, vtContext.currentLocation.pathname, basename) || vtContext.currentLocation.pathname;
1035
- let nextPath = _chunk2HFJAX7Ujs.stripBasename.call(void 0, vtContext.nextLocation.pathname, basename) || vtContext.nextLocation.pathname;
1036
- return _chunk2HFJAX7Ujs.matchPath.call(void 0, path.pathname, nextPath) != null || _chunk2HFJAX7Ujs.matchPath.call(void 0, path.pathname, currentPath) != null;
1035
+ let currentPath = _chunkZR2NIBH2js.stripBasename.call(void 0, vtContext.currentLocation.pathname, basename) || vtContext.currentLocation.pathname;
1036
+ let nextPath = _chunkZR2NIBH2js.stripBasename.call(void 0, vtContext.nextLocation.pathname, basename) || vtContext.nextLocation.pathname;
1037
+ return _chunkZR2NIBH2js.matchPath.call(void 0, path.pathname, nextPath) != null || _chunkZR2NIBH2js.matchPath.call(void 0, path.pathname, currentPath) != null;
1037
1038
  }
1038
1039
 
1039
1040
  // lib/dom/server.tsx
@@ -1044,7 +1045,7 @@ function StaticRouter({
1044
1045
  location: locationProp = "/"
1045
1046
  }) {
1046
1047
  if (typeof locationProp === "string") {
1047
- locationProp = _chunk2HFJAX7Ujs.parsePath.call(void 0, locationProp);
1048
+ locationProp = _chunkZR2NIBH2js.parsePath.call(void 0, locationProp);
1048
1049
  }
1049
1050
  let action = "POP" /* Pop */;
1050
1051
  let location = {
@@ -1056,7 +1057,7 @@ function StaticRouter({
1056
1057
  };
1057
1058
  let staticNavigator = getStatelessNavigator();
1058
1059
  return /* @__PURE__ */ React2.createElement(
1059
- _chunk2HFJAX7Ujs.Router,
1060
+ _chunkZR2NIBH2js.Router,
1060
1061
  {
1061
1062
  basename,
1062
1063
  children,
@@ -1074,7 +1075,7 @@ function StaticRouterProvider({
1074
1075
  hydrate = true,
1075
1076
  nonce
1076
1077
  }) {
1077
- _chunk2HFJAX7Ujs.invariant.call(void 0,
1078
+ _chunkZR2NIBH2js.invariant.call(void 0,
1078
1079
  router && context,
1079
1080
  "You must provide `router` and `context` to <StaticRouterProvider>"
1080
1081
  );
@@ -1093,12 +1094,12 @@ function StaticRouterProvider({
1093
1094
  actionData: context.actionData,
1094
1095
  errors: serializeErrors(context.errors)
1095
1096
  };
1096
- let json = htmlEscape(JSON.stringify(JSON.stringify(data)));
1097
+ let json = _chunkZR2NIBH2js.escapeHtml.call(void 0, JSON.stringify(JSON.stringify(data)));
1097
1098
  hydrateScript = `window.__staticRouterHydrationData = JSON.parse(${json});`;
1098
1099
  }
1099
1100
  let { state } = dataRouterContext.router;
1100
- return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(_chunk2HFJAX7Ujs.DataRouterContext.Provider, { value: dataRouterContext }, /* @__PURE__ */ React2.createElement(_chunk2HFJAX7Ujs.DataRouterStateContext.Provider, { value: state }, /* @__PURE__ */ React2.createElement(_chunk2HFJAX7Ujs.FetchersContext.Provider, { value: fetchersContext }, /* @__PURE__ */ React2.createElement(_chunk2HFJAX7Ujs.ViewTransitionContext.Provider, { value: { isTransitioning: false } }, /* @__PURE__ */ React2.createElement(
1101
- _chunk2HFJAX7Ujs.Router,
1101
+ return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(_chunkZR2NIBH2js.DataRouterContext.Provider, { value: dataRouterContext }, /* @__PURE__ */ React2.createElement(_chunkZR2NIBH2js.DataRouterStateContext.Provider, { value: state }, /* @__PURE__ */ React2.createElement(_chunkZR2NIBH2js.FetchersContext.Provider, { value: fetchersContext }, /* @__PURE__ */ React2.createElement(_chunkZR2NIBH2js.ViewTransitionContext.Provider, { value: { isTransitioning: false } }, /* @__PURE__ */ React2.createElement(
1102
+ _chunkZR2NIBH2js.Router,
1102
1103
  {
1103
1104
  basename: dataRouterContext.basename,
1104
1105
  location: state.location,
@@ -1129,14 +1130,14 @@ function DataRoutes({
1129
1130
  future,
1130
1131
  state
1131
1132
  }) {
1132
- return _chunk2HFJAX7Ujs.useRoutesImpl.call(void 0, routes, void 0, state, void 0, future);
1133
+ return _chunkZR2NIBH2js.useRoutesImpl.call(void 0, routes, void 0, state, void 0, future);
1133
1134
  }
1134
1135
  function serializeErrors(errors) {
1135
1136
  if (!errors) return null;
1136
1137
  let entries = Object.entries(errors);
1137
1138
  let serialized = {};
1138
1139
  for (let [key, val] of entries) {
1139
- if (_chunk2HFJAX7Ujs.isRouteErrorResponse.call(void 0, val)) {
1140
+ if (_chunkZR2NIBH2js.isRouteErrorResponse.call(void 0, val)) {
1140
1141
  serialized[key] = { ...val, __type: "RouteErrorResponse" };
1141
1142
  } else if (val instanceof Error) {
1142
1143
  serialized[key] = {
@@ -1186,16 +1187,16 @@ function getStatelessNavigator() {
1186
1187
  };
1187
1188
  }
1188
1189
  function createStaticHandler2(routes, opts) {
1189
- return _chunk2HFJAX7Ujs.createStaticHandler.call(void 0, routes, {
1190
+ return _chunkZR2NIBH2js.createStaticHandler.call(void 0, routes, {
1190
1191
  ...opts,
1191
- mapRouteProperties: _chunk2HFJAX7Ujs.mapRouteProperties
1192
+ mapRouteProperties: _chunkZR2NIBH2js.mapRouteProperties
1192
1193
  });
1193
1194
  }
1194
1195
  function createStaticRouter(routes, context, opts = {}) {
1195
1196
  let manifest = {};
1196
- let dataRoutes = _chunk2HFJAX7Ujs.convertRoutesToDataRoutes.call(void 0,
1197
+ let dataRoutes = _chunkZR2NIBH2js.convertRoutesToDataRoutes.call(void 0,
1197
1198
  routes,
1198
- _chunk2HFJAX7Ujs.mapRouteProperties,
1199
+ _chunkZR2NIBH2js.mapRouteProperties,
1199
1200
  void 0,
1200
1201
  manifest
1201
1202
  );
@@ -1226,7 +1227,7 @@ function createStaticRouter(routes, context, opts = {}) {
1226
1227
  actionData: context.actionData,
1227
1228
  errors: context.errors,
1228
1229
  initialized: true,
1229
- navigation: _chunk2HFJAX7Ujs.IDLE_NAVIGATION,
1230
+ navigation: _chunkZR2NIBH2js.IDLE_NAVIGATION,
1230
1231
  restoreScrollPosition: null,
1231
1232
  preventScrollReset: false,
1232
1233
  revalidation: "idle",
@@ -1261,7 +1262,7 @@ function createStaticRouter(routes, context, opts = {}) {
1261
1262
  createHref,
1262
1263
  encodeLocation,
1263
1264
  getFetcher() {
1264
- return _chunk2HFJAX7Ujs.IDLE_FETCHER;
1265
+ return _chunkZR2NIBH2js.IDLE_FETCHER;
1265
1266
  },
1266
1267
  deleteFetcher() {
1267
1268
  throw msg("deleteFetcher");
@@ -1273,7 +1274,7 @@ function createStaticRouter(routes, context, opts = {}) {
1273
1274
  throw msg("dispose");
1274
1275
  },
1275
1276
  getBlocker() {
1276
- return _chunk2HFJAX7Ujs.IDLE_BLOCKER;
1277
+ return _chunkZR2NIBH2js.IDLE_BLOCKER;
1277
1278
  },
1278
1279
  deleteBlocker() {
1279
1280
  throw msg("deleteBlocker");
@@ -1291,10 +1292,10 @@ function createStaticRouter(routes, context, opts = {}) {
1291
1292
  };
1292
1293
  }
1293
1294
  function createHref(to) {
1294
- return typeof to === "string" ? to : _chunk2HFJAX7Ujs.createPath.call(void 0, to);
1295
+ return typeof to === "string" ? to : _chunkZR2NIBH2js.createPath.call(void 0, to);
1295
1296
  }
1296
1297
  function encodeLocation(to) {
1297
- let href = typeof to === "string" ? to : _chunk2HFJAX7Ujs.createPath.call(void 0, to);
1298
+ let href = typeof to === "string" ? to : _chunkZR2NIBH2js.createPath.call(void 0, to);
1298
1299
  href = href.replace(/ $/, "%20");
1299
1300
  let encoded = ABSOLUTE_URL_REGEX2.test(href) ? new URL(href) : new URL(href, "http://localhost");
1300
1301
  return {
@@ -1304,17 +1305,6 @@ function encodeLocation(to) {
1304
1305
  };
1305
1306
  }
1306
1307
  var ABSOLUTE_URL_REGEX2 = /^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;
1307
- var ESCAPE_LOOKUP = {
1308
- "&": "\\u0026",
1309
- ">": "\\u003e",
1310
- "<": "\\u003c",
1311
- "\u2028": "\\u2028",
1312
- "\u2029": "\\u2029"
1313
- };
1314
- var ESCAPE_REGEX = /[&><\u2028\u2029]/g;
1315
- function htmlEscape(str) {
1316
- return str.replace(ESCAPE_REGEX, (match) => ESCAPE_LOOKUP[match]);
1317
- }
1318
1308
 
1319
1309
 
1320
1310