one 1.1.298 → 1.1.299

Sign up to get free protection for your applications and to get access to all the features.
Files changed (279) hide show
  1. package/dist/cjs/vite/replaceLoader.js +7 -1
  2. package/dist/cjs/vite/replaceLoader.js.map +1 -1
  3. package/dist/cjs/vite/replaceLoader.native.js +7 -1
  4. package/dist/cjs/vite/replaceLoader.native.js.map +1 -1
  5. package/dist/esm/Root.native.js +110 -104
  6. package/dist/esm/Root.native.js.map +6 -1
  7. package/dist/esm/Route.native.js +12 -10
  8. package/dist/esm/Route.native.js.map +6 -1
  9. package/dist/esm/cleanUrl.native.js +12 -13
  10. package/dist/esm/cleanUrl.native.js.map +6 -1
  11. package/dist/esm/cli/label-process.native.js +5 -4
  12. package/dist/esm/cli/label-process.native.js.map +6 -1
  13. package/dist/esm/cli/main.native.js +8 -13
  14. package/dist/esm/cli/main.native.js.map +6 -1
  15. package/dist/esm/cli/prebuild.native.js +5 -5
  16. package/dist/esm/cli/prebuild.native.js.map +6 -1
  17. package/dist/esm/cli/run.native.js +21 -28
  18. package/dist/esm/cli/run.native.js.map +6 -1
  19. package/dist/esm/cli.native.js +119 -148
  20. package/dist/esm/cli.native.js.map +6 -1
  21. package/dist/esm/clientLoaderResolver.native.js +9 -6
  22. package/dist/esm/clientLoaderResolver.native.js.map +6 -1
  23. package/dist/esm/config.native.js +12 -11
  24. package/dist/esm/config.native.js.map +6 -1
  25. package/dist/esm/constants.native.js +7 -5
  26. package/dist/esm/constants.native.js.map +6 -1
  27. package/dist/esm/createApp.native.js +13 -9
  28. package/dist/esm/createApp.native.js.map +6 -1
  29. package/dist/esm/createHandleRequest.native.js +55 -64
  30. package/dist/esm/createHandleRequest.native.js.map +6 -1
  31. package/dist/esm/createRoute.native.js +16 -16
  32. package/dist/esm/createRoute.native.js.map +6 -1
  33. package/dist/esm/fallbackViews/Sitemap.native.js +6 -3
  34. package/dist/esm/fallbackViews/Sitemap.native.js.map +6 -1
  35. package/dist/esm/fallbackViews/Unmatched.native.js +5 -3
  36. package/dist/esm/fallbackViews/Unmatched.native.js.map +6 -1
  37. package/dist/esm/fork/NavigationContainer.native.js +24 -31
  38. package/dist/esm/fork/NavigationContainer.native.js.map +6 -1
  39. package/dist/esm/fork/createMemoryHistory.native.js +99 -115
  40. package/dist/esm/fork/createMemoryHistory.native.js.map +6 -1
  41. package/dist/esm/fork/extractPathFromURL.native.js +16 -15
  42. package/dist/esm/fork/extractPathFromURL.native.js.map +6 -1
  43. package/dist/esm/fork/findFocusedRoute.native.js +6 -5
  44. package/dist/esm/fork/findFocusedRoute.native.js.map +6 -1
  45. package/dist/esm/fork/getPathFromState.native.js +127 -140
  46. package/dist/esm/fork/getPathFromState.native.js.map +6 -1
  47. package/dist/esm/fork/getStateFromPath.native.js +292 -288
  48. package/dist/esm/fork/getStateFromPath.native.js.map +6 -1
  49. package/dist/esm/fork/useLinking.native.js +70 -61
  50. package/dist/esm/fork/useLinking.native.js.map +6 -1
  51. package/dist/esm/fork/validatePathConfig.native.js +15 -9
  52. package/dist/esm/fork/validatePathConfig.native.js.map +6 -1
  53. package/dist/esm/getLinkingConfig.native.js +11 -6
  54. package/dist/esm/getLinkingConfig.native.js.map +6 -1
  55. package/dist/esm/getReactNavigationConfig.native.js +28 -20
  56. package/dist/esm/getReactNavigationConfig.native.js.map +6 -1
  57. package/dist/esm/getRoutes.native.js +249 -229
  58. package/dist/esm/getRoutes.native.js.map +6 -1
  59. package/dist/esm/getURL.native.js +4 -4
  60. package/dist/esm/getURL.native.js.map +6 -1
  61. package/dist/esm/head/Head.android.js +5 -3
  62. package/dist/esm/head/Head.android.js.map +6 -1
  63. package/dist/esm/head/Head.ios.js +144 -132
  64. package/dist/esm/head/Head.ios.js.map +6 -1
  65. package/dist/esm/head/Head.native.js +7 -7
  66. package/dist/esm/head/Head.native.js.map +6 -1
  67. package/dist/esm/head/HeadModule.native.js +6 -6
  68. package/dist/esm/head/HeadModule.native.js.map +6 -1
  69. package/dist/esm/head/index.native.js +2 -2
  70. package/dist/esm/head/index.native.js.map +6 -1
  71. package/dist/esm/head/types.native.js +1 -2
  72. package/dist/esm/head/types.native.js.map +6 -1
  73. package/dist/esm/head/url.native.js +10 -8
  74. package/dist/esm/head/url.native.js.map +6 -1
  75. package/dist/esm/hooks.native.js +53 -34
  76. package/dist/esm/hooks.native.js.map +6 -1
  77. package/dist/esm/imperative-api.native.js +9 -6
  78. package/dist/esm/imperative-api.native.js.map +6 -1
  79. package/dist/esm/import-mode/index.android.js +4 -3
  80. package/dist/esm/import-mode/index.android.js.map +6 -1
  81. package/dist/esm/import-mode/index.ios.js +4 -3
  82. package/dist/esm/import-mode/index.ios.js.map +6 -1
  83. package/dist/esm/import-mode/index.native.js +3 -1
  84. package/dist/esm/import-mode/index.native.js.map +6 -1
  85. package/dist/esm/index.native.js +65 -27
  86. package/dist/esm/index.native.js.map +6 -1
  87. package/dist/esm/interfaces/router.native.js +4 -2
  88. package/dist/esm/interfaces/router.native.js.map +6 -1
  89. package/dist/esm/layouts/Drawer.native.js +7 -6
  90. package/dist/esm/layouts/Drawer.native.js.map +6 -1
  91. package/dist/esm/layouts/Stack.native.js +7 -6
  92. package/dist/esm/layouts/Stack.native.js.map +6 -1
  93. package/dist/esm/layouts/Tabs.native.js +42 -39
  94. package/dist/esm/layouts/Tabs.native.js.map +6 -1
  95. package/dist/esm/layouts/withLayoutContext.native.js +51 -48
  96. package/dist/esm/layouts/withLayoutContext.native.js.map +6 -1
  97. package/dist/esm/link/Link.native.js +62 -53
  98. package/dist/esm/link/Link.native.js.map +6 -1
  99. package/dist/esm/link/Redirect.native.js +8 -9
  100. package/dist/esm/link/Redirect.native.js.map +6 -1
  101. package/dist/esm/link/href.native.js +28 -27
  102. package/dist/esm/link/href.native.js.map +6 -1
  103. package/dist/esm/link/linking.native.js +51 -40
  104. package/dist/esm/link/linking.native.js.map +6 -1
  105. package/dist/esm/link/path.native.js +28 -19
  106. package/dist/esm/link/path.native.js.map +6 -1
  107. package/dist/esm/link/useLinkTo.native.js +22 -20
  108. package/dist/esm/link/useLinkTo.native.js.map +6 -1
  109. package/dist/esm/link/useLoadedNavigation.native.js +30 -23
  110. package/dist/esm/link/useLoadedNavigation.native.js.map +6 -1
  111. package/dist/esm/matchers.native.js +16 -3
  112. package/dist/esm/matchers.native.js.map +6 -1
  113. package/dist/esm/platform.native.js +4 -2
  114. package/dist/esm/platform.native.js.map +6 -1
  115. package/dist/esm/polyfills-mobile.native.js +4 -5
  116. package/dist/esm/polyfills-mobile.native.js.map +6 -1
  117. package/dist/esm/polyfills-server.native.js +1 -1
  118. package/dist/esm/polyfills-server.native.js.map +6 -1
  119. package/dist/esm/render.native.js +3 -1
  120. package/dist/esm/render.native.js.map +6 -1
  121. package/dist/esm/router/RouterStore.native.js +1 -2
  122. package/dist/esm/router/RouterStore.native.js.map +6 -1
  123. package/dist/esm/router/constants.native.js +4 -2
  124. package/dist/esm/router/constants.native.js.map +6 -1
  125. package/dist/esm/router/getNormalizedStatePath.native.js +18 -17
  126. package/dist/esm/router/getNormalizedStatePath.native.js.map +6 -1
  127. package/dist/esm/router/lastAction.native.js +10 -9
  128. package/dist/esm/router/lastAction.native.js.map +6 -1
  129. package/dist/esm/router/router.native.js +135 -114
  130. package/dist/esm/router/router.native.js.map +6 -1
  131. package/dist/esm/router/serverLocationContext.native.js +4 -2
  132. package/dist/esm/router/serverLocationContext.native.js.map +6 -1
  133. package/dist/esm/router/useInitializeOneRouter.native.js +8 -5
  134. package/dist/esm/router/useInitializeOneRouter.native.js.map +6 -1
  135. package/dist/esm/serve.native.js +77 -104
  136. package/dist/esm/serve.native.js.map +6 -1
  137. package/dist/esm/server/createRoutesManifest.native.js +14 -11
  138. package/dist/esm/server/createRoutesManifest.native.js.map +6 -1
  139. package/dist/esm/server/getServerManifest.native.js +61 -67
  140. package/dist/esm/server/getServerManifest.native.js.map +6 -1
  141. package/dist/esm/server-render.native.js +9 -10
  142. package/dist/esm/server-render.native.js.map +6 -1
  143. package/dist/esm/sortRoutes.native.js +27 -17
  144. package/dist/esm/sortRoutes.native.js.map +6 -1
  145. package/dist/esm/typed-routes/generateRouteTypes.native.js +10 -11
  146. package/dist/esm/typed-routes/generateRouteTypes.native.js.map +6 -1
  147. package/dist/esm/typed-routes/getTypedRoutesDeclarationFile.native.js +38 -37
  148. package/dist/esm/typed-routes/getTypedRoutesDeclarationFile.native.js.map +6 -1
  149. package/dist/esm/types.native.js +1 -2
  150. package/dist/esm/types.native.js.map +6 -1
  151. package/dist/esm/useFocusEffect.native.js +25 -22
  152. package/dist/esm/useFocusEffect.native.js.map +6 -1
  153. package/dist/esm/useLoader.native.js +50 -50
  154. package/dist/esm/useLoader.native.js.map +6 -1
  155. package/dist/esm/useNavigation.native.js +23 -19
  156. package/dist/esm/useNavigation.native.js.map +6 -1
  157. package/dist/esm/useScreens.native.js +143 -160
  158. package/dist/esm/useScreens.native.js.map +6 -1
  159. package/dist/esm/useViteRoutes.native.js +25 -28
  160. package/dist/esm/useViteRoutes.native.js.map +6 -1
  161. package/dist/esm/utils/assertIsReady.native.js +6 -3
  162. package/dist/esm/utils/assertIsReady.native.js.map +6 -1
  163. package/dist/esm/utils/dynamicImport.native.js +5 -3
  164. package/dist/esm/utils/dynamicImport.native.js.map +6 -1
  165. package/dist/esm/utils/existsAsync.native.js +6 -4
  166. package/dist/esm/utils/existsAsync.native.js.map +6 -1
  167. package/dist/esm/utils/getPageExport.native.js +12 -11
  168. package/dist/esm/utils/getPageExport.native.js.map +6 -1
  169. package/dist/esm/utils/globDir.native.js +5 -3
  170. package/dist/esm/utils/globDir.native.js.map +6 -1
  171. package/dist/esm/utils/hashString.native.js +4 -2
  172. package/dist/esm/utils/hashString.native.js.map +6 -1
  173. package/dist/esm/utils/isResponse.native.js +4 -2
  174. package/dist/esm/utils/isResponse.native.js.map +6 -1
  175. package/dist/esm/utils/isStatus.native.js +4 -2
  176. package/dist/esm/utils/isStatus.native.js.map +6 -1
  177. package/dist/esm/utils/promiseWithResolvers.native.js +7 -7
  178. package/dist/esm/utils/promiseWithResolvers.native.js.map +6 -1
  179. package/dist/esm/utils/rand.native.js +5 -3
  180. package/dist/esm/utils/rand.native.js.map +6 -1
  181. package/dist/esm/utils/redirect.native.js +7 -5
  182. package/dist/esm/utils/redirect.native.js.map +6 -1
  183. package/dist/esm/utils/removeSearch.native.js +4 -2
  184. package/dist/esm/utils/removeSearch.native.js.map +6 -1
  185. package/dist/esm/utils/removeUndefined.native.js +6 -3
  186. package/dist/esm/utils/removeUndefined.native.js.map +6 -1
  187. package/dist/esm/utils/requireResolve.native.js +4 -2
  188. package/dist/esm/utils/requireResolve.native.js.map +6 -1
  189. package/dist/esm/utils/url.native.js +6 -2
  190. package/dist/esm/utils/url.native.js.map +6 -1
  191. package/dist/esm/utils/weakKey.native.js +11 -10
  192. package/dist/esm/utils/weakKey.native.js.map +6 -1
  193. package/dist/esm/utils/weakMemo.native.js +8 -8
  194. package/dist/esm/utils/weakMemo.native.js.map +6 -1
  195. package/dist/esm/views/EmptyRoute.native.js +5 -3
  196. package/dist/esm/views/EmptyRoute.native.js.map +6 -1
  197. package/dist/esm/views/ErrorBoundary.native.js +5 -8
  198. package/dist/esm/views/ErrorBoundary.native.js.map +6 -1
  199. package/dist/esm/views/LoadProgressBar.native.js +58 -57
  200. package/dist/esm/views/LoadProgressBar.native.js.map +6 -1
  201. package/dist/esm/views/Navigator.native.js +54 -71
  202. package/dist/esm/views/Navigator.native.js.map +6 -1
  203. package/dist/esm/views/PreloadLinks.native.js +3 -1
  204. package/dist/esm/views/PreloadLinks.native.js.map +6 -1
  205. package/dist/esm/views/RootErrorBoundary.native.js +39 -29
  206. package/dist/esm/views/RootErrorBoundary.native.js.map +6 -1
  207. package/dist/esm/views/Screen.native.js +12 -12
  208. package/dist/esm/views/Screen.native.js.map +6 -1
  209. package/dist/esm/views/ScrollRestoration.native.js +27 -27
  210. package/dist/esm/views/ScrollRestoration.native.js.map +6 -1
  211. package/dist/esm/views/Try.native.js +40 -37
  212. package/dist/esm/views/Try.native.js.map +6 -1
  213. package/dist/esm/vite/build.native.js +260 -295
  214. package/dist/esm/vite/build.native.js.map +6 -1
  215. package/dist/esm/vite/clientTreeShakePlugin.native.js +34 -33
  216. package/dist/esm/vite/clientTreeShakePlugin.native.js.map +6 -1
  217. package/dist/esm/vite/constants.native.js +6 -4
  218. package/dist/esm/vite/constants.native.js.map +6 -1
  219. package/dist/esm/vite/createFileSystemRouter.native.js +99 -130
  220. package/dist/esm/vite/createFileSystemRouter.native.js.map +6 -1
  221. package/dist/esm/vite/customNodeExternals.native.js +9 -10
  222. package/dist/esm/vite/customNodeExternals.native.js.map +6 -1
  223. package/dist/esm/vite/ensureTsConfig.native.js +7 -5
  224. package/dist/esm/vite/ensureTsConfig.native.js.map +6 -1
  225. package/dist/esm/vite/findDepsToOptimize.native.js +27 -19
  226. package/dist/esm/vite/findDepsToOptimize.native.js.map +6 -1
  227. package/dist/esm/vite/fixDependenciesPlugin.native.js +5 -3
  228. package/dist/esm/vite/fixDependenciesPlugin.native.js.map +6 -1
  229. package/dist/esm/vite/generateTypesForRoutes.native.js +9 -9
  230. package/dist/esm/vite/generateTypesForRoutes.native.js.map +6 -1
  231. package/dist/esm/vite/getManifest.native.js +6 -4
  232. package/dist/esm/vite/getManifest.native.js.map +6 -1
  233. package/dist/esm/vite/headers.native.js +11 -5
  234. package/dist/esm/vite/headers.native.js.map +6 -1
  235. package/dist/esm/vite/loadEnv.native.js +7 -6
  236. package/dist/esm/vite/loadEnv.native.js.map +6 -1
  237. package/dist/esm/vite/makePluginWebOnly.native.js +9 -5
  238. package/dist/esm/vite/makePluginWebOnly.native.js.map +6 -1
  239. package/dist/esm/vite/one.native.js +142 -127
  240. package/dist/esm/vite/one.native.js.map +6 -1
  241. package/dist/esm/vite/removeReactNativeWebAnimatedPlugin.native.js +14 -11
  242. package/dist/esm/vite/removeReactNativeWebAnimatedPlugin.native.js.map +6 -1
  243. package/dist/esm/vite/replaceLoader.js +7 -1
  244. package/dist/esm/vite/replaceLoader.js.map +1 -1
  245. package/dist/esm/vite/replaceLoader.mjs +5 -1
  246. package/dist/esm/vite/replaceLoader.mjs.map +1 -1
  247. package/dist/esm/vite/replaceLoader.native.js +13 -10
  248. package/dist/esm/vite/replaceLoader.native.js.map +6 -1
  249. package/dist/esm/vite/resolveAPIRequest.native.js +44 -47
  250. package/dist/esm/vite/resolveAPIRequest.native.js.map +6 -1
  251. package/dist/esm/vite/server.native.js +5 -4
  252. package/dist/esm/vite/server.native.js.map +6 -1
  253. package/dist/esm/vite/types.native.js +1 -2
  254. package/dist/esm/vite/types.native.js.map +6 -1
  255. package/dist/esm/vite/virtualEntryPlugin.native.js +21 -16
  256. package/dist/esm/vite/virtualEntryPlugin.native.js.map +6 -1
  257. package/dist/esm/vite/vitePluginSsrCss.native.js +61 -50
  258. package/dist/esm/vite/vitePluginSsrCss.native.js.map +6 -1
  259. package/dist/esm/vite.native.js +19 -10
  260. package/dist/esm/vite.native.js.map +6 -1
  261. package/dist/esm/zero/getQueryKey.native.js +5 -3
  262. package/dist/esm/zero/getQueryKey.native.js.map +6 -1
  263. package/dist/esm/zero/isZeroQuery.native.js +4 -2
  264. package/dist/esm/zero/isZeroQuery.native.js.map +6 -1
  265. package/dist/esm/zero/resolveQuery.native.js +9 -8
  266. package/dist/esm/zero/resolveQuery.native.js.map +6 -1
  267. package/dist/esm/zero/subscribeToQuery.native.js +5 -3
  268. package/dist/esm/zero/subscribeToQuery.native.js.map +6 -1
  269. package/dist/esm/zero/types.native.js +1 -2
  270. package/dist/esm/zero/types.native.js.map +6 -1
  271. package/dist/esm/zero/useQuery.native.js +12 -12
  272. package/dist/esm/zero/useQuery.native.js.map +6 -1
  273. package/dist/esm/zero/useQueryZero.native.js +24 -20
  274. package/dist/esm/zero/useQueryZero.native.js.map +6 -1
  275. package/dist/esm/zero.native.js +9 -5
  276. package/dist/esm/zero.native.js.map +6 -1
  277. package/package.json +7 -7
  278. package/src/vite/replaceLoader.ts +7 -1
  279. package/types/vite/replaceLoader.d.ts.map +1 -1
