lkd-web-kit 0.7.9 → 0.7.10

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 (381) hide show
  1. package/dist/_virtual/___vite-browser-external.cjs +12 -0
  2. package/dist/_virtual/___vite-browser-external.js +6 -0
  3. package/dist/_virtual/__vite-browser-external.cjs +5 -0
  4. package/dist/_virtual/__vite-browser-external.js +3 -0
  5. package/dist/_virtual/_commonjsHelpers.cjs +34 -0
  6. package/dist/_virtual/_commonjsHelpers.js +30 -0
  7. package/dist/_virtual/_interop_require_default.cjs +7 -0
  8. package/dist/_virtual/_interop_require_default.js +3 -0
  9. package/dist/_virtual/_interop_require_wildcard.cjs +7 -0
  10. package/dist/_virtual/_interop_require_wildcard.js +3 -0
  11. package/dist/_virtual/add-base-path.cjs +7 -0
  12. package/dist/_virtual/add-base-path.js +3 -0
  13. package/dist/_virtual/add-locale.cjs +7 -0
  14. package/dist/_virtual/add-locale.js +3 -0
  15. package/dist/_virtual/add-locale2.cjs +7 -0
  16. package/dist/_virtual/add-locale2.js +3 -0
  17. package/dist/_virtual/add-path-prefix.cjs +7 -0
  18. package/dist/_virtual/add-path-prefix.js +3 -0
  19. package/dist/_virtual/add-path-suffix.cjs +7 -0
  20. package/dist/_virtual/add-path-suffix.js +3 -0
  21. package/dist/_virtual/app-paths.cjs +7 -0
  22. package/dist/_virtual/app-paths.js +3 -0
  23. package/dist/_virtual/bloom-filter.cjs +7 -0
  24. package/dist/_virtual/bloom-filter.js +3 -0
  25. package/dist/_virtual/compare-states.cjs +7 -0
  26. package/dist/_virtual/compare-states.js +3 -0
  27. package/dist/_virtual/constants.cjs +7 -0
  28. package/dist/_virtual/constants.js +3 -0
  29. package/dist/_virtual/denormalize-page-path.cjs +7 -0
  30. package/dist/_virtual/denormalize-page-path.js +3 -0
  31. package/dist/_virtual/deployment-id.cjs +7 -0
  32. package/dist/_virtual/deployment-id.js +3 -0
  33. package/dist/_virtual/detect-domain-locale.cjs +7 -0
  34. package/dist/_virtual/detect-domain-locale.js +3 -0
  35. package/dist/_virtual/detect-domain-locale2.cjs +7 -0
  36. package/dist/_virtual/detect-domain-locale2.js +3 -0
  37. package/dist/_virtual/disable-smooth-scroll.cjs +7 -0
  38. package/dist/_virtual/disable-smooth-scroll.js +3 -0
  39. package/dist/_virtual/encode-uri-path.cjs +7 -0
  40. package/dist/_virtual/encode-uri-path.js +3 -0
  41. package/dist/_virtual/ensure-leading-slash.cjs +7 -0
  42. package/dist/_virtual/ensure-leading-slash.js +3 -0
  43. package/dist/_virtual/escape-regexp.cjs +7 -0
  44. package/dist/_virtual/escape-regexp.js +3 -0
  45. package/dist/_virtual/format-next-pathname-info.cjs +7 -0
  46. package/dist/_virtual/format-next-pathname-info.js +3 -0
  47. package/dist/_virtual/format-url.cjs +7 -0
  48. package/dist/_virtual/format-url.js +3 -0
  49. package/dist/_virtual/get-asset-path-from-route.cjs +7 -0
  50. package/dist/_virtual/get-asset-path-from-route.js +3 -0
  51. package/dist/_virtual/get-cookie-parser.cjs +7 -0
  52. package/dist/_virtual/get-cookie-parser.js +3 -0
  53. package/dist/_virtual/get-dynamic-param.cjs +7 -0
  54. package/dist/_virtual/get-dynamic-param.js +3 -0
  55. package/dist/_virtual/get-next-pathname-info.cjs +7 -0
  56. package/dist/_virtual/get-next-pathname-info.js +3 -0
  57. package/dist/_virtual/get-segment-param.cjs +7 -0
  58. package/dist/_virtual/get-segment-param.js +3 -0
  59. package/dist/_virtual/has-base-path.cjs +7 -0
  60. package/dist/_virtual/has-base-path.js +3 -0
  61. package/dist/_virtual/head-manager-context.shared-runtime.cjs +7 -0
  62. package/dist/_virtual/head-manager-context.shared-runtime.js +3 -0
  63. package/dist/_virtual/html-bots.cjs +7 -0
  64. package/dist/_virtual/html-bots.js +3 -0
  65. package/dist/_virtual/index.cjs +7 -0
  66. package/dist/_virtual/index.js +3 -0
  67. package/dist/_virtual/index2.cjs +7 -0
  68. package/dist/_virtual/index2.js +3 -0
  69. package/dist/_virtual/index3.cjs +7 -0
  70. package/dist/_virtual/index3.js +3 -0
  71. package/dist/_virtual/index4.cjs +7 -0
  72. package/dist/_virtual/index4.js +3 -0
  73. package/dist/_virtual/index5.cjs +7 -0
  74. package/dist/_virtual/index5.js +3 -0
  75. package/dist/_virtual/interception-routes.cjs +7 -0
  76. package/dist/_virtual/interception-routes.js +3 -0
  77. package/dist/_virtual/interpolate-as.cjs +7 -0
  78. package/dist/_virtual/interpolate-as.js +3 -0
  79. package/dist/_virtual/invariant-error.cjs +7 -0
  80. package/dist/_virtual/invariant-error.js +3 -0
  81. package/dist/_virtual/is-api-route.cjs +7 -0
  82. package/dist/_virtual/is-api-route.js +3 -0
  83. package/dist/_virtual/is-bot.cjs +7 -0
  84. package/dist/_virtual/is-bot.js +3 -0
  85. package/dist/_virtual/is-dynamic.cjs +7 -0
  86. package/dist/_virtual/is-dynamic.js +3 -0
  87. package/dist/_virtual/is-error.cjs +7 -0
  88. package/dist/_virtual/is-error.js +3 -0
  89. package/dist/_virtual/is-local-url.cjs +7 -0
  90. package/dist/_virtual/is-local-url.js +3 -0
  91. package/dist/_virtual/is-plain-object.cjs +7 -0
  92. package/dist/_virtual/is-plain-object.js +3 -0
  93. package/dist/_virtual/mitt.cjs +7 -0
  94. package/dist/_virtual/mitt.js +3 -0
  95. package/dist/_virtual/normalize-locale-path.cjs +7 -0
  96. package/dist/_virtual/normalize-locale-path.js +3 -0
  97. package/dist/_virtual/normalize-path-sep.cjs +7 -0
  98. package/dist/_virtual/normalize-path-sep.js +3 -0
  99. package/dist/_virtual/normalize-trailing-slash.cjs +7 -0
  100. package/dist/_virtual/normalize-trailing-slash.js +3 -0
  101. package/dist/_virtual/omit.cjs +7 -0
  102. package/dist/_virtual/omit.js +3 -0
  103. package/dist/_virtual/parse-loader-tree.cjs +7 -0
  104. package/dist/_virtual/parse-loader-tree.js +3 -0
  105. package/dist/_virtual/parse-path.cjs +7 -0
  106. package/dist/_virtual/parse-path.js +3 -0
  107. package/dist/_virtual/parse-relative-url.cjs +7 -0
  108. package/dist/_virtual/parse-relative-url.js +3 -0
  109. package/dist/_virtual/parse-url.cjs +7 -0
  110. package/dist/_virtual/parse-url.js +3 -0
  111. package/dist/_virtual/path-has-prefix.cjs +7 -0
  112. package/dist/_virtual/path-has-prefix.js +3 -0
  113. package/dist/_virtual/path-match.cjs +7 -0
  114. package/dist/_virtual/path-match.js +3 -0
  115. package/dist/_virtual/prepare-destination.cjs +7 -0
  116. package/dist/_virtual/prepare-destination.js +3 -0
  117. package/dist/_virtual/querystring.cjs +7 -0
  118. package/dist/_virtual/querystring.js +3 -0
  119. package/dist/_virtual/react-is.development.cjs +7 -0
  120. package/dist/_virtual/react-is.development.js +3 -0
  121. package/dist/_virtual/react-is.production.cjs +7 -0
  122. package/dist/_virtual/react-is.production.js +3 -0
  123. package/dist/_virtual/remove-base-path.cjs +7 -0
  124. package/dist/_virtual/remove-base-path.js +3 -0
  125. package/dist/_virtual/remove-locale.cjs +7 -0
  126. package/dist/_virtual/remove-locale.js +3 -0
  127. package/dist/_virtual/remove-path-prefix.cjs +7 -0
  128. package/dist/_virtual/remove-path-prefix.js +3 -0
  129. package/dist/_virtual/remove-trailing-slash.cjs +7 -0
  130. package/dist/_virtual/remove-trailing-slash.js +3 -0
  131. package/dist/_virtual/request-idle-callback.cjs +7 -0
  132. package/dist/_virtual/request-idle-callback.js +3 -0
  133. package/dist/_virtual/resolve-href.cjs +7 -0
  134. package/dist/_virtual/resolve-href.js +3 -0
  135. package/dist/_virtual/resolve-rewrites.cjs +7 -0
  136. package/dist/_virtual/resolve-rewrites.js +3 -0
  137. package/dist/_virtual/route-loader.cjs +7 -0
  138. package/dist/_virtual/route-loader.js +3 -0
  139. package/dist/_virtual/route-match-utils.cjs +7 -0
  140. package/dist/_virtual/route-match-utils.js +3 -0
  141. package/dist/_virtual/route-matcher.cjs +7 -0
  142. package/dist/_virtual/route-matcher.js +3 -0
  143. package/dist/_virtual/route-pattern-normalizer.cjs +7 -0
  144. package/dist/_virtual/route-pattern-normalizer.js +3 -0
  145. package/dist/_virtual/route-regex.cjs +7 -0
  146. package/dist/_virtual/route-regex.js +3 -0
  147. package/dist/_virtual/router-context.shared-runtime.cjs +7 -0
  148. package/dist/_virtual/router-context.shared-runtime.js +3 -0
  149. package/dist/_virtual/router.cjs +9 -0
  150. package/dist/_virtual/router.js +5 -0
  151. package/dist/_virtual/router2.cjs +7 -0
  152. package/dist/_virtual/router2.js +3 -0
  153. package/dist/_virtual/router3.cjs +7 -0
  154. package/dist/_virtual/router3.js +3 -0
  155. package/dist/_virtual/script.cjs +7 -0
  156. package/dist/_virtual/script.js +3 -0
  157. package/dist/_virtual/segment.cjs +7 -0
  158. package/dist/_virtual/segment.js +3 -0
  159. package/dist/_virtual/set-attributes-from-props.cjs +7 -0
  160. package/dist/_virtual/set-attributes-from-props.js +3 -0
  161. package/dist/_virtual/sorted-routes.cjs +7 -0
  162. package/dist/_virtual/sorted-routes.js +3 -0
  163. package/dist/_virtual/trusted-types.cjs +7 -0
  164. package/dist/_virtual/trusted-types.js +3 -0
  165. package/dist/_virtual/utils.cjs +7 -0
  166. package/dist/_virtual/utils.js +3 -0
  167. package/dist/_virtual/warn-once.cjs +7 -0
  168. package/dist/_virtual/warn-once.js +3 -0
  169. package/dist/_virtual/with-router.cjs +7 -0
  170. package/dist/_virtual/with-router.js +3 -0
  171. package/dist/components/EmptyState/index.cjs +5 -5
  172. package/dist/components/Icon.cjs +2 -2
  173. package/dist/components/InfinityLoader/index.cjs +4 -4
  174. package/dist/components/MyCheckboxGroup/index.cjs +2 -2
  175. package/dist/components/MyDateInput/index.cjs +3 -3
  176. package/dist/components/MyDatePickerInput/CalendarIcon.cjs +7 -7
  177. package/dist/components/MyDatePickerInput/index.cjs +3 -3
  178. package/dist/components/MyDateTimePicker/index.cjs +3 -3
  179. package/dist/components/MyMonthPickerInput/index.cjs +3 -3
  180. package/dist/components/MyMultiSelect/index.cjs +2 -2
  181. package/dist/components/MyNotifications/index.cjs +2 -2
  182. package/dist/components/MyNumberInput/index.cjs +2 -2
  183. package/dist/components/MyRadioGroup/index.cjs +2 -2
  184. package/dist/components/MySelect/index.cjs +2 -2
  185. package/dist/components/MyTextInput/index.cjs +2 -2
  186. package/dist/components/MyTextarea/index.cjs +2 -2
  187. package/dist/components/MyTimeInput/index.cjs +2 -2
  188. package/dist/components/NavItems.cjs +4 -4
  189. package/dist/components/SelectInfinity/index.cjs +8 -8
  190. package/dist/contexts/NavigationHistoryContext/hook.cjs +47 -0
  191. package/dist/contexts/NavigationHistoryContext/hook.js +42 -0
  192. package/dist/contexts/NavigationHistoryContext/index.cjs +15 -47
  193. package/dist/contexts/NavigationHistoryContext/index.js +17 -48
  194. package/dist/contexts/PageDataContext/index.cjs +2 -2
  195. package/dist/form/Form.cjs +2 -2
  196. package/dist/form/FormButtonSubmit.cjs +2 -2
  197. package/dist/form/base/FormCheckbox.cjs +2 -2
  198. package/dist/form/base/FormCheckboxGroup.cjs +2 -2
  199. package/dist/form/base/FormDateInput.cjs +2 -2
  200. package/dist/form/base/FormDatePickerInput.cjs +2 -2
  201. package/dist/form/base/FormDateTimePicker.cjs +2 -2
  202. package/dist/form/base/FormMonthPickerInput.cjs +2 -2
  203. package/dist/form/base/FormMultiSelect.cjs +2 -2
  204. package/dist/form/base/FormNumberInput.cjs +2 -2
  205. package/dist/form/base/FormRadioGroup.cjs +2 -2
  206. package/dist/form/base/FormSelect.cjs +2 -2
  207. package/dist/form/base/FormSelectInfinity.cjs +2 -2
  208. package/dist/form/base/FormTextInput.cjs +2 -2
  209. package/dist/form/base/FormTextarea.cjs +2 -2
  210. package/dist/form/base/FormTimeInput.cjs +2 -2
  211. package/dist/hocs/withController.cjs +3 -3
  212. package/dist/hocs/withModalManager.cjs +2 -2
  213. package/dist/index.cjs +3 -2
  214. package/dist/index.d.ts +0 -8
  215. package/dist/index.js +2 -1
  216. package/dist/node_modules/@swc/helpers/cjs/_interop_require_default.cjs +20 -0
  217. package/dist/node_modules/@swc/helpers/cjs/_interop_require_default.js +16 -0
  218. package/dist/node_modules/@swc/helpers/cjs/_interop_require_wildcard.cjs +52 -0
  219. package/dist/node_modules/@swc/helpers/cjs/_interop_require_wildcard.js +48 -0
  220. package/dist/node_modules/@tanstack/react-virtual/dist/esm/index.cjs +2 -2
  221. package/dist/node_modules/next/dist/build/deployment-id.cjs +34 -0
  222. package/dist/node_modules/next/dist/build/deployment-id.js +30 -0
  223. package/dist/node_modules/next/dist/client/add-base-path.cjs +42 -0
  224. package/dist/node_modules/next/dist/client/add-base-path.js +38 -0
  225. package/dist/node_modules/next/dist/client/add-locale.cjs +43 -0
  226. package/dist/node_modules/next/dist/client/add-locale.js +39 -0
  227. package/dist/node_modules/next/dist/client/detect-domain-locale.cjs +40 -0
  228. package/dist/node_modules/next/dist/client/detect-domain-locale.js +36 -0
  229. package/dist/node_modules/next/dist/client/has-base-path.cjs +40 -0
  230. package/dist/node_modules/next/dist/client/has-base-path.js +36 -0
  231. package/dist/node_modules/next/dist/client/normalize-trailing-slash.cjs +54 -0
  232. package/dist/node_modules/next/dist/client/normalize-trailing-slash.js +50 -0
  233. package/dist/node_modules/next/dist/client/remove-base-path.cjs +49 -0
  234. package/dist/node_modules/next/dist/client/remove-base-path.js +45 -0
  235. package/dist/node_modules/next/dist/client/remove-locale.cjs +45 -0
  236. package/dist/node_modules/next/dist/client/remove-locale.js +41 -0
  237. package/dist/node_modules/next/dist/client/request-idle-callback.cjs +56 -0
  238. package/dist/node_modules/next/dist/client/request-idle-callback.js +52 -0
  239. package/dist/node_modules/next/dist/client/resolve-href.cjs +132 -0
  240. package/dist/node_modules/next/dist/client/resolve-href.js +128 -0
  241. package/dist/node_modules/next/dist/client/route-loader.cjs +363 -0
  242. package/dist/node_modules/next/dist/client/route-loader.js +359 -0
  243. package/dist/node_modules/next/dist/client/router.cjs +201 -0
  244. package/dist/node_modules/next/dist/client/router.js +197 -0
  245. package/dist/node_modules/next/dist/client/script.cjs +366 -0
  246. package/dist/node_modules/next/dist/client/script.js +362 -0
  247. package/dist/node_modules/next/dist/client/set-attributes-from-props.cjs +81 -0
  248. package/dist/node_modules/next/dist/client/set-attributes-from-props.js +77 -0
  249. package/dist/node_modules/next/dist/client/trusted-types.cjs +56 -0
  250. package/dist/node_modules/next/dist/client/trusted-types.js +52 -0
  251. package/dist/node_modules/next/dist/client/with-router.cjs +54 -0
  252. package/dist/node_modules/next/dist/client/with-router.js +50 -0
  253. package/dist/node_modules/next/dist/compiled/cookie/index.cjs +22 -0
  254. package/dist/node_modules/next/dist/compiled/cookie/index.js +18 -0
  255. package/dist/node_modules/next/dist/compiled/gzip-size/index.cjs +17 -0
  256. package/dist/node_modules/next/dist/compiled/gzip-size/index.js +13 -0
  257. package/dist/node_modules/next/dist/compiled/path-to-regexp/index.cjs +16 -0
  258. package/dist/node_modules/next/dist/compiled/path-to-regexp/index.js +12 -0
  259. package/dist/node_modules/next/dist/compiled/react-is/cjs/react-is.development.cjs +147 -0
  260. package/dist/node_modules/next/dist/compiled/react-is/cjs/react-is.development.js +143 -0
  261. package/dist/node_modules/next/dist/compiled/react-is/cjs/react-is.production.cjs +144 -0
  262. package/dist/node_modules/next/dist/compiled/react-is/cjs/react-is.production.js +140 -0
  263. package/dist/node_modules/next/dist/compiled/react-is/index.cjs +23 -0
  264. package/dist/node_modules/next/dist/compiled/react-is/index.js +19 -0
  265. package/dist/node_modules/next/dist/lib/constants.cjs +365 -0
  266. package/dist/node_modules/next/dist/lib/constants.js +361 -0
  267. package/dist/node_modules/next/dist/lib/is-api-route.cjs +31 -0
  268. package/dist/node_modules/next/dist/lib/is-api-route.js +27 -0
  269. package/dist/node_modules/next/dist/lib/is-error.cjs +91 -0
  270. package/dist/node_modules/next/dist/lib/is-error.js +87 -0
  271. package/dist/node_modules/next/dist/lib/route-pattern-normalizer.cjs +115 -0
  272. package/dist/node_modules/next/dist/lib/route-pattern-normalizer.js +111 -0
  273. package/dist/node_modules/next/dist/server/api-utils/get-cookie-parser.cjs +39 -0
  274. package/dist/node_modules/next/dist/server/api-utils/get-cookie-parser.js +35 -0
  275. package/dist/node_modules/next/dist/shared/lib/bloom-filter.cjs +101 -0
  276. package/dist/node_modules/next/dist/shared/lib/bloom-filter.js +97 -0
  277. package/dist/node_modules/next/dist/shared/lib/encode-uri-path.cjs +31 -0
  278. package/dist/node_modules/next/dist/shared/lib/encode-uri-path.js +27 -0
  279. package/dist/node_modules/next/dist/shared/lib/escape-regexp.cjs +37 -0
  280. package/dist/node_modules/next/dist/shared/lib/escape-regexp.js +33 -0
  281. package/dist/node_modules/next/dist/shared/lib/head-manager-context.shared-runtime.cjs +36 -0
  282. package/dist/node_modules/next/dist/shared/lib/head-manager-context.shared-runtime.js +32 -0
  283. package/dist/node_modules/next/dist/shared/lib/i18n/detect-domain-locale.cjs +41 -0
  284. package/dist/node_modules/next/dist/shared/lib/i18n/detect-domain-locale.js +37 -0
  285. package/dist/node_modules/next/dist/shared/lib/i18n/normalize-locale-path.cjs +70 -0
  286. package/dist/node_modules/next/dist/shared/lib/i18n/normalize-locale-path.js +66 -0
  287. package/dist/node_modules/next/dist/shared/lib/invariant-error.cjs +34 -0
  288. package/dist/node_modules/next/dist/shared/lib/invariant-error.js +30 -0
  289. package/dist/node_modules/next/dist/shared/lib/is-plain-object.cjs +54 -0
  290. package/dist/node_modules/next/dist/shared/lib/is-plain-object.js +50 -0
  291. package/dist/node_modules/next/dist/shared/lib/mitt.cjs +58 -0
  292. package/dist/node_modules/next/dist/shared/lib/mitt.js +54 -0
  293. package/dist/node_modules/next/dist/shared/lib/page-path/denormalize-page-path.cjs +36 -0
  294. package/dist/node_modules/next/dist/shared/lib/page-path/denormalize-page-path.js +32 -0
  295. package/dist/node_modules/next/dist/shared/lib/page-path/ensure-leading-slash.cjs +36 -0
  296. package/dist/node_modules/next/dist/shared/lib/page-path/ensure-leading-slash.js +32 -0
  297. package/dist/node_modules/next/dist/shared/lib/page-path/normalize-path-sep.cjs +37 -0
  298. package/dist/node_modules/next/dist/shared/lib/page-path/normalize-path-sep.js +33 -0
  299. package/dist/node_modules/next/dist/shared/lib/router/router.cjs +1814 -0
  300. package/dist/node_modules/next/dist/shared/lib/router/router.js +1810 -0
  301. package/dist/node_modules/next/dist/shared/lib/router/utils/add-locale.cjs +46 -0
  302. package/dist/node_modules/next/dist/shared/lib/router/utils/add-locale.js +42 -0
  303. package/dist/node_modules/next/dist/shared/lib/router/utils/add-path-prefix.cjs +37 -0
  304. package/dist/node_modules/next/dist/shared/lib/router/utils/add-path-prefix.js +33 -0
  305. package/dist/node_modules/next/dist/shared/lib/router/utils/add-path-suffix.cjs +37 -0
  306. package/dist/node_modules/next/dist/shared/lib/router/utils/add-path-suffix.js +33 -0
  307. package/dist/node_modules/next/dist/shared/lib/router/utils/app-paths.cjs +65 -0
  308. package/dist/node_modules/next/dist/shared/lib/router/utils/app-paths.js +61 -0
  309. package/dist/node_modules/next/dist/shared/lib/router/utils/compare-states.cjs +50 -0
  310. package/dist/node_modules/next/dist/shared/lib/router/utils/compare-states.js +46 -0
  311. package/dist/node_modules/next/dist/shared/lib/router/utils/disable-smooth-scroll.cjs +60 -0
  312. package/dist/node_modules/next/dist/shared/lib/router/utils/disable-smooth-scroll.js +56 -0
  313. package/dist/node_modules/next/dist/shared/lib/router/utils/format-next-pathname-info.cjs +47 -0
  314. package/dist/node_modules/next/dist/shared/lib/router/utils/format-next-pathname-info.js +43 -0
  315. package/dist/node_modules/next/dist/shared/lib/router/utils/format-url.cjs +103 -0
  316. package/dist/node_modules/next/dist/shared/lib/router/utils/format-url.js +99 -0
  317. package/dist/node_modules/next/dist/shared/lib/router/utils/get-asset-path-from-route.cjs +32 -0
  318. package/dist/node_modules/next/dist/shared/lib/router/utils/get-asset-path-from-route.js +28 -0
  319. package/dist/node_modules/next/dist/shared/lib/router/utils/get-dynamic-param.cjs +208 -0
  320. package/dist/node_modules/next/dist/shared/lib/router/utils/get-dynamic-param.js +204 -0
  321. package/dist/node_modules/next/dist/shared/lib/router/utils/get-next-pathname-info.cjs +71 -0
  322. package/dist/node_modules/next/dist/shared/lib/router/utils/get-next-pathname-info.js +67 -0
  323. package/dist/node_modules/next/dist/shared/lib/router/utils/get-segment-param.cjs +94 -0
  324. package/dist/node_modules/next/dist/shared/lib/router/utils/get-segment-param.js +90 -0
  325. package/dist/node_modules/next/dist/shared/lib/router/utils/html-bots.cjs +29 -0
  326. package/dist/node_modules/next/dist/shared/lib/router/utils/html-bots.js +25 -0
  327. package/dist/node_modules/next/dist/shared/lib/router/utils/index.cjs +43 -0
  328. package/dist/node_modules/next/dist/shared/lib/router/utils/index.js +39 -0
  329. package/dist/node_modules/next/dist/shared/lib/router/utils/interception-routes.cjs +119 -0
  330. package/dist/node_modules/next/dist/shared/lib/router/utils/interception-routes.js +115 -0
  331. package/dist/node_modules/next/dist/shared/lib/router/utils/interpolate-as.cjs +71 -0
  332. package/dist/node_modules/next/dist/shared/lib/router/utils/interpolate-as.js +67 -0
  333. package/dist/node_modules/next/dist/shared/lib/router/utils/is-bot.cjs +68 -0
  334. package/dist/node_modules/next/dist/shared/lib/router/utils/is-bot.js +64 -0
  335. package/dist/node_modules/next/dist/shared/lib/router/utils/is-dynamic.cjs +43 -0
  336. package/dist/node_modules/next/dist/shared/lib/router/utils/is-dynamic.js +39 -0
  337. package/dist/node_modules/next/dist/shared/lib/router/utils/is-local-url.cjs +44 -0
  338. package/dist/node_modules/next/dist/shared/lib/router/utils/is-local-url.js +40 -0
  339. package/dist/node_modules/next/dist/shared/lib/router/utils/omit.cjs +37 -0
  340. package/dist/node_modules/next/dist/shared/lib/router/utils/omit.js +33 -0
  341. package/dist/node_modules/next/dist/shared/lib/router/utils/parse-loader-tree.cjs +46 -0
  342. package/dist/node_modules/next/dist/shared/lib/router/utils/parse-loader-tree.js +42 -0
  343. package/dist/node_modules/next/dist/shared/lib/router/utils/parse-path.cjs +51 -0
  344. package/dist/node_modules/next/dist/shared/lib/router/utils/parse-path.js +47 -0
  345. package/dist/node_modules/next/dist/shared/lib/router/utils/parse-relative-url.cjs +54 -0
  346. package/dist/node_modules/next/dist/shared/lib/router/utils/parse-relative-url.js +50 -0
  347. package/dist/node_modules/next/dist/shared/lib/router/utils/parse-url.cjs +50 -0
  348. package/dist/node_modules/next/dist/shared/lib/router/utils/parse-url.js +46 -0
  349. package/dist/node_modules/next/dist/shared/lib/router/utils/path-has-prefix.cjs +37 -0
  350. package/dist/node_modules/next/dist/shared/lib/router/utils/path-has-prefix.js +33 -0
  351. package/dist/node_modules/next/dist/shared/lib/router/utils/path-match.cjs +66 -0
  352. package/dist/node_modules/next/dist/shared/lib/router/utils/path-match.js +62 -0
  353. package/dist/node_modules/next/dist/shared/lib/router/utils/prepare-destination.cjs +303 -0
  354. package/dist/node_modules/next/dist/shared/lib/router/utils/prepare-destination.js +299 -0
  355. package/dist/node_modules/next/dist/shared/lib/router/utils/querystring.cjs +90 -0
  356. package/dist/node_modules/next/dist/shared/lib/router/utils/querystring.js +86 -0
  357. package/dist/node_modules/next/dist/shared/lib/router/utils/remove-path-prefix.cjs +56 -0
  358. package/dist/node_modules/next/dist/shared/lib/router/utils/remove-path-prefix.js +52 -0
  359. package/dist/node_modules/next/dist/shared/lib/router/utils/remove-trailing-slash.cjs +39 -0
  360. package/dist/node_modules/next/dist/shared/lib/router/utils/remove-trailing-slash.js +35 -0
  361. package/dist/node_modules/next/dist/shared/lib/router/utils/resolve-rewrites.cjs +140 -0
  362. package/dist/node_modules/next/dist/shared/lib/router/utils/resolve-rewrites.js +136 -0
  363. package/dist/node_modules/next/dist/shared/lib/router/utils/route-match-utils.cjs +127 -0
  364. package/dist/node_modules/next/dist/shared/lib/router/utils/route-match-utils.js +123 -0
  365. package/dist/node_modules/next/dist/shared/lib/router/utils/route-matcher.cjs +63 -0
  366. package/dist/node_modules/next/dist/shared/lib/router/utils/route-matcher.js +59 -0
  367. package/dist/node_modules/next/dist/shared/lib/router/utils/route-regex.cjs +272 -0
  368. package/dist/node_modules/next/dist/shared/lib/router/utils/route-regex.js +268 -0
  369. package/dist/node_modules/next/dist/shared/lib/router/utils/sorted-routes.cjs +256 -0
  370. package/dist/node_modules/next/dist/shared/lib/router/utils/sorted-routes.js +252 -0
  371. package/dist/node_modules/next/dist/shared/lib/router-context.shared-runtime.cjs +36 -0
  372. package/dist/node_modules/next/dist/shared/lib/router-context.shared-runtime.js +32 -0
  373. package/dist/node_modules/next/dist/shared/lib/segment.cjs +103 -0
  374. package/dist/node_modules/next/dist/shared/lib/segment.js +99 -0
  375. package/dist/node_modules/next/dist/shared/lib/utils/warn-once.cjs +38 -0
  376. package/dist/node_modules/next/dist/shared/lib/utils/warn-once.js +34 -0
  377. package/dist/node_modules/next/dist/shared/lib/utils.cjs +204 -0
  378. package/dist/node_modules/next/dist/shared/lib/utils.js +200 -0
  379. package/dist/node_modules/next/router.cjs +17 -0
  380. package/dist/node_modules/next/router.js +13 -0
  381. package/package.json +6 -6
