kindflow 0.1.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 (1606) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +222 -0
  3. package/agent-runner.js +190 -0
  4. package/agent-runner.js.map +1 -0
  5. package/chunk-2UX7Z5TH.js +95 -0
  6. package/chunk-2UX7Z5TH.js.map +1 -0
  7. package/chunk-2YT53FBK.js +38 -0
  8. package/chunk-2YT53FBK.js.map +1 -0
  9. package/chunk-3AMW7NXZ.js +688 -0
  10. package/chunk-3AMW7NXZ.js.map +1 -0
  11. package/chunk-GZFR7ELC.js +98 -0
  12. package/chunk-GZFR7ELC.js.map +1 -0
  13. package/chunk-P5P73L35.js +17 -0
  14. package/chunk-P5P73L35.js.map +1 -0
  15. package/chunk-UGIMNC7O.js +3134 -0
  16. package/chunk-UGIMNC7O.js.map +1 -0
  17. package/cli.js +153 -0
  18. package/cli.js.map +1 -0
  19. package/cron-runner.js +89 -0
  20. package/cron-runner.js.map +1 -0
  21. package/daemon.js +12 -0
  22. package/daemon.js.map +1 -0
  23. package/database.js +7 -0
  24. package/database.js.map +1 -0
  25. package/imap-runner.js +123 -0
  26. package/imap-runner.js.map +1 -0
  27. package/package.json +58 -0
  28. package/postgresql-TRH2S2OL.js +67 -0
  29. package/postgresql-TRH2S2OL.js.map +1 -0
  30. package/s3.js +7 -0
  31. package/s3.js.map +1 -0
  32. package/sqlite-HPBUYY7A.js +52 -0
  33. package/sqlite-HPBUYY7A.js.map +1 -0
  34. package/telegram-client.js +7 -0
  35. package/telegram-client.js.map +1 -0
  36. package/telegram-runner.js +156 -0
  37. package/telegram-runner.js.map +1 -0
  38. package/templates/agent/agent/.claude/settings.json +12 -0
  39. package/templates/agent/agent/CLAUDE.md +34 -0
  40. package/templates/agent/agent/capabilities/.gitkeep +0 -0
  41. package/templates/agent/agent/config.json +7 -0
  42. package/templates/agent/agent/data/.gitkeep +0 -0
  43. package/templates/agent/agent/resources/.gitkeep +0 -0
  44. package/templates/agent/agent/scripts/.gitkeep +0 -0
  45. package/templates/agent/master/.claude/commands/build-commands.md +10 -0
  46. package/templates/agent/master/.claude/commands/build-identity.md +7 -0
  47. package/templates/agent/master/.claude/commands/build-scripts.md +7 -0
  48. package/templates/agent/master/.claude/commands/discovery.md +46 -0
  49. package/templates/agent/master/.claude/commands/review-agent.md +57 -0
  50. package/templates/agent/master/.claude/commands/setup-database.md +12 -0
  51. package/templates/agent/master/.claude/commands/setup-s3.md +12 -0
  52. package/templates/agent/master/.claude/commands/setup-telegram.md +16 -0
  53. package/templates/agent/master/.claude/settings.json +13 -0
  54. package/templates/agent/master/CLAUDE.md +52 -0
  55. package/templates/agent/master/resources/agent-structure.md +24 -0
  56. package/templates/agent/master/resources/capabilities.md +209 -0
  57. package/types.js +1 -0
  58. package/types.js.map +1 -0
  59. package/web/standalone/.next/static/chunks/0.rhx-_tszlu4.js +6 -0
  60. package/web/standalone/.next/static/chunks/03ezf5l-_j4jg.js +1 -0
  61. package/web/standalone/.next/static/chunks/03~yq9q893hmn.js +1 -0
  62. package/web/standalone/.next/static/chunks/04ck6i02nzj~g.js +1 -0
  63. package/web/standalone/.next/static/chunks/059v8r-yfkdzg.js +1 -0
  64. package/web/standalone/.next/static/chunks/07m3a24dcvltn.js +1 -0
  65. package/web/standalone/.next/static/chunks/0846ex_9lje66.js +1 -0
  66. package/web/standalone/.next/static/chunks/09auzhh4.kw6i.js +1 -0
  67. package/web/standalone/.next/static/chunks/0cs-bbn7o_z8t.js +1 -0
  68. package/web/standalone/.next/static/chunks/0cz5_xjqg2kbi.js +1 -0
  69. package/web/standalone/.next/static/chunks/0d14tm~hn93.2.js +1 -0
  70. package/web/standalone/.next/static/chunks/0dbly4ik_4oyh.css +3 -0
  71. package/web/standalone/.next/static/chunks/0ecr_h8tt8vw7.js +1 -0
  72. package/web/standalone/.next/static/chunks/0emphvehnoi1-.js +2 -0
  73. package/web/standalone/.next/static/chunks/0gpetx3.4k6b4.js +1 -0
  74. package/web/standalone/.next/static/chunks/0hfzu1auqc8ou.js +4 -0
  75. package/web/standalone/.next/static/chunks/0hjgvrv57vh99.js +1 -0
  76. package/web/standalone/.next/static/chunks/0nwzqd02b0bz9.js +1 -0
  77. package/web/standalone/.next/static/chunks/0oja3muheolaf.js +1 -0
  78. package/web/standalone/.next/static/chunks/0qxvztkmx2jf8.js +1 -0
  79. package/web/standalone/.next/static/chunks/0rsdytxfylxaw.js +1 -0
  80. package/web/standalone/.next/static/chunks/0t3kxrf329vtx.js +31 -0
  81. package/web/standalone/.next/static/chunks/0tj~6ee-vyqtu.js +1 -0
  82. package/web/standalone/.next/static/chunks/0vu.7k.x708cp.js +18 -0
  83. package/web/standalone/.next/static/chunks/0yt_9qbiz6hzr.js +1 -0
  84. package/web/standalone/.next/static/chunks/0~6eav_b2pgm..js +1 -0
  85. package/web/standalone/.next/static/chunks/11c0vsuj8ueva.js +1 -0
  86. package/web/standalone/.next/static/chunks/11zn_gydr7w.9.js +1 -0
  87. package/web/standalone/.next/static/chunks/12dnb1g.3zjtg.js +1 -0
  88. package/web/standalone/.next/static/chunks/12~poxkd72k~o.js +1 -0
  89. package/web/standalone/.next/static/chunks/14_1rc6rwie3u.js +1 -0
  90. package/web/standalone/.next/static/chunks/14kp_3wlgnkxp.js +1 -0
  91. package/web/standalone/.next/static/chunks/16hbu0vikyrj2.js +1 -0
  92. package/web/standalone/.next/static/chunks/17irh9suob_1s.js +1 -0
  93. package/web/standalone/.next/static/chunks/17oc2l.ekcs8b.css +1 -0
  94. package/web/standalone/.next/static/chunks/turbopack-03.6m4zxjzd-b.js +1 -0
  95. package/web/standalone/.next/static/media/4fa387ec64143e14-s.0q3udbd2bu5yp.woff2 +0 -0
  96. package/web/standalone/.next/static/media/7178b3e590c64307-s.11.cyxs5p-0z~.woff2 +0 -0
  97. package/web/standalone/.next/static/media/797e433ab948586e-s.p.0.q-h669a_dqa.woff2 +0 -0
  98. package/web/standalone/.next/static/media/8a480f0b521d4e75-s.06d3mdzz5bre_.woff2 +0 -0
  99. package/web/standalone/.next/static/media/bbc41e54d2fcbd21-s.0gw~uztddq1df.woff2 +0 -0
  100. package/web/standalone/.next/static/media/caa3a2e1cccd8315-s.p.16t1db8_9y2o~.woff2 +0 -0
  101. package/web/standalone/.next/static/media/favicon.0x3dzn~oxb6tn.ico +0 -0
  102. package/web/standalone/.next/static/rP40PaqmfSDCp0BXJLoC8/_buildManifest.js +11 -0
  103. package/web/standalone/.next/static/rP40PaqmfSDCp0BXJLoC8/_clientMiddlewareManifest.js +1 -0
  104. package/web/standalone/.next/static/rP40PaqmfSDCp0BXJLoC8/_ssgManifest.js +1 -0
  105. package/web/standalone/apps/web/.next/BUILD_ID +1 -0
  106. package/web/standalone/apps/web/.next/app-path-routes-manifest.json +26 -0
  107. package/web/standalone/apps/web/.next/build-manifest.json +21 -0
  108. package/web/standalone/apps/web/.next/package.json +1 -0
  109. package/web/standalone/apps/web/.next/prerender-manifest.json +378 -0
  110. package/web/standalone/apps/web/.next/required-server-files.json +333 -0
  111. package/web/standalone/apps/web/.next/routes-manifest.json +208 -0
  112. package/web/standalone/apps/web/.next/server/app/_global-error/page/app-paths-manifest.json +3 -0
  113. package/web/standalone/apps/web/.next/server/app/_global-error/page/build-manifest.json +17 -0
  114. package/web/standalone/apps/web/.next/server/app/_global-error/page/next-font-manifest.json +6 -0
  115. package/web/standalone/apps/web/.next/server/app/_global-error/page/react-loadable-manifest.json +1 -0
  116. package/web/standalone/apps/web/.next/server/app/_global-error/page/server-reference-manifest.json +4 -0
  117. package/web/standalone/apps/web/.next/server/app/_global-error/page.js +10 -0
  118. package/web/standalone/apps/web/.next/server/app/_global-error/page.js.map +5 -0
  119. package/web/standalone/apps/web/.next/server/app/_global-error/page.js.nft.json +1 -0
  120. package/web/standalone/apps/web/.next/server/app/_global-error/page_client-reference-manifest.js +3 -0
  121. package/web/standalone/apps/web/.next/server/app/_global-error.html +1 -0
  122. package/web/standalone/apps/web/.next/server/app/_global-error.meta +15 -0
  123. package/web/standalone/apps/web/.next/server/app/_global-error.rsc +15 -0
  124. package/web/standalone/apps/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +5 -0
  125. package/web/standalone/apps/web/.next/server/app/_global-error.segments/_full.segment.rsc +15 -0
  126. package/web/standalone/apps/web/.next/server/app/_global-error.segments/_head.segment.rsc +6 -0
  127. package/web/standalone/apps/web/.next/server/app/_global-error.segments/_index.segment.rsc +5 -0
  128. package/web/standalone/apps/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -0
  129. package/web/standalone/apps/web/.next/server/app/_not-found/page/app-paths-manifest.json +3 -0
  130. package/web/standalone/apps/web/.next/server/app/_not-found/page/build-manifest.json +17 -0
  131. package/web/standalone/apps/web/.next/server/app/_not-found/page/next-font-manifest.json +11 -0
  132. package/web/standalone/apps/web/.next/server/app/_not-found/page/react-loadable-manifest.json +1 -0
  133. package/web/standalone/apps/web/.next/server/app/_not-found/page/server-reference-manifest.json +4 -0
  134. package/web/standalone/apps/web/.next/server/app/_not-found/page.js +13 -0
  135. package/web/standalone/apps/web/.next/server/app/_not-found/page.js.map +5 -0
  136. package/web/standalone/apps/web/.next/server/app/_not-found/page.js.nft.json +1 -0
  137. package/web/standalone/apps/web/.next/server/app/_not-found/page_client-reference-manifest.js +3 -0
  138. package/web/standalone/apps/web/.next/server/app/_not-found.html +1 -0
  139. package/web/standalone/apps/web/.next/server/app/_not-found.meta +16 -0
  140. package/web/standalone/apps/web/.next/server/app/_not-found.rsc +17 -0
  141. package/web/standalone/apps/web/.next/server/app/_not-found.segments/_full.segment.rsc +17 -0
  142. package/web/standalone/apps/web/.next/server/app/_not-found.segments/_head.segment.rsc +6 -0
  143. package/web/standalone/apps/web/.next/server/app/_not-found.segments/_index.segment.rsc +6 -0
  144. package/web/standalone/apps/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +5 -0
  145. package/web/standalone/apps/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +5 -0
  146. package/web/standalone/apps/web/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -0
  147. package/web/standalone/apps/web/.next/server/app/agents/[id]/edit/page/app-paths-manifest.json +3 -0
  148. package/web/standalone/apps/web/.next/server/app/agents/[id]/edit/page/build-manifest.json +17 -0
  149. package/web/standalone/apps/web/.next/server/app/agents/[id]/edit/page/next-font-manifest.json +11 -0
  150. package/web/standalone/apps/web/.next/server/app/agents/[id]/edit/page/react-loadable-manifest.json +1 -0
  151. package/web/standalone/apps/web/.next/server/app/agents/[id]/edit/page/server-reference-manifest.json +4 -0
  152. package/web/standalone/apps/web/.next/server/app/agents/[id]/edit/page.js +15 -0
  153. package/web/standalone/apps/web/.next/server/app/agents/[id]/edit/page.js.map +5 -0
  154. package/web/standalone/apps/web/.next/server/app/agents/[id]/edit/page.js.nft.json +1 -0
  155. package/web/standalone/apps/web/.next/server/app/agents/[id]/edit/page_client-reference-manifest.js +3 -0
  156. package/web/standalone/apps/web/.next/server/app/agents/[id]/page/app-paths-manifest.json +3 -0
  157. package/web/standalone/apps/web/.next/server/app/agents/[id]/page/build-manifest.json +17 -0
  158. package/web/standalone/apps/web/.next/server/app/agents/[id]/page/next-font-manifest.json +11 -0
  159. package/web/standalone/apps/web/.next/server/app/agents/[id]/page/react-loadable-manifest.json +1 -0
  160. package/web/standalone/apps/web/.next/server/app/agents/[id]/page/server-reference-manifest.json +4 -0
  161. package/web/standalone/apps/web/.next/server/app/agents/[id]/page.js +15 -0
  162. package/web/standalone/apps/web/.next/server/app/agents/[id]/page.js.map +5 -0
  163. package/web/standalone/apps/web/.next/server/app/agents/[id]/page.js.nft.json +1 -0
  164. package/web/standalone/apps/web/.next/server/app/agents/[id]/page_client-reference-manifest.js +3 -0
  165. package/web/standalone/apps/web/.next/server/app/agents/[id]/terminal/page/app-paths-manifest.json +3 -0
  166. package/web/standalone/apps/web/.next/server/app/agents/[id]/terminal/page/build-manifest.json +17 -0
  167. package/web/standalone/apps/web/.next/server/app/agents/[id]/terminal/page/next-font-manifest.json +11 -0
  168. package/web/standalone/apps/web/.next/server/app/agents/[id]/terminal/page/react-loadable-manifest.json +1 -0
  169. package/web/standalone/apps/web/.next/server/app/agents/[id]/terminal/page/server-reference-manifest.json +4 -0
  170. package/web/standalone/apps/web/.next/server/app/agents/[id]/terminal/page.js +15 -0
  171. package/web/standalone/apps/web/.next/server/app/agents/[id]/terminal/page.js.map +5 -0
  172. package/web/standalone/apps/web/.next/server/app/agents/[id]/terminal/page.js.nft.json +1 -0
  173. package/web/standalone/apps/web/.next/server/app/agents/[id]/terminal/page_client-reference-manifest.js +3 -0
  174. package/web/standalone/apps/web/.next/server/app/agents/new/page/app-paths-manifest.json +3 -0
  175. package/web/standalone/apps/web/.next/server/app/agents/new/page/build-manifest.json +17 -0
  176. package/web/standalone/apps/web/.next/server/app/agents/new/page/next-font-manifest.json +11 -0
  177. package/web/standalone/apps/web/.next/server/app/agents/new/page/react-loadable-manifest.json +1 -0
  178. package/web/standalone/apps/web/.next/server/app/agents/new/page/server-reference-manifest.json +4 -0
  179. package/web/standalone/apps/web/.next/server/app/agents/new/page.js +15 -0
  180. package/web/standalone/apps/web/.next/server/app/agents/new/page.js.map +5 -0
  181. package/web/standalone/apps/web/.next/server/app/agents/new/page.js.nft.json +1 -0
  182. package/web/standalone/apps/web/.next/server/app/agents/new/page_client-reference-manifest.js +3 -0
  183. package/web/standalone/apps/web/.next/server/app/agents/new.html +1 -0
  184. package/web/standalone/apps/web/.next/server/app/agents/new.meta +16 -0
  185. package/web/standalone/apps/web/.next/server/app/agents/new.rsc +25 -0
  186. package/web/standalone/apps/web/.next/server/app/agents/new.segments/_full.segment.rsc +25 -0
  187. package/web/standalone/apps/web/.next/server/app/agents/new.segments/_head.segment.rsc +6 -0
  188. package/web/standalone/apps/web/.next/server/app/agents/new.segments/_index.segment.rsc +6 -0
  189. package/web/standalone/apps/web/.next/server/app/agents/new.segments/_tree.segment.rsc +4 -0
  190. package/web/standalone/apps/web/.next/server/app/agents/new.segments/agents/new/__PAGE__.segment.rsc +9 -0
  191. package/web/standalone/apps/web/.next/server/app/agents/new.segments/agents/new.segment.rsc +5 -0
  192. package/web/standalone/apps/web/.next/server/app/agents/new.segments/agents.segment.rsc +6 -0
  193. package/web/standalone/apps/web/.next/server/app/agents/page/app-paths-manifest.json +3 -0
  194. package/web/standalone/apps/web/.next/server/app/agents/page/build-manifest.json +17 -0
  195. package/web/standalone/apps/web/.next/server/app/agents/page/next-font-manifest.json +11 -0
  196. package/web/standalone/apps/web/.next/server/app/agents/page/react-loadable-manifest.json +1 -0
  197. package/web/standalone/apps/web/.next/server/app/agents/page/server-reference-manifest.json +4 -0
  198. package/web/standalone/apps/web/.next/server/app/agents/page.js +15 -0
  199. package/web/standalone/apps/web/.next/server/app/agents/page.js.map +5 -0
  200. package/web/standalone/apps/web/.next/server/app/agents/page.js.nft.json +1 -0
  201. package/web/standalone/apps/web/.next/server/app/agents/page_client-reference-manifest.js +3 -0
  202. package/web/standalone/apps/web/.next/server/app/agents.html +1 -0
  203. package/web/standalone/apps/web/.next/server/app/agents.meta +15 -0
  204. package/web/standalone/apps/web/.next/server/app/agents.rsc +23 -0
  205. package/web/standalone/apps/web/.next/server/app/agents.segments/_full.segment.rsc +23 -0
  206. package/web/standalone/apps/web/.next/server/app/agents.segments/_head.segment.rsc +6 -0
  207. package/web/standalone/apps/web/.next/server/app/agents.segments/_index.segment.rsc +6 -0
  208. package/web/standalone/apps/web/.next/server/app/agents.segments/_tree.segment.rsc +4 -0
  209. package/web/standalone/apps/web/.next/server/app/agents.segments/agents/__PAGE__.segment.rsc +9 -0
  210. package/web/standalone/apps/web/.next/server/app/agents.segments/agents.segment.rsc +6 -0
  211. package/web/standalone/apps/web/.next/server/app/capabilities/cron/[id]/page/app-paths-manifest.json +3 -0
  212. package/web/standalone/apps/web/.next/server/app/capabilities/cron/[id]/page/build-manifest.json +17 -0
  213. package/web/standalone/apps/web/.next/server/app/capabilities/cron/[id]/page/next-font-manifest.json +11 -0
  214. package/web/standalone/apps/web/.next/server/app/capabilities/cron/[id]/page/react-loadable-manifest.json +1 -0
  215. package/web/standalone/apps/web/.next/server/app/capabilities/cron/[id]/page/server-reference-manifest.json +4 -0
  216. package/web/standalone/apps/web/.next/server/app/capabilities/cron/[id]/page.js +15 -0
  217. package/web/standalone/apps/web/.next/server/app/capabilities/cron/[id]/page.js.map +5 -0
  218. package/web/standalone/apps/web/.next/server/app/capabilities/cron/[id]/page.js.nft.json +1 -0
  219. package/web/standalone/apps/web/.next/server/app/capabilities/cron/[id]/page_client-reference-manifest.js +3 -0
  220. package/web/standalone/apps/web/.next/server/app/capabilities/cron/page/app-paths-manifest.json +3 -0
  221. package/web/standalone/apps/web/.next/server/app/capabilities/cron/page/build-manifest.json +17 -0
  222. package/web/standalone/apps/web/.next/server/app/capabilities/cron/page/next-font-manifest.json +11 -0
  223. package/web/standalone/apps/web/.next/server/app/capabilities/cron/page/react-loadable-manifest.json +1 -0
  224. package/web/standalone/apps/web/.next/server/app/capabilities/cron/page/server-reference-manifest.json +4 -0
  225. package/web/standalone/apps/web/.next/server/app/capabilities/cron/page.js +15 -0
  226. package/web/standalone/apps/web/.next/server/app/capabilities/cron/page.js.map +5 -0
  227. package/web/standalone/apps/web/.next/server/app/capabilities/cron/page.js.nft.json +1 -0
  228. package/web/standalone/apps/web/.next/server/app/capabilities/cron/page_client-reference-manifest.js +3 -0
  229. package/web/standalone/apps/web/.next/server/app/capabilities/cron.html +1 -0
  230. package/web/standalone/apps/web/.next/server/app/capabilities/cron.meta +16 -0
  231. package/web/standalone/apps/web/.next/server/app/capabilities/cron.rsc +25 -0
  232. package/web/standalone/apps/web/.next/server/app/capabilities/cron.segments/_full.segment.rsc +25 -0
  233. package/web/standalone/apps/web/.next/server/app/capabilities/cron.segments/_head.segment.rsc +6 -0
  234. package/web/standalone/apps/web/.next/server/app/capabilities/cron.segments/_index.segment.rsc +6 -0
  235. package/web/standalone/apps/web/.next/server/app/capabilities/cron.segments/_tree.segment.rsc +4 -0
  236. package/web/standalone/apps/web/.next/server/app/capabilities/cron.segments/capabilities/cron/__PAGE__.segment.rsc +9 -0
  237. package/web/standalone/apps/web/.next/server/app/capabilities/cron.segments/capabilities/cron.segment.rsc +5 -0
  238. package/web/standalone/apps/web/.next/server/app/capabilities/cron.segments/capabilities.segment.rsc +6 -0
  239. package/web/standalone/apps/web/.next/server/app/capabilities/database/[id]/page/app-paths-manifest.json +3 -0
  240. package/web/standalone/apps/web/.next/server/app/capabilities/database/[id]/page/build-manifest.json +17 -0
  241. package/web/standalone/apps/web/.next/server/app/capabilities/database/[id]/page/next-font-manifest.json +11 -0
  242. package/web/standalone/apps/web/.next/server/app/capabilities/database/[id]/page/react-loadable-manifest.json +1 -0
  243. package/web/standalone/apps/web/.next/server/app/capabilities/database/[id]/page/server-reference-manifest.json +4 -0
  244. package/web/standalone/apps/web/.next/server/app/capabilities/database/[id]/page.js +15 -0
  245. package/web/standalone/apps/web/.next/server/app/capabilities/database/[id]/page.js.map +5 -0
  246. package/web/standalone/apps/web/.next/server/app/capabilities/database/[id]/page.js.nft.json +1 -0
  247. package/web/standalone/apps/web/.next/server/app/capabilities/database/[id]/page_client-reference-manifest.js +3 -0
  248. package/web/standalone/apps/web/.next/server/app/capabilities/database/page/app-paths-manifest.json +3 -0
  249. package/web/standalone/apps/web/.next/server/app/capabilities/database/page/build-manifest.json +17 -0
  250. package/web/standalone/apps/web/.next/server/app/capabilities/database/page/next-font-manifest.json +11 -0
  251. package/web/standalone/apps/web/.next/server/app/capabilities/database/page/react-loadable-manifest.json +1 -0
  252. package/web/standalone/apps/web/.next/server/app/capabilities/database/page/server-reference-manifest.json +4 -0
  253. package/web/standalone/apps/web/.next/server/app/capabilities/database/page.js +15 -0
  254. package/web/standalone/apps/web/.next/server/app/capabilities/database/page.js.map +5 -0
  255. package/web/standalone/apps/web/.next/server/app/capabilities/database/page.js.nft.json +1 -0
  256. package/web/standalone/apps/web/.next/server/app/capabilities/database/page_client-reference-manifest.js +3 -0
  257. package/web/standalone/apps/web/.next/server/app/capabilities/database.html +1 -0
  258. package/web/standalone/apps/web/.next/server/app/capabilities/database.meta +16 -0
  259. package/web/standalone/apps/web/.next/server/app/capabilities/database.rsc +25 -0
  260. package/web/standalone/apps/web/.next/server/app/capabilities/database.segments/_full.segment.rsc +25 -0
  261. package/web/standalone/apps/web/.next/server/app/capabilities/database.segments/_head.segment.rsc +6 -0
  262. package/web/standalone/apps/web/.next/server/app/capabilities/database.segments/_index.segment.rsc +6 -0
  263. package/web/standalone/apps/web/.next/server/app/capabilities/database.segments/_tree.segment.rsc +4 -0
  264. package/web/standalone/apps/web/.next/server/app/capabilities/database.segments/capabilities/database/__PAGE__.segment.rsc +9 -0
  265. package/web/standalone/apps/web/.next/server/app/capabilities/database.segments/capabilities/database.segment.rsc +5 -0
  266. package/web/standalone/apps/web/.next/server/app/capabilities/database.segments/capabilities.segment.rsc +6 -0
  267. package/web/standalone/apps/web/.next/server/app/capabilities/email/page/app-paths-manifest.json +3 -0
  268. package/web/standalone/apps/web/.next/server/app/capabilities/email/page/build-manifest.json +17 -0
  269. package/web/standalone/apps/web/.next/server/app/capabilities/email/page/next-font-manifest.json +11 -0
  270. package/web/standalone/apps/web/.next/server/app/capabilities/email/page/react-loadable-manifest.json +1 -0
  271. package/web/standalone/apps/web/.next/server/app/capabilities/email/page/server-reference-manifest.json +4 -0
  272. package/web/standalone/apps/web/.next/server/app/capabilities/email/page.js +15 -0
  273. package/web/standalone/apps/web/.next/server/app/capabilities/email/page.js.map +5 -0
  274. package/web/standalone/apps/web/.next/server/app/capabilities/email/page.js.nft.json +1 -0
  275. package/web/standalone/apps/web/.next/server/app/capabilities/email/page_client-reference-manifest.js +3 -0
  276. package/web/standalone/apps/web/.next/server/app/capabilities/email.html +1 -0
  277. package/web/standalone/apps/web/.next/server/app/capabilities/email.meta +16 -0
  278. package/web/standalone/apps/web/.next/server/app/capabilities/email.rsc +25 -0
  279. package/web/standalone/apps/web/.next/server/app/capabilities/email.segments/_full.segment.rsc +25 -0
  280. package/web/standalone/apps/web/.next/server/app/capabilities/email.segments/_head.segment.rsc +6 -0
  281. package/web/standalone/apps/web/.next/server/app/capabilities/email.segments/_index.segment.rsc +6 -0
  282. package/web/standalone/apps/web/.next/server/app/capabilities/email.segments/_tree.segment.rsc +4 -0
  283. package/web/standalone/apps/web/.next/server/app/capabilities/email.segments/capabilities/email/__PAGE__.segment.rsc +9 -0
  284. package/web/standalone/apps/web/.next/server/app/capabilities/email.segments/capabilities/email.segment.rsc +5 -0
  285. package/web/standalone/apps/web/.next/server/app/capabilities/email.segments/capabilities.segment.rsc +6 -0
  286. package/web/standalone/apps/web/.next/server/app/capabilities/http/[id]/page/app-paths-manifest.json +3 -0
  287. package/web/standalone/apps/web/.next/server/app/capabilities/http/[id]/page/build-manifest.json +17 -0
  288. package/web/standalone/apps/web/.next/server/app/capabilities/http/[id]/page/next-font-manifest.json +11 -0
  289. package/web/standalone/apps/web/.next/server/app/capabilities/http/[id]/page/react-loadable-manifest.json +1 -0
  290. package/web/standalone/apps/web/.next/server/app/capabilities/http/[id]/page/server-reference-manifest.json +4 -0
  291. package/web/standalone/apps/web/.next/server/app/capabilities/http/[id]/page.js +15 -0
  292. package/web/standalone/apps/web/.next/server/app/capabilities/http/[id]/page.js.map +5 -0
  293. package/web/standalone/apps/web/.next/server/app/capabilities/http/[id]/page.js.nft.json +1 -0
  294. package/web/standalone/apps/web/.next/server/app/capabilities/http/[id]/page_client-reference-manifest.js +3 -0
  295. package/web/standalone/apps/web/.next/server/app/capabilities/http/page/app-paths-manifest.json +3 -0
  296. package/web/standalone/apps/web/.next/server/app/capabilities/http/page/build-manifest.json +17 -0
  297. package/web/standalone/apps/web/.next/server/app/capabilities/http/page/next-font-manifest.json +11 -0
  298. package/web/standalone/apps/web/.next/server/app/capabilities/http/page/react-loadable-manifest.json +1 -0
  299. package/web/standalone/apps/web/.next/server/app/capabilities/http/page/server-reference-manifest.json +4 -0
  300. package/web/standalone/apps/web/.next/server/app/capabilities/http/page.js +15 -0
  301. package/web/standalone/apps/web/.next/server/app/capabilities/http/page.js.map +5 -0
  302. package/web/standalone/apps/web/.next/server/app/capabilities/http/page.js.nft.json +1 -0
  303. package/web/standalone/apps/web/.next/server/app/capabilities/http/page_client-reference-manifest.js +3 -0
  304. package/web/standalone/apps/web/.next/server/app/capabilities/http.html +1 -0
  305. package/web/standalone/apps/web/.next/server/app/capabilities/http.meta +16 -0
  306. package/web/standalone/apps/web/.next/server/app/capabilities/http.rsc +25 -0
  307. package/web/standalone/apps/web/.next/server/app/capabilities/http.segments/_full.segment.rsc +25 -0
  308. package/web/standalone/apps/web/.next/server/app/capabilities/http.segments/_head.segment.rsc +6 -0
  309. package/web/standalone/apps/web/.next/server/app/capabilities/http.segments/_index.segment.rsc +6 -0
  310. package/web/standalone/apps/web/.next/server/app/capabilities/http.segments/_tree.segment.rsc +4 -0
  311. package/web/standalone/apps/web/.next/server/app/capabilities/http.segments/capabilities/http/__PAGE__.segment.rsc +9 -0
  312. package/web/standalone/apps/web/.next/server/app/capabilities/http.segments/capabilities/http.segment.rsc +5 -0
  313. package/web/standalone/apps/web/.next/server/app/capabilities/http.segments/capabilities.segment.rsc +6 -0
  314. package/web/standalone/apps/web/.next/server/app/capabilities/s3/[id]/page/app-paths-manifest.json +3 -0
  315. package/web/standalone/apps/web/.next/server/app/capabilities/s3/[id]/page/build-manifest.json +17 -0
  316. package/web/standalone/apps/web/.next/server/app/capabilities/s3/[id]/page/next-font-manifest.json +11 -0
  317. package/web/standalone/apps/web/.next/server/app/capabilities/s3/[id]/page/react-loadable-manifest.json +1 -0
  318. package/web/standalone/apps/web/.next/server/app/capabilities/s3/[id]/page/server-reference-manifest.json +4 -0
  319. package/web/standalone/apps/web/.next/server/app/capabilities/s3/[id]/page.js +15 -0
  320. package/web/standalone/apps/web/.next/server/app/capabilities/s3/[id]/page.js.map +5 -0
  321. package/web/standalone/apps/web/.next/server/app/capabilities/s3/[id]/page.js.nft.json +1 -0
  322. package/web/standalone/apps/web/.next/server/app/capabilities/s3/[id]/page_client-reference-manifest.js +3 -0
  323. package/web/standalone/apps/web/.next/server/app/capabilities/s3/page/app-paths-manifest.json +3 -0
  324. package/web/standalone/apps/web/.next/server/app/capabilities/s3/page/build-manifest.json +17 -0
  325. package/web/standalone/apps/web/.next/server/app/capabilities/s3/page/next-font-manifest.json +11 -0
  326. package/web/standalone/apps/web/.next/server/app/capabilities/s3/page/react-loadable-manifest.json +1 -0
  327. package/web/standalone/apps/web/.next/server/app/capabilities/s3/page/server-reference-manifest.json +4 -0
  328. package/web/standalone/apps/web/.next/server/app/capabilities/s3/page.js +15 -0
  329. package/web/standalone/apps/web/.next/server/app/capabilities/s3/page.js.map +5 -0
  330. package/web/standalone/apps/web/.next/server/app/capabilities/s3/page.js.nft.json +1 -0
  331. package/web/standalone/apps/web/.next/server/app/capabilities/s3/page_client-reference-manifest.js +3 -0
  332. package/web/standalone/apps/web/.next/server/app/capabilities/s3.html +1 -0
  333. package/web/standalone/apps/web/.next/server/app/capabilities/s3.meta +16 -0
  334. package/web/standalone/apps/web/.next/server/app/capabilities/s3.rsc +25 -0
  335. package/web/standalone/apps/web/.next/server/app/capabilities/s3.segments/_full.segment.rsc +25 -0
  336. package/web/standalone/apps/web/.next/server/app/capabilities/s3.segments/_head.segment.rsc +6 -0
  337. package/web/standalone/apps/web/.next/server/app/capabilities/s3.segments/_index.segment.rsc +6 -0
  338. package/web/standalone/apps/web/.next/server/app/capabilities/s3.segments/_tree.segment.rsc +4 -0
  339. package/web/standalone/apps/web/.next/server/app/capabilities/s3.segments/capabilities/s3/__PAGE__.segment.rsc +9 -0
  340. package/web/standalone/apps/web/.next/server/app/capabilities/s3.segments/capabilities/s3.segment.rsc +5 -0
  341. package/web/standalone/apps/web/.next/server/app/capabilities/s3.segments/capabilities.segment.rsc +6 -0
  342. package/web/standalone/apps/web/.next/server/app/capabilities/telegram/[id]/page/app-paths-manifest.json +3 -0
  343. package/web/standalone/apps/web/.next/server/app/capabilities/telegram/[id]/page/build-manifest.json +17 -0
  344. package/web/standalone/apps/web/.next/server/app/capabilities/telegram/[id]/page/next-font-manifest.json +11 -0
  345. package/web/standalone/apps/web/.next/server/app/capabilities/telegram/[id]/page/react-loadable-manifest.json +1 -0
  346. package/web/standalone/apps/web/.next/server/app/capabilities/telegram/[id]/page/server-reference-manifest.json +4 -0
  347. package/web/standalone/apps/web/.next/server/app/capabilities/telegram/[id]/page.js +15 -0
  348. package/web/standalone/apps/web/.next/server/app/capabilities/telegram/[id]/page.js.map +5 -0
  349. package/web/standalone/apps/web/.next/server/app/capabilities/telegram/[id]/page.js.nft.json +1 -0
  350. package/web/standalone/apps/web/.next/server/app/capabilities/telegram/[id]/page_client-reference-manifest.js +3 -0
  351. package/web/standalone/apps/web/.next/server/app/capabilities/telegram/page/app-paths-manifest.json +3 -0
  352. package/web/standalone/apps/web/.next/server/app/capabilities/telegram/page/build-manifest.json +17 -0
  353. package/web/standalone/apps/web/.next/server/app/capabilities/telegram/page/next-font-manifest.json +11 -0
  354. package/web/standalone/apps/web/.next/server/app/capabilities/telegram/page/react-loadable-manifest.json +1 -0
  355. package/web/standalone/apps/web/.next/server/app/capabilities/telegram/page/server-reference-manifest.json +4 -0
  356. package/web/standalone/apps/web/.next/server/app/capabilities/telegram/page.js +15 -0
  357. package/web/standalone/apps/web/.next/server/app/capabilities/telegram/page.js.map +5 -0
  358. package/web/standalone/apps/web/.next/server/app/capabilities/telegram/page.js.nft.json +1 -0
  359. package/web/standalone/apps/web/.next/server/app/capabilities/telegram/page_client-reference-manifest.js +3 -0
  360. package/web/standalone/apps/web/.next/server/app/capabilities/telegram.html +1 -0
  361. package/web/standalone/apps/web/.next/server/app/capabilities/telegram.meta +16 -0
  362. package/web/standalone/apps/web/.next/server/app/capabilities/telegram.rsc +25 -0
  363. package/web/standalone/apps/web/.next/server/app/capabilities/telegram.segments/_full.segment.rsc +25 -0
  364. package/web/standalone/apps/web/.next/server/app/capabilities/telegram.segments/_head.segment.rsc +6 -0
  365. package/web/standalone/apps/web/.next/server/app/capabilities/telegram.segments/_index.segment.rsc +6 -0
  366. package/web/standalone/apps/web/.next/server/app/capabilities/telegram.segments/_tree.segment.rsc +4 -0
  367. package/web/standalone/apps/web/.next/server/app/capabilities/telegram.segments/capabilities/telegram/__PAGE__.segment.rsc +9 -0
  368. package/web/standalone/apps/web/.next/server/app/capabilities/telegram.segments/capabilities/telegram.segment.rsc +5 -0
  369. package/web/standalone/apps/web/.next/server/app/capabilities/telegram.segments/capabilities.segment.rsc +6 -0
  370. package/web/standalone/apps/web/.next/server/app/dashboard/page/app-paths-manifest.json +3 -0
  371. package/web/standalone/apps/web/.next/server/app/dashboard/page/build-manifest.json +17 -0
  372. package/web/standalone/apps/web/.next/server/app/dashboard/page/next-font-manifest.json +11 -0
  373. package/web/standalone/apps/web/.next/server/app/dashboard/page/react-loadable-manifest.json +1 -0
  374. package/web/standalone/apps/web/.next/server/app/dashboard/page/server-reference-manifest.json +4 -0
  375. package/web/standalone/apps/web/.next/server/app/dashboard/page.js +15 -0
  376. package/web/standalone/apps/web/.next/server/app/dashboard/page.js.map +5 -0
  377. package/web/standalone/apps/web/.next/server/app/dashboard/page.js.nft.json +1 -0
  378. package/web/standalone/apps/web/.next/server/app/dashboard/page_client-reference-manifest.js +3 -0
  379. package/web/standalone/apps/web/.next/server/app/dashboard.html +1 -0
  380. package/web/standalone/apps/web/.next/server/app/dashboard.meta +15 -0
  381. package/web/standalone/apps/web/.next/server/app/dashboard.rsc +23 -0
  382. package/web/standalone/apps/web/.next/server/app/dashboard.segments/_full.segment.rsc +23 -0
  383. package/web/standalone/apps/web/.next/server/app/dashboard.segments/_head.segment.rsc +6 -0
  384. package/web/standalone/apps/web/.next/server/app/dashboard.segments/_index.segment.rsc +6 -0
  385. package/web/standalone/apps/web/.next/server/app/dashboard.segments/_tree.segment.rsc +4 -0
  386. package/web/standalone/apps/web/.next/server/app/dashboard.segments/dashboard/__PAGE__.segment.rsc +9 -0
  387. package/web/standalone/apps/web/.next/server/app/dashboard.segments/dashboard.segment.rsc +6 -0
  388. package/web/standalone/apps/web/.next/server/app/favicon.ico/route/app-paths-manifest.json +3 -0
  389. package/web/standalone/apps/web/.next/server/app/favicon.ico/route/build-manifest.json +9 -0
  390. package/web/standalone/apps/web/.next/server/app/favicon.ico/route.js +6 -0
  391. package/web/standalone/apps/web/.next/server/app/favicon.ico/route.js.map +5 -0
  392. package/web/standalone/apps/web/.next/server/app/favicon.ico/route.js.nft.json +1 -0
  393. package/web/standalone/apps/web/.next/server/app/favicon.ico.body +0 -0
  394. package/web/standalone/apps/web/.next/server/app/favicon.ico.meta +1 -0
  395. package/web/standalone/apps/web/.next/server/app/index.html +1 -0
  396. package/web/standalone/apps/web/.next/server/app/index.meta +14 -0
  397. package/web/standalone/apps/web/.next/server/app/index.rsc +18 -0
  398. package/web/standalone/apps/web/.next/server/app/index.segments/__PAGE__.segment.rsc +6 -0
  399. package/web/standalone/apps/web/.next/server/app/index.segments/_full.segment.rsc +18 -0
  400. package/web/standalone/apps/web/.next/server/app/index.segments/_head.segment.rsc +6 -0
  401. package/web/standalone/apps/web/.next/server/app/index.segments/_index.segment.rsc +6 -0
  402. package/web/standalone/apps/web/.next/server/app/index.segments/_tree.segment.rsc +4 -0
  403. package/web/standalone/apps/web/.next/server/app/page/app-paths-manifest.json +3 -0
  404. package/web/standalone/apps/web/.next/server/app/page/build-manifest.json +17 -0
  405. package/web/standalone/apps/web/.next/server/app/page/next-font-manifest.json +11 -0
  406. package/web/standalone/apps/web/.next/server/app/page/react-loadable-manifest.json +1 -0
  407. package/web/standalone/apps/web/.next/server/app/page/server-reference-manifest.json +4 -0
  408. package/web/standalone/apps/web/.next/server/app/page.js +14 -0
  409. package/web/standalone/apps/web/.next/server/app/page.js.map +5 -0
  410. package/web/standalone/apps/web/.next/server/app/page.js.nft.json +1 -0
  411. package/web/standalone/apps/web/.next/server/app/page_client-reference-manifest.js +3 -0
  412. package/web/standalone/apps/web/.next/server/app/processes/[id]/page/app-paths-manifest.json +3 -0
  413. package/web/standalone/apps/web/.next/server/app/processes/[id]/page/build-manifest.json +17 -0
  414. package/web/standalone/apps/web/.next/server/app/processes/[id]/page/next-font-manifest.json +11 -0
  415. package/web/standalone/apps/web/.next/server/app/processes/[id]/page/react-loadable-manifest.json +1 -0
  416. package/web/standalone/apps/web/.next/server/app/processes/[id]/page/server-reference-manifest.json +4 -0
  417. package/web/standalone/apps/web/.next/server/app/processes/[id]/page.js +15 -0
  418. package/web/standalone/apps/web/.next/server/app/processes/[id]/page.js.map +5 -0
  419. package/web/standalone/apps/web/.next/server/app/processes/[id]/page.js.nft.json +1 -0
  420. package/web/standalone/apps/web/.next/server/app/processes/[id]/page_client-reference-manifest.js +3 -0
  421. package/web/standalone/apps/web/.next/server/app/processes/page/app-paths-manifest.json +3 -0
  422. package/web/standalone/apps/web/.next/server/app/processes/page/build-manifest.json +17 -0
  423. package/web/standalone/apps/web/.next/server/app/processes/page/next-font-manifest.json +11 -0
  424. package/web/standalone/apps/web/.next/server/app/processes/page/react-loadable-manifest.json +1 -0
  425. package/web/standalone/apps/web/.next/server/app/processes/page/server-reference-manifest.json +4 -0
  426. package/web/standalone/apps/web/.next/server/app/processes/page.js +15 -0
  427. package/web/standalone/apps/web/.next/server/app/processes/page.js.map +5 -0
  428. package/web/standalone/apps/web/.next/server/app/processes/page.js.nft.json +1 -0
  429. package/web/standalone/apps/web/.next/server/app/processes/page_client-reference-manifest.js +3 -0
  430. package/web/standalone/apps/web/.next/server/app/processes.html +1 -0
  431. package/web/standalone/apps/web/.next/server/app/processes.meta +15 -0
  432. package/web/standalone/apps/web/.next/server/app/processes.rsc +23 -0
  433. package/web/standalone/apps/web/.next/server/app/processes.segments/_full.segment.rsc +23 -0
  434. package/web/standalone/apps/web/.next/server/app/processes.segments/_head.segment.rsc +6 -0
  435. package/web/standalone/apps/web/.next/server/app/processes.segments/_index.segment.rsc +6 -0
  436. package/web/standalone/apps/web/.next/server/app/processes.segments/_tree.segment.rsc +4 -0
  437. package/web/standalone/apps/web/.next/server/app/processes.segments/processes/__PAGE__.segment.rsc +9 -0
  438. package/web/standalone/apps/web/.next/server/app/processes.segments/processes.segment.rsc +6 -0
  439. package/web/standalone/apps/web/.next/server/app/settings/page/app-paths-manifest.json +3 -0
  440. package/web/standalone/apps/web/.next/server/app/settings/page/build-manifest.json +17 -0
  441. package/web/standalone/apps/web/.next/server/app/settings/page/next-font-manifest.json +11 -0
  442. package/web/standalone/apps/web/.next/server/app/settings/page/react-loadable-manifest.json +1 -0
  443. package/web/standalone/apps/web/.next/server/app/settings/page/server-reference-manifest.json +4 -0
  444. package/web/standalone/apps/web/.next/server/app/settings/page.js +15 -0
  445. package/web/standalone/apps/web/.next/server/app/settings/page.js.map +5 -0
  446. package/web/standalone/apps/web/.next/server/app/settings/page.js.nft.json +1 -0
  447. package/web/standalone/apps/web/.next/server/app/settings/page_client-reference-manifest.js +3 -0
  448. package/web/standalone/apps/web/.next/server/app/settings.html +1 -0
  449. package/web/standalone/apps/web/.next/server/app/settings.meta +15 -0
  450. package/web/standalone/apps/web/.next/server/app/settings.rsc +23 -0
  451. package/web/standalone/apps/web/.next/server/app/settings.segments/_full.segment.rsc +23 -0
  452. package/web/standalone/apps/web/.next/server/app/settings.segments/_head.segment.rsc +6 -0
  453. package/web/standalone/apps/web/.next/server/app/settings.segments/_index.segment.rsc +6 -0
  454. package/web/standalone/apps/web/.next/server/app/settings.segments/_tree.segment.rsc +4 -0
  455. package/web/standalone/apps/web/.next/server/app/settings.segments/settings/__PAGE__.segment.rsc +9 -0
  456. package/web/standalone/apps/web/.next/server/app/settings.segments/settings.segment.rsc +6 -0
  457. package/web/standalone/apps/web/.next/server/app-paths-manifest.json +26 -0
  458. package/web/standalone/apps/web/.next/server/chunks/[externals]_next_dist_0arv.vj._.js +3 -0
  459. package/web/standalone/apps/web/.next/server/chunks/[root-of-the-server]__0~3j_ga._.js +13 -0
  460. package/web/standalone/apps/web/.next/server/chunks/[turbopack]_runtime.js +903 -0
  461. package/web/standalone/apps/web/.next/server/chunks/apps_web__next-internal_server_app_favicon_ico_route_actions_0h5n1et.js +3 -0
  462. package/web/standalone/apps/web/.next/server/chunks/ssr/02dz_web__next-internal_server_app_capabilities_database_[id]_page_actions_0.-c3vs.js +3 -0
  463. package/web/standalone/apps/web/.next/server/chunks/ssr/02dz_web__next-internal_server_app_capabilities_telegram_[id]_page_actions_00x92aq.js +3 -0
  464. package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_0f4v1z5._.js +6 -0
  465. package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_05v-uws._.js +3 -0
  466. package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_0kt-.cm._.js +6 -0
  467. package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_client_components_04~l9~b._.js +3 -0
  468. package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_client_components_builtin_forbidden_0a6wr8l.js +3 -0
  469. package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_client_components_builtin_global-error_109gj6..js +3 -0
  470. package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_client_components_builtin_unauthorized_08_5kf-.js +3 -0
  471. package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_esm_build_templates_app-page_0-uhk21.js +4 -0
  472. package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_esm_build_templates_app-page_0.3kkc_.js +4 -0
  473. package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_esm_build_templates_app-page_016gfnx.js +4 -0
  474. package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_esm_build_templates_app-page_01mctzl.js +4 -0
  475. package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_esm_build_templates_app-page_02e3oga.js +4 -0
  476. package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_esm_build_templates_app-page_02y4i-c.js +4 -0
  477. package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_esm_build_templates_app-page_05ygn2~.js +4 -0
  478. package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_esm_build_templates_app-page_0_~wwe5.js +4 -0
  479. package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_esm_build_templates_app-page_0b4dx3w.js +4 -0
  480. package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_esm_build_templates_app-page_0du38rd.js +4 -0
  481. package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_esm_build_templates_app-page_0e8g9q0.js +4 -0
  482. package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_esm_build_templates_app-page_0f2-c.e.js +4 -0
  483. package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_esm_build_templates_app-page_0gdgxa7.js +4 -0
  484. package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_esm_build_templates_app-page_0i5zrqw.js +4 -0
  485. package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_esm_build_templates_app-page_0ljd49j.js +4 -0
  486. package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_esm_build_templates_app-page_0mi9cdx.js +4 -0
  487. package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_esm_build_templates_app-page_0oq8du3.js +4 -0
  488. package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_esm_build_templates_app-page_0pl_g7l.js +4 -0
  489. package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_esm_build_templates_app-page_0wg3p4e.js +4 -0
  490. package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_esm_build_templates_app-page_0yc3j~6.js +4 -0
  491. package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_esm_build_templates_app-page_0yi0vqi.js +4 -0
  492. package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_esm_build_templates_app-page_0z1d.gu.js +4 -0
  493. package/web/standalone/apps/web/.next/server/chunks/ssr/0fuv_next_dist_esm_build_templates_app-page_13slyfs.js +4 -0
  494. package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__01j9ea3._.js +3 -0
  495. package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__01l01-8._.js +3 -0
  496. package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__02p4wbs._.js +3 -0
  497. package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__04v6.qm._.js +3 -0
  498. package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__06czjj7._.js +33 -0
  499. package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__072vzf1._.js +3 -0
  500. package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__08_g-x7._.js +3 -0
  501. package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0_b.9lv._.js +3 -0
  502. package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0_jvn9i._.js +3 -0
  503. package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0bgnjx2._.js +3 -0
  504. package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0cy-jpt._.js +3 -0
  505. package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0djkqf8._.js +19 -0
  506. package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0djyuc4._.js +3 -0
  507. package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0hln-za._.js +3 -0
  508. package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0ktr_dg._.js +3 -0
  509. package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0m19rl3._.js +3 -0
  510. package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0m9l~vh._.js +3 -0
  511. package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0ogkk8r._.js +33 -0
  512. package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0q.cram._.js +3 -0
  513. package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0rnwev6._.js +3 -0
  514. package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0s9xit3._.js +3 -0
  515. package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0s~z9ow._.js +3 -0
  516. package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0ulv~qj._.js +3 -0
  517. package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0xnq8g-._.js +3 -0
  518. package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0zuw_7g._.js +3 -0
  519. package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0~9h4iq._.js +3 -0
  520. package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__0~mjqf7._.js +3 -0
  521. package/web/standalone/apps/web/.next/server/chunks/ssr/[root-of-the-server]__12e7-gz._.js +3 -0
  522. package/web/standalone/apps/web/.next/server/chunks/ssr/[turbopack]_runtime.js +903 -0
  523. package/web/standalone/apps/web/.next/server/chunks/ssr/_0.bdnad._.js +3 -0
  524. package/web/standalone/apps/web/.next/server/chunks/ssr/_00a5evk._.js +3 -0
  525. package/web/standalone/apps/web/.next/server/chunks/ssr/_04--tsw._.js +3 -0
  526. package/web/standalone/apps/web/.next/server/chunks/ssr/_05lesu9._.js +3 -0
  527. package/web/standalone/apps/web/.next/server/chunks/ssr/_05sycvg._.js +3 -0
  528. package/web/standalone/apps/web/.next/server/chunks/ssr/_07a_7z8._.js +3 -0
  529. package/web/standalone/apps/web/.next/server/chunks/ssr/_0fxpl8-._.js +3 -0
  530. package/web/standalone/apps/web/.next/server/chunks/ssr/_0i3-r5p._.js +8 -0
  531. package/web/standalone/apps/web/.next/server/chunks/ssr/_0j04ujl._.js +3 -0
  532. package/web/standalone/apps/web/.next/server/chunks/ssr/_0neh~vy._.js +3 -0
  533. package/web/standalone/apps/web/.next/server/chunks/ssr/_0pixn7s._.js +3 -0
  534. package/web/standalone/apps/web/.next/server/chunks/ssr/_0u3ezmt._.js +3 -0
  535. package/web/standalone/apps/web/.next/server/chunks/ssr/_0xkzxjy._.js +3 -0
  536. package/web/standalone/apps/web/.next/server/chunks/ssr/_0xpz1yw._.js +3 -0
  537. package/web/standalone/apps/web/.next/server/chunks/ssr/_0yrq69.._.js +3 -0
  538. package/web/standalone/apps/web/.next/server/chunks/ssr/_0z_z7lg._.js +33 -0
  539. package/web/standalone/apps/web/.next/server/chunks/ssr/_12.8jw7._.js +3 -0
  540. package/web/standalone/apps/web/.next/server/chunks/ssr/_12ou3y3._.js +3 -0
  541. package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app__global-error_page_actions_0.u5cfa.js +3 -0
  542. package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app__not-found_page_actions_0appun9.js +3 -0
  543. package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app_agents_[id]_edit_page_actions_0_lcg_e.js +3 -0
  544. package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app_agents_[id]_page_actions_0sxkzxu.js +3 -0
  545. package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app_agents_[id]_terminal_page_actions_0x5.gii.js +3 -0
  546. package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app_agents_new_page_actions_077_d8h.js +3 -0
  547. package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app_agents_page_actions_0fcm22n.js +3 -0
  548. package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app_capabilities_cron_[id]_page_actions_03ri~.h.js +3 -0
  549. package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app_capabilities_cron_page_actions_0i6638x.js +3 -0
  550. package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app_capabilities_database_page_actions_084olu1.js +3 -0
  551. package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app_capabilities_email_page_actions_0y_8jvo.js +3 -0
  552. package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app_capabilities_http_[id]_page_actions_0w_nads.js +3 -0
  553. package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app_capabilities_http_page_actions_08q~6ps.js +3 -0
  554. package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app_capabilities_s3_[id]_page_actions_0b1va89.js +3 -0
  555. package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app_capabilities_s3_page_actions_01-rjn5.js +3 -0
  556. package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app_capabilities_telegram_page_actions_0~n0cvz.js +3 -0
  557. package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app_dashboard_page_actions_0d7kn4j.js +3 -0
  558. package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app_page_actions_0rm5_5w.js +3 -0
  559. package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app_processes_[id]_page_actions_00kaa~m.js +3 -0
  560. package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app_processes_page_actions_01mh_2n.js +3 -0
  561. package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web__next-internal_server_app_settings_page_actions_0f6epye.js +3 -0
  562. package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web_src_0.swnkn._.js +3 -0
  563. package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web_src_06~qvaf._.js +3 -0
  564. package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web_src_07amn01._.js +3 -0
  565. package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web_src_07juq0h._.js +3 -0
  566. package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web_src_0_glyv-._.js +3 -0
  567. package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web_src_0f3e-_6._.js +3 -0
  568. package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web_src_0ipwebe._.js +3 -0
  569. package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web_src_0t.jg~x._.js +3 -0
  570. package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web_src_0ug8ln8._.js +3 -0
  571. package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web_src_app_capabilities_database_page_tsx_0331n3m._.js +3 -0
  572. package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web_src_app_capabilities_email_page_tsx_0sdgf9o._.js +3 -0
  573. package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web_src_app_processes_[id]_page_tsx_03n8i7e._.js +3 -0
  574. package/web/standalone/apps/web/.next/server/chunks/ssr/apps_web_src_app_settings_page_tsx_0i6itlb._.js +3 -0
  575. package/web/standalone/apps/web/.next/server/chunks/ssr/node_modules_@xterm_addon-fit_lib_addon-fit_mjs_0qsj~me._.js +3 -0
  576. package/web/standalone/apps/web/.next/server/chunks/ssr/node_modules_@xterm_xterm_lib_xterm_mjs_0ruzhkb._.js +20 -0
  577. package/web/standalone/apps/web/.next/server/functions-config-manifest.json +4 -0
  578. package/web/standalone/apps/web/.next/server/middleware-build-manifest.js +21 -0
  579. package/web/standalone/apps/web/.next/server/middleware-manifest.json +6 -0
  580. package/web/standalone/apps/web/.next/server/next-font-manifest.js +1 -0
  581. package/web/standalone/apps/web/.next/server/next-font-manifest.json +95 -0
  582. package/web/standalone/apps/web/.next/server/pages/404.html +1 -0
  583. package/web/standalone/apps/web/.next/server/pages/500.html +1 -0
  584. package/web/standalone/apps/web/.next/server/pages-manifest.json +4 -0
  585. package/web/standalone/apps/web/.next/server/prefetch-hints.json +1 -0
  586. package/web/standalone/apps/web/.next/server/server-reference-manifest.js +1 -0
  587. package/web/standalone/apps/web/.next/server/server-reference-manifest.json +5 -0
  588. package/web/standalone/apps/web/node_modules/@next/env/dist/index.js +1 -0
  589. package/web/standalone/apps/web/node_modules/@next/env/package.json +36 -0
  590. package/web/standalone/apps/web/node_modules/next/dist/build/adapter/setup-node-env.external.js +15 -0
  591. package/web/standalone/apps/web/node_modules/next/dist/build/define-env.js +255 -0
  592. package/web/standalone/apps/web/node_modules/next/dist/build/duration-to-string.js +99 -0
  593. package/web/standalone/apps/web/node_modules/next/dist/build/get-supported-browsers.js +38 -0
  594. package/web/standalone/apps/web/node_modules/next/dist/build/next-config-ts/require-hook.js +85 -0
  595. package/web/standalone/apps/web/node_modules/next/dist/build/next-config-ts/transpile-config.js +251 -0
  596. package/web/standalone/apps/web/node_modules/next/dist/build/output/format.js +84 -0
  597. package/web/standalone/apps/web/node_modules/next/dist/build/output/log.js +135 -0
  598. package/web/standalone/apps/web/node_modules/next/dist/build/segment-config/app/app-segment-config.js +162 -0
  599. package/web/standalone/apps/web/node_modules/next/dist/build/segment-config/app/app-segments.js +137 -0
  600. package/web/standalone/apps/web/node_modules/next/dist/build/segment-config/app/collect-root-param-keys.js +52 -0
  601. package/web/standalone/apps/web/node_modules/next/dist/build/static-paths/app/extract-pathname-route-param-segments-from-loader-tree.js +137 -0
  602. package/web/standalone/apps/web/node_modules/next/dist/build/static-paths/app.js +735 -0
  603. package/web/standalone/apps/web/node_modules/next/dist/build/static-paths/pages.js +169 -0
  604. package/web/standalone/apps/web/node_modules/next/dist/build/static-paths/utils.js +119 -0
  605. package/web/standalone/apps/web/node_modules/next/dist/build/swc/helpers.js +15 -0
  606. package/web/standalone/apps/web/node_modules/next/dist/build/swc/index.js +1348 -0
  607. package/web/standalone/apps/web/node_modules/next/dist/build/swc/install-bindings.js +30 -0
  608. package/web/standalone/apps/web/node_modules/next/dist/build/swc/jest-transformer.js +76 -0
  609. package/web/standalone/apps/web/node_modules/next/dist/build/swc/loaderWorkerPool.js +40 -0
  610. package/web/standalone/apps/web/node_modules/next/dist/build/swc/options.js +403 -0
  611. package/web/standalone/apps/web/node_modules/next/dist/build/swc/types.js +6 -0
  612. package/web/standalone/apps/web/node_modules/next/dist/build/utils.js +1215 -0
  613. package/web/standalone/apps/web/node_modules/next/dist/cli/next-test.js +170 -0
  614. package/web/standalone/apps/web/node_modules/next/dist/client/add-base-path.js +24 -0
  615. package/web/standalone/apps/web/node_modules/next/dist/client/app-call-server.js +34 -0
  616. package/web/standalone/apps/web/node_modules/next/dist/client/app-find-source-map-url.js +39 -0
  617. package/web/standalone/apps/web/node_modules/next/dist/client/assign-location.js +29 -0
  618. package/web/standalone/apps/web/node_modules/next/dist/client/components/app-router-announcer.js +78 -0
  619. package/web/standalone/apps/web/node_modules/next/dist/client/components/app-router-headers.js +138 -0
  620. package/web/standalone/apps/web/node_modules/next/dist/client/components/app-router-instance.js +397 -0
  621. package/web/standalone/apps/web/node_modules/next/dist/client/components/app-router-utils.js +62 -0
  622. package/web/standalone/apps/web/node_modules/next/dist/client/components/app-router.js +514 -0
  623. package/web/standalone/apps/web/node_modules/next/dist/client/components/builtin/default.js +35 -0
  624. package/web/standalone/apps/web/node_modules/next/dist/client/components/builtin/error-styles.js +165 -0
  625. package/web/standalone/apps/web/node_modules/next/dist/client/components/builtin/global-error.js +100 -0
  626. package/web/standalone/apps/web/node_modules/next/dist/client/components/dev-root-http-access-fallback-boundary.js +52 -0
  627. package/web/standalone/apps/web/node_modules/next/dist/client/components/error-boundary.js +144 -0
  628. package/web/standalone/apps/web/node_modules/next/dist/client/components/errors/graceful-degrade-boundary.js +86 -0
  629. package/web/standalone/apps/web/node_modules/next/dist/client/components/errors/root-error-boundary.js +41 -0
  630. package/web/standalone/apps/web/node_modules/next/dist/client/components/forbidden.js +48 -0
  631. package/web/standalone/apps/web/node_modules/next/dist/client/components/handle-isr-error.js +30 -0
  632. package/web/standalone/apps/web/node_modules/next/dist/client/components/hooks-server-context.js +42 -0
  633. package/web/standalone/apps/web/node_modules/next/dist/client/components/http-access-fallback/error-boundary.js +125 -0
  634. package/web/standalone/apps/web/node_modules/next/dist/client/components/http-access-fallback/http-access-fallback.js +72 -0
  635. package/web/standalone/apps/web/node_modules/next/dist/client/components/is-next-router-error.js +23 -0
  636. package/web/standalone/apps/web/node_modules/next/dist/client/components/links.js +299 -0
  637. package/web/standalone/apps/web/node_modules/next/dist/client/components/match-segments.js +32 -0
  638. package/web/standalone/apps/web/node_modules/next/dist/client/components/nav-failure-handler.js +61 -0
  639. package/web/standalone/apps/web/node_modules/next/dist/client/components/navigation-devtools.js +126 -0
  640. package/web/standalone/apps/web/node_modules/next/dist/client/components/navigation-untracked.js +67 -0
  641. package/web/standalone/apps/web/node_modules/next/dist/client/components/navigation.js +225 -0
  642. package/web/standalone/apps/web/node_modules/next/dist/client/components/navigation.react-server.js +75 -0
  643. package/web/standalone/apps/web/node_modules/next/dist/client/components/not-found.js +42 -0
  644. package/web/standalone/apps/web/node_modules/next/dist/client/components/readonly-url-search-params.js +41 -0
  645. package/web/standalone/apps/web/node_modules/next/dist/client/components/redirect-boundary.js +107 -0
  646. package/web/standalone/apps/web/node_modules/next/dist/client/components/redirect-error.js +43 -0
  647. package/web/standalone/apps/web/node_modules/next/dist/client/components/redirect-status-code.js +24 -0
  648. package/web/standalone/apps/web/node_modules/next/dist/client/components/redirect.js +91 -0
  649. package/web/standalone/apps/web/node_modules/next/dist/client/components/router-reducer/compute-changed-path.js +201 -0
  650. package/web/standalone/apps/web/node_modules/next/dist/client/components/router-reducer/create-href-from-url.js +21 -0
  651. package/web/standalone/apps/web/node_modules/next/dist/client/components/router-reducer/create-initial-router-state.js +153 -0
  652. package/web/standalone/apps/web/node_modules/next/dist/client/components/router-reducer/create-router-cache-key.js +32 -0
  653. package/web/standalone/apps/web/node_modules/next/dist/client/components/router-reducer/fetch-server-response.js +457 -0
  654. package/web/standalone/apps/web/node_modules/next/dist/client/components/router-reducer/is-navigating-to-new-root-layout.js +59 -0
  655. package/web/standalone/apps/web/node_modules/next/dist/client/components/router-reducer/ppr-navigations.js +1341 -0
  656. package/web/standalone/apps/web/node_modules/next/dist/client/components/router-reducer/reducers/committed-state.js +49 -0
  657. package/web/standalone/apps/web/node_modules/next/dist/client/components/router-reducer/reducers/find-head-in-cache.js +63 -0
  658. package/web/standalone/apps/web/node_modules/next/dist/client/components/router-reducer/reducers/has-interception-route-in-current-tree.js +38 -0
  659. package/web/standalone/apps/web/node_modules/next/dist/client/components/router-reducer/reducers/hmr-refresh-reducer.js +23 -0
  660. package/web/standalone/apps/web/node_modules/next/dist/client/components/router-reducer/reducers/navigate-reducer.js +56 -0
  661. package/web/standalone/apps/web/node_modules/next/dist/client/components/router-reducer/reducers/refresh-reducer.js +83 -0
  662. package/web/standalone/apps/web/node_modules/next/dist/client/components/router-reducer/reducers/restore-reducer.js +62 -0
  663. package/web/standalone/apps/web/node_modules/next/dist/client/components/router-reducer/reducers/server-action-reducer.js +320 -0
  664. package/web/standalone/apps/web/node_modules/next/dist/client/components/router-reducer/reducers/server-patch-reducer.js +58 -0
  665. package/web/standalone/apps/web/node_modules/next/dist/client/components/router-reducer/router-reducer-types.js +70 -0
  666. package/web/standalone/apps/web/node_modules/next/dist/client/components/router-reducer/router-reducer.js +66 -0
  667. package/web/standalone/apps/web/node_modules/next/dist/client/components/router-reducer/set-cache-busting-search-param.js +60 -0
  668. package/web/standalone/apps/web/node_modules/next/dist/client/components/segment-cache/bfcache.js +128 -0
  669. package/web/standalone/apps/web/node_modules/next/dist/client/components/segment-cache/cache-key.js +28 -0
  670. package/web/standalone/apps/web/node_modules/next/dist/client/components/segment-cache/cache-map.js +305 -0
  671. package/web/standalone/apps/web/node_modules/next/dist/client/components/segment-cache/cache.js +1933 -0
  672. package/web/standalone/apps/web/node_modules/next/dist/client/components/segment-cache/lru.js +152 -0
  673. package/web/standalone/apps/web/node_modules/next/dist/client/components/segment-cache/navigation-testing-lock.js +194 -0
  674. package/web/standalone/apps/web/node_modules/next/dist/client/components/segment-cache/navigation.js +597 -0
  675. package/web/standalone/apps/web/node_modules/next/dist/client/components/segment-cache/optimistic-routes.js +543 -0
  676. package/web/standalone/apps/web/node_modules/next/dist/client/components/segment-cache/prefetch.js +31 -0
  677. package/web/standalone/apps/web/node_modules/next/dist/client/components/segment-cache/scheduler.js +1249 -0
  678. package/web/standalone/apps/web/node_modules/next/dist/client/components/segment-cache/types.js +69 -0
  679. package/web/standalone/apps/web/node_modules/next/dist/client/components/segment-cache/vary-path.js +278 -0
  680. package/web/standalone/apps/web/node_modules/next/dist/client/components/static-generation-bailout.js +42 -0
  681. package/web/standalone/apps/web/node_modules/next/dist/client/components/unauthorized.js +49 -0
  682. package/web/standalone/apps/web/node_modules/next/dist/client/components/unrecognized-action-error.js +39 -0
  683. package/web/standalone/apps/web/node_modules/next/dist/client/components/unresolved-thenable.js +23 -0
  684. package/web/standalone/apps/web/node_modules/next/dist/client/components/unstable-rethrow.browser.js +28 -0
  685. package/web/standalone/apps/web/node_modules/next/dist/client/components/unstable-rethrow.js +25 -0
  686. package/web/standalone/apps/web/node_modules/next/dist/client/components/unstable-rethrow.server.js +32 -0
  687. package/web/standalone/apps/web/node_modules/next/dist/client/components/use-action-queue.js +148 -0
  688. package/web/standalone/apps/web/node_modules/next/dist/client/dev/debug-channel.js +72 -0
  689. package/web/standalone/apps/web/node_modules/next/dist/client/flight-data-helpers.js +232 -0
  690. package/web/standalone/apps/web/node_modules/next/dist/client/has-base-path.js +23 -0
  691. package/web/standalone/apps/web/node_modules/next/dist/client/lib/console.js +177 -0
  692. package/web/standalone/apps/web/node_modules/next/dist/client/lib/javascript-url.js +32 -0
  693. package/web/standalone/apps/web/node_modules/next/dist/client/navigation-build-id.js +53 -0
  694. package/web/standalone/apps/web/node_modules/next/dist/client/normalize-trailing-slash.js +36 -0
  695. package/web/standalone/apps/web/node_modules/next/dist/client/remove-base-path.js +32 -0
  696. package/web/standalone/apps/web/node_modules/next/dist/client/route-params.js +230 -0
  697. package/web/standalone/apps/web/node_modules/next/dist/compiled/@edge-runtime/cookies/index.js +339 -0
  698. package/web/standalone/apps/web/node_modules/next/dist/compiled/@edge-runtime/cookies/package.json +1 -0
  699. package/web/standalone/apps/web/node_modules/next/dist/compiled/@edge-runtime/ponyfill/index.js +46 -0
  700. package/web/standalone/apps/web/node_modules/next/dist/compiled/@edge-runtime/ponyfill/package.json +1 -0
  701. package/web/standalone/apps/web/node_modules/next/dist/compiled/@edge-runtime/primitives/abort-controller.js.text.js +1 -0
  702. package/web/standalone/apps/web/node_modules/next/dist/compiled/@edge-runtime/primitives/console.js.text.js +1 -0
  703. package/web/standalone/apps/web/node_modules/next/dist/compiled/@edge-runtime/primitives/events.js.text.js +1 -0
  704. package/web/standalone/apps/web/node_modules/next/dist/compiled/@edge-runtime/primitives/index.js +5 -0
  705. package/web/standalone/apps/web/node_modules/next/dist/compiled/@edge-runtime/primitives/load.js +18713 -0
  706. package/web/standalone/apps/web/node_modules/next/dist/compiled/@edge-runtime/primitives/package.json +1 -0
  707. package/web/standalone/apps/web/node_modules/next/dist/compiled/@edge-runtime/primitives/stream.js +44 -0
  708. package/web/standalone/apps/web/node_modules/next/dist/compiled/@edge-runtime/primitives/timers.js.text.js +1 -0
  709. package/web/standalone/apps/web/node_modules/next/dist/compiled/@edge-runtime/primitives/url.js.text.js +1 -0
  710. package/web/standalone/apps/web/node_modules/next/dist/compiled/@hapi/accept/index.js +1 -0
  711. package/web/standalone/apps/web/node_modules/next/dist/compiled/@hapi/accept/package.json +1 -0
  712. package/web/standalone/apps/web/node_modules/next/dist/compiled/@mswjs/interceptors/ClientRequest/index.js +1 -0
  713. package/web/standalone/apps/web/node_modules/next/dist/compiled/@mswjs/interceptors/ClientRequest/package.json +1 -0
  714. package/web/standalone/apps/web/node_modules/next/dist/compiled/@napi-rs/triples/index.js +1 -0
  715. package/web/standalone/apps/web/node_modules/next/dist/compiled/@napi-rs/triples/package.json +1 -0
  716. package/web/standalone/apps/web/node_modules/next/dist/compiled/@opentelemetry/api/index.js +1 -0
  717. package/web/standalone/apps/web/node_modules/next/dist/compiled/@opentelemetry/api/package.json +1 -0
  718. package/web/standalone/apps/web/node_modules/next/dist/compiled/async-retry/index.js +1 -0
  719. package/web/standalone/apps/web/node_modules/next/dist/compiled/async-retry/package.json +1 -0
  720. package/web/standalone/apps/web/node_modules/next/dist/compiled/async-sema/index.js +1 -0
  721. package/web/standalone/apps/web/node_modules/next/dist/compiled/async-sema/package.json +1 -0
  722. package/web/standalone/apps/web/node_modules/next/dist/compiled/busboy/index.js +1 -0
  723. package/web/standalone/apps/web/node_modules/next/dist/compiled/busboy/package.json +1 -0
  724. package/web/standalone/apps/web/node_modules/next/dist/compiled/bytes/index.js +8 -0
  725. package/web/standalone/apps/web/node_modules/next/dist/compiled/bytes/package.json +1 -0
  726. package/web/standalone/apps/web/node_modules/next/dist/compiled/ci-info/index.js +1 -0
  727. package/web/standalone/apps/web/node_modules/next/dist/compiled/ci-info/package.json +1 -0
  728. package/web/standalone/apps/web/node_modules/next/dist/compiled/commander/index.js +1 -0
  729. package/web/standalone/apps/web/node_modules/next/dist/compiled/commander/package.json +1 -0
  730. package/web/standalone/apps/web/node_modules/next/dist/compiled/comment-json/index.js +7 -0
  731. package/web/standalone/apps/web/node_modules/next/dist/compiled/comment-json/package.json +1 -0
  732. package/web/standalone/apps/web/node_modules/next/dist/compiled/compression/index.js +58 -0
  733. package/web/standalone/apps/web/node_modules/next/dist/compiled/compression/package.json +1 -0
  734. package/web/standalone/apps/web/node_modules/next/dist/compiled/conf/index.js +15 -0
  735. package/web/standalone/apps/web/node_modules/next/dist/compiled/conf/package.json +1 -0
  736. package/web/standalone/apps/web/node_modules/next/dist/compiled/content-disposition/index.js +6 -0
  737. package/web/standalone/apps/web/node_modules/next/dist/compiled/content-disposition/package.json +1 -0
  738. package/web/standalone/apps/web/node_modules/next/dist/compiled/cookie/index.js +7 -0
  739. package/web/standalone/apps/web/node_modules/next/dist/compiled/cookie/package.json +1 -0
  740. package/web/standalone/apps/web/node_modules/next/dist/compiled/cross-spawn/index.js +1 -0
  741. package/web/standalone/apps/web/node_modules/next/dist/compiled/cross-spawn/package.json +1 -0
  742. package/web/standalone/apps/web/node_modules/next/dist/compiled/debug/index.js +1 -0
  743. package/web/standalone/apps/web/node_modules/next/dist/compiled/debug/package.json +1 -0
  744. package/web/standalone/apps/web/node_modules/next/dist/compiled/edge-runtime/index.js +1 -0
  745. package/web/standalone/apps/web/node_modules/next/dist/compiled/edge-runtime/package.json +1 -0
  746. package/web/standalone/apps/web/node_modules/next/dist/compiled/find-up/index.js +1 -0
  747. package/web/standalone/apps/web/node_modules/next/dist/compiled/find-up/package.json +1 -0
  748. package/web/standalone/apps/web/node_modules/next/dist/compiled/fresh/index.js +8 -0
  749. package/web/standalone/apps/web/node_modules/next/dist/compiled/fresh/package.json +1 -0
  750. package/web/standalone/apps/web/node_modules/next/dist/compiled/http-proxy/index.js +34 -0
  751. package/web/standalone/apps/web/node_modules/next/dist/compiled/http-proxy/package.json +1 -0
  752. package/web/standalone/apps/web/node_modules/next/dist/compiled/image-detector/detector.js +1 -0
  753. package/web/standalone/apps/web/node_modules/next/dist/compiled/image-size/index.js +1 -0
  754. package/web/standalone/apps/web/node_modules/next/dist/compiled/image-size/package.json +1 -0
  755. package/web/standalone/apps/web/node_modules/next/dist/compiled/ipaddr.js/ipaddr.js +1 -0
  756. package/web/standalone/apps/web/node_modules/next/dist/compiled/ipaddr.js/package.json +1 -0
  757. package/web/standalone/apps/web/node_modules/next/dist/compiled/is-animated/index.js +1 -0
  758. package/web/standalone/apps/web/node_modules/next/dist/compiled/is-animated/package.json +1 -0
  759. package/web/standalone/apps/web/node_modules/next/dist/compiled/is-docker/index.js +1 -0
  760. package/web/standalone/apps/web/node_modules/next/dist/compiled/is-docker/package.json +1 -0
  761. package/web/standalone/apps/web/node_modules/next/dist/compiled/is-wsl/index.js +1 -0
  762. package/web/standalone/apps/web/node_modules/next/dist/compiled/is-wsl/package.json +1 -0
  763. package/web/standalone/apps/web/node_modules/next/dist/compiled/jsonwebtoken/index.js +11 -0
  764. package/web/standalone/apps/web/node_modules/next/dist/compiled/jsonwebtoken/package.json +1 -0
  765. package/web/standalone/apps/web/node_modules/next/dist/compiled/nanoid/index.cjs +1 -0
  766. package/web/standalone/apps/web/node_modules/next/dist/compiled/nanoid/package.json +1 -0
  767. package/web/standalone/apps/web/node_modules/next/dist/compiled/next-server/app-page-turbo-experimental.runtime.prod.js +54 -0
  768. package/web/standalone/apps/web/node_modules/next/dist/compiled/next-server/app-page-turbo.runtime.prod.js +54 -0
  769. package/web/standalone/apps/web/node_modules/next/dist/compiled/next-server/app-route-turbo.runtime.prod.js +6 -0
  770. package/web/standalone/apps/web/node_modules/next/dist/compiled/next-server/pages-turbo.runtime.prod.js +20 -0
  771. package/web/standalone/apps/web/node_modules/next/dist/compiled/p-limit/index.js +1 -0
  772. package/web/standalone/apps/web/node_modules/next/dist/compiled/p-limit/package.json +1 -0
  773. package/web/standalone/apps/web/node_modules/next/dist/compiled/p-queue/index.js +1 -0
  774. package/web/standalone/apps/web/node_modules/next/dist/compiled/p-queue/package.json +1 -0
  775. package/web/standalone/apps/web/node_modules/next/dist/compiled/path-browserify/index.js +1 -0
  776. package/web/standalone/apps/web/node_modules/next/dist/compiled/path-browserify/package.json +1 -0
  777. package/web/standalone/apps/web/node_modules/next/dist/compiled/path-to-regexp/index.js +1 -0
  778. package/web/standalone/apps/web/node_modules/next/dist/compiled/path-to-regexp/package.json +1 -0
  779. package/web/standalone/apps/web/node_modules/next/dist/compiled/picomatch/index.js +1 -0
  780. package/web/standalone/apps/web/node_modules/next/dist/compiled/picomatch/package.json +1 -0
  781. package/web/standalone/apps/web/node_modules/next/dist/compiled/react-is/cjs/react-is.development.js +133 -0
  782. package/web/standalone/apps/web/node_modules/next/dist/compiled/react-is/cjs/react-is.production.js +130 -0
  783. package/web/standalone/apps/web/node_modules/next/dist/compiled/react-is/index.js +7 -0
  784. package/web/standalone/apps/web/node_modules/next/dist/compiled/react-is/package.json +26 -0
  785. package/web/standalone/apps/web/node_modules/next/dist/compiled/regenerator-runtime/package.json +19 -0
  786. package/web/standalone/apps/web/node_modules/next/dist/compiled/regenerator-runtime/runtime.js +729 -0
  787. package/web/standalone/apps/web/node_modules/next/dist/compiled/semver/index.js +1 -0
  788. package/web/standalone/apps/web/node_modules/next/dist/compiled/semver/package.json +1 -0
  789. package/web/standalone/apps/web/node_modules/next/dist/compiled/send/index.js +70 -0
  790. package/web/standalone/apps/web/node_modules/next/dist/compiled/send/package.json +1 -0
  791. package/web/standalone/apps/web/node_modules/next/dist/compiled/source-map/package.json +1 -0
  792. package/web/standalone/apps/web/node_modules/next/dist/compiled/source-map/source-map.js +1 -0
  793. package/web/standalone/apps/web/node_modules/next/dist/compiled/stacktrace-parser/package.json +1 -0
  794. package/web/standalone/apps/web/node_modules/next/dist/compiled/stacktrace-parser/stack-trace-parser.cjs.js +1 -0
  795. package/web/standalone/apps/web/node_modules/next/dist/compiled/string-hash/index.js +1 -0
  796. package/web/standalone/apps/web/node_modules/next/dist/compiled/string-hash/package.json +1 -0
  797. package/web/standalone/apps/web/node_modules/next/dist/compiled/strip-ansi/index.js +1 -0
  798. package/web/standalone/apps/web/node_modules/next/dist/compiled/strip-ansi/package.json +1 -0
  799. package/web/standalone/apps/web/node_modules/next/dist/compiled/superstruct/index.cjs +1 -0
  800. package/web/standalone/apps/web/node_modules/next/dist/compiled/superstruct/package.json +1 -0
  801. package/web/standalone/apps/web/node_modules/next/dist/compiled/tar/index.min.js +1 -0
  802. package/web/standalone/apps/web/node_modules/next/dist/compiled/tar/package.json +1 -0
  803. package/web/standalone/apps/web/node_modules/next/dist/compiled/text-table/index.js +1 -0
  804. package/web/standalone/apps/web/node_modules/next/dist/compiled/text-table/package.json +1 -0
  805. package/web/standalone/apps/web/node_modules/next/dist/compiled/watchpack/package.json +1 -0
  806. package/web/standalone/apps/web/node_modules/next/dist/compiled/watchpack/watchpack.js +1 -0
  807. package/web/standalone/apps/web/node_modules/next/dist/compiled/ws/index.js +1 -0
  808. package/web/standalone/apps/web/node_modules/next/dist/compiled/ws/package.json +1 -0
  809. package/web/standalone/apps/web/node_modules/next/dist/compiled/zod/index.cjs +1 -0
  810. package/web/standalone/apps/web/node_modules/next/dist/compiled/zod/package.json +1 -0
  811. package/web/standalone/apps/web/node_modules/next/dist/compiled/zod-validation-error/index.js +1 -0
  812. package/web/standalone/apps/web/node_modules/next/dist/compiled/zod-validation-error/package.json +1 -0
  813. package/web/standalone/apps/web/node_modules/next/dist/experimental/testmode/context.js +57 -0
  814. package/web/standalone/apps/web/node_modules/next/dist/experimental/testmode/fetch.js +142 -0
  815. package/web/standalone/apps/web/node_modules/next/dist/experimental/testmode/httpget.js +26 -0
  816. package/web/standalone/apps/web/node_modules/next/dist/experimental/testmode/server-edge.js +32 -0
  817. package/web/standalone/apps/web/node_modules/next/dist/experimental/testmode/server.js +62 -0
  818. package/web/standalone/apps/web/node_modules/next/dist/export/helpers/create-incremental-cache.js +61 -0
  819. package/web/standalone/apps/web/node_modules/next/dist/lib/batcher.js +65 -0
  820. package/web/standalone/apps/web/node_modules/next/dist/lib/build-custom-route.js +46 -0
  821. package/web/standalone/apps/web/node_modules/next/dist/lib/bundler.js +97 -0
  822. package/web/standalone/apps/web/node_modules/next/dist/lib/client-and-server-references.js +54 -0
  823. package/web/standalone/apps/web/node_modules/next/dist/lib/coalesced-function.js +39 -0
  824. package/web/standalone/apps/web/node_modules/next/dist/lib/compile-error.js +14 -0
  825. package/web/standalone/apps/web/node_modules/next/dist/lib/constants.js +420 -0
  826. package/web/standalone/apps/web/node_modules/next/dist/lib/create-client-router-filter.js +67 -0
  827. package/web/standalone/apps/web/node_modules/next/dist/lib/default-transpiled-packages.json +1 -0
  828. package/web/standalone/apps/web/node_modules/next/dist/lib/detached-promise.js +32 -0
  829. package/web/standalone/apps/web/node_modules/next/dist/lib/detect-typo.js +51 -0
  830. package/web/standalone/apps/web/node_modules/next/dist/lib/download-swc.js +183 -0
  831. package/web/standalone/apps/web/node_modules/next/dist/lib/error-telemetry-utils.js +42 -0
  832. package/web/standalone/apps/web/node_modules/next/dist/lib/fallback.js +100 -0
  833. package/web/standalone/apps/web/node_modules/next/dist/lib/fatal-error.js +14 -0
  834. package/web/standalone/apps/web/node_modules/next/dist/lib/file-exists.js +53 -0
  835. package/web/standalone/apps/web/node_modules/next/dist/lib/find-config.js +102 -0
  836. package/web/standalone/apps/web/node_modules/next/dist/lib/find-pages-dir.js +65 -0
  837. package/web/standalone/apps/web/node_modules/next/dist/lib/find-root.js +126 -0
  838. package/web/standalone/apps/web/node_modules/next/dist/lib/format-cli-help-output.js +84 -0
  839. package/web/standalone/apps/web/node_modules/next/dist/lib/format-dynamic-import-path.js +24 -0
  840. package/web/standalone/apps/web/node_modules/next/dist/lib/format-server-error.js +75 -0
  841. package/web/standalone/apps/web/node_modules/next/dist/lib/framework/boundary-components.js +62 -0
  842. package/web/standalone/apps/web/node_modules/next/dist/lib/framework/boundary-constants.js +36 -0
  843. package/web/standalone/apps/web/node_modules/next/dist/lib/fs/rename.js +87 -0
  844. package/web/standalone/apps/web/node_modules/next/dist/lib/fs/write-atomic.js +28 -0
  845. package/web/standalone/apps/web/node_modules/next/dist/lib/generate-interception-routes-rewrites.js +52 -0
  846. package/web/standalone/apps/web/node_modules/next/dist/lib/get-files-in-dir.js +33 -0
  847. package/web/standalone/apps/web/node_modules/next/dist/lib/get-network-host.js +44 -0
  848. package/web/standalone/apps/web/node_modules/next/dist/lib/get-package-version.js +118 -0
  849. package/web/standalone/apps/web/node_modules/next/dist/lib/get-project-dir.js +51 -0
  850. package/web/standalone/apps/web/node_modules/next/dist/lib/has-necessary-dependencies.js +49 -0
  851. package/web/standalone/apps/web/node_modules/next/dist/lib/helpers/get-cache-directory.js +66 -0
  852. package/web/standalone/apps/web/node_modules/next/dist/lib/helpers/get-npx-command.js +29 -0
  853. package/web/standalone/apps/web/node_modules/next/dist/lib/helpers/get-online.js +50 -0
  854. package/web/standalone/apps/web/node_modules/next/dist/lib/helpers/get-pkg-manager.js +63 -0
  855. package/web/standalone/apps/web/node_modules/next/dist/lib/helpers/get-registry.js +45 -0
  856. package/web/standalone/apps/web/node_modules/next/dist/lib/helpers/get-reserved-port.js +116 -0
  857. package/web/standalone/apps/web/node_modules/next/dist/lib/helpers/install.js +83 -0
  858. package/web/standalone/apps/web/node_modules/next/dist/lib/import-next-warning.js +50 -0
  859. package/web/standalone/apps/web/node_modules/next/dist/lib/inline-static-env.js +112 -0
  860. package/web/standalone/apps/web/node_modules/next/dist/lib/install-dependencies.js +40 -0
  861. package/web/standalone/apps/web/node_modules/next/dist/lib/interop-default.js +16 -0
  862. package/web/standalone/apps/web/node_modules/next/dist/lib/is-api-route.js +15 -0
  863. package/web/standalone/apps/web/node_modules/next/dist/lib/is-app-page-route.js +15 -0
  864. package/web/standalone/apps/web/node_modules/next/dist/lib/is-app-route-route.js +15 -0
  865. package/web/standalone/apps/web/node_modules/next/dist/lib/is-edge-runtime.js +16 -0
  866. package/web/standalone/apps/web/node_modules/next/dist/lib/is-error.js +78 -0
  867. package/web/standalone/apps/web/node_modules/next/dist/lib/is-interception-route-rewrite.js +18 -0
  868. package/web/standalone/apps/web/node_modules/next/dist/lib/is-internal-component.js +36 -0
  869. package/web/standalone/apps/web/node_modules/next/dist/lib/is-serializable-props.js +106 -0
  870. package/web/standalone/apps/web/node_modules/next/dist/lib/known-edge-safe-packages.json +1 -0
  871. package/web/standalone/apps/web/node_modules/next/dist/lib/load-custom-routes.js +594 -0
  872. package/web/standalone/apps/web/node_modules/next/dist/lib/memory/gc-observer.js +53 -0
  873. package/web/standalone/apps/web/node_modules/next/dist/lib/memory/shutdown.js +29 -0
  874. package/web/standalone/apps/web/node_modules/next/dist/lib/memory/startup.js +47 -0
  875. package/web/standalone/apps/web/node_modules/next/dist/lib/memory/trace.js +109 -0
  876. package/web/standalone/apps/web/node_modules/next/dist/lib/metadata/constants.js +40 -0
  877. package/web/standalone/apps/web/node_modules/next/dist/lib/metadata/default-metadata.js +82 -0
  878. package/web/standalone/apps/web/node_modules/next/dist/lib/metadata/generate/icon-mark.js +22 -0
  879. package/web/standalone/apps/web/node_modules/next/dist/lib/metadata/generate/utils.js +52 -0
  880. package/web/standalone/apps/web/node_modules/next/dist/lib/metadata/get-metadata-route.js +123 -0
  881. package/web/standalone/apps/web/node_modules/next/dist/lib/metadata/is-metadata-route.js +221 -0
  882. package/web/standalone/apps/web/node_modules/next/dist/lib/metadata/metadata-context.js +18 -0
  883. package/web/standalone/apps/web/node_modules/next/dist/lib/metadata/metadata.js +1686 -0
  884. package/web/standalone/apps/web/node_modules/next/dist/lib/metadata/resolve-metadata.js +884 -0
  885. package/web/standalone/apps/web/node_modules/next/dist/lib/metadata/resolvers/resolve-basics.js +232 -0
  886. package/web/standalone/apps/web/node_modules/next/dist/lib/metadata/resolvers/resolve-icons.js +56 -0
  887. package/web/standalone/apps/web/node_modules/next/dist/lib/metadata/resolvers/resolve-opengraph.js +199 -0
  888. package/web/standalone/apps/web/node_modules/next/dist/lib/metadata/resolvers/resolve-title.js +40 -0
  889. package/web/standalone/apps/web/node_modules/next/dist/lib/metadata/resolvers/resolve-url.js +135 -0
  890. package/web/standalone/apps/web/node_modules/next/dist/lib/metadata/types/alternative-urls-types.js +7 -0
  891. package/web/standalone/apps/web/node_modules/next/dist/lib/metadata/types/extra-types.js +9 -0
  892. package/web/standalone/apps/web/node_modules/next/dist/lib/metadata/types/icons.js +6 -0
  893. package/web/standalone/apps/web/node_modules/next/dist/lib/metadata/types/manifest-types.js +6 -0
  894. package/web/standalone/apps/web/node_modules/next/dist/lib/metadata/types/metadata-interface.js +18 -0
  895. package/web/standalone/apps/web/node_modules/next/dist/lib/metadata/types/metadata-types.js +10 -0
  896. package/web/standalone/apps/web/node_modules/next/dist/lib/metadata/types/opengraph-types.js +6 -0
  897. package/web/standalone/apps/web/node_modules/next/dist/lib/metadata/types/resolvers.js +6 -0
  898. package/web/standalone/apps/web/node_modules/next/dist/lib/metadata/types/twitter-types.js +7 -0
  899. package/web/standalone/apps/web/node_modules/next/dist/lib/mime-type.js +20 -0
  900. package/web/standalone/apps/web/node_modules/next/dist/lib/mkcert.js +204 -0
  901. package/web/standalone/apps/web/node_modules/next/dist/lib/multi-file-writer.js +75 -0
  902. package/web/standalone/apps/web/node_modules/next/dist/lib/needs-experimental-react.js +16 -0
  903. package/web/standalone/apps/web/node_modules/next/dist/lib/non-nullable.js +15 -0
  904. package/web/standalone/apps/web/node_modules/next/dist/lib/normalize-path.js +21 -0
  905. package/web/standalone/apps/web/node_modules/next/dist/lib/oxford-comma-list.js +15 -0
  906. package/web/standalone/apps/web/node_modules/next/dist/lib/page-types.js +18 -0
  907. package/web/standalone/apps/web/node_modules/next/dist/lib/patch-incorrect-lockfile.js +185 -0
  908. package/web/standalone/apps/web/node_modules/next/dist/lib/pick.js +19 -0
  909. package/web/standalone/apps/web/node_modules/next/dist/lib/picocolors.js +177 -0
  910. package/web/standalone/apps/web/node_modules/next/dist/lib/pretty-bytes.js +74 -0
  911. package/web/standalone/apps/web/node_modules/next/dist/lib/realpath.js +20 -0
  912. package/web/standalone/apps/web/node_modules/next/dist/lib/recursive-copy.js +76 -0
  913. package/web/standalone/apps/web/node_modules/next/dist/lib/recursive-delete.js +137 -0
  914. package/web/standalone/apps/web/node_modules/next/dist/lib/recursive-readdir.js +124 -0
  915. package/web/standalone/apps/web/node_modules/next/dist/lib/redirect-status.js +46 -0
  916. package/web/standalone/apps/web/node_modules/next/dist/lib/require-instrumentation-client.js +26 -0
  917. package/web/standalone/apps/web/node_modules/next/dist/lib/resolve-build-paths.js +154 -0
  918. package/web/standalone/apps/web/node_modules/next/dist/lib/resolve-from.js +65 -0
  919. package/web/standalone/apps/web/node_modules/next/dist/lib/route-pattern-normalizer.js +107 -0
  920. package/web/standalone/apps/web/node_modules/next/dist/lib/scheduler.js +64 -0
  921. package/web/standalone/apps/web/node_modules/next/dist/lib/semver-noop.js +18 -0
  922. package/web/standalone/apps/web/node_modules/next/dist/lib/server-external-packages.jsonc +103 -0
  923. package/web/standalone/apps/web/node_modules/next/dist/lib/setup-exception-listeners.js +11 -0
  924. package/web/standalone/apps/web/node_modules/next/dist/lib/static-env.js +92 -0
  925. package/web/standalone/apps/web/node_modules/next/dist/lib/try-to-parse-path.js +67 -0
  926. package/web/standalone/apps/web/node_modules/next/dist/lib/turbopack-warning.js +185 -0
  927. package/web/standalone/apps/web/node_modules/next/dist/lib/typescript/diagnosticFormatter.js +243 -0
  928. package/web/standalone/apps/web/node_modules/next/dist/lib/typescript/getTypeScriptConfiguration.js +73 -0
  929. package/web/standalone/apps/web/node_modules/next/dist/lib/typescript/getTypeScriptIntent.js +52 -0
  930. package/web/standalone/apps/web/node_modules/next/dist/lib/typescript/missingDependencyError.js +27 -0
  931. package/web/standalone/apps/web/node_modules/next/dist/lib/typescript/runTypeCheck.js +149 -0
  932. package/web/standalone/apps/web/node_modules/next/dist/lib/typescript/type-paths.js +51 -0
  933. package/web/standalone/apps/web/node_modules/next/dist/lib/typescript/writeAppTypeDeclarations.js +75 -0
  934. package/web/standalone/apps/web/node_modules/next/dist/lib/typescript/writeConfigurationDefaults.js +391 -0
  935. package/web/standalone/apps/web/node_modules/next/dist/lib/url.js +75 -0
  936. package/web/standalone/apps/web/node_modules/next/dist/lib/verify-partytown-setup.js +115 -0
  937. package/web/standalone/apps/web/node_modules/next/dist/lib/verify-root-layout.js +165 -0
  938. package/web/standalone/apps/web/node_modules/next/dist/lib/verify-typescript-setup.js +228 -0
  939. package/web/standalone/apps/web/node_modules/next/dist/lib/wait.js +19 -0
  940. package/web/standalone/apps/web/node_modules/next/dist/lib/with-promise-cache.js +24 -0
  941. package/web/standalone/apps/web/node_modules/next/dist/lib/worker.js +234 -0
  942. package/web/standalone/apps/web/node_modules/next/dist/server/ReactDOMServerPages.js +16 -0
  943. package/web/standalone/apps/web/node_modules/next/dist/server/accept-header.js +132 -0
  944. package/web/standalone/apps/web/node_modules/next/dist/server/after/after-context.js +140 -0
  945. package/web/standalone/apps/web/node_modules/next/dist/server/after/after.js +26 -0
  946. package/web/standalone/apps/web/node_modules/next/dist/server/after/awaiter.js +74 -0
  947. package/web/standalone/apps/web/node_modules/next/dist/server/after/builtin-request-context.js +38 -0
  948. package/web/standalone/apps/web/node_modules/next/dist/server/after/index.js +21 -0
  949. package/web/standalone/apps/web/node_modules/next/dist/server/after/run-with-after.js +35 -0
  950. package/web/standalone/apps/web/node_modules/next/dist/server/api-utils/get-cookie-parser.js +22 -0
  951. package/web/standalone/apps/web/node_modules/next/dist/server/api-utils/index.js +201 -0
  952. package/web/standalone/apps/web/node_modules/next/dist/server/api-utils/node/api-resolver.js +395 -0
  953. package/web/standalone/apps/web/node_modules/next/dist/server/api-utils/node/parse-body.js +79 -0
  954. package/web/standalone/apps/web/node_modules/next/dist/server/api-utils/node/try-get-preview-data.js +86 -0
  955. package/web/standalone/apps/web/node_modules/next/dist/server/api-utils/web.js +17 -0
  956. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/action-async-storage-instance.js +14 -0
  957. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/action-async-storage.external.js +13 -0
  958. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/action-handler.js +1020 -0
  959. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/after-task-async-storage-instance.js +14 -0
  960. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/after-task-async-storage.external.js +13 -0
  961. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/app-render-prerender-utils.js +167 -0
  962. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/app-render-render-utils.js +76 -0
  963. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/app-render-scheduling.js +188 -0
  964. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/app-render.js +4469 -0
  965. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/async-local-storage.js +76 -0
  966. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/cache-signal.js +181 -0
  967. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/collect-segment-data.js +600 -0
  968. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/console-async-storage-instance.js +14 -0
  969. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/console-async-storage.external.js +13 -0
  970. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/create-component-styles-and-scripts.js +33 -0
  971. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/create-component-tree.js +840 -0
  972. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/create-error-handler.js +189 -0
  973. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/create-flight-router-state-from-loader-tree.js +102 -0
  974. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/csrf-protection.js +86 -0
  975. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/debug-channel-server.js +30 -0
  976. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/debug-channel-server.web.js +71 -0
  977. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/dynamic-access-async-storage-instance.js +14 -0
  978. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/dynamic-access-async-storage.external.js +13 -0
  979. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/dynamic-rendering.js +1144 -0
  980. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/encryption-utils-server.js +114 -0
  981. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/encryption-utils.js +93 -0
  982. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/encryption.js +259 -0
  983. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/entry-base.js +256 -0
  984. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/flight-render-result.js +28 -0
  985. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/get-asset-query-string.js +29 -0
  986. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/get-css-inlined-link-tags.js +49 -0
  987. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/get-layer-assets.js +65 -0
  988. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/get-preloadable-fonts.js +39 -0
  989. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/get-script-nonce-from-header.js +44 -0
  990. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/get-short-dynamic-param-type.js +25 -0
  991. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/has-loading-component-in-tree.js +19 -0
  992. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/instant-validation/boundary-constants.js +13 -0
  993. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/instant-validation/boundary-impl.js +103 -0
  994. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/instant-validation/boundary-tracking.js +18 -0
  995. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/instant-validation/instant-config.js +181 -0
  996. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/instant-validation/instant-samples-client.js +128 -0
  997. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/instant-validation/instant-samples.js +432 -0
  998. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/instant-validation/instant-validation-error.js +33 -0
  999. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/instant-validation/instant-validation.js +713 -0
  1000. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/instant-validation/stream-utils.js +96 -0
  1001. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/interop-default.js +17 -0
  1002. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/make-get-server-inserted-html.js +92 -0
  1003. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/manifests-singleton.js +264 -0
  1004. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/metadata-insertion/create-server-inserted-metadata.js +28 -0
  1005. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/module-loading/track-dynamic-import.js +57 -0
  1006. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/module-loading/track-module-loading.external.js +32 -0
  1007. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/module-loading/track-module-loading.instance.js +66 -0
  1008. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/parse-and-validate-flight-router-state.js +49 -0
  1009. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/postponed-state.js +157 -0
  1010. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/prospective-render-utils.js +74 -0
  1011. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/react-large-shell-error.js +17 -0
  1012. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/react-server.node.js +39 -0
  1013. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/render-css-resource.js +52 -0
  1014. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/required-scripts.js +76 -0
  1015. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/rsc/postpone.js +18 -0
  1016. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/rsc/preloads.js +74 -0
  1017. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/rsc/taint.js +79 -0
  1018. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/segment-explorer-path.js +128 -0
  1019. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/server-inserted-html.js +77 -0
  1020. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/staged-rendering.js +343 -0
  1021. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/stale-time.js +111 -0
  1022. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/stream-ops.js +106 -0
  1023. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/stream-ops.web.js +163 -0
  1024. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/strip-flight-headers.js +18 -0
  1025. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/types.js +65 -0
  1026. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/use-flight-response.js +214 -0
  1027. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/vary-params.js +336 -0
  1028. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/walk-tree-with-flight-router-state.js +232 -0
  1029. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/work-async-storage-instance.js +14 -0
  1030. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/work-async-storage.external.js +13 -0
  1031. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/work-unit-async-storage-instance.js +14 -0
  1032. package/web/standalone/apps/web/node_modules/next/dist/server/app-render/work-unit-async-storage.external.js +280 -0
  1033. package/web/standalone/apps/web/node_modules/next/dist/server/async-storage/draft-mode-provider.js +62 -0
  1034. package/web/standalone/apps/web/node_modules/next/dist/server/async-storage/request-store.js +144 -0
  1035. package/web/standalone/apps/web/node_modules/next/dist/server/async-storage/with-store.js +6 -0
  1036. package/web/standalone/apps/web/node_modules/next/dist/server/async-storage/work-store.js +91 -0
  1037. package/web/standalone/apps/web/node_modules/next/dist/server/base-http/helpers.js +36 -0
  1038. package/web/standalone/apps/web/node_modules/next/dist/server/base-http/index.js +54 -0
  1039. package/web/standalone/apps/web/node_modules/next/dist/server/base-http/node.js +147 -0
  1040. package/web/standalone/apps/web/node_modules/next/dist/server/base-http/web.js +124 -0
  1041. package/web/standalone/apps/web/node_modules/next/dist/server/base-server.js +1874 -0
  1042. package/web/standalone/apps/web/node_modules/next/dist/server/body-streams.js +114 -0
  1043. package/web/standalone/apps/web/node_modules/next/dist/server/cache-dir.js +26 -0
  1044. package/web/standalone/apps/web/node_modules/next/dist/server/capsize-font-metrics.json +181516 -0
  1045. package/web/standalone/apps/web/node_modules/next/dist/server/ci-info.js +41 -0
  1046. package/web/standalone/apps/web/node_modules/next/dist/server/client-component-renderer-logger.js +70 -0
  1047. package/web/standalone/apps/web/node_modules/next/dist/server/config-schema.js +717 -0
  1048. package/web/standalone/apps/web/node_modules/next/dist/server/config-shared.js +369 -0
  1049. package/web/standalone/apps/web/node_modules/next/dist/server/config-utils.js +185 -0
  1050. package/web/standalone/apps/web/node_modules/next/dist/server/config.js +1545 -0
  1051. package/web/standalone/apps/web/node_modules/next/dist/server/create-deduped-by-callsite-server-error-logger.js +96 -0
  1052. package/web/standalone/apps/web/node_modules/next/dist/server/crypto-utils.js +70 -0
  1053. package/web/standalone/apps/web/node_modules/next/dist/server/dev/browser-logs/file-logger.js +186 -0
  1054. package/web/standalone/apps/web/node_modules/next/dist/server/dev/browser-logs/receive-logs.js +558 -0
  1055. package/web/standalone/apps/web/node_modules/next/dist/server/dev/browser-logs/source-map.js +222 -0
  1056. package/web/standalone/apps/web/node_modules/next/dist/server/dev/debug-channel.js +87 -0
  1057. package/web/standalone/apps/web/node_modules/next/dist/server/dev/dev-indicator-server-state.js +15 -0
  1058. package/web/standalone/apps/web/node_modules/next/dist/server/dev/get-source-map-from-file.js +100 -0
  1059. package/web/standalone/apps/web/node_modules/next/dist/server/dev/hot-middleware.js +274 -0
  1060. package/web/standalone/apps/web/node_modules/next/dist/server/dev/hot-reloader-rspack.js +171 -0
  1061. package/web/standalone/apps/web/node_modules/next/dist/server/dev/hot-reloader-shared-utils.js +56 -0
  1062. package/web/standalone/apps/web/node_modules/next/dist/server/dev/hot-reloader-turbopack.js +1478 -0
  1063. package/web/standalone/apps/web/node_modules/next/dist/server/dev/hot-reloader-types.js +58 -0
  1064. package/web/standalone/apps/web/node_modules/next/dist/server/dev/hot-reloader-webpack.js +1386 -0
  1065. package/web/standalone/apps/web/node_modules/next/dist/server/dev/log-requests.js +149 -0
  1066. package/web/standalone/apps/web/node_modules/next/dist/server/dev/messages.js +74 -0
  1067. package/web/standalone/apps/web/node_modules/next/dist/server/dev/middleware-turbopack.js +403 -0
  1068. package/web/standalone/apps/web/node_modules/next/dist/server/dev/middleware-webpack.js +483 -0
  1069. package/web/standalone/apps/web/node_modules/next/dist/server/dev/node-stack-frames.js +72 -0
  1070. package/web/standalone/apps/web/node_modules/next/dist/server/dev/on-demand-entry-handler.js +773 -0
  1071. package/web/standalone/apps/web/node_modules/next/dist/server/dev/parse-version-info.js +108 -0
  1072. package/web/standalone/apps/web/node_modules/next/dist/server/dev/require-cache.js +79 -0
  1073. package/web/standalone/apps/web/node_modules/next/dist/server/dev/serialized-errors.js +67 -0
  1074. package/web/standalone/apps/web/node_modules/next/dist/server/dev/server-action-logger.js +37 -0
  1075. package/web/standalone/apps/web/node_modules/next/dist/server/dev/static-paths-worker.js +104 -0
  1076. package/web/standalone/apps/web/node_modules/next/dist/server/dev/turbopack-utils.js +687 -0
  1077. package/web/standalone/apps/web/node_modules/next/dist/server/dynamic-rendering-utils.js +108 -0
  1078. package/web/standalone/apps/web/node_modules/next/dist/server/font-utils.js +43 -0
  1079. package/web/standalone/apps/web/node_modules/next/dist/server/get-app-route-from-entrypoint.js +30 -0
  1080. package/web/standalone/apps/web/node_modules/next/dist/server/get-page-files.js +23 -0
  1081. package/web/standalone/apps/web/node_modules/next/dist/server/get-route-from-entrypoint.js +35 -0
  1082. package/web/standalone/apps/web/node_modules/next/dist/server/htmlescape.js +37 -0
  1083. package/web/standalone/apps/web/node_modules/next/dist/server/image-optimizer.js +1220 -0
  1084. package/web/standalone/apps/web/node_modules/next/dist/server/instrumentation/types.js +6 -0
  1085. package/web/standalone/apps/web/node_modules/next/dist/server/instrumentation/utils.js +21 -0
  1086. package/web/standalone/apps/web/node_modules/next/dist/server/internal-utils.js +39 -0
  1087. package/web/standalone/apps/web/node_modules/next/dist/server/is-private-ip.js +36 -0
  1088. package/web/standalone/apps/web/node_modules/next/dist/server/lib/app-dir-module.js +59 -0
  1089. package/web/standalone/apps/web/node_modules/next/dist/server/lib/app-info-log.js +132 -0
  1090. package/web/standalone/apps/web/node_modules/next/dist/server/lib/async-callback-set.js +29 -0
  1091. package/web/standalone/apps/web/node_modules/next/dist/server/lib/cache-control.js +22 -0
  1092. package/web/standalone/apps/web/node_modules/next/dist/server/lib/cache-handlers/default.external.js +18 -0
  1093. package/web/standalone/apps/web/node_modules/next/dist/server/lib/cache-handlers/default.js +160 -0
  1094. package/web/standalone/apps/web/node_modules/next/dist/server/lib/cache-handlers/types.js +8 -0
  1095. package/web/standalone/apps/web/node_modules/next/dist/server/lib/chrome-devtools-workspace.js +116 -0
  1096. package/web/standalone/apps/web/node_modules/next/dist/server/lib/clone-response.js +77 -0
  1097. package/web/standalone/apps/web/node_modules/next/dist/server/lib/cpu-profile.js +59 -0
  1098. package/web/standalone/apps/web/node_modules/next/dist/server/lib/decode-query-path-parameter.js +26 -0
  1099. package/web/standalone/apps/web/node_modules/next/dist/server/lib/dedupe-fetch.js +163 -0
  1100. package/web/standalone/apps/web/node_modules/next/dist/server/lib/dev-bundler-service.js +95 -0
  1101. package/web/standalone/apps/web/node_modules/next/dist/server/lib/disk-lru-cache.external.js +57 -0
  1102. package/web/standalone/apps/web/node_modules/next/dist/server/lib/etag.js +56 -0
  1103. package/web/standalone/apps/web/node_modules/next/dist/server/lib/experimental/create-env-definitions.js +48 -0
  1104. package/web/standalone/apps/web/node_modules/next/dist/server/lib/experimental/ppr.js +47 -0
  1105. package/web/standalone/apps/web/node_modules/next/dist/server/lib/find-page-file.js +147 -0
  1106. package/web/standalone/apps/web/node_modules/next/dist/server/lib/fix-mojibake.js +25 -0
  1107. package/web/standalone/apps/web/node_modules/next/dist/server/lib/format-hostname.js +16 -0
  1108. package/web/standalone/apps/web/node_modules/next/dist/server/lib/i18n-provider.js +129 -0
  1109. package/web/standalone/apps/web/node_modules/next/dist/server/lib/implicit-tags.js +77 -0
  1110. package/web/standalone/apps/web/node_modules/next/dist/server/lib/incremental-cache/file-system-cache.js +335 -0
  1111. package/web/standalone/apps/web/node_modules/next/dist/server/lib/incremental-cache/index.js +501 -0
  1112. package/web/standalone/apps/web/node_modules/next/dist/server/lib/incremental-cache/memory-cache.external.js +57 -0
  1113. package/web/standalone/apps/web/node_modules/next/dist/server/lib/incremental-cache/shared-cache-controls.external.js +73 -0
  1114. package/web/standalone/apps/web/node_modules/next/dist/server/lib/incremental-cache/tags-manifest.external.js +55 -0
  1115. package/web/standalone/apps/web/node_modules/next/dist/server/lib/install-code-frame.js +22 -0
  1116. package/web/standalone/apps/web/node_modules/next/dist/server/lib/is-ipv6.js +41 -0
  1117. package/web/standalone/apps/web/node_modules/next/dist/server/lib/lazy-result.js +46 -0
  1118. package/web/standalone/apps/web/node_modules/next/dist/server/lib/lru-cache.js +191 -0
  1119. package/web/standalone/apps/web/node_modules/next/dist/server/lib/match-next-data-pathname.js +18 -0
  1120. package/web/standalone/apps/web/node_modules/next/dist/server/lib/mock-request.js +416 -0
  1121. package/web/standalone/apps/web/node_modules/next/dist/server/lib/module-loader/module-loader.js +8 -0
  1122. package/web/standalone/apps/web/node_modules/next/dist/server/lib/module-loader/node-module-loader.js +25 -0
  1123. package/web/standalone/apps/web/node_modules/next/dist/server/lib/module-loader/route-module-loader.js +26 -0
  1124. package/web/standalone/apps/web/node_modules/next/dist/server/lib/node-fs-methods.js +28 -0
  1125. package/web/standalone/apps/web/node_modules/next/dist/server/lib/parse-stack.js +46 -0
  1126. package/web/standalone/apps/web/node_modules/next/dist/server/lib/patch-fetch.js +978 -0
  1127. package/web/standalone/apps/web/node_modules/next/dist/server/lib/patch-set-header.js +38 -0
  1128. package/web/standalone/apps/web/node_modules/next/dist/server/lib/postponed-request-body.js +64 -0
  1129. package/web/standalone/apps/web/node_modules/next/dist/server/lib/render-server.js +155 -0
  1130. package/web/standalone/apps/web/node_modules/next/dist/server/lib/router-server.js +683 -0
  1131. package/web/standalone/apps/web/node_modules/next/dist/server/lib/router-utils/block-cross-site-dev.js +110 -0
  1132. package/web/standalone/apps/web/node_modules/next/dist/server/lib/router-utils/build-data-route.js +48 -0
  1133. package/web/standalone/apps/web/node_modules/next/dist/server/lib/router-utils/build-prefetch-segment-data-route.js +50 -0
  1134. package/web/standalone/apps/web/node_modules/next/dist/server/lib/router-utils/cache-life-type-utils.js +211 -0
  1135. package/web/standalone/apps/web/node_modules/next/dist/server/lib/router-utils/decode-path-params.js +42 -0
  1136. package/web/standalone/apps/web/node_modules/next/dist/server/lib/router-utils/filesystem.js +591 -0
  1137. package/web/standalone/apps/web/node_modules/next/dist/server/lib/router-utils/instrumentation-globals.external.js +89 -0
  1138. package/web/standalone/apps/web/node_modules/next/dist/server/lib/router-utils/instrumentation-node-extensions.js +96 -0
  1139. package/web/standalone/apps/web/node_modules/next/dist/server/lib/router-utils/is-postpone.js +16 -0
  1140. package/web/standalone/apps/web/node_modules/next/dist/server/lib/router-utils/proxy-request.js +118 -0
  1141. package/web/standalone/apps/web/node_modules/next/dist/server/lib/router-utils/resolve-routes.js +629 -0
  1142. package/web/standalone/apps/web/node_modules/next/dist/server/lib/router-utils/route-types-utils.js +286 -0
  1143. package/web/standalone/apps/web/node_modules/next/dist/server/lib/router-utils/router-server-context.js +26 -0
  1144. package/web/standalone/apps/web/node_modules/next/dist/server/lib/router-utils/typegen.js +858 -0
  1145. package/web/standalone/apps/web/node_modules/next/dist/server/lib/router-utils/types.js +6 -0
  1146. package/web/standalone/apps/web/node_modules/next/dist/server/lib/server-action-request-meta.js +53 -0
  1147. package/web/standalone/apps/web/node_modules/next/dist/server/lib/server-ipc/utils.js +81 -0
  1148. package/web/standalone/apps/web/node_modules/next/dist/server/lib/source-maps.js +196 -0
  1149. package/web/standalone/apps/web/node_modules/next/dist/server/lib/start-server.js +494 -0
  1150. package/web/standalone/apps/web/node_modules/next/dist/server/lib/streaming-metadata.js +38 -0
  1151. package/web/standalone/apps/web/node_modules/next/dist/server/lib/to-route.js +37 -0
  1152. package/web/standalone/apps/web/node_modules/next/dist/server/lib/trace/constants.js +203 -0
  1153. package/web/standalone/apps/web/node_modules/next/dist/server/lib/trace/tracer.js +280 -0
  1154. package/web/standalone/apps/web/node_modules/next/dist/server/lib/trace/utils.js +16 -0
  1155. package/web/standalone/apps/web/node_modules/next/dist/server/lib/types.js +6 -0
  1156. package/web/standalone/apps/web/node_modules/next/dist/server/lib/utils.js +278 -0
  1157. package/web/standalone/apps/web/node_modules/next/dist/server/lib/worker-utils.js +36 -0
  1158. package/web/standalone/apps/web/node_modules/next/dist/server/load-components.js +179 -0
  1159. package/web/standalone/apps/web/node_modules/next/dist/server/load-default-error-components.js +41 -0
  1160. package/web/standalone/apps/web/node_modules/next/dist/server/load-manifest.external.js +117 -0
  1161. package/web/standalone/apps/web/node_modules/next/dist/server/match-bundle.js +25 -0
  1162. package/web/standalone/apps/web/node_modules/next/dist/server/mcp/get-mcp-middleware.js +49 -0
  1163. package/web/standalone/apps/web/node_modules/next/dist/server/mcp/get-or-create-mcp-server.js +41 -0
  1164. package/web/standalone/apps/web/node_modules/next/dist/server/mcp/mcp-telemetry-tracker.js +82 -0
  1165. package/web/standalone/apps/web/node_modules/next/dist/server/mcp/tools/get-errors.js +114 -0
  1166. package/web/standalone/apps/web/node_modules/next/dist/server/mcp/tools/get-logs.js +67 -0
  1167. package/web/standalone/apps/web/node_modules/next/dist/server/mcp/tools/get-page-metadata.js +188 -0
  1168. package/web/standalone/apps/web/node_modules/next/dist/server/mcp/tools/get-project-metadata.js +59 -0
  1169. package/web/standalone/apps/web/node_modules/next/dist/server/mcp/tools/get-routes.js +136 -0
  1170. package/web/standalone/apps/web/node_modules/next/dist/server/mcp/tools/get-server-action-by-id.js +121 -0
  1171. package/web/standalone/apps/web/node_modules/next/dist/server/mcp/tools/next-instance-error-state.js +31 -0
  1172. package/web/standalone/apps/web/node_modules/next/dist/server/mcp/tools/utils/browser-communication.js +90 -0
  1173. package/web/standalone/apps/web/node_modules/next/dist/server/mcp/tools/utils/format-errors.js +137 -0
  1174. package/web/standalone/apps/web/node_modules/next/dist/server/next-server.js +1429 -0
  1175. package/web/standalone/apps/web/node_modules/next/dist/server/next-typescript.js +13 -0
  1176. package/web/standalone/apps/web/node_modules/next/dist/server/next.js +455 -0
  1177. package/web/standalone/apps/web/node_modules/next/dist/server/node-environment-baseline.js +25 -0
  1178. package/web/standalone/apps/web/node_modules/next/dist/server/node-environment-extensions/console-dim.external.js +301 -0
  1179. package/web/standalone/apps/web/node_modules/next/dist/server/node-environment-extensions/console-exit.js +49 -0
  1180. package/web/standalone/apps/web/node_modules/next/dist/server/node-environment-extensions/console-file.js +56 -0
  1181. package/web/standalone/apps/web/node_modules/next/dist/server/node-environment-extensions/date.js +52 -0
  1182. package/web/standalone/apps/web/node_modules/next/dist/server/node-environment-extensions/error-inspect.js +8 -0
  1183. package/web/standalone/apps/web/node_modules/next/dist/server/node-environment-extensions/fast-set-immediate.external.js +577 -0
  1184. package/web/standalone/apps/web/node_modules/next/dist/server/node-environment-extensions/global-behaviors.js +33 -0
  1185. package/web/standalone/apps/web/node_modules/next/dist/server/node-environment-extensions/io-utils.js +195 -0
  1186. package/web/standalone/apps/web/node_modules/next/dist/server/node-environment-extensions/node-crypto.js +103 -0
  1187. package/web/standalone/apps/web/node_modules/next/dist/server/node-environment-extensions/process-error-handlers.js +91 -0
  1188. package/web/standalone/apps/web/node_modules/next/dist/server/node-environment-extensions/random.js +28 -0
  1189. package/web/standalone/apps/web/node_modules/next/dist/server/node-environment-extensions/unhandled-rejection.external.js +508 -0
  1190. package/web/standalone/apps/web/node_modules/next/dist/server/node-environment-extensions/web-crypto.js +45 -0
  1191. package/web/standalone/apps/web/node_modules/next/dist/server/node-environment.js +19 -0
  1192. package/web/standalone/apps/web/node_modules/next/dist/server/node-polyfill-crypto.js +21 -0
  1193. package/web/standalone/apps/web/node_modules/next/dist/server/normalizers/absolute-filename-normalizer.js +33 -0
  1194. package/web/standalone/apps/web/node_modules/next/dist/server/normalizers/built/app/app-bundle-path-normalizer.js +54 -0
  1195. package/web/standalone/apps/web/node_modules/next/dist/server/normalizers/built/app/app-filename-normalizer.js +22 -0
  1196. package/web/standalone/apps/web/node_modules/next/dist/server/normalizers/built/app/app-page-normalizer.js +40 -0
  1197. package/web/standalone/apps/web/node_modules/next/dist/server/normalizers/built/app/app-pathname-normalizer.js +55 -0
  1198. package/web/standalone/apps/web/node_modules/next/dist/server/normalizers/built/app/index.js +42 -0
  1199. package/web/standalone/apps/web/node_modules/next/dist/server/normalizers/built/pages/index.js +44 -0
  1200. package/web/standalone/apps/web/node_modules/next/dist/server/normalizers/built/pages/pages-bundle-path-normalizer.js +55 -0
  1201. package/web/standalone/apps/web/node_modules/next/dist/server/normalizers/built/pages/pages-filename-normalizer.js +22 -0
  1202. package/web/standalone/apps/web/node_modules/next/dist/server/normalizers/built/pages/pages-page-normalizer.js +19 -0
  1203. package/web/standalone/apps/web/node_modules/next/dist/server/normalizers/built/pages/pages-pathname-normalizer.js +19 -0
  1204. package/web/standalone/apps/web/node_modules/next/dist/server/normalizers/locale-route-normalizer.js +26 -0
  1205. package/web/standalone/apps/web/node_modules/next/dist/server/normalizers/normalizer.js +6 -0
  1206. package/web/standalone/apps/web/node_modules/next/dist/server/normalizers/normalizers.js +23 -0
  1207. package/web/standalone/apps/web/node_modules/next/dist/server/normalizers/prefixing-normalizer.js +26 -0
  1208. package/web/standalone/apps/web/node_modules/next/dist/server/normalizers/request/base-path.js +25 -0
  1209. package/web/standalone/apps/web/node_modules/next/dist/server/normalizers/request/next-data.js +38 -0
  1210. package/web/standalone/apps/web/node_modules/next/dist/server/normalizers/request/pathname-normalizer.js +6 -0
  1211. package/web/standalone/apps/web/node_modules/next/dist/server/normalizers/request/prefix.js +39 -0
  1212. package/web/standalone/apps/web/node_modules/next/dist/server/normalizers/request/rsc.js +19 -0
  1213. package/web/standalone/apps/web/node_modules/next/dist/server/normalizers/request/segment-prefix-rsc.js +33 -0
  1214. package/web/standalone/apps/web/node_modules/next/dist/server/normalizers/request/suffix.js +27 -0
  1215. package/web/standalone/apps/web/node_modules/next/dist/server/normalizers/underscore-normalizer.js +17 -0
  1216. package/web/standalone/apps/web/node_modules/next/dist/server/normalizers/wrap-normalizer-fn.js +17 -0
  1217. package/web/standalone/apps/web/node_modules/next/dist/server/og/image-response.js +53 -0
  1218. package/web/standalone/apps/web/node_modules/next/dist/server/patch-error-inspect.js +453 -0
  1219. package/web/standalone/apps/web/node_modules/next/dist/server/pipe-readable.js +140 -0
  1220. package/web/standalone/apps/web/node_modules/next/dist/server/post-process.js +39 -0
  1221. package/web/standalone/apps/web/node_modules/next/dist/server/render-result.js +204 -0
  1222. package/web/standalone/apps/web/node_modules/next/dist/server/render.js +1140 -0
  1223. package/web/standalone/apps/web/node_modules/next/dist/server/request/connection.js +133 -0
  1224. package/web/standalone/apps/web/node_modules/next/dist/server/request/cookies.js +235 -0
  1225. package/web/standalone/apps/web/node_modules/next/dist/server/request/draft-mode.js +230 -0
  1226. package/web/standalone/apps/web/node_modules/next/dist/server/request/fallback-params.js +69 -0
  1227. package/web/standalone/apps/web/node_modules/next/dist/server/request/headers.js +229 -0
  1228. package/web/standalone/apps/web/node_modules/next/dist/server/request/params.js +527 -0
  1229. package/web/standalone/apps/web/node_modules/next/dist/server/request/pathname.js +119 -0
  1230. package/web/standalone/apps/web/node_modules/next/dist/server/request/root-params.js +194 -0
  1231. package/web/standalone/apps/web/node_modules/next/dist/server/request/search-params.js +526 -0
  1232. package/web/standalone/apps/web/node_modules/next/dist/server/request/utils.js +51 -0
  1233. package/web/standalone/apps/web/node_modules/next/dist/server/request-meta.js +55 -0
  1234. package/web/standalone/apps/web/node_modules/next/dist/server/require-hook.js +82 -0
  1235. package/web/standalone/apps/web/node_modules/next/dist/server/require.js +109 -0
  1236. package/web/standalone/apps/web/node_modules/next/dist/server/response-cache/index.js +311 -0
  1237. package/web/standalone/apps/web/node_modules/next/dist/server/response-cache/types.js +41 -0
  1238. package/web/standalone/apps/web/node_modules/next/dist/server/response-cache/utils.js +104 -0
  1239. package/web/standalone/apps/web/node_modules/next/dist/server/response-cache/web.js +101 -0
  1240. package/web/standalone/apps/web/node_modules/next/dist/server/resume-data-cache/cache-store.js +96 -0
  1241. package/web/standalone/apps/web/node_modules/next/dist/server/resume-data-cache/resume-data-cache.js +124 -0
  1242. package/web/standalone/apps/web/node_modules/next/dist/server/revalidation-utils.js +157 -0
  1243. package/web/standalone/apps/web/node_modules/next/dist/server/route-definitions/app-page-route-definition.js +16 -0
  1244. package/web/standalone/apps/web/node_modules/next/dist/server/route-definitions/app-route-route-definition.js +6 -0
  1245. package/web/standalone/apps/web/node_modules/next/dist/server/route-definitions/locale-route-definition.js +6 -0
  1246. package/web/standalone/apps/web/node_modules/next/dist/server/route-definitions/pages-api-route-definition.js +6 -0
  1247. package/web/standalone/apps/web/node_modules/next/dist/server/route-definitions/pages-route-definition.js +6 -0
  1248. package/web/standalone/apps/web/node_modules/next/dist/server/route-definitions/route-definition.js +6 -0
  1249. package/web/standalone/apps/web/node_modules/next/dist/server/route-kind.js +32 -0
  1250. package/web/standalone/apps/web/node_modules/next/dist/server/route-matcher-managers/default-route-matcher-manager.js +239 -0
  1251. package/web/standalone/apps/web/node_modules/next/dist/server/route-matcher-managers/dev-route-matcher-manager.js +120 -0
  1252. package/web/standalone/apps/web/node_modules/next/dist/server/route-matcher-managers/route-matcher-manager.js +6 -0
  1253. package/web/standalone/apps/web/node_modules/next/dist/server/route-matcher-providers/app-page-route-matcher-provider.js +55 -0
  1254. package/web/standalone/apps/web/node_modules/next/dist/server/route-matcher-providers/app-route-route-matcher-provider.js +43 -0
  1255. package/web/standalone/apps/web/node_modules/next/dist/server/route-matcher-providers/dev/dev-app-page-route-matcher-provider.js +91 -0
  1256. package/web/standalone/apps/web/node_modules/next/dist/server/route-matcher-providers/dev/dev-app-route-route-matcher-provider.js +112 -0
  1257. package/web/standalone/apps/web/node_modules/next/dist/server/route-matcher-providers/dev/dev-pages-api-route-matcher-provider.js +77 -0
  1258. package/web/standalone/apps/web/node_modules/next/dist/server/route-matcher-providers/dev/dev-pages-route-matcher-provider.js +77 -0
  1259. package/web/standalone/apps/web/node_modules/next/dist/server/route-matcher-providers/dev/file-cache-route-matcher-provider.js +28 -0
  1260. package/web/standalone/apps/web/node_modules/next/dist/server/route-matcher-providers/dev/helpers/file-reader/batched-file-reader.js +106 -0
  1261. package/web/standalone/apps/web/node_modules/next/dist/server/route-matcher-providers/dev/helpers/file-reader/default-file-reader.js +42 -0
  1262. package/web/standalone/apps/web/node_modules/next/dist/server/route-matcher-providers/dev/helpers/file-reader/file-reader.js +6 -0
  1263. package/web/standalone/apps/web/node_modules/next/dist/server/route-matcher-providers/helpers/cached-route-matcher-provider.js +30 -0
  1264. package/web/standalone/apps/web/node_modules/next/dist/server/route-matcher-providers/helpers/manifest-loaders/manifest-loader.js +6 -0
  1265. package/web/standalone/apps/web/node_modules/next/dist/server/route-matcher-providers/helpers/manifest-loaders/node-manifest-loader.js +34 -0
  1266. package/web/standalone/apps/web/node_modules/next/dist/server/route-matcher-providers/helpers/manifest-loaders/server-manifest-loader.js +20 -0
  1267. package/web/standalone/apps/web/node_modules/next/dist/server/route-matcher-providers/manifest-route-matcher-provider.js +21 -0
  1268. package/web/standalone/apps/web/node_modules/next/dist/server/route-matcher-providers/pages-api-route-matcher-provider.js +55 -0
  1269. package/web/standalone/apps/web/node_modules/next/dist/server/route-matcher-providers/pages-route-matcher-provider.js +64 -0
  1270. package/web/standalone/apps/web/node_modules/next/dist/server/route-matcher-providers/route-matcher-provider.js +6 -0
  1271. package/web/standalone/apps/web/node_modules/next/dist/server/route-matchers/app-page-route-matcher.js +18 -0
  1272. package/web/standalone/apps/web/node_modules/next/dist/server/route-matchers/app-route-route-matcher.js +15 -0
  1273. package/web/standalone/apps/web/node_modules/next/dist/server/route-matchers/locale-route-matcher.js +68 -0
  1274. package/web/standalone/apps/web/node_modules/next/dist/server/route-matchers/pages-api-route-matcher.js +30 -0
  1275. package/web/standalone/apps/web/node_modules/next/dist/server/route-matchers/pages-route-matcher.js +30 -0
  1276. package/web/standalone/apps/web/node_modules/next/dist/server/route-matchers/route-matcher.js +54 -0
  1277. package/web/standalone/apps/web/node_modules/next/dist/server/route-matches/app-page-route-match.js +6 -0
  1278. package/web/standalone/apps/web/node_modules/next/dist/server/route-matches/app-route-route-match.js +6 -0
  1279. package/web/standalone/apps/web/node_modules/next/dist/server/route-matches/locale-route-match.js +6 -0
  1280. package/web/standalone/apps/web/node_modules/next/dist/server/route-matches/pages-api-route-match.js +16 -0
  1281. package/web/standalone/apps/web/node_modules/next/dist/server/route-matches/pages-route-match.js +6 -0
  1282. package/web/standalone/apps/web/node_modules/next/dist/server/route-matches/route-match.js +6 -0
  1283. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/helpers/prerender-manifest-matcher.js +51 -0
  1284. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/module.compiled.js +36 -0
  1285. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/module.js +162 -0
  1286. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/module.render.js +24 -0
  1287. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/normalize-request-url.js +25 -0
  1288. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/contexts/app-router-context.js +4 -0
  1289. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/contexts/entrypoints.js +87 -0
  1290. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/contexts/head-manager-context.js +4 -0
  1291. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/contexts/hooks-client-context.js +4 -0
  1292. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/contexts/image-config-context.js +4 -0
  1293. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/contexts/router-context.js +4 -0
  1294. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/contexts/server-inserted-html.js +4 -0
  1295. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/entrypoints.js +140 -0
  1296. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-compiler-runtime.js +4 -0
  1297. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-dom.js +4 -0
  1298. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-jsx-dev-runtime.js +4 -0
  1299. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-jsx-runtime.js +4 -0
  1300. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-server-dom-turbopack-server.js +4 -0
  1301. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-server-dom-turbopack-static.js +4 -0
  1302. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-server-dom-webpack-server.js +4 -0
  1303. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react-server-dom-webpack-static.js +4 -0
  1304. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/rsc/react.js +4 -0
  1305. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/entrypoints.js +125 -0
  1306. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-compiler-runtime.js +4 -0
  1307. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-dom-server.js +4 -0
  1308. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-dom.js +4 -0
  1309. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-dev-runtime.js +4 -0
  1310. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-jsx-runtime.js +4 -0
  1311. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-server-dom-turbopack-client.js +4 -0
  1312. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react-server-dom-webpack-client.js +4 -0
  1313. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-page/vendored/ssr/react.js +4 -0
  1314. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-route/helpers/auto-implement-methods.js +85 -0
  1315. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-route/helpers/clean-url.js +24 -0
  1316. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-route/helpers/get-pathname-from-absolute-path.js +29 -0
  1317. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-route/helpers/is-static-gen-enabled.js +15 -0
  1318. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-route/helpers/parsed-url-query-to-params.js +20 -0
  1319. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-route/module.compiled.js +36 -0
  1320. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-route/module.js +899 -0
  1321. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/app-route/shared-modules.js +56 -0
  1322. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/checks.js +45 -0
  1323. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/pages/builtin/_error.js +100 -0
  1324. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/pages/module.compiled.js +20 -0
  1325. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/pages/module.js +92 -0
  1326. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/pages/module.render.js +24 -0
  1327. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/pages/pages-handler.js +545 -0
  1328. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/pages/vendored/contexts/app-router-context.js +4 -0
  1329. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/pages/vendored/contexts/entrypoints.js +102 -0
  1330. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/pages/vendored/contexts/head-manager-context.js +4 -0
  1331. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/pages/vendored/contexts/hooks-client-context.js +4 -0
  1332. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/pages/vendored/contexts/html-context.js +4 -0
  1333. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/pages/vendored/contexts/image-config-context.js +4 -0
  1334. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/pages/vendored/contexts/loadable-context.js +4 -0
  1335. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/pages/vendored/contexts/loadable.js +4 -0
  1336. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/pages/vendored/contexts/router-context.js +4 -0
  1337. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/pages/vendored/contexts/server-inserted-html.js +4 -0
  1338. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/pages-api/module.compiled.js +20 -0
  1339. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/pages-api/module.js +58 -0
  1340. package/web/standalone/apps/web/node_modules/next/dist/server/route-modules/route-module.js +650 -0
  1341. package/web/standalone/apps/web/node_modules/next/dist/server/runtime-reacts.external.js +46 -0
  1342. package/web/standalone/apps/web/node_modules/next/dist/server/send-payload.js +88 -0
  1343. package/web/standalone/apps/web/node_modules/next/dist/server/send-response.js +70 -0
  1344. package/web/standalone/apps/web/node_modules/next/dist/server/serve-static.js +66 -0
  1345. package/web/standalone/apps/web/node_modules/next/dist/server/server-route-utils.js +30 -0
  1346. package/web/standalone/apps/web/node_modules/next/dist/server/server-utils.js +323 -0
  1347. package/web/standalone/apps/web/node_modules/next/dist/server/setup-http-agent-env.js +31 -0
  1348. package/web/standalone/apps/web/node_modules/next/dist/server/stream-utils/encoded-tags.js +122 -0
  1349. package/web/standalone/apps/web/node_modules/next/dist/server/stream-utils/node-web-streams-helper.js +918 -0
  1350. package/web/standalone/apps/web/node_modules/next/dist/server/stream-utils/uint8array-helpers.js +74 -0
  1351. package/web/standalone/apps/web/node_modules/next/dist/server/typescript/constant.js +98 -0
  1352. package/web/standalone/apps/web/node_modules/next/dist/server/typescript/index.js +199 -0
  1353. package/web/standalone/apps/web/node_modules/next/dist/server/typescript/rules/client-boundary.js +97 -0
  1354. package/web/standalone/apps/web/node_modules/next/dist/server/typescript/rules/config.js +512 -0
  1355. package/web/standalone/apps/web/node_modules/next/dist/server/typescript/rules/entry.js +149 -0
  1356. package/web/standalone/apps/web/node_modules/next/dist/server/typescript/rules/error.js +38 -0
  1357. package/web/standalone/apps/web/node_modules/next/dist/server/typescript/rules/metadata.js +234 -0
  1358. package/web/standalone/apps/web/node_modules/next/dist/server/typescript/rules/server-boundary.js +115 -0
  1359. package/web/standalone/apps/web/node_modules/next/dist/server/typescript/rules/server.js +79 -0
  1360. package/web/standalone/apps/web/node_modules/next/dist/server/typescript/utils.js +212 -0
  1361. package/web/standalone/apps/web/node_modules/next/dist/server/use-cache/cache-life.js +163 -0
  1362. package/web/standalone/apps/web/node_modules/next/dist/server/use-cache/cache-tag.js +52 -0
  1363. package/web/standalone/apps/web/node_modules/next/dist/server/use-cache/constants.js +28 -0
  1364. package/web/standalone/apps/web/node_modules/next/dist/server/use-cache/handlers.js +121 -0
  1365. package/web/standalone/apps/web/node_modules/next/dist/server/use-cache/use-cache-errors.js +36 -0
  1366. package/web/standalone/apps/web/node_modules/next/dist/server/use-cache/use-cache-wrapper.js +1588 -0
  1367. package/web/standalone/apps/web/node_modules/next/dist/server/utils.js +73 -0
  1368. package/web/standalone/apps/web/node_modules/next/dist/server/web/adapter.js +392 -0
  1369. package/web/standalone/apps/web/node_modules/next/dist/server/web/edge-route-module-wrapper.js +123 -0
  1370. package/web/standalone/apps/web/node_modules/next/dist/server/web/error.js +54 -0
  1371. package/web/standalone/apps/web/node_modules/next/dist/server/web/exports/index.js +56 -0
  1372. package/web/standalone/apps/web/node_modules/next/dist/server/web/get-edge-preview-props.js +23 -0
  1373. package/web/standalone/apps/web/node_modules/next/dist/server/web/globals.js +128 -0
  1374. package/web/standalone/apps/web/node_modules/next/dist/server/web/http.js +39 -0
  1375. package/web/standalone/apps/web/node_modules/next/dist/server/web/internal-edge-wait-until.js +64 -0
  1376. package/web/standalone/apps/web/node_modules/next/dist/server/web/next-url.js +199 -0
  1377. package/web/standalone/apps/web/node_modules/next/dist/server/web/sandbox/context.js +462 -0
  1378. package/web/standalone/apps/web/node_modules/next/dist/server/web/sandbox/fetch-inline-assets.js +35 -0
  1379. package/web/standalone/apps/web/node_modules/next/dist/server/web/sandbox/index.js +28 -0
  1380. package/web/standalone/apps/web/node_modules/next/dist/server/web/sandbox/resource-managers.js +88 -0
  1381. package/web/standalone/apps/web/node_modules/next/dist/server/web/sandbox/sandbox.js +137 -0
  1382. package/web/standalone/apps/web/node_modules/next/dist/server/web/spec-extension/adapters/headers.js +192 -0
  1383. package/web/standalone/apps/web/node_modules/next/dist/server/web/spec-extension/adapters/next-request.js +142 -0
  1384. package/web/standalone/apps/web/node_modules/next/dist/server/web/spec-extension/adapters/reflect.js +30 -0
  1385. package/web/standalone/apps/web/node_modules/next/dist/server/web/spec-extension/adapters/request-cookies.js +211 -0
  1386. package/web/standalone/apps/web/node_modules/next/dist/server/web/spec-extension/cookies.js +29 -0
  1387. package/web/standalone/apps/web/node_modules/next/dist/server/web/spec-extension/fetch-event.js +98 -0
  1388. package/web/standalone/apps/web/node_modules/next/dist/server/web/spec-extension/image-response.js +22 -0
  1389. package/web/standalone/apps/web/node_modules/next/dist/server/web/spec-extension/request.js +99 -0
  1390. package/web/standalone/apps/web/node_modules/next/dist/server/web/spec-extension/response.js +136 -0
  1391. package/web/standalone/apps/web/node_modules/next/dist/server/web/spec-extension/revalidate.js +214 -0
  1392. package/web/standalone/apps/web/node_modules/next/dist/server/web/spec-extension/unstable-cache.js +289 -0
  1393. package/web/standalone/apps/web/node_modules/next/dist/server/web/spec-extension/unstable-no-store.js +51 -0
  1394. package/web/standalone/apps/web/node_modules/next/dist/server/web/spec-extension/url-pattern.js +14 -0
  1395. package/web/standalone/apps/web/node_modules/next/dist/server/web/spec-extension/user-agent.js +46 -0
  1396. package/web/standalone/apps/web/node_modules/next/dist/server/web/types.js +6 -0
  1397. package/web/standalone/apps/web/node_modules/next/dist/server/web/utils.js +151 -0
  1398. package/web/standalone/apps/web/node_modules/next/dist/server/web/web-on-close.js +87 -0
  1399. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/action-revalidation-kind.js +31 -0
  1400. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/app-router-context.shared-runtime.js +50 -0
  1401. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/app-router-types.js +46 -0
  1402. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/constants.js +448 -0
  1403. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/deep-freeze.js +30 -0
  1404. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/deployment-id.js +63 -0
  1405. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/dset.js +34 -0
  1406. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/encode-uri-path.js +15 -0
  1407. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/entry-constants.js +36 -0
  1408. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/error-source.js +36 -0
  1409. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/errors/canary-only-config-error.js +39 -0
  1410. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/errors/code-frame.js +20 -0
  1411. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/errors/constants.js +19 -0
  1412. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/errors/empty-generate-static-params-error.js +24 -0
  1413. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/errors/hard-deprecated-config-error.js +20 -0
  1414. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/escape-regexp.js +22 -0
  1415. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/get-hostname.js +23 -0
  1416. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/hash.js +42 -0
  1417. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/head-manager-context.shared-runtime.js +18 -0
  1418. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/head.js +163 -0
  1419. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/hooks-client-context.shared-runtime.js +60 -0
  1420. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/html-context.shared-runtime.js +40 -0
  1421. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/i18n/detect-domain-locale.js +25 -0
  1422. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/i18n/get-locale-redirect.js +59 -0
  1423. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/i18n/normalize-locale-path.js +54 -0
  1424. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/image-blur-svg.js +22 -0
  1425. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/image-config-context.shared-runtime.js +19 -0
  1426. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/image-config.js +77 -0
  1427. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/invariant-error.js +18 -0
  1428. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/is-plain-object.js +42 -0
  1429. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/is-thenable.js +20 -0
  1430. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/isomorphic/path.js +14 -0
  1431. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/lazy-dynamic/bailout-to-csr.js +37 -0
  1432. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/loadable-context.shared-runtime.js +19 -0
  1433. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/loadable.shared-runtime.js +246 -0
  1434. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/match-local-pattern.js +46 -0
  1435. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/match-remote-pattern.js +63 -0
  1436. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/modern-browserslist-target.js +15 -0
  1437. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/no-fallback-error.external.js +18 -0
  1438. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/normalized-asset-prefix.js +28 -0
  1439. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/page-path/absolute-path-to-page.js +26 -0
  1440. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/page-path/denormalize-page-path.js +18 -0
  1441. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/page-path/ensure-leading-slash.js +18 -0
  1442. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/page-path/get-page-paths.js +40 -0
  1443. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/page-path/normalize-data-path.js +23 -0
  1444. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/page-path/normalize-page-path.js +26 -0
  1445. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/page-path/normalize-path-sep.js +19 -0
  1446. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/page-path/remove-page-path-tail.js +20 -0
  1447. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/promise-with-resolvers.js +26 -0
  1448. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/adapters.js +136 -0
  1449. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/routes/app.js +122 -0
  1450. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/add-locale.js +28 -0
  1451. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/add-path-prefix.js +20 -0
  1452. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/add-path-suffix.js +20 -0
  1453. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/app-paths.js +62 -0
  1454. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/as-path-to-search-params.js +17 -0
  1455. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/cache-busting-search-param.js +24 -0
  1456. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/escape-path-delimiters.js +16 -0
  1457. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/format-next-pathname-info.js +27 -0
  1458. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/format-url.js +111 -0
  1459. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/get-dynamic-param.js +174 -0
  1460. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/get-next-pathname-info.js +52 -0
  1461. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/get-route-from-asset-path.js +25 -0
  1462. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/get-segment-param.js +90 -0
  1463. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/html-bots.js +17 -0
  1464. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/index.js +30 -0
  1465. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/interception-prefix-from-param-type.js +33 -0
  1466. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/interception-routes.js +108 -0
  1467. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/is-bot.js +57 -0
  1468. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/is-dynamic.js +26 -0
  1469. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/middleware-route-matcher.js +31 -0
  1470. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/parse-loader-tree.js +30 -0
  1471. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/parse-path.js +33 -0
  1472. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/parse-relative-url.js +43 -0
  1473. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/parse-url.js +38 -0
  1474. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/path-has-prefix.js +20 -0
  1475. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/path-match.js +49 -0
  1476. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/prepare-destination.js +292 -0
  1477. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/querystring.js +79 -0
  1478. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/relativize-url.js +40 -0
  1479. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/remove-path-prefix.js +39 -0
  1480. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/remove-trailing-slash.js +21 -0
  1481. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/resolve-param-value.js +116 -0
  1482. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/route-match-utils.js +113 -0
  1483. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/route-matcher.js +45 -0
  1484. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/route-regex.js +256 -0
  1485. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router/utils/sorted-routes.js +244 -0
  1486. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/router-context.shared-runtime.js +18 -0
  1487. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/segment-cache/segment-value-encoding.js +99 -0
  1488. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/segment-cache/vary-params-decoding.js +32 -0
  1489. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/segment.js +102 -0
  1490. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/server-inserted-html.shared-runtime.js +35 -0
  1491. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/server-reference-info.js +56 -0
  1492. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/side-effect.js +63 -0
  1493. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/size-limit.js +40 -0
  1494. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/turbopack/internal-error.js +53 -0
  1495. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/utils/reflect-utils.js +69 -0
  1496. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/utils/warn-once.js +22 -0
  1497. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/utils.js +207 -0
  1498. package/web/standalone/apps/web/node_modules/next/dist/shared/lib/zod.js +101 -0
  1499. package/web/standalone/apps/web/node_modules/next/dist/telemetry/anonymous-meta.js +89 -0
  1500. package/web/standalone/apps/web/node_modules/next/dist/telemetry/detached-flush.js +56 -0
  1501. package/web/standalone/apps/web/node_modules/next/dist/telemetry/events/build.js +174 -0
  1502. package/web/standalone/apps/web/node_modules/next/dist/telemetry/events/index.js +41 -0
  1503. package/web/standalone/apps/web/node_modules/next/dist/telemetry/events/plugins.js +51 -0
  1504. package/web/standalone/apps/web/node_modules/next/dist/telemetry/events/swc-load-failure.js +55 -0
  1505. package/web/standalone/apps/web/node_modules/next/dist/telemetry/events/version.js +66 -0
  1506. package/web/standalone/apps/web/node_modules/next/dist/telemetry/flush-telemetry.js +19 -0
  1507. package/web/standalone/apps/web/node_modules/next/dist/telemetry/post-telemetry-payload.js +48 -0
  1508. package/web/standalone/apps/web/node_modules/next/dist/telemetry/project-id.js +48 -0
  1509. package/web/standalone/apps/web/node_modules/next/dist/telemetry/storage.js +301 -0
  1510. package/web/standalone/apps/web/node_modules/next/dist/trace/index.js +58 -0
  1511. package/web/standalone/apps/web/node_modules/next/dist/trace/report/index.js +37 -0
  1512. package/web/standalone/apps/web/node_modules/next/dist/trace/report/to-json-build.js +40 -0
  1513. package/web/standalone/apps/web/node_modules/next/dist/trace/report/to-json.js +165 -0
  1514. package/web/standalone/apps/web/node_modules/next/dist/trace/report/to-telemetry.js +36 -0
  1515. package/web/standalone/apps/web/node_modules/next/dist/trace/shared.js +39 -0
  1516. package/web/standalone/apps/web/node_modules/next/dist/trace/trace.js +211 -0
  1517. package/web/standalone/apps/web/node_modules/next/package.json +378 -0
  1518. package/web/standalone/apps/web/package.json +33 -0
  1519. package/web/standalone/apps/web/server.js +38 -0
  1520. package/web/standalone/node_modules/@img/colour/color.cjs +1596 -0
  1521. package/web/standalone/node_modules/@img/colour/index.cjs +1 -0
  1522. package/web/standalone/node_modules/@img/colour/package.json +58 -0
  1523. package/web/standalone/node_modules/@img/sharp-darwin-arm64/lib/sharp-darwin-arm64.node +0 -0
  1524. package/web/standalone/node_modules/@img/sharp-darwin-arm64/package.json +40 -0
  1525. package/web/standalone/node_modules/@img/sharp-libvips-darwin-arm64/README.md +46 -0
  1526. package/web/standalone/node_modules/@img/sharp-libvips-darwin-arm64/lib/glib-2.0/include/glibconfig.h +220 -0
  1527. package/web/standalone/node_modules/@img/sharp-libvips-darwin-arm64/lib/index.js +1 -0
  1528. package/web/standalone/node_modules/@img/sharp-libvips-darwin-arm64/lib/libvips-cpp.8.17.3.dylib +0 -0
  1529. package/web/standalone/node_modules/@img/sharp-libvips-darwin-arm64/package.json +36 -0
  1530. package/web/standalone/node_modules/@img/sharp-libvips-darwin-arm64/versions.json +30 -0
  1531. package/web/standalone/node_modules/@swc/helpers/cjs/_interop_require_default.cjs +6 -0
  1532. package/web/standalone/node_modules/@swc/helpers/cjs/_interop_require_wildcard.cjs +38 -0
  1533. package/web/standalone/node_modules/@swc/helpers/package.json +471 -0
  1534. package/web/standalone/node_modules/client-only/index.js +0 -0
  1535. package/web/standalone/node_modules/client-only/package.json +19 -0
  1536. package/web/standalone/node_modules/detect-libc/lib/detect-libc.js +313 -0
  1537. package/web/standalone/node_modules/detect-libc/lib/elf.js +39 -0
  1538. package/web/standalone/node_modules/detect-libc/lib/filesystem.js +51 -0
  1539. package/web/standalone/node_modules/detect-libc/lib/process.js +24 -0
  1540. package/web/standalone/node_modules/detect-libc/package.json +44 -0
  1541. package/web/standalone/node_modules/react/cjs/react-compiler-runtime.production.js +16 -0
  1542. package/web/standalone/node_modules/react/cjs/react-jsx-dev-runtime.production.js +14 -0
  1543. package/web/standalone/node_modules/react/cjs/react-jsx-runtime.production.js +34 -0
  1544. package/web/standalone/node_modules/react/cjs/react.development.js +1284 -0
  1545. package/web/standalone/node_modules/react/cjs/react.production.js +542 -0
  1546. package/web/standalone/node_modules/react/compiler-runtime.js +14 -0
  1547. package/web/standalone/node_modules/react/index.js +7 -0
  1548. package/web/standalone/node_modules/react/jsx-dev-runtime.js +7 -0
  1549. package/web/standalone/node_modules/react/jsx-runtime.js +7 -0
  1550. package/web/standalone/node_modules/react/package.json +51 -0
  1551. package/web/standalone/node_modules/react-dom/cjs/react-dom-server-legacy.browser.production.js +6603 -0
  1552. package/web/standalone/node_modules/react-dom/cjs/react-dom-server-legacy.node.production.js +6692 -0
  1553. package/web/standalone/node_modules/react-dom/cjs/react-dom-server.browser.production.js +7410 -0
  1554. package/web/standalone/node_modules/react-dom/cjs/react-dom-server.edge.production.js +7512 -0
  1555. package/web/standalone/node_modules/react-dom/cjs/react-dom-server.node.production.js +7707 -0
  1556. package/web/standalone/node_modules/react-dom/cjs/react-dom.production.js +210 -0
  1557. package/web/standalone/node_modules/react-dom/index.js +38 -0
  1558. package/web/standalone/node_modules/react-dom/package.json +117 -0
  1559. package/web/standalone/node_modules/react-dom/server.browser.js +16 -0
  1560. package/web/standalone/node_modules/react-dom/server.edge.js +17 -0
  1561. package/web/standalone/node_modules/react-dom/server.node.js +18 -0
  1562. package/web/standalone/node_modules/react-dom/static.node.js +14 -0
  1563. package/web/standalone/node_modules/sharp/lib/channel.js +177 -0
  1564. package/web/standalone/node_modules/sharp/lib/colour.js +195 -0
  1565. package/web/standalone/node_modules/sharp/lib/composite.js +212 -0
  1566. package/web/standalone/node_modules/sharp/lib/constructor.js +499 -0
  1567. package/web/standalone/node_modules/sharp/lib/index.js +16 -0
  1568. package/web/standalone/node_modules/sharp/lib/input.js +809 -0
  1569. package/web/standalone/node_modules/sharp/lib/is.js +143 -0
  1570. package/web/standalone/node_modules/sharp/lib/libvips.js +207 -0
  1571. package/web/standalone/node_modules/sharp/lib/operation.js +1016 -0
  1572. package/web/standalone/node_modules/sharp/lib/output.js +1666 -0
  1573. package/web/standalone/node_modules/sharp/lib/resize.js +595 -0
  1574. package/web/standalone/node_modules/sharp/lib/sharp.js +121 -0
  1575. package/web/standalone/node_modules/sharp/lib/utility.js +291 -0
  1576. package/web/standalone/node_modules/sharp/node_modules/semver/classes/comparator.js +143 -0
  1577. package/web/standalone/node_modules/sharp/node_modules/semver/classes/range.js +557 -0
  1578. package/web/standalone/node_modules/sharp/node_modules/semver/classes/semver.js +333 -0
  1579. package/web/standalone/node_modules/sharp/node_modules/semver/functions/cmp.js +54 -0
  1580. package/web/standalone/node_modules/sharp/node_modules/semver/functions/coerce.js +62 -0
  1581. package/web/standalone/node_modules/sharp/node_modules/semver/functions/compare.js +7 -0
  1582. package/web/standalone/node_modules/sharp/node_modules/semver/functions/eq.js +5 -0
  1583. package/web/standalone/node_modules/sharp/node_modules/semver/functions/gt.js +5 -0
  1584. package/web/standalone/node_modules/sharp/node_modules/semver/functions/gte.js +5 -0
  1585. package/web/standalone/node_modules/sharp/node_modules/semver/functions/lt.js +5 -0
  1586. package/web/standalone/node_modules/sharp/node_modules/semver/functions/lte.js +5 -0
  1587. package/web/standalone/node_modules/sharp/node_modules/semver/functions/neq.js +5 -0
  1588. package/web/standalone/node_modules/sharp/node_modules/semver/functions/parse.js +18 -0
  1589. package/web/standalone/node_modules/sharp/node_modules/semver/functions/satisfies.js +12 -0
  1590. package/web/standalone/node_modules/sharp/node_modules/semver/internal/constants.js +37 -0
  1591. package/web/standalone/node_modules/sharp/node_modules/semver/internal/debug.js +11 -0
  1592. package/web/standalone/node_modules/sharp/node_modules/semver/internal/identifiers.js +29 -0
  1593. package/web/standalone/node_modules/sharp/node_modules/semver/internal/lrucache.js +42 -0
  1594. package/web/standalone/node_modules/sharp/node_modules/semver/internal/parse-options.js +17 -0
  1595. package/web/standalone/node_modules/sharp/node_modules/semver/internal/re.js +223 -0
  1596. package/web/standalone/node_modules/sharp/node_modules/semver/package.json +78 -0
  1597. package/web/standalone/node_modules/sharp/package.json +202 -0
  1598. package/web/standalone/node_modules/styled-jsx/dist/index/index.js +499 -0
  1599. package/web/standalone/node_modules/styled-jsx/index.js +1 -0
  1600. package/web/standalone/node_modules/styled-jsx/package.json +132 -0
  1601. package/web/standalone/node_modules/styled-jsx/style.js +1 -0
  1602. package/web/standalone/public/file.svg +1 -0
  1603. package/web/standalone/public/globe.svg +1 -0
  1604. package/web/standalone/public/next.svg +1 -0
  1605. package/web/standalone/public/vercel.svg +1 -0
  1606. package/web/standalone/public/window.svg +1 -0
@@ -0,0 +1,4469 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "renderToHTMLOrFlight", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return renderToHTMLOrFlight;
9
+ }
10
+ });
11
+ const _jsxruntime = require("react/jsx-runtime");
12
+ const _workasyncstorageexternal = require("../app-render/work-async-storage.external");
13
+ const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
14
+ const _renderresult = /*#__PURE__*/ _interop_require_default(require("../render-result"));
15
+ const _streamops = require("./stream-ops");
16
+ const _internalutils = require("../internal-utils");
17
+ const _approuterheaders = require("../../client/components/app-router-headers");
18
+ const _metadatacontext = require("../../lib/metadata/metadata-context");
19
+ const _requeststore = require("../async-storage/request-store");
20
+ const _workstore = require("../async-storage/work-store");
21
+ const _httpaccessfallback = require("../../client/components/http-access-fallback/http-access-fallback");
22
+ const _redirect = require("../../client/components/redirect");
23
+ const _redirecterror = require("../../client/components/redirect-error");
24
+ const _implicittags = require("../lib/implicit-tags");
25
+ const _constants = require("../lib/trace/constants");
26
+ const _tracer = require("../lib/trace/tracer");
27
+ const _flightrenderresult = require("./flight-render-result");
28
+ const _createerrorhandler = require("./create-error-handler");
29
+ const _getshortdynamicparamtype = require("./get-short-dynamic-param-type");
30
+ const _getsegmentparam = require("../../shared/lib/router/utils/get-segment-param");
31
+ const _getscriptnoncefromheader = require("./get-script-nonce-from-header");
32
+ const _parseandvalidateflightrouterstate = require("./parse-and-validate-flight-router-state");
33
+ const _createflightrouterstatefromloadertree = require("./create-flight-router-state-from-loader-tree");
34
+ const _actionhandler = require("./action-handler");
35
+ const _bailouttocsr = require("../../shared/lib/lazy-dynamic/bailout-to-csr");
36
+ const _log = require("../../build/output/log");
37
+ const _requestcookies = require("../web/spec-extension/adapters/request-cookies");
38
+ const _serverinsertedhtml = require("./server-inserted-html");
39
+ const _requiredscripts = require("./required-scripts");
40
+ const _addpathprefix = require("../../shared/lib/router/utils/add-path-prefix");
41
+ const _makegetserverinsertedhtml = require("./make-get-server-inserted-html");
42
+ const _walktreewithflightrouterstate = require("./walk-tree-with-flight-router-state");
43
+ const _createcomponenttree = require("./create-component-tree");
44
+ const _getassetquerystring = require("./get-asset-query-string");
45
+ const _manifestssingleton = require("./manifests-singleton");
46
+ const _postponedstate = require("./postponed-state");
47
+ const _hooksservercontext = require("../../client/components/hooks-server-context");
48
+ const _useflightresponse = require("./use-flight-response");
49
+ const _staticgenerationbailout = require("../../client/components/static-generation-bailout");
50
+ const _formatservererror = require("../../lib/format-server-error");
51
+ const _errortelemetryutils = require("../../lib/error-telemetry-utils");
52
+ const _dynamicrendering = require("./dynamic-rendering");
53
+ const _clientcomponentrendererlogger = require("../client-component-renderer-logger");
54
+ const _helpers = require("../base-http/helpers");
55
+ const _parserelativeurl = require("../../shared/lib/router/utils/parse-relative-url");
56
+ const _approuter = /*#__PURE__*/ _interop_require_default(require("../../client/components/app-router"));
57
+ const _serveractionrequestmeta = require("../lib/server-action-request-meta");
58
+ const _createinitialrouterstate = require("../../client/components/router-reducer/create-initial-router-state");
59
+ const _approuterinstance = require("../../client/components/app-router-instance");
60
+ const _utils = require("../instrumentation/utils");
61
+ const _segment = require("../../shared/lib/segment");
62
+ const _fallbackparams = require("../request/fallback-params");
63
+ const _apprenderprerenderutils = require("./app-render-prerender-utils");
64
+ const _prospectiverenderutils = require("./prospective-render-utils");
65
+ const _apprenderrenderutils = require("./app-render-render-utils");
66
+ const _scheduler = require("../../lib/scheduler");
67
+ const _workunitasyncstorageexternal = require("./work-unit-async-storage.external");
68
+ const _consoleasyncstorageexternal = require("./console-async-storage.external");
69
+ const _cachesignal = require("./cache-signal");
70
+ const _varyparams = require("./vary-params");
71
+ const _utils1 = require("../lib/trace/utils");
72
+ const _invarianterror = require("../../shared/lib/invariant-error");
73
+ const _staletime = require("./stale-time");
74
+ const _constants1 = require("../../lib/constants");
75
+ const _createcomponentstylesandscripts = require("./create-component-styles-and-scripts");
76
+ const _parseloadertree = require("../../shared/lib/router/utils/parse-loader-tree");
77
+ const _resumedatacache = require("../resume-data-cache/resume-data-cache");
78
+ const _iserror = /*#__PURE__*/ _interop_require_default(require("../../lib/is-error"));
79
+ const _createserverinsertedmetadata = require("./metadata-insertion/create-server-inserted-metadata");
80
+ const _serverutils = require("../server-utils");
81
+ const _revalidationutils = require("../revalidation-utils");
82
+ const _trackmoduleloadingexternal = require("./module-loading/track-module-loading.external");
83
+ const _reactlargeshellerror = require("./react-large-shell-error");
84
+ const _segmentexplorerpath = require("./segment-explorer-path");
85
+ const _requestmeta = require("../request-meta");
86
+ const _getdynamicparam = require("../../shared/lib/router/utils/get-dynamic-param");
87
+ const _imageconfigcontextsharedruntime = require("../../shared/lib/image-config-context.shared-runtime");
88
+ const _imageconfig = require("../../shared/lib/image-config");
89
+ const _stagedrendering = require("./staged-rendering");
90
+ const _instantconfig = require("./instant-validation/instant-config");
91
+ const _warnonce = require("../../shared/lib/utils/warn-once");
92
+ const _debugchannelserver = require("./debug-channel-server");
93
+ const _streamutils = require("./instant-validation/stream-utils");
94
+ const _boundarytracking = require("./instant-validation/boundary-tracking");
95
+ const _cookies = require("../web/spec-extension/cookies");
96
+ const _instantvalidationerror = require("./instant-validation/instant-validation-error");
97
+ function _interop_require_default(obj) {
98
+ return obj && obj.__esModule ? obj : {
99
+ default: obj
100
+ };
101
+ }
102
+ function _getRequireWildcardCache(nodeInterop) {
103
+ if (typeof WeakMap !== "function") return null;
104
+ var cacheBabelInterop = new WeakMap();
105
+ var cacheNodeInterop = new WeakMap();
106
+ return (_getRequireWildcardCache = function(nodeInterop) {
107
+ return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
108
+ })(nodeInterop);
109
+ }
110
+ function _interop_require_wildcard(obj, nodeInterop) {
111
+ if (!nodeInterop && obj && obj.__esModule) {
112
+ return obj;
113
+ }
114
+ if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
115
+ return {
116
+ default: obj
117
+ };
118
+ }
119
+ var cache = _getRequireWildcardCache(nodeInterop);
120
+ if (cache && cache.has(obj)) {
121
+ return cache.get(obj);
122
+ }
123
+ var newObj = {
124
+ __proto__: null
125
+ };
126
+ var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
127
+ for(var key in obj){
128
+ if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
129
+ var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
130
+ if (desc && (desc.get || desc.set)) {
131
+ Object.defineProperty(newObj, key, desc);
132
+ } else {
133
+ newObj[key] = obj[key];
134
+ }
135
+ }
136
+ }
137
+ newObj.default = obj;
138
+ if (cache) {
139
+ cache.set(obj, newObj);
140
+ }
141
+ return newObj;
142
+ }
143
+ function maybeAppendBuildIdToRSCPayload(ctx, payload) {
144
+ if (!ctx.sharedContext.deploymentId) {
145
+ // When using the build id, we need to initialize the id on initial page load, so a build id
146
+ // header wouldn't be enough.
147
+ payload.b = ctx.sharedContext.buildId;
148
+ }
149
+ return payload;
150
+ }
151
+ const flightDataPathHeadKey = 'h';
152
+ const getFlightViewportKey = (requestId)=>requestId + 'v';
153
+ const getFlightMetadataKey = (requestId)=>requestId + 'm';
154
+ const filterStackFrame = process.env.NODE_ENV !== 'production' ? require('../lib/source-maps').filterStackFrameDEV : undefined;
155
+ function parseRequestHeaders(headers, options) {
156
+ // runtime prefetch requests are *not* treated as prefetch requests
157
+ // (TODO: this is confusing, we should refactor this to express this better)
158
+ const isPrefetchRequest = headers[_approuterheaders.NEXT_ROUTER_PREFETCH_HEADER] === '1';
159
+ const isRuntimePrefetchRequest = headers[_approuterheaders.NEXT_ROUTER_PREFETCH_HEADER] === '2';
160
+ const isHmrRefresh = headers[_approuterheaders.NEXT_HMR_REFRESH_HEADER] !== undefined;
161
+ const isRSCRequest = headers[_approuterheaders.RSC_HEADER] !== undefined;
162
+ const shouldProvideFlightRouterState = isRSCRequest && (!isPrefetchRequest || !options.isRoutePPREnabled);
163
+ const flightRouterState = shouldProvideFlightRouterState ? (0, _parseandvalidateflightrouterstate.parseAndValidateFlightRouterState)(headers[_approuterheaders.NEXT_ROUTER_STATE_TREE_HEADER]) : undefined;
164
+ // Checks if this is a prefetch of the Route Tree by the Segment Cache
165
+ const isRouteTreePrefetchRequest = headers[_approuterheaders.NEXT_ROUTER_SEGMENT_PREFETCH_HEADER] === '/_tree';
166
+ const csp = headers['content-security-policy'] || headers['content-security-policy-report-only'];
167
+ const nonce = typeof csp === 'string' ? (0, _getscriptnoncefromheader.getScriptNonceFromHeader)(csp) : undefined;
168
+ const previouslyRevalidatedTags = (0, _serverutils.getPreviouslyRevalidatedTags)(headers, options.previewModeId);
169
+ let requestId;
170
+ let htmlRequestId;
171
+ if (process.env.__NEXT_DEV_SERVER) {
172
+ // The request IDs are only used for the dev server to send debug
173
+ // information to the matching client (identified by the HTML request ID
174
+ // that was sent to the client with the HTML document) for the current
175
+ // request (identified by the request ID, as defined by the client).
176
+ requestId = typeof headers[_approuterheaders.NEXT_REQUEST_ID_HEADER] === 'string' ? headers[_approuterheaders.NEXT_REQUEST_ID_HEADER] : undefined;
177
+ htmlRequestId = typeof headers[_approuterheaders.NEXT_HTML_REQUEST_ID_HEADER] === 'string' ? headers[_approuterheaders.NEXT_HTML_REQUEST_ID_HEADER] : undefined;
178
+ }
179
+ return {
180
+ flightRouterState,
181
+ isPrefetchRequest,
182
+ isRuntimePrefetchRequest,
183
+ isRouteTreePrefetchRequest,
184
+ isHmrRefresh,
185
+ isRSCRequest,
186
+ nonce,
187
+ previouslyRevalidatedTags,
188
+ requestId,
189
+ htmlRequestId
190
+ };
191
+ }
192
+ /**
193
+ * Walks the loader tree to find the minimum `unstable_dynamicStaleTime` exported by
194
+ * any page module. Returns null if no page exports the config.
195
+ *
196
+ * This only reads static exports from page modules — it does not render any
197
+ * server components, so it's cheap to call.
198
+ *
199
+ * TODO: Move this to the prefetch hints file so we don't have to walk the
200
+ * tree on every render.
201
+ */ async function getDynamicStaleTime(tree) {
202
+ const { page, parallelRoutes } = (0, _parseloadertree.parseLoaderTree)(tree);
203
+ let result = null;
204
+ // Only pages (not layouts) can export unstable_dynamicStaleTime.
205
+ if (typeof page !== 'undefined') {
206
+ const pageMod = await page[0]();
207
+ if (pageMod && typeof pageMod.unstable_dynamicStaleTime === 'number') {
208
+ const value = pageMod.unstable_dynamicStaleTime;
209
+ result = result !== null ? Math.min(result, value) : value;
210
+ }
211
+ }
212
+ const childPromises = [];
213
+ for(const parallelRouteKey in parallelRoutes){
214
+ childPromises.push(getDynamicStaleTime(parallelRoutes[parallelRouteKey]));
215
+ }
216
+ const childResults = await Promise.all(childPromises);
217
+ for (const childResult of childResults){
218
+ if (childResult !== null) {
219
+ result = result !== null ? Math.min(result, childResult) : childResult;
220
+ }
221
+ }
222
+ return result;
223
+ }
224
+ function createNotFoundLoaderTree(loaderTree) {
225
+ const components = loaderTree[2];
226
+ const hasGlobalNotFound = !!components['global-not-found'];
227
+ const notFoundTreeComponents = hasGlobalNotFound ? {
228
+ layout: components['global-not-found'],
229
+ page: [
230
+ ()=>null,
231
+ 'next/dist/client/components/builtin/empty-stub'
232
+ ]
233
+ } : {
234
+ page: components['not-found']
235
+ };
236
+ return [
237
+ '',
238
+ {
239
+ children: [
240
+ _segment.PAGE_SEGMENT_KEY,
241
+ {},
242
+ notFoundTreeComponents,
243
+ null
244
+ ]
245
+ },
246
+ // Always include global-error so that getGlobalErrorStyles can access it.
247
+ // When global-not-found is present, use full components.
248
+ // Otherwise, only include global-error module.
249
+ hasGlobalNotFound ? components : {
250
+ 'global-error': components['global-error']
251
+ },
252
+ null
253
+ ];
254
+ }
255
+ /**
256
+ * Returns a function that parses the dynamic segment and return the associated value.
257
+ */ function makeGetDynamicParamFromSegment(interpolatedParams, fallbackRouteParams, optimisticRouting) {
258
+ return function getDynamicParamFromSegment(loaderTree) {
259
+ const [segment, , , staticSiblings] = loaderTree;
260
+ const segmentParam = (0, _getsegmentparam.getSegmentParam)(segment);
261
+ if (!segmentParam) {
262
+ return null;
263
+ }
264
+ const segmentKey = segmentParam.paramName;
265
+ const dynamicParamType = _getshortdynamicparamtype.dynamicParamTypes[segmentParam.paramType];
266
+ // Static siblings are only included when optimistic routing is enabled
267
+ const siblings = optimisticRouting ? staticSiblings : null;
268
+ return (0, _getdynamicparam.getDynamicParam)(interpolatedParams, segmentKey, dynamicParamType, fallbackRouteParams, siblings);
269
+ };
270
+ }
271
+ function NonIndex({ createElement, pagePath, statusCode, isPossibleServerAction }) {
272
+ const is404Page = pagePath === '/404';
273
+ const isInvalidStatusCode = typeof statusCode === 'number' && statusCode > 400;
274
+ // Only render noindex for page request, skip for server actions
275
+ // TODO: is this correct if `isPossibleServerAction` is a false positive?
276
+ if (!isPossibleServerAction && (is404Page || isInvalidStatusCode)) {
277
+ return createElement('meta', {
278
+ name: 'robots',
279
+ content: 'noindex'
280
+ });
281
+ }
282
+ return null;
283
+ }
284
+ /**
285
+ * This is used by server actions & client-side navigations to generate RSC data from a client-side request.
286
+ * This function is only called on "dynamic" requests (ie, there wasn't already a static response).
287
+ * It uses request headers (namely `next-router-state-tree`) to determine where to start rendering.
288
+ */ async function generateDynamicRSCPayload(ctx, options) {
289
+ // Flight data that is going to be passed to the browser.
290
+ // Currently a single item array but in the future multiple patches might be combined in a single request.
291
+ // We initialize `flightData` to an empty string because the client router knows how to tolerate
292
+ // it (treating it as an MPA navigation). The only time this function wouldn't generate flight data
293
+ // is for server actions, if the server action handler instructs this function to skip it. When the server
294
+ // action reducer sees a falsy value, it'll simply resolve the action with no data.
295
+ let flightData = '';
296
+ const { componentMod: { routeModule: { userland: { loaderTree } }, createElement, createMetadataComponents, Fragment }, query, requestId, flightRouterState, workStore, url } = ctx;
297
+ const serveStreamingMetadata = !!ctx.renderOpts.serveStreamingMetadata;
298
+ if (!(options == null ? void 0 : options.skipPageRendering)) {
299
+ var _ctx_renderOpts_prefetchHints;
300
+ const preloadCallbacks = [];
301
+ // If we're performing instant validation, we need to render the whole tree,
302
+ // without skipping shared layouts.
303
+ const needsFullTree = process.env.__NEXT_DEV_SERVER && ctx.renderOpts.cacheComponents && !(options == null ? void 0 : options.actionResult) && // Only for navigations
304
+ await (0, _instantconfig.anySegmentNeedsInstantValidationInDev)(loaderTree);
305
+ const metadataIsRuntimePrefetchable = await (0, _instantconfig.anySegmentHasRuntimePrefetchEnabled)(loaderTree);
306
+ const { Viewport, Metadata, MetadataOutlet } = createMetadataComponents({
307
+ tree: loaderTree,
308
+ parsedQuery: query,
309
+ pathname: url.pathname,
310
+ metadataContext: (0, _metadatacontext.createMetadataContext)(ctx.renderOpts),
311
+ interpolatedParams: ctx.interpolatedParams,
312
+ serveStreamingMetadata,
313
+ isRuntimePrefetchable: metadataIsRuntimePrefetchable
314
+ });
315
+ const rscHead = createElement(Fragment, {
316
+ key: flightDataPathHeadKey
317
+ }, createElement(NonIndex, {
318
+ createElement,
319
+ pagePath: ctx.pagePath,
320
+ statusCode: ctx.res.statusCode,
321
+ isPossibleServerAction: ctx.isPossibleServerAction
322
+ }), createElement(Viewport, {
323
+ key: getFlightViewportKey(requestId)
324
+ }), createElement(Metadata, {
325
+ key: getFlightMetadataKey(requestId)
326
+ }));
327
+ flightData = (needsFullTree ? await (0, _walktreewithflightrouterstate.createFullTreeFlightDataForNavigation)({
328
+ ctx,
329
+ loaderTree,
330
+ rscHead,
331
+ injectedCSS: new Set(),
332
+ injectedJS: new Set(),
333
+ injectedFontPreloadTags: new Set(),
334
+ preloadCallbacks,
335
+ MetadataOutlet
336
+ }) : await (0, _walktreewithflightrouterstate.walkTreeWithFlightRouterState)({
337
+ ctx,
338
+ loaderTreeToFilter: loaderTree,
339
+ parentParams: {},
340
+ flightRouterState,
341
+ rscHead,
342
+ injectedCSS: new Set(),
343
+ injectedJS: new Set(),
344
+ injectedFontPreloadTags: new Set(),
345
+ rootLayoutIncluded: false,
346
+ preloadCallbacks,
347
+ MetadataOutlet,
348
+ hintTree: ((_ctx_renderOpts_prefetchHints = ctx.renderOpts.prefetchHints) == null ? void 0 : _ctx_renderOpts_prefetchHints[ctx.pagePath]) ?? null
349
+ })).map((path)=>path.slice(1)) // remove the '' (root) segment
350
+ ;
351
+ }
352
+ // In dev, the Vary header may not reliably reflect whether a route can
353
+ // be intercepted, because interception routes are compiled on demand.
354
+ // Default to true so the client doesn't cache a stale Fallback entry.
355
+ const varyHeader = ctx.res.getHeader('vary');
356
+ const couldBeIntercepted = !!process.env.__NEXT_DEV_SERVER || typeof varyHeader === 'string' && varyHeader.includes(_approuterheaders.NEXT_URL);
357
+ // If we have an action result, then this is a server action response.
358
+ // We can rely on this because `ActionResult` will always be a promise, even if
359
+ // the result is falsey.
360
+ if (options == null ? void 0 : options.actionResult) {
361
+ return maybeAppendBuildIdToRSCPayload(ctx, {
362
+ a: options.actionResult,
363
+ f: flightData,
364
+ q: getRenderedSearch(query),
365
+ i: !!couldBeIntercepted
366
+ });
367
+ }
368
+ // Otherwise, it's a regular RSC response.
369
+ const baseResponse = maybeAppendBuildIdToRSCPayload(ctx, {
370
+ f: flightData,
371
+ q: getRenderedSearch(query),
372
+ i: !!couldBeIntercepted,
373
+ S: workStore.isStaticGeneration,
374
+ h: (0, _varyparams.getMetadataVaryParamsThenable)()
375
+ });
376
+ if ((options == null ? void 0 : options.staleTimeIterable) !== undefined) {
377
+ baseResponse.s = options.staleTimeIterable;
378
+ }
379
+ if ((options == null ? void 0 : options.staticStageByteLengthPromise) !== undefined) {
380
+ baseResponse.l = options.staticStageByteLengthPromise;
381
+ }
382
+ if ((options == null ? void 0 : options.runtimePrefetchStream) !== undefined) {
383
+ baseResponse.p = options.runtimePrefetchStream;
384
+ }
385
+ // Include the per-page dynamic stale time from unstable_dynamicStaleTime, but only
386
+ // for dynamic renders (not prerenders/static generation). The client treats
387
+ // its presence as authoritative.
388
+ // TODO: Move this to the prefetch hints file so we don't have to walk the
389
+ // tree on every render.
390
+ if (!workStore.isStaticGeneration) {
391
+ const dynamicStaleTime = await getDynamicStaleTime(ctx.componentMod.routeModule.userland.loaderTree);
392
+ if (dynamicStaleTime !== null) {
393
+ baseResponse.d = dynamicStaleTime;
394
+ }
395
+ }
396
+ return baseResponse;
397
+ }
398
+ function createErrorContext(ctx, renderSource) {
399
+ return {
400
+ routerKind: 'App Router',
401
+ routePath: ctx.pagePath,
402
+ // TODO: is this correct if `isPossibleServerAction` is a false positive?
403
+ routeType: ctx.isPossibleServerAction ? 'action' : 'render',
404
+ renderSource,
405
+ revalidateReason: (0, _utils.getRevalidateReason)(ctx.workStore)
406
+ };
407
+ }
408
+ /**
409
+ * Produces a RenderResult containing the Flight data for the given request. See
410
+ * `generateDynamicRSCPayload` for information on the contents of the render result.
411
+ */ async function generateDynamicFlightRenderResult(req, ctx, requestStore, options) {
412
+ const { htmlRequestId, renderOpts, requestId, workStore } = ctx;
413
+ const { onInstrumentationRequestError, setReactDebugChannel, isBuildTimePrerendering = false } = renderOpts;
414
+ function onFlightDataRenderError(err, silenceLog) {
415
+ return onInstrumentationRequestError == null ? void 0 : onInstrumentationRequestError(err, req, createErrorContext(ctx, 'react-server-components-payload'), silenceLog);
416
+ }
417
+ const onError = (0, _createerrorhandler.createReactServerErrorHandler)(process.env.NODE_ENV === 'development', isBuildTimePrerendering, workStore.reactServerErrorsByDigest, onFlightDataRenderError);
418
+ const debugChannel = setReactDebugChannel && (0, _debugchannelserver.createDebugChannel)();
419
+ if (debugChannel) {
420
+ setReactDebugChannel(debugChannel.clientSide, htmlRequestId, requestId);
421
+ }
422
+ const { clientModules } = (0, _manifestssingleton.getClientReferenceManifest)();
423
+ // For app dir, use the bundled version of Flight server renderer (renderToReadableStream)
424
+ // which contains the subset React.
425
+ const rscPayload = await _workunitasyncstorageexternal.workUnitAsyncStorage.run(requestStore, generateDynamicRSCPayload, ctx, options);
426
+ const flightStream = _workunitasyncstorageexternal.workUnitAsyncStorage.run(requestStore, _streamops.renderToFlightStream, ctx.componentMod, rscPayload, clientModules, {
427
+ onError,
428
+ temporaryReferences: options == null ? void 0 : options.temporaryReferences,
429
+ filterStackFrame,
430
+ debugChannel: debugChannel == null ? void 0 : debugChannel.serverSide
431
+ });
432
+ return new _flightrenderresult.FlightRenderResult(flightStream, {
433
+ fetchMetrics: workStore.fetchMetrics
434
+ }, options == null ? void 0 : options.waitUntil);
435
+ }
436
+ /**
437
+ * Production-only staged dynamic flight render for cache components. Uses
438
+ * staged rendering to separate static (RDC-backed) from runtime/dynamic
439
+ * content.
440
+ */ async function generateStagedDynamicFlightRenderResult(req, ctx, requestStore) {
441
+ const { componentMod, workStore, renderOpts } = ctx;
442
+ const { renderToReadableStream, routeModule } = componentMod;
443
+ const { loaderTree } = routeModule.userland;
444
+ const { onInstrumentationRequestError, experimental } = renderOpts;
445
+ function onFlightDataRenderError(err, silenceLog) {
446
+ return onInstrumentationRequestError == null ? void 0 : onInstrumentationRequestError(err, req, createErrorContext(ctx, 'react-server-components-payload'), silenceLog);
447
+ }
448
+ const onError = (0, _createerrorhandler.createReactServerErrorHandler)(false, false, workStore.reactServerErrorsByDigest, onFlightDataRenderError);
449
+ const selectStaleTime = (0, _staletime.createSelectStaleTime)(experimental);
450
+ const staleTimeIterable = new _staletime.StaleTimeIterable();
451
+ // TODO(cached-navs): this assumes that we checked during build that there's no sync IO.
452
+ // but it can happen e.g. after a revalidation or conditionally for a param that wasn't prerendered.
453
+ // we should change this to track sync IO, log an error and advance to dynamic.
454
+ const shouldTrackSyncIO = false;
455
+ const stageController = new _stagedrendering.StagedRenderingController(null, null, shouldTrackSyncIO);
456
+ // Initialize stale time tracking on the request store.
457
+ requestStore.stale = _constants1.INFINITE_CACHE;
458
+ requestStore.stagedRendering = stageController;
459
+ requestStore.asyncApiPromises = createAsyncApiPromises(stageController, requestStore.cookies, requestStore.mutableCookies, requestStore.headers);
460
+ (0, _staletime.trackStaleTime)(requestStore, staleTimeIterable, selectStaleTime);
461
+ // Deferred promise for the static stage byte length. Flight serializes the
462
+ // resolved value into the stream so the client knows where the static
463
+ // prefix ends.
464
+ let resolveStaticStageByteLength;
465
+ const staticStageByteLengthPromise = new Promise((resolve)=>{
466
+ resolveStaticStageByteLength = resolve;
467
+ });
468
+ // Check if this route has opted into runtime prefetching via
469
+ // unstable_instant. If so, we piggyback on the dynamic render to fill caches
470
+ // and then spawn a final runtime prerender whose result stream is embedded in
471
+ // the RSC payload. This is gated on the explicit opt-in because it adds extra
472
+ // server processing, increases the response payload size, and the runtime
473
+ // prefetch output should have been validated first.
474
+ const hasRuntimePrefetch = await (0, _instantconfig.anySegmentHasRuntimePrefetchEnabled)(loaderTree);
475
+ let runtimePrefetchStream;
476
+ if (hasRuntimePrefetch) {
477
+ // Create a mutable cache that gets filled during the dynamic render.
478
+ const prerenderResumeDataCache = (0, _resumedatacache.createPrerenderResumeDataCache)();
479
+ requestStore.prerenderResumeDataCache = prerenderResumeDataCache;
480
+ const cacheSignal = new _cachesignal.CacheSignal();
481
+ (0, _trackmoduleloadingexternal.trackPendingModules)(cacheSignal);
482
+ requestStore.cacheSignal = cacheSignal;
483
+ // Create a deferred stream for the runtime prefetch result. Its readable
484
+ // side goes into the RSC payload (Flight serializes it lazily). The
485
+ // writable side receives the runtime prerender result once the dynamic
486
+ // render has filled all caches.
487
+ const runtimePrefetchTransform = new TransformStream();
488
+ runtimePrefetchStream = runtimePrefetchTransform.readable;
489
+ // Wait for the dynamic render to fill caches, then run the final runtime
490
+ // prerender (fire-and-forget — does not block the response).
491
+ void cacheSignal.cacheReady().then(()=>spawnRuntimePrefetchWithFilledCaches(runtimePrefetchTransform.writable, ctx, prerenderResumeDataCache, requestStore, onError));
492
+ }
493
+ const rscPayload = await _workunitasyncstorageexternal.workUnitAsyncStorage.run(requestStore, generateDynamicRSCPayload, ctx, {
494
+ staleTimeIterable,
495
+ staticStageByteLengthPromise,
496
+ runtimePrefetchStream
497
+ });
498
+ const { clientModules } = (0, _manifestssingleton.getClientReferenceManifest)();
499
+ const flightReadableStream = await (0, _apprenderrenderutils.runInSequentialTasks)(()=>{
500
+ stageController.advanceStage(_stagedrendering.RenderStage.Static);
501
+ const stream = _workunitasyncstorageexternal.workUnitAsyncStorage.run(requestStore, renderToReadableStream, rscPayload, clientModules, {
502
+ onError,
503
+ filterStackFrame
504
+ });
505
+ const [dynamicStream, staticStream] = stream.tee();
506
+ countStaticStageBytes(staticStream, stageController).then(resolveStaticStageByteLength);
507
+ return dynamicStream;
508
+ }, ()=>{
509
+ // This is a separate task that doesn't advance a stage. It forces
510
+ // draining the microtask queue so that the stale time iterable is closed
511
+ // before we advance to the dynamic stage.
512
+ void (0, _staletime.finishStaleTimeTracking)(staleTimeIterable);
513
+ }, ()=>{
514
+ stageController.advanceStage(_stagedrendering.RenderStage.Dynamic);
515
+ });
516
+ return new _flightrenderresult.FlightRenderResult(flightReadableStream, {
517
+ fetchMetrics: workStore.fetchMetrics
518
+ });
519
+ }
520
+ /**
521
+ * Runs a final runtime prerender using the provided (already filled) cache and
522
+ * pipes its output into the provided writable stream. The caller is responsible
523
+ * for waiting until caches are warm before calling this function.
524
+ */ async function spawnRuntimePrefetchWithFilledCaches(writable, ctx, prerenderResumeDataCache, requestStore, onError) {
525
+ try {
526
+ const { componentMod, getDynamicParamFromSegment } = ctx;
527
+ const { loaderTree } = componentMod.routeModule.userland;
528
+ const rootParams = (0, _createcomponenttree.getRootParams)(loaderTree, getDynamicParamFromSegment);
529
+ const staleTimeIterable = new _staletime.StaleTimeIterable();
530
+ const { result } = await finalRuntimeServerPrerender(ctx, generateDynamicRSCPayload.bind(null, ctx, {
531
+ staleTimeIterable
532
+ }), prerenderResumeDataCache, null, rootParams, requestStore.headers, requestStore.cookies, requestStore.draftMode, onError, staleTimeIterable);
533
+ await result.prelude.pipeTo(writable);
534
+ } catch {
535
+ // Runtime prerender failed. Close the stream gracefully — the navigation
536
+ // still works, we just won't get cached runtime data.
537
+ try {
538
+ await writable.close();
539
+ } catch {
540
+ // Writable may already be closed/errored.
541
+ }
542
+ }
543
+ }
544
+ async function stagedRenderToReadableStreamWithoutCachesInDev(ctx, requestStore, getPayload, options) {
545
+ // We're rendering while bypassing caches,
546
+ // so we have no hope of showing a useful runtime stage.
547
+ // But we still want things like `params` to show up in devtools correctly,
548
+ // which relies on mechanisms we've set up for staged rendering,
549
+ // so we do a 2-task version (Static -> Dynamic) instead.
550
+ // We aren't filling caches so we don't need to abort this render, it'll
551
+ // stream in a single pass
552
+ const stageController = new _stagedrendering.StagedRenderingController(null, null, false // do not track sync IO (we don't have reliable stages)
553
+ );
554
+ const environmentName = ()=>{
555
+ const currentStage = stageController.currentStage;
556
+ switch(currentStage){
557
+ case _stagedrendering.RenderStage.Before:
558
+ case _stagedrendering.RenderStage.EarlyStatic:
559
+ case _stagedrendering.RenderStage.Static:
560
+ return 'Prerender';
561
+ case _stagedrendering.RenderStage.EarlyRuntime:
562
+ case _stagedrendering.RenderStage.Runtime:
563
+ case _stagedrendering.RenderStage.Dynamic:
564
+ case _stagedrendering.RenderStage.Abandoned:
565
+ return 'Server';
566
+ default:
567
+ currentStage;
568
+ throw Object.defineProperty(new _invarianterror.InvariantError(`Invalid render stage: ${currentStage}`), "__NEXT_ERROR_CODE", {
569
+ value: "E881",
570
+ enumerable: false,
571
+ configurable: true
572
+ });
573
+ }
574
+ };
575
+ requestStore.stagedRendering = stageController;
576
+ requestStore.asyncApiPromises = createAsyncApiPromises(stageController, requestStore.cookies, requestStore.mutableCookies, requestStore.headers);
577
+ const { clientModules } = (0, _manifestssingleton.getClientReferenceManifest)();
578
+ const rscPayload = await getPayload(requestStore);
579
+ return await (0, _apprenderrenderutils.runInSequentialTasks)(()=>{
580
+ stageController.advanceStage(_stagedrendering.RenderStage.Static);
581
+ return _workunitasyncstorageexternal.workUnitAsyncStorage.run(requestStore, _streamops.renderToFlightStream, ctx.componentMod, rscPayload, clientModules, {
582
+ ...options,
583
+ environmentName
584
+ });
585
+ }, ()=>{
586
+ stageController.advanceStage(_stagedrendering.RenderStage.Dynamic);
587
+ });
588
+ }
589
+ /**
590
+ * Fork of `generateDynamicFlightRenderResult` that renders using `renderWithRestartOnCacheMissInDev`
591
+ * to ensure correct separation of environments Prerender/Server (for use in Cache Components)
592
+ */ async function generateDynamicFlightRenderResultWithStagesInDev(req, ctx, initialRequestStore, createRequestStore, fallbackParams) {
593
+ const { htmlRequestId, renderOpts, requestId, workStore, componentMod: { createElement, routeModule: { userland: { loaderTree } } }, url } = ctx;
594
+ const { onInstrumentationRequestError, setReactDebugChannel, setCacheStatus, isBuildTimePrerendering = false } = renderOpts;
595
+ function onFlightDataRenderError(err, silenceLog) {
596
+ return onInstrumentationRequestError == null ? void 0 : onInstrumentationRequestError(err, req, createErrorContext(ctx, 'react-server-components-payload'), silenceLog);
597
+ }
598
+ const onError = (0, _createerrorhandler.createReactServerErrorHandler)(process.env.NODE_ENV === 'development', isBuildTimePrerendering, workStore.reactServerErrorsByDigest, onFlightDataRenderError);
599
+ // We validate RSC requests for HMR refreshes and client navigations when
600
+ // instant configs exist, since we render all the layouts necessary to perform
601
+ // the validation in those cases.
602
+ const shouldValidate = !isBypassingCachesInDev(initialRequestStore) && (initialRequestStore.isHmrRefresh === true || await (0, _instantconfig.anySegmentNeedsInstantValidationInDev)(loaderTree));
603
+ const getPayload = async (requestStore)=>{
604
+ const payload = await _workunitasyncstorageexternal.workUnitAsyncStorage.run(requestStore, generateDynamicRSCPayload, ctx, undefined);
605
+ if (isBypassingCachesInDev(requestStore)) {
606
+ // Mark the RSC payload to indicate that caches were bypassed in dev.
607
+ // This lets the client know not to cache anything based on this render.
608
+ payload._bypassCachesInDev = createElement(WarnForBypassCachesInDev, {
609
+ route: workStore.route
610
+ });
611
+ } else if (shouldValidate) {
612
+ // If this payload will be used for validation, it needs to contain the
613
+ // canonical URL. Without it we'd get an error.
614
+ payload.c = prepareInitialCanonicalUrl(url);
615
+ }
616
+ return payload;
617
+ };
618
+ let debugChannel;
619
+ let stream;
620
+ if (// We only do this flow if we can safely recreate the store from scratch
621
+ // (which is not the case for renders after an action)
622
+ createRequestStore && // We only do this flow if we're not bypassing caches in dev using
623
+ // "disable cache" in devtools or a hard refresh (cache-control: "no-store")
624
+ !isBypassingCachesInDev(initialRequestStore)) {
625
+ // Before we kick off the render, we set the cache status back to it's initial state
626
+ // in case a previous render bypassed the cache.
627
+ if (setCacheStatus) {
628
+ setCacheStatus('ready', htmlRequestId);
629
+ }
630
+ const { stream: serverStream, accumulatedChunksPromise, syncInterruptReason, startTime, staticStageEndTime, runtimeStageEndTime, debugChannel: returnedDebugChannel, requestStore: finalRequestStore } = await renderWithRestartOnCacheMissInDev(ctx, initialRequestStore, createRequestStore, getPayload, onError);
631
+ if (shouldValidate) {
632
+ let validationDebugChannelClient = undefined;
633
+ if (returnedDebugChannel) {
634
+ const [t1, t2] = returnedDebugChannel.clientSide.readable.tee();
635
+ returnedDebugChannel.clientSide.readable = t1;
636
+ validationDebugChannelClient = nodeStreamFromReadableStream(t2);
637
+ }
638
+ _consoleasyncstorageexternal.consoleAsyncStorage.run({
639
+ dim: true
640
+ }, spawnStaticShellValidationInDev, accumulatedChunksPromise, syncInterruptReason, startTime, staticStageEndTime, runtimeStageEndTime, ctx, finalRequestStore, fallbackParams, validationDebugChannelClient);
641
+ } else {
642
+ logValidationSkipped(ctx);
643
+ }
644
+ debugChannel = returnedDebugChannel;
645
+ stream = serverStream;
646
+ } else {
647
+ // We're either bypassing caches or we can't restart the render.
648
+ // Do a dynamic render, but with (basic) environment labels.
649
+ // Set cache status to bypass when specifically bypassing caches in dev
650
+ if (setCacheStatus) {
651
+ setCacheStatus('bypass', htmlRequestId);
652
+ }
653
+ debugChannel = setReactDebugChannel && (0, _debugchannelserver.createDebugChannel)();
654
+ stream = await stagedRenderToReadableStreamWithoutCachesInDev(ctx, initialRequestStore, getPayload, {
655
+ onError: onError,
656
+ filterStackFrame,
657
+ debugChannel: debugChannel == null ? void 0 : debugChannel.serverSide
658
+ });
659
+ }
660
+ if (debugChannel && setReactDebugChannel) {
661
+ setReactDebugChannel(debugChannel.clientSide, htmlRequestId, requestId);
662
+ }
663
+ return new _flightrenderresult.FlightRenderResult(stream, {
664
+ fetchMetrics: workStore.fetchMetrics
665
+ });
666
+ }
667
+ async function generateRuntimePrefetchResult(req, ctx, requestStore) {
668
+ const { workStore, renderOpts } = ctx;
669
+ const { isBuildTimePrerendering = false, onInstrumentationRequestError } = renderOpts;
670
+ function onFlightDataRenderError(err, silenceLog) {
671
+ return onInstrumentationRequestError == null ? void 0 : onInstrumentationRequestError(err, req, // TODO(runtime-ppr): should we use a different value?
672
+ createErrorContext(ctx, 'react-server-components-payload'), silenceLog);
673
+ }
674
+ const onError = (0, _createerrorhandler.createReactServerErrorHandler)(false, isBuildTimePrerendering, workStore.reactServerErrorsByDigest, onFlightDataRenderError);
675
+ const metadata = {};
676
+ const staleTimeIterable = new _staletime.StaleTimeIterable();
677
+ const { componentMod: { routeModule: { userland: { loaderTree } } }, getDynamicParamFromSegment } = ctx;
678
+ const rootParams = (0, _createcomponenttree.getRootParams)(loaderTree, getDynamicParamFromSegment);
679
+ // We need to share caches between the prospective prerender and the final prerender,
680
+ // but we're not going to persist this anywhere.
681
+ const prerenderResumeDataCache = (0, _resumedatacache.createPrerenderResumeDataCache)();
682
+ // We're not resuming an existing render.
683
+ const renderResumeDataCache = null;
684
+ await prospectiveRuntimeServerPrerender(ctx, generateDynamicRSCPayload.bind(null, ctx), prerenderResumeDataCache, renderResumeDataCache, rootParams, requestStore.headers, requestStore.cookies, requestStore.draftMode);
685
+ const response = await finalRuntimeServerPrerender(ctx, generateDynamicRSCPayload.bind(null, ctx, {
686
+ staleTimeIterable
687
+ }), prerenderResumeDataCache, renderResumeDataCache, rootParams, requestStore.headers, requestStore.cookies, requestStore.draftMode, onError, staleTimeIterable);
688
+ applyMetadataFromPrerenderResult(response, metadata, workStore);
689
+ metadata.fetchMetrics = ctx.workStore.fetchMetrics;
690
+ return new _flightrenderresult.FlightRenderResult(response.result.prelude, metadata);
691
+ }
692
+ async function prospectiveRuntimeServerPrerender(ctx, getPayload, prerenderResumeDataCache, renderResumeDataCache, rootParams, headers, cookies, draftMode) {
693
+ const { implicitTags, renderOpts, workStore } = ctx;
694
+ const { ComponentMod } = renderOpts;
695
+ // Prerender controller represents the lifetime of the prerender.
696
+ // It will be aborted when a Task is complete or a synchronously aborting
697
+ // API is called. Notably during cache-filling renders this does not actually
698
+ // terminate the render itself which will continue until all caches are filled
699
+ const initialServerPrerenderController = new AbortController();
700
+ // This controller represents the lifetime of the React render call. Notably
701
+ // during the cache-filling render it is different from the prerender controller
702
+ // because we don't want to end the react render until all caches are filled.
703
+ const initialServerRenderController = new AbortController();
704
+ // The cacheSignal helps us track whether caches are still filling or we are ready
705
+ // to cut the render off.
706
+ const cacheSignal = new _cachesignal.CacheSignal();
707
+ const initialServerPrerenderStore = {
708
+ type: 'prerender-runtime',
709
+ phase: 'render',
710
+ rootParams,
711
+ implicitTags,
712
+ renderSignal: initialServerRenderController.signal,
713
+ controller: initialServerPrerenderController,
714
+ // During the initial prerender we need to track all cache reads to ensure
715
+ // we render long enough to fill every cache it is possible to visit during
716
+ // the final prerender.
717
+ cacheSignal,
718
+ // We only need to track dynamic accesses during the final prerender.
719
+ dynamicTracking: null,
720
+ // Runtime prefetches are never cached server-side, only client-side,
721
+ // so we set `expire` and `revalidate` to their minimum values just in case.
722
+ revalidate: 1,
723
+ expire: 0,
724
+ stale: _constants1.INFINITE_CACHE,
725
+ tags: [
726
+ ...implicitTags.tags
727
+ ],
728
+ renderResumeDataCache,
729
+ prerenderResumeDataCache,
730
+ hmrRefreshHash: undefined,
731
+ // We don't track vary params during initial prerender, only the final one
732
+ varyParamsAccumulator: null,
733
+ // No stage sequencing needed for prospective renders.
734
+ stagedRendering: null,
735
+ // These are not present in regular prerenders, but allowed in a runtime prerender.
736
+ headers,
737
+ cookies,
738
+ draftMode
739
+ };
740
+ const { clientModules } = (0, _manifestssingleton.getClientReferenceManifest)();
741
+ // We're not going to use the result of this render because the only time it could be used
742
+ // is if it completes in a microtask and that's likely very rare for any non-trivial app
743
+ const initialServerPayload = await _workunitasyncstorageexternal.workUnitAsyncStorage.run(initialServerPrerenderStore, getPayload);
744
+ const prerenderOptions = {
745
+ filterStackFrame,
746
+ onError: (err)=>{
747
+ const digest = (0, _createerrorhandler.getDigestForWellKnownError)(err);
748
+ if (digest) {
749
+ return digest;
750
+ }
751
+ if (initialServerPrerenderController.signal.aborted) {
752
+ // The render aborted before this error was handled which indicates
753
+ // the error is caused by unfinished components within the render
754
+ return;
755
+ } else if (process.env.NEXT_DEBUG_BUILD || process.env.__NEXT_VERBOSE_LOGGING) {
756
+ (0, _prospectiverenderutils.printDebugThrownValueForProspectiveRender)(err, workStore.route, _prospectiverenderutils.Phase.ProspectiveRender);
757
+ }
758
+ },
759
+ // We don't want to stop rendering until the cacheSignal is complete so we pass
760
+ // a different signal to this render call than is used by dynamic APIs to signify
761
+ // transitioning out of the prerender environment
762
+ signal: initialServerRenderController.signal
763
+ };
764
+ const pendingInitialServerResult = _workunitasyncstorageexternal.workUnitAsyncStorage.run(initialServerPrerenderStore, (0, _streamops.getServerPrerender)(ComponentMod), initialServerPayload, clientModules, prerenderOptions);
765
+ // Wait for all caches to be finished filling and for async imports to resolve
766
+ (0, _trackmoduleloadingexternal.trackPendingModules)(cacheSignal);
767
+ await cacheSignal.cacheReady();
768
+ initialServerRenderController.abort();
769
+ initialServerPrerenderController.abort();
770
+ // We don't need to continue the prerender process if we already
771
+ // detected invalid dynamic usage in the initial prerender phase.
772
+ if (workStore.invalidDynamicUsageError) {
773
+ throw workStore.invalidDynamicUsageError;
774
+ }
775
+ try {
776
+ return await (0, _apprenderprerenderutils.createReactServerPrerenderResult)(pendingInitialServerResult);
777
+ } catch (err) {
778
+ if (initialServerRenderController.signal.aborted || initialServerPrerenderController.signal.aborted) {
779
+ // These are expected errors that might error the prerender. we ignore them.
780
+ } else if (process.env.NEXT_DEBUG_BUILD || process.env.__NEXT_VERBOSE_LOGGING) {
781
+ // We don't normally log these errors because we are going to retry anyway but
782
+ // it can be useful for debugging Next.js itself to get visibility here when needed
783
+ (0, _prospectiverenderutils.printDebugThrownValueForProspectiveRender)(err, workStore.route, _prospectiverenderutils.Phase.ProspectiveRender);
784
+ }
785
+ return null;
786
+ }
787
+ }
788
+ /**
789
+ * Prepends a single ASCII byte to the stream indicating whether the response
790
+ * is partial (contains dynamic holes): '~' (0x7e) for partial, '#' (0x23)
791
+ * for complete.
792
+ */ function prependIsPartialByte(stream, isPartial) {
793
+ const byte = new Uint8Array([
794
+ isPartial ? 0x7e : 0x23
795
+ ]);
796
+ return stream.pipeThrough(new TransformStream({
797
+ start (controller) {
798
+ controller.enqueue(byte);
799
+ }
800
+ }));
801
+ }
802
+ async function finalRuntimeServerPrerender(ctx, getPayload, prerenderResumeDataCache, renderResumeDataCache, rootParams, headers, cookies, draftMode, onError, staleTimeIterable) {
803
+ const { implicitTags, renderOpts } = ctx;
804
+ const { ComponentMod, experimental, isDebugDynamicAccesses } = renderOpts;
805
+ const selectStaleTime = (0, _staletime.createSelectStaleTime)(experimental);
806
+ let serverIsDynamic = false;
807
+ const finalServerController = new AbortController();
808
+ const serverDynamicTracking = (0, _dynamicrendering.createDynamicTrackingState)(isDebugDynamicAccesses);
809
+ const finalStageController = new _stagedrendering.StagedRenderingController(finalServerController.signal, null, true // track sync IO
810
+ );
811
+ const varyParamsAccumulator = (0, _varyparams.createResponseVaryParamsAccumulator)();
812
+ const finalServerPrerenderStore = {
813
+ type: 'prerender-runtime',
814
+ phase: 'render',
815
+ rootParams,
816
+ implicitTags,
817
+ renderSignal: finalServerController.signal,
818
+ controller: finalServerController,
819
+ // All caches we could read must already be filled so no tracking is necessary
820
+ cacheSignal: null,
821
+ dynamicTracking: serverDynamicTracking,
822
+ // Runtime prefetches are never cached server-side, only client-side,
823
+ // so we set `expire` and `revalidate` to their minimum values just in case.
824
+ revalidate: 1,
825
+ expire: 0,
826
+ stale: _constants1.INFINITE_CACHE,
827
+ tags: [
828
+ ...implicitTags.tags
829
+ ],
830
+ prerenderResumeDataCache,
831
+ renderResumeDataCache,
832
+ hmrRefreshHash: undefined,
833
+ varyParamsAccumulator,
834
+ // Used to separate the stages in the 5-task pipeline.
835
+ stagedRendering: finalStageController,
836
+ // These are not present in regular prerenders, but allowed in a runtime prerender.
837
+ headers,
838
+ cookies,
839
+ draftMode
840
+ };
841
+ (0, _staletime.trackStaleTime)(finalServerPrerenderStore, staleTimeIterable, selectStaleTime);
842
+ const { clientModules } = (0, _manifestssingleton.getClientReferenceManifest)();
843
+ const finalRSCPayload = await _workunitasyncstorageexternal.workUnitAsyncStorage.run(finalServerPrerenderStore, getPayload);
844
+ let prerenderIsPending = true;
845
+ const result = await (0, _apprenderrenderutils.runInSequentialTasks)(async ()=>{
846
+ // EarlyStatic stage: render begins.
847
+ // Runtime-prefetchable segments render immediately.
848
+ // Non-prefetchable segments are gated until the Static stage.
849
+ finalStageController.advanceStage(_stagedrendering.RenderStage.EarlyStatic);
850
+ const prerenderResult = await _workunitasyncstorageexternal.workUnitAsyncStorage.run(finalServerPrerenderStore, (0, _streamops.getServerPrerender)(ComponentMod), finalRSCPayload, clientModules, {
851
+ filterStackFrame,
852
+ onError,
853
+ signal: finalServerController.signal
854
+ });
855
+ prerenderIsPending = false;
856
+ return prerenderResult;
857
+ }, ()=>{
858
+ // Advance to Static stage: resolve promise holding back
859
+ // non-prefetchable segments so they can begin rendering.
860
+ finalStageController.advanceStage(_stagedrendering.RenderStage.Static);
861
+ }, ()=>{
862
+ // Advance to EarlyRuntime stage: resolve cookies/headers for
863
+ // runtime-prefetchable segments. Sync IO is checked here.
864
+ finalStageController.advanceStage(_stagedrendering.RenderStage.EarlyRuntime);
865
+ }, ()=>{
866
+ // Advance to Runtime stage: resolve cookies/headers for
867
+ // non-prefetchable segments. Sync IO is allowed here.
868
+ finalStageController.advanceStage(_stagedrendering.RenderStage.Runtime);
869
+ }, ()=>{
870
+ Promise.all([
871
+ (0, _staletime.finishStaleTimeTracking)(staleTimeIterable),
872
+ (0, _varyparams.finishAccumulatingVaryParams)(varyParamsAccumulator)
873
+ ]).then(()=>{
874
+ // Abort. This runs as a microtask after Flight has flushed the
875
+ // staleTime and varyParams closing chunks, but before the next
876
+ // macrotask resolves the overall result.
877
+ if (finalServerController.signal.aborted) {
878
+ // If the server controller is already aborted we must have called
879
+ // something that required aborting the prerender synchronously such
880
+ // as with new Date()
881
+ serverIsDynamic = true;
882
+ return;
883
+ }
884
+ if (prerenderIsPending) {
885
+ // If prerenderIsPending then we have blocked for longer than a Task
886
+ // and we assume there is something unfinished.
887
+ serverIsDynamic = true;
888
+ }
889
+ finalServerController.abort();
890
+ });
891
+ });
892
+ result.prelude = prependIsPartialByte(result.prelude, serverIsDynamic);
893
+ return {
894
+ result,
895
+ // TODO(runtime-ppr): do we need to produce a digest map here?
896
+ // digestErrorsMap: ...,
897
+ dynamicAccess: serverDynamicTracking,
898
+ isPartial: serverIsDynamic,
899
+ collectedRevalidate: finalServerPrerenderStore.revalidate,
900
+ collectedExpire: finalServerPrerenderStore.expire,
901
+ collectedStale: staleTimeIterable.currentValue,
902
+ collectedTags: finalServerPrerenderStore.tags
903
+ };
904
+ }
905
+ /**
906
+ * Crawlers will inadvertently think the canonicalUrl in the RSC payload should be crawled
907
+ * when our intention is to just seed the router state with the current URL.
908
+ * This function splits up the pathname so that we can later join it on
909
+ * when we're ready to consume the path.
910
+ */ function prepareInitialCanonicalUrl(url) {
911
+ return (url.pathname + url.search).split('/');
912
+ }
913
+ function getRenderedSearch(query) {
914
+ // Inlined implementation of querystring.encode, which is not available in
915
+ // the Edge runtime.
916
+ const pairs = [];
917
+ for(const key in query){
918
+ const value = query[key];
919
+ if (value == null) continue;
920
+ if (Array.isArray(value)) {
921
+ for (const v of value){
922
+ pairs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(v))}`);
923
+ }
924
+ } else {
925
+ pairs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`);
926
+ }
927
+ }
928
+ // The result should match the format of a web URL's `search` property, since
929
+ // this is the format that's stored in the App Router state.
930
+ // TODO: We're a bit inconsistent about this. The x-nextjs-rewritten-query
931
+ // header omits the leading question mark. Should refactor to always do
932
+ // that instead.
933
+ if (pairs.length === 0) {
934
+ // If the search string is empty, return an empty string.
935
+ return '';
936
+ }
937
+ // Prepend '?' to the search params string.
938
+ return '?' + pairs.join('&');
939
+ }
940
+ // This is the data necessary to render <AppRouter /> when no SSR errors are encountered
941
+ async function getRSCPayload(tree, ctx, options) {
942
+ var _ctx_renderOpts_prefetchHints;
943
+ const { is404, staleTimeIterable, staticStageByteLengthPromise, runtimePrefetchStream } = options;
944
+ const injectedCSS = new Set();
945
+ const injectedJS = new Set();
946
+ const injectedFontPreloadTags = new Set();
947
+ let missingSlots;
948
+ // We only track missing parallel slots in development
949
+ if (process.env.__NEXT_DEV_SERVER) {
950
+ missingSlots = new Set();
951
+ }
952
+ const { getDynamicParamFromSegment, query, appUsingSizeAdjustment, componentMod: { createMetadataComponents, createElement, Fragment }, url, workStore } = ctx;
953
+ const hints = ((_ctx_renderOpts_prefetchHints = ctx.renderOpts.prefetchHints) == null ? void 0 : _ctx_renderOpts_prefetchHints[ctx.pagePath]) ?? null;
954
+ const initialTree = await (0, _createflightrouterstatefromloadertree.createFlightRouterStateFromLoaderTree)(tree, hints, getDynamicParamFromSegment, query);
955
+ const serveStreamingMetadata = !!ctx.renderOpts.serveStreamingMetadata;
956
+ const hasGlobalNotFound = !!tree[2]['global-not-found'];
957
+ const metadataIsRuntimePrefetchable = await (0, _instantconfig.anySegmentHasRuntimePrefetchEnabled)(tree);
958
+ const { Viewport, Metadata, MetadataOutlet } = createMetadataComponents({
959
+ tree,
960
+ // When it's using global-not-found, metadata errorType is undefined, which will retrieve the
961
+ // metadata from the page.
962
+ // When it's using not-found, metadata errorType is 'not-found', which will retrieve the
963
+ // metadata from the not-found.js boundary.
964
+ // TODO: remove this condition and keep it undefined when global-not-found is stabilized.
965
+ errorType: is404 && !hasGlobalNotFound ? 'not-found' : undefined,
966
+ parsedQuery: query,
967
+ pathname: url.pathname,
968
+ metadataContext: (0, _metadatacontext.createMetadataContext)(ctx.renderOpts),
969
+ interpolatedParams: ctx.interpolatedParams,
970
+ serveStreamingMetadata,
971
+ isRuntimePrefetchable: metadataIsRuntimePrefetchable
972
+ });
973
+ const preloadCallbacks = [];
974
+ const seedData = await (0, _createcomponenttree.createComponentTree)({
975
+ ctx,
976
+ loaderTree: tree,
977
+ parentParams: {},
978
+ parentOptionalCatchAllParamName: null,
979
+ parentRuntimePrefetchable: false,
980
+ injectedCSS,
981
+ injectedJS,
982
+ injectedFontPreloadTags,
983
+ rootLayoutIncluded: false,
984
+ missingSlots,
985
+ preloadCallbacks,
986
+ authInterrupts: ctx.renderOpts.experimental.authInterrupts,
987
+ MetadataOutlet
988
+ });
989
+ // When the `vary` response header is present with `Next-URL`, that means there's a chance
990
+ // it could respond differently if there's an interception route. We provide this information
991
+ // to `AppRouter` so that it can properly seed the prefetch cache with a prefix, if needed.
992
+ // In dev, the Vary header may not reliably reflect whether a route can
993
+ // be intercepted, because interception routes are compiled on demand.
994
+ // Default to true so the client doesn't cache a stale Fallback entry.
995
+ const varyHeader = ctx.res.getHeader('vary');
996
+ const couldBeIntercepted = !!process.env.__NEXT_DEV_SERVER || typeof varyHeader === 'string' && varyHeader.includes(_approuterheaders.NEXT_URL);
997
+ const initialHead = createElement(Fragment, {
998
+ key: flightDataPathHeadKey
999
+ }, createElement(NonIndex, {
1000
+ createElement,
1001
+ pagePath: ctx.pagePath,
1002
+ statusCode: ctx.res.statusCode,
1003
+ isPossibleServerAction: ctx.isPossibleServerAction
1004
+ }), createElement(Viewport, null), createElement(Metadata, null), appUsingSizeAdjustment ? createElement('meta', {
1005
+ name: 'next-size-adjust',
1006
+ content: ''
1007
+ }) : null);
1008
+ const { GlobalError, styles: globalErrorStyles } = await getGlobalErrorStyles(tree, ctx);
1009
+ // Assume the head we're rendering contains only partial data if PPR is
1010
+ // enabled and this is a statically generated response. This is used by the
1011
+ // client Segment Cache after a prefetch to determine if it can skip the
1012
+ // second request to fill in the dynamic data.
1013
+ //
1014
+ // See similar comment in create-component-tree.tsx for more context.
1015
+ const isPossiblyPartialHead = workStore.isStaticGeneration && ctx.renderOpts.experimental.isRoutePPREnabled === true;
1016
+ return maybeAppendBuildIdToRSCPayload(ctx, {
1017
+ // See the comment above the `Preloads` component (below) for why this is part of the payload
1018
+ P: createElement(Preloads, {
1019
+ preloadCallbacks: preloadCallbacks
1020
+ }),
1021
+ c: prepareInitialCanonicalUrl(url),
1022
+ q: getRenderedSearch(query),
1023
+ i: !!couldBeIntercepted,
1024
+ f: [
1025
+ [
1026
+ initialTree,
1027
+ seedData,
1028
+ initialHead,
1029
+ isPossiblyPartialHead
1030
+ ]
1031
+ ],
1032
+ m: missingSlots,
1033
+ G: [
1034
+ GlobalError,
1035
+ globalErrorStyles
1036
+ ],
1037
+ // Tells the client whether this route supports per-segment prefetching.
1038
+ // With Cache Components, all routes support it. Without it, only fully
1039
+ // static pages do, because their per-segment prefetch responses are
1040
+ // generated during static generation (build or ISR).
1041
+ S: workStore.isStaticGeneration || ctx.renderOpts.cacheComponents,
1042
+ h: (0, _varyparams.getMetadataVaryParamsThenable)(),
1043
+ s: staleTimeIterable,
1044
+ l: staticStageByteLengthPromise,
1045
+ p: runtimePrefetchStream,
1046
+ // Include the per-page dynamic stale time from unstable_dynamicStaleTime, but
1047
+ // only for dynamic renders. The client treats its presence as
1048
+ // authoritative.
1049
+ // TODO: Move this to the prefetch hints file so we don't have to walk
1050
+ // the tree on every render.
1051
+ d: !workStore.isStaticGeneration ? await getDynamicStaleTime(tree) ?? undefined : undefined
1052
+ });
1053
+ }
1054
+ /**
1055
+ * Preload calls (such as `ReactDOM.preloadStyle` and `ReactDOM.preloadFont`) need to be called during rendering
1056
+ * in order to create the appropriate preload tags in the DOM, otherwise they're a no-op. Since we invoke
1057
+ * renderToReadableStream with a function that returns component props rather than a component itself, we use
1058
+ * this component to "render " the preload calls.
1059
+ */ function Preloads({ preloadCallbacks }) {
1060
+ preloadCallbacks.forEach((preloadFn)=>preloadFn());
1061
+ return null;
1062
+ }
1063
+ // This is the data necessary to render <AppRouter /> when an error state is triggered
1064
+ async function getErrorRSCPayload(tree, ctx, ssrError, errorType) {
1065
+ var _ctx_renderOpts_prefetchHints;
1066
+ const { getDynamicParamFromSegment, query, componentMod: { createMetadataComponents, createElement, Fragment }, url, workStore } = ctx;
1067
+ const serveStreamingMetadata = !!ctx.renderOpts.serveStreamingMetadata;
1068
+ const metadataIsRuntimePrefetchable = await (0, _instantconfig.anySegmentHasRuntimePrefetchEnabled)(tree);
1069
+ const { Viewport, Metadata } = createMetadataComponents({
1070
+ tree,
1071
+ parsedQuery: query,
1072
+ pathname: url.pathname,
1073
+ metadataContext: (0, _metadatacontext.createMetadataContext)(ctx.renderOpts),
1074
+ errorType,
1075
+ interpolatedParams: ctx.interpolatedParams,
1076
+ serveStreamingMetadata: serveStreamingMetadata,
1077
+ isRuntimePrefetchable: metadataIsRuntimePrefetchable
1078
+ });
1079
+ const initialHead = createElement(Fragment, {
1080
+ key: flightDataPathHeadKey
1081
+ }, createElement(NonIndex, {
1082
+ createElement,
1083
+ pagePath: ctx.pagePath,
1084
+ statusCode: ctx.res.statusCode,
1085
+ isPossibleServerAction: ctx.isPossibleServerAction
1086
+ }), createElement(Viewport, null), process.env.__NEXT_DEV_SERVER && createElement('meta', {
1087
+ name: 'next-error',
1088
+ content: 'not-found'
1089
+ }), createElement(Metadata, null));
1090
+ const errorHints = ((_ctx_renderOpts_prefetchHints = ctx.renderOpts.prefetchHints) == null ? void 0 : _ctx_renderOpts_prefetchHints[ctx.pagePath]) ?? null;
1091
+ const initialTree = await (0, _createflightrouterstatefromloadertree.createFlightRouterStateFromLoaderTree)(tree, errorHints, getDynamicParamFromSegment, query);
1092
+ let err = undefined;
1093
+ if (ssrError) {
1094
+ err = (0, _iserror.default)(ssrError) ? ssrError : Object.defineProperty(new Error(ssrError + ''), "__NEXT_ERROR_CODE", {
1095
+ value: "E394",
1096
+ enumerable: false,
1097
+ configurable: true
1098
+ });
1099
+ }
1100
+ // For metadata notFound error there's no global not found boundary on top
1101
+ // so we create a not found page with AppRouter
1102
+ const seedData = [
1103
+ createElement('html', {
1104
+ id: '__next_error__'
1105
+ }, createElement('head', null), createElement('body', null, process.env.__NEXT_DEV_SERVER && err ? createElement('template', {
1106
+ 'data-next-error-message': err.message,
1107
+ 'data-next-error-digest': 'digest' in err ? err.digest : '',
1108
+ 'data-next-error-stack': err.stack
1109
+ }) : null)),
1110
+ {},
1111
+ null,
1112
+ false,
1113
+ null
1114
+ ];
1115
+ const { GlobalError, styles: globalErrorStyles } = await getGlobalErrorStyles(tree, ctx);
1116
+ const isPossiblyPartialHead = workStore.isStaticGeneration && ctx.renderOpts.experimental.isRoutePPREnabled === true;
1117
+ return maybeAppendBuildIdToRSCPayload(ctx, {
1118
+ c: prepareInitialCanonicalUrl(url),
1119
+ q: getRenderedSearch(query),
1120
+ m: undefined,
1121
+ i: false,
1122
+ f: [
1123
+ [
1124
+ initialTree,
1125
+ seedData,
1126
+ initialHead,
1127
+ isPossiblyPartialHead
1128
+ ]
1129
+ ],
1130
+ G: [
1131
+ GlobalError,
1132
+ globalErrorStyles
1133
+ ],
1134
+ // Tells the client whether this route supports per-segment prefetching.
1135
+ // With Cache Components, all routes support it. Without it, only fully
1136
+ // static pages do, because their per-segment prefetch responses are
1137
+ // generated during static generation (build or ISR).
1138
+ S: workStore.isStaticGeneration || ctx.renderOpts.cacheComponents,
1139
+ h: (0, _varyparams.getMetadataVaryParamsThenable)()
1140
+ });
1141
+ }
1142
+ // This component must run in an SSR context. It will render the RSC root component
1143
+ function App({ reactServerStream, reactDebugStream, debugEndTime, preinitScripts, ServerInsertedHTMLProvider, nonce, images }) {
1144
+ preinitScripts();
1145
+ const response = _react.use((0, _useflightresponse.getFlightStream)(reactServerStream, reactDebugStream, debugEndTime, nonce));
1146
+ const initialState = (0, _createinitialrouterstate.createInitialRouterState)({
1147
+ // This is not used during hydration, so we don't have to pass a
1148
+ // real timestamp.
1149
+ navigatedAt: -1,
1150
+ initialRSCPayload: response,
1151
+ // location is not initialized in the SSR render
1152
+ // it's set to window.location during hydration
1153
+ location: null
1154
+ });
1155
+ const actionQueue = (0, _approuterinstance.createMutableActionQueue)(initialState, null);
1156
+ const { HeadManagerContext } = require('../../shared/lib/head-manager-context.shared-runtime');
1157
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(HeadManagerContext.Provider, {
1158
+ value: {
1159
+ appDir: true,
1160
+ nonce
1161
+ },
1162
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_imageconfigcontextsharedruntime.ImageConfigContext.Provider, {
1163
+ value: images ?? _imageconfig.imageConfigDefault,
1164
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(ServerInsertedHTMLProvider, {
1165
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_approuter.default, {
1166
+ actionQueue: actionQueue,
1167
+ globalErrorState: response.G
1168
+ })
1169
+ })
1170
+ })
1171
+ });
1172
+ /* eslint-enable @next/internal/no-ambiguous-jsx -- React Client */ }
1173
+ // @TODO our error stream should be probably just use the same root component. But it was previously
1174
+ // different I don't want to figure out if that is meaningful at this time so just keeping the behavior
1175
+ // consistent for now.
1176
+ function ErrorApp({ reactServerStream, preinitScripts, ServerInsertedHTMLProvider, nonce, images }) {
1177
+ /* eslint-disable @next/internal/no-ambiguous-jsx -- React Client */ preinitScripts();
1178
+ const response = _react.use((0, _useflightresponse.getFlightStream)(reactServerStream, undefined, undefined, nonce));
1179
+ const initialState = (0, _createinitialrouterstate.createInitialRouterState)({
1180
+ // This is not used during hydration, so we don't have to pass a
1181
+ // real timestamp.
1182
+ navigatedAt: -1,
1183
+ initialRSCPayload: response,
1184
+ // location is not initialized in the SSR render
1185
+ // it's set to window.location during hydration
1186
+ location: null
1187
+ });
1188
+ const actionQueue = (0, _approuterinstance.createMutableActionQueue)(initialState, null);
1189
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_imageconfigcontextsharedruntime.ImageConfigContext.Provider, {
1190
+ value: images ?? _imageconfig.imageConfigDefault,
1191
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(ServerInsertedHTMLProvider, {
1192
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_approuter.default, {
1193
+ actionQueue: actionQueue,
1194
+ globalErrorState: response.G
1195
+ })
1196
+ })
1197
+ });
1198
+ /* eslint-enable @next/internal/no-ambiguous-jsx -- React Client */ }
1199
+ async function renderToHTMLOrFlightImpl(req, res, url, pagePath, query, renderOpts, workStore, parsedRequestHeaders, postponedState, serverComponentsHmrCache, sharedContext, interpolatedParams, fallbackRouteParams) {
1200
+ const isNotFoundPath = pagePath === '/404';
1201
+ if (isNotFoundPath) {
1202
+ res.statusCode = 404;
1203
+ }
1204
+ // A unique request timestamp used by development to ensure that it's
1205
+ // consistent and won't change during this request. This is important to
1206
+ // avoid that resources can be deduped by React Float if the same resource is
1207
+ // rendered or preloaded multiple times: `<link href="a.css?v={Date.now()}"/>`.
1208
+ const requestTimestamp = Date.now();
1209
+ const { ComponentMod, nextFontManifest, serverActions, assetPrefix = '', enableTainting, cacheComponents, setIsrStatus } = renderOpts;
1210
+ const { cachedNavigations } = renderOpts.experimental;
1211
+ // We need to expose the bundled `require` API globally for
1212
+ // react-server-dom-webpack. This is a hack until we find a better way.
1213
+ if (ComponentMod.__next_app__) {
1214
+ const instrumented = (0, _clientcomponentrendererlogger.wrapClientComponentLoader)(ComponentMod);
1215
+ // When we are prerendering if there is a cacheSignal for tracking
1216
+ // cache reads we track calls to `loadChunk` and `require`. This allows us
1217
+ // to treat chunk/module loading with similar semantics as cache reads to avoid
1218
+ // module loading from causing a prerender to abort too early.
1219
+ const shouldTrackModuleLoading = ()=>{
1220
+ if (!cacheComponents) {
1221
+ return false;
1222
+ }
1223
+ if (process.env.__NEXT_DEV_SERVER) {
1224
+ return true;
1225
+ }
1226
+ const workUnitStore = _workunitasyncstorageexternal.workUnitAsyncStorage.getStore();
1227
+ if (!workUnitStore) {
1228
+ return false;
1229
+ }
1230
+ switch(workUnitStore.type){
1231
+ case 'prerender':
1232
+ case 'prerender-client':
1233
+ case 'validation-client':
1234
+ case 'prerender-runtime':
1235
+ case 'cache':
1236
+ case 'private-cache':
1237
+ return true;
1238
+ case 'prerender-ppr':
1239
+ case 'prerender-legacy':
1240
+ case 'request':
1241
+ case 'unstable-cache':
1242
+ case 'generate-static-params':
1243
+ return false;
1244
+ default:
1245
+ workUnitStore;
1246
+ }
1247
+ };
1248
+ const __next_require__ = (...args)=>{
1249
+ const exportsOrPromise = instrumented.require(...args);
1250
+ if (shouldTrackModuleLoading()) {
1251
+ // requiring an async module returns a promise.
1252
+ (0, _trackmoduleloadingexternal.trackPendingImport)(exportsOrPromise);
1253
+ }
1254
+ return exportsOrPromise;
1255
+ };
1256
+ // @ts-expect-error
1257
+ globalThis.__next_require__ = __next_require__;
1258
+ const __next_chunk_load__ = (...args)=>{
1259
+ const loadingChunk = instrumented.loadChunk(...args);
1260
+ if (shouldTrackModuleLoading()) {
1261
+ (0, _trackmoduleloadingexternal.trackPendingChunkLoad)(loadingChunk);
1262
+ }
1263
+ return loadingChunk;
1264
+ };
1265
+ // @ts-expect-error
1266
+ globalThis.__next_chunk_load__ = __next_chunk_load__;
1267
+ }
1268
+ if (process.env.__NEXT_DEV_SERVER && setIsrStatus && !cacheComponents) {
1269
+ // Reset the ISR status at start of request.
1270
+ const { pathname } = new URL(req.url || '/', 'http://n');
1271
+ setIsrStatus(pathname, // Only pages using the Node runtime can use ISR, Edge is always dynamic.
1272
+ process.env.NEXT_RUNTIME === 'edge' ? false : undefined);
1273
+ }
1274
+ if (// The type check here ensures that `req` is correctly typed, and the
1275
+ // environment variable check provides dead code elimination.
1276
+ process.env.NEXT_RUNTIME !== 'edge' && (0, _helpers.isNodeNextRequest)(req)) {
1277
+ res.onClose(()=>{
1278
+ // We stop tracking fetch metrics when the response closes, since we
1279
+ // report them at that time.
1280
+ workStore.shouldTrackFetchMetrics = false;
1281
+ });
1282
+ req.originalRequest.on('end', ()=>{
1283
+ if ('performance' in globalThis) {
1284
+ const metrics = (0, _clientcomponentrendererlogger.getClientComponentLoaderMetrics)({
1285
+ reset: true
1286
+ });
1287
+ if (metrics) {
1288
+ (0, _tracer.getTracer)().startSpan(_constants.NextNodeServerSpan.clientComponentLoading, {
1289
+ startTime: metrics.clientComponentLoadStart,
1290
+ attributes: {
1291
+ 'next.clientComponentLoadCount': metrics.clientComponentLoadCount,
1292
+ 'next.span_type': _constants.NextNodeServerSpan.clientComponentLoading
1293
+ }
1294
+ }).end(metrics.clientComponentLoadStart + metrics.clientComponentLoadTimes);
1295
+ }
1296
+ }
1297
+ });
1298
+ }
1299
+ const metadata = {
1300
+ statusCode: isNotFoundPath ? 404 : undefined
1301
+ };
1302
+ const appUsingSizeAdjustment = !!(nextFontManifest == null ? void 0 : nextFontManifest.appUsingSizeAdjust);
1303
+ ComponentMod.patchFetch();
1304
+ // Pull out the hooks/references from the component.
1305
+ const { routeModule: { userland: { loaderTree } }, taintObjectReference } = ComponentMod;
1306
+ if (enableTainting) {
1307
+ taintObjectReference('Do not pass process.env to Client Components since it will leak sensitive data', process.env);
1308
+ }
1309
+ workStore.fetchMetrics = [];
1310
+ metadata.fetchMetrics = workStore.fetchMetrics;
1311
+ // don't modify original query object
1312
+ query = {
1313
+ ...query
1314
+ };
1315
+ (0, _internalutils.stripInternalQueries)(query);
1316
+ const { isStaticGeneration } = workStore;
1317
+ let requestId;
1318
+ let htmlRequestId;
1319
+ const { flightRouterState, isPrefetchRequest, isRuntimePrefetchRequest, isRSCRequest, isHmrRefresh, nonce } = parsedRequestHeaders;
1320
+ if (parsedRequestHeaders.requestId) {
1321
+ // If the client has provided a request ID (in development mode), we use it.
1322
+ requestId = parsedRequestHeaders.requestId;
1323
+ } else {
1324
+ // Otherwise we generate a new request ID.
1325
+ if (isStaticGeneration) {
1326
+ requestId = Buffer.from(await crypto.subtle.digest('SHA-1', Buffer.from(req.url))).toString('hex');
1327
+ } else if (process.env.NEXT_RUNTIME === 'edge') {
1328
+ requestId = crypto.randomUUID();
1329
+ } else {
1330
+ requestId = require('next/dist/compiled/nanoid').nanoid();
1331
+ }
1332
+ }
1333
+ // If the client has provided an HTML request ID, we use it to associate the
1334
+ // request with the HTML document from which it originated, which is used to
1335
+ // send debug information to the associated WebSocket client. Otherwise, this
1336
+ // is the request for the HTML document, so we use the request ID also as the
1337
+ // HTML request ID.
1338
+ htmlRequestId = parsedRequestHeaders.htmlRequestId || requestId;
1339
+ const getDynamicParamFromSegment = makeGetDynamicParamFromSegment(interpolatedParams, fallbackRouteParams, renderOpts.experimental.optimisticRouting);
1340
+ const isPossibleActionRequest = (0, _serveractionrequestmeta.getIsPossibleServerAction)(req);
1341
+ // For implicit tags, we use the resolved pathname which has dynamic params
1342
+ // interpolated, is decoded, and has trailing slash removed.
1343
+ const resolvedPathname = (0, _requestmeta.getRequestMeta)(req, 'resolvedPathname');
1344
+ if (!resolvedPathname) {
1345
+ throw Object.defineProperty(new _invarianterror.InvariantError('resolvedPathname must be set in request metadata'), "__NEXT_ERROR_CODE", {
1346
+ value: "E981",
1347
+ enumerable: false,
1348
+ configurable: true
1349
+ });
1350
+ }
1351
+ const implicitTags = await (0, _implicittags.getImplicitTags)(workStore.page, resolvedPathname, fallbackRouteParams);
1352
+ const ctx = {
1353
+ componentMod: ComponentMod,
1354
+ url,
1355
+ renderOpts,
1356
+ workStore,
1357
+ parsedRequestHeaders,
1358
+ getDynamicParamFromSegment,
1359
+ interpolatedParams,
1360
+ query,
1361
+ isPrefetch: isPrefetchRequest,
1362
+ isPossibleServerAction: isPossibleActionRequest,
1363
+ requestTimestamp,
1364
+ appUsingSizeAdjustment,
1365
+ flightRouterState,
1366
+ requestId,
1367
+ htmlRequestId,
1368
+ pagePath,
1369
+ assetPrefix,
1370
+ isNotFoundPath,
1371
+ nonce,
1372
+ res,
1373
+ sharedContext,
1374
+ implicitTags
1375
+ };
1376
+ (0, _tracer.getTracer)().setRootSpanAttribute('next.route', pagePath);
1377
+ if (isStaticGeneration) {
1378
+ // We're either building or revalidating. In either case we need to
1379
+ // prerender our page rather than render it.
1380
+ const prerenderToStreamWithTracing = (0, _tracer.getTracer)().wrap(_constants.AppRenderSpan.getBodyResult, {
1381
+ spanName: `prerender route (app) ${pagePath}`,
1382
+ attributes: {
1383
+ 'next.route': pagePath
1384
+ }
1385
+ }, prerenderToStream);
1386
+ const response = await prerenderToStreamWithTracing(req, res, ctx, metadata, loaderTree, fallbackRouteParams);
1387
+ // If we're debugging partial prerendering, print all the dynamic API accesses
1388
+ // that occurred during the render.
1389
+ // @TODO move into renderToStream function
1390
+ if (response.dynamicAccess && (0, _dynamicrendering.accessedDynamicData)(response.dynamicAccess) && renderOpts.isDebugDynamicAccesses) {
1391
+ (0, _log.warn)('The following dynamic usage was detected:');
1392
+ for (const access of (0, _dynamicrendering.formatDynamicAPIAccesses)(response.dynamicAccess)){
1393
+ (0, _log.warn)(access);
1394
+ }
1395
+ }
1396
+ // If we encountered any unexpected errors during build we fail the
1397
+ // prerendering phase and the build.
1398
+ if (workStore.invalidDynamicUsageError) {
1399
+ (0, _dynamicrendering.logDisallowedDynamicError)(workStore, workStore.invalidDynamicUsageError);
1400
+ throw new _staticgenerationbailout.StaticGenBailoutError();
1401
+ }
1402
+ if (response.digestErrorsMap.size) {
1403
+ const buildFailingError = response.digestErrorsMap.values().next().value;
1404
+ if (buildFailingError) throw buildFailingError;
1405
+ }
1406
+ // Pick first userland SSR error, which is also not a RSC error.
1407
+ if (response.ssrErrors.length) {
1408
+ const buildFailingError = response.ssrErrors.find((err)=>(0, _createerrorhandler.isUserLandError)(err));
1409
+ if (buildFailingError) throw buildFailingError;
1410
+ }
1411
+ const options = {
1412
+ metadata,
1413
+ contentType: _constants1.HTML_CONTENT_TYPE_HEADER
1414
+ };
1415
+ // If we have pending revalidates, wait until they are all resolved.
1416
+ const maybeRevalidatesPromise = (0, _revalidationutils.executeRevalidates)(workStore);
1417
+ if (maybeRevalidatesPromise !== false) {
1418
+ const revalidatesPromise = maybeRevalidatesPromise.finally(()=>{
1419
+ if (process.env.NEXT_PRIVATE_DEBUG_CACHE) {
1420
+ console.log('pending revalidates promise finished for:', url.href);
1421
+ }
1422
+ });
1423
+ if (renderOpts.waitUntil) {
1424
+ renderOpts.waitUntil(revalidatesPromise);
1425
+ } else {
1426
+ options.waitUntil = revalidatesPromise;
1427
+ }
1428
+ }
1429
+ applyMetadataFromPrerenderResult(response, metadata, workStore);
1430
+ if (response.renderResumeDataCache) {
1431
+ metadata.renderResumeDataCache = response.renderResumeDataCache;
1432
+ }
1433
+ const streamString = await (0, _streamops.streamToString)(response.stream);
1434
+ const result = new _renderresult.default(streamString, options);
1435
+ // Run build-time instant validation if the page has instant configs
1436
+ // TODO(instant-validation-build): This is not a great place to wire this in.
1437
+ if (workStore.cacheComponentsEnabled && workStore.isBuildTimePrerendering && renderOpts.runInstantValidation && await (0, _instantconfig.anySegmentNeedsInstantValidationInBuild)(loaderTree)) {
1438
+ // Throws StaticGenBailoutError if validation failed.
1439
+ await validateInstantConfigsInBuild(ctx, response.renderResumeDataCache ?? null);
1440
+ }
1441
+ return result;
1442
+ } else {
1443
+ // We're rendering dynamically
1444
+ const renderResumeDataCache = renderOpts.renderResumeDataCache ?? (postponedState == null ? void 0 : postponedState.renderResumeDataCache) ?? null;
1445
+ const rootParams = (0, _createcomponenttree.getRootParams)(loaderTree, ctx.getDynamicParamFromSegment);
1446
+ const fallbackParams = (0, _requestmeta.getRequestMeta)(req, 'fallbackParams') || null;
1447
+ const createRequestStore = _requeststore.createRequestStoreForRender.bind(null, req, res, url, rootParams, implicitTags, renderOpts.onUpdateCookies, renderOpts.previewProps, isHmrRefresh, serverComponentsHmrCache, renderResumeDataCache, fallbackParams);
1448
+ const requestStore = createRequestStore();
1449
+ if (process.env.__NEXT_DEV_SERVER && setIsrStatus && !cacheComponents && // Only pages using the Node runtime can use ISR, so we only need to
1450
+ // update the status for those.
1451
+ // The type check here ensures that `req` is correctly typed, and the
1452
+ // environment variable check provides dead code elimination.
1453
+ process.env.NEXT_RUNTIME !== 'edge' && (0, _helpers.isNodeNextRequest)(req)) {
1454
+ req.originalRequest.on('end', ()=>{
1455
+ const { pathname } = new URL(req.url || '/', 'http://n');
1456
+ const isStatic = !requestStore.usedDynamic && !workStore.forceDynamic;
1457
+ setIsrStatus(pathname, isStatic);
1458
+ });
1459
+ }
1460
+ if (isRSCRequest) {
1461
+ if (isRuntimePrefetchRequest) {
1462
+ return generateRuntimePrefetchResult(req, ctx, requestStore);
1463
+ } else {
1464
+ if (process.env.__NEXT_DEV_SERVER && process.env.NEXT_RUNTIME !== 'edge' && cacheComponents) {
1465
+ return generateDynamicFlightRenderResultWithStagesInDev(req, ctx, requestStore, createRequestStore, fallbackParams);
1466
+ } else if (cacheComponents && cachedNavigations) {
1467
+ return generateStagedDynamicFlightRenderResult(req, ctx, requestStore);
1468
+ } else {
1469
+ return generateDynamicFlightRenderResult(req, ctx, requestStore);
1470
+ }
1471
+ }
1472
+ }
1473
+ let didExecuteServerAction = false;
1474
+ let formState = null;
1475
+ if (isPossibleActionRequest) {
1476
+ // For action requests, we handle them differently with a special render result.
1477
+ const actionRequestResult = await (0, _actionhandler.handleAction)({
1478
+ req,
1479
+ res,
1480
+ ComponentMod,
1481
+ generateFlight: generateDynamicFlightRenderResult,
1482
+ workStore,
1483
+ requestStore,
1484
+ serverActions,
1485
+ ctx,
1486
+ metadata
1487
+ });
1488
+ if (actionRequestResult) {
1489
+ if (actionRequestResult.type === 'not-found') {
1490
+ const notFoundLoaderTree = createNotFoundLoaderTree(loaderTree);
1491
+ res.statusCode = 404;
1492
+ metadata.statusCode = 404;
1493
+ const stream = await renderToStream(requestStore, req, res, ctx, notFoundLoaderTree, formState, postponedState, metadata, undefined, fallbackParams);
1494
+ return new _renderresult.default(stream, {
1495
+ metadata,
1496
+ contentType: _constants1.HTML_CONTENT_TYPE_HEADER
1497
+ });
1498
+ } else if (actionRequestResult.type === 'done') {
1499
+ if (actionRequestResult.result) {
1500
+ actionRequestResult.result.assignMetadata(metadata);
1501
+ return actionRequestResult.result;
1502
+ } else if (actionRequestResult.formState) {
1503
+ formState = actionRequestResult.formState;
1504
+ }
1505
+ }
1506
+ }
1507
+ didExecuteServerAction = true;
1508
+ }
1509
+ const options = {
1510
+ metadata,
1511
+ contentType: _constants1.HTML_CONTENT_TYPE_HEADER
1512
+ };
1513
+ const stream = await renderToStream(// NOTE: in Cache Components (dev), if the render is restarted, it will use a different requestStore
1514
+ // than the one that we're passing in here.
1515
+ requestStore, req, res, ctx, loaderTree, formState, postponedState, metadata, // If we're rendering HTML after an action, we don't want restartable-render behavior
1516
+ // because the result should be dynamic, like it is in prod.
1517
+ // Also, the request store might have been mutated by the action (e.g. enabling draftMode)
1518
+ // and we currently we don't copy changes over when creating a new store,
1519
+ // so the restarted render wouldn't be correct.
1520
+ didExecuteServerAction ? undefined : createRequestStore, fallbackParams);
1521
+ // Invalid dynamic usages should only error the request in development.
1522
+ // In production, it's better to produce a result.
1523
+ // (the dynamic error will still be thrown inside the component tree, but it's catchable by error boundaries)
1524
+ if (workStore.invalidDynamicUsageError && process.env.__NEXT_DEV_SERVER) {
1525
+ throw workStore.invalidDynamicUsageError;
1526
+ }
1527
+ // If we have pending revalidates, wait until they are all resolved.
1528
+ const maybeRevalidatesPromise = (0, _revalidationutils.executeRevalidates)(workStore);
1529
+ if (maybeRevalidatesPromise !== false) {
1530
+ const revalidatesPromise = maybeRevalidatesPromise.finally(()=>{
1531
+ if (process.env.NEXT_PRIVATE_DEBUG_CACHE) {
1532
+ console.log('pending revalidates promise finished for:', url.href);
1533
+ }
1534
+ });
1535
+ if (renderOpts.waitUntil) {
1536
+ renderOpts.waitUntil(revalidatesPromise);
1537
+ } else {
1538
+ options.waitUntil = revalidatesPromise;
1539
+ }
1540
+ }
1541
+ // Create the new render result for the response.
1542
+ return new _renderresult.default(stream, options);
1543
+ }
1544
+ }
1545
+ const renderToHTMLOrFlight = (req, res, pagePath, query, fallbackRouteParams, renderOpts, serverComponentsHmrCache, sharedContext)=>{
1546
+ var _renderOpts_previewProps;
1547
+ if (!req.url) {
1548
+ throw Object.defineProperty(new Error('Invalid URL'), "__NEXT_ERROR_CODE", {
1549
+ value: "E182",
1550
+ enumerable: false,
1551
+ configurable: true
1552
+ });
1553
+ }
1554
+ const url = (0, _parserelativeurl.parseRelativeUrl)(req.url, undefined, false);
1555
+ // We read these values from the request object as, in certain cases,
1556
+ // base-server will strip them to opt into different rendering behavior.
1557
+ const parsedRequestHeaders = parseRequestHeaders(req.headers, {
1558
+ isRoutePPREnabled: renderOpts.experimental.isRoutePPREnabled === true,
1559
+ previewModeId: (_renderOpts_previewProps = renderOpts.previewProps) == null ? void 0 : _renderOpts_previewProps.previewModeId
1560
+ });
1561
+ const { isPrefetchRequest, previouslyRevalidatedTags, nonce } = parsedRequestHeaders;
1562
+ let interpolatedParams;
1563
+ let postponedState = null;
1564
+ // If provided, the postpone state should be parsed so it can be provided to
1565
+ // React.
1566
+ if (typeof renderOpts.postponed === 'string') {
1567
+ if (fallbackRouteParams) {
1568
+ throw Object.defineProperty(new _invarianterror.InvariantError('postponed state should not be provided when fallback params are provided'), "__NEXT_ERROR_CODE", {
1569
+ value: "E592",
1570
+ enumerable: false,
1571
+ configurable: true
1572
+ });
1573
+ }
1574
+ interpolatedParams = (0, _getdynamicparam.interpolateParallelRouteParams)(renderOpts.ComponentMod.routeModule.userland.loaderTree, renderOpts.params ?? {}, pagePath, fallbackRouteParams);
1575
+ postponedState = (0, _postponedstate.parsePostponedState)(renderOpts.postponed, interpolatedParams, renderOpts.experimental.maxPostponedStateSizeBytes);
1576
+ } else {
1577
+ interpolatedParams = (0, _getdynamicparam.interpolateParallelRouteParams)(renderOpts.ComponentMod.routeModule.userland.loaderTree, renderOpts.params ?? {}, pagePath, fallbackRouteParams);
1578
+ }
1579
+ if ((postponedState == null ? void 0 : postponedState.renderResumeDataCache) && renderOpts.renderResumeDataCache) {
1580
+ throw Object.defineProperty(new _invarianterror.InvariantError('postponed state and dev warmup immutable resume data cache should not be provided together'), "__NEXT_ERROR_CODE", {
1581
+ value: "E589",
1582
+ enumerable: false,
1583
+ configurable: true
1584
+ });
1585
+ }
1586
+ const workStore = (0, _workstore.createWorkStore)({
1587
+ page: renderOpts.routeModule.definition.page,
1588
+ renderOpts,
1589
+ // @TODO move to workUnitStore of type Request
1590
+ isPrefetchRequest,
1591
+ buildId: sharedContext.buildId,
1592
+ previouslyRevalidatedTags,
1593
+ nonce
1594
+ });
1595
+ return _workasyncstorageexternal.workAsyncStorage.run(workStore, // The function to run
1596
+ renderToHTMLOrFlightImpl, // all of it's args
1597
+ req, res, url, pagePath, query, renderOpts, workStore, parsedRequestHeaders, postponedState, serverComponentsHmrCache, sharedContext, interpolatedParams, fallbackRouteParams);
1598
+ };
1599
+ function applyMetadataFromPrerenderResult(response, metadata, workStore) {
1600
+ if (response.collectedTags) {
1601
+ metadata.fetchTags = response.collectedTags.join(',');
1602
+ }
1603
+ // Let the client router know how long to keep the cached entry around.
1604
+ const staleHeader = String(response.collectedStale);
1605
+ metadata.headers ??= {};
1606
+ metadata.headers[_approuterheaders.NEXT_ROUTER_STALE_TIME_HEADER] = staleHeader;
1607
+ // If force static is specifically set to false, we should not revalidate
1608
+ // the page.
1609
+ if (workStore.forceStatic === false || response.collectedRevalidate === 0) {
1610
+ metadata.cacheControl = {
1611
+ revalidate: 0,
1612
+ expire: undefined
1613
+ };
1614
+ } else {
1615
+ // Copy the cache control value onto the render result metadata.
1616
+ metadata.cacheControl = {
1617
+ revalidate: response.collectedRevalidate >= _constants1.INFINITE_CACHE ? false : response.collectedRevalidate,
1618
+ expire: response.collectedExpire >= _constants1.INFINITE_CACHE ? undefined : response.collectedExpire
1619
+ };
1620
+ }
1621
+ // provide bailout info for debugging
1622
+ if (metadata.cacheControl.revalidate === 0) {
1623
+ metadata.staticBailoutInfo = {
1624
+ description: workStore.dynamicUsageDescription,
1625
+ stack: workStore.dynamicUsageStack
1626
+ };
1627
+ }
1628
+ }
1629
+ async function renderToStream(requestStore, req, res, ctx, tree, formState, postponedState, metadata, createRequestStore, fallbackParams) {
1630
+ /* eslint-disable @next/internal/no-ambiguous-jsx -- React Client */ const { assetPrefix, htmlRequestId, nonce, pagePath, renderOpts, requestId, workStore } = ctx;
1631
+ const { basePath, buildManifest, ComponentMod: { createElement }, crossOrigin, experimental, isBuildTimePrerendering = false, onInstrumentationRequestError, page, reactMaxHeadersLength, setReactDebugChannel, shouldWaitOnAllReady, subresourceIntegrityManifest, supportsDynamicResponse, cacheComponents } = renderOpts;
1632
+ const { cachedNavigations } = renderOpts.experimental;
1633
+ const { ServerInsertedHTMLProvider, renderServerInsertedHTML } = (0, _serverinsertedhtml.createServerInsertedHTML)();
1634
+ const getServerInsertedMetadata = (0, _createserverinsertedmetadata.createServerInsertedMetadata)(nonce);
1635
+ const tracingMetadata = (0, _utils1.getTracedMetadata)((0, _tracer.getTracer)().getTracePropagationData(), experimental.clientTraceMetadata);
1636
+ const polyfills = buildManifest.polyfillFiles.filter((polyfill)=>polyfill.endsWith('.js') && !polyfill.endsWith('.module.js')).map((polyfill)=>({
1637
+ src: `${assetPrefix}/_next/${polyfill}${(0, _getassetquerystring.getAssetQueryString)(ctx, false)}`,
1638
+ integrity: subresourceIntegrityManifest == null ? void 0 : subresourceIntegrityManifest[polyfill],
1639
+ crossOrigin,
1640
+ noModule: true,
1641
+ nonce
1642
+ }));
1643
+ const [preinitScripts, bootstrapScript] = (0, _requiredscripts.getRequiredScripts)(buildManifest, // Why is assetPrefix optional on renderOpts?
1644
+ // @TODO make it default empty string on renderOpts and get rid of it from ctx
1645
+ assetPrefix, crossOrigin, subresourceIntegrityManifest, (0, _getassetquerystring.getAssetQueryString)(ctx, true), nonce, page);
1646
+ // In development mode, set the request ID as a global variable, before the
1647
+ // bootstrap script is executed, which depends on it during hydration.
1648
+ // For MPA navigations (page reload, direct URL entry), the request ID
1649
+ // header is not present, so we generate a random one.
1650
+ const bootstrapScriptContent = process.env.__NEXT_DEV_SERVER ? `self.__next_r=${JSON.stringify(requestId ?? crypto.randomUUID())}` : undefined;
1651
+ // Create the "render route (app)" span manually so we can keep it open during streaming.
1652
+ // This is necessary because errors inside Suspense boundaries are reported asynchronously
1653
+ // during stream consumption, after a typical wrapped function would have ended the span.
1654
+ // Note: We pass the full span name as the first argument since startSpan uses it directly.
1655
+ const renderSpan = (0, _tracer.getTracer)().startSpan(`render route (app) ${pagePath}`, {
1656
+ attributes: {
1657
+ 'next.span_name': `render route (app) ${pagePath}`,
1658
+ 'next.span_type': _constants.AppRenderSpan.getBodyResult,
1659
+ 'next.route': pagePath
1660
+ }
1661
+ });
1662
+ // Helper to end the span with error status (used when throwing from catch blocks)
1663
+ const endSpanWithError = (err)=>{
1664
+ if (!renderSpan.isRecording()) return;
1665
+ if (err instanceof Error) {
1666
+ renderSpan.recordException(err);
1667
+ renderSpan.setAttribute('error.type', err.name);
1668
+ }
1669
+ renderSpan.setStatus({
1670
+ code: _tracer.SpanStatusCode.ERROR,
1671
+ message: err instanceof Error ? err.message : undefined
1672
+ });
1673
+ renderSpan.end();
1674
+ };
1675
+ // Run the rest of the function within the span's context so child spans
1676
+ // (like "build component tree", "generateMetadata") are properly parented.
1677
+ return (0, _tracer.getTracer)().withSpan(renderSpan, async ()=>{
1678
+ const { reactServerErrorsByDigest } = workStore;
1679
+ function onHTMLRenderRSCError(err, silenceLog) {
1680
+ return onInstrumentationRequestError == null ? void 0 : onInstrumentationRequestError(err, req, createErrorContext(ctx, 'react-server-components'), silenceLog);
1681
+ }
1682
+ const serverComponentsErrorHandler = (0, _createerrorhandler.createReactServerErrorHandler)(process.env.NODE_ENV === 'development', isBuildTimePrerendering, reactServerErrorsByDigest, onHTMLRenderRSCError, renderSpan);
1683
+ function onHTMLRenderSSRError(err) {
1684
+ // We don't need to silence logs here. onHTMLRenderSSRError won't be called
1685
+ // at all if the error was logged before in the RSC error handler.
1686
+ const silenceLog = false;
1687
+ return onInstrumentationRequestError == null ? void 0 : onInstrumentationRequestError(err, req, createErrorContext(ctx, 'server-rendering'), silenceLog);
1688
+ }
1689
+ const allCapturedErrors = [];
1690
+ const htmlRendererErrorHandler = (0, _createerrorhandler.createHTMLErrorHandler)(process.env.NODE_ENV === 'development', isBuildTimePrerendering, reactServerErrorsByDigest, allCapturedErrors, onHTMLRenderSSRError, renderSpan);
1691
+ let reactServerResult = null;
1692
+ let reactDebugStream;
1693
+ const setHeader = res.setHeader.bind(res);
1694
+ const appendHeader = res.appendHeader.bind(res);
1695
+ const { clientModules } = (0, _manifestssingleton.getClientReferenceManifest)();
1696
+ try {
1697
+ if (process.env.__NEXT_DEV_SERVER && // Edge routes never prerender so we don't have a Prerender environment for anything in edge runtime
1698
+ process.env.NEXT_RUNTIME !== 'edge' && // We only have a Prerender environment for projects opted into cacheComponents
1699
+ cacheComponents) {
1700
+ let debugChannel;
1701
+ // eslint-disable-next-line @typescript-eslint/no-shadow
1702
+ const getPayload = async (requestStore)=>{
1703
+ const payload = await _workunitasyncstorageexternal.workUnitAsyncStorage.run(requestStore, getRSCPayload, tree, ctx, {
1704
+ is404: res.statusCode === 404
1705
+ });
1706
+ if (isBypassingCachesInDev(requestStore)) {
1707
+ // Mark the RSC payload to indicate that caches were bypassed in dev.
1708
+ // This lets the client know not to cache anything based on this render.
1709
+ if (renderOpts.setCacheStatus) {
1710
+ // we know this is available when cacheComponents is enabled, but typeguard to be safe
1711
+ renderOpts.setCacheStatus('bypass', htmlRequestId);
1712
+ }
1713
+ payload._bypassCachesInDev = createElement(WarnForBypassCachesInDev, {
1714
+ route: workStore.route
1715
+ });
1716
+ }
1717
+ return payload;
1718
+ };
1719
+ if (// We only do this flow if we can safely recreate the store from scratch
1720
+ // (which is not the case for renders after an action)
1721
+ createRequestStore && // We only do this flow if we're not bypassing caches in dev using
1722
+ // "disable cache" in devtools or a hard refresh (cache-control: "no-store")
1723
+ !isBypassingCachesInDev(requestStore)) {
1724
+ const { stream: serverStream, accumulatedChunksPromise, syncInterruptReason, startTime, staticStageEndTime, runtimeStageEndTime, debugChannel: returnedDebugChannel, requestStore: finalRequestStore } = await renderWithRestartOnCacheMissInDev(ctx, requestStore, createRequestStore, getPayload, serverComponentsErrorHandler);
1725
+ let validationDebugChannelClient = undefined;
1726
+ if (returnedDebugChannel) {
1727
+ const [t1, t2] = returnedDebugChannel.clientSide.readable.tee();
1728
+ returnedDebugChannel.clientSide.readable = t1;
1729
+ validationDebugChannelClient = nodeStreamFromReadableStream(t2);
1730
+ }
1731
+ _consoleasyncstorageexternal.consoleAsyncStorage.run({
1732
+ dim: true
1733
+ }, spawnStaticShellValidationInDev, accumulatedChunksPromise, syncInterruptReason, startTime, staticStageEndTime, runtimeStageEndTime, ctx, finalRequestStore, fallbackParams, validationDebugChannelClient);
1734
+ reactServerResult = new _apprenderprerenderutils.ReactServerResult(serverStream);
1735
+ requestStore = finalRequestStore;
1736
+ debugChannel = returnedDebugChannel;
1737
+ } else {
1738
+ logValidationSkipped(ctx);
1739
+ // We're either bypassing caches or we can't restart the render.
1740
+ // Do a dynamic render, but with (basic) environment labels.
1741
+ debugChannel = setReactDebugChannel && (0, _debugchannelserver.createDebugChannel)();
1742
+ const serverStream = await stagedRenderToReadableStreamWithoutCachesInDev(ctx, requestStore, getPayload, {
1743
+ onError: serverComponentsErrorHandler,
1744
+ filterStackFrame,
1745
+ debugChannel: debugChannel == null ? void 0 : debugChannel.serverSide
1746
+ });
1747
+ reactServerResult = new _apprenderprerenderutils.ReactServerResult(serverStream);
1748
+ }
1749
+ if (debugChannel && setReactDebugChannel) {
1750
+ const [readableSsr, readableBrowser] = debugChannel.clientSide.readable.tee();
1751
+ reactDebugStream = readableSsr;
1752
+ setReactDebugChannel({
1753
+ readable: readableBrowser
1754
+ }, htmlRequestId, requestId);
1755
+ }
1756
+ } else if (cacheComponents && cachedNavigations) {
1757
+ // Production Cache Components + Cached Navigations: use staged
1758
+ // rendering so the RSC payload includes the static stage byte length
1759
+ // (`l` field), enabling the client to cache the static subset during
1760
+ // hydration.
1761
+ const { renderToReadableStream } = ctx.componentMod;
1762
+ const selectStaleTime = (0, _staletime.createSelectStaleTime)(experimental);
1763
+ const staleTimeIterable = new _staletime.StaleTimeIterable();
1764
+ // TODO(cached-navs): this assumes that we checked during build that there's no sync IO.
1765
+ // but it can happen e.g. after a revalidation or conditionally for a param that wasn't prerendered.
1766
+ // we should change this to track sync IO, log an error and advance to dynamic.
1767
+ const shouldTrackSyncIO = false;
1768
+ const stageController = new _stagedrendering.StagedRenderingController(null, null, shouldTrackSyncIO);
1769
+ requestStore.stale = _constants1.INFINITE_CACHE;
1770
+ requestStore.stagedRendering = stageController;
1771
+ (0, _staletime.trackStaleTime)(requestStore, staleTimeIterable, selectStaleTime);
1772
+ let resolveStaticStageByteLength;
1773
+ const staticStageByteLengthPromise = new Promise((resolve)=>{
1774
+ resolveStaticStageByteLength = resolve;
1775
+ });
1776
+ // If the route has runtime prefetching enabled, spawn a runtime
1777
+ // prerender after the resume render fills caches. The result is
1778
+ // embedded in the initial RSC payload so the client can cache
1779
+ // runtime-prefetchable content during hydration.
1780
+ const hasRuntimePrefetch = await (0, _instantconfig.anySegmentHasRuntimePrefetchEnabled)(tree);
1781
+ let runtimePrefetchStream;
1782
+ if (hasRuntimePrefetch) {
1783
+ const prerenderResumeDataCache = (0, _resumedatacache.createPrerenderResumeDataCache)();
1784
+ requestStore.prerenderResumeDataCache = prerenderResumeDataCache;
1785
+ const cacheSignal = new _cachesignal.CacheSignal();
1786
+ (0, _trackmoduleloadingexternal.trackPendingModules)(cacheSignal);
1787
+ requestStore.cacheSignal = cacheSignal;
1788
+ const runtimePrefetchTransform = new TransformStream();
1789
+ runtimePrefetchStream = runtimePrefetchTransform.readable;
1790
+ void cacheSignal.cacheReady().then(()=>spawnRuntimePrefetchWithFilledCaches(runtimePrefetchTransform.writable, ctx, prerenderResumeDataCache, requestStore, serverComponentsErrorHandler));
1791
+ }
1792
+ const RSCPayload = await _workunitasyncstorageexternal.workUnitAsyncStorage.run(requestStore, getRSCPayload, tree, ctx, {
1793
+ is404: res.statusCode === 404,
1794
+ staleTimeIterable,
1795
+ staticStageByteLengthPromise,
1796
+ runtimePrefetchStream
1797
+ });
1798
+ const flightStream = await (0, _apprenderrenderutils.runInSequentialTasks)(()=>{
1799
+ stageController.advanceStage(_stagedrendering.RenderStage.Static);
1800
+ const stream = _workunitasyncstorageexternal.workUnitAsyncStorage.run(requestStore, renderToReadableStream, RSCPayload, clientModules, {
1801
+ onError: serverComponentsErrorHandler,
1802
+ filterStackFrame
1803
+ });
1804
+ const [dynamicStream, staticStream] = stream.tee();
1805
+ countStaticStageBytes(staticStream, stageController).then(resolveStaticStageByteLength);
1806
+ return dynamicStream;
1807
+ }, ()=>{
1808
+ // This is a separate task that doesn't advance a stage. It forces
1809
+ // draining the microtask queue so that the stale time iterable is
1810
+ // closed before we advance to the dynamic stage.
1811
+ void (0, _staletime.finishStaleTimeTracking)(staleTimeIterable);
1812
+ }, ()=>{
1813
+ stageController.advanceStage(_stagedrendering.RenderStage.Dynamic);
1814
+ });
1815
+ reactServerResult = new _apprenderprerenderutils.ReactServerResult(flightStream);
1816
+ } else {
1817
+ // This is a dynamic render. We don't do dynamic tracking because we're not prerendering
1818
+ const RSCPayload = await _workunitasyncstorageexternal.workUnitAsyncStorage.run(requestStore, getRSCPayload, tree, ctx, {
1819
+ is404: res.statusCode === 404
1820
+ });
1821
+ const debugChannel = setReactDebugChannel && (0, _debugchannelserver.createDebugChannel)();
1822
+ if (debugChannel) {
1823
+ const [readableSsr, readableBrowser] = debugChannel.clientSide.readable.tee();
1824
+ reactDebugStream = readableSsr;
1825
+ setReactDebugChannel({
1826
+ readable: readableBrowser
1827
+ }, htmlRequestId, requestId);
1828
+ }
1829
+ reactServerResult = new _apprenderprerenderutils.ReactServerResult(_workunitasyncstorageexternal.workUnitAsyncStorage.run(requestStore, _streamops.renderToFlightStream, ctx.componentMod, RSCPayload, clientModules, {
1830
+ filterStackFrame,
1831
+ onError: serverComponentsErrorHandler,
1832
+ debugChannel: debugChannel == null ? void 0 : debugChannel.serverSide
1833
+ }));
1834
+ }
1835
+ // React doesn't start rendering synchronously but we want the RSC render to have a chance to start
1836
+ // before we begin SSR rendering because we want to capture any available preload headers so we tick
1837
+ // one task before continuing
1838
+ await (0, _scheduler.waitAtLeastOneReactRenderTask)();
1839
+ // If provided, the postpone state should be parsed as JSON so it can be
1840
+ // provided to React.
1841
+ if (typeof renderOpts.postponed === 'string') {
1842
+ if ((postponedState == null ? void 0 : postponedState.type) === _postponedstate.DynamicState.DATA) {
1843
+ // We have a complete HTML Document in the prerender but we need to
1844
+ // still include the new server component render because it was not included
1845
+ // in the static prelude.
1846
+ const inlinedDataStream = (0, _streamops.createInlinedDataStream)(reactServerResult.tee(), nonce, formState);
1847
+ // End the span since there's no async rendering in this path
1848
+ if (renderSpan.isRecording()) renderSpan.end();
1849
+ return (0, _streamops.chainStreams)(inlinedDataStream, (0, _streamops.createDocumentClosingStream)());
1850
+ } else if (postponedState) {
1851
+ // We assume we have dynamic HTML requiring a resume render to complete
1852
+ const { postponed, preludeState } = (0, _postponedstate.getPostponedFromState)(postponedState);
1853
+ const resumeAppElement = /*#__PURE__*/ (0, _jsxruntime.jsx)(App, {
1854
+ reactServerStream: reactServerResult.tee(),
1855
+ reactDebugStream: reactDebugStream,
1856
+ debugEndTime: undefined,
1857
+ preinitScripts: preinitScripts,
1858
+ ServerInsertedHTMLProvider: ServerInsertedHTMLProvider,
1859
+ nonce: nonce,
1860
+ images: ctx.renderOpts.images
1861
+ });
1862
+ const getServerInsertedHTML = (0, _makegetserverinsertedhtml.makeGetServerInsertedHTML)({
1863
+ polyfills,
1864
+ renderServerInsertedHTML,
1865
+ serverCapturedErrors: allCapturedErrors,
1866
+ basePath,
1867
+ tracingMetadata: tracingMetadata
1868
+ });
1869
+ const { stream: htmlStream, allReady } = await _workunitasyncstorageexternal.workUnitAsyncStorage.run(requestStore, _streamops.resumeToFizzStream, resumeAppElement, postponed, {
1870
+ onError: htmlRendererErrorHandler,
1871
+ nonce
1872
+ });
1873
+ // End the render span only after React completed rendering (including anything inside Suspense boundaries)
1874
+ allReady.finally(()=>{
1875
+ if (renderSpan.isRecording()) renderSpan.end();
1876
+ });
1877
+ return await (0, _streamops.continueDynamicHTMLResume)(htmlStream, {
1878
+ delayDataUntilFirstHtmlChunk: preludeState === _postponedstate.DynamicHTMLPreludeState.Empty,
1879
+ inlinedDataStream: (0, _streamops.createInlinedDataStream)(reactServerResult.consume(), nonce, formState),
1880
+ getServerInsertedHTML,
1881
+ getServerInsertedMetadata,
1882
+ deploymentId: ctx.sharedContext.deploymentId
1883
+ });
1884
+ }
1885
+ }
1886
+ // This is a regular dynamic render
1887
+ const getServerInsertedHTML = (0, _makegetserverinsertedhtml.makeGetServerInsertedHTML)({
1888
+ polyfills,
1889
+ renderServerInsertedHTML,
1890
+ serverCapturedErrors: allCapturedErrors,
1891
+ basePath,
1892
+ tracingMetadata: tracingMetadata
1893
+ });
1894
+ const generateStaticHTML = supportsDynamicResponse !== true || !!shouldWaitOnAllReady;
1895
+ const appElement = /*#__PURE__*/ (0, _jsxruntime.jsx)(App, {
1896
+ reactServerStream: reactServerResult.tee(),
1897
+ reactDebugStream: reactDebugStream,
1898
+ debugEndTime: undefined,
1899
+ preinitScripts: preinitScripts,
1900
+ ServerInsertedHTMLProvider: ServerInsertedHTMLProvider,
1901
+ nonce: nonce,
1902
+ images: ctx.renderOpts.images
1903
+ });
1904
+ const fizzOptions = {
1905
+ onError: htmlRendererErrorHandler,
1906
+ nonce,
1907
+ onHeaders: (headers)=>{
1908
+ headers.forEach((value, key)=>{
1909
+ appendHeader(key, value);
1910
+ });
1911
+ },
1912
+ maxHeadersLength: reactMaxHeadersLength,
1913
+ bootstrapScriptContent,
1914
+ bootstrapScripts: [
1915
+ bootstrapScript
1916
+ ],
1917
+ formState
1918
+ };
1919
+ const { stream: htmlStream, allReady } = await _workunitasyncstorageexternal.workUnitAsyncStorage.run(requestStore, _streamops.renderToFizzStream, appElement, fizzOptions);
1920
+ // End the render span only after React completed rendering (including anything inside Suspense boundaries)
1921
+ allReady.finally(()=>{
1922
+ if (renderSpan.isRecording()) renderSpan.end();
1923
+ });
1924
+ return await (0, _streamops.continueFizzStream)(htmlStream, {
1925
+ inlinedDataStream: (0, _streamops.createInlinedDataStream)(reactServerResult.consume(), nonce, formState),
1926
+ isStaticGeneration: generateStaticHTML,
1927
+ allReady,
1928
+ deploymentId: ctx.sharedContext.deploymentId,
1929
+ getServerInsertedHTML,
1930
+ getServerInsertedMetadata,
1931
+ validateRootLayout: !!process.env.__NEXT_DEV_SERVER
1932
+ });
1933
+ } catch (err) {
1934
+ if ((0, _staticgenerationbailout.isStaticGenBailoutError)(err) || typeof err === 'object' && err !== null && 'message' in err && typeof err.message === 'string' && err.message.includes('https://nextjs.org/docs/advanced-features/static-html-export')) {
1935
+ // Ensure that "next dev" prints the red error overlay
1936
+ endSpanWithError(err);
1937
+ throw err;
1938
+ }
1939
+ // If a bailout made it to this point, it means it wasn't wrapped inside
1940
+ // a suspense boundary.
1941
+ const shouldBailoutToCSR = (0, _bailouttocsr.isBailoutToCSRError)(err);
1942
+ if (shouldBailoutToCSR) {
1943
+ const stack = (0, _formatservererror.getStackWithoutErrorMessage)(err);
1944
+ (0, _log.error)(`${err.reason} should be wrapped in a suspense boundary at page "${pagePath}". Read more: https://nextjs.org/docs/messages/missing-suspense-with-csr-bailout\n${stack}`);
1945
+ endSpanWithError(err);
1946
+ throw err;
1947
+ }
1948
+ let errorType;
1949
+ if ((0, _httpaccessfallback.isHTTPAccessFallbackError)(err)) {
1950
+ res.statusCode = (0, _httpaccessfallback.getAccessFallbackHTTPStatus)(err);
1951
+ metadata.statusCode = res.statusCode;
1952
+ errorType = (0, _httpaccessfallback.getAccessFallbackErrorTypeByStatus)(res.statusCode);
1953
+ } else if ((0, _redirecterror.isRedirectError)(err)) {
1954
+ errorType = 'redirect';
1955
+ res.statusCode = (0, _redirect.getRedirectStatusCodeFromError)(err);
1956
+ metadata.statusCode = res.statusCode;
1957
+ const redirectUrl = (0, _addpathprefix.addPathPrefix)((0, _redirect.getURLFromRedirectError)(err), basePath);
1958
+ // If there were mutable cookies set, we need to set them on the
1959
+ // response.
1960
+ const headers = new Headers();
1961
+ if ((0, _requestcookies.appendMutableCookies)(headers, requestStore.mutableCookies)) {
1962
+ setHeader('set-cookie', Array.from(headers.values()));
1963
+ }
1964
+ setHeader('location', redirectUrl);
1965
+ } else if (!shouldBailoutToCSR) {
1966
+ res.statusCode = 500;
1967
+ metadata.statusCode = res.statusCode;
1968
+ }
1969
+ const [errorPreinitScripts, errorBootstrapScript] = (0, _requiredscripts.getRequiredScripts)(buildManifest, assetPrefix, crossOrigin, subresourceIntegrityManifest, (0, _getassetquerystring.getAssetQueryString)(ctx, false), nonce, '/_not-found/page');
1970
+ let errorRSCPayload;
1971
+ let errorServerStream;
1972
+ try {
1973
+ errorRSCPayload = await _workunitasyncstorageexternal.workUnitAsyncStorage.run(requestStore, getErrorRSCPayload, tree, ctx, reactServerErrorsByDigest.has(err.digest) ? null : err, errorType);
1974
+ errorServerStream = _workunitasyncstorageexternal.workUnitAsyncStorage.run(requestStore, _streamops.renderToFlightStream, ctx.componentMod, errorRSCPayload, clientModules, {
1975
+ filterStackFrame,
1976
+ onError: serverComponentsErrorHandler
1977
+ });
1978
+ if (reactServerResult === null) {
1979
+ // We errored when we did not have an RSC stream to read from. This is not just a render
1980
+ // error, we need to throw early
1981
+ endSpanWithError(err);
1982
+ throw err;
1983
+ }
1984
+ } catch (setupErr) {
1985
+ endSpanWithError(setupErr);
1986
+ throw setupErr;
1987
+ }
1988
+ try {
1989
+ const generateStaticHTML = supportsDynamicResponse !== true || !!shouldWaitOnAllReady;
1990
+ const { stream: errorHtmlStream, allReady: errorAllReady } = await _workunitasyncstorageexternal.workUnitAsyncStorage.run(requestStore, _streamops.renderToFizzStream, /*#__PURE__*/ (0, _jsxruntime.jsx)(ErrorApp, {
1991
+ reactServerStream: errorServerStream,
1992
+ ServerInsertedHTMLProvider: ServerInsertedHTMLProvider,
1993
+ preinitScripts: errorPreinitScripts,
1994
+ nonce: nonce,
1995
+ images: ctx.renderOpts.images
1996
+ }), {
1997
+ nonce,
1998
+ bootstrapScriptContent,
1999
+ bootstrapScripts: [
2000
+ errorBootstrapScript
2001
+ ],
2002
+ formState
2003
+ });
2004
+ // End the render span only after React completed rendering (including anything inside Suspense boundaries)
2005
+ errorAllReady.finally(()=>{
2006
+ if (renderSpan.isRecording()) renderSpan.end();
2007
+ });
2008
+ return await (0, _streamops.continueFizzStream)(errorHtmlStream, {
2009
+ inlinedDataStream: (0, _streamops.createInlinedDataStream)(// This is intentionally using the readable datastream from the
2010
+ // main render rather than the flight data from the error page
2011
+ // render
2012
+ reactServerResult.consume(), nonce, formState),
2013
+ isStaticGeneration: generateStaticHTML,
2014
+ deploymentId: ctx.sharedContext.deploymentId,
2015
+ getServerInsertedHTML: (0, _makegetserverinsertedhtml.makeGetServerInsertedHTML)({
2016
+ polyfills,
2017
+ renderServerInsertedHTML,
2018
+ serverCapturedErrors: [],
2019
+ basePath,
2020
+ tracingMetadata: tracingMetadata
2021
+ }),
2022
+ getServerInsertedMetadata,
2023
+ validateRootLayout: !!process.env.__NEXT_DEV_SERVER
2024
+ });
2025
+ } catch (finalErr) {
2026
+ if (process.env.__NEXT_DEV_SERVER && (0, _httpaccessfallback.isHTTPAccessFallbackError)(finalErr)) {
2027
+ const { bailOnRootNotFound } = require('../../client/components/dev-root-http-access-fallback-boundary');
2028
+ bailOnRootNotFound();
2029
+ }
2030
+ endSpanWithError(finalErr);
2031
+ throw finalErr;
2032
+ }
2033
+ }
2034
+ });
2035
+ /* eslint-enable @next/internal/no-ambiguous-jsx */ }
2036
+ async function renderWithRestartOnCacheMissInDev(ctx, initialRequestStore, createRequestStore, getPayload, onError) {
2037
+ const { htmlRequestId, renderOpts } = ctx;
2038
+ const { ComponentMod, setCacheStatus, setReactDebugChannel } = renderOpts;
2039
+ let startTime = -Infinity;
2040
+ // If the render is restarted, we'll recreate a fresh request store
2041
+ let requestStore = initialRequestStore;
2042
+ const environmentName = ()=>{
2043
+ const currentStage = requestStore.stagedRendering.currentStage;
2044
+ switch(currentStage){
2045
+ case _stagedrendering.RenderStage.Before:
2046
+ case _stagedrendering.RenderStage.EarlyStatic:
2047
+ case _stagedrendering.RenderStage.Static:
2048
+ return 'Prerender';
2049
+ case _stagedrendering.RenderStage.EarlyRuntime:
2050
+ return 'Prefetch';
2051
+ case _stagedrendering.RenderStage.Runtime:
2052
+ return 'Prefetchable';
2053
+ case _stagedrendering.RenderStage.Dynamic:
2054
+ case _stagedrendering.RenderStage.Abandoned:
2055
+ return 'Server';
2056
+ default:
2057
+ currentStage;
2058
+ throw Object.defineProperty(new _invarianterror.InvariantError(`Invalid render stage: ${currentStage}`), "__NEXT_ERROR_CODE", {
2059
+ value: "E881",
2060
+ enumerable: false,
2061
+ configurable: true
2062
+ });
2063
+ }
2064
+ };
2065
+ //===============================================
2066
+ // Initial render
2067
+ //===============================================
2068
+ // Try to render the page and see if there's any cache misses.
2069
+ // If there are, wait for caches to finish and restart the render.
2070
+ // This render might end up being used as a prospective render (if there's cache misses),
2071
+ // so we need to set it up for filling caches.
2072
+ const cacheSignal = new _cachesignal.CacheSignal();
2073
+ // If we encounter async modules that delay rendering, we'll also need to restart.
2074
+ // TODO(restart-on-cache-miss): technically, we only need to wait for pending *server* modules here,
2075
+ // but `trackPendingModules` doesn't distinguish between client and server.
2076
+ (0, _trackmoduleloadingexternal.trackPendingModules)(cacheSignal);
2077
+ const prerenderResumeDataCache = (0, _resumedatacache.createPrerenderResumeDataCache)();
2078
+ const initialReactController = new AbortController();
2079
+ const initialDataController = new AbortController() // Controls hanging promises we create
2080
+ ;
2081
+ const initialAbandonController = new AbortController() // Controls whether this render is abandoned
2082
+ ;
2083
+ const initialStageController = new _stagedrendering.StagedRenderingController(initialDataController.signal, initialAbandonController, true // track sync IO
2084
+ );
2085
+ requestStore.prerenderResumeDataCache = prerenderResumeDataCache;
2086
+ // `getRenderResumeDataCache` will fall back to using `prerenderResumeDataCache` as `renderResumeDataCache`,
2087
+ // so not having a resume data cache won't break any expectations in case we don't need to restart.
2088
+ requestStore.renderResumeDataCache = null;
2089
+ requestStore.stagedRendering = initialStageController;
2090
+ requestStore.asyncApiPromises = createAsyncApiPromises(initialStageController, requestStore.cookies, requestStore.mutableCookies, requestStore.headers);
2091
+ requestStore.cacheSignal = cacheSignal;
2092
+ let debugChannel = setReactDebugChannel && (0, _debugchannelserver.createDebugChannel)();
2093
+ const { clientModules } = (0, _manifestssingleton.getClientReferenceManifest)();
2094
+ // Note: The stage controller starts out in the `Before` stage,
2095
+ // where sync IO does not cause aborts, so it's okay if it happens before render.
2096
+ const initialRscPayload = await getPayload(requestStore);
2097
+ const initialStreamResult = await (0, _apprenderrenderutils.runInSequentialTasks)(()=>{
2098
+ initialStageController.advanceStage(_stagedrendering.RenderStage.EarlyStatic);
2099
+ startTime = performance.now() + performance.timeOrigin;
2100
+ const streamPair = _workunitasyncstorageexternal.workUnitAsyncStorage.run(requestStore, _streamops.renderToFlightStream, ComponentMod, initialRscPayload, clientModules, {
2101
+ onError,
2102
+ environmentName,
2103
+ startTime,
2104
+ filterStackFrame,
2105
+ debugChannel: debugChannel == null ? void 0 : debugChannel.serverSide,
2106
+ signal: initialReactController.signal
2107
+ }).tee();
2108
+ // If we abort the render, we want to reject the stage-dependent promises as well.
2109
+ // Note that we want to install this listener after the render is started
2110
+ // so that it runs after react is finished running its abort code.
2111
+ initialReactController.signal.addEventListener('abort', ()=>{
2112
+ const { reason } = initialReactController.signal;
2113
+ initialDataController.abort(reason);
2114
+ }, {
2115
+ once: true
2116
+ });
2117
+ const stream = streamPair[0];
2118
+ const accumulatedChunksPromise = accumulateStreamChunks(streamPair[1], initialStageController, initialDataController.signal);
2119
+ initialDataController.signal.addEventListener('abort', ()=>{
2120
+ accumulatedChunksPromise.catch(()=>{});
2121
+ stream.cancel();
2122
+ }, {
2123
+ once: true
2124
+ });
2125
+ return {
2126
+ stream,
2127
+ accumulatedChunksPromise
2128
+ };
2129
+ }, ()=>{
2130
+ if (initialAbandonController.signal.aborted === true) {
2131
+ return;
2132
+ } else if (cacheSignal.hasPendingReads()) {
2133
+ initialAbandonController.abort();
2134
+ } else {
2135
+ initialStageController.advanceStage(_stagedrendering.RenderStage.Static);
2136
+ }
2137
+ }, ()=>{
2138
+ if (initialAbandonController.signal.aborted === true) {
2139
+ return;
2140
+ } else if (cacheSignal.hasPendingReads()) {
2141
+ initialAbandonController.abort();
2142
+ } else {
2143
+ initialStageController.advanceStage(_stagedrendering.RenderStage.EarlyRuntime);
2144
+ }
2145
+ }, ()=>{
2146
+ if (initialAbandonController.signal.aborted === true) {
2147
+ return;
2148
+ } else if (cacheSignal.hasPendingReads()) {
2149
+ initialAbandonController.abort();
2150
+ } else {
2151
+ initialStageController.advanceStage(_stagedrendering.RenderStage.Runtime);
2152
+ }
2153
+ }, ()=>{
2154
+ if (initialAbandonController.signal.aborted === true) {
2155
+ return;
2156
+ } else if (cacheSignal.hasPendingReads()) {
2157
+ initialAbandonController.abort();
2158
+ } else {
2159
+ initialStageController.advanceStage(_stagedrendering.RenderStage.Dynamic);
2160
+ }
2161
+ });
2162
+ if (initialStageController.currentStage !== _stagedrendering.RenderStage.Abandoned) {
2163
+ // No cache misses. We can use the result as-is.
2164
+ return {
2165
+ stream: initialStreamResult.stream,
2166
+ accumulatedChunksPromise: initialStreamResult.accumulatedChunksPromise,
2167
+ syncInterruptReason: initialStageController.getSyncInterruptReason(),
2168
+ startTime,
2169
+ staticStageEndTime: initialStageController.getStaticStageEndTime(),
2170
+ runtimeStageEndTime: initialStageController.getRuntimeStageEndTime(),
2171
+ debugChannel,
2172
+ requestStore
2173
+ };
2174
+ }
2175
+ if (process.env.__NEXT_DEV_SERVER && setCacheStatus) {
2176
+ setCacheStatus('filling', htmlRequestId);
2177
+ }
2178
+ // Cache miss. We will use the initial render to fill caches, and discard its result.
2179
+ // Then, we can render again with warm caches.
2180
+ // TODO(restart-on-cache-miss):
2181
+ // This might end up waiting for more caches than strictly necessary,
2182
+ // because we can't abort the render yet, and we'll let runtime/dynamic APIs resolve.
2183
+ // Ideally we'd only wait for caches that are needed in the static stage.
2184
+ // This will be optimized in the future by not allowing runtime/dynamic APIs to resolve.
2185
+ await cacheSignal.cacheReady();
2186
+ initialReactController.abort();
2187
+ //===============================================
2188
+ // Final render (restarted)
2189
+ //===============================================
2190
+ // The initial render acted as a prospective render to warm the caches.
2191
+ requestStore = createRequestStore();
2192
+ // We are going to render this pass all the way through because we've already
2193
+ // filled any caches so we won't be aborting this time.
2194
+ const abortSignal = null;
2195
+ const finalStageController = new _stagedrendering.StagedRenderingController(abortSignal, null, true // track sync IO
2196
+ );
2197
+ // We've filled the caches, so now we can render as usual,
2198
+ // without any cache-filling mechanics.
2199
+ requestStore.prerenderResumeDataCache = null;
2200
+ requestStore.renderResumeDataCache = (0, _resumedatacache.createRenderResumeDataCache)(prerenderResumeDataCache);
2201
+ requestStore.stagedRendering = finalStageController;
2202
+ requestStore.cacheSignal = null;
2203
+ requestStore.asyncApiPromises = createAsyncApiPromises(finalStageController, requestStore.cookies, requestStore.mutableCookies, requestStore.headers);
2204
+ // The initial render already wrote to its debug channel.
2205
+ // We're not using it, so we need to create a new one.
2206
+ debugChannel = setReactDebugChannel && (0, _debugchannelserver.createDebugChannel)();
2207
+ // Note: The stage controller starts out in the `Before` stage,
2208
+ // where sync IO does not cause aborts, so it's okay if it happens before render.
2209
+ const finalRscPayload = await getPayload(requestStore);
2210
+ const finalStreamResult = await (0, _apprenderrenderutils.runInSequentialTasks)(()=>{
2211
+ finalStageController.advanceStage(_stagedrendering.RenderStage.EarlyStatic);
2212
+ startTime = performance.now() + performance.timeOrigin;
2213
+ const streamPair = _workunitasyncstorageexternal.workUnitAsyncStorage.run(requestStore, _streamops.renderToFlightStream, ComponentMod, finalRscPayload, clientModules, {
2214
+ onError,
2215
+ environmentName,
2216
+ startTime,
2217
+ filterStackFrame,
2218
+ debugChannel: debugChannel == null ? void 0 : debugChannel.serverSide
2219
+ }).tee();
2220
+ return {
2221
+ stream: streamPair[0],
2222
+ accumulatedChunksPromise: accumulateStreamChunks(streamPair[1], finalStageController, null)
2223
+ };
2224
+ }, ()=>{
2225
+ // Static stage
2226
+ finalStageController.advanceStage(_stagedrendering.RenderStage.Static);
2227
+ }, ()=>{
2228
+ // EarlyRuntime stage
2229
+ finalStageController.advanceStage(_stagedrendering.RenderStage.EarlyRuntime);
2230
+ }, ()=>{
2231
+ // Runtime stage
2232
+ finalStageController.advanceStage(_stagedrendering.RenderStage.Runtime);
2233
+ }, ()=>{
2234
+ // Dynamic stage
2235
+ finalStageController.advanceStage(_stagedrendering.RenderStage.Dynamic);
2236
+ });
2237
+ if (process.env.__NEXT_DEV_SERVER && setCacheStatus) {
2238
+ setCacheStatus('filled', htmlRequestId);
2239
+ }
2240
+ return {
2241
+ stream: finalStreamResult.stream,
2242
+ accumulatedChunksPromise: finalStreamResult.accumulatedChunksPromise,
2243
+ syncInterruptReason: finalStageController.getSyncInterruptReason(),
2244
+ startTime,
2245
+ staticStageEndTime: finalStageController.getStaticStageEndTime(),
2246
+ runtimeStageEndTime: finalStageController.getRuntimeStageEndTime(),
2247
+ debugChannel,
2248
+ requestStore
2249
+ };
2250
+ }
2251
+ async function accumulateStreamChunks(stream, stageController, signal) {
2252
+ const staticChunks = [];
2253
+ const runtimeChunks = [];
2254
+ const dynamicChunks = [];
2255
+ const reader = stream.getReader();
2256
+ let cancelled = false;
2257
+ function cancel() {
2258
+ if (!cancelled) {
2259
+ cancelled = true;
2260
+ reader.cancel();
2261
+ }
2262
+ }
2263
+ if (signal) {
2264
+ signal.addEventListener('abort', cancel, {
2265
+ once: true
2266
+ });
2267
+ }
2268
+ try {
2269
+ while(!cancelled){
2270
+ const { done, value } = await reader.read();
2271
+ if (done) {
2272
+ cancel();
2273
+ break;
2274
+ }
2275
+ switch(stageController.currentStage){
2276
+ case _stagedrendering.RenderStage.Before:
2277
+ throw Object.defineProperty(new _invarianterror.InvariantError('Unexpected stream chunk while in Before stage'), "__NEXT_ERROR_CODE", {
2278
+ value: "E942",
2279
+ enumerable: false,
2280
+ configurable: true
2281
+ });
2282
+ case _stagedrendering.RenderStage.EarlyStatic:
2283
+ case _stagedrendering.RenderStage.Static:
2284
+ staticChunks.push(value);
2285
+ // fall through
2286
+ case _stagedrendering.RenderStage.EarlyRuntime:
2287
+ case _stagedrendering.RenderStage.Runtime:
2288
+ runtimeChunks.push(value);
2289
+ // fall through
2290
+ case _stagedrendering.RenderStage.Dynamic:
2291
+ dynamicChunks.push(value);
2292
+ break;
2293
+ case _stagedrendering.RenderStage.Abandoned:
2294
+ break;
2295
+ default:
2296
+ stageController.currentStage;
2297
+ break;
2298
+ }
2299
+ }
2300
+ } catch (err) {
2301
+ // When we cancel the reader we may reject the read.
2302
+ // Only swallow errors caused by our intentional cancel();
2303
+ // re-throw unexpected errors to avoid silently returning partial data.
2304
+ if (!cancelled) {
2305
+ throw err;
2306
+ }
2307
+ }
2308
+ return {
2309
+ staticChunks,
2310
+ runtimeChunks,
2311
+ dynamicChunks
2312
+ };
2313
+ }
2314
+ async function countStaticStageBytes(stream, stageController) {
2315
+ let byteLength = 0;
2316
+ const reader = stream.getReader();
2317
+ stageController.onStage(_stagedrendering.RenderStage.EarlyRuntime, ()=>{
2318
+ reader.cancel();
2319
+ });
2320
+ while(true){
2321
+ const { done, value } = await reader.read();
2322
+ if (done) {
2323
+ break;
2324
+ }
2325
+ if (stageController.currentStage <= _stagedrendering.RenderStage.Static) {
2326
+ byteLength += value.byteLength;
2327
+ } else {
2328
+ reader.cancel();
2329
+ break;
2330
+ }
2331
+ }
2332
+ return byteLength;
2333
+ }
2334
+ function createAsyncApiPromises(stagedRendering, cookies, mutableCookies, headers) {
2335
+ return {
2336
+ // Runtime APIs (for prefetch segments)
2337
+ cookies: stagedRendering.delayUntilStage(_stagedrendering.RenderStage.Runtime, 'cookies', cookies),
2338
+ earlyCookies: stagedRendering.delayUntilStage(_stagedrendering.RenderStage.EarlyRuntime, 'cookies', cookies),
2339
+ mutableCookies: stagedRendering.delayUntilStage(_stagedrendering.RenderStage.Runtime, 'cookies', mutableCookies),
2340
+ earlyMutableCookies: stagedRendering.delayUntilStage(_stagedrendering.RenderStage.EarlyRuntime, 'cookies', mutableCookies),
2341
+ headers: stagedRendering.delayUntilStage(_stagedrendering.RenderStage.Runtime, 'headers', headers),
2342
+ earlyHeaders: stagedRendering.delayUntilStage(_stagedrendering.RenderStage.EarlyRuntime, 'headers', headers),
2343
+ // These are not used directly, but we chain other `params`/`searchParams` promises off of them.
2344
+ sharedParamsParent: stagedRendering.delayUntilStage(_stagedrendering.RenderStage.Runtime, undefined, '<internal params>'),
2345
+ earlySharedParamsParent: stagedRendering.delayUntilStage(_stagedrendering.RenderStage.EarlyRuntime, undefined, '<internal params>'),
2346
+ sharedSearchParamsParent: stagedRendering.delayUntilStage(_stagedrendering.RenderStage.Runtime, undefined, '<internal searchParams>'),
2347
+ earlySharedSearchParamsParent: stagedRendering.delayUntilStage(_stagedrendering.RenderStage.EarlyRuntime, undefined, '<internal searchParams>'),
2348
+ connection: stagedRendering.delayUntilStage(_stagedrendering.RenderStage.Dynamic, 'connection', undefined)
2349
+ };
2350
+ }
2351
+ /**
2352
+ * Logs the given messages, and sends the error instances to the browser as an
2353
+ * RSC stream, where they can be deserialized and logged (or otherwise presented
2354
+ * in the devtools), while leveraging React's capabilities to not only
2355
+ * source-map the stack frames (via findSourceMapURL), but also create virtual
2356
+ * server modules that allow users to inspect the server source code in the
2357
+ * browser.
2358
+ */ async function logMessagesAndSendErrorsToBrowser(messages, ctx) {
2359
+ const { htmlRequestId, renderOpts } = ctx;
2360
+ const { sendErrorsToBrowser } = renderOpts;
2361
+ const errors = [];
2362
+ for (const message of messages){
2363
+ // Log the error to the CLI. Prevent the logs from being dimmed, which we
2364
+ // apply for other logs during the spawned validation.
2365
+ _consoleasyncstorageexternal.consoleAsyncStorage.exit(()=>{
2366
+ console.error(message);
2367
+ });
2368
+ // Error instances are also sent to the browser. We're currently using a
2369
+ // non-Error message only in debug build mode as a message that is only
2370
+ // meant for the CLI. FIXME: This is a bit spooky action at a distance. We
2371
+ // should maybe have a more explicit way of determining which messages
2372
+ // should be sent to the browser. Regardless, only real errors with a proper
2373
+ // stack make sense to be "replayed" in the browser.
2374
+ if (message instanceof Error) {
2375
+ errors.push(message);
2376
+ }
2377
+ }
2378
+ if (errors.length > 0) {
2379
+ if (!sendErrorsToBrowser) {
2380
+ throw Object.defineProperty(new _invarianterror.InvariantError('Expected `sendErrorsToBrowser` to be defined in renderOpts.'), "__NEXT_ERROR_CODE", {
2381
+ value: "E947",
2382
+ enumerable: false,
2383
+ configurable: true
2384
+ });
2385
+ }
2386
+ // Build a Map of error → error code for errors that have one.
2387
+ // React doesn't revive __NEXT_ERROR_CODE during RSC deserialization, so we
2388
+ // send it as a side-channel Map. RSC preserves object identity, so the
2389
+ // deserialized Map keys will reference the same Error objects.
2390
+ const errorCodes = new Map();
2391
+ for (const err of errors){
2392
+ const code = (0, _errortelemetryutils.extractNextErrorCode)(err);
2393
+ if (code !== undefined) {
2394
+ errorCodes.set(err, code);
2395
+ }
2396
+ }
2397
+ const { clientModules } = (0, _manifestssingleton.getClientReferenceManifest)();
2398
+ const errorsFlightStream = (0, _streamops.renderToFlightStream)(ctx.componentMod, {
2399
+ errors,
2400
+ errorCodes
2401
+ }, clientModules, {
2402
+ filterStackFrame
2403
+ });
2404
+ sendErrorsToBrowser(errorsFlightStream, htmlRequestId);
2405
+ }
2406
+ }
2407
+ function logValidationSkipped(ctx) {
2408
+ if (process.env.__NEXT_TEST_MODE && process.env.NEXT_TEST_LOG_VALIDATION) {
2409
+ const requestId = ctx.requestId;
2410
+ const url = ctx.url.href;
2411
+ console.log('<VALIDATION_MESSAGE>' + JSON.stringify({
2412
+ type: 'validation_start',
2413
+ requestId,
2414
+ url
2415
+ }) + '</VALIDATION_MESSAGE>');
2416
+ console.log('<VALIDATION_MESSAGE>' + JSON.stringify({
2417
+ type: 'validation_end',
2418
+ requestId,
2419
+ url
2420
+ }) + '</VALIDATION_MESSAGE>');
2421
+ }
2422
+ }
2423
+ async function spawnStaticShellValidationInDev(...args) {
2424
+ if (process.env.__NEXT_TEST_MODE && process.env.NEXT_TEST_LOG_VALIDATION) {
2425
+ const ctx = args[5];
2426
+ const requestId = ctx.requestId;
2427
+ const url = ctx.url.href;
2428
+ console.log('<VALIDATION_MESSAGE>' + JSON.stringify({
2429
+ type: 'validation_start',
2430
+ requestId,
2431
+ url
2432
+ }) + '</VALIDATION_MESSAGE>');
2433
+ try {
2434
+ return await spawnStaticShellValidationInDevImpl(...args);
2435
+ } finally{
2436
+ console.log('<VALIDATION_MESSAGE>' + JSON.stringify({
2437
+ type: 'validation_end',
2438
+ requestId,
2439
+ url
2440
+ }) + '</VALIDATION_MESSAGE>');
2441
+ }
2442
+ } else {
2443
+ return await spawnStaticShellValidationInDevImpl(...args);
2444
+ }
2445
+ }
2446
+ /**
2447
+ * This function is a fork of prerenderToStream cacheComponents branch.
2448
+ * While it doesn't return a stream we want it to have identical
2449
+ * prerender semantics to prerenderToStream and should update it
2450
+ * in conjunction with any changes to that function.
2451
+ */ async function spawnStaticShellValidationInDevImpl(accumulatedChunksPromise, syncInterruptReason, startTime, staticStageEndTime, runtimeStageEndTime, ctx, requestStore, fallbackRouteParams, debugChannelClient) {
2452
+ const debug = process.env.NEXT_PRIVATE_DEBUG_VALIDATION === '1' ? console.log : undefined;
2453
+ const { componentMod: ComponentMod, getDynamicParamFromSegment, renderOpts, workStore } = ctx;
2454
+ const loaderTree = ComponentMod.routeModule.userland.loaderTree;
2455
+ const allowEmptyStaticShell = (renderOpts.allowEmptyStaticShell ?? false) || await (0, _instantconfig.isPageAllowedToBlock)(loaderTree);
2456
+ const rootParams = (0, _createcomponenttree.getRootParams)(loaderTree, getDynamicParamFromSegment);
2457
+ const hmrRefreshHash = (0, _workunitasyncstorageexternal.getHmrRefreshHash)(requestStore);
2458
+ // We don't need to continue the prerender process if we already
2459
+ // detected invalid dynamic usage in the initial prerender phase.
2460
+ const { invalidDynamicUsageError } = workStore;
2461
+ if (invalidDynamicUsageError) {
2462
+ return logMessagesAndSendErrorsToBrowser([
2463
+ invalidDynamicUsageError
2464
+ ], ctx);
2465
+ }
2466
+ if (syncInterruptReason) {
2467
+ return logMessagesAndSendErrorsToBrowser([
2468
+ syncInterruptReason
2469
+ ], ctx);
2470
+ }
2471
+ let debugChunks = null;
2472
+ if (debugChannelClient) {
2473
+ debugChunks = [];
2474
+ debugChannelClient.on('data', (c)=>{
2475
+ debugChunks.push(c);
2476
+ });
2477
+ }
2478
+ const accumulatedChunks = await accumulatedChunksPromise;
2479
+ const { staticChunks, runtimeChunks, dynamicChunks } = accumulatedChunks;
2480
+ const needsInstantValidation = await (0, _instantconfig.anySegmentNeedsInstantValidationInDev)(loaderTree);
2481
+ // `samples` from instant config are only used during build
2482
+ const validationSamples = null;
2483
+ const validationSampleTracking = null;
2484
+ // First we warmup SSR with the runtime chunks. This ensures that when we do
2485
+ // the full prerender pass with dynamic tracking module loading won't
2486
+ // interrupt the prerender and can properly observe the entire content
2487
+ await warmupClientModulesForStagedValidation(// if we're going to be validating prefetches, we'll be rendering some segments in the dynamic stage.
2488
+ // otherwise, for static shell validation, we only need to warm up to the runtime stage.
2489
+ // we also need to use a different store type, because instant validation allows more APIs to resolve.
2490
+ needsInstantValidation ? 'validation-client' : 'prerender-client', needsInstantValidation ? dynamicChunks : runtimeChunks, dynamicChunks, rootParams, fallbackRouteParams, allowEmptyStaticShell, ctx, validationSamples, validationSampleTracking);
2491
+ debug == null ? void 0 : debug(`Starting static shell validation...`);
2492
+ const runtimeResult = await validateStagedShell(runtimeChunks, dynamicChunks, debugChunks, runtimeStageEndTime, rootParams, fallbackRouteParams, allowEmptyStaticShell, ctx, hmrRefreshHash, _dynamicrendering.trackDynamicHoleInRuntimeShell);
2493
+ if (runtimeResult.length > 0) {
2494
+ debug == null ? void 0 : debug(`❌ Failed - ${runtimeResult.length} errors from runtime stage`);
2495
+ // We have something to report from the runtime validation
2496
+ // We can skip the rest
2497
+ return logMessagesAndSendErrorsToBrowser(runtimeResult, ctx);
2498
+ }
2499
+ const staticResult = await validateStagedShell(staticChunks, dynamicChunks, debugChunks, staticStageEndTime, rootParams, fallbackRouteParams, allowEmptyStaticShell, ctx, hmrRefreshHash, _dynamicrendering.trackDynamicHoleInStaticShell);
2500
+ if (staticResult.length > 0) {
2501
+ debug == null ? void 0 : debug(`❌ Failed - ${staticResult.length} errors from static stage`);
2502
+ // We have something to report from the static validation
2503
+ // We can skip the rest
2504
+ return logMessagesAndSendErrorsToBrowser(staticResult, ctx);
2505
+ }
2506
+ debug == null ? void 0 : debug(`✅ Passed`);
2507
+ if (needsInstantValidation) {
2508
+ const instantConfigsResult = await validateInstantConfigs(accumulatedChunks, debugChunks, startTime, rootParams, fallbackRouteParams, ctx, hmrRefreshHash, validationSamples);
2509
+ if (instantConfigsResult.length > 0) {
2510
+ return logMessagesAndSendErrorsToBrowser(instantConfigsResult, ctx);
2511
+ }
2512
+ }
2513
+ }
2514
+ async function warmupClientModulesForStagedValidation(storeType, partialServerChunks, allServerChunks, rootParams, fallbackRouteParams, allowEmptyStaticShell, ctx, validationSamples, validationSampleTracking) {
2515
+ const { implicitTags, nonce, workStore } = ctx;
2516
+ // Warmup SSR
2517
+ const initialClientPrerenderController = new AbortController();
2518
+ const initialClientReactController = new AbortController();
2519
+ const initialClientRenderController = new AbortController();
2520
+ const preinitScripts = ()=>{};
2521
+ const { ServerInsertedHTMLProvider } = (0, _serverinsertedhtml.createServerInsertedHTML)();
2522
+ let initialClientPrerenderStore;
2523
+ if (storeType === 'prerender-client') {
2524
+ const store = {
2525
+ type: 'prerender-client',
2526
+ phase: 'render',
2527
+ rootParams,
2528
+ fallbackRouteParams,
2529
+ implicitTags,
2530
+ renderSignal: initialClientRenderController.signal,
2531
+ controller: initialClientPrerenderController,
2532
+ // For HTML Generation the only cache tracked activity
2533
+ // is module loading, which has it's own cache signal
2534
+ cacheSignal: null,
2535
+ dynamicTracking: null,
2536
+ allowEmptyStaticShell,
2537
+ revalidate: _constants1.INFINITE_CACHE,
2538
+ expire: _constants1.INFINITE_CACHE,
2539
+ stale: _constants1.INFINITE_CACHE,
2540
+ tags: [
2541
+ ...implicitTags.tags
2542
+ ],
2543
+ // TODO should this be removed from client stores?
2544
+ prerenderResumeDataCache: null,
2545
+ renderResumeDataCache: null,
2546
+ hmrRefreshHash: undefined,
2547
+ // Client prerenders don't track server param access
2548
+ varyParamsAccumulator: null
2549
+ };
2550
+ initialClientPrerenderStore = store;
2551
+ } else {
2552
+ const store = {
2553
+ type: 'validation-client',
2554
+ phase: 'render',
2555
+ rootParams,
2556
+ implicitTags,
2557
+ renderSignal: initialClientRenderController.signal,
2558
+ controller: initialClientPrerenderController,
2559
+ // For HTML Generation the only cache tracked activity
2560
+ // is module loading, which has it's own cache signal
2561
+ cacheSignal: null,
2562
+ dynamicTracking: null,
2563
+ revalidate: _constants1.INFINITE_CACHE,
2564
+ expire: _constants1.INFINITE_CACHE,
2565
+ stale: _constants1.INFINITE_CACHE,
2566
+ tags: [
2567
+ ...implicitTags.tags
2568
+ ],
2569
+ // TODO should this be removed from client stores?
2570
+ prerenderResumeDataCache: null,
2571
+ renderResumeDataCache: null,
2572
+ hmrRefreshHash: undefined,
2573
+ // Client prerenders don't track server param access
2574
+ varyParamsAccumulator: null,
2575
+ // We're not rendering any validation boundaries yet.
2576
+ boundaryState: null,
2577
+ validationSamples,
2578
+ validationSampleTracking,
2579
+ fallbackRouteParams
2580
+ };
2581
+ initialClientPrerenderStore = store;
2582
+ }
2583
+ // TODO: maybe conditionally switch between runtime chunks and all chunks?
2584
+ // but warming too much should always be fine, just not always necessary
2585
+ const serverStream = (0, _streamutils.createNodeStreamWithLateRelease)(partialServerChunks, allServerChunks, initialClientReactController.signal);
2586
+ const pendingInitialClientResult = _workunitasyncstorageexternal.workUnitAsyncStorage.run(initialClientPrerenderStore, _streamops.getClientPrerender, // eslint-disable-next-line @next/internal/no-ambiguous-jsx -- React Client
2587
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(App, {
2588
+ reactServerStream: serverStream,
2589
+ reactDebugStream: undefined,
2590
+ debugEndTime: undefined,
2591
+ preinitScripts: preinitScripts,
2592
+ ServerInsertedHTMLProvider: ServerInsertedHTMLProvider,
2593
+ nonce: nonce,
2594
+ images: ctx.renderOpts.images
2595
+ }), {
2596
+ signal: initialClientReactController.signal,
2597
+ onError: (err)=>{
2598
+ const digest = (0, _createerrorhandler.getDigestForWellKnownError)(err);
2599
+ if (digest) {
2600
+ return digest;
2601
+ }
2602
+ if ((0, _reactlargeshellerror.isReactLargeShellError)(err)) {
2603
+ // TODO: Aggregate
2604
+ console.error(err);
2605
+ return undefined;
2606
+ }
2607
+ if (initialClientReactController.signal.aborted) {
2608
+ // These are expected errors that might error the prerender. we ignore them.
2609
+ } else if (process.env.NEXT_DEBUG_BUILD || process.env.__NEXT_VERBOSE_LOGGING) {
2610
+ // We don't normally log these errors because we are going to retry anyway but
2611
+ // it can be useful for debugging Next.js itself to get visibility here when needed
2612
+ (0, _prospectiverenderutils.printDebugThrownValueForProspectiveRender)(err, workStore.route, _prospectiverenderutils.Phase.ProspectiveRender);
2613
+ }
2614
+ }
2615
+ });
2616
+ // The listener to abort our own render controller must be added after React
2617
+ // has added its listener, to ensure that pending I/O is not
2618
+ // aborted/rejected too early.
2619
+ initialClientReactController.signal.addEventListener('abort', ()=>{
2620
+ initialClientRenderController.abort();
2621
+ }, {
2622
+ once: true
2623
+ });
2624
+ pendingInitialClientResult.catch((err)=>{
2625
+ if (initialClientReactController.signal.aborted || (0, _dynamicrendering.isPrerenderInterruptedError)(err)) {
2626
+ // These are expected errors that might error the prerender. we ignore them.
2627
+ } else if (process.env.NEXT_DEBUG_BUILD || process.env.__NEXT_VERBOSE_LOGGING) {
2628
+ // We don't normally log these errors because we are going to retry anyway but
2629
+ // it can be useful for debugging Next.js itself to get visibility here when needed
2630
+ (0, _prospectiverenderutils.printDebugThrownValueForProspectiveRender)(err, workStore.route, _prospectiverenderutils.Phase.ProspectiveRender);
2631
+ }
2632
+ });
2633
+ // This is mostly needed for dynamic `import()`s in client components.
2634
+ // Promises passed to client were already awaited above (assuming that they came from cached functions)
2635
+ const cacheSignal = new _cachesignal.CacheSignal();
2636
+ (0, _trackmoduleloadingexternal.trackPendingModules)(cacheSignal);
2637
+ await cacheSignal.cacheReady();
2638
+ initialClientReactController.abort();
2639
+ }
2640
+ async function validateStagedShell(stageChunks, allServerChunks, debugChunks, debugEndTime, rootParams, fallbackRouteParams, allowEmptyStaticShell, ctx, hmrRefreshHash, trackDynamicHole) {
2641
+ const { implicitTags, nonce, workStore } = ctx;
2642
+ const clientDynamicTracking = (0, _dynamicrendering.createDynamicTrackingState)(false //isDebugDynamicAccesses
2643
+ );
2644
+ const clientReactController = new AbortController();
2645
+ const clientRenderController = new AbortController();
2646
+ const preinitScripts = ()=>{};
2647
+ const { ServerInsertedHTMLProvider } = (0, _serverinsertedhtml.createServerInsertedHTML)();
2648
+ const finalClientPrerenderStore = {
2649
+ type: 'prerender-client',
2650
+ phase: 'render',
2651
+ rootParams,
2652
+ fallbackRouteParams,
2653
+ implicitTags,
2654
+ renderSignal: clientRenderController.signal,
2655
+ controller: clientReactController,
2656
+ // No APIs require a cacheSignal through the workUnitStore during the HTML prerender
2657
+ cacheSignal: null,
2658
+ dynamicTracking: clientDynamicTracking,
2659
+ allowEmptyStaticShell,
2660
+ revalidate: _constants1.INFINITE_CACHE,
2661
+ expire: _constants1.INFINITE_CACHE,
2662
+ stale: _constants1.INFINITE_CACHE,
2663
+ tags: [
2664
+ ...implicitTags.tags
2665
+ ],
2666
+ // TODO should this be removed from client stores?
2667
+ prerenderResumeDataCache: null,
2668
+ renderResumeDataCache: null,
2669
+ hmrRefreshHash,
2670
+ // Client prerenders don't track server param access
2671
+ varyParamsAccumulator: null
2672
+ };
2673
+ const dynamicValidation = (0, _dynamicrendering.createDynamicValidationState)();
2674
+ const serverStream = (0, _streamutils.createNodeStreamWithLateRelease)(stageChunks, allServerChunks, clientReactController.signal);
2675
+ const debugChannelClient = debugChunks ? (0, _streamutils.createNodeStreamWithLateRelease)(debugChunks, debugChunks, clientReactController.signal) : undefined;
2676
+ try {
2677
+ let { prelude: unprocessedPrelude } = await (0, _apprenderrenderutils.runInSequentialTasks)(()=>{
2678
+ const pendingFinalClientResult = _workunitasyncstorageexternal.workUnitAsyncStorage.run(finalClientPrerenderStore, _streamops.getClientPrerender, // eslint-disable-next-line @next/internal/no-ambiguous-jsx -- React Client
2679
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(App, {
2680
+ reactServerStream: serverStream,
2681
+ reactDebugStream: debugChannelClient,
2682
+ debugEndTime: debugEndTime,
2683
+ preinitScripts: preinitScripts,
2684
+ ServerInsertedHTMLProvider: ServerInsertedHTMLProvider,
2685
+ nonce: nonce,
2686
+ images: ctx.renderOpts.images
2687
+ }), {
2688
+ signal: clientReactController.signal,
2689
+ onError: (err, errorInfo)=>{
2690
+ if ((0, _dynamicrendering.isPrerenderInterruptedError)(err) || clientReactController.signal.aborted) {
2691
+ const componentStack = errorInfo.componentStack;
2692
+ if (typeof componentStack === 'string') {
2693
+ trackDynamicHole(workStore, componentStack, dynamicValidation, clientDynamicTracking);
2694
+ }
2695
+ return;
2696
+ }
2697
+ if ((0, _reactlargeshellerror.isReactLargeShellError)(err)) {
2698
+ // TODO: Aggregate
2699
+ console.error(err);
2700
+ return undefined;
2701
+ }
2702
+ return (0, _createerrorhandler.getDigestForWellKnownError)(err);
2703
+ }
2704
+ });
2705
+ // The listener to abort our own render controller must be added after
2706
+ // React has added its listener, to ensure that pending I/O is not
2707
+ // aborted/rejected too early.
2708
+ clientReactController.signal.addEventListener('abort', ()=>{
2709
+ clientRenderController.abort();
2710
+ }, {
2711
+ once: true
2712
+ });
2713
+ return pendingFinalClientResult;
2714
+ }, ()=>{
2715
+ clientReactController.abort();
2716
+ });
2717
+ const { preludeIsEmpty } = await (0, _streamops.processPrelude)(unprocessedPrelude);
2718
+ return (0, _dynamicrendering.getStaticShellDisallowedDynamicReasons)(workStore, preludeIsEmpty ? _dynamicrendering.PreludeState.Empty : _dynamicrendering.PreludeState.Full, dynamicValidation, // TODO(instant-validation): if allowEmptyStaticShell is true (likely due to blocking configs),
2719
+ // we should probably just skip this altogether
2720
+ allowEmptyStaticShell);
2721
+ } catch (thrownValue) {
2722
+ // Even if the root errors we still want to report any cache components errors
2723
+ // that were discovered before the root errored.
2724
+ let errors = (0, _dynamicrendering.getStaticShellDisallowedDynamicReasons)(workStore, _dynamicrendering.PreludeState.Errored, dynamicValidation, // TODO(instant-validation): if allowEmptyStaticShell is true (likely due to blocking configs),
2725
+ // we should probably just skip this altogether
2726
+ allowEmptyStaticShell);
2727
+ if (process.env.NEXT_DEBUG_BUILD || process.env.__NEXT_VERBOSE_LOGGING) {
2728
+ errors.unshift('During dynamic validation the root of the page errored. The next logged error is the thrown value. It may be a duplicate of errors reported during the normal development mode render.', thrownValue);
2729
+ }
2730
+ return errors;
2731
+ }
2732
+ }
2733
+ /**
2734
+ * Validates instant configs by iterating URL depths from deepest to
2735
+ * shallowest. At each depth, builds a combined payload where segments
2736
+ * above the boundary use Dynamic stage (already mounted) and segments
2737
+ * below use Static/Runtime stage (being prefetched). If the new subtree
2738
+ * contains any `unstable_instant` configs, the payload is rendered to
2739
+ * detect dynamic holes without Suspense.
2740
+ */ async function validateInstantConfigs(accumulatedChunks, debugChunks, startTime, rootParams, fallbackRouteParams, ctx, hmrRefreshHash, validationSamples) {
2741
+ const debug = process.env.NEXT_PRIVATE_DEBUG_VALIDATION === '1' ? console.log : undefined;
2742
+ const { createCombinedPayloadAtDepth, createCombinedPayloadStream, collectStagedSegmentData, discoverValidationDepths } = ctx.componentMod.InstantValidation();
2743
+ const { createValidationSampleTracking } = require('./instant-validation/instant-samples');
2744
+ debug == null ? void 0 : debug('\nStarting depth-based instant validation...');
2745
+ const loaderTree = ctx.componentMod.routeModule.userland.loaderTree;
2746
+ // Only affects a debug environment name label, not functional behavior.
2747
+ const hasRuntimePrefetch = true;
2748
+ const clientReferenceManifest = (0, _manifestssingleton.getClientReferenceManifest)();
2749
+ const { cache, payload: initialRscPayload, stageEndTimes } = await collectStagedSegmentData({
2750
+ [_stagedrendering.RenderStage.Static]: accumulatedChunks.staticChunks,
2751
+ [_stagedrendering.RenderStage.Runtime]: accumulatedChunks.runtimeChunks,
2752
+ [_stagedrendering.RenderStage.Dynamic]: accumulatedChunks.dynamicChunks
2753
+ }, debugChunks, startTime, hasRuntimePrefetch, clientReferenceManifest);
2754
+ const { implicitTags, nonce, workStore } = ctx;
2755
+ const isDebugChannelEnabled = !!ctx.renderOpts.setReactDebugChannel;
2756
+ /**
2757
+ * Build and validate a combined payload at the given URL depth.
2758
+ *
2759
+ * Returns null if no instant config exists at this depth.
2760
+ * Returns an empty array if validation passed.
2761
+ * Returns a non-empty array of errors if validation failed.
2762
+ *
2763
+ * When the initial validation uses static segments and finds errors,
2764
+ * automatically retries with runtime stages to discriminate between
2765
+ * runtime and dynamic errors, returning the more specific result.
2766
+ */ async function validateAtDepth(depth, groupDepthForValidation) {
2767
+ return validateAtDepthImpl(depth, groupDepthForValidation, null);
2768
+ }
2769
+ async function validateAtDepthImpl(depth, groupDepthForValidation, previousBoundaryState) {
2770
+ const extraChunksController = new AbortController();
2771
+ const boundaryState = (0, _boundarytracking.createValidationBoundaryTracking)();
2772
+ let useRuntimeStageForPartialSegments = false;
2773
+ if (previousBoundaryState) {
2774
+ // We're doing a followup render to better discriminate error types
2775
+ useRuntimeStageForPartialSegments = true;
2776
+ for (const id of previousBoundaryState.expectedIds){
2777
+ boundaryState.expectedIds.add(id);
2778
+ }
2779
+ }
2780
+ const payloadResult = await createCombinedPayloadAtDepth(initialRscPayload, cache, loaderTree, ctx.getDynamicParamFromSegment, ctx.query, depth, groupDepthForValidation, extraChunksController.signal, boundaryState, clientReferenceManifest, stageEndTimes, useRuntimeStageForPartialSegments);
2781
+ if (payloadResult === null) {
2782
+ return null;
2783
+ }
2784
+ const reactController = new AbortController();
2785
+ const renderController = new AbortController();
2786
+ const preinitScripts = ()=>{};
2787
+ const { ServerInsertedHTMLProvider } = (0, _serverinsertedhtml.createServerInsertedHTML)();
2788
+ const { stream: serverStream, debugStream } = await createCombinedPayloadStream(payloadResult.payload, extraChunksController, reactController.signal, clientReferenceManifest, startTime, isDebugChannelEnabled);
2789
+ const instantValidationState = (0, _dynamicrendering.createInstantValidationState)(payloadResult.createInstantStack);
2790
+ const validationSampleTracking = validationSamples !== null ? createValidationSampleTracking() : null;
2791
+ const clientDynamicTracking = (0, _dynamicrendering.createDynamicTrackingState)(false);
2792
+ const prerenderStore = {
2793
+ type: 'validation-client',
2794
+ phase: 'render',
2795
+ rootParams,
2796
+ implicitTags,
2797
+ renderSignal: renderController.signal,
2798
+ controller: reactController,
2799
+ cacheSignal: null,
2800
+ dynamicTracking: clientDynamicTracking,
2801
+ revalidate: _constants1.INFINITE_CACHE,
2802
+ expire: _constants1.INFINITE_CACHE,
2803
+ stale: _constants1.INFINITE_CACHE,
2804
+ tags: [
2805
+ ...implicitTags.tags
2806
+ ],
2807
+ prerenderResumeDataCache: null,
2808
+ renderResumeDataCache: null,
2809
+ hmrRefreshHash,
2810
+ varyParamsAccumulator: null,
2811
+ boundaryState,
2812
+ fallbackRouteParams,
2813
+ validationSamples,
2814
+ validationSampleTracking
2815
+ };
2816
+ let errors;
2817
+ try {
2818
+ const { prelude: unprocessedPrelude } = await (0, _apprenderrenderutils.runInSequentialTasks)(()=>{
2819
+ const pendingResult = _workunitasyncstorageexternal.workUnitAsyncStorage.run(prerenderStore, _streamops.getClientPrerender, // eslint-disable-next-line @next/internal/no-ambiguous-jsx -- React Client
2820
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(App, {
2821
+ reactServerStream: serverStream,
2822
+ reactDebugStream: debugStream ?? undefined,
2823
+ debugEndTime: undefined,
2824
+ preinitScripts: preinitScripts,
2825
+ ServerInsertedHTMLProvider: ServerInsertedHTMLProvider,
2826
+ nonce: nonce,
2827
+ images: ctx.renderOpts.images
2828
+ }), {
2829
+ signal: reactController.signal,
2830
+ onError: (err, errorInfo)=>{
2831
+ if ((0, _dynamicrendering.isPrerenderInterruptedError)(err) || reactController.signal.aborted) {
2832
+ const componentStack = errorInfo.componentStack;
2833
+ if (typeof componentStack === 'string') {
2834
+ (0, _dynamicrendering.trackDynamicHoleInNavigation)(workStore, componentStack, instantValidationState, clientDynamicTracking, payloadResult.hasAmbiguousErrors ? _dynamicrendering.DynamicHoleKind.Runtime : _dynamicrendering.DynamicHoleKind.Dynamic, boundaryState);
2835
+ }
2836
+ return;
2837
+ } else if (!reactController.signal.aborted) {
2838
+ const componentStack = errorInfo.componentStack;
2839
+ if (typeof componentStack === 'string') {
2840
+ let errorForDisplay = err;
2841
+ if (process.env.NODE_ENV === 'production') {
2842
+ // In production (i.e. build validation), Flight omits everything except the digest
2843
+ // when serializing errors, which makes them very unfriendly for debugging.
2844
+ // Map the deserialized errors back to their original error object to make it more useful.
2845
+ if (err && typeof err === 'object' && 'digest' in err && typeof err.digest === 'string') {
2846
+ const serverError = workStore.reactServerErrorsByDigest.get(err.digest);
2847
+ if (serverError !== undefined) {
2848
+ errorForDisplay = serverError;
2849
+ }
2850
+ }
2851
+ }
2852
+ (0, _dynamicrendering.trackThrownErrorInNavigation)(workStore, instantValidationState, errorForDisplay, componentStack);
2853
+ }
2854
+ }
2855
+ if ((0, _reactlargeshellerror.isReactLargeShellError)(err)) {
2856
+ console.error(err);
2857
+ return undefined;
2858
+ }
2859
+ return (0, _createerrorhandler.getDigestForWellKnownError)(err);
2860
+ }
2861
+ });
2862
+ reactController.signal.addEventListener('abort', ()=>{
2863
+ renderController.abort();
2864
+ }, {
2865
+ once: true
2866
+ });
2867
+ return pendingResult;
2868
+ }, ()=>{
2869
+ reactController.abort();
2870
+ });
2871
+ const { preludeIsEmpty } = await (0, _streamops.processPrelude)(unprocessedPrelude);
2872
+ errors = (0, _dynamicrendering.getNavigationDisallowedDynamicReasons)(workStore, preludeIsEmpty ? _dynamicrendering.PreludeState.Empty : _dynamicrendering.PreludeState.Full, instantValidationState, validationSampleTracking, boundaryState);
2873
+ } catch (thrownValue) {
2874
+ errors = (0, _dynamicrendering.getNavigationDisallowedDynamicReasons)(workStore, _dynamicrendering.PreludeState.Errored, instantValidationState, validationSampleTracking, boundaryState);
2875
+ }
2876
+ // This prerender did not produce any errors
2877
+ if (errors.length === 0) {
2878
+ return [];
2879
+ }
2880
+ if (previousBoundaryState === null && payloadResult.hasAmbiguousErrors) {
2881
+ // This is the first validation attempt. we prepared a payload where dynamic holes might be runtime data dependencies
2882
+ // or dynamic data dependencies. We do a followup validation using a payload with only Runtime segments to discriminate
2883
+ const dynamicOnlyErrors = await validateAtDepthImpl(depth, groupDepthForValidation, boundaryState);
2884
+ if (dynamicOnlyErrors !== null && dynamicOnlyErrors.length > 0) {
2885
+ // The dynamic errors only validation found errors to report so we favor those
2886
+ return dynamicOnlyErrors;
2887
+ }
2888
+ }
2889
+ // If we didn't return some other errors at this point the only thing to return is this validation's errors
2890
+ return errors;
2891
+ }
2892
+ // Discover validation depth bounds from the LoaderTree. The array
2893
+ // length is the max URL depth; each entry is the max group depth
2894
+ // (route group segments) between that URL depth and the next.
2895
+ const groupDepthsByUrlDepth = discoverValidationDepths(loaderTree);
2896
+ const maxDepth = groupDepthsByUrlDepth.length;
2897
+ for(let depth = maxDepth - 1; depth >= 0; depth--){
2898
+ const maxGroupDepth = groupDepthsByUrlDepth[depth];
2899
+ for(let currentGroupDepth = maxGroupDepth; currentGroupDepth >= 0; currentGroupDepth--){
2900
+ debug == null ? void 0 : debug(`Trying depth ${depth}` + (currentGroupDepth > 0 ? ` + groupDepth ${currentGroupDepth}...` : '...'));
2901
+ const errors = await validateAtDepth(depth, currentGroupDepth);
2902
+ if (errors === null) {
2903
+ debug == null ? void 0 : debug(` No config at depth ${depth}+${currentGroupDepth}, skipping.`);
2904
+ continue;
2905
+ }
2906
+ if (errors.length > 0) {
2907
+ debug == null ? void 0 : debug(` Depth ${depth}+${currentGroupDepth}: ❌ Failed (${errors.length} errors)`);
2908
+ return errors;
2909
+ }
2910
+ debug == null ? void 0 : debug(` Depth ${depth}+${currentGroupDepth}: ✅ Passed`);
2911
+ }
2912
+ }
2913
+ debug == null ? void 0 : debug(`✅ All depths passed`);
2914
+ return [];
2915
+ }
2916
+ /**
2917
+ * Two-pass render for build-time instant validation.
2918
+ * The flow is similar to `renderWithRestartOnCacheMissInDev`: pass 1 warms caches,
2919
+ * pass 2 renders with warm caches. If pass 1 has no cache misses,
2920
+ * its result is returned directly.
2921
+ *
2922
+ * Differences from `renderWithRestartOnCacheMissInDev`:
2923
+ * - both renders are abortable: if we know that we can't use a stream, we can just
2924
+ * throw it away, we don't have to render a complete result.
2925
+ * - We don't need to tee the stream, we only care about accumulating chunks.
2926
+ */ async function renderWithRestartOnCacheMissInValidation(ctx, initialRequestStore, createRequestStore, getPayload, createOnError, prefilledDataCache) {
2927
+ const { componentMod: ComponentMod } = ctx;
2928
+ const { clientModules } = (0, _manifestssingleton.getClientReferenceManifest)();
2929
+ let startTime = -Infinity;
2930
+ let requestStore = initialRequestStore;
2931
+ //===============================================
2932
+ // Initial render (prospective — may warm caches)
2933
+ //===============================================
2934
+ const cacheSignal = new _cachesignal.CacheSignal();
2935
+ (0, _trackmoduleloadingexternal.trackPendingModules)(cacheSignal);
2936
+ // The prerender we rean before the validation probably already filled some caches,
2937
+ // so we want to save work and re-use them.
2938
+ const prerenderResumeDataCache = prefilledDataCache ? (0, _resumedatacache.createPrerenderResumeDataCache)(prefilledDataCache) : (0, _resumedatacache.createPrerenderResumeDataCache)();
2939
+ const initialReactController = new AbortController();
2940
+ const initialDataController = new AbortController();
2941
+ const initialAbandonController = new AbortController();
2942
+ const initialStageController = new _stagedrendering.StagedRenderingController(initialDataController.signal, initialAbandonController, true // track sync IO
2943
+ );
2944
+ requestStore.prerenderResumeDataCache = prerenderResumeDataCache;
2945
+ requestStore.renderResumeDataCache = null;
2946
+ requestStore.stagedRendering = initialStageController;
2947
+ requestStore.cacheSignal = cacheSignal;
2948
+ requestStore.asyncApiPromises = createAsyncApiPromises(initialStageController, requestStore.cookies, requestStore.mutableCookies, requestStore.headers);
2949
+ // We don't set `requestStore.controller and requestStore.renderSignal here.
2950
+ // Right now, we only abort for sync IO, and in the first render, that's just a restart
2951
+ // (after waiting for caches)
2952
+ requestStore.controller = undefined;
2953
+ requestStore.renderSignal = undefined;
2954
+ const initialRscPayload = await getPayload(requestStore);
2955
+ const advanceStageIfNoCacheMiss = (stage)=>{
2956
+ if (initialAbandonController.signal.aborted === true) {
2957
+ return;
2958
+ } else if (cacheSignal.hasPendingReads()) {
2959
+ initialAbandonController.abort();
2960
+ } else {
2961
+ initialStageController.advanceStage(stage);
2962
+ }
2963
+ };
2964
+ const initialResult = await (0, _apprenderrenderutils.runInSequentialTasks)(()=>{
2965
+ initialStageController.advanceStage(_stagedrendering.RenderStage.EarlyStatic);
2966
+ startTime = performance.now() + performance.timeOrigin;
2967
+ const stream = _workunitasyncstorageexternal.workUnitAsyncStorage.run(requestStore, _streamops.renderToFlightStream, ComponentMod, initialRscPayload, clientModules, {
2968
+ onError: createOnError(initialReactController.signal, false),
2969
+ startTime,
2970
+ filterStackFrame,
2971
+ signal: initialReactController.signal
2972
+ });
2973
+ initialReactController.signal.addEventListener('abort', ()=>{
2974
+ const { reason } = initialReactController.signal;
2975
+ initialDataController.abort(reason);
2976
+ }, {
2977
+ once: true
2978
+ });
2979
+ const accumulatedChunksPromise = accumulateStreamChunks(stream, initialStageController, initialDataController.signal);
2980
+ accumulatedChunksPromise.catch(()=>{});
2981
+ return {
2982
+ accumulatedChunksPromise
2983
+ };
2984
+ }, ()=>{
2985
+ advanceStageIfNoCacheMiss(_stagedrendering.RenderStage.Static);
2986
+ }, ()=>{
2987
+ advanceStageIfNoCacheMiss(_stagedrendering.RenderStage.EarlyRuntime);
2988
+ }, ()=>{
2989
+ advanceStageIfNoCacheMiss(_stagedrendering.RenderStage.Runtime);
2990
+ }, ()=>{
2991
+ advanceStageIfNoCacheMiss(_stagedrendering.RenderStage.Dynamic);
2992
+ });
2993
+ if (initialStageController.currentStage !== _stagedrendering.RenderStage.Abandoned) {
2994
+ // No cache misses. Use the result as-is.
2995
+ return {
2996
+ accumulatedChunksPromise: initialResult.accumulatedChunksPromise,
2997
+ startTime,
2998
+ stageController: initialStageController,
2999
+ requestStore
3000
+ };
3001
+ }
3002
+ // Cache miss. Wait for caches to fill, then re-render with warm caches.
3003
+ await cacheSignal.cacheReady();
3004
+ initialReactController.abort();
3005
+ //===============================================
3006
+ // Final render (restarted, with warm caches)
3007
+ //===============================================
3008
+ requestStore = createRequestStore();
3009
+ // Unlike dev, where we're re-using the render that'll be visible in the browser,
3010
+ // we *can* abort the validation render.
3011
+ const finalReactController = new AbortController();
3012
+ const finalDataController = new AbortController();
3013
+ const finalStageController = new _stagedrendering.StagedRenderingController(finalDataController.signal, null, true // track sync IO
3014
+ );
3015
+ requestStore.prerenderResumeDataCache = null;
3016
+ requestStore.renderResumeDataCache = (0, _resumedatacache.createRenderResumeDataCache)(prerenderResumeDataCache);
3017
+ requestStore.stagedRendering = finalStageController;
3018
+ requestStore.cacheSignal = null;
3019
+ requestStore.asyncApiPromises = createAsyncApiPromises(finalStageController, requestStore.cookies, requestStore.mutableCookies, requestStore.headers);
3020
+ // Right now, we only abort for sync IO.
3021
+ // If sync IO occurs in a place where it's not allowed, then we have to fail validation,
3022
+ // and we can abort the render immediately, without waiting for anything else..
3023
+ requestStore.controller = finalReactController;
3024
+ requestStore.renderSignal = finalDataController.signal;
3025
+ const finalRscPayload = await getPayload(requestStore);
3026
+ const finalResult = await (0, _apprenderrenderutils.runInSequentialTasks)(()=>{
3027
+ finalStageController.advanceStage(_stagedrendering.RenderStage.EarlyStatic);
3028
+ startTime = performance.now() + performance.timeOrigin;
3029
+ const stream = _workunitasyncstorageexternal.workUnitAsyncStorage.run(requestStore, _streamops.renderToFlightStream, ComponentMod, finalRscPayload, clientModules, {
3030
+ onError: createOnError(finalReactController.signal, true),
3031
+ startTime,
3032
+ filterStackFrame,
3033
+ signal: finalReactController.signal
3034
+ });
3035
+ finalReactController.signal.addEventListener('abort', ()=>{
3036
+ finalDataController.abort(finalReactController.signal.reason);
3037
+ }, {
3038
+ once: true
3039
+ });
3040
+ const accumulatedChunksPromise = accumulateStreamChunks(stream, finalStageController, null);
3041
+ accumulatedChunksPromise.catch(()=>{});
3042
+ return {
3043
+ accumulatedChunksPromise
3044
+ };
3045
+ }, ()=>{
3046
+ finalStageController.advanceStage(_stagedrendering.RenderStage.Static);
3047
+ }, ()=>{
3048
+ finalStageController.advanceStage(_stagedrendering.RenderStage.EarlyRuntime);
3049
+ }, ()=>{
3050
+ finalStageController.advanceStage(_stagedrendering.RenderStage.Runtime);
3051
+ }, ()=>{
3052
+ finalStageController.advanceStage(_stagedrendering.RenderStage.Dynamic);
3053
+ });
3054
+ return {
3055
+ accumulatedChunksPromise: finalResult.accumulatedChunksPromise,
3056
+ startTime,
3057
+ stageController: finalStageController,
3058
+ requestStore
3059
+ };
3060
+ }
3061
+ async function validateInstantConfigsInBuild(ctx, prefilledDataCache) {
3062
+ const run = async ()=>{
3063
+ let success;
3064
+ try {
3065
+ // The validation renders are separate renders, and use a separate WorkStore.
3066
+ // However, we defensively exit the existing workStore to avoid relying on something from there
3067
+ // before we shadow it.
3068
+ success = await _workasyncstorageexternal.workAsyncStorage.exit(async ()=>validateInstantConfigsInBuildImpl(ctx, prefilledDataCache));
3069
+ } catch (err) {
3070
+ console.error(Object.defineProperty(new _invarianterror.InvariantError('An unexpected error occcured during instant validation', {
3071
+ cause: err
3072
+ }), "__NEXT_ERROR_CODE", {
3073
+ value: "E1097",
3074
+ enumerable: false,
3075
+ configurable: true
3076
+ }));
3077
+ success = false;
3078
+ }
3079
+ if (!success) {
3080
+ console.error('Stopping prerender due to instant validation errors.');
3081
+ throw new _staticgenerationbailout.StaticGenBailoutError();
3082
+ }
3083
+ };
3084
+ if (process.env.__NEXT_TEST_MODE && process.env.NEXT_TEST_LOG_VALIDATION) {
3085
+ // In tests, we use these markers to extract the relevant portion of the CLI logs.
3086
+ // We want consistent ordering of these messages and other console.error calls,
3087
+ // so we use console.error here as well. Using console.log leads to non-deterministic
3088
+ // log order, likely stdout/stderr can interleave in non-deterministic ways.
3089
+ const requestId = Date.now();
3090
+ const route = ctx.workStore.route;
3091
+ console.error('<VALIDATION_MESSAGE>' + JSON.stringify({
3092
+ type: 'validation_start',
3093
+ requestId,
3094
+ url: route
3095
+ }) + '</VALIDATION_MESSAGE>');
3096
+ try {
3097
+ return await run();
3098
+ } finally{
3099
+ console.error('<VALIDATION_MESSAGE>' + JSON.stringify({
3100
+ type: 'validation_end',
3101
+ requestId,
3102
+ url: route
3103
+ }) + '</VALIDATION_MESSAGE>');
3104
+ }
3105
+ } else {
3106
+ return await run();
3107
+ }
3108
+ }
3109
+ /**
3110
+ * Runs instant validation at build time using the `samples` from `unstable_instant`.
3111
+ *
3112
+ * For each sample, this creates a staged RSC render with a synthetic `RequestStore`
3113
+ * populated from sample data, then feeds the accumulated chunks to
3114
+ * `validateInstantConfigs` which handles the actual validation.
3115
+ */ async function validateInstantConfigsInBuildImpl(ctx, prefilledDataCache) {
3116
+ const debug = process.env.NEXT_PRIVATE_DEBUG_VALIDATION === '1' ? console.log : undefined;
3117
+ const { workStore: outerWorkStore } = ctx;
3118
+ const route = outerWorkStore.route;
3119
+ const loaderTree = ctx.componentMod.routeModule.userland.loaderTree;
3120
+ let samples = await (0, _instantconfig.resolveInstantConfigSamplesForPage)(loaderTree);
3121
+ if (!samples || samples.length === 0) {
3122
+ // No samples defined; use a single empty sample to still run validation
3123
+ samples = [
3124
+ {}
3125
+ ];
3126
+ }
3127
+ debug == null ? void 0 : debug('Resolved samples:', samples);
3128
+ const allPossibleFallbackRouteParams = (0, _fallbackparams.getFallbackRouteParams)(route, ctx.componentMod.routeModule);
3129
+ for(let sampleIndex = 0; sampleIndex < samples.length; sampleIndex++){
3130
+ const sample = samples[sampleIndex];
3131
+ debug == null ? void 0 : debug(`Validating sample (${sampleIndex + 1}/${samples.length}):`, sample);
3132
+ let errors;
3133
+ try {
3134
+ errors = await _consoleasyncstorageexternal.consoleAsyncStorage.run({
3135
+ dim: true
3136
+ }, ()=>validateInstantConfigInBuildWithSample(ctx, sample, allPossibleFallbackRouteParams, prefilledDataCache));
3137
+ } catch (err) {
3138
+ if ((0, _instantvalidationerror.isInstantValidationError)(err)) {
3139
+ errors = [
3140
+ err
3141
+ ];
3142
+ } else {
3143
+ throw err;
3144
+ }
3145
+ }
3146
+ if (errors.length > 0) {
3147
+ debug == null ? void 0 : debug(`❌ Sample failed validation (${errors.length} errors)`);
3148
+ const sampleDesc = samples.length > 1 ? ` (sample ${sampleIndex + 1} of ${samples.length})` : '';
3149
+ for (const err of errors){
3150
+ console.error(err);
3151
+ }
3152
+ console.error(`Build-time instant validation failed for route "${route}"${sampleDesc}.`);
3153
+ return false;
3154
+ } else {
3155
+ debug == null ? void 0 : debug('✅ Sample validated successfully');
3156
+ }
3157
+ }
3158
+ return true;
3159
+ }
3160
+ async function validateInstantConfigInBuildWithSample(outerCtx, sample, allPossibleFallbackRouteParams, prefilledDataCache) {
3161
+ // The flow for build mirrors what we do when validating in dev.
3162
+ // We have to perform a full dynamic render to get the RSC chunks for each stage.
3163
+ // In order to do that, we have to set up a mock AppRenderContext, workStore, and requestStore
3164
+ // based on the `sample` we're using.
3165
+ const { workStore: outerWorkStore } = outerCtx;
3166
+ const loaderTree = outerCtx.componentMod.routeModule.userland.loaderTree;
3167
+ const route = outerWorkStore.route;
3168
+ const { createCookiesFromSample, createHeadersFromSample, createDraftModeForValidation, createRelativeURLFromSamples, createValidationSampleTracking } = require('./instant-validation/instant-samples');
3169
+ // TODO(instant-validation-build): it feels like this should happen higher up
3170
+ // and go through existing URL parsing/generation logic?
3171
+ const sampleUrl = createRelativeURLFromSamples(route, sample.params, sample.searchParams);
3172
+ const sampleParams = sample.params ?? {};
3173
+ let fallbackRouteParams = null;
3174
+ if (allPossibleFallbackRouteParams) {
3175
+ const fallbackRouteParamsMut = new Map();
3176
+ for (const [paramKey, value] of allPossibleFallbackRouteParams){
3177
+ if (!(paramKey in sampleParams)) {
3178
+ fallbackRouteParamsMut.set(paramKey, value);
3179
+ }
3180
+ }
3181
+ fallbackRouteParams = fallbackRouteParamsMut;
3182
+ }
3183
+ const getDynamicParamFromSegment = makeGetDynamicParamFromSegment(sampleParams, fallbackRouteParams, false);
3184
+ const sampleRootParams = (0, _createcomponenttree.getRootParams)(loaderTree, getDynamicParamFromSegment);
3185
+ let sampleUrlWithoutQuery;
3186
+ let sampleQuery;
3187
+ ({ query: sampleQuery, ...sampleUrlWithoutQuery } = sampleUrl);
3188
+ const { AfterContext } = require('../after/after-context');
3189
+ // NOTE: Matching the field order in `createWorkStore` to avoid deopting.
3190
+ const workStore = {
3191
+ isStaticGeneration: false,
3192
+ page: outerWorkStore.page,
3193
+ route: outerWorkStore.route,
3194
+ incrementalCache: outerWorkStore.incrementalCache,
3195
+ cacheLifeProfiles: outerWorkStore.cacheLifeProfiles,
3196
+ isBuildTimePrerendering: false,
3197
+ fetchCache: outerWorkStore.fetchCache,
3198
+ isOnDemandRevalidate: false,
3199
+ isDraftMode: false,
3200
+ isPrefetchRequest: false,
3201
+ buildId: outerWorkStore.buildId,
3202
+ reactLoadableManifest: outerWorkStore.reactLoadableManifest,
3203
+ assetPrefix: outerWorkStore.assetPrefix,
3204
+ nonce: outerWorkStore.nonce,
3205
+ // Never run `after()` for this validation render. by definition, `after` can't affect the rendered output.
3206
+ afterContext: new AfterContext({
3207
+ waitUntil (promise) {
3208
+ promise.catch(()=>{});
3209
+ },
3210
+ onClose () {},
3211
+ onTaskError () {}
3212
+ }),
3213
+ cacheComponentsEnabled: outerWorkStore.cacheComponentsEnabled,
3214
+ previouslyRevalidatedTags: [],
3215
+ refreshTagsByCacheKind: new Map(),
3216
+ runInCleanSnapshot: outerWorkStore.runInCleanSnapshot,
3217
+ shouldTrackFetchMetrics: false,
3218
+ reactServerErrorsByDigest: new Map()
3219
+ };
3220
+ return _workasyncstorageexternal.workAsyncStorage.run(workStore, async ()=>{
3221
+ // NOTE: match field order in renderToHTMLOrFlightImpl to avoid deopts
3222
+ const validationCtx = {
3223
+ componentMod: outerCtx.componentMod,
3224
+ url: sampleUrlWithoutQuery,
3225
+ renderOpts: outerCtx.renderOpts,
3226
+ workStore,
3227
+ parsedRequestHeaders: outerCtx.parsedRequestHeaders,
3228
+ getDynamicParamFromSegment,
3229
+ interpolatedParams: sampleParams,
3230
+ query: sampleQuery,
3231
+ isPrefetch: false,
3232
+ isPossibleServerAction: false,
3233
+ requestTimestamp: outerCtx.requestTimestamp,
3234
+ appUsingSizeAdjustment: outerCtx.appUsingSizeAdjustment,
3235
+ flightRouterState: undefined,
3236
+ requestId: outerCtx.requestId,
3237
+ htmlRequestId: outerCtx.htmlRequestId,
3238
+ pagePath: outerCtx.pagePath,
3239
+ assetPrefix: outerCtx.assetPrefix,
3240
+ isNotFoundPath: outerCtx.isNotFoundPath,
3241
+ nonce: outerCtx.nonce,
3242
+ res: outerCtx.res,
3243
+ sharedContext: outerCtx.sharedContext,
3244
+ implicitTags: outerCtx.implicitTags
3245
+ };
3246
+ const validationSamples = {
3247
+ params: sample.params,
3248
+ searchParams: sample.searchParams
3249
+ };
3250
+ const createRequestStore = ()=>{
3251
+ // Create exhaustive request data from sample
3252
+ const sampleCookies = createCookiesFromSample(sample.cookies, route);
3253
+ // We don't have to bother initializing these, pages can't access them anyway,
3254
+ // we just need them because RequestStore requires them.
3255
+ const unusedMutableCookies = new _cookies.ResponseCookies(new Headers());
3256
+ // Create headers.
3257
+ const sampleHeaders = createHeadersFromSample(sample.headers, sample.cookies, route);
3258
+ const draftMode = createDraftModeForValidation();
3259
+ return {
3260
+ type: 'request',
3261
+ phase: 'render',
3262
+ implicitTags: outerCtx.implicitTags,
3263
+ url: {
3264
+ pathname: sampleUrl.pathname,
3265
+ search: sampleUrl.search
3266
+ },
3267
+ headers: sampleHeaders,
3268
+ cookies: sampleCookies,
3269
+ mutableCookies: unusedMutableCookies,
3270
+ userspaceMutableCookies: unusedMutableCookies,
3271
+ draftMode,
3272
+ rootParams: sampleRootParams,
3273
+ validationSamples,
3274
+ validationSampleTracking: createValidationSampleTracking(),
3275
+ // These will be set when rendering
3276
+ renderResumeDataCache: null,
3277
+ prerenderResumeDataCache: null,
3278
+ stagedRendering: null,
3279
+ asyncApiPromises: undefined
3280
+ };
3281
+ };
3282
+ // Track server errors. If one of them surfaces during the client render
3283
+ // in the deserialized form (with no message/stack) we'll use this to map it
3284
+ // back to the original.
3285
+ const onServerError = (0, _createerrorhandler.createReactServerErrorHandler)(true, true, workStore.reactServerErrorsByDigest, ()=>{} // Don't report anything here. If needed, it will be reported in the client render.
3286
+ );
3287
+ const { accumulatedChunksPromise, startTime, stageController, requestStore: finalServerStore } = await renderWithRestartOnCacheMissInValidation(validationCtx, createRequestStore(), createRequestStore, (requestStore)=>_workunitasyncstorageexternal.workUnitAsyncStorage.run(requestStore, getRSCPayload, loaderTree, validationCtx, {
3288
+ is404: false
3289
+ }), (signal)=>function onError(err) {
3290
+ const digest = (0, _createerrorhandler.getDigestForWellKnownError)(err);
3291
+ if (digest) {
3292
+ return digest;
3293
+ }
3294
+ if (signal.aborted) {
3295
+ return;
3296
+ }
3297
+ return onServerError(err);
3298
+ }, prefilledDataCache);
3299
+ const accumulatedChunks = await accumulatedChunksPromise;
3300
+ const debugChunks = null // TODO(instant-validation-build): support debugChannel
3301
+ ;
3302
+ // Missing sample errors take priority over everything else,
3303
+ // because they prevent us from rendering everything we need to validate.
3304
+ const serverValidationSampleTracking = finalServerStore.validationSampleTracking;
3305
+ if (serverValidationSampleTracking.missingSampleErrors.length > 0) {
3306
+ return serverValidationSampleTracking.missingSampleErrors;
3307
+ }
3308
+ // We also error for sync IO. This runs after the prerender,
3309
+ // so if we get sync IO errors here, they're likely from the runtime stage --
3310
+ // the prerender probably discovered sync IO in the static stage
3311
+ if (stageController.currentStage === _stagedrendering.RenderStage.Abandoned && stageController.syncInterruptReason) {
3312
+ return [
3313
+ stageController.syncInterruptReason
3314
+ ];
3315
+ }
3316
+ const allowEmptyStaticShell = (validationCtx.renderOpts.allowEmptyStaticShell ?? false) || await (0, _instantconfig.isPageAllowedToBlock)(loaderTree);
3317
+ // Now we the chunks of a fully rendered page, just like in dev.
3318
+ // We can use them to validate all the navigations required by `instant` configs.
3319
+ // Note that we're not performing static shell validation here -- that happens
3320
+ // implicitly as part of the static prerender.
3321
+ // The static prerender has warmed some client modules already,
3322
+ // but we'll be reaching Runtime/Dynamic stages and thus rendering more content,
3323
+ // so we need to warm again.
3324
+ // TODO(instant-validation-build): This might warm too much, possibly hitting errors on code that didn't expect
3325
+ // to run at build time. For example, we generally don't need to render leaf segments (e.g. __PAGE__) in
3326
+ // the Dynamic stage, they're Runtime at best.
3327
+ const warmupValidationSamplesTracking = createValidationSampleTracking();
3328
+ await warmupClientModulesForStagedValidation('validation-client', accumulatedChunks.dynamicChunks, accumulatedChunks.dynamicChunks, sampleRootParams, fallbackRouteParams, allowEmptyStaticShell, validationCtx, validationSamples, warmupValidationSamplesTracking);
3329
+ if (warmupValidationSamplesTracking.missingSampleErrors.length > 0) {
3330
+ return warmupValidationSamplesTracking.missingSampleErrors;
3331
+ }
3332
+ return await validateInstantConfigs(accumulatedChunks, debugChunks, startTime, sampleRootParams, fallbackRouteParams, validationCtx, undefined, validationSamples);
3333
+ });
3334
+ }
3335
+ /**
3336
+ * Determines whether we should generate static flight data.
3337
+ */ function shouldGenerateStaticFlightData(workStore) {
3338
+ const { isStaticGeneration } = workStore;
3339
+ if (!isStaticGeneration) return false;
3340
+ return true;
3341
+ }
3342
+ async function prerenderToStream(req, res, ctx, metadata, tree, fallbackRouteParams) {
3343
+ // When prerendering formState is always null. We still include it
3344
+ // because some shared APIs expect a formState value and this is slightly
3345
+ // more explicit than making it an optional function argument
3346
+ const formState = null;
3347
+ const { assetPrefix, getDynamicParamFromSegment, implicitTags, nonce, pagePath, renderOpts, workStore } = ctx;
3348
+ const { basePath, buildManifest, ComponentMod, crossOrigin, experimental, isDebugDynamicAccesses, isBuildTimePrerendering = false, onInstrumentationRequestError, page, reactMaxHeadersLength, subresourceIntegrityManifest, cacheComponents } = renderOpts;
3349
+ const { cachedNavigations } = renderOpts.experimental;
3350
+ const allowEmptyStaticShell = (renderOpts.allowEmptyStaticShell ?? false) || await (0, _instantconfig.isPageAllowedToBlock)(tree);
3351
+ const rootParams = (0, _createcomponenttree.getRootParams)(tree, getDynamicParamFromSegment);
3352
+ const { ServerInsertedHTMLProvider, renderServerInsertedHTML } = (0, _serverinsertedhtml.createServerInsertedHTML)();
3353
+ const getServerInsertedMetadata = (0, _createserverinsertedmetadata.createServerInsertedMetadata)(nonce);
3354
+ const tracingMetadata = (0, _utils1.getTracedMetadata)((0, _tracer.getTracer)().getTracePropagationData(), experimental.clientTraceMetadata);
3355
+ const polyfills = buildManifest.polyfillFiles.filter((polyfill)=>polyfill.endsWith('.js') && !polyfill.endsWith('.module.js')).map((polyfill)=>({
3356
+ src: `${assetPrefix}/_next/${polyfill}${(0, _getassetquerystring.getAssetQueryString)(ctx, false)}`,
3357
+ integrity: subresourceIntegrityManifest == null ? void 0 : subresourceIntegrityManifest[polyfill],
3358
+ crossOrigin,
3359
+ noModule: true,
3360
+ nonce
3361
+ }));
3362
+ const [preinitScripts, bootstrapScript] = (0, _requiredscripts.getRequiredScripts)(buildManifest, // Why is assetPrefix optional on renderOpts?
3363
+ // @TODO make it default empty string on renderOpts and get rid of it from ctx
3364
+ assetPrefix, crossOrigin, subresourceIntegrityManifest, (0, _getassetquerystring.getAssetQueryString)(ctx, true), nonce, page);
3365
+ const { reactServerErrorsByDigest } = workStore;
3366
+ // We don't report errors during prerendering through our instrumentation hooks
3367
+ const reportErrors = !experimental.isRoutePPREnabled;
3368
+ function onHTMLRenderRSCError(err, silenceLog) {
3369
+ if (reportErrors) {
3370
+ return onInstrumentationRequestError == null ? void 0 : onInstrumentationRequestError(err, req, createErrorContext(ctx, 'react-server-components'), silenceLog);
3371
+ }
3372
+ }
3373
+ const serverComponentsErrorHandler = (0, _createerrorhandler.createReactServerErrorHandler)(process.env.NODE_ENV === 'development', isBuildTimePrerendering, reactServerErrorsByDigest, onHTMLRenderRSCError);
3374
+ function onHTMLRenderSSRError(err) {
3375
+ if (reportErrors) {
3376
+ // We don't need to silence logs here. onHTMLRenderSSRError won't be
3377
+ // called at all if the error was logged before in the RSC error handler.
3378
+ const silenceLog = false;
3379
+ return onInstrumentationRequestError == null ? void 0 : onInstrumentationRequestError(err, req, createErrorContext(ctx, 'server-rendering'), silenceLog);
3380
+ }
3381
+ }
3382
+ const allCapturedErrors = [];
3383
+ const htmlRendererErrorHandler = (0, _createerrorhandler.createHTMLErrorHandler)(process.env.NODE_ENV === 'development', isBuildTimePrerendering, reactServerErrorsByDigest, allCapturedErrors, onHTMLRenderSSRError);
3384
+ let reactServerPrerenderResult = null;
3385
+ const setMetadataHeader = (name)=>{
3386
+ metadata.headers ??= {};
3387
+ metadata.headers[name] = res.getHeader(name);
3388
+ };
3389
+ const setHeader = (name, value)=>{
3390
+ res.setHeader(name, value);
3391
+ setMetadataHeader(name);
3392
+ return res;
3393
+ };
3394
+ const appendHeader = (name, value)=>{
3395
+ if (Array.isArray(value)) {
3396
+ value.forEach((item)=>{
3397
+ res.appendHeader(name, item);
3398
+ });
3399
+ } else {
3400
+ res.appendHeader(name, value);
3401
+ }
3402
+ setMetadataHeader(name);
3403
+ };
3404
+ const selectStaleTime = (0, _staletime.createSelectStaleTime)(experimental);
3405
+ const { clientModules } = (0, _manifestssingleton.getClientReferenceManifest)();
3406
+ let prerenderStore = null;
3407
+ try {
3408
+ if (cacheComponents) {
3409
+ /**
3410
+ * cacheComponents with PPR
3411
+ *
3412
+ * The general approach is to render the RSC stream first allowing any cache reads to resolve.
3413
+ * Once we have settled all cache reads we restart the render and abort after a single Task.
3414
+ *
3415
+ * Unlike with the non PPR case we can't synchronously abort the render when a dynamic API is used
3416
+ * during the initial render because we need to ensure all caches can be filled as part of the initial Task
3417
+ * and a synchronous abort might prevent us from filling all caches.
3418
+ *
3419
+ * Once the render is complete we allow the SSR render to finish and use a combination of the postponed state
3420
+ * and the reactServerIsDynamic value to determine how to treat the resulting render
3421
+ */ // The prerender controller represents the lifetime of the prerender. It
3422
+ // will be aborted when a task is complete or a synchronously aborting API
3423
+ // is called. Notably, during prospective prerenders, this does not
3424
+ // actually terminate the prerender itself, which will continue until all
3425
+ // caches are filled.
3426
+ const initialServerPrerenderController = new AbortController();
3427
+ // This controller is used to abort the React prerender.
3428
+ const initialServerReactController = new AbortController();
3429
+ // This controller represents the lifetime of the React prerender. Its
3430
+ // signal can be used for any I/O operation to abort the I/O and/or to
3431
+ // reject, when prerendering aborts. This includes our own hanging
3432
+ // promises for accessing request data, and for fetch calls. It might be
3433
+ // replaced in the future by React.cacheSignal(). It's aborted after the
3434
+ // React controller, so that no pending I/O can register abort listeners
3435
+ // that are called before React's abort listener is called. This ensures
3436
+ // that pending I/O is not rejected too early when aborting the prerender.
3437
+ // Notably, during the prospective prerender, it is different from the
3438
+ // prerender controller because we don't want to end the React prerender
3439
+ // until all caches are filled.
3440
+ const initialServerRenderController = new AbortController();
3441
+ // The cacheSignal helps us track whether caches are still filling or we are ready
3442
+ // to cut the render off.
3443
+ const cacheSignal = new _cachesignal.CacheSignal();
3444
+ // Always start with a fresh prerender RDC so warmup can fill misses,
3445
+ // even when we have a prefilled render RDC to seed from.
3446
+ const prerenderResumeDataCache = (0, _resumedatacache.createPrerenderResumeDataCache)();
3447
+ let renderResumeDataCache = renderOpts.renderResumeDataCache ?? null;
3448
+ const initialServerPayloadPrerenderStore = {
3449
+ type: 'prerender',
3450
+ phase: 'render',
3451
+ rootParams,
3452
+ fallbackRouteParams,
3453
+ implicitTags,
3454
+ // While this render signal isn't going to be used to abort a React render while getting the RSC payload
3455
+ // various request data APIs bind to this controller to reject after completion.
3456
+ renderSignal: initialServerRenderController.signal,
3457
+ // When we generate the RSC payload we might abort this controller due to sync IO
3458
+ // but we don't actually care about sync IO in this phase so we use a throw away controller
3459
+ // that isn't connected to anything
3460
+ controller: new AbortController(),
3461
+ // During the initial prerender we need to track all cache reads to ensure
3462
+ // we render long enough to fill every cache it is possible to visit during
3463
+ // the final prerender.
3464
+ cacheSignal,
3465
+ dynamicTracking: null,
3466
+ allowEmptyStaticShell,
3467
+ revalidate: _constants1.INFINITE_CACHE,
3468
+ expire: _constants1.INFINITE_CACHE,
3469
+ stale: _constants1.INFINITE_CACHE,
3470
+ tags: [
3471
+ ...implicitTags.tags
3472
+ ],
3473
+ prerenderResumeDataCache,
3474
+ renderResumeDataCache,
3475
+ hmrRefreshHash: undefined,
3476
+ // We don't track vary params during initial prerender, only the final one
3477
+ varyParamsAccumulator: null
3478
+ };
3479
+ // We're not going to use the result of this render because the only time it could be used
3480
+ // is if it completes in a microtask and that's likely very rare for any non-trivial app
3481
+ const initialServerPayload = await _workunitasyncstorageexternal.workUnitAsyncStorage.run(initialServerPayloadPrerenderStore, getRSCPayload, tree, ctx, {
3482
+ is404: res.statusCode === 404
3483
+ });
3484
+ const initialServerPrerenderStore = prerenderStore = {
3485
+ type: 'prerender',
3486
+ phase: 'render',
3487
+ rootParams,
3488
+ fallbackRouteParams,
3489
+ implicitTags,
3490
+ renderSignal: initialServerRenderController.signal,
3491
+ controller: initialServerPrerenderController,
3492
+ // During the initial prerender we need to track all cache reads to ensure
3493
+ // we render long enough to fill every cache it is possible to visit during
3494
+ // the final prerender.
3495
+ cacheSignal,
3496
+ dynamicTracking: null,
3497
+ allowEmptyStaticShell,
3498
+ revalidate: _constants1.INFINITE_CACHE,
3499
+ expire: _constants1.INFINITE_CACHE,
3500
+ stale: _constants1.INFINITE_CACHE,
3501
+ tags: [
3502
+ ...implicitTags.tags
3503
+ ],
3504
+ prerenderResumeDataCache,
3505
+ renderResumeDataCache,
3506
+ hmrRefreshHash: undefined,
3507
+ // We don't track vary params during initial prerender, only the final one
3508
+ varyParamsAccumulator: null
3509
+ };
3510
+ const initialPrerenderOptions = {
3511
+ filterStackFrame,
3512
+ onError: (err)=>{
3513
+ const digest = (0, _createerrorhandler.getDigestForWellKnownError)(err);
3514
+ if (digest) {
3515
+ return digest;
3516
+ }
3517
+ if ((0, _reactlargeshellerror.isReactLargeShellError)(err)) {
3518
+ // TODO: Aggregate
3519
+ console.error(err);
3520
+ return undefined;
3521
+ }
3522
+ if (initialServerPrerenderController.signal.aborted) {
3523
+ // The render aborted before this error was handled which indicates
3524
+ // the error is caused by unfinished components within the render
3525
+ return;
3526
+ } else if (process.env.NEXT_DEBUG_BUILD || process.env.__NEXT_VERBOSE_LOGGING) {
3527
+ (0, _prospectiverenderutils.printDebugThrownValueForProspectiveRender)(err, workStore.route, _prospectiverenderutils.Phase.ProspectiveRender);
3528
+ }
3529
+ },
3530
+ // We don't want to stop rendering until the cacheSignal is complete so we pass
3531
+ // a different signal to this render call than is used by dynamic APIs to signify
3532
+ // transitioning out of the prerender environment
3533
+ signal: initialServerReactController.signal
3534
+ };
3535
+ const pendingInitialServerResult = _workunitasyncstorageexternal.workUnitAsyncStorage.run(initialServerPrerenderStore, (0, _streamops.getServerPrerender)(ComponentMod), initialServerPayload, clientModules, initialPrerenderOptions);
3536
+ // The listener to abort our own render controller must be added after
3537
+ // React has added its listener, to ensure that pending I/O is not
3538
+ // aborted/rejected too early.
3539
+ initialServerReactController.signal.addEventListener('abort', ()=>{
3540
+ initialServerRenderController.abort();
3541
+ initialServerPrerenderController.abort();
3542
+ }, {
3543
+ once: true
3544
+ });
3545
+ // Wait for all caches to be finished filling and for async imports to resolve
3546
+ (0, _trackmoduleloadingexternal.trackPendingModules)(cacheSignal);
3547
+ await cacheSignal.cacheReady();
3548
+ initialServerReactController.abort();
3549
+ // We don't need to continue the prerender process if we already
3550
+ // detected invalid dynamic usage in the initial prerender phase.
3551
+ if (workStore.invalidDynamicUsageError) {
3552
+ (0, _dynamicrendering.logDisallowedDynamicError)(workStore, workStore.invalidDynamicUsageError);
3553
+ throw new _staticgenerationbailout.StaticGenBailoutError();
3554
+ }
3555
+ let initialServerResult;
3556
+ try {
3557
+ initialServerResult = await (0, _apprenderprerenderutils.createReactServerPrerenderResult)(pendingInitialServerResult);
3558
+ } catch (err) {
3559
+ if (initialServerReactController.signal.aborted || initialServerPrerenderController.signal.aborted) {
3560
+ // These are expected errors that might error the prerender. we ignore them.
3561
+ } else if (process.env.NEXT_DEBUG_BUILD || process.env.__NEXT_VERBOSE_LOGGING) {
3562
+ // We don't normally log these errors because we are going to retry anyway but
3563
+ // it can be useful for debugging Next.js itself to get visibility here when needed
3564
+ (0, _prospectiverenderutils.printDebugThrownValueForProspectiveRender)(err, workStore.route, _prospectiverenderutils.Phase.ProspectiveRender);
3565
+ }
3566
+ }
3567
+ if (initialServerResult) {
3568
+ const initialClientPrerenderController = new AbortController();
3569
+ const initialClientReactController = new AbortController();
3570
+ const initialClientRenderController = new AbortController();
3571
+ const initialClientPrerenderStore = {
3572
+ type: 'prerender-client',
3573
+ phase: 'render',
3574
+ rootParams,
3575
+ fallbackRouteParams,
3576
+ implicitTags,
3577
+ renderSignal: initialClientRenderController.signal,
3578
+ controller: initialClientPrerenderController,
3579
+ // For HTML Generation the only cache tracked activity
3580
+ // is module loading, which has it's own cache signal
3581
+ cacheSignal: null,
3582
+ dynamicTracking: null,
3583
+ allowEmptyStaticShell,
3584
+ revalidate: _constants1.INFINITE_CACHE,
3585
+ expire: _constants1.INFINITE_CACHE,
3586
+ stale: _constants1.INFINITE_CACHE,
3587
+ tags: [
3588
+ ...implicitTags.tags
3589
+ ],
3590
+ prerenderResumeDataCache,
3591
+ renderResumeDataCache,
3592
+ hmrRefreshHash: undefined,
3593
+ // Client prerenders don't track server param access
3594
+ varyParamsAccumulator: null
3595
+ };
3596
+ const pendingInitialClientResult = _workunitasyncstorageexternal.workUnitAsyncStorage.run(initialClientPrerenderStore, _streamops.getClientPrerender, // eslint-disable-next-line @next/internal/no-ambiguous-jsx
3597
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(App, {
3598
+ reactServerStream: initialServerResult.asUnclosingStream(),
3599
+ reactDebugStream: undefined,
3600
+ debugEndTime: undefined,
3601
+ preinitScripts: preinitScripts,
3602
+ ServerInsertedHTMLProvider: ServerInsertedHTMLProvider,
3603
+ nonce: nonce,
3604
+ images: ctx.renderOpts.images
3605
+ }), {
3606
+ signal: initialClientReactController.signal,
3607
+ onError: (err)=>{
3608
+ const digest = (0, _createerrorhandler.getDigestForWellKnownError)(err);
3609
+ if (digest) {
3610
+ return digest;
3611
+ }
3612
+ if ((0, _reactlargeshellerror.isReactLargeShellError)(err)) {
3613
+ // TODO: Aggregate
3614
+ console.error(err);
3615
+ return undefined;
3616
+ }
3617
+ if (initialClientReactController.signal.aborted) {
3618
+ // These are expected errors that might error the prerender. we ignore them.
3619
+ } else if (process.env.NEXT_DEBUG_BUILD || process.env.__NEXT_VERBOSE_LOGGING) {
3620
+ // We don't normally log these errors because we are going to retry anyway but
3621
+ // it can be useful for debugging Next.js itself to get visibility here when needed
3622
+ (0, _prospectiverenderutils.printDebugThrownValueForProspectiveRender)(err, workStore.route, _prospectiverenderutils.Phase.ProspectiveRender);
3623
+ }
3624
+ },
3625
+ bootstrapScripts: [
3626
+ bootstrapScript
3627
+ ]
3628
+ });
3629
+ // The listener to abort our own render controller must be added after
3630
+ // React has added its listener, to ensure that pending I/O is not
3631
+ // aborted/rejected too early.
3632
+ initialClientReactController.signal.addEventListener('abort', ()=>{
3633
+ initialClientRenderController.abort();
3634
+ }, {
3635
+ once: true
3636
+ });
3637
+ pendingInitialClientResult.catch((err)=>{
3638
+ if (initialClientReactController.signal.aborted || (0, _dynamicrendering.isPrerenderInterruptedError)(err)) {
3639
+ // These are expected errors that might error the prerender. we ignore them.
3640
+ } else if (process.env.NEXT_DEBUG_BUILD || process.env.__NEXT_VERBOSE_LOGGING) {
3641
+ // We don't normally log these errors because we are going to retry anyway but
3642
+ // it can be useful for debugging Next.js itself to get visibility here when needed
3643
+ (0, _prospectiverenderutils.printDebugThrownValueForProspectiveRender)(err, workStore.route, _prospectiverenderutils.Phase.ProspectiveRender);
3644
+ }
3645
+ });
3646
+ // This is mostly needed for dynamic `import()`s in client components.
3647
+ // Promises passed to client were already awaited above (assuming that they came from cached functions)
3648
+ (0, _trackmoduleloadingexternal.trackPendingModules)(cacheSignal);
3649
+ await cacheSignal.cacheReady();
3650
+ initialClientReactController.abort();
3651
+ }
3652
+ if (renderOpts.renderResumeDataCache) {
3653
+ // Swap to the warmed cache so the final render uses entries produced during warmup.
3654
+ renderResumeDataCache = (0, _resumedatacache.createRenderResumeDataCache)(prerenderResumeDataCache);
3655
+ }
3656
+ const finalServerReactController = new AbortController();
3657
+ const finalServerRenderController = new AbortController();
3658
+ const varyParamsAccumulator = (0, _varyparams.createResponseVaryParamsAccumulator)();
3659
+ const finalServerPayloadPrerenderStore = {
3660
+ type: 'prerender',
3661
+ phase: 'render',
3662
+ rootParams,
3663
+ fallbackRouteParams,
3664
+ implicitTags,
3665
+ // While this render signal isn't going to be used to abort a React render while getting the RSC payload
3666
+ // various request data APIs bind to this controller to reject after completion.
3667
+ renderSignal: finalServerRenderController.signal,
3668
+ // When we generate the RSC payload we might abort this controller due to sync IO
3669
+ // but we don't actually care about sync IO in this phase so we use a throw away controller
3670
+ // that isn't connected to anything
3671
+ controller: new AbortController(),
3672
+ // All caches we could read must already be filled so no tracking is necessary
3673
+ cacheSignal: null,
3674
+ dynamicTracking: null,
3675
+ allowEmptyStaticShell,
3676
+ revalidate: _constants1.INFINITE_CACHE,
3677
+ expire: _constants1.INFINITE_CACHE,
3678
+ stale: _constants1.INFINITE_CACHE,
3679
+ tags: [
3680
+ ...implicitTags.tags
3681
+ ],
3682
+ prerenderResumeDataCache,
3683
+ renderResumeDataCache,
3684
+ hmrRefreshHash: undefined,
3685
+ varyParamsAccumulator
3686
+ };
3687
+ const finalAttemptRSCPayload = await _workunitasyncstorageexternal.workUnitAsyncStorage.run(finalServerPayloadPrerenderStore, getRSCPayload, tree, ctx, {
3688
+ is404: res.statusCode === 404
3689
+ });
3690
+ let staleTimeIterable;
3691
+ if (cachedNavigations) {
3692
+ staleTimeIterable = new _staletime.StaleTimeIterable();
3693
+ finalAttemptRSCPayload.s = staleTimeIterable;
3694
+ }
3695
+ const serverDynamicTracking = (0, _dynamicrendering.createDynamicTrackingState)(isDebugDynamicAccesses);
3696
+ let serverIsDynamic = false;
3697
+ const finalServerPrerenderStore = prerenderStore = {
3698
+ type: 'prerender',
3699
+ phase: 'render',
3700
+ rootParams,
3701
+ fallbackRouteParams,
3702
+ implicitTags,
3703
+ renderSignal: finalServerRenderController.signal,
3704
+ controller: finalServerReactController,
3705
+ // All caches we could read must already be filled so no tracking is necessary
3706
+ cacheSignal: null,
3707
+ dynamicTracking: serverDynamicTracking,
3708
+ allowEmptyStaticShell,
3709
+ revalidate: _constants1.INFINITE_CACHE,
3710
+ expire: _constants1.INFINITE_CACHE,
3711
+ stale: _constants1.INFINITE_CACHE,
3712
+ tags: [
3713
+ ...implicitTags.tags
3714
+ ],
3715
+ prerenderResumeDataCache,
3716
+ renderResumeDataCache,
3717
+ hmrRefreshHash: undefined,
3718
+ varyParamsAccumulator
3719
+ };
3720
+ if (staleTimeIterable !== undefined) {
3721
+ (0, _staletime.trackStaleTime)(finalServerPrerenderStore, staleTimeIterable, selectStaleTime);
3722
+ }
3723
+ let prerenderIsPending = true;
3724
+ const finalRSCPrerenderOptions = {
3725
+ filterStackFrame,
3726
+ onError: (err)=>{
3727
+ return serverComponentsErrorHandler(err);
3728
+ },
3729
+ signal: finalServerReactController.signal
3730
+ };
3731
+ const finalRSCAbortCallback = async ()=>{
3732
+ // Now that the prerendering is complete, we know the final stale
3733
+ // time and vary params. Close the stale time iterable and resolve
3734
+ // the vary params thenable so Flight can serialize their values
3735
+ // into the stream. The timing here is important: both were
3736
+ // included in the Flight payload, but they can only be serialized
3737
+ // at the very end, after all the components have finished.
3738
+ //
3739
+ // We resolve these directly here instead of reading from the work
3740
+ // unit store because this callback runs in a separate task (via
3741
+ // setTimeout) and may not have access to the async storage context.
3742
+ const pendingFinishes = [
3743
+ (0, _varyparams.finishAccumulatingVaryParams)(varyParamsAccumulator)
3744
+ ];
3745
+ if (staleTimeIterable !== undefined) {
3746
+ pendingFinishes.push((0, _staletime.finishStaleTimeTracking)(staleTimeIterable));
3747
+ }
3748
+ await Promise.all(pendingFinishes);
3749
+ if (finalServerReactController.signal.aborted) {
3750
+ // If the server controller is already aborted we must have called something
3751
+ // that required aborting the prerender synchronously such as with new Date()
3752
+ serverIsDynamic = true;
3753
+ return;
3754
+ }
3755
+ if (prerenderIsPending) {
3756
+ // If prerenderIsPending then we have blocked for longer than a Task and we assume
3757
+ // there is something unfinished.
3758
+ serverIsDynamic = true;
3759
+ }
3760
+ finalServerReactController.abort();
3761
+ };
3762
+ const finalRSCPrerenderFn = async ()=>{
3763
+ const pendingPrerenderResult = _workunitasyncstorageexternal.workUnitAsyncStorage.run(// The store to scope
3764
+ finalServerPrerenderStore, // The function to run
3765
+ (0, _streamops.getServerPrerender)(ComponentMod), // ... the arguments for the function to run
3766
+ finalAttemptRSCPayload, clientModules, finalRSCPrerenderOptions);
3767
+ // The listener to abort our own render controller must be added
3768
+ // after React has added its listener, to ensure that pending I/O
3769
+ // is not aborted/rejected too early.
3770
+ finalServerReactController.signal.addEventListener('abort', ()=>{
3771
+ finalServerRenderController.abort();
3772
+ }, {
3773
+ once: true
3774
+ });
3775
+ const prerenderResult = await pendingPrerenderResult;
3776
+ prerenderIsPending = false;
3777
+ return prerenderResult;
3778
+ };
3779
+ const reactServerResult = reactServerPrerenderResult = await (0, _apprenderprerenderutils.createReactServerPrerenderResult)((0, _apprenderrenderutils.runInSequentialTasks)(finalRSCPrerenderFn, finalRSCAbortCallback));
3780
+ const clientDynamicTracking = (0, _dynamicrendering.createDynamicTrackingState)(isDebugDynamicAccesses);
3781
+ const finalClientReactController = new AbortController();
3782
+ const finalClientRenderController = new AbortController();
3783
+ const finalClientPrerenderStore = {
3784
+ type: 'prerender-client',
3785
+ phase: 'render',
3786
+ rootParams,
3787
+ fallbackRouteParams,
3788
+ implicitTags,
3789
+ renderSignal: finalClientRenderController.signal,
3790
+ controller: finalClientReactController,
3791
+ // No APIs require a cacheSignal through the workUnitStore during the HTML prerender
3792
+ cacheSignal: null,
3793
+ dynamicTracking: clientDynamicTracking,
3794
+ allowEmptyStaticShell,
3795
+ revalidate: _constants1.INFINITE_CACHE,
3796
+ expire: _constants1.INFINITE_CACHE,
3797
+ stale: _constants1.INFINITE_CACHE,
3798
+ tags: [
3799
+ ...implicitTags.tags
3800
+ ],
3801
+ prerenderResumeDataCache,
3802
+ renderResumeDataCache,
3803
+ hmrRefreshHash: undefined,
3804
+ // Client prerenders don't track server param access
3805
+ varyParamsAccumulator: null
3806
+ };
3807
+ let dynamicValidation = (0, _dynamicrendering.createDynamicValidationState)();
3808
+ const finalClientOnHeaders = (0, _streamops.createOnHeadersCallback)(appendHeader);
3809
+ let { prelude: unprocessedPrelude, postponed } = await (0, _apprenderrenderutils.runInSequentialTasks)(()=>{
3810
+ const pendingFinalClientResult = _workunitasyncstorageexternal.workUnitAsyncStorage.run(finalClientPrerenderStore, _streamops.getClientPrerender, // eslint-disable-next-line @next/internal/no-ambiguous-jsx
3811
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(App, {
3812
+ reactServerStream: reactServerResult.asUnclosingStream(),
3813
+ reactDebugStream: undefined,
3814
+ debugEndTime: undefined,
3815
+ preinitScripts: preinitScripts,
3816
+ ServerInsertedHTMLProvider: ServerInsertedHTMLProvider,
3817
+ nonce: nonce,
3818
+ images: ctx.renderOpts.images
3819
+ }), {
3820
+ signal: finalClientReactController.signal,
3821
+ onError: (err, errorInfo)=>{
3822
+ if ((0, _dynamicrendering.isPrerenderInterruptedError)(err) || finalClientReactController.signal.aborted) {
3823
+ const componentStack = errorInfo.componentStack;
3824
+ if (typeof componentStack === 'string') {
3825
+ (0, _dynamicrendering.trackAllowedDynamicAccess)(workStore, componentStack, dynamicValidation, clientDynamicTracking);
3826
+ }
3827
+ return;
3828
+ }
3829
+ return htmlRendererErrorHandler(err, errorInfo);
3830
+ },
3831
+ onHeaders: finalClientOnHeaders,
3832
+ maxHeadersLength: reactMaxHeadersLength,
3833
+ bootstrapScripts: [
3834
+ bootstrapScript
3835
+ ]
3836
+ });
3837
+ // The listener to abort our own render controller must be added
3838
+ // after React has added its listener, to ensure that pending I/O is
3839
+ // not aborted/rejected too early.
3840
+ finalClientReactController.signal.addEventListener('abort', ()=>{
3841
+ finalClientRenderController.abort();
3842
+ }, {
3843
+ once: true
3844
+ });
3845
+ return pendingFinalClientResult;
3846
+ }, ()=>{
3847
+ finalClientReactController.abort();
3848
+ });
3849
+ const { prelude, preludeIsEmpty } = await (0, _streamops.processPrelude)(unprocessedPrelude);
3850
+ // If we've disabled throwing on empty static shell, then we don't need to
3851
+ // track any dynamic access that occurs above the suspense boundary because
3852
+ // we'll do so in the route shell.
3853
+ if (!allowEmptyStaticShell) {
3854
+ (0, _dynamicrendering.throwIfDisallowedDynamic)(workStore, preludeIsEmpty ? _dynamicrendering.PreludeState.Empty : _dynamicrendering.PreludeState.Full, dynamicValidation, serverDynamicTracking);
3855
+ }
3856
+ const getServerInsertedHTML = (0, _makegetserverinsertedhtml.makeGetServerInsertedHTML)({
3857
+ polyfills,
3858
+ renderServerInsertedHTML,
3859
+ serverCapturedErrors: allCapturedErrors,
3860
+ basePath,
3861
+ tracingMetadata: tracingMetadata
3862
+ });
3863
+ metadata.flightData = await (0, _streamops.streamToBuffer)(cachedNavigations ? prependIsPartialByte(reactServerResult.asStream(), serverIsDynamic) : reactServerResult.asStream());
3864
+ // collectSegmentData needs the raw flight data without the marker byte.
3865
+ const flightData = cachedNavigations ? metadata.flightData.subarray(1) : metadata.flightData;
3866
+ await collectSegmentData(flightData, finalServerPrerenderStore, ComponentMod, renderOpts, ctx.pagePath, metadata);
3867
+ if (serverIsDynamic) {
3868
+ // Dynamic case
3869
+ // We will always need to perform a "resume" render of some kind when this route is accessed
3870
+ // because the RSC data itself is dynamic. We determine if there are any HTML holes or not
3871
+ // but generally this is a "partial" prerender in that there will be a per-request compute
3872
+ // concatenated to the static shell.
3873
+ if (postponed != null) {
3874
+ // Dynamic HTML case
3875
+ metadata.postponed = await (0, _postponedstate.getDynamicHTMLPostponedState)(postponed, preludeIsEmpty ? _postponedstate.DynamicHTMLPreludeState.Empty : _postponedstate.DynamicHTMLPreludeState.Full, fallbackRouteParams, prerenderResumeDataCache, cacheComponents);
3876
+ } else {
3877
+ // Dynamic Data case
3878
+ metadata.postponed = await (0, _postponedstate.getDynamicDataPostponedState)(prerenderResumeDataCache, cacheComponents);
3879
+ }
3880
+ reactServerResult.consume();
3881
+ const continueDynamicPrerenderOpts = {
3882
+ getServerInsertedHTML,
3883
+ getServerInsertedMetadata,
3884
+ deploymentId: ctx.sharedContext.deploymentId
3885
+ };
3886
+ return {
3887
+ digestErrorsMap: reactServerErrorsByDigest,
3888
+ ssrErrors: allCapturedErrors,
3889
+ stream: await (0, _streamops.continueDynamicPrerender)(prelude, continueDynamicPrerenderOpts),
3890
+ dynamicAccess: (0, _dynamicrendering.consumeDynamicAccess)(serverDynamicTracking, clientDynamicTracking),
3891
+ // TODO: Should this include the SSR pass?
3892
+ collectedRevalidate: finalServerPrerenderStore.revalidate,
3893
+ collectedExpire: finalServerPrerenderStore.expire,
3894
+ collectedStale: selectStaleTime(finalServerPrerenderStore.stale),
3895
+ collectedTags: finalServerPrerenderStore.tags,
3896
+ renderResumeDataCache: (0, _resumedatacache.createRenderResumeDataCache)(prerenderResumeDataCache)
3897
+ };
3898
+ } else {
3899
+ // Static case
3900
+ // We will not perform resumption per request. The result can be served statically to the requestor
3901
+ // and if there was anything dynamic it will only be rendered in the browser.
3902
+ if (workStore.forceDynamic) {
3903
+ throw Object.defineProperty(new _staticgenerationbailout.StaticGenBailoutError('Invariant: a Page with `dynamic = "force-dynamic"` did not trigger the dynamic pathway. This is a bug in Next.js'), "__NEXT_ERROR_CODE", {
3904
+ value: "E598",
3905
+ enumerable: false,
3906
+ configurable: true
3907
+ });
3908
+ }
3909
+ let htmlStream = prelude;
3910
+ if (postponed != null) {
3911
+ // We postponed but nothing dynamic was used. We resume the render now and immediately abort it
3912
+ // so we can set all the postponed boundaries to client render mode before we store the HTML response
3913
+ const foreverStream = (0, _streamops.createPendingStream)();
3914
+ const resumePrelude = await (0, _streamops.resumeAndAbort)(// eslint-disable-next-line @next/internal/no-ambiguous-jsx
3915
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(App, {
3916
+ reactServerStream: foreverStream,
3917
+ reactDebugStream: undefined,
3918
+ debugEndTime: undefined,
3919
+ preinitScripts: ()=>{},
3920
+ ServerInsertedHTMLProvider: ServerInsertedHTMLProvider,
3921
+ nonce: nonce,
3922
+ images: ctx.renderOpts.images
3923
+ }), JSON.parse(JSON.stringify(postponed)), {
3924
+ signal: (0, _dynamicrendering.createRenderInBrowserAbortSignal)(),
3925
+ onError: htmlRendererErrorHandler,
3926
+ nonce
3927
+ });
3928
+ // First we write everything from the prerender, then we write everything from the aborted resume render
3929
+ htmlStream = (0, _streamops.chainStreams)(prelude, resumePrelude);
3930
+ }
3931
+ let finalStream;
3932
+ const hasFallbackRouteParams = fallbackRouteParams && fallbackRouteParams.size > 0;
3933
+ if (hasFallbackRouteParams) {
3934
+ // This is a "static fallback" prerender: although the page didn't
3935
+ // access any runtime params in a Server Component, it may have
3936
+ // accessed a runtime param in a client segment.
3937
+ //
3938
+ // TODO: If there were no client segments, we can use the fully static
3939
+ // path instead.
3940
+ //
3941
+ // Rather than use a dynamic server resume to fill in the params,
3942
+ // we can rely on the client to parse the params from the URL and use
3943
+ // that to hydrate the page.
3944
+ //
3945
+ // Send an empty InitialRSCPayload to the server component renderer
3946
+ // The data will be fetched by the client instead.
3947
+ // TODO: In the future, rather than defer the entire hydration payload
3948
+ // to be fetched by the client, we should only defer the client
3949
+ // segments, since those are the only ones whose data is not complete.
3950
+ const emptyReactServerResult = await (0, _apprenderprerenderutils.createReactServerPrerenderResultFromRender)((0, _streamops.renderToFlightStream)(ComponentMod, [], clientModules, {
3951
+ filterStackFrame,
3952
+ onError: serverComponentsErrorHandler
3953
+ }));
3954
+ finalStream = await (0, _streamops.continueStaticFallbackPrerender)(htmlStream, {
3955
+ inlinedDataStream: (0, _streamops.createInlinedDataStream)(emptyReactServerResult.consumeAsStream(), nonce, formState),
3956
+ getServerInsertedHTML,
3957
+ getServerInsertedMetadata,
3958
+ deploymentId: ctx.sharedContext.deploymentId
3959
+ });
3960
+ } else {
3961
+ // Normal static prerender case, no fallback param handling needed
3962
+ finalStream = await (0, _streamops.continueStaticPrerender)(htmlStream, {
3963
+ inlinedDataStream: (0, _streamops.createInlinedDataStream)(reactServerResult.consumeAsStream(), nonce, formState),
3964
+ getServerInsertedHTML,
3965
+ getServerInsertedMetadata,
3966
+ deploymentId: ctx.sharedContext.deploymentId
3967
+ });
3968
+ }
3969
+ return {
3970
+ digestErrorsMap: reactServerErrorsByDigest,
3971
+ ssrErrors: allCapturedErrors,
3972
+ stream: finalStream,
3973
+ dynamicAccess: (0, _dynamicrendering.consumeDynamicAccess)(serverDynamicTracking, clientDynamicTracking),
3974
+ // TODO: Should this include the SSR pass?
3975
+ collectedRevalidate: finalServerPrerenderStore.revalidate,
3976
+ collectedExpire: finalServerPrerenderStore.expire,
3977
+ collectedStale: selectStaleTime(finalServerPrerenderStore.stale),
3978
+ collectedTags: finalServerPrerenderStore.tags,
3979
+ renderResumeDataCache: (0, _resumedatacache.createRenderResumeDataCache)(prerenderResumeDataCache)
3980
+ };
3981
+ }
3982
+ } else if (experimental.isRoutePPREnabled) {
3983
+ // We're statically generating with PPR and need to do dynamic tracking
3984
+ let dynamicTracking = (0, _dynamicrendering.createDynamicTrackingState)(isDebugDynamicAccesses);
3985
+ const prerenderResumeDataCache = (0, _resumedatacache.createPrerenderResumeDataCache)();
3986
+ const reactServerPrerenderStore = prerenderStore = {
3987
+ type: 'prerender-ppr',
3988
+ phase: 'render',
3989
+ rootParams,
3990
+ fallbackRouteParams,
3991
+ implicitTags,
3992
+ dynamicTracking,
3993
+ revalidate: _constants1.INFINITE_CACHE,
3994
+ expire: _constants1.INFINITE_CACHE,
3995
+ stale: _constants1.INFINITE_CACHE,
3996
+ tags: [
3997
+ ...implicitTags.tags
3998
+ ],
3999
+ prerenderResumeDataCache
4000
+ };
4001
+ const RSCPayload = await _workunitasyncstorageexternal.workUnitAsyncStorage.run(reactServerPrerenderStore, getRSCPayload, tree, ctx, {
4002
+ is404: res.statusCode === 404
4003
+ });
4004
+ let reactServerResult;
4005
+ reactServerResult = reactServerPrerenderResult = await (0, _apprenderprerenderutils.createReactServerPrerenderResultFromRender)(_workunitasyncstorageexternal.workUnitAsyncStorage.run(reactServerPrerenderStore, _streamops.renderToFlightStream, ComponentMod, RSCPayload, clientModules, {
4006
+ filterStackFrame,
4007
+ onError: serverComponentsErrorHandler
4008
+ }));
4009
+ const ssrPrerenderStore = {
4010
+ type: 'prerender-ppr',
4011
+ phase: 'render',
4012
+ rootParams,
4013
+ fallbackRouteParams,
4014
+ implicitTags,
4015
+ dynamicTracking,
4016
+ revalidate: _constants1.INFINITE_CACHE,
4017
+ expire: _constants1.INFINITE_CACHE,
4018
+ stale: _constants1.INFINITE_CACHE,
4019
+ tags: [
4020
+ ...implicitTags.tags
4021
+ ],
4022
+ prerenderResumeDataCache
4023
+ };
4024
+ const pprOnHeaders = (0, _streamops.createOnHeadersCallback)(appendHeader);
4025
+ const { prelude: unprocessedPrelude, postponed } = await _workunitasyncstorageexternal.workUnitAsyncStorage.run(ssrPrerenderStore, _streamops.getClientPrerender, // eslint-disable-next-line @next/internal/no-ambiguous-jsx
4026
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(App, {
4027
+ reactServerStream: reactServerResult.asUnclosingStream(),
4028
+ reactDebugStream: undefined,
4029
+ debugEndTime: undefined,
4030
+ preinitScripts: preinitScripts,
4031
+ ServerInsertedHTMLProvider: ServerInsertedHTMLProvider,
4032
+ nonce: nonce,
4033
+ images: ctx.renderOpts.images
4034
+ }), {
4035
+ onError: htmlRendererErrorHandler,
4036
+ onHeaders: pprOnHeaders,
4037
+ maxHeadersLength: reactMaxHeadersLength,
4038
+ bootstrapScripts: [
4039
+ bootstrapScript
4040
+ ]
4041
+ });
4042
+ const getServerInsertedHTML = (0, _makegetserverinsertedhtml.makeGetServerInsertedHTML)({
4043
+ polyfills,
4044
+ renderServerInsertedHTML,
4045
+ serverCapturedErrors: allCapturedErrors,
4046
+ basePath,
4047
+ tracingMetadata: tracingMetadata
4048
+ });
4049
+ // After awaiting here we've waited for the entire RSC render to complete. Crucially this means
4050
+ // that when we detect whether we've used dynamic APIs below we know we'll have picked up even
4051
+ // parts of the React Server render that might not be used in the SSR render.
4052
+ const flightData = await (0, _streamops.streamToBuffer)(reactServerResult.asStream());
4053
+ if (shouldGenerateStaticFlightData(workStore)) {
4054
+ metadata.flightData = flightData;
4055
+ await collectSegmentData(flightData, ssrPrerenderStore, ComponentMod, renderOpts, ctx.pagePath, metadata);
4056
+ }
4057
+ const { prelude, preludeIsEmpty } = await (0, _streamops.processPrelude)(unprocessedPrelude);
4058
+ /**
4059
+ * When prerendering there are three outcomes to consider
4060
+ *
4061
+ * Dynamic HTML: The prerender has dynamic holes (caused by using Next.js Dynamic Rendering APIs)
4062
+ * We will need to resume this result when requests are handled and we don't include
4063
+ * any server inserted HTML or inlined flight data in the static HTML
4064
+ *
4065
+ * Dynamic Data: The prerender has no dynamic holes but dynamic APIs were used. We will not
4066
+ * resume this render when requests are handled but we will generate new inlined
4067
+ * flight data since it is dynamic and differences may end up reconciling on the client
4068
+ *
4069
+ * Static: The prerender has no dynamic holes and no dynamic APIs were used. We statically encode
4070
+ * all server inserted HTML and flight data
4071
+ */ // First we check if we have any dynamic holes in our HTML prerender
4072
+ if ((0, _dynamicrendering.accessedDynamicData)(dynamicTracking.dynamicAccesses)) {
4073
+ if (postponed != null) {
4074
+ // Dynamic HTML case.
4075
+ metadata.postponed = await (0, _postponedstate.getDynamicHTMLPostponedState)(postponed, preludeIsEmpty ? _postponedstate.DynamicHTMLPreludeState.Empty : _postponedstate.DynamicHTMLPreludeState.Full, fallbackRouteParams, prerenderResumeDataCache, cacheComponents);
4076
+ } else {
4077
+ // Dynamic Data case.
4078
+ metadata.postponed = await (0, _postponedstate.getDynamicDataPostponedState)(prerenderResumeDataCache, cacheComponents);
4079
+ }
4080
+ // Regardless of whether this is the Dynamic HTML or Dynamic Data case we need to ensure we include
4081
+ // server inserted html in the static response because the html that is part of the prerender may depend on it
4082
+ // It is possible in the set of stream transforms for Dynamic HTML vs Dynamic Data may differ but currently both states
4083
+ // require the same set so we unify the code path here
4084
+ reactServerResult.consume();
4085
+ const pprDynamicOpts = {
4086
+ getServerInsertedHTML,
4087
+ getServerInsertedMetadata,
4088
+ deploymentId: ctx.sharedContext.deploymentId
4089
+ };
4090
+ return {
4091
+ digestErrorsMap: reactServerErrorsByDigest,
4092
+ ssrErrors: allCapturedErrors,
4093
+ stream: await (0, _streamops.continueDynamicPrerender)(prelude, pprDynamicOpts),
4094
+ dynamicAccess: dynamicTracking.dynamicAccesses,
4095
+ // TODO: Should this include the SSR pass?
4096
+ collectedRevalidate: reactServerPrerenderStore.revalidate,
4097
+ collectedExpire: reactServerPrerenderStore.expire,
4098
+ collectedStale: selectStaleTime(reactServerPrerenderStore.stale),
4099
+ collectedTags: reactServerPrerenderStore.tags
4100
+ };
4101
+ } else if (fallbackRouteParams && fallbackRouteParams.size > 0) {
4102
+ // Rendering the fallback case.
4103
+ metadata.postponed = await (0, _postponedstate.getDynamicDataPostponedState)(prerenderResumeDataCache, cacheComponents);
4104
+ const pprFallbackDynamicOpts = {
4105
+ getServerInsertedHTML,
4106
+ getServerInsertedMetadata,
4107
+ deploymentId: ctx.sharedContext.deploymentId
4108
+ };
4109
+ return {
4110
+ digestErrorsMap: reactServerErrorsByDigest,
4111
+ ssrErrors: allCapturedErrors,
4112
+ stream: await (0, _streamops.continueDynamicPrerender)(prelude, pprFallbackDynamicOpts),
4113
+ dynamicAccess: dynamicTracking.dynamicAccesses,
4114
+ // TODO: Should this include the SSR pass?
4115
+ collectedRevalidate: reactServerPrerenderStore.revalidate,
4116
+ collectedExpire: reactServerPrerenderStore.expire,
4117
+ collectedStale: selectStaleTime(reactServerPrerenderStore.stale),
4118
+ collectedTags: reactServerPrerenderStore.tags
4119
+ };
4120
+ } else {
4121
+ // Static case
4122
+ // We still have not used any dynamic APIs. At this point we can produce an entirely static prerender response
4123
+ if (workStore.forceDynamic) {
4124
+ throw Object.defineProperty(new _staticgenerationbailout.StaticGenBailoutError('Invariant: a Page with `dynamic = "force-dynamic"` did not trigger the dynamic pathway. This is a bug in Next.js'), "__NEXT_ERROR_CODE", {
4125
+ value: "E598",
4126
+ enumerable: false,
4127
+ configurable: true
4128
+ });
4129
+ }
4130
+ let htmlStream = prelude;
4131
+ if (postponed != null) {
4132
+ // We postponed but nothing dynamic was used. We resume the render now and immediately abort it
4133
+ // so we can set all the postponed boundaries to client render mode before we store the HTML response
4134
+ const foreverStream = (0, _streamops.createPendingStream)();
4135
+ const resumePrelude = await (0, _streamops.resumeAndAbort)(// eslint-disable-next-line @next/internal/no-ambiguous-jsx
4136
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(App, {
4137
+ reactServerStream: foreverStream,
4138
+ reactDebugStream: undefined,
4139
+ debugEndTime: undefined,
4140
+ preinitScripts: ()=>{},
4141
+ ServerInsertedHTMLProvider: ServerInsertedHTMLProvider,
4142
+ nonce: nonce,
4143
+ images: ctx.renderOpts.images
4144
+ }), JSON.parse(JSON.stringify(postponed)), {
4145
+ signal: (0, _dynamicrendering.createRenderInBrowserAbortSignal)(),
4146
+ onError: htmlRendererErrorHandler,
4147
+ nonce
4148
+ });
4149
+ // First we write everything from the prerender, then we write everything from the aborted resume render
4150
+ htmlStream = (0, _streamops.chainStreams)(prelude, resumePrelude);
4151
+ }
4152
+ return {
4153
+ digestErrorsMap: reactServerErrorsByDigest,
4154
+ ssrErrors: allCapturedErrors,
4155
+ stream: await (0, _streamops.continueStaticPrerender)(htmlStream, {
4156
+ inlinedDataStream: (0, _streamops.createInlinedDataStream)(reactServerResult.consumeAsStream(), nonce, formState),
4157
+ getServerInsertedHTML,
4158
+ getServerInsertedMetadata,
4159
+ deploymentId: ctx.sharedContext.deploymentId
4160
+ }),
4161
+ dynamicAccess: dynamicTracking.dynamicAccesses,
4162
+ // TODO: Should this include the SSR pass?
4163
+ collectedRevalidate: reactServerPrerenderStore.revalidate,
4164
+ collectedExpire: reactServerPrerenderStore.expire,
4165
+ collectedStale: selectStaleTime(reactServerPrerenderStore.stale),
4166
+ collectedTags: reactServerPrerenderStore.tags
4167
+ };
4168
+ }
4169
+ } else {
4170
+ const prerenderLegacyStore = prerenderStore = {
4171
+ type: 'prerender-legacy',
4172
+ phase: 'render',
4173
+ rootParams,
4174
+ implicitTags,
4175
+ revalidate: _constants1.INFINITE_CACHE,
4176
+ expire: _constants1.INFINITE_CACHE,
4177
+ stale: _constants1.INFINITE_CACHE,
4178
+ tags: [
4179
+ ...implicitTags.tags
4180
+ ]
4181
+ };
4182
+ // This is a regular static generation. We don't do dynamic tracking because we rely on
4183
+ // the old-school dynamic error handling to bail out of static generation
4184
+ const RSCPayload = await _workunitasyncstorageexternal.workUnitAsyncStorage.run(prerenderLegacyStore, getRSCPayload, tree, ctx, {
4185
+ is404: res.statusCode === 404
4186
+ });
4187
+ let reactServerResult;
4188
+ reactServerResult = reactServerPrerenderResult = await (0, _apprenderprerenderutils.createReactServerPrerenderResultFromRender)(_workunitasyncstorageexternal.workUnitAsyncStorage.run(prerenderLegacyStore, _streamops.renderToFlightStream, ComponentMod, RSCPayload, clientModules, {
4189
+ filterStackFrame,
4190
+ onError: serverComponentsErrorHandler
4191
+ }));
4192
+ const { stream: htmlStream } = await _workunitasyncstorageexternal.workUnitAsyncStorage.run(prerenderLegacyStore, _streamops.renderToFizzStream, // eslint-disable-next-line @next/internal/no-ambiguous-jsx
4193
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(App, {
4194
+ reactServerStream: reactServerResult.asUnclosingStream(),
4195
+ reactDebugStream: undefined,
4196
+ debugEndTime: undefined,
4197
+ preinitScripts: preinitScripts,
4198
+ ServerInsertedHTMLProvider: ServerInsertedHTMLProvider,
4199
+ nonce: nonce,
4200
+ images: ctx.renderOpts.images
4201
+ }), {
4202
+ onError: htmlRendererErrorHandler,
4203
+ nonce,
4204
+ bootstrapScripts: [
4205
+ bootstrapScript
4206
+ ]
4207
+ });
4208
+ if (shouldGenerateStaticFlightData(workStore)) {
4209
+ const flightData = await (0, _streamops.streamToBuffer)(reactServerResult.asStream());
4210
+ metadata.flightData = flightData;
4211
+ await collectSegmentData(flightData, prerenderLegacyStore, ComponentMod, renderOpts, ctx.pagePath, metadata);
4212
+ }
4213
+ const getServerInsertedHTML = (0, _makegetserverinsertedhtml.makeGetServerInsertedHTML)({
4214
+ polyfills,
4215
+ renderServerInsertedHTML,
4216
+ serverCapturedErrors: allCapturedErrors,
4217
+ basePath,
4218
+ tracingMetadata: tracingMetadata
4219
+ });
4220
+ return {
4221
+ digestErrorsMap: reactServerErrorsByDigest,
4222
+ ssrErrors: allCapturedErrors,
4223
+ stream: await (0, _streamops.continueFizzStream)(htmlStream, {
4224
+ inlinedDataStream: (0, _streamops.createInlinedDataStream)(reactServerResult.consumeAsStream(), nonce, formState),
4225
+ isStaticGeneration: true,
4226
+ getServerInsertedHTML,
4227
+ getServerInsertedMetadata,
4228
+ deploymentId: ctx.sharedContext.deploymentId
4229
+ }),
4230
+ // TODO: Should this include the SSR pass?
4231
+ collectedRevalidate: prerenderLegacyStore.revalidate,
4232
+ collectedExpire: prerenderLegacyStore.expire,
4233
+ collectedStale: selectStaleTime(prerenderLegacyStore.stale),
4234
+ collectedTags: prerenderLegacyStore.tags
4235
+ };
4236
+ }
4237
+ } catch (err) {
4238
+ if ((0, _staticgenerationbailout.isStaticGenBailoutError)(err) || typeof err === 'object' && err !== null && 'message' in err && typeof err.message === 'string' && err.message.includes('https://nextjs.org/docs/advanced-features/static-html-export')) {
4239
+ // Ensure that "next dev" prints the red error overlay
4240
+ throw err;
4241
+ }
4242
+ // If this is a static generation error, we need to throw it so that it
4243
+ // can be handled by the caller if we're in static generation mode.
4244
+ if ((0, _hooksservercontext.isDynamicServerError)(err)) {
4245
+ throw err;
4246
+ }
4247
+ // If a bailout made it to this point, it means it wasn't wrapped inside
4248
+ // a suspense boundary.
4249
+ const shouldBailoutToCSR = (0, _bailouttocsr.isBailoutToCSRError)(err);
4250
+ if (shouldBailoutToCSR) {
4251
+ const stack = (0, _formatservererror.getStackWithoutErrorMessage)(err);
4252
+ (0, _log.error)(`${err.reason} should be wrapped in a suspense boundary at page "${pagePath}". Read more: https://nextjs.org/docs/messages/missing-suspense-with-csr-bailout\n${stack}`);
4253
+ throw err;
4254
+ }
4255
+ // If we errored when we did not have an RSC stream to read from. This is
4256
+ // not just a render error, we need to throw early.
4257
+ if (reactServerPrerenderResult === null) {
4258
+ throw err;
4259
+ }
4260
+ let errorType;
4261
+ if ((0, _httpaccessfallback.isHTTPAccessFallbackError)(err)) {
4262
+ res.statusCode = (0, _httpaccessfallback.getAccessFallbackHTTPStatus)(err);
4263
+ metadata.statusCode = res.statusCode;
4264
+ errorType = (0, _httpaccessfallback.getAccessFallbackErrorTypeByStatus)(res.statusCode);
4265
+ } else if ((0, _redirecterror.isRedirectError)(err)) {
4266
+ errorType = 'redirect';
4267
+ res.statusCode = (0, _redirect.getRedirectStatusCodeFromError)(err);
4268
+ metadata.statusCode = res.statusCode;
4269
+ const redirectUrl = (0, _addpathprefix.addPathPrefix)((0, _redirect.getURLFromRedirectError)(err), basePath);
4270
+ setHeader('location', redirectUrl);
4271
+ } else if (!shouldBailoutToCSR) {
4272
+ res.statusCode = 500;
4273
+ metadata.statusCode = res.statusCode;
4274
+ }
4275
+ const [errorPreinitScripts, errorBootstrapScript] = (0, _requiredscripts.getRequiredScripts)(buildManifest, assetPrefix, crossOrigin, subresourceIntegrityManifest, (0, _getassetquerystring.getAssetQueryString)(ctx, false), nonce, '/_not-found/page');
4276
+ const prerenderLegacyStore = prerenderStore = {
4277
+ type: 'prerender-legacy',
4278
+ phase: 'render',
4279
+ rootParams,
4280
+ implicitTags: implicitTags,
4281
+ revalidate: typeof (prerenderStore == null ? void 0 : prerenderStore.revalidate) !== 'undefined' ? prerenderStore.revalidate : _constants1.INFINITE_CACHE,
4282
+ expire: typeof (prerenderStore == null ? void 0 : prerenderStore.expire) !== 'undefined' ? prerenderStore.expire : _constants1.INFINITE_CACHE,
4283
+ stale: typeof (prerenderStore == null ? void 0 : prerenderStore.stale) !== 'undefined' ? prerenderStore.stale : _constants1.INFINITE_CACHE,
4284
+ tags: [
4285
+ ...(prerenderStore == null ? void 0 : prerenderStore.tags) || implicitTags.tags
4286
+ ]
4287
+ };
4288
+ const errorRSCPayload = await _workunitasyncstorageexternal.workUnitAsyncStorage.run(prerenderLegacyStore, getErrorRSCPayload, tree, ctx, reactServerErrorsByDigest.has(err.digest) ? undefined : err, errorType);
4289
+ const errorServerStream = _workunitasyncstorageexternal.workUnitAsyncStorage.run(prerenderLegacyStore, _streamops.renderToFlightStream, ComponentMod, errorRSCPayload, clientModules, {
4290
+ filterStackFrame,
4291
+ onError: serverComponentsErrorHandler
4292
+ });
4293
+ try {
4294
+ const { stream: errorHtmlStream } = await _workunitasyncstorageexternal.workUnitAsyncStorage.run(prerenderLegacyStore, _streamops.renderToFizzStream, // eslint-disable-next-line @next/internal/no-ambiguous-jsx
4295
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(ErrorApp, {
4296
+ reactServerStream: errorServerStream,
4297
+ ServerInsertedHTMLProvider: ServerInsertedHTMLProvider,
4298
+ preinitScripts: errorPreinitScripts,
4299
+ nonce: nonce,
4300
+ images: ctx.renderOpts.images
4301
+ }), {
4302
+ nonce,
4303
+ bootstrapScripts: [
4304
+ errorBootstrapScript
4305
+ ],
4306
+ formState
4307
+ });
4308
+ if (shouldGenerateStaticFlightData(workStore)) {
4309
+ const flightData = await (0, _streamops.streamToBuffer)(reactServerPrerenderResult.asStream());
4310
+ metadata.flightData = flightData;
4311
+ await collectSegmentData(flightData, prerenderLegacyStore, ComponentMod, renderOpts, ctx.pagePath, metadata);
4312
+ }
4313
+ // This is intentionally using the readable datastream from the main
4314
+ // render rather than the flight data from the error page render
4315
+ const flightStream = reactServerPrerenderResult.consumeAsStream();
4316
+ return {
4317
+ digestErrorsMap: reactServerErrorsByDigest,
4318
+ ssrErrors: allCapturedErrors,
4319
+ stream: await (0, _streamops.continueFizzStream)(errorHtmlStream, {
4320
+ inlinedDataStream: (0, _streamops.createInlinedDataStream)(flightStream, nonce, formState),
4321
+ isStaticGeneration: true,
4322
+ getServerInsertedHTML: (0, _makegetserverinsertedhtml.makeGetServerInsertedHTML)({
4323
+ polyfills,
4324
+ renderServerInsertedHTML,
4325
+ serverCapturedErrors: [],
4326
+ basePath,
4327
+ tracingMetadata: tracingMetadata
4328
+ }),
4329
+ getServerInsertedMetadata,
4330
+ validateRootLayout: !!process.env.__NEXT_DEV_SERVER,
4331
+ deploymentId: ctx.sharedContext.deploymentId
4332
+ }),
4333
+ dynamicAccess: null,
4334
+ collectedRevalidate: prerenderStore !== null ? prerenderStore.revalidate : _constants1.INFINITE_CACHE,
4335
+ collectedExpire: prerenderStore !== null ? prerenderStore.expire : _constants1.INFINITE_CACHE,
4336
+ collectedStale: selectStaleTime(prerenderStore !== null ? prerenderStore.stale : _constants1.INFINITE_CACHE),
4337
+ collectedTags: prerenderStore !== null ? prerenderStore.tags : null
4338
+ };
4339
+ } catch (finalErr) {
4340
+ if (process.env.__NEXT_DEV_SERVER && (0, _httpaccessfallback.isHTTPAccessFallbackError)(finalErr)) {
4341
+ const { bailOnRootNotFound } = require('../../client/components/dev-root-http-access-fallback-boundary');
4342
+ bailOnRootNotFound();
4343
+ }
4344
+ throw finalErr;
4345
+ }
4346
+ }
4347
+ }
4348
+ const getGlobalErrorStyles = async (tree, ctx)=>{
4349
+ const globalErrorModule = (0, _parseloadertree.parseLoaderTree)(tree).modules['global-error'];
4350
+ if (!globalErrorModule) {
4351
+ throw Object.defineProperty(new Error('Invariant: global-error module is required but not found in loader tree'), "__NEXT_ERROR_CODE", {
4352
+ value: "E983",
4353
+ enumerable: false,
4354
+ configurable: true
4355
+ });
4356
+ }
4357
+ const { componentMod: { createElement } } = ctx;
4358
+ // Get the GlobalError component and styles from the loader tree
4359
+ const [GlobalErrorComponent, styles] = await (0, _createcomponentstylesandscripts.createComponentStylesAndScripts)({
4360
+ ctx,
4361
+ filePath: globalErrorModule[1],
4362
+ getComponent: globalErrorModule[0],
4363
+ injectedCSS: new Set(),
4364
+ injectedJS: new Set()
4365
+ });
4366
+ let globalErrorStyles = styles;
4367
+ if (process.env.__NEXT_DEV_SERVER) {
4368
+ const dir = (process.env.NEXT_RUNTIME === 'edge' ? process.env.__NEXT_EDGE_PROJECT_DIR : ctx.renderOpts.dir) || '';
4369
+ const globalErrorModulePath = (0, _segmentexplorerpath.normalizeConventionFilePath)(dir, globalErrorModule[1]);
4370
+ if (globalErrorModulePath) {
4371
+ const SegmentViewNode = ctx.componentMod.SegmentViewNode;
4372
+ globalErrorStyles = // This will be rendered next to GlobalError component under ErrorBoundary,
4373
+ // it requires a key to avoid React warning about duplicate keys.
4374
+ createElement(SegmentViewNode, {
4375
+ key: 'ge-svn',
4376
+ type: 'global-error',
4377
+ pagePath: globalErrorModulePath
4378
+ }, globalErrorStyles);
4379
+ }
4380
+ }
4381
+ return {
4382
+ GlobalError: GlobalErrorComponent,
4383
+ styles: globalErrorStyles
4384
+ };
4385
+ };
4386
+ async function collectSegmentData(fullPageDataBuffer, prerenderStore, ComponentMod, renderOpts, pagePath, metadata) {
4387
+ // Per-segment prefetch data
4388
+ //
4389
+ // All of the segments for a page are generated simultaneously, including
4390
+ // during revalidations. This is to ensure consistency, because it's
4391
+ // possible for a mismatch between a layout and page segment can cause the
4392
+ // client to error during rendering. We want to preserve the ability of the
4393
+ // client to recover from such a mismatch by re-requesting all the segments
4394
+ // to get a consistent view of the page.
4395
+ //
4396
+ // For performance, we reuse the Flight output that was created when
4397
+ // generating the initial page HTML. The Flight stream for the whole page is
4398
+ // decomposed into a separate stream per segment.
4399
+ const { clientModules, edgeRscModuleMapping, rscModuleMapping } = (0, _manifestssingleton.getClientReferenceManifest)();
4400
+ // Manifest passed to the Flight client for reading the full-page Flight
4401
+ // stream. Based off similar code in use-cache-wrapper.ts.
4402
+ const isEdgeRuntime = process.env.NEXT_RUNTIME === 'edge';
4403
+ const serverConsumerManifest = {
4404
+ // moduleLoading must be null because we don't want to trigger preloads of ClientReferences
4405
+ // to be added to the consumer. Instead, we'll wait for any ClientReference to be emitted
4406
+ // which themselves will handle the preloading.
4407
+ moduleLoading: null,
4408
+ moduleMap: isEdgeRuntime ? edgeRscModuleMapping : rscModuleMapping,
4409
+ serverModuleMap: (0, _manifestssingleton.getServerModuleMap)()
4410
+ };
4411
+ const selectStaleTime = (0, _staletime.createSelectStaleTime)(renderOpts.experimental);
4412
+ const staleTime = selectStaleTime(prerenderStore.stale);
4413
+ // Resolve prefetch hints. At runtime (next start / ISR), the precomputed
4414
+ // hints are already loaded from the prefetch-hints.json manifest. During
4415
+ // build, compute them by measuring segment gzip sizes and write them to
4416
+ // metadata so the build pipeline can persist them to the manifest.
4417
+ let hints;
4418
+ const prefetchInlining = renderOpts.experimental.prefetchInlining;
4419
+ if (!prefetchInlining) {
4420
+ hints = null;
4421
+ } else if (renderOpts.isBuildTimePrerendering) {
4422
+ // Build time: compute fresh hints and store in metadata for the manifest.
4423
+ hints = await ComponentMod.collectPrefetchHints(fullPageDataBuffer, staleTime, clientModules, serverConsumerManifest, prefetchInlining.maxSize, prefetchInlining.maxBundleSize);
4424
+ metadata.prefetchHints = hints;
4425
+ } else {
4426
+ var _renderOpts_prefetchHints;
4427
+ // Runtime: use hints from the manifest. Never compute fresh hints
4428
+ // during ISR/revalidation.
4429
+ hints = ((_renderOpts_prefetchHints = renderOpts.prefetchHints) == null ? void 0 : _renderOpts_prefetchHints[pagePath]) ?? null;
4430
+ }
4431
+ // Pass the resolved hints so collectSegmentData can union them into
4432
+ // the TreePrefetch. During the initial build the FlightRouterState in
4433
+ // the buffer doesn't have inlining hints yet (they were just computed
4434
+ // above), so we need to merge them in here. At runtime/ISR the hints
4435
+ // are already embedded in the FlightRouterState, so this is null.
4436
+ metadata.segmentData = await ComponentMod.collectSegmentData(renderOpts.cacheComponents, fullPageDataBuffer, staleTime, clientModules, serverConsumerManifest, Boolean(renderOpts.experimental.prefetchInlining), hints);
4437
+ }
4438
+ function isBypassingCachesInDev(requestStore) {
4439
+ return !!process.env.__NEXT_DEV_SERVER && requestStore.headers.get('cache-control') === 'no-cache';
4440
+ }
4441
+ function WarnForBypassCachesInDev({ route }) {
4442
+ (0, _warnonce.warnOnce)(`Route ${route} is rendering with server caches disabled. For this navigation, Component Metadata in React DevTools will not accurately reflect what is statically prerenderable and runtime prefetchable. See more info here: https://nextjs.org/docs/messages/cache-bypass-in-dev`);
4443
+ return null;
4444
+ }
4445
+ function nodeStreamFromReadableStream(stream) {
4446
+ if (process.env.NEXT_RUNTIME === 'edge') {
4447
+ throw Object.defineProperty(new _invarianterror.InvariantError('nodeStreamFromReadableStream cannot be used in the edge runtime'), "__NEXT_ERROR_CODE", {
4448
+ value: "E944",
4449
+ enumerable: false,
4450
+ configurable: true
4451
+ });
4452
+ } else {
4453
+ const reader = stream.getReader();
4454
+ const { Readable } = require('node:stream');
4455
+ return new Readable({
4456
+ read () {
4457
+ reader.read().then(({ done, value })=>{
4458
+ if (done) {
4459
+ this.push(null);
4460
+ } else {
4461
+ this.push(value);
4462
+ }
4463
+ }).catch((err)=>this.destroy(err));
4464
+ }
4465
+ });
4466
+ }
4467
+ }
4468
+
4469
+ //# sourceMappingURL=app-render.js.map