@@ -1,11 +1,16 @@
1
- import { getDefaultRenderMode } from "./config.native.js";
2
- import { matchArrayGroupName, matchDeepDynamicRouteName, matchDynamicName, matchGroupName, removeSupportedExtensions } from "./matchers.native.js";
3
- import { getPageExport } from "./utils/getPageExport.native.js";
4
- var validPlatforms = /* @__PURE__ */new Set(["android", "ios", "native", "web"]);
1
+ import { getDefaultRenderMode } from "./config";
2
+ import { matchArrayGroupName, matchDeepDynamicRouteName, matchDynamicName, matchGroupName, removeSupportedExtensions } from "./matchers";
3
+ import { getPageExport } from "./utils/getPageExport";
4
+ var validPlatforms = /* @__PURE__ */ new Set([
5
+ "android",
6
+ "ios",
7
+ "native",
8
+ "web"
9
+ ]);
5
10
  function getRoutes(contextModule) {
6
- var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {},
7
- directoryTree = getDirectoryTree(contextModule, options);
8
- if (!directoryTree) return null;
11
+ var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, directoryTree = getDirectoryTree(contextModule, options);
12
+ if (!directoryTree)
13
+ return null;
9
14
  var rootNode = flattenDirectoryTreeToRoutes(directoryTree, options);
10
15
  return options.ignoreEntryPoints || crawlAndAppendInitialRoutesAndEntryFiles(rootNode, options), rootNode;
11
16
  }