@@ -0,0 +1,303 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const prepareDestination = require('../../../../../../../_virtual/prepare-destination.cjs');
6
+ const escapeRegexp = require('../../escape-regexp.cjs');
7
+ const parseUrl = require('./parse-url.cjs');
8
+ const interceptionRoutes = require('./interception-routes.cjs');
9
+ const getCookieParser = require('../../../../server/api-utils/get-cookie-parser.cjs');
10
+ const routeMatchUtils = require('./route-match-utils.cjs');
11
+
12
+ var hasRequiredPrepareDestination;
13
+
14
+ function requirePrepareDestination () {
15
+ if (hasRequiredPrepareDestination) return prepareDestination.__exports;
16
+ hasRequiredPrepareDestination = 1;
17
+ (function (exports) {
18
+ Object.defineProperty(exports, "__esModule", {
19
+ value: true
20
+ });
21
+ function _export(target, all) {
22
+ for(var name in all)Object.defineProperty(target, name, {
23
+ enumerable: true,
24
+ get: all[name]
25
+ });
26
+ }
27
+ _export(exports, {
28
+ compileNonPath: function() {
29
+ return compileNonPath;
30
+ },
31
+ matchHas: function() {
32
+ return matchHas;
33
+ },
34
+ parseDestination: function() {
35
+ return parseDestination;
36
+ },
37
+ prepareDestination: function() {
38
+ return prepareDestination;
39
+ }
40
+ });
41
+ const _escaperegexp = escapeRegexp.__require();
42
+ const _parseurl = parseUrl.__require();
43
+ const _interceptionroutes = interceptionRoutes.__require();
44
+ const _getcookieparser = getCookieParser.__require();
45
+ const _routematchutils = routeMatchUtils.__require();
46
+ /**
47
+ * Ensure only a-zA-Z are used for param names for proper interpolating
48
+ * with path-to-regexp
49
+ */ function getSafeParamName(paramName) {
50
+ let newParamName = '';
51
+ for(let i = 0; i < paramName.length; i++){
52
+ const charCode = paramName.charCodeAt(i);
53
+ if (charCode > 64 && charCode < 91 || // A-Z
54
+ charCode > 96 && charCode < 123 // a-z
55
+ ) {
56
+ newParamName += paramName[i];
57
+ }
58
+ }
59
+ return newParamName;
60
+ }
61
+ function escapeSegment(str, segmentName) {
62
+ return str.replace(new RegExp(`:${(0, _escaperegexp.escapeStringRegexp)(segmentName)}`, 'g'), `__ESC_COLON_${segmentName}`);
63
+ }
64
+ function unescapeSegments(str) {
65
+ return str.replace(/__ESC_COLON_/gi, ':');
66
+ }
67
+ function matchHas(req, query, has = [], missing = []) {
68
+ const params = {};
69
+ const hasMatch = (hasItem)=>{
70
+ let value;
71
+ let key = hasItem.key;
72
+ switch(hasItem.type){
73
+ case 'header':
74
+ {
75
+ key = key.toLowerCase();
76
+ value = req.headers[key];
77
+ break;
78
+ }
79
+ case 'cookie':
80
+ {
81
+ if ('cookies' in req) {
82
+ value = req.cookies[hasItem.key];
83
+ } else {
84
+ const cookies = (0, _getcookieparser.getCookieParser)(req.headers)();
85
+ value = cookies[hasItem.key];
86
+ }
87
+ break;
88
+ }
89
+ case 'query':
90
+ {
91
+ value = query[key];
92
+ break;
93
+ }
94
+ case 'host':
95
+ {
96
+ const { host } = req?.headers || {};
97
+ // remove port from host if present
98
+ const hostname = host?.split(':', 1)[0].toLowerCase();
99
+ value = hostname;
100
+ break;
101
+ }
102
+ }
103
+ if (!hasItem.value && value) {
104
+ params[getSafeParamName(key)] = value;
105
+ return true;
106
+ } else if (value) {
107
+ const matcher = new RegExp(`^${hasItem.value}$`);
108
+ const matches = Array.isArray(value) ? value.slice(-1)[0].match(matcher) : value.match(matcher);
109
+ if (matches) {
110
+ if (Array.isArray(matches)) {
111
+ if (matches.groups) {
112
+ Object.keys(matches.groups).forEach((groupKey)=>{
113
+ params[groupKey] = matches.groups[groupKey];
114
+ });
115
+ } else if (hasItem.type === 'host' && matches[0]) {
116
+ params.host = matches[0];
117
+ }
118
+ }
119
+ return true;
120
+ }
121
+ }
122
+ return false;
123
+ };
124
+ const allMatch = has.every((item)=>hasMatch(item)) && !missing.some((item)=>hasMatch(item));
125
+ if (allMatch) {
126
+ return params;
127
+ }
128
+ return false;
129
+ }
130
+ function compileNonPath(value, params) {
131
+ if (!value.includes(':')) {
132
+ return value;
133
+ }
134
+ for (const key of Object.keys(params)){
135
+ if (value.includes(`:${key}`)) {
136
+ value = value.replace(new RegExp(`:${key}\\*`, 'g'), `:${key}--ESCAPED_PARAM_ASTERISKS`).replace(new RegExp(`:${key}\\?`, 'g'), `:${key}--ESCAPED_PARAM_QUESTION`).replace(new RegExp(`:${key}\\+`, 'g'), `:${key}--ESCAPED_PARAM_PLUS`).replace(new RegExp(`:${key}(?!\\w)`, 'g'), `--ESCAPED_PARAM_COLON${key}`);
137
+ }
138
+ }
139
+ value = value.replace(/(:|\*|\?|\+|\(|\)|\{|\})/g, '\\$1').replace(/--ESCAPED_PARAM_PLUS/g, '+').replace(/--ESCAPED_PARAM_COLON/g, ':').replace(/--ESCAPED_PARAM_QUESTION/g, '?').replace(/--ESCAPED_PARAM_ASTERISKS/g, '*');
140
+ // the value needs to start with a forward-slash to be compiled
141
+ // correctly
142
+ return (0, _routematchutils.safeCompile)(`/${value}`, {
143
+ validate: false
144
+ })(params).slice(1);
145
+ }
146
+ function parseDestination(args) {
147
+ let escaped = args.destination;
148
+ for (const param of Object.keys({
149
+ ...args.params,
150
+ ...args.query
151
+ })){
152
+ if (!param) continue;
153
+ escaped = escapeSegment(escaped, param);
154
+ }
155
+ const parsed = (0, _parseurl.parseUrl)(escaped);
156
+ let pathname = parsed.pathname;
157
+ if (pathname) {
158
+ pathname = unescapeSegments(pathname);
159
+ }
160
+ let href = parsed.href;
161
+ if (href) {
162
+ href = unescapeSegments(href);
163
+ }
164
+ let hostname = parsed.hostname;
165
+ if (hostname) {
166
+ hostname = unescapeSegments(hostname);
167
+ }
168
+ let hash = parsed.hash;
169
+ if (hash) {
170
+ hash = unescapeSegments(hash);
171
+ }
172
+ let search = parsed.search;
173
+ if (search) {
174
+ search = unescapeSegments(search);
175
+ }
176
+ let origin = parsed.origin;
177
+ if (origin) {
178
+ origin = unescapeSegments(origin);
179
+ }
180
+ return {
181
+ ...parsed,
182
+ pathname,
183
+ hostname,
184
+ href,
185
+ hash,
186
+ search,
187
+ origin
188
+ };
189
+ }
190
+ function prepareDestination(args) {
191
+ const parsedDestination = parseDestination(args);
192
+ const { hostname: destHostname, query: destQuery, search: destSearch } = parsedDestination;
193
+ // The following code assumes that the pathname here includes the hash if it's
194
+ // present.
195
+ let destPath = parsedDestination.pathname;
196
+ if (parsedDestination.hash) {
197
+ destPath = `${destPath}${parsedDestination.hash}`;
198
+ }
199
+ const destParams = [];
200
+ const destPathParamKeys = [];
201
+ (0, _routematchutils.safePathToRegexp)(destPath, destPathParamKeys);
202
+ for (const key of destPathParamKeys){
203
+ destParams.push(key.name);
204
+ }
205
+ if (destHostname) {
206
+ const destHostnameParamKeys = [];
207
+ (0, _routematchutils.safePathToRegexp)(destHostname, destHostnameParamKeys);
208
+ for (const key of destHostnameParamKeys){
209
+ destParams.push(key.name);
210
+ }
211
+ }
212
+ const destPathCompiler = (0, _routematchutils.safeCompile)(destPath, // we don't validate while compiling the destination since we should
213
+ // have already validated before we got to this point and validating
214
+ // breaks compiling destinations with named pattern params from the source
215
+ // e.g. /something:hello(.*) -> /another/:hello is broken with validation
216
+ // since compile validation is meant for reversing and not for inserting
217
+ // params from a separate path-regex into another
218
+ {
219
+ validate: false
220
+ });
221
+ let destHostnameCompiler;
222
+ if (destHostname) {
223
+ destHostnameCompiler = (0, _routematchutils.safeCompile)(destHostname, {
224
+ validate: false
225
+ });
226
+ }
227
+ // update any params in query values
228
+ for (const [key, strOrArray] of Object.entries(destQuery)){
229
+ // the value needs to start with a forward-slash to be compiled
230
+ // correctly
231
+ if (Array.isArray(strOrArray)) {
232
+ destQuery[key] = strOrArray.map((value)=>compileNonPath(unescapeSegments(value), args.params));
233
+ } else if (typeof strOrArray === 'string') {
234
+ destQuery[key] = compileNonPath(unescapeSegments(strOrArray), args.params);
235
+ }
236
+ }
237
+ // add path params to query if it's not a redirect and not
238
+ // already defined in destination query or path
239
+ let paramKeys = Object.keys(args.params).filter((name)=>name !== 'nextInternalLocale');
240
+ if (args.appendParamsToQuery && !paramKeys.some((key)=>destParams.includes(key))) {
241
+ for (const key of paramKeys){
242
+ if (!(key in destQuery)) {
243
+ destQuery[key] = args.params[key];
244
+ }
245
+ }
246
+ }
247
+ let newUrl;
248
+ // The compiler also that the interception route marker is an unnamed param, hence '0',
249
+ // so we need to add it to the params object.
250
+ if ((0, _interceptionroutes.isInterceptionRouteAppPath)(destPath)) {
251
+ for (const segment of destPath.split('/')){
252
+ const marker = _interceptionroutes.INTERCEPTION_ROUTE_MARKERS.find((m)=>segment.startsWith(m));
253
+ if (marker) {
254
+ if (marker === '(..)(..)') {
255
+ args.params['0'] = '(..)';
256
+ args.params['1'] = '(..)';
257
+ } else {
258
+ args.params['0'] = marker;
259
+ }
260
+ break;
261
+ }
262
+ }
263
+ }
264
+ try {
265
+ newUrl = destPathCompiler(args.params);
266
+ const [pathname, hash] = newUrl.split('#', 2);
267
+ if (destHostnameCompiler) {
268
+ parsedDestination.hostname = destHostnameCompiler(args.params);
269
+ }
270
+ parsedDestination.pathname = pathname;
271
+ parsedDestination.hash = `${hash ? '#' : ''}${hash || ''}`;
272
+ parsedDestination.search = destSearch ? compileNonPath(destSearch, args.params) : '';
273
+ } catch (err) {
274
+ if (err.message.match(/Expected .*? to not repeat, but got an array/)) {
275
+ throw Object.defineProperty(new Error(`To use a multi-match in the destination you must add \`*\` at the end of the param name to signify it should repeat. https://nextjs.org/docs/messages/invalid-multi-match`), "__NEXT_ERROR_CODE", {
276
+ value: "E329",
277
+ enumerable: false,
278
+ configurable: true
279
+ });
280
+ }
281
+ throw err;
282
+ }
283
+ // Query merge order lowest priority to highest
284
+ // 1. initial URL query values
285
+ // 2. path segment values
286
+ // 3. destination specified query values
287
+ parsedDestination.query = {
288
+ ...args.query,
289
+ ...parsedDestination.query
290
+ };
291
+ return {
292
+ newUrl,
293
+ destQuery,
294
+ parsedDestination
295
+ };
296
+ }
297
+
298
+
299
+ } (prepareDestination.__exports));
300
+ return prepareDestination.__exports;
301
+ }
302
+
303
+ exports.__require = requirePrepareDestination;
@@ -0,0 +1,299 @@
1
+ import { __exports as prepareDestination } from '../../../../../../../_virtual/prepare-destination.js';
2
+ import { __require as requireEscapeRegexp } from '../../escape-regexp.js';
3
+ import { __require as requireParseUrl } from './parse-url.js';
4
+ import { __require as requireInterceptionRoutes } from './interception-routes.js';
5
+ import { __require as requireGetCookieParser } from '../../../../server/api-utils/get-cookie-parser.js';
6
+ import { __require as requireRouteMatchUtils } from './route-match-utils.js';
7
+
8
+ var hasRequiredPrepareDestination;
9
+
10
+ function requirePrepareDestination () {
11
+ if (hasRequiredPrepareDestination) return prepareDestination;
12
+ hasRequiredPrepareDestination = 1;
13
+ (function (exports) {
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ function _export(target, all) {
18
+ for(var name in all)Object.defineProperty(target, name, {
19
+ enumerable: true,
20
+ get: all[name]
21
+ });
22
+ }
23
+ _export(exports, {
24
+ compileNonPath: function() {
25
+ return compileNonPath;
26
+ },
27
+ matchHas: function() {
28
+ return matchHas;
29
+ },
30
+ parseDestination: function() {
31
+ return parseDestination;
32
+ },
33
+ prepareDestination: function() {
34
+ return prepareDestination;
35
+ }
36
+ });
37
+ const _escaperegexp = requireEscapeRegexp();
38
+ const _parseurl = requireParseUrl();
39
+ const _interceptionroutes = requireInterceptionRoutes();
40
+ const _getcookieparser = requireGetCookieParser();
41
+ const _routematchutils = requireRouteMatchUtils();
42
+ /**
43
+ * Ensure only a-zA-Z are used for param names for proper interpolating
44
+ * with path-to-regexp
45
+ */ function getSafeParamName(paramName) {
46
+ let newParamName = '';
47
+ for(let i = 0; i < paramName.length; i++){
48
+ const charCode = paramName.charCodeAt(i);
49
+ if (charCode > 64 && charCode < 91 || // A-Z
50
+ charCode > 96 && charCode < 123 // a-z
51
+ ) {
52
+ newParamName += paramName[i];
53
+ }
54
+ }
55
+ return newParamName;
56
+ }
57
+ function escapeSegment(str, segmentName) {
58
+ return str.replace(new RegExp(`:${(0, _escaperegexp.escapeStringRegexp)(segmentName)}`, 'g'), `__ESC_COLON_${segmentName}`);
59
+ }
60
+ function unescapeSegments(str) {
61
+ return str.replace(/__ESC_COLON_/gi, ':');
62
+ }
63
+ function matchHas(req, query, has = [], missing = []) {
64
+ const params = {};
65
+ const hasMatch = (hasItem)=>{
66
+ let value;
67
+ let key = hasItem.key;
68
+ switch(hasItem.type){
69
+ case 'header':
70
+ {
71
+ key = key.toLowerCase();
72
+ value = req.headers[key];
73
+ break;
74
+ }
75
+ case 'cookie':
76
+ {
77
+ if ('cookies' in req) {
78
+ value = req.cookies[hasItem.key];
79
+ } else {
80
+ const cookies = (0, _getcookieparser.getCookieParser)(req.headers)();
81
+ value = cookies[hasItem.key];
82
+ }
83
+ break;
84
+ }
85
+ case 'query':
86
+ {
87
+ value = query[key];
88
+ break;
89
+ }
90
+ case 'host':
91
+ {
92
+ const { host } = req?.headers || {};
93
+ // remove port from host if present
94
+ const hostname = host?.split(':', 1)[0].toLowerCase();
95
+ value = hostname;
96
+ break;
97
+ }
98
+ }
99
+ if (!hasItem.value && value) {
100
+ params[getSafeParamName(key)] = value;
101
+ return true;
102
+ } else if (value) {
103
+ const matcher = new RegExp(`^${hasItem.value}$`);
104
+ const matches = Array.isArray(value) ? value.slice(-1)[0].match(matcher) : value.match(matcher);
105
+ if (matches) {
106
+ if (Array.isArray(matches)) {
107
+ if (matches.groups) {
108
+ Object.keys(matches.groups).forEach((groupKey)=>{
109
+ params[groupKey] = matches.groups[groupKey];
110
+ });
111
+ } else if (hasItem.type === 'host' && matches[0]) {
112
+ params.host = matches[0];
113
+ }
114
+ }
115
+ return true;
116
+ }
117
+ }
118
+ return false;
119
+ };
120
+ const allMatch = has.every((item)=>hasMatch(item)) && !missing.some((item)=>hasMatch(item));
121
+ if (allMatch) {
122
+ return params;
123
+ }
124
+ return false;
125
+ }
126
+ function compileNonPath(value, params) {
127
+ if (!value.includes(':')) {
128
+ return value;
129
+ }
130
+ for (const key of Object.keys(params)){
131
+ if (value.includes(`:${key}`)) {
132
+ value = value.replace(new RegExp(`:${key}\\*`, 'g'), `:${key}--ESCAPED_PARAM_ASTERISKS`).replace(new RegExp(`:${key}\\?`, 'g'), `:${key}--ESCAPED_PARAM_QUESTION`).replace(new RegExp(`:${key}\\+`, 'g'), `:${key}--ESCAPED_PARAM_PLUS`).replace(new RegExp(`:${key}(?!\\w)`, 'g'), `--ESCAPED_PARAM_COLON${key}`);
133
+ }
134
+ }
135
+ value = value.replace(/(:|\*|\?|\+|\(|\)|\{|\})/g, '\\$1').replace(/--ESCAPED_PARAM_PLUS/g, '+').replace(/--ESCAPED_PARAM_COLON/g, ':').replace(/--ESCAPED_PARAM_QUESTION/g, '?').replace(/--ESCAPED_PARAM_ASTERISKS/g, '*');
136
+ // the value needs to start with a forward-slash to be compiled
137
+ // correctly
138
+ return (0, _routematchutils.safeCompile)(`/${value}`, {
139
+ validate: false
140
+ })(params).slice(1);
141
+ }
142
+ function parseDestination(args) {
143
+ let escaped = args.destination;
144
+ for (const param of Object.keys({
145
+ ...args.params,
146
+ ...args.query
147
+ })){
148
+ if (!param) continue;
149
+ escaped = escapeSegment(escaped, param);
150
+ }
151
+ const parsed = (0, _parseurl.parseUrl)(escaped);
152
+ let pathname = parsed.pathname;
153
+ if (pathname) {
154
+ pathname = unescapeSegments(pathname);
155
+ }
156
+ let href = parsed.href;
157
+ if (href) {
158
+ href = unescapeSegments(href);
159
+ }
160
+ let hostname = parsed.hostname;
161
+ if (hostname) {
162
+ hostname = unescapeSegments(hostname);
163
+ }
164
+ let hash = parsed.hash;
165
+ if (hash) {
166
+ hash = unescapeSegments(hash);
167
+ }
168
+ let search = parsed.search;
169
+ if (search) {
170
+ search = unescapeSegments(search);
171
+ }
172
+ let origin = parsed.origin;
173
+ if (origin) {
174
+ origin = unescapeSegments(origin);
175
+ }
176
+ return {
177
+ ...parsed,
178
+ pathname,
179
+ hostname,
180
+ href,
181
+ hash,
182
+ search,
183
+ origin
184
+ };
185
+ }
186
+ function prepareDestination(args) {
187
+ const parsedDestination = parseDestination(args);
188
+ const { hostname: destHostname, query: destQuery, search: destSearch } = parsedDestination;
189
+ // The following code assumes that the pathname here includes the hash if it's
190
+ // present.
191
+ let destPath = parsedDestination.pathname;
192
+ if (parsedDestination.hash) {
193
+ destPath = `${destPath}${parsedDestination.hash}`;
194
+ }
195
+ const destParams = [];
196
+ const destPathParamKeys = [];
197
+ (0, _routematchutils.safePathToRegexp)(destPath, destPathParamKeys);
198
+ for (const key of destPathParamKeys){
199
+ destParams.push(key.name);
200
+ }
201
+ if (destHostname) {
202
+ const destHostnameParamKeys = [];
203
+ (0, _routematchutils.safePathToRegexp)(destHostname, destHostnameParamKeys);
204
+ for (const key of destHostnameParamKeys){
205
+ destParams.push(key.name);
206
+ }
207
+ }
208
+ const destPathCompiler = (0, _routematchutils.safeCompile)(destPath, // we don't validate while compiling the destination since we should
209
+ // have already validated before we got to this point and validating
210
+ // breaks compiling destinations with named pattern params from the source
211
+ // e.g. /something:hello(.*) -> /another/:hello is broken with validation
212
+ // since compile validation is meant for reversing and not for inserting
213
+ // params from a separate path-regex into another
214
+ {
215
+ validate: false
216
+ });
217
+ let destHostnameCompiler;
218
+ if (destHostname) {
219
+ destHostnameCompiler = (0, _routematchutils.safeCompile)(destHostname, {
220
+ validate: false
221
+ });
222
+ }
223
+ // update any params in query values
224
+ for (const [key, strOrArray] of Object.entries(destQuery)){
225
+ // the value needs to start with a forward-slash to be compiled
226
+ // correctly
227
+ if (Array.isArray(strOrArray)) {
228
+ destQuery[key] = strOrArray.map((value)=>compileNonPath(unescapeSegments(value), args.params));
229
+ } else if (typeof strOrArray === 'string') {
230
+ destQuery[key] = compileNonPath(unescapeSegments(strOrArray), args.params);
231
+ }
232
+ }
233
+ // add path params to query if it's not a redirect and not
234
+ // already defined in destination query or path
235
+ let paramKeys = Object.keys(args.params).filter((name)=>name !== 'nextInternalLocale');
236
+ if (args.appendParamsToQuery && !paramKeys.some((key)=>destParams.includes(key))) {
237
+ for (const key of paramKeys){
238
+ if (!(key in destQuery)) {
239
+ destQuery[key] = args.params[key];
240
+ }
241
+ }
242
+ }
243
+ let newUrl;
244
+ // The compiler also that the interception route marker is an unnamed param, hence '0',
245
+ // so we need to add it to the params object.
246
+ if ((0, _interceptionroutes.isInterceptionRouteAppPath)(destPath)) {
247
+ for (const segment of destPath.split('/')){
248
+ const marker = _interceptionroutes.INTERCEPTION_ROUTE_MARKERS.find((m)=>segment.startsWith(m));
249
+ if (marker) {
250
+ if (marker === '(..)(..)') {
251
+ args.params['0'] = '(..)';
252
+ args.params['1'] = '(..)';
253
+ } else {
254
+ args.params['0'] = marker;
255
+ }
256
+ break;
257
+ }
258
+ }
259
+ }
260
+ try {
261
+ newUrl = destPathCompiler(args.params);
262
+ const [pathname, hash] = newUrl.split('#', 2);
263
+ if (destHostnameCompiler) {
264
+ parsedDestination.hostname = destHostnameCompiler(args.params);
265
+ }
266
+ parsedDestination.pathname = pathname;
267
+ parsedDestination.hash = `${hash ? '#' : ''}${hash || ''}`;
268
+ parsedDestination.search = destSearch ? compileNonPath(destSearch, args.params) : '';
269
+ } catch (err) {
270
+ if (err.message.match(/Expected .*? to not repeat, but got an array/)) {
271
+ throw Object.defineProperty(new Error(`To use a multi-match in the destination you must add \`*\` at the end of the param name to signify it should repeat. https://nextjs.org/docs/messages/invalid-multi-match`), "__NEXT_ERROR_CODE", {
272
+ value: "E329",
273
+ enumerable: false,
274
+ configurable: true
275
+ });
276
+ }
277
+ throw err;
278
+ }
279
+ // Query merge order lowest priority to highest
280
+ // 1. initial URL query values
281
+ // 2. path segment values
282
+ // 3. destination specified query values
283
+ parsedDestination.query = {
284
+ ...args.query,
285
+ ...parsedDestination.query
286
+ };
287
+ return {
288
+ newUrl,
289
+ destQuery,
290
+ parsedDestination
291
+ };
292
+ }
293
+
294
+
295
+ } (prepareDestination));
296
+ return prepareDestination;
297
+ }
298
+
299
+ export { requirePrepareDestination as __require };
@@ -0,0 +1,90 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+
5
+ const querystring = require('../../../../../../../_virtual/querystring.cjs');
6
+
7
+ var hasRequiredQuerystring;
8
+
9
+ function requireQuerystring () {
10
+ if (hasRequiredQuerystring) return querystring.__exports;
11
+ hasRequiredQuerystring = 1;
12
+ (function (exports) {
13
+ Object.defineProperty(exports, "__esModule", {
14
+ value: true
15
+ });
16
+ function _export(target, all) {
17
+ for(var name in all)Object.defineProperty(target, name, {
18
+ enumerable: true,
19
+ get: all[name]
20
+ });
21
+ }
22
+ _export(exports, {
23
+ assign: function() {
24
+ return assign;
25
+ },
26
+ searchParamsToUrlQuery: function() {
27
+ return searchParamsToUrlQuery;
28
+ },
29
+ urlQueryToSearchParams: function() {
30
+ return urlQueryToSearchParams;
31
+ }
32
+ });
33
+ function searchParamsToUrlQuery(searchParams) {
34
+ const query = {};
35
+ for (const [key, value] of searchParams.entries()){
36
+ const existing = query[key];
37
+ if (typeof existing === 'undefined') {
38
+ query[key] = value;
39
+ } else if (Array.isArray(existing)) {
40
+ existing.push(value);
41
+ } else {
42
+ query[key] = [
43
+ existing,
44
+ value
45
+ ];
46
+ }
47
+ }
48
+ return query;
49
+ }
50
+ function stringifyUrlQueryParam(param) {
51
+ if (typeof param === 'string') {
52
+ return param;
53
+ }
54
+ if (typeof param === 'number' && !isNaN(param) || typeof param === 'boolean') {
55
+ return String(param);
56
+ } else {
57
+ return '';
58
+ }
59
+ }
60
+ function urlQueryToSearchParams(query) {
61
+ const searchParams = new URLSearchParams();
62
+ for (const [key, value] of Object.entries(query)){
63
+ if (Array.isArray(value)) {
64
+ for (const item of value){
65
+ searchParams.append(key, stringifyUrlQueryParam(item));
66
+ }
67
+ } else {
68
+ searchParams.set(key, stringifyUrlQueryParam(value));
69
+ }
70
+ }
71
+ return searchParams;
72
+ }
73
+ function assign(target, ...searchParamsList) {
74
+ for (const searchParams of searchParamsList){
75
+ for (const key of searchParams.keys()){
76
+ target.delete(key);
77
+ }
78
+ for (const [key, value] of searchParams.entries()){
79
+ target.append(key, value);
80
+ }
81
+ }
82
+ return target;
83
+ }
84
+
85
+
86
+ } (querystring.__exports));
87
+ return querystring.__exports;
88
+ }
89
+
90
+ exports.__require = requireQuerystring;