pulse-dashboard 1.2.8 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (229) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +63 -11
  3. package/.next/fallback-build-manifest.json +6 -4
  4. package/.next/next-minimal-server.js.nft.json +1 -1
  5. package/.next/next-server.js.nft.json +1 -1
  6. package/.next/prerender-manifest.json +15 -3
  7. package/.next/required-server-files.json +55 -13
  8. package/.next/server/app/_global-error/page/build-manifest.json +13 -8
  9. package/.next/server/app/_global-error/page.js +7 -6
  10. package/.next/server/app/_global-error/page.js.nft.json +1 -1
  11. package/.next/server/app/_global-error/page_client-reference-manifest.js +8 -3
  12. package/.next/server/app/_global-error.html +1 -1
  13. package/.next/server/app/_global-error.meta +19 -5
  14. package/.next/server/app/_global-error.rsc +17 -13
  15. package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +21 -4
  16. package/.next/server/app/_global-error.segments/_tree.segment.rsc +2 -1
  17. package/.next/server/app/_not-found/page/build-manifest.json +13 -8
  18. package/.next/server/app/_not-found/page.js +11 -9
  19. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  20. package/.next/server/app/_not-found/page_client-reference-manifest.js +9 -3
  21. package/.next/server/app/_not-found.html +2 -2
  22. package/.next/server/app/_not-found.meta +24 -6
  23. package/.next/server/app/_not-found.rsc +23 -21
  24. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +28 -4
  25. package/.next/server/app/_not-found.segments/_tree.segment.rsc +4 -2
  26. package/.next/server/app/api/analyze-test/route/build-manifest.json +4 -1
  27. package/.next/server/app/api/analyze-test/route.js +4 -3
  28. package/.next/server/app/api/analyze-test/route.js.nft.json +1 -1
  29. package/.next/server/app/api/analyze-test/route_client-reference-manifest.js +5 -3
  30. package/.next/server/app/api/assets/[...slug]/route/build-manifest.json +4 -1
  31. package/.next/server/app/api/assets/[...slug]/route.js +4 -4
  32. package/.next/server/app/api/assets/[...slug]/route.js.nft.json +1 -1
  33. package/.next/server/app/api/assets/[...slug]/route_client-reference-manifest.js +5 -3
  34. package/.next/server/app/api/current-run/route/build-manifest.json +4 -1
  35. package/.next/server/app/api/current-run/route.js +4 -3
  36. package/.next/server/app/api/current-run/route.js.nft.json +1 -1
  37. package/.next/server/app/api/current-run/route_client-reference-manifest.js +5 -3
  38. package/.next/server/app/api/historical-trends/route/build-manifest.json +4 -1
  39. package/.next/server/app/api/historical-trends/route/server-reference-manifest.json +32 -1
  40. package/.next/server/app/api/historical-trends/route.js +5 -4
  41. package/.next/server/app/api/historical-trends/route.js.nft.json +1 -1
  42. package/.next/server/app/api/historical-trends/route_client-reference-manifest.js +5 -3
  43. package/.next/server/app/api/report-config/route/build-manifest.json +4 -1
  44. package/.next/server/app/api/report-config/route.js +4 -3
  45. package/.next/server/app/api/report-config/route.js.nft.json +1 -1
  46. package/.next/server/app/api/report-config/route_client-reference-manifest.js +5 -3
  47. package/.next/server/app/api/reports/[filename]/route/build-manifest.json +4 -1
  48. package/.next/server/app/api/reports/[filename]/route.js +4 -3
  49. package/.next/server/app/api/reports/[filename]/route.js.nft.json +1 -1
  50. package/.next/server/app/api/reports/[filename]/route_client-reference-manifest.js +5 -3
  51. package/.next/server/app/api/run-command/route/build-manifest.json +4 -1
  52. package/.next/server/app/api/run-command/route.js +4 -3
  53. package/.next/server/app/api/run-command/route.js.nft.json +1 -1
  54. package/.next/server/app/api/run-command/route_client-reference-manifest.js +5 -3
  55. package/.next/server/app/index.html +2 -2
  56. package/.next/server/app/index.meta +19 -5
  57. package/.next/server/app/index.rsc +26 -17
  58. package/.next/server/app/index.segments/__PAGE__.segment.rsc +31 -5
  59. package/.next/server/app/index.segments/_tree.segment.rsc +3 -2
  60. package/.next/server/app/page/build-manifest.json +13 -8
  61. package/.next/server/app/page/react-loadable-manifest.json +1 -1
  62. package/.next/server/app/page/server-reference-manifest.json +3 -5
  63. package/.next/server/app/page.js +13 -10
  64. package/.next/server/app/page.js.nft.json +1 -1
  65. package/.next/server/app/page_client-reference-manifest.js +9 -3
  66. package/.next/server/app/test/[testId]/page/build-manifest.json +13 -8
  67. package/.next/server/app/test/[testId]/page/server-reference-manifest.json +3 -5
  68. package/.next/server/app/test/[testId]/page.js +13 -10
  69. package/.next/server/app/test/[testId]/page.js.nft.json +1 -1
  70. package/.next/server/app/test/[testId]/page_client-reference-manifest.js +9 -3
  71. package/.next/server/chunks/[externals]__1bks6n1-hi3u2._.js +3 -0
  72. package/.next/server/chunks/[root-of-the-server]__08mw5-21_l0y0._.js +3 -0
  73. package/.next/server/chunks/[root-of-the-server]__0ainik_9ptfd4._.js +3 -0
  74. package/.next/server/chunks/[root-of-the-server]__0d2a-3_xzfq9t._.js +3 -0
  75. package/.next/server/chunks/[root-of-the-server]__0k8r_2i_c7804._.js +3 -0
  76. package/.next/server/chunks/[root-of-the-server]__0ku061j3k9q9v._.js +3 -0
  77. package/.next/server/chunks/[root-of-the-server]__1iga9nxrdvdxp._.js +63 -0
  78. package/.next/server/chunks/[root-of-the-server]__1l48ghhplu7u9._.js +3 -0
  79. package/.next/server/chunks/[turbopack]_runtime.js +342 -247
  80. package/.next/server/chunks/_021wero7wk5g-._.js +3 -0
  81. package/.next/server/chunks/_0f66qkfi1bpbn._.js +4 -0
  82. package/.next/server/chunks/_0omvyrynvgj4q._.js +3 -0
  83. package/.next/server/chunks/_0rj3uq83vare4._.js +3 -0
  84. package/.next/server/chunks/_1bftf09jweaep._.js +3 -0
  85. package/.next/server/chunks/_1e44q68l7kg3i._.js +3 -0
  86. package/.next/server/chunks/_next-internal_server_app_api_analyze-test_route_actions_mjs_0uo58g5gzd0uc._.js +3 -0
  87. package/.next/server/chunks/_next-internal_server_app_api_assets_[___slug]_route_actions_mjs_04b62p5ullv5v._.js +3 -0
  88. package/.next/server/chunks/_next-internal_server_app_api_current-run_route_actions_mjs_05xzsg3gk7k2q._.js +3 -0
  89. package/.next/server/chunks/_next-internal_server_app_api_report-config_route_actions_mjs_175cyh31s_2_h._.js +3 -0
  90. package/.next/server/chunks/_next-internal_server_app_api_reports_[filename]_route_actions_mjs_1803al6ouhkyr._.js +3 -0
  91. package/.next/server/chunks/_next-internal_server_app_api_run-command_route_actions_mjs_0o7ewtw5zp6ao._.js +3 -0
  92. package/.next/server/chunks/ssr/[root-of-the-server]__077mujmfcjrlq._.js +3 -0
  93. package/.next/server/chunks/ssr/[root-of-the-server]__0954o-19g2le2._.js +3 -0
  94. package/.next/server/chunks/ssr/[root-of-the-server]__0bqmj2mimgfp2._.js +3 -0
  95. package/.next/server/chunks/ssr/[root-of-the-server]__0dv9b4zkg5hdn._.js +3 -0
  96. package/.next/server/chunks/ssr/[root-of-the-server]__0ivd4vt5v8vsz._.js +3 -0
  97. package/.next/server/chunks/ssr/[root-of-the-server]__10tkfx-ofp61y._.js +3 -0
  98. package/.next/server/chunks/ssr/[root-of-the-server]__19zw3uu3ckhlo._.js +3 -0
  99. package/.next/server/chunks/ssr/[root-of-the-server]__1hsaagmb2fvap._.js +14 -0
  100. package/.next/server/chunks/ssr/[root-of-the-server]__1i9r59yk4i69p._.js +3 -0
  101. package/.next/server/chunks/ssr/[root-of-the-server]__1jljxgnhlm87p._.js +3 -0
  102. package/.next/server/chunks/ssr/[root-of-the-server]__1ycj5t-2qcq3e._.js +3 -0
  103. package/.next/server/chunks/ssr/[turbopack]_runtime.js +342 -247
  104. package/.next/server/chunks/ssr/_0-a_-dy7ui975._.js +5 -0
  105. package/.next/server/chunks/ssr/_04dqze6ixrsvs._.js +4 -0
  106. package/.next/server/chunks/ssr/_0x914xxedzmgf._.js +32 -0
  107. package/.next/server/chunks/ssr/_1-bq-mvkidpbm._.js +27 -0
  108. package/.next/server/chunks/ssr/_1z0ejft8z3bqp._.js +3 -0
  109. package/.next/server/chunks/ssr/_next-internal_server_app__global-error_page_actions_mjs_1ctekssbjfw_g._.js +3 -0
  110. package/.next/server/chunks/ssr/_next-internal_server_app__not-found_page_actions_mjs_1ghl5fbynabiq._.js +3 -0
  111. package/.next/server/chunks/ssr/node_modules_0gxlxpuufujz9._.js +33 -0
  112. package/.next/server/chunks/ssr/node_modules_0mtji6mpjxw71._.js +3 -0
  113. package/.next/server/chunks/ssr/{node_modules_@swc_helpers_cjs__interop_require_default_cjs_11~q6fv._.js → node_modules_@swc_helpers_cjs__interop_require_default_cjs_1ztp13a5szri_._.js} +1 -1
  114. package/.next/server/chunks/ssr/node_modules_next_dist_1dylt_x2lwntt._.js +3 -0
  115. package/.next/server/chunks/ssr/node_modules_next_dist_1tvl46c87-b1a._.js +8 -0
  116. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_0bew68i643j53._.js +33 -0
  117. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_1vdct3pkbqi_w._.js +3 -0
  118. package/.next/server/chunks/ssr/{node_modules_next_dist_client_components_builtin_forbidden_0ghu-f7.js → node_modules_next_dist_client_components_builtin_forbidden_0symwr9mbf-fh.js} +2 -2
  119. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_global-error_0q-w892nagajq.js +3 -0
  120. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_not-found_1vvgosrc2w28f.js +3 -0
  121. package/.next/server/chunks/ssr/{node_modules_next_dist_client_components_builtin_unauthorized_0cjv-23.js → node_modules_next_dist_client_components_builtin_unauthorized_0l_sp0xky89qu.js} +2 -2
  122. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_03a44q3-aihnz.js +3 -0
  123. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0k6_l1jr3jsqq.js +3 -0
  124. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0min3q4oeyf8a.js +3 -0
  125. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_19--w_z4y02i7.js +3 -0
  126. package/.next/server/chunks/ssr/src_0aglj-npucwwk._.js +23 -0
  127. package/.next/server/chunks/ssr/src_components_ui_toaster_tsx_0ll6bbq4_t7m_._.js +3 -0
  128. package/.next/server/middleware-build-manifest.js +63 -11
  129. package/.next/server/prefetch-hints.json +34 -1
  130. package/.next/server/preview-props.json +5 -0
  131. package/.next/server/server-reference-manifest.js +1 -1
  132. package/.next/server/server-reference-manifest.json +27 -13
  133. package/.next/static/chunks/06u3fo34cc4ga.js +1 -0
  134. package/.next/static/chunks/07ceko_qv-n_d.js +1 -0
  135. package/.next/static/chunks/17tig9fuzy99m.js +1 -0
  136. package/.next/static/chunks/1axqivg23ezfb.js +1 -0
  137. package/.next/static/chunks/1e2nvb4q-3vse.js +1 -0
  138. package/.next/static/chunks/1ltrs9eixy8gu.js +3 -0
  139. package/.next/static/chunks/1n-k9_9iohc4w.js +1 -0
  140. package/.next/static/chunks/1oyrxi90x4jw8.js +31 -0
  141. package/.next/static/chunks/2510hisbrlwfi.js +1 -0
  142. package/.next/static/chunks/2viv-yky3p-jf.js +1 -0
  143. package/.next/static/chunks/3-ptszisyxsi8.js +5 -0
  144. package/.next/static/chunks/3f-g_qcegf3q4.js +22 -0
  145. package/.next/static/chunks/3j6vhmh5ev771.js +1 -0
  146. package/.next/static/chunks/3qtedoc85mjel.js +1 -0
  147. package/.next/static/chunks/3vukeef84f3mg.js +1 -0
  148. package/.next/static/chunks/3z98c46ozxe__.js +1 -0
  149. package/.next/static/chunks/turbopack-2lihmh2pdnr2x.js +1 -0
  150. package/package.json +3 -3
  151. package/.next/server/app/_global-error.segments/_full.segment.rsc +0 -14
  152. package/.next/server/app/_global-error.segments/_head.segment.rsc +0 -5
  153. package/.next/server/app/_global-error.segments/_index.segment.rsc +0 -5
  154. package/.next/server/app/_not-found.segments/_full.segment.rsc +0 -23
  155. package/.next/server/app/_not-found.segments/_head.segment.rsc +0 -6
  156. package/.next/server/app/_not-found.segments/_index.segment.rsc +0 -7
  157. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +0 -5
  158. package/.next/server/app/index.segments/_full.segment.rsc +0 -19
  159. package/.next/server/app/index.segments/_head.segment.rsc +0 -6
  160. package/.next/server/app/index.segments/_index.segment.rsc +0 -7
  161. package/.next/server/chunks/[externals]__0m-sipc._.js +0 -3
  162. package/.next/server/chunks/[externals]__124ywe.._.js +0 -3
  163. package/.next/server/chunks/[root-of-the-server]__0126wt3._.js +0 -3
  164. package/.next/server/chunks/[root-of-the-server]__016m3l7._.js +0 -3
  165. package/.next/server/chunks/[root-of-the-server]__0bgp.n9._.js +0 -3
  166. package/.next/server/chunks/[root-of-the-server]__0jh2b8b._.js +0 -3
  167. package/.next/server/chunks/[root-of-the-server]__0k26p~k._.js +0 -3
  168. package/.next/server/chunks/[root-of-the-server]__0nglzhr._.js +0 -13
  169. package/.next/server/chunks/[root-of-the-server]__0x8r-.9._.js +0 -3
  170. package/.next/server/chunks/_next-internal_server_app_api_analyze-test_route_actions_0.saobd.js +0 -3
  171. package/.next/server/chunks/_next-internal_server_app_api_assets_[___slug]_route_actions_0rqs88g.js +0 -3
  172. package/.next/server/chunks/_next-internal_server_app_api_current-run_route_actions_10w286-.js +0 -3
  173. package/.next/server/chunks/_next-internal_server_app_api_historical-trends_route_actions_0tfs591.js +0 -3
  174. package/.next/server/chunks/_next-internal_server_app_api_report-config_route_actions_0lzyt8k.js +0 -3
  175. package/.next/server/chunks/_next-internal_server_app_api_reports_[filename]_route_actions_0emat-g.js +0 -3
  176. package/.next/server/chunks/_next-internal_server_app_api_run-command_route_actions_0uxr5bx.js +0 -3
  177. package/.next/server/chunks/node_modules_next_dist_06kebd7._.js +0 -4
  178. package/.next/server/chunks/ssr/[root-of-the-server]__0.zquoa._.js +0 -3
  179. package/.next/server/chunks/ssr/[root-of-the-server]__05ct2gl._.js +0 -3
  180. package/.next/server/chunks/ssr/[root-of-the-server]__0eqd2za._.js +0 -33
  181. package/.next/server/chunks/ssr/[root-of-the-server]__0jmj6g1._.js +0 -4
  182. package/.next/server/chunks/ssr/[root-of-the-server]__0mgphg.._.js +0 -3
  183. package/.next/server/chunks/ssr/[root-of-the-server]__0uyy96m._.js +0 -4
  184. package/.next/server/chunks/ssr/[root-of-the-server]__0v5vgt4._.js +0 -3
  185. package/.next/server/chunks/ssr/[root-of-the-server]__0we7bel._.js +0 -3
  186. package/.next/server/chunks/ssr/[root-of-the-server]__10xgshr._.js +0 -33
  187. package/.next/server/chunks/ssr/_0dvn4a6._.js +0 -6
  188. package/.next/server/chunks/ssr/_0jkkbka._.js +0 -7
  189. package/.next/server/chunks/ssr/_0nfs~1l._.js +0 -5
  190. package/.next/server/chunks/ssr/_0pa59oo._.js +0 -3
  191. package/.next/server/chunks/ssr/_11mmbg~._.js +0 -5
  192. package/.next/server/chunks/ssr/_next-internal_server_app__global-error_page_actions_0k77kol.js +0 -3
  193. package/.next/server/chunks/ssr/_next-internal_server_app__not-found_page_actions_0eq97pa.js +0 -3
  194. package/.next/server/chunks/ssr/node_modules_09w7yel._.js +0 -33
  195. package/.next/server/chunks/ssr/node_modules_0aem7sr._.js +0 -19
  196. package/.next/server/chunks/ssr/node_modules_next_dist_0h9llsw._.js +0 -6
  197. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_0inhx6q._.js +0 -3
  198. package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_global-error_0lgvd_..js +0 -3
  199. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_01ycdec.js +0 -4
  200. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0bj8dkg.js +0 -4
  201. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0cvrgh7.js +0 -4
  202. package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0rc3ul_.js +0 -4
  203. package/.next/server/chunks/ssr/src_0udngk~._.js +0 -23
  204. package/.next/server/chunks/ssr/src_components_ui_toaster_tsx_0cainpy._.js +0 -3
  205. package/.next/static/chunks/00g8rbqi0h8lk.js +0 -1
  206. package/.next/static/chunks/01xlw8hd842-c.js +0 -1
  207. package/.next/static/chunks/04j4.hz_cv-pf.js +0 -1
  208. package/.next/static/chunks/07uz2g0_38qia.js +0 -4
  209. package/.next/static/chunks/0b8rufmwi4-6v.js +0 -1
  210. package/.next/static/chunks/0fwam_-pec8pg.js +0 -2
  211. package/.next/static/chunks/0gsquco4lyvb4.js +0 -1
  212. package/.next/static/chunks/0h4bq73pogmtb.js +0 -1
  213. package/.next/static/chunks/0imfvrlr~2q89.js +0 -31
  214. package/.next/static/chunks/0m5-x6u~hwh1m.js +0 -1
  215. package/.next/static/chunks/0mzwfspg4216r.js +0 -1
  216. package/.next/static/chunks/0p.r891xm97do.js +0 -1
  217. package/.next/static/chunks/0w0gkm45qpujx.js +0 -5
  218. package/.next/static/chunks/0~ariudu4in54.js +0 -1
  219. package/.next/static/chunks/13mqc.b~s2gjo.js +0 -1
  220. package/.next/static/chunks/15y_~8vy363bg.js +0 -3
  221. package/.next/static/chunks/16navnbzwbp36.js +0 -1
  222. package/.next/static/chunks/17~ltcjkf11xe.js +0 -3
  223. package/.next/static/chunks/1860zsbcg5z1o.js +0 -1
  224. package/.next/static/chunks/turbopack-11rw6yhug.je0.js +0 -1
  225. /package/.next/static/{RgESZIprcZznm98mxUv-O → 5NYK4iijm2Nff3usU87JA}/_buildManifest.js +0 -0
  226. /package/.next/static/{RgESZIprcZznm98mxUv-O → 5NYK4iijm2Nff3usU87JA}/_clientMiddlewareManifest.js +0 -0
  227. /package/.next/static/{RgESZIprcZznm98mxUv-O → 5NYK4iijm2Nff3usU87JA}/_ssgManifest.js +0 -0
  228. /package/.next/static/chunks/{03~yq9q893hmn.js → 0cz1d0mv5g_q7.js} +0 -0
  229. /package/.next/static/chunks/{14rqub-mhf1rm.css → 3vfh62-53kqxb.css} +0 -0