@@ -17,133 +22,136 @@ function getExactRoutes(contextModule) {
17
22
  });
18
23
  }
19
24
  function getDirectoryTree(contextModule, options) {
20
- var importMode = options.importMode || process.env.One_ROUTER_IMPORT_MODE,
21
- ignoreList = [/^\.\/\+html\.[tj]sx?$/];
25
+ var importMode = options.importMode || process.env.One_ROUTER_IMPORT_MODE, ignoreList = [
26
+ /^\.\/\+html\.[tj]sx?$/
27
+ ];
22
28
  options.ignore && ignoreList.push(...options.ignore), options.preserveApiRoutes || ignoreList.push(/\+api\.[tj]sx?$/);
23
29
  var rootDirectory = {
24
- files: /* @__PURE__ */new Map(),
25
- subdirectories: /* @__PURE__ */new Map()
26
- },
27
- hasRoutes = !1,
28
- isValid = !1,
29
- _iteratorNormalCompletion = !0,
30
- _didIteratorError = !1,
31
- _iteratorError = void 0;
30
+ files: /* @__PURE__ */ new Map(),
31
+ subdirectories: /* @__PURE__ */ new Map()
32
+ }, hasRoutes = !1, isValid = !1, _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
32
33
  try {
33
- for (var _loop = function () {
34
- var filePath = _step.value;
35
- if (ignoreList.some(function (regex) {
36
- return regex.test(filePath);
37
- })) return "continue";
38
- isValid = !0;
39
- var meta = getFileMeta(filePath, options);
40
- if (meta.specificity < 0) return "continue";
41
- var type = meta.isLayout ? "layout" : meta.renderMode || getDefaultRenderMode(),
42
- node = {
43
- type,
44
- loadRoute() {
45
- if (options.ignoreRequireErrors) try {
46
- return contextModule(filePath);
47
- } catch {
48
- return {};
49
- } else return contextModule(filePath);
50
- },
51
- contextKey: filePath,
52
- route: "",
53
- // This is overwritten during hoisting based upon the _layout
54
- dynamic: null,
55
- children: []
56
- };
57
- if (process.env.NODE_ENV === "development" && node.type !== "api" && importMode === "sync" && !getPageExport(node.loadRoute())) return "continue";
58
- var _iteratorNormalCompletion2 = !0,
59
- _didIteratorError2 = !1,
60
- _iteratorError2 = void 0;
61
- try {
62
- for (var _iterator2 = extrapolateGroups(meta.route)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion2 = (_step1 = _iterator2.next()).done); _iteratorNormalCompletion2 = !0) {
63
- var route = _step1.value,
64
- subdirectoryParts = route.split("/").slice(0, -1),
65
- directory = rootDirectory,
66
- _iteratorNormalCompletion1 = !0,
67
- _didIteratorError1 = !1,
68
- _iteratorError1 = void 0;
34
+ for (var _loop = function() {
35
+ var filePath = _step.value;
36
+ if (ignoreList.some(function(regex) {
37
+ return regex.test(filePath);
38
+ }))
39
+ return "continue";
40
+ isValid = !0;
41
+ var meta = getFileMeta(filePath, options);
42
+ if (meta.specificity < 0)
43
+ return "continue";
44
+ var type = meta.isLayout ? "layout" : meta.renderMode || getDefaultRenderMode(), node = {
45
+ type,
46
+ loadRoute() {
47
+ if (options.ignoreRequireErrors)
69
48
  try {
70
- for (var _iterator1 = subdirectoryParts[Symbol.iterator](), _step2; !(_iteratorNormalCompletion1 = (_step2 = _iterator1.next()).done); _iteratorNormalCompletion1 = !0) {
71
- var part = _step2.value,
72
- subDirectory = directory.subdirectories.get(part);
73
- subDirectory || (subDirectory = {
74
- files: /* @__PURE__ */new Map(),
75
- subdirectories: /* @__PURE__ */new Map()
76
- }, directory.subdirectories.set(part, subDirectory)), directory = subDirectory;
77
- }
78
- } catch (err) {
79
- _didIteratorError1 = !0, _iteratorError1 = err;
80
- } finally {
81
- try {
82
- !_iteratorNormalCompletion1 && _iterator1.return != null && _iterator1.return();
83
- } finally {
84
- if (_didIteratorError1) throw _iteratorError1;
85
- }
49
+ return contextModule(filePath);
50
+ } catch {
51
+ return {};
86
52
  }
87
- if (node = {
88
- ...node,
89
- route
90
- }, meta.isLayout) {
91
- var _directory, _layout;
92
- (_layout = (_directory = directory).layout) !== null && _layout !== void 0 || (_directory.layout = []);
93
- var existing = directory.layout[meta.specificity];
94
- if (existing) {
95
- if (process.env.NODE_ENV !== "production") throw new Error(`The layouts "${filePath}" and "${existing.contextKey}" conflict on the route "/${route}". Please remove or rename one of these files.`);
96
- } else node = getLayoutNode(node, options), directory.layout[meta.specificity] = node;
97
- } else if (type === "api") {
98
- var fileKey = `${route}+api`,
99
- nodes = directory.files.get(fileKey);
100
- nodes || (nodes = [], directory.files.set(fileKey, nodes));
101
- var existing1 = nodes[0];
102
- if (existing1) {
103
- if (process.env.NODE_ENV !== "production") throw new Error(`The API route file "${filePath}" and "${existing1.contextKey}" conflict on the route "/${route}". Please remove or rename one of these files.`);
104
- } else nodes[0] = node;
105
- } else {
106
- var nodes1 = directory.files.get(route);
107
- nodes1 || (nodes1 = [], directory.files.set(route, nodes1));
108
- var existing2 = nodes1[meta.specificity];
109
- if (existing2) {
110
- if (process.env.NODE_ENV !== "production") throw new Error(`The route files "${filePath}" and "${existing2.contextKey}" conflict on the route "/${route}". Please remove or rename one of these files.`);
111
- } else hasRoutes || (hasRoutes = !0), nodes1[meta.specificity] = node;
112
- }
113
- }
114
- } catch (err) {
115
- _didIteratorError2 = !0, _iteratorError2 = err;
116
- } finally {
53
+ else
54
+ return contextModule(filePath);
55
+ },
56
+ contextKey: filePath,
57
+ route: "",
58
+ // This is overwritten during hoisting based upon the _layout
59
+ dynamic: null,
60
+ children: []
61
+ };
62
+ if (process.env.NODE_ENV === "development" && node.type !== "api" && importMode === "sync" && !getPageExport(node.loadRoute()))
63
+ return "continue";
64
+ var _iteratorNormalCompletion2 = !0, _didIteratorError2 = !1, _iteratorError2 = void 0;
65
+ try {
66
+ for (var _iterator2 = extrapolateGroups(meta.route)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion2 = (_step1 = _iterator2.next()).done); _iteratorNormalCompletion2 = !0) {
67
+ var route = _step1.value, subdirectoryParts = route.split("/").slice(0, -1), directory = rootDirectory, _iteratorNormalCompletion1 = !0, _didIteratorError1 = !1, _iteratorError1 = void 0;
117
68
  try {
118
- !_iteratorNormalCompletion2 && _iterator2.return != null && _iterator2.return();
69
+ for (var _iterator1 = subdirectoryParts[Symbol.iterator](), _step2; !(_iteratorNormalCompletion1 = (_step2 = _iterator1.next()).done); _iteratorNormalCompletion1 = !0) {
70
+ var part = _step2.value, subDirectory = directory.subdirectories.get(part);
71
+ subDirectory || (subDirectory = {
72
+ files: /* @__PURE__ */ new Map(),
73
+ subdirectories: /* @__PURE__ */ new Map()
74
+ }, directory.subdirectories.set(part, subDirectory)), directory = subDirectory;
75
+ }
76
+ } catch (err) {
77
+ _didIteratorError1 = !0, _iteratorError1 = err;
119
78
  } finally {
120
- if (_didIteratorError2) throw _iteratorError2;
79
+ try {
80
+ !_iteratorNormalCompletion1 && _iterator1.return != null && _iterator1.return();
81
+ } finally {
82
+ if (_didIteratorError1)
83
+ throw _iteratorError1;
84
+ }
121
85
  }
86
+ if (node = {
87
+ ...node,
88
+ route
89
+ }, meta.isLayout) {
90
+ var _directory, _layout;
91
+ (_layout = (_directory = directory).layout) !== null && _layout !== void 0 || (_directory.layout = []);
92
+ var existing = directory.layout[meta.specificity];
93
+ if (existing) {
94
+ if (process.env.NODE_ENV !== "production")
95
+ throw new Error(`The layouts "${filePath}" and "${existing.contextKey}" conflict on the route "/${route}". Please remove or rename one of these files.`);
96
+ } else
97
+ node = getLayoutNode(node, options), directory.layout[meta.specificity] = node;
98
+ } else if (type === "api") {
99
+ var fileKey = `${route}+api`, nodes = directory.files.get(fileKey);
100
+ nodes || (nodes = [], directory.files.set(fileKey, nodes));
101
+ var existing1 = nodes[0];
102
+ if (existing1) {
103
+ if (process.env.NODE_ENV !== "production")
104
+ throw new Error(`The API route file "${filePath}" and "${existing1.contextKey}" conflict on the route "/${route}". Please remove or rename one of these files.`);
105
+ } else
106
+ nodes[0] = node;
107
+ } else {
108
+ var nodes1 = directory.files.get(route);
109
+ nodes1 || (nodes1 = [], directory.files.set(route, nodes1));
110
+ var existing2 = nodes1[meta.specificity];
111
+ if (existing2) {
112
+ if (process.env.NODE_ENV !== "production")
113
+ throw new Error(`The route files "${filePath}" and "${existing2.contextKey}" conflict on the route "/${route}". Please remove or rename one of these files.`);
114
+ } else
115
+ hasRoutes || (hasRoutes = !0), nodes1[meta.specificity] = node;
116
+ }
117
+ }
118
+ } catch (err) {
119
+ _didIteratorError2 = !0, _iteratorError2 = err;
120
+ } finally {
121
+ try {
122
+ !_iteratorNormalCompletion2 && _iterator2.return != null && _iterator2.return();
123
+ } finally {
124
+ if (_didIteratorError2)
125
+ throw _iteratorError2;
122
126
  }
123
- }, _iterator = contextModule.keys()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
127
+ }
128
+ }, _iterator = contextModule.keys()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) _loop();
124
129
  } catch (err) {
125
130
  _didIteratorError = !0, _iteratorError = err;
126
131
  } finally {
127
132
  try {
128
133
  !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
129
134
  } finally {
130
- if (_didIteratorError) throw _iteratorError;
135
+ if (_didIteratorError)
136
+ throw _iteratorError;
131
137
  }
132
138
  }
