react-router 7.18.0 → 8.0.0-pre.1

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 (285) hide show
  1. package/dist/development/dom-export.d.ts +6 -172
  2. package/dist/development/dom-export.js +12 -1009
  3. package/dist/development/index-react-server-client.d.ts +7 -4
  4. package/dist/development/index-react-server-client.js +8 -52
  5. package/dist/development/index-react-server.d.ts +1650 -1641
  6. package/dist/development/index-react-server.js +2882 -3664
  7. package/dist/development/index.d.ts +42 -1476
  8. package/dist/development/index.js +36 -2553
  9. package/dist/development/lib/actions.js +50 -0
  10. package/dist/development/lib/components.d.ts +1030 -0
  11. package/dist/development/lib/components.js +841 -0
  12. package/dist/development/lib/context.d.ts +83 -0
  13. package/dist/development/lib/context.js +41 -0
  14. package/dist/development/lib/dom/dom.d.ts +119 -0
  15. package/dist/development/lib/dom/dom.js +143 -0
  16. package/dist/development/lib/dom/lib.d.ts +2053 -0
  17. package/dist/development/lib/dom/lib.js +1271 -0
  18. package/dist/development/lib/dom/server.d.ts +138 -0
  19. package/dist/development/lib/dom/server.js +301 -0
  20. package/dist/development/lib/dom/ssr/components.d.ts +198 -0
  21. package/dist/development/lib/dom/ssr/components.js +589 -0
  22. package/dist/development/lib/dom/ssr/data.js +29 -0
  23. package/dist/development/lib/dom/ssr/entry.d.ts +60 -0
  24. package/dist/development/lib/dom/ssr/errorBoundaries.d.ts +27 -0
  25. package/dist/development/lib/dom/ssr/errorBoundaries.js +87 -0
  26. package/dist/development/lib/dom/ssr/fallback.js +33 -0
  27. package/dist/development/lib/dom/ssr/fog-of-war.d.ts +12 -0
  28. package/dist/development/lib/dom/ssr/fog-of-war.js +180 -0
  29. package/dist/development/lib/dom/ssr/hydration.d.ts +32 -0
  30. package/dist/development/lib/dom/ssr/hydration.js +29 -0
  31. package/dist/development/lib/dom/ssr/invariant.js +16 -0
  32. package/dist/development/lib/dom/ssr/links.js +170 -0
  33. package/dist/development/lib/dom/ssr/markup.js +24 -0
  34. package/dist/development/lib/dom/ssr/routeModules.d.ts +206 -0
  35. package/dist/development/lib/dom/ssr/routeModules.js +31 -0
  36. package/dist/development/lib/dom/ssr/routes-test-stub.d.ts +62 -0
  37. package/dist/development/lib/dom/ssr/routes-test-stub.js +108 -0
  38. package/dist/development/lib/dom/ssr/routes.d.ts +33 -0
  39. package/dist/development/lib/dom/ssr/routes.js +303 -0
  40. package/dist/development/lib/dom/ssr/server.d.ts +48 -0
  41. package/dist/development/lib/dom/ssr/server.js +69 -0
  42. package/dist/development/lib/dom/ssr/single-fetch.d.ts +14 -0
  43. package/dist/development/lib/dom/ssr/single-fetch.js +345 -0
  44. package/dist/development/lib/dom-export/dom-router-provider.d.ts +9 -0
  45. package/dist/development/lib/dom-export/dom-router-provider.js +22 -0
  46. package/dist/development/lib/dom-export/hydrated-router.d.ts +125 -0
  47. package/dist/development/lib/dom-export/hydrated-router.js +150 -0
  48. package/dist/development/lib/errors.js +29 -0
  49. package/dist/development/lib/hooks.d.ts +947 -0
  50. package/dist/development/lib/hooks.js +1388 -0
  51. package/dist/development/lib/href.d.ts +20 -0
  52. package/dist/development/lib/href.js +50 -0
  53. package/dist/development/lib/router/history.d.ts +258 -0
  54. package/dist/development/lib/router/history.js +372 -0
  55. package/dist/development/lib/router/instrumentation.d.ts +86 -0
  56. package/dist/development/lib/router/instrumentation.js +213 -0
  57. package/dist/development/lib/router/links.d.ts +114 -0
  58. package/dist/development/lib/router/router.d.ts +663 -0
  59. package/dist/development/lib/router/router.js +2988 -0
  60. package/dist/development/lib/router/url.js +18 -0
  61. package/dist/development/lib/router/utils.d.ts +948 -0
  62. package/dist/development/lib/router/utils.js +810 -0
  63. package/dist/development/lib/rsc/browser.d.ts +137 -0
  64. package/dist/development/lib/rsc/browser.js +603 -0
  65. package/dist/development/lib/rsc/errorBoundaries.d.ts +11 -0
  66. package/dist/development/lib/rsc/errorBoundaries.js +90 -0
  67. package/dist/development/lib/rsc/html-stream/browser.d.ts +48 -0
  68. package/dist/development/lib/rsc/html-stream/browser.js +74 -0
  69. package/dist/development/lib/rsc/html-stream/server.js +78 -0
  70. package/dist/development/lib/rsc/route-modules.js +27 -0
  71. package/dist/development/lib/rsc/server.rsc.d.ts +219 -0
  72. package/dist/development/lib/rsc/server.ssr.d.ts +129 -0
  73. package/dist/development/lib/rsc/server.ssr.js +404 -0
  74. package/dist/development/lib/server-runtime/build.d.ts +66 -0
  75. package/dist/development/lib/server-runtime/cookies.d.ts +66 -0
  76. package/dist/development/lib/server-runtime/cookies.js +139 -0
  77. package/dist/development/lib/server-runtime/crypto.js +43 -0
  78. package/dist/development/lib/server-runtime/data.d.ts +13 -0
  79. package/dist/development/lib/server-runtime/data.js +25 -0
  80. package/dist/development/lib/server-runtime/dev.d.ts +9 -0
  81. package/dist/development/lib/server-runtime/dev.js +26 -0
  82. package/dist/development/lib/server-runtime/entry.js +20 -0
  83. package/dist/development/lib/server-runtime/errors.js +75 -0
  84. package/dist/development/lib/server-runtime/headers.js +73 -0
  85. package/dist/development/lib/server-runtime/invariant.js +19 -0
  86. package/dist/development/lib/server-runtime/mode.d.ts +12 -0
  87. package/dist/development/lib/server-runtime/mode.js +25 -0
  88. package/dist/development/lib/server-runtime/routeMatching.js +28 -0
  89. package/dist/development/lib/server-runtime/routes.d.ts +13 -0
  90. package/dist/development/lib/server-runtime/routes.js +74 -0
  91. package/dist/development/lib/server-runtime/server.d.ts +10 -0
  92. package/dist/development/lib/server-runtime/server.js +345 -0
  93. package/dist/development/lib/server-runtime/serverHandoff.js +17 -0
  94. package/dist/development/lib/server-runtime/sessions/cookieStorage.d.ts +25 -0
  95. package/dist/development/lib/server-runtime/sessions/cookieStorage.js +45 -0
  96. package/dist/development/lib/server-runtime/sessions/memoryStorage.d.ts +23 -0
  97. package/dist/development/lib/server-runtime/sessions/memoryStorage.js +52 -0
  98. package/dist/development/lib/server-runtime/sessions.d.ts +145 -0
  99. package/dist/development/lib/server-runtime/sessions.js +98 -0
  100. package/dist/development/lib/server-runtime/single-fetch.d.ts +7 -0
  101. package/dist/development/lib/server-runtime/single-fetch.js +215 -0
  102. package/dist/development/lib/server-runtime/urls.js +28 -0
  103. package/dist/development/lib/server-runtime/warnings.js +20 -0
  104. package/dist/development/lib/types/future.d.ts +9 -0
  105. package/dist/development/lib/types/internal.d.ts +26 -177
  106. package/dist/development/lib/types/internal.js +3 -2
  107. package/dist/development/{register-roq_0qYo.d.ts → lib/types/register.d.ts} +9 -15
  108. package/dist/development/lib/types/route-data.d.ts +113 -0
  109. package/dist/development/lib/types/route-module-annotations.d.ts +149 -0
  110. package/dist/development/lib/types/route-module.d.ts +19 -0
  111. package/dist/development/lib/types/serializes-to.d.ts +13 -0
  112. package/dist/development/lib/types/utils.d.ts +11 -0
  113. package/dist/development/vendor/turbo-stream-v2/flatten.js +159 -0
  114. package/dist/development/vendor/turbo-stream-v2/turbo-stream.js +179 -0
  115. package/dist/development/vendor/turbo-stream-v2/unflatten.js +199 -0
  116. package/dist/development/vendor/turbo-stream-v2/utils.js +39 -0
  117. package/dist/production/dom-export.d.ts +6 -172
  118. package/dist/production/dom-export.js +12 -1009
  119. package/dist/production/index-react-server-client.d.ts +7 -4
  120. package/dist/production/index-react-server-client.js +8 -52
  121. package/dist/production/index-react-server.d.ts +1650 -1641
  122. package/dist/production/index-react-server.js +2873 -3664
  123. package/dist/production/index.d.ts +42 -1476
  124. package/dist/production/index.js +36 -2553
  125. package/dist/production/lib/actions.js +50 -0
  126. package/dist/production/lib/components.d.ts +1030 -0
  127. package/dist/production/lib/components.js +841 -0
  128. package/dist/production/lib/context.d.ts +83 -0
  129. package/dist/production/lib/context.js +41 -0
  130. package/dist/production/lib/dom/dom.d.ts +119 -0
  131. package/dist/production/lib/dom/dom.js +143 -0
  132. package/dist/production/lib/dom/lib.d.ts +2053 -0
  133. package/dist/production/lib/dom/lib.js +1271 -0
  134. package/dist/production/lib/dom/server.d.ts +138 -0
  135. package/dist/production/lib/dom/server.js +301 -0
  136. package/dist/production/lib/dom/ssr/components.d.ts +198 -0
  137. package/dist/production/lib/dom/ssr/components.js +589 -0
  138. package/dist/production/lib/dom/ssr/data.js +29 -0
  139. package/dist/production/lib/dom/ssr/entry.d.ts +60 -0
  140. package/dist/production/lib/dom/ssr/errorBoundaries.d.ts +27 -0
  141. package/dist/production/lib/dom/ssr/errorBoundaries.js +87 -0
  142. package/dist/production/lib/dom/ssr/fallback.js +23 -0
  143. package/dist/production/lib/dom/ssr/fog-of-war.d.ts +12 -0
  144. package/dist/production/lib/dom/ssr/fog-of-war.js +180 -0
  145. package/dist/production/lib/dom/ssr/hydration.d.ts +32 -0
  146. package/dist/production/lib/dom/ssr/hydration.js +29 -0
  147. package/dist/production/lib/dom/ssr/invariant.js +16 -0
  148. package/dist/production/lib/dom/ssr/links.js +170 -0
  149. package/dist/production/lib/dom/ssr/markup.js +24 -0
  150. package/dist/production/lib/dom/ssr/routeModules.d.ts +206 -0
  151. package/dist/production/lib/dom/ssr/routeModules.js +31 -0
  152. package/dist/production/lib/dom/ssr/routes-test-stub.d.ts +62 -0
  153. package/dist/production/lib/dom/ssr/routes-test-stub.js +108 -0
  154. package/dist/production/lib/dom/ssr/routes.d.ts +33 -0
  155. package/dist/production/lib/dom/ssr/routes.js +303 -0
  156. package/dist/production/lib/dom/ssr/server.d.ts +48 -0
  157. package/dist/production/lib/dom/ssr/server.js +69 -0
  158. package/dist/production/lib/dom/ssr/single-fetch.d.ts +14 -0
  159. package/dist/production/lib/dom/ssr/single-fetch.js +345 -0
  160. package/dist/production/lib/dom-export/dom-router-provider.d.ts +9 -0
  161. package/dist/production/lib/dom-export/dom-router-provider.js +22 -0
  162. package/dist/production/lib/dom-export/hydrated-router.d.ts +125 -0
  163. package/dist/production/lib/dom-export/hydrated-router.js +150 -0
  164. package/dist/production/lib/errors.js +29 -0
  165. package/dist/production/lib/hooks.d.ts +947 -0
  166. package/dist/production/lib/hooks.js +1373 -0
  167. package/dist/production/lib/href.d.ts +20 -0
  168. package/dist/production/lib/href.js +50 -0
  169. package/dist/production/lib/router/history.d.ts +258 -0
  170. package/dist/production/lib/router/history.js +372 -0
  171. package/dist/production/lib/router/instrumentation.d.ts +86 -0
  172. package/dist/production/lib/router/instrumentation.js +213 -0
  173. package/dist/production/lib/router/links.d.ts +114 -0
  174. package/dist/production/lib/router/router.d.ts +663 -0
  175. package/dist/production/lib/router/router.js +2988 -0
  176. package/dist/production/lib/router/url.js +18 -0
  177. package/dist/production/lib/router/utils.d.ts +948 -0
  178. package/dist/production/lib/router/utils.js +801 -0
  179. package/dist/production/lib/rsc/browser.d.ts +137 -0
  180. package/dist/production/lib/rsc/browser.js +603 -0
  181. package/dist/production/lib/rsc/errorBoundaries.d.ts +11 -0
  182. package/dist/production/lib/rsc/errorBoundaries.js +90 -0
  183. package/dist/production/lib/rsc/html-stream/browser.d.ts +48 -0
  184. package/dist/production/lib/rsc/html-stream/browser.js +74 -0
  185. package/dist/production/lib/rsc/html-stream/server.js +78 -0
  186. package/dist/production/lib/rsc/route-modules.js +27 -0
  187. package/dist/production/lib/rsc/server.rsc.d.ts +219 -0
  188. package/dist/production/lib/rsc/server.ssr.d.ts +129 -0
  189. package/dist/production/lib/rsc/server.ssr.js +404 -0
  190. package/dist/production/lib/server-runtime/build.d.ts +66 -0
  191. package/dist/production/lib/server-runtime/cookies.d.ts +66 -0
  192. package/dist/production/lib/server-runtime/cookies.js +139 -0
  193. package/dist/production/lib/server-runtime/crypto.js +43 -0
  194. package/dist/production/lib/server-runtime/data.d.ts +13 -0
  195. package/dist/production/lib/server-runtime/data.js +25 -0
  196. package/dist/production/lib/server-runtime/dev.d.ts +9 -0
  197. package/dist/production/lib/server-runtime/dev.js +26 -0
  198. package/dist/production/lib/server-runtime/entry.js +20 -0
  199. package/dist/production/lib/server-runtime/errors.js +75 -0
  200. package/dist/production/lib/server-runtime/headers.js +73 -0
  201. package/dist/production/lib/server-runtime/invariant.js +19 -0
  202. package/dist/production/lib/server-runtime/mode.d.ts +12 -0
  203. package/dist/production/lib/server-runtime/mode.js +25 -0
  204. package/dist/production/lib/server-runtime/routeMatching.js +28 -0
  205. package/dist/production/lib/server-runtime/routes.d.ts +13 -0
  206. package/dist/production/lib/server-runtime/routes.js +74 -0
  207. package/dist/production/lib/server-runtime/server.d.ts +10 -0
  208. package/dist/production/lib/server-runtime/server.js +345 -0
  209. package/dist/production/lib/server-runtime/serverHandoff.js +17 -0
  210. package/dist/production/lib/server-runtime/sessions/cookieStorage.d.ts +25 -0
  211. package/dist/production/lib/server-runtime/sessions/cookieStorage.js +45 -0
  212. package/dist/production/lib/server-runtime/sessions/memoryStorage.d.ts +23 -0
  213. package/dist/production/lib/server-runtime/sessions/memoryStorage.js +52 -0
  214. package/dist/production/lib/server-runtime/sessions.d.ts +145 -0
  215. package/dist/production/lib/server-runtime/sessions.js +98 -0
  216. package/dist/production/lib/server-runtime/single-fetch.d.ts +7 -0
  217. package/dist/production/lib/server-runtime/single-fetch.js +215 -0
  218. package/dist/production/lib/server-runtime/urls.js +28 -0
  219. package/dist/production/lib/server-runtime/warnings.js +20 -0
  220. package/dist/production/lib/types/future.d.ts +9 -0
  221. package/dist/production/lib/types/internal.d.ts +26 -177
  222. package/dist/production/lib/types/internal.js +3 -2
  223. package/dist/production/{register-roq_0qYo.d.ts → lib/types/register.d.ts} +9 -15
  224. package/dist/production/lib/types/route-data.d.ts +113 -0
  225. package/dist/production/lib/types/route-module-annotations.d.ts +149 -0
  226. package/dist/production/lib/types/route-module.d.ts +19 -0
  227. package/dist/production/lib/types/serializes-to.d.ts +13 -0
  228. package/dist/production/lib/types/utils.d.ts +11 -0
  229. package/dist/production/vendor/turbo-stream-v2/flatten.js +159 -0
  230. package/dist/production/vendor/turbo-stream-v2/turbo-stream.js +179 -0
  231. package/dist/production/vendor/turbo-stream-v2/unflatten.js +199 -0
  232. package/dist/production/vendor/turbo-stream-v2/utils.js +39 -0
  233. package/docs/explanation/code-splitting.md +16 -0
  234. package/docs/how-to/middleware.md +6 -41
  235. package/docs/how-to/react-server-components.md +1 -1
  236. package/docs/upgrading/future.md +0 -249
  237. package/package.json +43 -87
  238. package/dist/development/browser-B2PdsXXH.d.ts +0 -318
  239. package/dist/development/browser-DBmQ1yAR.d.mts +0 -318
  240. package/dist/development/chunk-4ZMWKKQ3.mjs +0 -11606
  241. package/dist/development/chunk-E4MTK73K.mjs +0 -2517
  242. package/dist/development/chunk-U7ORXROY.js +0 -10307
  243. package/dist/development/chunk-WW7PN6QI.js +0 -188
  244. package/dist/development/chunk-YL5M26XI.js +0 -1366
  245. package/dist/development/context-CeD5LmaF.d.mts +0 -1779
  246. package/dist/development/data-CjO11-hU.d.ts +0 -1740
  247. package/dist/development/data-DEjBmEfD.d.mts +0 -1740
  248. package/dist/development/dom-export.d.mts +0 -172
  249. package/dist/development/dom-export.mjs +0 -1010
  250. package/dist/development/index-react-server-client-3ykjivgQ.d.ts +0 -3677
  251. package/dist/development/index-react-server-client-CACgcj2J.d.mts +0 -2614
  252. package/dist/development/index-react-server-client.d.mts +0 -4
  253. package/dist/development/index-react-server-client.mjs +0 -59
  254. package/dist/development/index-react-server.d.mts +0 -2711
  255. package/dist/development/index-react-server.mjs +0 -3803
  256. package/dist/development/index.d.mts +0 -1479
  257. package/dist/development/index.mjs +0 -275
  258. package/dist/development/instrumentation-Dkmpzd13.d.ts +0 -715
  259. package/dist/development/lib/types/internal.d.mts +0 -184
  260. package/dist/development/lib/types/internal.mjs +0 -10
  261. package/dist/development/register-CmkRspdl.d.mts +0 -30
  262. package/dist/production/browser-B2PdsXXH.d.ts +0 -318
  263. package/dist/production/browser-DBmQ1yAR.d.mts +0 -318
  264. package/dist/production/chunk-3Z6WS2WZ.js +0 -188
  265. package/dist/production/chunk-BIP66BKV.js +0 -1366
  266. package/dist/production/chunk-EGOTSXNH.mjs +0 -2517
  267. package/dist/production/chunk-IUPBOWYO.js +0 -10307
  268. package/dist/production/chunk-M7NGGUU6.mjs +0 -11606
  269. package/dist/production/context-CeD5LmaF.d.mts +0 -1779
  270. package/dist/production/data-CjO11-hU.d.ts +0 -1740
  271. package/dist/production/data-DEjBmEfD.d.mts +0 -1740
  272. package/dist/production/dom-export.d.mts +0 -172
  273. package/dist/production/dom-export.mjs +0 -1010
  274. package/dist/production/index-react-server-client-3ykjivgQ.d.ts +0 -3677
  275. package/dist/production/index-react-server-client-CACgcj2J.d.mts +0 -2614
  276. package/dist/production/index-react-server-client.d.mts +0 -4
  277. package/dist/production/index-react-server-client.mjs +0 -59
  278. package/dist/production/index-react-server.d.mts +0 -2711
  279. package/dist/production/index-react-server.mjs +0 -3803
  280. package/dist/production/index.d.mts +0 -1479
  281. package/dist/production/index.mjs +0 -275
  282. package/dist/production/instrumentation-Dkmpzd13.d.ts +0 -715
  283. package/dist/production/lib/types/internal.d.mts +0 -184
  284. package/dist/production/lib/types/internal.mjs +0 -10
  285. package/dist/production/register-CmkRspdl.d.mts +0 -30