@@ -1,11 +1,10 @@
1
- const RUNTIME_PUBLIC_PATH = "server/chunks/ssr/[turbopack]_runtime.js";
2
- const RELATIVE_ROOT_PATH = "..";
3
- const ASSET_PREFIX = "/_next/";
4
- const WORKER_FORWARDED_GLOBALS = ["NEXT_DEPLOYMENT_ID","NEXT_CLIENT_ASSET_SUFFIX"];
1
+ var RUNTIME_PUBLIC_PATH = "server/chunks/ssr/[turbopack]_runtime.js";
2
+ var RELATIVE_ROOT_PATH = "..";
3
+ var ASSET_PREFIX = "/_next/";
5
4
  // Apply forwarded globals from workerData if running in a worker thread
6
5
  if (typeof require !== 'undefined') {
7
6
  try {
8
- const { workerData } = require('worker_threads');
7
+ var { workerData } = require('worker_threads');
9
8
  if (workerData?.__turbopack_globals__) {
10
9
  Object.assign(globalThis, workerData.__turbopack_globals__);
11
10
  // Remove internal data so it's not visible to user code
@@ -21,6 +20,7 @@ if (typeof require !== 'undefined') {
21
20
  *
22
21
  * It will be prepended to the runtime code of each runtime.
23
22
  */ /* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="./runtime-types.d.ts" />
23
+ /// <reference path="./async-module.ts" />
24
24
  /**
25
25
  * Describes why a module was instantiated.
26
26
  * Shared between browser and Node.js runtimes.
@@ -47,6 +47,9 @@ if (typeof require !== 'undefined') {
47
47
  * nodejs build-base.ts). Browser production (build-base.ts) leaves it as `false` since it
48
48
  * uses plain Module objects.
49
49
  */ let createModuleWithDirectionFlag = false;
50
+ /**
51
+ * Maps module IDs to the factory functions that instantiate them.
52
+ */ const moduleFactories = new Map();
50
53
  const REEXPORTED_OBJECTS = new WeakMap();
51
54
  /**
52
55
  * Constructs the `__turbopack_context__` object for a module.
@@ -62,21 +65,32 @@ const REEXPORTED_OBJECTS = new WeakMap();
62
65
  this.e = exports;
63
66
  }
64
67
  const contextPrototype = Context.prototype;
68
+ contextPrototype.M = moduleFactories;
65
69
  const hasOwnProperty = Object.prototype.hasOwnProperty;
66
70
  const toStringTag = typeof Symbol !== 'undefined' && Symbol.toStringTag;
67
71
  function defineProp(obj, name, options) {
68
72
  if (!hasOwnProperty.call(obj, name)) Object.defineProperty(obj, name, options);
69
73
  }
74
+ /**
75
+ * Returns the cached module for `id`, or `undefined` if it has not been
76
+ * instantiated yet. Rethrows the error if the module's factory threw.
77
+ */ function getCachedModule(moduleCache, id) {
78
+ const module = moduleCache.get(id);
79
+ if (module?.error) {
80
+ throw module.error;
81
+ }
82
+ return module;
83
+ }
70
84
  function getOverwrittenModule(moduleCache, id) {
71
- let module = moduleCache[id];
72
- if (!module) {
85
+ let module = moduleCache.get(id);
86
+ if (module === undefined) {
73
87
  if (createModuleWithDirectionFlag) {
74
88
  // set in development modes for hmr support
75
89
  module = createModuleWithDirection(id);
76
90
  } else {
77
91
  module = createModuleObject(id);
78
92
  }
79
- moduleCache[id] = module;
93
+ moduleCache.set(id, module);
80
94
  }
81
95
  return module;
82
96
  }
@@ -101,9 +115,12 @@ function createModuleWithDirection(id) {
101
115
  };
102
116
  }
103
117
  const BindingTag_Value = 0;
118
+ /**
119
+ * Terminates a module's group of entries in an {@link EsmReexports} list.
120
+ */ const REEXPORT_GROUP_END = 0;
104
121
  /**
105
122
  * Adds the getters to the exports object.
106
- */ function esm(exports, bindings) {
123
+ */ function esm(exports, bindings, dynamic) {
107
124
  defineProp(exports, '__esModule', {
108
125
  value: true
109
126
  });
@@ -141,11 +158,18 @@ const BindingTag_Value = 0;
141
158
  }
142
159
  }
143
160
  }
144
- Object.seal(exports);
161
+ // The properties defined above are already non-configurable and
162
+ // non-writable, so the namespace's existing exports are effectively
163
+ // immutable. Sealing additionally makes the object non-extensible, matching
164
+ // real ESM-namespace semantics. Modules with dynamic re-exports
165
+ // (`export *` from a CommonJS module) must stay extensible so the dynamic
166
+ // export proxy can surface keys discovered at runtime, so skip the seal for
167
+ // them.
168
+ if (!dynamic) Object.seal(exports);
145
169
  }
146
170
  /**
147
171
  * Makes the module an ESM with exports
148
- */ function esmExport(bindings, id) {
172
+ */ function esmExport(bindings, id, dynamic) {
149
173
  let module;
150
174
  let exports;
151
175
  if (id != null) {
@@ -156,24 +180,182 @@ const BindingTag_Value = 0;
156
180
  exports = this.e;
157
181
  }
158
182
  module.namespaceObject = exports;
159
- esm(exports, bindings);
183
+ esm(exports, bindings, dynamic);
160
184
  }
161
185
  contextPrototype.s = esmExport;
186
+ /**
187
+ * Registers re-exports that all forward to properties of other modules.
188
+ *
189
+ * This is a compact spelling of the pattern
190
+ *
191
+ * ```js
192
+ * var ns = context.i(moduleId)
193
+ * context.s([exportName, () => ns[importedName], ...])
194
+ * ```
195
+ *
196
+ * The list is a flat sequence of groups. Each group starts with the source the exports come from,
197
+ * followed by that group's entries, and is terminated by the `0` sentinel (or the end of the list).
198
+ *
199
+ * The group head is either a **module id**, which is instantiated here:
200
+ *
201
+ * ```js
202
+ * context.S([
203
+ * 76061, 'default', 'f', 'named', 'A', 0,
204
+ * 29842, 'otherModule', 'f',
205
+ * ])
206
+ * ```
207
+ *
208
+ * or the **namespace value** of a module that has already been imported, which is used directly:
209
+ *
210
+ * ```js
211
+ * var ns1 = context.i(76061)
212
+ * context.S([ns1, 'default', 'f', 'named', 'A'])
213
+ * ```
214
+ *
215
+ * The producer picks the namespace form when it has generated the import anyway -- because some
216
+ * later import must not be reordered past it -- so nothing is instantiated twice. The two are told
217
+ * apart by type: a module id is always a string or number. A CommonJS function export produces a
218
+ * callable namespace value, so namespace heads can be functions as well as objects.
219
+ *
220
+ * Entries are `exportName, importedName` pairs, except when a group holds exactly one string. That
221
+ * string is then a comma-joined list of the same pairs, which saves the repeated quoting:
222
+ *
223
+ * ```js
224
+ * context.S([
225
+ * 76061, 'default,f,named,A', 0,
226
+ * 29842, 'otherModule,f',
227
+ * ])
228
+ * ```
229
+ *
230
+ * The producer picks that spelling independently for each group whose names contain no commas,
231
+ * since that group's names are recovered by splitting on them.
232
+ *
233
+ * Groups whose head is a module id are instantiated in list order, at the point where the call
234
+ * appears, so the producer must not merge such a group across an import of another module. The
235
+ * destination reuses a source data value or getter descriptor when one exists, falling back to a
236
+ * wrapper getter for dynamic/proxy/inherited properties.
237
+ *
238
+ * `id` names the module the exports belong to when this module was merged into a scope-hoisting
239
+ * group, exactly as it does for {@link EsmExport}.
240
+ *
241
+ * Only the source descriptor's payload (value or getter) is reused. {@link esm} still defines a
242
+ * fresh enumerable, non-configurable destination property, and no source setter is ever forwarded.
243
+ */ function esmReexport(list, id) {
244
+ const bindings = [];
245
+ let i = 0;
246
+ while(i < list.length){
247
+ const head = list[i++];
248
+ const start = i;
249
+ while(i < list.length && list[i] !== REEXPORT_GROUP_END)i++;
250
+ const end = i;
251
+ // Skip the sentinel, if this group was terminated by one rather than by the end of the list.
252
+ i++;
253
+ // Module ids are always strings or numbers. Other values are already-imported namespaces;
254
+ // notably, interop with a CommonJS function export produces a callable namespace function.
255
+ // `esmImport` may return a promise for an async module, but re-exports of async modules keep
256
+ // going through `context.s`, so the producer never routes them here and this stays synchronous.
257
+ const namespace = typeof head === 'string' || typeof head === 'number' ? esmImport.call(this, head) : head;
258
+ if (end - start === 1) {
259
+ const pairs = list[start].split(',');
260
+ for(let j = 0; j < pairs.length; j += 2){
261
+ appendReexportBinding(bindings, pairs[j], namespace, pairs[j + 1]);
262
+ }
263
+ } else {
264
+ for(let j = start; j < end; j += 2){
265
+ appendReexportBinding(bindings, list[j], namespace, list[j + 1]);
266
+ }
267
+ }
268
+ }
269
+ esmExport.call(this, bindings, id);
270
+ }
271
+ contextPrototype.S = esmReexport;
272
+ function appendReexportBinding(bindings, exportedName, namespace, importedName) {
273
+ const descriptor = Reflect.getOwnPropertyDescriptor(namespace, importedName);
274
+ if (descriptor) {
275
+ if ('value' in descriptor) {
276
+ // Code generation only routes immutable imported bindings through this helper, so a data
277
+ // descriptor is a constant export and can be captured once.
278
+ bindings.push(exportedName, BindingTag_Value, descriptor.value);
279
+ return;
280
+ }
281
+ if (descriptor.get) {
282
+ // Accessors remain live by reusing the source getter. `esmReexport` is only called by
283
+ // generated code: every group head is either produced by
284
+ // `this.i` or is the namespace variable from a generated `this.i` call. Every getter on such
285
+ // a namespace is receiver-independent: ESM bindings are compiler-generated arrow functions,
286
+ // and the CommonJS/dynamic-namespace paths create arrows in `createGetter` and
287
+ // `getOwnPropertyDescriptor`. The destination can therefore reuse the exact function instead
288
+ // of allocating another wrapper getter.
289
+ bindings.push(exportedName, descriptor.get);
290
+ return;
291
+ }
292
+ }
293
+ // Dynamic/proxy/inherited CommonJS edge cases may not expose a usable own descriptor.
294
+ bindings.push(exportedName, ()=>namespace[importedName]);
295
+ }
162
296
  function ensureDynamicExports(module, exports) {
163
297
  let reexportedObjects = REEXPORTED_OBJECTS.get(module);
164
298
  if (!reexportedObjects) {
165
299
  REEXPORTED_OBJECTS.set(module, reexportedObjects = []);
300
+ // Returns the re-exported object that provides `prop` as an own property,
301
+ // or `undefined` if none does. The traps share this logic so they always
302
+ // agree on which keys are synthesized from `reexportedObjects`. `default`
303
+ // is never re-exported by `export *`, so it is never synthesized.
304
+ const reexportOwning = (prop)=>{
305
+ if (prop !== 'default') {
306
+ for (const obj of reexportedObjects){
307
+ if (hasOwnProperty.call(obj, prop)) return obj;
308
+ }
309
+ }
310
+ return undefined;
311
+ };
312
+ // Modules with dynamic re-exports are not sealed by `esm()`, so the
313
+ // target beneath the namespace stays extensible. That is what lets the
314
+ // `ownKeys` and `getOwnPropertyDescriptor` traps legally report keys that
315
+ // exist on `reexportedObjects` but not on the target itself.
166
316
  module.exports = module.namespaceObject = new Proxy(exports, {
167
317
  get (target, prop) {
168
318
  if (hasOwnProperty.call(target, prop) || prop === 'default' || prop === '__esModule') {
169
319
  return Reflect.get(target, prop);
170
320
  }
171
- for (const obj of reexportedObjects){
172
- const value = Reflect.get(obj, prop);
173
- if (value !== undefined) return value;
174
- }
175
- return undefined;
321
+ const obj = reexportOwning(prop);
322
+ return obj && Reflect.get(obj, prop);
323
+ },
324
+ // The namespace is read-only, like a real esm namespace object. The
325
+ // re-exported modules can still mutate their own exports (exposed live
326
+ // via `get`), but mutating the namespace itself is rejected. Refusing
327
+ // here, rather than forwarding to the extensible target, also prevents an
328
+ // assignment/definition from shadowing a dynamic re-export. It also
329
+ // prevents delete from removing a static export.
330
+ set () {
331
+ return false;
332
+ },
333
+ defineProperty () {
334
+ return false;
176
335
  },
336
+ deleteProperty () {
337
+ return false;
338
+ },
339
+ // The `has` trap ensures that `'exportName' in starImports` will reflect
340
+ // the truth of whether a key is exported.
341
+ has (target, prop) {
342
+ if (Reflect.has(target, prop)) return true;
343
+ if (prop === 'default' || prop === '__esModule') return false;
344
+ return reexportOwning(prop) !== undefined;
345
+ },
346
+ // ownKeys and getOwnPropertyDescriptor together make the keys enumerable.
347
+ // If a value is returned from `ownKeys` but its property descriptor is
348
+ // not enumerable, it will not be visible to iterator methods.
349
+ // Collectively, they allow code like the following:
350
+ //
351
+ // ```
352
+ // // module.js re-exports dynamic CJS exports
353
+ // export * from './legacyModule.cjs'
354
+ //
355
+ // // from another JS file, reference the re-exported dynamic values
356
+ // import * as Namespace from './module.js'
357
+ // Object.keys(Namespace)
358
+ // ```
177
359
  ownKeys (target) {
178
360
  const keys = Reflect.ownKeys(target);
179
361
  for (const obj of reexportedObjects){
@@ -182,6 +364,22 @@ function ensureDynamicExports(module, exports) {
182
364
  }
183
365
  }
184
366
  return keys;
367
+ },
368
+ getOwnPropertyDescriptor (target, prop) {
369
+ const own = Reflect.getOwnPropertyDescriptor(target, prop);
370
+ if (own || prop === 'default' || prop === '__esModule') return own;
371
+ const obj = reexportOwning(prop);
372
+ if (obj) {
373
+ // Synthetic keys don't exist on the target, so they MUST be
374
+ // reported as configurable. However the set/delete traps above will
375
+ // prevent them from actually being changed
376
+ return {
377
+ enumerable: true,
378
+ configurable: true,
379
+ get: ()=>Reflect.get(obj, prop)
380
+ };
381
+ }
382
+ return undefined;
185
383
  }
186
384
  });
187
385
  }
@@ -287,7 +485,7 @@ function esmImport(id) {
287
485
  }
288
486
  contextPrototype.i = esmImport;
289
487
  function asyncLoader(moduleId) {
290
- const loader = this.r(moduleId);
488
+ const loader = getOrInstantiateModuleFromParent(moduleId, this.m).exports;
291
489
  return loader(esmImport.bind(this));
292
490
  }
293
491
  contextPrototype.A = asyncLoader;
@@ -323,7 +521,39 @@ contextPrototype.r = commonJsRequire;
323
521
  }
324
522
  /**
325
523
  * `require.context` and require/import expression runtime.
326
- */ function moduleContext(map) {
524
+ */ function moduleContextFactory(ids, mode = 0) {
525
+ const context = this;
526
+ const parentModule = this.m;
527
+ const map = {};
528
+ for(let i = 0; i < ids.length; i += 2){
529
+ const entry = ids[i + 1];
530
+ let id;
531
+ let module;
532
+ if (typeof entry === 'function') {
533
+ // A function is given for a module without an id to load it by: mostly a
534
+ // request that throws an error (e.g. one that can't be resolved), and also an
535
+ // external. As there is no id, `resolve` calls the function too, so that it
536
+ // throws the same error.
537
+ id = module = entry;
538
+ } else {
539
+ id = ()=>entry;
540
+ if (mode === 0) {
541
+ // inlined require implementation, which gives an ignored module empty exports
542
+ module = ()=>entry === undefined ? {} : getOrInstantiateModuleFromParent(entry, parentModule).exports;
543
+ } else if (entry === undefined) {
544
+ module = ()=>Promise.resolve({});
545
+ } else if (mode === 1) {
546
+ // Like `import()`, the module is evaluated asynchronously.
547
+ module = ()=>Promise.resolve().then(()=>esmImport.call(context, entry));
548
+ } else {
549
+ module = ()=>asyncLoader.call(context, entry);
550
+ }
551
+ }
552
+ map[ids[i]] = {
553
+ id,
554
+ module
555
+ };
556
+ }
327
557
  function moduleContext(id) {
328
558
  id = parseRequest(id);
329
559
  if (hasOwnProperty.call(map, id)) {
@@ -350,39 +580,22 @@ contextPrototype.r = commonJsRequire;
350
580
  };
351
581
  return moduleContext;
352
582
  }
353
- contextPrototype.f = moduleContext;
583
+ contextPrototype.f = moduleContextFactory;
354
584
  /**
355
585
  * Returns the path of a chunk defined by its data.
356
586
  */ function getChunkPath(chunkData) {
357
587
  return typeof chunkData === 'string' ? chunkData : chunkData.path;
358
588
  }
359
- function isPromise(maybePromise) {
360
- return maybePromise != null && typeof maybePromise === 'object' && 'then' in maybePromise && typeof maybePromise.then === 'function';
361
- }
362
- function isAsyncModuleExt(obj) {
363
- return turbopackQueues in obj;
364
- }
365
- function createPromise() {
366
- let resolve;
367
- let reject;
368
- const promise = new Promise((res, rej)=>{
369
- reject = rej;
370
- resolve = res;
371
- });
372
- return {
373
- promise,
374
- resolve: resolve,
375
- reject: reject
376
- };
377
- }
378
- // Load the CompressedmoduleFactories of a chunk into the `moduleFactories` Map.
379
- // The CompressedModuleFactories format is
380
- // - 1 or more module ids
381
- // - a module factory function
382
- // So walking this is a little complex but the flat structure is also fast to
383
- // traverse, we can use `typeof` operators to distinguish the two cases.
384
- function installCompressedModuleFactories(chunkModules, offset, moduleFactories, newModuleId) {
589
+ // Load the CompressedModuleFactories of a chunk into the `moduleFactories` Map.
590
+ // The flat format alternates one or more module IDs with their factory function.
591
+ // Strict factories can be prepended as a nested array.
592
+ function installCompressedModuleFactories(chunkModules, offset, newModuleId) {
385
593
  let i = offset;
594
+ const strictFactories = chunkModules[i];
595
+ if (Array.isArray(strictFactories)) {
596
+ installCompressedModuleFactories(strictFactories, 0, newModuleId);
597
+ i++;
598
+ }
386
599
  while(i < chunkModules.length){
387
600
  let end = i + 1;
388
601
  // Find our factory function
@@ -421,113 +634,9 @@ function installCompressedModuleFactories(chunkModules, offset, moduleFactories,
421
634
  newModuleId?.(id);
422
635
  }
423
636
  }
424
- i = end + 1; // end is pointing at the last factory advance to the next id or the end of the array.
425
- }
426
- }
427
- // everything below is adapted from webpack
428
- // https://github.com/webpack/webpack/blob/6be4065ade1e252c1d8dcba4af0f43e32af1bdc1/lib/runtime/AsyncModuleRuntimeModule.js#L13
429
- const turbopackQueues = Symbol('turbopack queues');
430
- const turbopackExports = Symbol('turbopack exports');
431
- const turbopackError = Symbol('turbopack error');
432
- function resolveQueue(queue) {
433
- if (queue && queue.status !== 1) {
434
- queue.status = 1;
435
- queue.forEach((fn)=>fn.queueCount--);
436
- queue.forEach((fn)=>fn.queueCount-- ? fn.queueCount++ : fn());
437
- }
438
- }
439
- function wrapDeps(deps) {
440
- return deps.map((dep)=>{
441
- if (dep !== null && typeof dep === 'object') {
442
- if (isAsyncModuleExt(dep)) return dep;
443
- if (isPromise(dep)) {
444
- const queue = Object.assign([], {
445
- status: 0
446
- });
447
- const obj = {
448
- [turbopackExports]: {},
449
- [turbopackQueues]: (fn)=>fn(queue)
450
- };
451
- dep.then((res)=>{
452
- obj[turbopackExports] = res;
453
- resolveQueue(queue);
454
- }, (err)=>{
455
- obj[turbopackError] = err;
456
- resolveQueue(queue);
457
- });
458
- return obj;
459
- }
460
- }
461
- return {
462
- [turbopackExports]: dep,
463
- [turbopackQueues]: ()=>{}
464
- };
465
- });
466
- }
467
- function asyncModule(body, hasAwait) {
468
- const module = this.m;
469
- const queue = hasAwait ? Object.assign([], {
470
- status: -1
471
- }) : undefined;
472
- const depQueues = new Set();
473
- const { resolve, reject, promise: rawPromise } = createPromise();
474
- const promise = Object.assign(rawPromise, {
475
- [turbopackExports]: module.exports,
476
- [turbopackQueues]: (fn)=>{
477
- queue && fn(queue);
478
- depQueues.forEach(fn);
479
- promise['catch'](()=>{});
480
- }
481
- });
482
- const attributes = {
483
- get () {
484
- return promise;
485
- },
486
- set (v) {
487
- // Calling `esmExport` leads to this.
488
- if (v !== promise) {
489
- promise[turbopackExports] = v;
490
- }
491
- }
492
- };
493
- Object.defineProperty(module, 'exports', attributes);
494
- Object.defineProperty(module, 'namespaceObject', attributes);
495
- function handleAsyncDependencies(deps) {
496
- const currentDeps = wrapDeps(deps);
497
- const getResult = ()=>currentDeps.map((d)=>{
498
- if (d[turbopackError]) throw d[turbopackError];
499
- return d[turbopackExports];
500
- });
501
- const { promise, resolve } = createPromise();
502
- const fn = Object.assign(()=>resolve(getResult), {
503
- queueCount: 0
504
- });
505
- function fnQueue(q) {
506
- if (q !== queue && !depQueues.has(q)) {
507
- depQueues.add(q);
508
- if (q && q.status === 0) {
509
- fn.queueCount++;
510
- q.push(fn);
511
- }
512
- }
513
- }
514
- currentDeps.map((dep)=>dep[turbopackQueues](fnQueue));
515
- return fn.queueCount ? promise : getResult();
516
- }
517
- function asyncResult(err) {
518
- if (err) {
519
- reject(promise[turbopackError] = err);
520
- } else {
521
- resolve(promise[turbopackExports]);
522
- }
523
- resolveQueue(queue);
524
- }
525
- body(handleAsyncDependencies, asyncResult);
526
- if (queue && queue.status === -1) {
527
- queue.status = 0;
637
+ i = end + 1;
528
638
  }
529
639
  }
530
- contextPrototype.a = asyncModule;
531
640
  /**
532
641
  * A pseudo "fake" URL object to resolve to its relative path.
533
642
  *
@@ -577,6 +686,14 @@ contextPrototype.U = relativeURL;
577
686
  }
578
687
  return `Module ${moduleId} was instantiated ${instantiationReason}, but the module factory is not available.`;
579
688
  }
689
+ /**
690
+ * Returns a `file://` URL under a synthetic directory named after `root`
691
+ * (`ROOT` for the project root), for when the real filesystem path is unknown.
692
+ * The root name and path segments are percent-encoded so the result is always
693
+ * a valid file URI.
694
+ */ function placeholderFileUrl(modulePath, root) {
695
+ return `file:///${encodeURIComponent(root ?? 'ROOT')}/${modulePath.split('/').map(encodeURIComponent).join('/')}`;
696
+ }
580
697
  /**
581
698
  * A stub function to make `require` available but non-functional in ESM.
582
699
  */ function requireStub(_moduleId) {
@@ -653,43 +770,36 @@ const ABSOLUTE_ROOT = path.resolve(__filename, relativePathToDistRoot);
653
770
  return ABSOLUTE_ROOT;
654
771
  }
655
772
  Context.prototype.P = resolveAbsolutePath;
656
- /* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="../shared/runtime/runtime-utils.ts" />
657
- function readWebAssemblyAsResponse(path) {
658
- const { createReadStream } = require('fs');
659
- const { Readable } = require('stream');
660
- const stream = createReadStream(path);
661
- // @ts-ignore unfortunately there's a slight type mismatch with the stream.
662
- return new Response(Readable.toWeb(stream), {
663
- headers: {
664
- 'content-type': 'application/wasm'
665
- }
666
- });
667
- }
668
- async function compileWebAssemblyFromPath(path) {
669
- const response = readWebAssemblyAsResponse(path);
670
- return await WebAssembly.compileStreaming(response);
671
- }
672
- async function instantiateWebAssemblyFromPath(path, importsObj) {
673
- const response = readWebAssemblyAsResponse(path);
674
- const { instance } = await WebAssembly.instantiateStreaming(response, importsObj);
675
- return instance.exports;
773
+ /**
774
+ * Returns an absolute `file://` URL for the given module path, which is
775
+ * relative to the project root or the named `root`.
776
+ *
777
+ * Uses `url.pathToFileURL` so that the resulting URL is a valid file URI on
778
+ * all platforms (forward slashes on Windows, drive letters handled
779
+ * correctly, path segments URL-encoded).
780
+ *
781
+ * The location of a named `root` isn't known at runtime (the output may have
782
+ * been moved away from the sources), so this returns a placeholder URL for it.
783
+ */ function resolveFileUrl(modulePath, root) {
784
+ if (root !== undefined) {
785
+ return placeholderFileUrl(modulePath, root);
786
+ }
787
+ return require('url').pathToFileURL(resolveAbsolutePath(modulePath)).href;
676
788
  }
789
+ Context.prototype.F = resolveFileUrl;
677
790
  /* eslint-disable @typescript-eslint/no-unused-vars */ /// <reference path="../../shared/runtime/runtime-utils.ts" />
678
791
  /// <reference path="../../shared-node/base-externals-utils.ts" />
679
792
  /// <reference path="../../shared-node/node-externals-utils.ts" />
680
- /// <reference path="../../shared-node/node-wasm-utils.ts" />
681
793
  /// <reference path="./nodejs-globals.d.ts" />
682
794
  /**
683
795
  * Base Node.js runtime shared between production and development.
684
796
  * Contains chunk loading, module caching, and other non-HMR functionality.
685
797
  */ process.env.TURBOPACK = '1';
686
798
  const url = require('url');
687
- const moduleFactories = new Map();
688
- const moduleCache = Object.create(null);
689
799
  /**
690
800
  * Returns an absolute path to the given module's id.
691
801
  */ function resolvePathFromModule(moduleId) {
692
- const exported = this.r(moduleId);
802
+ const exported = getOrInstantiateModuleFromParent(moduleId, this.m).exports;
693
803
  const exportedPath = exported?.default ?? exported;
694
804
  if (typeof exportedPath !== 'string') {
695
805
  return exported;
@@ -730,7 +840,7 @@ function loadRuntimeChunkPath(sourcePath, chunkPath) {
730
840
  try {
731
841
  const resolved = path.resolve(RUNTIME_ROOT, chunkPath);
732
842
  const chunkModules = require(resolved);
733
- installCompressedModuleFactories(chunkModules, 0, moduleFactories);
843
+ installCompressedModuleFactories(chunkModules, 0);
734
844
  loadedChunks.add(chunkPath);
735
845
  } catch (cause) {
736
846
  let errorMessage = `Failed to load chunk ${chunkPath}`;
@@ -753,68 +863,70 @@ function loadChunkAsync(chunkData) {
753
863
  }
754
864
  let entry = chunkCache.get(chunkPath);
755
865
  if (entry === undefined) {
756
- try {
757
- // resolve to an absolute path to simplify `require` handling
758
- const resolved = path.resolve(RUNTIME_ROOT, chunkPath);
759
- // TODO: consider switching to `import()` to enable concurrent chunk loading and async file io
760
- // However this is incompatible with hot reloading (since `import` doesn't use the require cache)
761
- const chunkModules = require(resolved);
762
- installCompressedModuleFactories(chunkModules, 0, moduleFactories);
763
- entry = loadedChunk;
764
- } catch (cause) {
765
- const errorMessage = `Failed to load chunk ${chunkPath} from module ${this.m.id}`;
766
- const error = new Error(errorMessage, {
767
- cause
866
+ const sourceModuleId = this.m.id;
867
+ // `ensureChunk` is conditionally installed to support lazy dynamic imports during SSR
868
+ // It can be used to call back into turbopack to compile the chunk we are about to reference.
869
+ const ensureChunk = globalThis.__turbopack_ensure_chunk__;
870
+ let ensuring = undefined;
871
+ if (ensureChunk !== undefined) {
872
+ try {
873
+ // Returns `undefined` when the chunk can be required right away.
874
+ ensuring = ensureChunk(chunkPath);
875
+ } catch (error) {
876
+ // Don't cache a failure to compile the chunk, so that the next load
877
+ // retries it.
878
+ return Promise.reject(error);
879
+ }
880
+ }
881
+ if (ensuring === undefined) {
882
+ entry = requireChunk(chunkPath, sourceModuleId);
883
+ } else {
884
+ // The chunk is being compiled on demand before it can be required.
885
+ // Cache the combined promise right away so that every caller (including
886
+ // concurrent ones) gets the same promise for this chunk.
887
+ const ensured = Promise.resolve(ensuring).then(()=>requireChunk(chunkPath, sourceModuleId), (error)=>{
888
+ // Don't cache a failure to compile the chunk, so that the next load
889
+ // retries it.
890
+ if (chunkCache.get(chunkPath) === ensured) {
891
+ chunkCache.delete(chunkPath);
892
+ }
893
+ throw error;
768
894
  });
769
- error.name = 'ChunkLoadError';
770
- // Cache the failure promise, future requests will also get this same rejection
771
- entry = Promise.reject(error);
895
+ entry = ensured;
772
896
  }
773
897
  chunkCache.set(chunkPath, entry);
774
898
  }
775
899
  // TODO: Return an instrumented Promise that React can use instead of relying on referential equality.
776
900
  return entry;
777
901
  }
902
+ function requireChunk(chunkPath, sourceModuleId) {
903
+ try {
904
+ // resolve to an absolute path to simplify `require` handling
905
+ const resolved = path.resolve(RUNTIME_ROOT, chunkPath);
906
+ // TODO: consider switching to `import()` to enable concurrent chunk loading and async file io
907
+ // However this is incompatible with hot reloading (since `import` doesn't use the require cache)
908
+ const chunkModules = require(resolved);
909
+ installCompressedModuleFactories(chunkModules, 0);
910
+ return loadedChunk;
911
+ } catch (cause) {
912
+ const errorMessage = `Failed to load chunk ${chunkPath} from module ${sourceModuleId}`;
913
+ const error = new Error(errorMessage, {
914
+ cause
915
+ });
916
+ error.name = 'ChunkLoadError';
917
+ // Cache the failure promise, future requests will also get this same rejection
918
+ return Promise.reject(error);
919
+ }
920
+ }
778
921
  contextPrototype.l = loadChunkAsync;
779
922
  function loadChunkAsyncByUrl(chunkUrl) {
780
923
  const path1 = url.fileURLToPath(new URL(chunkUrl, RUNTIME_ROOT));
781
924
  return loadChunkAsync.call(this, path1);
782
925
  }
783
926
  contextPrototype.L = loadChunkAsyncByUrl;
784
- function loadWebAssembly(chunkPath, _edgeModule, imports) {
785
- const resolved = path.resolve(RUNTIME_ROOT, chunkPath);
786
- return instantiateWebAssemblyFromPath(resolved, imports);
787
- }
788
- contextPrototype.w = loadWebAssembly;
789
- function loadWebAssemblyModule(chunkPath, _edgeModule) {
790
- const resolved = path.resolve(RUNTIME_ROOT, chunkPath);
791
- return compileWebAssemblyFromPath(resolved);
792
- }
793
- contextPrototype.u = loadWebAssemblyModule;
794
- /**
795
- * Creates a Node.js worker thread by instantiating the given WorkerConstructor
796
- * with the appropriate path and options, including forwarded globals.
797
- *
798
- * @param WorkerConstructor The Worker constructor from worker_threads
799
- * @param workerPath Path to the worker entry chunk
800
- * @param workerOptions options to pass to the Worker constructor (optional)
801
- */ function createWorker(WorkerConstructor, workerPath, workerOptions) {
802
- // Build the forwarded globals object
803
- const forwardedGlobals = {};
804
- for (const name of WORKER_FORWARDED_GLOBALS){
805
- forwardedGlobals[name] = globalThis[name];
806
- }
807
- // Merge workerData with forwarded globals
808
- const existingWorkerData = workerOptions?.workerData || {};
809
- const options = {
810
- ...workerOptions,
811
- workerData: {
812
- ...typeof existingWorkerData === 'object' ? existingWorkerData : {},
813
- __turbopack_globals__: forwardedGlobals
814
- }
815
- };
816
- return new WorkerConstructor(workerPath, options);
817
- }
927
+ // Shared runtime primitive: the root that on-disk chunk paths are resolved
928
+ // against. Used by the bundled wasm helper (exposed as `__turbopack_runtime_root__`).
929
+ contextPrototype.w = RUNTIME_ROOT;
818
930
  const regexJsUrl = /\.js(?:\?[^#]*)?(?:#.*)?$/;
819
931
  /**
820
932
  * Checks if a given path/URL ends with .js, optionally followed by ?query or #fragment.
@@ -825,16 +937,13 @@ const regexJsUrl = /\.js(?:\?[^#]*)?(?:#.*)?$/;
825
937
  /**
826
938
  * Production Node.js runtime.
827
939
  * Uses ModuleWithDirection and simple module instantiation without HMR support.
828
- */ // moduleCache and moduleFactories are declared in runtime-base.ts
829
- // this is read in runtime-utils.ts so it creates a module with direction for hmr
940
+ */ // this is read in runtime-utils.ts so it creates a module with direction for hmr
830
941
  createModuleWithDirectionFlag = true;
942
+ const moduleCache = new Map();
831
943
  const nodeContextPrototype = Context.prototype;
832
944
  nodeContextPrototype.q = exportUrl;
833
- nodeContextPrototype.M = moduleFactories;
834
- // Cast moduleCache to ModuleWithDirection for production mode
835
945
  nodeContextPrototype.c = moduleCache;
836
946
  nodeContextPrototype.R = resolvePathFromModule;
837
- nodeContextPrototype.b = createWorker;
838
947
  nodeContextPrototype.C = clearChunkCache;
839
948
  function instantiateModule(id, sourceType, sourceData) {
840
949
  const moduleFactory = moduleFactories.get(id);
@@ -846,7 +955,7 @@ function instantiateModule(id, sourceType, sourceData) {
846
955
  }
847
956
  const module1 = createModuleWithDirection(id);
848
957
  const exports = module1.exports;
849
- moduleCache[id] = module1;
958
+ moduleCache.set(id, module1);
850
959
  const context = new Context(module1, exports);
851
960
  // NOTE(alexkirsz) This can fail when the module encounters a runtime error.
852
961
  try {
@@ -867,14 +976,7 @@ function instantiateModule(id, sourceType, sourceData) {
867
976
  * Retrieves a module from the cache, or instantiate it if it is not cached.
868
977
  */ // @ts-ignore
869
978
  function getOrInstantiateModuleFromParent(id, sourceModule) {
870
- const module1 = moduleCache[id];
871
- if (module1) {
872
- if (module1.error) {
873
- throw module1.error;
874
- }
875
- return module1;
876
- }
877
- return instantiateModule(id, SourceType.Parent, sourceModule.id);
979
+ return getCachedModule(moduleCache, id) ?? instantiateModule(id, SourceType.Parent, sourceModule.id);
878
980
  }
879
981
  /**
880
982
  * Instantiates a runtime module.
@@ -885,14 +987,7 @@ function getOrInstantiateModuleFromParent(id, sourceModule) {
885
987
  * Retrieves a module from the cache, or instantiate it as a runtime module if it is not cached.
886
988
  */ // @ts-ignore TypeScript doesn't separate this module space from the browser runtime
887
989
  function getOrInstantiateRuntimeModule(chunkPath, moduleId) {
888
- const module1 = moduleCache[moduleId];
889
- if (module1) {
890
- if (module1.error) {
891
- throw module1.error;
892
- }
893
- return module1;
894
- }
895
- return instantiateRuntimeModule(chunkPath, moduleId);
990
+ return getCachedModule(moduleCache, moduleId) ?? instantiateRuntimeModule(chunkPath, moduleId);
896
991
  }
897
992
  module.exports = (sourcePath)=>({
898
993
  m: (id)=>getOrInstantiateRuntimeModule(sourcePath, id),