133
- return isValid ? (rootDirectory.layout || (rootDirectory.layout = [{
134
- type: "layout",
135
- loadRoute: function () {
136
- return {
137
- default: require("./views/Navigator").DefaultNavigator
138
- };
139
- },
140
- // Generate a fake file name for the directory
141
- contextKey: "router/build/views/Navigator.js",
142
- route: "",
143
- generated: !0,
144
- dynamic: null,
145
- children: []
146
- }]), options.skipGenerated || (hasRoutes && appendSitemapRoute(rootDirectory), appendNotFoundRoute(rootDirectory)), rootDirectory) : null;
139
+ return isValid ? (rootDirectory.layout || (rootDirectory.layout = [
140
+ {
141
+ type: "layout",
142
+ loadRoute: function() {
143
+ return {
144
+ default: require("./views/Navigator").DefaultNavigator
145
+ };
146
+ },
147
+ // Generate a fake file name for the directory
148
+ contextKey: "router/build/views/Navigator.js",
149
+ route: "",
150
+ generated: !0,
151
+ dynamic: null,
152
+ children: []
153
+ }
154
+ ]), options.skipGenerated || (hasRoutes && appendSitemapRoute(rootDirectory), appendNotFoundRoute(rootDirectory)), rootDirectory) : null;
147
155
  }