@@ -1,1366 +0,0 @@
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.0
3
- *
4
- * Copyright (c) Remix Software Inc.
5
- *
6
- * This source code is licensed under the MIT license found in the
7
- * LICENSE.md file in the root directory of this source tree.
8
- *
9
- * @license MIT
10
- */
11
-
12
-
13
-
14
-
15
-
16
-
17
-
18
-
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
27
-
28
-
29
-
30
-
31
-
32
-
33
-
34
-
35
-
36
-
37
-
38
-
39
-
40
-
41
-
42
-
43
-
44
-
45
-
46
-
47
-
48
-
49
-
50
-
51
-
52
-
53
-
54
-
55
-
56
- var _chunkU7ORXROYjs = require('./chunk-U7ORXROY.js');
57
-
58
- // lib/dom/dom.ts
59
- var defaultMethod = "get";
60
- var defaultEncType = "application/x-www-form-urlencoded";
61
- function isHtmlElement(object) {
62
- return typeof HTMLElement !== "undefined" && object instanceof HTMLElement;
63
- }
64
- function isButtonElement(object) {
65
- return isHtmlElement(object) && object.tagName.toLowerCase() === "button";
66
- }
67
- function isFormElement(object) {
68
- return isHtmlElement(object) && object.tagName.toLowerCase() === "form";
69
- }
70
- function isInputElement(object) {
71
- return isHtmlElement(object) && object.tagName.toLowerCase() === "input";
72
- }
73
- function isModifiedEvent(event) {
74
- return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey);
75
- }
76
- function shouldProcessLinkClick(event, target) {
77
- return event.button === 0 && // Ignore everything but left clicks
78
- (!target || target === "_self") && // Let browser handle "target=_blank" etc.
79
- !isModifiedEvent(event);
80
- }
81
- function createSearchParams(init = "") {
82
- return new URLSearchParams(
83
- typeof init === "string" || Array.isArray(init) || init instanceof URLSearchParams ? init : Object.keys(init).reduce((memo, key) => {
84
- let value = init[key];
85
- return memo.concat(
86
- Array.isArray(value) ? value.map((v) => [key, v]) : [[key, value]]
87
- );
88
- }, [])
89
- );
90
- }
91
- function getSearchParamsForLocation(locationSearch, defaultSearchParams) {
92
- let searchParams = createSearchParams(locationSearch);
93
- if (defaultSearchParams) {
94
- defaultSearchParams.forEach((_, key) => {
95
- if (!searchParams.has(key)) {
96
- defaultSearchParams.getAll(key).forEach((value) => {
97
- searchParams.append(key, value);
98
- });
99
- }
100
- });
101
- }
102
- return searchParams;
103
- }
104
- var _formDataSupportsSubmitter = null;
105
- function isFormDataSubmitterSupported() {
106
- if (_formDataSupportsSubmitter === null) {
107
- try {
108
- new FormData(
109
- document.createElement("form"),
110
- // @ts-expect-error if FormData supports the submitter parameter, this will throw
111
- 0
112
- );
113
- _formDataSupportsSubmitter = false;
114
- } catch (e) {
115
- _formDataSupportsSubmitter = true;
116
- }
117
- }
118
- return _formDataSupportsSubmitter;
119
- }
120
- var supportedFormEncTypes = /* @__PURE__ */ new Set([
121
- "application/x-www-form-urlencoded",
122
- "multipart/form-data",
123
- "text/plain"
124
- ]);
125
- function getFormEncType(encType) {
126
- if (encType != null && !supportedFormEncTypes.has(encType)) {
127
- _chunkU7ORXROYjs.warning.call(void 0,
128
- false,
129
- `"${encType}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${defaultEncType}"`
130
- );
131
- return null;
132
- }
133
- return encType;
134
- }
135
- function getFormSubmissionInfo(target, basename) {
136
- let method;
137
- let action;
138
- let encType;
139
- let formData;
140
- let body;
141
- if (isFormElement(target)) {
142
- let attr = target.getAttribute("action");
143
- action = attr ? _chunkU7ORXROYjs.stripBasename.call(void 0, attr, basename) : null;
144
- method = target.getAttribute("method") || defaultMethod;
145
- encType = getFormEncType(target.getAttribute("enctype")) || defaultEncType;
146
- formData = new FormData(target);
147
- } else if (isButtonElement(target) || isInputElement(target) && (target.type === "submit" || target.type === "image")) {
148
- let form = target.form;
149
- if (form == null) {
150
- throw new Error(
151
- `Cannot submit a <button> or <input type="submit"> without a <form>`
152
- );
153
- }
154
- let attr = target.getAttribute("formaction") || form.getAttribute("action");
155
- action = attr ? _chunkU7ORXROYjs.stripBasename.call(void 0, attr, basename) : null;
156
- method = target.getAttribute("formmethod") || form.getAttribute("method") || defaultMethod;
157
- encType = getFormEncType(target.getAttribute("formenctype")) || getFormEncType(form.getAttribute("enctype")) || defaultEncType;
158
- formData = new FormData(form, target);
159
- if (!isFormDataSubmitterSupported()) {
160
- let { name, type, value } = target;
161
- if (type === "image") {
162
- let prefix = name ? `${name}.` : "";
163
- formData.append(`${prefix}x`, "0");
164
- formData.append(`${prefix}y`, "0");
165
- } else if (name) {
166
- formData.append(name, value);
167
- }
168
- }
169
- } else if (isHtmlElement(target)) {
170
- throw new Error(
171
- `Cannot submit element that is not <form>, <button>, or <input type="submit|image">`
172
- );
173
- } else {
174
- method = defaultMethod;
175
- action = null;
176
- encType = defaultEncType;
177
- body = target;
178
- }
179
- if (formData && encType === "text/plain") {
180
- body = formData;
181
- formData = void 0;
182
- }
183
- return { action, method: method.toLowerCase(), encType, formData, body };
184
- }
185
-
186
- // lib/dom/lib.tsx
187
- var _react = require('react'); var React = _interopRequireWildcard(_react); var React2 = _interopRequireWildcard(_react);
188
- var isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined";
189
- try {
190
- if (isBrowser) {
191
- window.__reactRouterVersion = // @ts-expect-error
192
- "7.18.0";
193
- }
194
- } catch (e) {
195
- }
196
- function createBrowserRouter(routes, opts) {
197
- return _chunkU7ORXROYjs.createRouter.call(void 0, {
198
- basename: _optionalChain([opts, 'optionalAccess', _2 => _2.basename]),
199
- getContext: _optionalChain([opts, 'optionalAccess', _3 => _3.getContext]),
200
- future: _optionalChain([opts, 'optionalAccess', _4 => _4.future]),
201
- history: _chunkU7ORXROYjs.createBrowserHistory.call(void 0, { window: _optionalChain([opts, 'optionalAccess', _5 => _5.window]) }),
202
- hydrationData: _optionalChain([opts, 'optionalAccess', _6 => _6.hydrationData]) || parseHydrationData(),
203
- routes,
204
- mapRouteProperties: _chunkU7ORXROYjs.mapRouteProperties,
205
- hydrationRouteProperties: _chunkU7ORXROYjs.hydrationRouteProperties,
206
- dataStrategy: _optionalChain([opts, 'optionalAccess', _7 => _7.dataStrategy]),
207
- patchRoutesOnNavigation: _optionalChain([opts, 'optionalAccess', _8 => _8.patchRoutesOnNavigation]),
208
- window: _optionalChain([opts, 'optionalAccess', _9 => _9.window]),
209
- instrumentations: _optionalChain([opts, 'optionalAccess', _10 => _10.instrumentations])
210
- }).initialize();
211
- }
212
- function createHashRouter(routes, opts) {
213
- return _chunkU7ORXROYjs.createRouter.call(void 0, {
214
- basename: _optionalChain([opts, 'optionalAccess', _11 => _11.basename]),
215
- getContext: _optionalChain([opts, 'optionalAccess', _12 => _12.getContext]),
216
- future: _optionalChain([opts, 'optionalAccess', _13 => _13.future]),
217
- history: _chunkU7ORXROYjs.createHashHistory.call(void 0, { window: _optionalChain([opts, 'optionalAccess', _14 => _14.window]) }),
218
- hydrationData: _optionalChain([opts, 'optionalAccess', _15 => _15.hydrationData]) || parseHydrationData(),
219
- routes,
220
- mapRouteProperties: _chunkU7ORXROYjs.mapRouteProperties,
221
- hydrationRouteProperties: _chunkU7ORXROYjs.hydrationRouteProperties,
222
- dataStrategy: _optionalChain([opts, 'optionalAccess', _16 => _16.dataStrategy]),
223
- patchRoutesOnNavigation: _optionalChain([opts, 'optionalAccess', _17 => _17.patchRoutesOnNavigation]),
224
- window: _optionalChain([opts, 'optionalAccess', _18 => _18.window]),
225
- instrumentations: _optionalChain([opts, 'optionalAccess', _19 => _19.instrumentations])
226
- }).initialize();
227
- }
228
- function parseHydrationData() {
229
- let state = _optionalChain([window, 'optionalAccess', _20 => _20.__staticRouterHydrationData]);
230
- if (state && state.errors) {
231
- state = {
232
- ...state,
233
- errors: deserializeErrors(state.errors)
234
- };
235
- }
236
- return state;
237
- }
238
- function deserializeErrors(errors) {
239
- if (!errors) return null;
240
- let entries = Object.entries(errors);
241
- let serialized = {};
242
- for (let [key, val] of entries) {
243
- if (val && val.__type === "RouteErrorResponse") {
244
- serialized[key] = new (0, _chunkU7ORXROYjs.ErrorResponseImpl)(
245
- val.status,
246
- val.statusText,
247
- val.data,
248
- val.internal === true
249
- );
250
- } else if (val && val.__type === "Error") {
251
- if (typeof val.__subType === "string" && _chunkU7ORXROYjs.SUPPORTED_ERROR_TYPES.includes(val.__subType)) {
252
- let ErrorConstructor = window[val.__subType];
253
- if (typeof ErrorConstructor === "function") {
254
- try {
255
- let error = new ErrorConstructor(val.message);
256
- error.stack = "";
257
- serialized[key] = error;
258
- } catch (e) {
259
- }
260
- }
261
- }
262
- if (serialized[key] == null) {
263
- let error = new Error(val.message);
264
- error.stack = "";
265
- serialized[key] = error;
266
- }
267
- } else {
268
- serialized[key] = val;
269
- }
270
- }
271
- return serialized;
272
- }
273
- function BrowserRouter({
274
- basename,
275
- children,
276
- useTransitions,
277
- window: window2
278
- }) {
279
- let historyRef = React.useRef();
280
- if (historyRef.current == null) {
281
- historyRef.current = _chunkU7ORXROYjs.createBrowserHistory.call(void 0, { window: window2, v5Compat: true });
282
- }
283
- let history = historyRef.current;
284
- let [state, setStateImpl] = React.useState({
285
- action: history.action,
286
- location: history.location
287
- });
288
- let setState = React.useCallback(
289
- (newState) => {
290
- if (useTransitions === false) {
291
- setStateImpl(newState);
292
- } else {
293
- React.startTransition(() => setStateImpl(newState));
294
- }
295
- },
296
- [useTransitions]
297
- );
298
- React.useLayoutEffect(() => history.listen(setState), [history, setState]);
299
- return /* @__PURE__ */ React.createElement(
300
- _chunkU7ORXROYjs.Router,
301
- {
302
- basename,
303
- children,
304
- location: state.location,
305
- navigationType: state.action,
306
- navigator: history,
307
- useTransitions
308
- }
309
- );
310
- }
311
- function HashRouter({
312
- basename,
313
- children,
314
- useTransitions,
315
- window: window2
316
- }) {
317
- let historyRef = React.useRef();
318
- if (historyRef.current == null) {
319
- historyRef.current = _chunkU7ORXROYjs.createHashHistory.call(void 0, { window: window2, v5Compat: true });
320
- }
321
- let history = historyRef.current;
322
- let [state, setStateImpl] = React.useState({
323
- action: history.action,
324
- location: history.location
325
- });
326
- let setState = React.useCallback(
327
- (newState) => {
328
- if (useTransitions === false) {
329
- setStateImpl(newState);
330
- } else {
331
- React.startTransition(() => setStateImpl(newState));
332
- }
333
- },
334
- [useTransitions]
335
- );
336
- React.useLayoutEffect(() => history.listen(setState), [history, setState]);
337
- return /* @__PURE__ */ React.createElement(
338
- _chunkU7ORXROYjs.Router,
339
- {
340
- basename,
341
- children,
342
- location: state.location,
343
- navigationType: state.action,
344
- navigator: history,
345
- useTransitions
346
- }
347
- );
348
- }
349
- function HistoryRouter({
350
- basename,
351
- children,
352
- history,
353
- useTransitions
354
- }) {
355
- let [state, setStateImpl] = React.useState({
356
- action: history.action,
357
- location: history.location
358
- });
359
- let setState = React.useCallback(
360
- (newState) => {
361
- if (useTransitions === false) {
362
- setStateImpl(newState);
363
- } else {
364
- React.startTransition(() => setStateImpl(newState));
365
- }
366
- },
367
- [useTransitions]
368
- );
369
- React.useLayoutEffect(() => history.listen(setState), [history, setState]);
370
- return /* @__PURE__ */ React.createElement(
371
- _chunkU7ORXROYjs.Router,
372
- {
373
- basename,
374
- children,
375
- location: state.location,
376
- navigationType: state.action,
377
- navigator: history,
378
- useTransitions
379
- }
380
- );
381
- }
382
- HistoryRouter.displayName = "unstable_HistoryRouter";
383
- var Link = React.forwardRef(
384
- function LinkWithRef({
385
- onClick,
386
- discover = "render",
387
- prefetch = "none",
388
- relative,
389
- reloadDocument,
390
- replace,
391
- mask,
392
- state,
393
- target,
394
- to,
395
- preventScrollReset,
396
- viewTransition,
397
- defaultShouldRevalidate,
398
- ...rest
399
- }, forwardedRef) {
400
- let { basename, navigator, useTransitions } = React.useContext(_chunkU7ORXROYjs.NavigationContext);
401
- let isAbsolute = typeof to === "string" && _chunkU7ORXROYjs.ABSOLUTE_URL_REGEX.test(to);
402
- let parsed = _chunkU7ORXROYjs.parseToInfo.call(void 0, to, basename);
403
- to = parsed.to;
404
- let href = _chunkU7ORXROYjs.useHref.call(void 0, to, { relative });
405
- let location = _chunkU7ORXROYjs.useLocation.call(void 0, );
406
- let maskedHref = null;
407
- if (mask) {
408
- let resolved = _chunkU7ORXROYjs.resolveTo.call(void 0,
409
- mask,
410
- [],
411
- location.mask ? location.mask.pathname : "/",
412
- true
413
- );
414
- if (basename !== "/") {
415
- resolved.pathname = resolved.pathname === "/" ? basename : _chunkU7ORXROYjs.joinPaths.call(void 0, [basename, resolved.pathname]);
416
- }
417
- maskedHref = navigator.createHref(resolved);
418
- }
419
- let [shouldPrefetch, prefetchRef, prefetchHandlers] = _chunkU7ORXROYjs.usePrefetchBehavior.call(void 0,
420
- prefetch,
421
- rest
422
- );
423
- let internalOnClick = useLinkClickHandler(to, {
424
- replace,
425
- mask,
426
- state,
427
- target,
428
- preventScrollReset,
429
- relative,
430
- viewTransition,
431
- defaultShouldRevalidate,
432
- useTransitions
433
- });
434
- function handleClick(event) {
435
- if (onClick) onClick(event);
436
- if (!event.defaultPrevented) {
437
- internalOnClick(event);
438
- }
439
- }
440
- let isSpaLink = !(parsed.isExternal || reloadDocument);
441
- let link = (
442
- // eslint-disable-next-line jsx-a11y/anchor-has-content
443
- /* @__PURE__ */ React.createElement(
444
- "a",
445
- {
446
- ...rest,
447
- ...prefetchHandlers,
448
- href: (isSpaLink ? maskedHref : void 0) || parsed.absoluteURL || href,
449
- onClick: isSpaLink ? handleClick : onClick,
450
- ref: _chunkU7ORXROYjs.mergeRefs.call(void 0, forwardedRef, prefetchRef),
451
- target,
452
- "data-discover": !isAbsolute && discover === "render" ? "true" : void 0
453
- }
454
- )
455
- );
456
- return shouldPrefetch && !isAbsolute ? /* @__PURE__ */ React.createElement(React.Fragment, null, link, /* @__PURE__ */ React.createElement(_chunkU7ORXROYjs.PrefetchPageLinks, { page: href })) : link;
457
- }
458
- );
459
- Link.displayName = "Link";
460
- var NavLink = React.forwardRef(
461
- function NavLinkWithRef({
462
- "aria-current": ariaCurrentProp = "page",
463
- caseSensitive = false,
464
- className: classNameProp = "",
465
- end = false,
466
- style: styleProp,
467
- to,
468
- viewTransition,
469
- children,
470
- ...rest
471
- }, ref) {
472
- let path = _chunkU7ORXROYjs.useResolvedPath.call(void 0, to, { relative: rest.relative });
473
- let location = _chunkU7ORXROYjs.useLocation.call(void 0, );
474
- let routerState = React.useContext(_chunkU7ORXROYjs.DataRouterStateContext);
475
- let { navigator, basename } = React.useContext(_chunkU7ORXROYjs.NavigationContext);
476
- let isTransitioning = routerState != null && // Conditional usage is OK here because the usage of a data router is static
477
- // eslint-disable-next-line react-hooks/rules-of-hooks
478
- useViewTransitionState(path) && viewTransition === true;
479
- let toPathname = navigator.encodeLocation ? navigator.encodeLocation(path).pathname : path.pathname;
480
- let locationPathname = location.pathname;
481
- let nextLocationPathname = routerState && routerState.navigation && routerState.navigation.location ? routerState.navigation.location.pathname : null;
482
- if (!caseSensitive) {
483
- locationPathname = locationPathname.toLowerCase();
484
- nextLocationPathname = nextLocationPathname ? nextLocationPathname.toLowerCase() : null;
485
- toPathname = toPathname.toLowerCase();
486
- }
487
- if (nextLocationPathname && basename) {
488
- nextLocationPathname = _chunkU7ORXROYjs.stripBasename.call(void 0, nextLocationPathname, basename) || nextLocationPathname;
489
- }
490
- const endSlashPosition = toPathname !== "/" && toPathname.endsWith("/") ? toPathname.length - 1 : toPathname.length;
491
- let isActive = locationPathname === toPathname || !end && locationPathname.startsWith(toPathname) && locationPathname.charAt(endSlashPosition) === "/";
492
- let isPending = nextLocationPathname != null && (nextLocationPathname === toPathname || !end && nextLocationPathname.startsWith(toPathname) && nextLocationPathname.charAt(toPathname.length) === "/");
493
- let renderProps = {
494
- isActive,
495
- isPending,
496
- isTransitioning
497
- };
498
- let ariaCurrent = isActive ? ariaCurrentProp : void 0;
499
- let className;
500
- if (typeof classNameProp === "function") {
501
- className = classNameProp(renderProps);
502
- } else {
503
- className = [
504
- classNameProp,
505
- isActive ? "active" : null,
506
- isPending ? "pending" : null,
507
- isTransitioning ? "transitioning" : null
508
- ].filter(Boolean).join(" ");
509
- }
510
- let style = typeof styleProp === "function" ? styleProp(renderProps) : styleProp;
511
- return /* @__PURE__ */ React.createElement(
512
- Link,
513
- {
514
- ...rest,
515
- "aria-current": ariaCurrent,
516
- className,
517
- ref,
518
- style,
519
- to,
520
- viewTransition
521
- },
522
- typeof children === "function" ? children(renderProps) : children
523
- );
524
- }
525
- );
526
- NavLink.displayName = "NavLink";
527
- var Form = React.forwardRef(
528
- ({
529
- discover = "render",
530
- fetcherKey,
531
- navigate,
532
- reloadDocument,
533
- replace,
534
- state,
535
- method = defaultMethod,
536
- action,
537
- onSubmit,
538
- relative,
539
- preventScrollReset,
540
- viewTransition,
541
- defaultShouldRevalidate,
542
- ...props
543
- }, forwardedRef) => {
544
- let { useTransitions } = React.useContext(_chunkU7ORXROYjs.NavigationContext);
545
- let submit = useSubmit();
546
- let formAction = useFormAction(action, { relative });
547
- let formMethod = method.toLowerCase() === "get" ? "get" : "post";
548
- let isAbsolute = typeof action === "string" && _chunkU7ORXROYjs.ABSOLUTE_URL_REGEX.test(action);
549
- let submitHandler = (event) => {
550
- onSubmit && onSubmit(event);
551
- if (event.defaultPrevented) return;
552
- event.preventDefault();
553
- let submitter = event.nativeEvent.submitter;
554
- let submitMethod = _optionalChain([submitter, 'optionalAccess', _21 => _21.getAttribute, 'call', _22 => _22("formmethod")]) || method;
555
- let doSubmit = () => submit(submitter || event.currentTarget, {
556
- fetcherKey,
557
- method: submitMethod,
558
- navigate,
559
- replace,
560
- state,
561
- relative,
562
- preventScrollReset,
563
- viewTransition,
564
- defaultShouldRevalidate
565
- });
566
- if (useTransitions && navigate !== false) {
567
- React.startTransition(() => doSubmit());
568
- } else {
569
- doSubmit();
570
- }
571
- };
572
- return /* @__PURE__ */ React.createElement(
573
- "form",
574
- {
575
- ref: forwardedRef,
576
- method: formMethod,
577
- action: formAction,
578
- onSubmit: reloadDocument ? onSubmit : submitHandler,
579
- ...props,
580
- "data-discover": !isAbsolute && discover === "render" ? "true" : void 0
581
- }
582
- );
583
- }
584
- );
585
- Form.displayName = "Form";
586
- function ScrollRestoration({
587
- getKey,
588
- storageKey,
589
- ...props
590
- }) {
591
- let remixContext = React.useContext(_chunkU7ORXROYjs.FrameworkContext);
592
- let { basename } = React.useContext(_chunkU7ORXROYjs.NavigationContext);
593
- let location = _chunkU7ORXROYjs.useLocation.call(void 0, );
594
- let matches = _chunkU7ORXROYjs.useMatches.call(void 0, );
595
- useScrollRestoration({ getKey, storageKey });
596
- let ssrKey = React.useMemo(
597
- () => {
598
- if (!remixContext || !getKey) return null;
599
- let userKey = getScrollRestorationKey(
600
- location,
601
- matches,
602
- basename,
603
- getKey
604
- );
605
- return userKey !== location.key ? userKey : null;
606
- },
607
- // Nah, we only need this the first time for the SSR render
608
- // eslint-disable-next-line react-hooks/exhaustive-deps
609
- []
610
- );
611
- if (!remixContext || remixContext.isSpaMode) {
612
- return null;
613
- }
614
- let restoreScroll = ((storageKey2, restoreKey) => {
615
- if (!window.history.state || !window.history.state.key) {
616
- let key = Math.random().toString(32).slice(2);
617
- window.history.replaceState({ key }, "");
618
- }
619
- try {
620
- let positions = JSON.parse(sessionStorage.getItem(storageKey2) || "{}");
621
- let storedY = positions[restoreKey || window.history.state.key];
622
- if (typeof storedY === "number") {
623
- window.scrollTo(0, storedY);
624
- }
625
- } catch (error) {
626
- console.error(error);
627
- sessionStorage.removeItem(storageKey2);
628
- }
629
- }).toString();
630
- if (props.nonce == null && _optionalChain([remixContext, 'optionalAccess', _23 => _23.nonce])) {
631
- props.nonce = remixContext.nonce;
632
- }
633
- return /* @__PURE__ */ React.createElement(
634
- "script",
635
- {
636
- ...props,
637
- suppressHydrationWarning: true,
638
- dangerouslySetInnerHTML: {
639
- __html: `(${restoreScroll})(${_chunkU7ORXROYjs.escapeHtml.call(void 0,
640
- JSON.stringify(storageKey || SCROLL_RESTORATION_STORAGE_KEY)
641
- )}, ${_chunkU7ORXROYjs.escapeHtml.call(void 0, JSON.stringify(ssrKey))})`
642
- }
643
- }
644
- );
645
- }
646
- ScrollRestoration.displayName = "ScrollRestoration";
647
- function getDataRouterConsoleError(hookName) {
648
- return `${hookName} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`;
649
- }
650
- function useDataRouterContext(hookName) {
651
- let ctx = React.useContext(_chunkU7ORXROYjs.DataRouterContext);
652
- _chunkU7ORXROYjs.invariant.call(void 0, ctx, getDataRouterConsoleError(hookName));
653
- return ctx;
654
- }
655
- function useDataRouterState(hookName) {
656
- let state = React.useContext(_chunkU7ORXROYjs.DataRouterStateContext);
657
- _chunkU7ORXROYjs.invariant.call(void 0, state, getDataRouterConsoleError(hookName));
658
- return state;
659
- }
660
- function useLinkClickHandler(to, {
661
- target,
662
- replace: replaceProp,
663
- mask,
664
- state,
665
- preventScrollReset,
666
- relative,
667
- viewTransition,
668
- defaultShouldRevalidate,
669
- useTransitions
670
- } = {}) {
671
- let navigate = _chunkU7ORXROYjs.useNavigate.call(void 0, );
672
- let location = _chunkU7ORXROYjs.useLocation.call(void 0, );
673
- let path = _chunkU7ORXROYjs.useResolvedPath.call(void 0, to, { relative });
674
- return React.useCallback(
675
- (event) => {
676
- if (shouldProcessLinkClick(event, target)) {
677
- event.preventDefault();
678
- let replace = replaceProp !== void 0 ? replaceProp : _chunkU7ORXROYjs.createPath.call(void 0, location) === _chunkU7ORXROYjs.createPath.call(void 0, path);
679
- let doNavigate = () => navigate(to, {
680
- replace,
681
- mask,
682
- state,
683
- preventScrollReset,
684
- relative,
685
- viewTransition,
686
- defaultShouldRevalidate
687
- });
688
- if (useTransitions) {
689
- React.startTransition(() => doNavigate());
690
- } else {
691
- doNavigate();
692
- }
693
- }
694
- },
695
- [
696
- location,
697
- navigate,
698
- path,
699
- replaceProp,
700
- mask,
701
- state,
702
- target,
703
- to,
704
- preventScrollReset,
705
- relative,
706
- viewTransition,
707
- defaultShouldRevalidate,
708
- useTransitions
709
- ]
710
- );
711
- }
712
- function useSearchParams(defaultInit) {
713
- _chunkU7ORXROYjs.warning.call(void 0,
714
- typeof URLSearchParams !== "undefined",
715
- `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
- );
717
- let defaultSearchParamsRef = React.useRef(createSearchParams(defaultInit));
718
- let hasSetSearchParamsRef = React.useRef(false);
719
- let location = _chunkU7ORXROYjs.useLocation.call(void 0, );
720
- let searchParams = React.useMemo(
721
- () => (
722
- // Only merge in the defaults if we haven't yet called setSearchParams.
723
- // Once we call that we want those to take precedence, otherwise you can't
724
- // remove a param with setSearchParams({}) if it has an initial value
725
- getSearchParamsForLocation(
726
- location.search,
727
- hasSetSearchParamsRef.current ? null : defaultSearchParamsRef.current
728
- )
729
- ),
730
- [location.search]
731
- );
732
- let navigate = _chunkU7ORXROYjs.useNavigate.call(void 0, );
733
- let setSearchParams = React.useCallback(
734
- (nextInit, navigateOptions) => {
735
- const newSearchParams = createSearchParams(
736
- typeof nextInit === "function" ? nextInit(new URLSearchParams(searchParams)) : nextInit
737
- );
738
- hasSetSearchParamsRef.current = true;
739
- navigate("?" + newSearchParams, navigateOptions);
740
- },
741
- [navigate, searchParams]
742
- );
743
- return [searchParams, setSearchParams];
744
- }
745
- var fetcherId = 0;
746
- var getUniqueFetcherId = () => `__${String(++fetcherId)}__`;
747
- function useSubmit() {
748
- let { router } = useDataRouterContext("useSubmit" /* UseSubmit */);
749
- let { basename } = React.useContext(_chunkU7ORXROYjs.NavigationContext);
750
- let currentRouteId = _chunkU7ORXROYjs.useRouteId.call(void 0, );
751
- let routerFetch = router.fetch;
752
- let routerNavigate = router.navigate;
753
- return React.useCallback(
754
- async (target, options = {}) => {
755
- let { action, method, encType, formData, body } = getFormSubmissionInfo(
756
- target,
757
- basename
758
- );
759
- if (options.navigate === false) {
760
- let key = options.fetcherKey || getUniqueFetcherId();
761
- await routerFetch(key, currentRouteId, options.action || action, {
762
- defaultShouldRevalidate: options.defaultShouldRevalidate,
763
- preventScrollReset: options.preventScrollReset,
764
- formData,
765
- body,
766
- formMethod: options.method || method,
767
- formEncType: options.encType || encType,
768
- flushSync: options.flushSync
769
- });
770
- } else {
771
- await routerNavigate(options.action || action, {
772
- defaultShouldRevalidate: options.defaultShouldRevalidate,
773
- preventScrollReset: options.preventScrollReset,
774
- formData,
775
- body,
776
- formMethod: options.method || method,
777
- formEncType: options.encType || encType,
778
- replace: options.replace,
779
- state: options.state,
780
- fromRouteId: currentRouteId,
781
- flushSync: options.flushSync,
782
- viewTransition: options.viewTransition
783
- });
784
- }
785
- },
786
- [routerFetch, routerNavigate, basename, currentRouteId]
787
- );
788
- }
789
- function useFormAction(action, { relative } = {}) {
790
- let { basename } = React.useContext(_chunkU7ORXROYjs.NavigationContext);
791
- let routeContext = React.useContext(_chunkU7ORXROYjs.RouteContext);
792
- _chunkU7ORXROYjs.invariant.call(void 0, routeContext, "useFormAction must be used inside a RouteContext");
793
- let [match] = routeContext.matches.slice(-1);
794
- let path = { ..._chunkU7ORXROYjs.useResolvedPath.call(void 0, action ? action : ".", { relative }) };
795
- let location = _chunkU7ORXROYjs.useLocation.call(void 0, );
796
- if (action == null) {
797
- path.search = location.search;
798
- let params = new URLSearchParams(path.search);
799
- let indexValues = params.getAll("index");
800
- let hasNakedIndexParam = indexValues.some((v) => v === "");
801
- if (hasNakedIndexParam) {
802
- params.delete("index");
803
- indexValues.filter((v) => v).forEach((v) => params.append("index", v));
804
- let qs = params.toString();
805
- path.search = qs ? `?${qs}` : "";
806
- }
807
- }
808
- if ((!action || action === ".") && match.route.index) {
809
- path.search = path.search ? path.search.replace(/^\?/, "?index&") : "?index";
810
- }
811
- if (basename !== "/") {
812
- path.pathname = path.pathname === "/" ? basename : _chunkU7ORXROYjs.joinPaths.call(void 0, [basename, path.pathname]);
813
- }
814
- return _chunkU7ORXROYjs.createPath.call(void 0, path);
815
- }
816
- function useFetcher({
817
- key
818
- } = {}) {
819
- let { router } = useDataRouterContext("useFetcher" /* UseFetcher */);
820
- let state = useDataRouterState("useFetcher" /* UseFetcher */);
821
- let fetcherData = React.useContext(_chunkU7ORXROYjs.FetchersContext);
822
- let route = React.useContext(_chunkU7ORXROYjs.RouteContext);
823
- let routeId = _optionalChain([route, 'access', _24 => _24.matches, 'access', _25 => _25[route.matches.length - 1], 'optionalAccess', _26 => _26.route, 'access', _27 => _27.id]);
824
- _chunkU7ORXROYjs.invariant.call(void 0, fetcherData, `useFetcher must be used inside a FetchersContext`);
825
- _chunkU7ORXROYjs.invariant.call(void 0, route, `useFetcher must be used inside a RouteContext`);
826
- _chunkU7ORXROYjs.invariant.call(void 0,
827
- routeId != null,
828
- `useFetcher can only be used on routes that contain a unique "id"`
829
- );
830
- let defaultKey = React.useId();
831
- let [fetcherKey, setFetcherKey] = React.useState(key || defaultKey);
832
- if (key && key !== fetcherKey) {
833
- setFetcherKey(key);
834
- }
835
- let { deleteFetcher, getFetcher, resetFetcher, fetch: routerFetch } = router;
836
- React.useEffect(() => {
837
- getFetcher(fetcherKey);
838
- return () => deleteFetcher(fetcherKey);
839
- }, [deleteFetcher, getFetcher, fetcherKey]);
840
- let load = React.useCallback(
841
- async (href, opts) => {
842
- _chunkU7ORXROYjs.invariant.call(void 0, routeId, "No routeId available for fetcher.load()");
843
- await routerFetch(fetcherKey, routeId, href, opts);
844
- },
845
- [fetcherKey, routeId, routerFetch]
846
- );
847
- let submitImpl = useSubmit();
848
- let submit = React.useCallback(
849
- async (target, opts) => {
850
- await submitImpl(target, {
851
- ...opts,
852
- navigate: false,
853
- fetcherKey
854
- });
855
- },
856
- [fetcherKey, submitImpl]
857
- );
858
- let reset = React.useCallback(
859
- (opts) => resetFetcher(fetcherKey, opts),
860
- [resetFetcher, fetcherKey]
861
- );
862
- let FetcherForm = React.useMemo(() => {
863
- let FetcherForm2 = React.forwardRef(
864
- (props, ref) => {
865
- return /* @__PURE__ */ React.createElement(Form, { ...props, navigate: false, fetcherKey, ref });
866
- }
867
- );
868
- FetcherForm2.displayName = "fetcher.Form";
869
- return FetcherForm2;
870
- }, [fetcherKey]);
871
- let fetcher = state.fetchers.get(fetcherKey) || _chunkU7ORXROYjs.IDLE_FETCHER;
872
- let data = fetcherData.get(fetcherKey);
873
- let fetcherWithComponents = React.useMemo(
874
- () => ({
875
- Form: FetcherForm,
876
- submit,
877
- load,
878
- reset,
879
- ...fetcher,
880
- data
881
- }),
882
- [FetcherForm, submit, load, reset, fetcher, data]
883
- );
884
- return fetcherWithComponents;
885
- }
886
- function useFetchers() {
887
- let state = useDataRouterState("useFetchers" /* UseFetchers */);
888
- return React.useMemo(
889
- () => Array.from(state.fetchers.entries()).map(([key, fetcher]) => ({
890
- ...fetcher,
891
- key
892
- })),
893
- [state.fetchers]
894
- );
895
- }
896
- var SCROLL_RESTORATION_STORAGE_KEY = "react-router-scroll-positions";
897
- var savedScrollPositions = {};
898
- function getScrollRestorationKey(location, matches, basename, getKey) {
899
- let key = null;
900
- if (getKey) {
901
- if (basename !== "/") {
902
- key = getKey(
903
- {
904
- ...location,
905
- pathname: _chunkU7ORXROYjs.stripBasename.call(void 0, location.pathname, basename) || location.pathname
906
- },
907
- matches
908
- );
909
- } else {
910
- key = getKey(location, matches);
911
- }
912
- }
913
- if (key == null) {
914
- key = location.key;
915
- }
916
- return key;
917
- }
918
- function useScrollRestoration({
919
- getKey,
920
- storageKey
921
- } = {}) {
922
- let { router } = useDataRouterContext("useScrollRestoration" /* UseScrollRestoration */);
923
- let { restoreScrollPosition, preventScrollReset } = useDataRouterState(
924
- "useScrollRestoration" /* UseScrollRestoration */
925
- );
926
- let { basename } = React.useContext(_chunkU7ORXROYjs.NavigationContext);
927
- let location = _chunkU7ORXROYjs.useLocation.call(void 0, );
928
- let matches = _chunkU7ORXROYjs.useMatches.call(void 0, );
929
- let navigation = _chunkU7ORXROYjs.useNavigation.call(void 0, );
930
- React.useEffect(() => {
931
- window.history.scrollRestoration = "manual";
932
- return () => {
933
- window.history.scrollRestoration = "auto";
934
- };
935
- }, []);
936
- usePageHide(
937
- React.useCallback(() => {
938
- if (navigation.state === "idle") {
939
- let key = getScrollRestorationKey(location, matches, basename, getKey);
940
- savedScrollPositions[key] = window.scrollY;
941
- }
942
- try {
943
- sessionStorage.setItem(
944
- storageKey || SCROLL_RESTORATION_STORAGE_KEY,
945
- JSON.stringify(savedScrollPositions)
946
- );
947
- } catch (error) {
948
- _chunkU7ORXROYjs.warning.call(void 0,
949
- false,
950
- `Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${error}).`
951
- );
952
- }
953
- window.history.scrollRestoration = "auto";
954
- }, [navigation.state, getKey, basename, location, matches, storageKey])
955
- );
956
- if (typeof document !== "undefined") {
957
- React.useLayoutEffect(() => {
958
- try {
959
- let sessionPositions = sessionStorage.getItem(
960
- storageKey || SCROLL_RESTORATION_STORAGE_KEY
961
- );
962
- if (sessionPositions) {
963
- savedScrollPositions = JSON.parse(sessionPositions);
964
- }
965
- } catch (e) {
966
- }
967
- }, [storageKey]);
968
- React.useLayoutEffect(() => {
969
- let disableScrollRestoration = _optionalChain([router, 'optionalAccess', _28 => _28.enableScrollRestoration, 'call', _29 => _29(
970
- savedScrollPositions,
971
- () => window.scrollY,
972
- getKey ? (location2, matches2) => getScrollRestorationKey(location2, matches2, basename, getKey) : void 0
973
- )]);
974
- return () => disableScrollRestoration && disableScrollRestoration();
975
- }, [router, basename, getKey]);
976
- React.useLayoutEffect(() => {
977
- if (restoreScrollPosition === false) {
978
- return;
979
- }
980
- if (typeof restoreScrollPosition === "number") {
981
- window.scrollTo(0, restoreScrollPosition);
982
- return;
983
- }
984
- try {
985
- if (location.hash) {
986
- let el = document.getElementById(
987
- decodeURIComponent(location.hash.slice(1))
988
- );
989
- if (el) {
990
- el.scrollIntoView();
991
- return;
992
- }
993
- }
994
- } catch (e2) {
995
- _chunkU7ORXROYjs.warning.call(void 0,
996
- false,
997
- `"${location.hash.slice(
998
- 1
999
- )}" is not a decodable element ID. The view will not scroll to it.`
1000
- );
1001
- }
1002
- if (preventScrollReset === true) {
1003
- return;
1004
- }
1005
- window.scrollTo(0, 0);
1006
- }, [location, restoreScrollPosition, preventScrollReset]);
1007
- }
1008
- }
1009
- function useBeforeUnload(callback, options) {
1010
- let { capture } = options || {};
1011
- React.useEffect(() => {
1012
- let opts = capture != null ? { capture } : void 0;
1013
- window.addEventListener("beforeunload", callback, opts);
1014
- return () => {
1015
- window.removeEventListener("beforeunload", callback, opts);
1016
- };
1017
- }, [callback, capture]);
1018
- }
1019
- function usePageHide(callback, options) {
1020
- let { capture } = options || {};
1021
- React.useEffect(() => {
1022
- let opts = capture != null ? { capture } : void 0;
1023
- window.addEventListener("pagehide", callback, opts);
1024
- return () => {
1025
- window.removeEventListener("pagehide", callback, opts);
1026
- };
1027
- }, [callback, capture]);
1028
- }
1029
- function usePrompt({
1030
- when,
1031
- message
1032
- }) {
1033
- let blocker = _chunkU7ORXROYjs.useBlocker.call(void 0, when);
1034
- React.useEffect(() => {
1035
- if (blocker.state === "blocked") {
1036
- let proceed = window.confirm(message);
1037
- if (proceed) {
1038
- setTimeout(blocker.proceed, 0);
1039
- } else {
1040
- blocker.reset();
1041
- }
1042
- }
1043
- }, [blocker, message]);
1044
- React.useEffect(() => {
1045
- if (blocker.state === "blocked" && !when) {
1046
- blocker.reset();
1047
- }
1048
- }, [blocker, when]);
1049
- }
1050
- function useViewTransitionState(to, { relative } = {}) {
1051
- let vtContext = React.useContext(_chunkU7ORXROYjs.ViewTransitionContext);
1052
- _chunkU7ORXROYjs.invariant.call(void 0,
1053
- vtContext != null,
1054
- "`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"
1055
- );
1056
- let { basename } = useDataRouterContext(
1057
- "useViewTransitionState" /* useViewTransitionState */
1058
- );
1059
- let path = _chunkU7ORXROYjs.useResolvedPath.call(void 0, to, { relative });
1060
- if (!vtContext.isTransitioning) {
1061
- return false;
1062
- }
1063
- let currentPath = _chunkU7ORXROYjs.stripBasename.call(void 0, vtContext.currentLocation.pathname, basename) || vtContext.currentLocation.pathname;
1064
- let nextPath = _chunkU7ORXROYjs.stripBasename.call(void 0, vtContext.nextLocation.pathname, basename) || vtContext.nextLocation.pathname;
1065
- return _chunkU7ORXROYjs.matchPath.call(void 0, path.pathname, nextPath) != null || _chunkU7ORXROYjs.matchPath.call(void 0, path.pathname, currentPath) != null;
1066
- }
1067
-
1068
- // lib/dom/server.tsx
1069
-
1070
- function StaticRouter({
1071
- basename,
1072
- children,
1073
- location: locationProp = "/"
1074
- }) {
1075
- if (typeof locationProp === "string") {
1076
- locationProp = _chunkU7ORXROYjs.parsePath.call(void 0, locationProp);
1077
- }
1078
- let action = "POP" /* Pop */;
1079
- let location = {
1080
- pathname: locationProp.pathname || "/",
1081
- search: locationProp.search || "",
1082
- hash: locationProp.hash || "",
1083
- state: locationProp.state != null ? locationProp.state : null,
1084
- key: locationProp.key || "default",
1085
- mask: void 0
1086
- };
1087
- let staticNavigator = getStatelessNavigator();
1088
- return /* @__PURE__ */ React2.createElement(
1089
- _chunkU7ORXROYjs.Router,
1090
- {
1091
- basename,
1092
- children,
1093
- location,
1094
- navigationType: action,
1095
- navigator: staticNavigator,
1096
- static: true,
1097
- useTransitions: false
1098
- }
1099
- );
1100
- }
1101
- function StaticRouterProvider({
1102
- context,
1103
- router,
1104
- hydrate = true,
1105
- nonce
1106
- }) {
1107
- _chunkU7ORXROYjs.invariant.call(void 0,
1108
- router && context,
1109
- "You must provide `router` and `context` to <StaticRouterProvider>"
1110
- );
1111
- let dataRouterContext = {
1112
- router,
1113
- navigator: getStatelessNavigator(),
1114
- static: true,
1115
- staticContext: context,
1116
- basename: context.basename || "/"
1117
- };
1118
- let fetchersContext = /* @__PURE__ */ new Map();
1119
- let hydrateScript = "";
1120
- if (hydrate !== false) {
1121
- let data = {
1122
- loaderData: context.loaderData,
1123
- actionData: context.actionData,
1124
- errors: serializeErrors(context.errors)
1125
- };
1126
- let json = _chunkU7ORXROYjs.escapeHtml.call(void 0, JSON.stringify(JSON.stringify(data)));
1127
- hydrateScript = `window.__staticRouterHydrationData = JSON.parse(${json});`;
1128
- }
1129
- let { state } = dataRouterContext.router;
1130
- return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(_chunkU7ORXROYjs.DataRouterContext.Provider, { value: dataRouterContext }, /* @__PURE__ */ React2.createElement(_chunkU7ORXROYjs.DataRouterStateContext.Provider, { value: state }, /* @__PURE__ */ React2.createElement(_chunkU7ORXROYjs.FetchersContext.Provider, { value: fetchersContext }, /* @__PURE__ */ React2.createElement(_chunkU7ORXROYjs.ViewTransitionContext.Provider, { value: { isTransitioning: false } }, /* @__PURE__ */ React2.createElement(
1131
- _chunkU7ORXROYjs.Router,
1132
- {
1133
- basename: dataRouterContext.basename,
1134
- location: state.location,
1135
- navigationType: state.historyAction,
1136
- navigator: dataRouterContext.navigator,
1137
- static: dataRouterContext.static,
1138
- useTransitions: false
1139
- },
1140
- /* @__PURE__ */ React2.createElement(
1141
- _chunkU7ORXROYjs.DataRoutes,
1142
- {
1143
- manifest: router.manifest,
1144
- routes: router.routes,
1145
- future: router.future,
1146
- state,
1147
- isStatic: true
1148
- }
1149
- )
1150
- ))))), hydrateScript ? /* @__PURE__ */ React2.createElement(
1151
- "script",
1152
- {
1153
- suppressHydrationWarning: true,
1154
- nonce,
1155
- dangerouslySetInnerHTML: { __html: hydrateScript }
1156
- }
1157
- ) : null);
1158
- }
1159
- function serializeErrors(errors) {
1160
- if (!errors) return null;
1161
- let entries = Object.entries(errors);
1162
- let serialized = {};
1163
- for (let [key, val] of entries) {
1164
- if (_chunkU7ORXROYjs.isRouteErrorResponse.call(void 0, val)) {
1165
- serialized[key] = { ...val, __type: "RouteErrorResponse" };
1166
- } else if (val instanceof Error) {
1167
- serialized[key] = {
1168
- message: val.message,
1169
- __type: "Error",
1170
- // If this is a subclass (i.e., ReferenceError), send up the type so we
1171
- // can re-create the same type during hydration.
1172
- ...val.name !== "Error" ? {
1173
- __subType: val.name
1174
- } : {}
1175
- };
1176
- } else {
1177
- serialized[key] = val;
1178
- }
1179
- }
1180
- return serialized;
1181
- }
1182
- function getStatelessNavigator() {
1183
- return {
1184
- createHref,
1185
- encodeLocation,
1186
- push(to) {
1187
- throw new Error(
1188
- `You cannot use navigator.push() on the server because it is a stateless environment. This error was probably triggered when you did a \`navigate(${JSON.stringify(to)})\` somewhere in your app.`
1189
- );
1190
- },
1191
- replace(to) {
1192
- throw new Error(
1193
- `You cannot use navigator.replace() on the server because it is a stateless environment. This error was probably triggered when you did a \`navigate(${JSON.stringify(to)}, { replace: true })\` somewhere in your app.`
1194
- );
1195
- },
1196
- go(delta) {
1197
- throw new Error(
1198
- `You cannot use navigator.go() on the server because it is a stateless environment. This error was probably triggered when you did a \`navigate(${delta})\` somewhere in your app.`
1199
- );
1200
- },
1201
- back() {
1202
- throw new Error(
1203
- `You cannot use navigator.back() on the server because it is a stateless environment.`
1204
- );
1205
- },
1206
- forward() {
1207
- throw new Error(
1208
- `You cannot use navigator.forward() on the server because it is a stateless environment.`
1209
- );
1210
- }
1211
- };
1212
- }
1213
- function createStaticHandler2(routes, opts) {
1214
- return _chunkU7ORXROYjs.createStaticHandler.call(void 0, routes, {
1215
- ...opts,
1216
- mapRouteProperties: _chunkU7ORXROYjs.mapRouteProperties
1217
- });
1218
- }
1219
- function createStaticRouter(routes, context, opts = {}) {
1220
- let manifest = {};
1221
- let dataRoutes = _chunkU7ORXROYjs.convertRoutesToDataRoutes.call(void 0,
1222
- routes,
1223
- _chunkU7ORXROYjs.mapRouteProperties,
1224
- void 0,
1225
- manifest
1226
- );
1227
- let matches = context.matches.map((match) => {
1228
- let route = manifest[match.route.id] || match.route;
1229
- return {
1230
- ...match,
1231
- route
1232
- };
1233
- });
1234
- let msg = (method) => `You cannot use router.${method}() on the server because it is a stateless environment`;
1235
- return {
1236
- get basename() {
1237
- return context.basename;
1238
- },
1239
- get future() {
1240
- return {
1241
- v8_middleware: false,
1242
- v8_passThroughRequests: false,
1243
- v8_trailingSlashAwareDataRequests: false,
1244
- ..._optionalChain([opts, 'optionalAccess', _30 => _30.future])
1245
- };
1246
- },
1247
- get state() {
1248
- return {
1249
- historyAction: "POP" /* Pop */,
1250
- location: context.location,
1251
- matches,
1252
- loaderData: context.loaderData,
1253
- actionData: context.actionData,
1254
- errors: context.errors,
1255
- initialized: true,
1256
- renderFallback: false,
1257
- navigation: _chunkU7ORXROYjs.IDLE_NAVIGATION,
1258
- restoreScrollPosition: null,
1259
- preventScrollReset: false,
1260
- revalidation: "idle",
1261
- fetchers: /* @__PURE__ */ new Map(),
1262
- blockers: /* @__PURE__ */ new Map()
1263
- };
1264
- },
1265
- get routes() {
1266
- return dataRoutes;
1267
- },
1268
- get branches() {
1269
- return opts.branches;
1270
- },
1271
- get manifest() {
1272
- return manifest;
1273
- },
1274
- get window() {
1275
- return void 0;
1276
- },
1277
- initialize() {
1278
- throw msg("initialize");
1279
- },
1280
- subscribe() {
1281
- throw msg("subscribe");
1282
- },
1283
- enableScrollRestoration() {
1284
- throw msg("enableScrollRestoration");
1285
- },
1286
- navigate() {
1287
- throw msg("navigate");
1288
- },
1289
- fetch() {
1290
- throw msg("fetch");
1291
- },
1292
- revalidate() {
1293
- throw msg("revalidate");
1294
- },
1295
- createHref,
1296
- encodeLocation,
1297
- getFetcher() {
1298
- return _chunkU7ORXROYjs.IDLE_FETCHER;
1299
- },
1300
- deleteFetcher() {
1301
- throw msg("deleteFetcher");
1302
- },
1303
- resetFetcher() {
1304
- throw msg("resetFetcher");
1305
- },
1306
- dispose() {
1307
- throw msg("dispose");
1308
- },
1309
- getBlocker() {
1310
- return _chunkU7ORXROYjs.IDLE_BLOCKER;
1311
- },
1312
- deleteBlocker() {
1313
- throw msg("deleteBlocker");
1314
- },
1315
- patchRoutes() {
1316
- throw msg("patchRoutes");
1317
- },
1318
- _internalFetchControllers: /* @__PURE__ */ new Map(),
1319
- _internalSetRoutes() {
1320
- throw msg("_internalSetRoutes");
1321
- },
1322
- _internalSetStateDoNotUseOrYouWillBreakYourApp() {
1323
- throw msg("_internalSetStateDoNotUseOrYouWillBreakYourApp");
1324
- }
1325
- };
1326
- }
1327
- function createHref(to) {
1328
- return typeof to === "string" ? to : _chunkU7ORXROYjs.createPath.call(void 0, to);
1329
- }
1330
- function encodeLocation(to) {
1331
- let href = typeof to === "string" ? to : _chunkU7ORXROYjs.createPath.call(void 0, to);
1332
- href = href.replace(/ $/, "%20");
1333
- let encoded = _chunkU7ORXROYjs.ABSOLUTE_URL_REGEX.test(href) ? new URL(href) : new URL(href, "http://localhost");
1334
- return {
1335
- pathname: encoded.pathname,
1336
- search: encoded.search,
1337
- hash: encoded.hash
1338
- };
1339
- }
1340
-
1341
-
1342
-
1343
-
1344
-
1345
-
1346
-
1347
-
1348
-
1349
-
1350
-
1351
-
1352
-
1353
-
1354
-
1355
-
1356
-
1357
-
1358
-
1359
-
1360
-
1361
-
1362
-
1363
-
1364
-
1365
-
1366
- exports.createSearchParams = createSearchParams; exports.createBrowserRouter = createBrowserRouter; exports.createHashRouter = createHashRouter; exports.BrowserRouter = BrowserRouter; exports.HashRouter = HashRouter; exports.HistoryRouter = HistoryRouter; exports.Link = Link; exports.NavLink = NavLink; exports.Form = Form; exports.ScrollRestoration = ScrollRestoration; exports.useLinkClickHandler = useLinkClickHandler; exports.useSearchParams = useSearchParams; exports.useSubmit = useSubmit; exports.useFormAction = useFormAction; exports.useFetcher = useFetcher; exports.useFetchers = useFetchers; exports.useScrollRestoration = useScrollRestoration; exports.useBeforeUnload = useBeforeUnload; exports.usePrompt = usePrompt; exports.useViewTransitionState = useViewTransitionState; exports.StaticRouter = StaticRouter; exports.StaticRouterProvider = StaticRouterProvider; exports.createStaticHandler = createStaticHandler2; exports.createStaticRouter = createStaticRouter;