148
156
  function flattenDirectoryTreeToRoutes(directory, options, layout) {
149
157
  var pathToRemove = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : "";
@@ -154,13 +162,10 @@ function flattenDirectoryTreeToRoutes(directory, options, layout) {
154
162
  pathToRemove = layout.route ? `${layout.route}/` : "", layout.route = newRoute, layout.dynamic = generateDynamic(layout.route);
155
163
  }
156
164
  if (!layout) throw new Error("One Internal Error: No nearest layout");
157
- var _iteratorNormalCompletion = !0,
158
- _didIteratorError = !1,
159
- _iteratorError = void 0;
165
+ var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
160
166
  try {
161
167
  for (var _iterator = directory.files.values()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
162
- var routes = _step.value,
163
- routeNode = getMostSpecific(routes);
168
+ var routes = _step.value, routeNode = getMostSpecific(routes);
164
169
  routeNode.route = routeNode.route.replace(pathToRemove, ""), routeNode.dynamic = generateDynamic(routeNode.route), options.internal_stripLoadRoute && delete routeNode.loadRoute, layout.children.push(routeNode);
165
170
  }
166
171
  } catch (err) {
@@ -169,12 +174,11 @@ function flattenDirectoryTreeToRoutes(directory, options, layout) {
169
174
  try {
170
175
  !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
171
176
  } finally {
172
- if (_didIteratorError) throw _iteratorError;
177
+ if (_didIteratorError)
178
+ throw _iteratorError;
173
179
  }
174
180
  }
175
- var _iteratorNormalCompletion1 = !0,
176
- _didIteratorError1 = !1,
177
- _iteratorError1 = void 0;
181
+ var _iteratorNormalCompletion1 = !0, _didIteratorError1 = !1, _iteratorError1 = void 0;
178
182
  try {
179
183
  for (var _iterator1 = directory.subdirectories.values()[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = !0) {
180
184
  var child = _step1.value;
@@ -186,32 +190,28 @@ function flattenDirectoryTreeToRoutes(directory, options, layout) {
186
190
  try {
187
191
  !_iteratorNormalCompletion1 && _iterator1.return != null && _iterator1.return();
188
192
  } finally {
189
- if (_didIteratorError1) throw _iteratorError1;
193
+ if (_didIteratorError1)
194
+ throw _iteratorError1;
190
195
  }
191
196
  }
192
197
  return layout;
193
198
  }
194
199
  function getFileMeta(key, options) {
195
200
  key = key.replace(/^\.\//, "");
196
- var parts = key.split("/"),
197
- route = removeSupportedExtensions(key),
198
- filename = parts[parts.length - 1],
199
- filenameWithoutExtensions = removeSupportedExtensions(filename),
200
- isLayout = filenameWithoutExtensions.startsWith("_layout"),
201
- [_fullname, renderModeFound] = filename.match(/\+(api|ssg|ssr|spa)\.(\w+\.)?[jt]sx?$/) || [],
202
- renderMode = renderModeFound;
203
- if (filenameWithoutExtensions.startsWith("(") && filenameWithoutExtensions.endsWith(")")) throw new Error(`Invalid route ./${key}. Routes cannot end with '(group)' syntax`);
201
+ var parts = key.split("/"), route = removeSupportedExtensions(key), filename = parts[parts.length - 1], filenameWithoutExtensions = removeSupportedExtensions(filename), isLayout = filenameWithoutExtensions.startsWith("_layout"), [_fullname, renderModeFound] = filename.match(/\+(api|ssg|ssr|spa)\.(\w+\.)?[jt]sx?$/) || [], renderMode = renderModeFound;
202
+ if (filenameWithoutExtensions.startsWith("(") && filenameWithoutExtensions.endsWith(")"))
203
+ throw new Error(`Invalid route ./${key}. Routes cannot end with '(group)' syntax`);
204
204
  if (renderMode !== "api" && filename.startsWith("+") && filenameWithoutExtensions !== "+not-found") {
205
- var renamedRoute = [...parts.slice(0, -1), filename.slice(1)].join("/");
205
+ var renamedRoute = [
206
+ ...parts.slice(0, -1),
207
+ filename.slice(1)
208
+ ].join("/");
206
209
  throw new Error(`Invalid route ./${key}. Route nodes cannot start with the '+' character. "Please rename to ${renamedRoute}"`);
207
210
  }
208
- var specificity = 0,
209
- platformExtension = filenameWithoutExtensions.split(".")[1],
210
- hasPlatformExtension = validPlatforms.has(platformExtension),
211
- _options_platformRoutes,
212
- usePlatformRoutes = (_options_platformRoutes = options.platformRoutes) !== null && _options_platformRoutes !== void 0 ? _options_platformRoutes : !0;
211
+ var specificity = 0, platformExtension = filenameWithoutExtensions.split(".")[1], hasPlatformExtension = validPlatforms.has(platformExtension), _options_platformRoutes, usePlatformRoutes = (_options_platformRoutes = options.platformRoutes) !== null && _options_platformRoutes !== void 0 ? _options_platformRoutes : !0;
213
212
  if (hasPlatformExtension) {
214
- if (usePlatformRoutes && options.platform ? platformExtension === options.platform ? specificity = 2 : platformExtension === "native" && options.platform !== "web" ? specificity = 1 : platformExtension !== options.platform && (specificity = -1) : specificity = -1, renderMode === "api" && specificity !== 0) throw new Error(`Api routes cannot have platform extensions. Please remove '.${platformExtension}' from './${key}'`);
213
+ if (usePlatformRoutes && options.platform ? platformExtension === options.platform ? specificity = 2 : platformExtension === "native" && options.platform !== "web" ? specificity = 1 : platformExtension !== options.platform && (specificity = -1) : specificity = -1, renderMode === "api" && specificity !== 0)
214
+ throw new Error(`Api routes cannot have platform extensions. Please remove '.${platformExtension}' from './${key}'`);
215
215
  route = route.replace(new RegExp(`.${platformExtension}$`), "");
216
216
  }
217
217
  return {
@@ -223,29 +223,31 @@ function getFileMeta(key, options) {
223
223
  }
224
224
  function getMostSpecific(routes) {
225
225
  var route = routes[routes.length - 1];
226
- if (!routes[0]) throw new Error(` [one] The file ${route.contextKey} does not have a fallback sibling file without a platform extension in routes (${routes[0]}, ${routes.length}):
227
- ${routes.map(function (r) {
228
- return r.contextKey || "NONE";
229
- }).join(`
226
+ if (!routes[0])
227
+ throw new Error(` [one] The file ${route.contextKey} does not have a fallback sibling file without a platform extension in routes (${routes[0]}, ${routes.length}):
228
+ ${routes.map(function(r) {
229
+ return r.contextKey || "NONE";
230
+ }).join(`
230
231
  `)}.`);
231
232
  return routes[routes.length - 1];
232
233
  }
233
234
  function getIgnoreList(options) {
234
- var _options_ignore,
235
- ignore = [/^\.\/\+html\.[tj]sx?$/, ...((_options_ignore = options?.ignore) !== null && _options_ignore !== void 0 ? _options_ignore : [])];
235
+ var _options_ignore, ignore = [
236
+ /^\.\/\+html\.[tj]sx?$/,
237
+ ...(_options_ignore = options?.ignore) !== null && _options_ignore !== void 0 ? _options_ignore : []
238
+ ];
236
239
  return options?.preserveApiRoutes !== !0 && ignore.push(/\+api\.[tj]sx?$/), ignore;
237
240
  }
238
241
  function extrapolateGroups(key) {
239
- var keys = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : /* @__PURE__ */new Set(),
240
- match = matchArrayGroupName(key);
241
- if (!match) return keys.add(key), keys;
242
- var groups = match.split(","),
243
- groupsSet = new Set(groups);
244
- if (groupsSet.size !== groups.length) throw new Error(`Array syntax cannot contain duplicate group name "${groups}" in "${key}".`);
245
- if (groups.length === 1) return keys.add(key), keys;
246
- var _iteratorNormalCompletion = !0,
247
- _didIteratorError = !1,
248
- _iteratorError = void 0;
242
+ var keys = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : /* @__PURE__ */ new Set(), match = matchArrayGroupName(key);
243
+ if (!match)
244
+ return keys.add(key), keys;
245
+ var groups = match.split(","), groupsSet = new Set(groups);
246
+ if (groupsSet.size !== groups.length)
247
+ throw new Error(`Array syntax cannot contain duplicate group name "${groups}" in "${key}".`);
248
+ if (groups.length === 1)
249
+ return keys.add(key), keys;
250
+ var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
249
251
  try {
250
252
  for (var _iterator = groups[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
251
253
  var group = _step.value;
@@ -257,76 +259,82 @@ function extrapolateGroups(key) {
257
259
  try {
258
260
  !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
259
261
  } finally {
260
- if (_didIteratorError) throw _iteratorError;
262
+ if (_didIteratorError)
263
+ throw _iteratorError;
261
264
  }
262
265
  }
263
266
  return keys;
264
267
  }
265
268
  function generateDynamic(path) {
266
- var dynamic = path.split("/").map(function (part) {
267
- if (part === "+not-found") return {
268
- name: "+not-found",
269
- deep: !0,
270
- notFound: !0
271
- };
272
- var deepDynamicName = matchDeepDynamicRouteName(part),
273
- dynamicName = deepDynamicName ?? matchDynamicName(part);
269
+ var dynamic = path.split("/").map(function(part) {
270
+ if (part === "+not-found")
271
+ return {
272
+ name: "+not-found",
273
+ deep: !0,
274
+ notFound: !0
275
+ };
276
+ var deepDynamicName = matchDeepDynamicRouteName(part), dynamicName = deepDynamicName ?? matchDynamicName(part);
274
277
  return dynamicName ? {
275
278
  name: dynamicName,
276
279
  deep: !!deepDynamicName
277
280
  } : null;
278
- }).filter(function (part) {
281
+ }).filter(function(part) {
279
282
  return !!part;
280
283
  });
281
284
  return dynamic.length === 0 ? null : dynamic;
282
285
  }
283
286
  function appendSitemapRoute(directory) {
284
- directory.files.has("_sitemap") || directory.files.set("_sitemap", [{
285
- loadRoute() {
286
- return {
287
- default: function () {
288
- return null;
289
- },
290
- getNavOptions: function () {}
291
- };
292
- },
293
- route: "_sitemap",
294
- type: "ssg",
295
- contextKey: "",
296
- generated: !0,
297
- internal: !0,
298
- dynamic: null,
299
- children: []
300
- }]);
287
+ directory.files.has("_sitemap") || directory.files.set("_sitemap", [
288
+ {
289
+ loadRoute() {
290
+ return {
291
+ default: function() {
292
+ return null;
293
+ },
294
+ getNavOptions: function() {
295
+ }
296
+ };
297
+ },
298
+ route: "_sitemap",
299
+ type: "ssg",
300
+ contextKey: "",
301
+ generated: !0,
302
+ internal: !0,
303
+ dynamic: null,
304
+ children: []
305
+ }
306
+ ]);
301
307
  }
302
308
  function appendNotFoundRoute(directory) {
303
- directory.files.has("+not-found") || directory.files.set("+not-found", [{
304
- loadRoute() {
305
- return {
306
- default: function () {
307
- return null;
309
+ directory.files.has("+not-found") || directory.files.set("+not-found", [
310
+ {
311
+ loadRoute() {
312
+ return {
313
+ default: function() {
314
+ return null;
315
+ }
316
+ };
317
+ },
318
+ type: "spa",
319
+ route: "+not-found",
320
+ contextKey: "",
321
+ generated: !0,
322
+ internal: !0,
323
+ dynamic: [
324
+ {
325
+ name: "+not-found",
326
+ deep: !0,
327
+ notFound: !0
308
328
  }
309
- };
310
- },
311
- type: "spa",
312
- route: "+not-found",
313
- contextKey: "",
314
- generated: !0,
315
- internal: !0,
316
- dynamic: [{
317
- name: "+not-found",
318
- deep: !0,
319
- notFound: !0
320
- }],
321
- children: []
322
- }]);
329
+ ],
330
+ children: []
331
+ }
332
+ ]);
323
333
  }
324
334
  function getLayoutNode(node, options) {
325
- var groupName = matchGroupName(node.route),
326
- childMatchingGroup = node.children.find(function (child) {
327
- return child.route.replace(/\/index$/, "") === groupName;
328
- }),
329
- initialRouteName = childMatchingGroup?.route;
335
+ var groupName = matchGroupName(node.route), childMatchingGroup = node.children.find(function(child) {
336
+ return child.route.replace(/\/index$/, "") === groupName;
337
+ }), initialRouteName = childMatchingGroup?.route;
330
338
  return {
331
339
  ...node,
332
340
  route: node.route.replace(/\/?_layout$/, ""),
@@ -337,43 +345,48 @@ function getLayoutNode(node, options) {
337
345
  }
338
346
  function crawlAndAppendInitialRoutesAndEntryFiles(node, options) {
339
347
  var entryPoints = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
340
- if (node.type === "spa" || node.type === "ssg" || node.type === "ssr") node.entryPoints = [... /* @__PURE__ */new Set([...entryPoints, node.contextKey])];else if (node.type === "layout") {
341
- if (!node.children) throw new Error(`Layout "${node.contextKey}" does not contain any child routes`);
342
- entryPoints = [...entryPoints, node.contextKey];
343
- var groupName = matchGroupName(node.route),
344
- childMatchingGroup = node.children.find(function (child2) {
345
- return child2.route.replace(/\/index$/, "") === groupName;
346
- }),
347
- initialRouteName = childMatchingGroup?.route;
348
+ if (node.type === "spa" || node.type === "ssg" || node.type === "ssr")
349
+ node.entryPoints = [
350
+ .../* @__PURE__ */ new Set([
351
+ ...entryPoints,
352
+ node.contextKey
353
+ ])
354
+ ];
355
+ else if (node.type === "layout") {
356
+ if (!node.children)
357
+ throw new Error(`Layout "${node.contextKey}" does not contain any child routes`);
358
+ entryPoints = [
359
+ ...entryPoints,
360
+ node.contextKey
361
+ ];
362
+ var groupName = matchGroupName(node.route), childMatchingGroup = node.children.find(function(child2) {
363
+ return child2.route.replace(/\/index$/, "") === groupName;
364
+ }), initialRouteName = childMatchingGroup?.route;
348
365
  if (!options.internal_stripLoadRoute) {
349
366
  var loaded = node.loadRoute();
350
367
  if (loaded?.unstable_settings) {
351
368
  var _loaded_unstable_settings_initialRouteName;
352
369
  if (initialRouteName = (_loaded_unstable_settings_initialRouteName = loaded.unstable_settings.initialRouteName) !== null && _loaded_unstable_settings_initialRouteName !== void 0 ? _loaded_unstable_settings_initialRouteName : initialRouteName, groupName) {
353
- var _loaded_unstable_settings_groupName,
354
- _loaded_unstable_settings,
355
- groupSpecificInitialRouteName = (_loaded_unstable_settings = loaded.unstable_settings) === null || _loaded_unstable_settings === void 0 || (_loaded_unstable_settings_groupName = _loaded_unstable_settings[groupName]) === null || _loaded_unstable_settings_groupName === void 0 ? void 0 : _loaded_unstable_settings_groupName.initialRouteName;
370
+ var _loaded_unstable_settings_groupName, _loaded_unstable_settings, groupSpecificInitialRouteName = (_loaded_unstable_settings = loaded.unstable_settings) === null || _loaded_unstable_settings === void 0 || (_loaded_unstable_settings_groupName = _loaded_unstable_settings[groupName]) === null || _loaded_unstable_settings_groupName === void 0 ? void 0 : _loaded_unstable_settings_groupName.initialRouteName;
356
371
  initialRouteName = groupSpecificInitialRouteName ?? initialRouteName;
357
372
  }
358
373
  }
359
374
  }
360
375
  if (initialRouteName) {
361
- var initialRoute = node.children.find(function (child2) {
376
+ var initialRoute = node.children.find(function(child2) {
362
377
  return child2.route === initialRouteName;
363
378
  });
364
379
  if (!initialRoute) {
365
- var validInitialRoutes = node.children.filter(function (child2) {
380
+ var validInitialRoutes = node.children.filter(function(child2) {
366
381
  return !child2.generated;
367
- }).map(function (child2) {
382
+ }).map(function(child2) {
368
383
  return `'${child2.route}'`;
369
384
  }).join(", ");
370
385
  throw groupName ? new Error(`Layout ${node.contextKey} has invalid initialRouteName '${initialRouteName}' for group '(${groupName})'. Valid options are: ${validInitialRoutes}`) : new Error(`Layout ${node.contextKey} has invalid initialRouteName '${initialRouteName}'. Valid options are: ${validInitialRoutes}`);
371
386
  }
372
387
  node.initialRouteName = initialRouteName, entryPoints.push(initialRoute.contextKey);
373
388
  }
374
- var _iteratorNormalCompletion = !0,
375
- _didIteratorError = !1,
376
- _iteratorError = void 0;
389
+ var _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;
377
390
  try {
378
391
  for (var _iterator = node.children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {
379
392
  var child = _step.value;
@@ -385,10 +398,17 @@ function crawlAndAppendInitialRoutesAndEntryFiles(node, options) {
385
398
  try {
386
399
  !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();
387
400
  } finally {
388
- if (_didIteratorError) throw _iteratorError;
401
+ if (_didIteratorError)
402
+ throw _iteratorError;
389
403
  }
390
404
  }
391
405
  }
392
406
  }
393
- export { extrapolateGroups, generateDynamic, getExactRoutes, getIgnoreList, getRoutes };
394
- //# sourceMappingURL=getRoutes.native.js.map
407
+ export {
408
+ extrapolateGroups,
409
+ generateDynamic,
410
+ getExactRoutes,
411
+ getIgnoreList,
412
+ getRoutes
413
+ };
414
+ //# sourceMappingURL=getRoutes.js.map