@farm.js/core 0.1.67 → 0.1.69

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 (297) hide show
  1. package/dist/{agent-mcp.d-DWyWkTSy.d.mts → agent-mcp.d-DOfBMEzP.d.mts} +1 -1
  2. package/dist/{agent-mcp.d-BFu9xHAi.d.ts → agent-mcp.d-DnIgriX1.d.ts} +1 -1
  3. package/dist/agent-runtime.d.mts +5 -3
  4. package/dist/agent-runtime.d.ts +5 -3
  5. package/dist/{analyzer-TTIIXXMQ.mjs → analyzer-NAL5TJUP.mjs} +2 -2
  6. package/dist/analyzer-SAJSV6SP.cjs +16 -0
  7. package/dist/api/node.d.mts +7 -5
  8. package/dist/api/node.d.ts +7 -5
  9. package/dist/api/route-manager.d.mts +7 -5
  10. package/dist/api/route-manager.d.ts +7 -5
  11. package/dist/api/runtime.d.mts +6 -4
  12. package/dist/api/runtime.d.ts +6 -4
  13. package/dist/api.cjs +2 -2
  14. package/dist/api.d.mts +8 -23
  15. package/dist/api.d.ts +8 -23
  16. package/dist/api.mjs +1 -1
  17. package/dist/{app-manifest.d-CwfhGrVR.d.ts → app-manifest.d-CaAcaukR.d.ts} +1 -1
  18. package/dist/{app-manifest.d-CRmjN5j9.d.mts → app-manifest.d-_BVbI0xp.d.mts} +1 -1
  19. package/dist/app-markdown.cjs +3 -3
  20. package/dist/app-markdown.d.mts +10 -10
  21. package/dist/app-markdown.d.ts +10 -10
  22. package/dist/app-markdown.mjs +2 -2
  23. package/dist/{app.d-BX9LVTiP.d.ts → app.d-BWeDqOaF.d.ts} +6 -6
  24. package/dist/{app.d-uBBUxwyV.d.mts → app.d-CaPwtytN.d.mts} +6 -6
  25. package/dist/{base-path.d-BOUV5ozD.d.mts → base-path.d-CTDVF0Fc.d.mts} +2 -1
  26. package/dist/{base-path.d-BOUV5ozD.d.ts → base-path.d-CTDVF0Fc.d.ts} +2 -1
  27. package/dist/{chunk-HM7AGSKU.cjs → chunk-22LGTSBA.cjs} +1 -1
  28. package/dist/{chunk-4JX3M4C6.cjs → chunk-23VJEGKC.cjs} +2 -1
  29. package/dist/{chunk-V5MQMQ2P.mjs → chunk-2P7UYHZP.mjs} +1 -1
  30. package/dist/{chunk-Q37INCXG.cjs → chunk-3EEINK7G.cjs} +11 -2
  31. package/dist/{chunk-BRWIVOV4.cjs → chunk-3GNHJ3RN.cjs} +10 -8
  32. package/dist/{chunk-QJVW76JG.mjs → chunk-3Y52TWYU.mjs} +2 -2
  33. package/dist/{chunk-OB3IFUK6.cjs → chunk-437QZIC2.cjs} +4 -4
  34. package/dist/{chunk-DCXSIEFE.cjs → chunk-4JRAMCUP.cjs} +59 -38
  35. package/dist/{chunk-Q5UX55YA.cjs → chunk-4W4ZWSV2.cjs} +887 -485
  36. package/dist/{chunk-JWSI5WO4.mjs → chunk-4ZXKYCYK.mjs} +1 -1
  37. package/dist/{chunk-N35YPV4N.mjs → chunk-57QAQU4F.mjs} +9 -7
  38. package/dist/{chunk-AQDLVHNF.mjs → chunk-5FBZJJGA.mjs} +17 -0
  39. package/dist/{chunk-HP2DQGQH.mjs → chunk-5TOWKGV3.mjs} +1 -1
  40. package/dist/{chunk-556H7JCE.cjs → chunk-6GQJVY4E.cjs} +32 -27
  41. package/dist/{chunk-PL6RTBDE.cjs → chunk-ABIBASLJ.cjs} +2 -2
  42. package/dist/{chunk-H37MDCPR.mjs → chunk-ANMIR6US.mjs} +1 -1
  43. package/dist/{chunk-DQJ2CIH7.cjs → chunk-ASYOWPSR.cjs} +2 -1
  44. package/dist/{chunk-QGJ4FI2G.mjs → chunk-C6HGUTXB.mjs} +113 -29
  45. package/dist/{chunk-UHNSY2PQ.mjs → chunk-CKCKCUYO.mjs} +826 -424
  46. package/dist/{chunk-IRA2CZAY.mjs → chunk-CRVSYDHV.mjs} +2 -2
  47. package/dist/{chunk-2ZOYOYEE.mjs → chunk-D5F7RPZP.mjs} +71 -1
  48. package/dist/{chunk-N5DQMOAG.cjs → chunk-DHR2WDSL.cjs} +275 -92
  49. package/dist/{chunk-QGQP6QKO.cjs → chunk-DWLNLU55.cjs} +2 -2
  50. package/dist/{chunk-52Y3C3HG.mjs → chunk-E7VF3LQ5.mjs} +3 -2
  51. package/dist/{chunk-V5RTHYJB.cjs → chunk-F6YLXK5L.cjs} +93 -25
  52. package/dist/{chunk-HNVAZGQD.cjs → chunk-FJMC24KG.cjs} +2 -2
  53. package/dist/{chunk-KCY52OUQ.cjs → chunk-FSODPZRT.cjs} +1 -1
  54. package/dist/{chunk-PPX7UOFY.cjs → chunk-FVYBEMOD.cjs} +55 -38
  55. package/dist/{chunk-6YBYX4K4.mjs → chunk-G7NBPP7H.mjs} +1 -1
  56. package/dist/{chunk-HFHJJXSV.mjs → chunk-GFPS7MNE.mjs} +1 -1
  57. package/dist/{chunk-LPIZMU7D.cjs → chunk-GQ6QOH7T.cjs} +9 -5
  58. package/dist/{chunk-BZWTBELF.cjs → chunk-GTQOEEE7.cjs} +77 -7
  59. package/dist/{chunk-6V5YWI4W.cjs → chunk-GUMKIQJL.cjs} +2 -2
  60. package/dist/{chunk-3T5TLFCQ.mjs → chunk-HEJM46HQ.mjs} +11 -2
  61. package/dist/{chunk-F43OG25P.cjs → chunk-I7J5RLGO.cjs} +15 -1
  62. package/dist/chunk-ICFPTHXM.mjs +97 -0
  63. package/dist/{chunk-WGHY3OL5.mjs → chunk-IYLZZTP6.mjs} +233 -50
  64. package/dist/{chunk-WUTFJOV7.cjs → chunk-JFPKARWM.cjs} +16 -8
  65. package/dist/{chunk-TEG6HJVF.mjs → chunk-JL2YW5KX.mjs} +1 -0
  66. package/dist/{chunk-23PVOIPT.cjs → chunk-L5OZN6YW.cjs} +3 -3
  67. package/dist/{chunk-QITSS4TD.cjs → chunk-L6NWQ3DR.cjs} +537 -356
  68. package/dist/{chunk-3T7ALZJF.cjs → chunk-LR4KP3I7.cjs} +2 -2
  69. package/dist/{chunk-CO3YMZFD.mjs → chunk-MAGFDK4Q.mjs} +1 -1
  70. package/dist/{chunk-VFXE6NWR.mjs → chunk-MGKWYPE3.mjs} +2 -1
  71. package/dist/{chunk-5TA63JD3.mjs → chunk-MGZVDX4R.mjs} +1 -1
  72. package/dist/{chunk-6SQZXRJ2.cjs → chunk-MMDKYJ5V.cjs} +7 -7
  73. package/dist/{chunk-5Y2P454O.cjs → chunk-MTBDJ326.cjs} +6 -5
  74. package/dist/{chunk-XUES6OET.mjs → chunk-MV7NWU23.mjs} +1 -1
  75. package/dist/{chunk-4IHMHFQB.cjs → chunk-NG2EZ6QS.cjs} +28 -1
  76. package/dist/{chunk-F7JKVHU2.mjs → chunk-NVOMQLI2.mjs} +15 -1
  77. package/dist/{chunk-5IQ2ERQA.cjs → chunk-O47W53D3.cjs} +1 -1
  78. package/dist/{chunk-22IWL4YD.cjs → chunk-OCNV4CI2.cjs} +21 -2
  79. package/dist/{chunk-3TXKFRSO.mjs → chunk-OEL5EPOJ.mjs} +1 -1
  80. package/dist/{chunk-E6CD45JK.mjs → chunk-PDQ6EGPK.mjs} +26 -5
  81. package/dist/{chunk-VK54PDQ6.mjs → chunk-PEYDQMSA.mjs} +86 -18
  82. package/dist/{chunk-KSZK34HU.mjs → chunk-PJQ5W356.mjs} +16 -8
  83. package/dist/{chunk-72KCTHLV.cjs → chunk-PRL7FXG4.cjs} +113 -29
  84. package/dist/{chunk-JSOCDYER.cjs → chunk-Q4HH5Q6A.cjs} +15 -1
  85. package/dist/{chunk-YVTS3S3F.cjs → chunk-QOGIZKSO.cjs} +3 -3
  86. package/dist/{chunk-DB2HSHQA.cjs → chunk-QSUYB3RH.cjs} +14 -14
  87. package/dist/{chunk-724MGMIL.mjs → chunk-R2ZHU37O.mjs} +19 -0
  88. package/dist/{chunk-YQYTQJZN.mjs → chunk-RLH5AH2M.mjs} +1 -1
  89. package/dist/{chunk-WDD5CTZW.mjs → chunk-SZORL7EW.mjs} +24 -19
  90. package/dist/{chunk-6R53ZWX2.cjs → chunk-TKYOJ5G2.cjs} +3 -3
  91. package/dist/{chunk-XNZWMXCF.mjs → chunk-UHU4QALN.mjs} +330 -149
  92. package/dist/{chunk-J7JHVCWA.cjs → chunk-UKZ6AWKZ.cjs} +2 -1
  93. package/dist/{chunk-GTV2ABO7.mjs → chunk-ULMXZYOA.mjs} +162 -33
  94. package/dist/{chunk-4DRINDGN.cjs → chunk-VO65MYJD.cjs} +254 -125
  95. package/dist/chunk-W44X6IC2.cjs +97 -0
  96. package/dist/{chunk-UHE5JUKB.mjs → chunk-XCAQTCGK.mjs} +1 -1
  97. package/dist/{chunk-DGOFR7D5.cjs → chunk-Y6KHPJDB.cjs} +2 -2
  98. package/dist/{chunk-DXZ57EPE.mjs → chunk-YOHHL2UE.mjs} +14 -0
  99. package/dist/{chunk-KWFNUODD.mjs → chunk-YVPX5PI5.mjs} +1 -0
  100. package/dist/{chunk-HRPTMX5C.mjs → chunk-ZR2QB45W.mjs} +7 -3
  101. package/dist/{chunk-JVM3DKZE.mjs → chunk-ZYCEEE3V.mjs} +1 -1
  102. package/dist/{chunk-5FE5YT2N.mjs → chunk-ZZGQD3LL.mjs} +28 -1
  103. package/dist/{client-component.d-DWRKyAp5.d.ts → client-component.d-CfJxuXZl.d.ts} +2 -2
  104. package/dist/{client-component.d-CDRvRmbU.d.mts → client-component.d-CnEeVvGG.d.mts} +2 -2
  105. package/dist/{client-plugins.d-CrKZiNSN.d.ts → client-plugins.d-D7dHV1Nf.d.ts} +37 -236
  106. package/dist/{client-plugins.d-BNILjfX3.d.mts → client-plugins.d-Do5ULA0x.d.mts} +37 -236
  107. package/dist/client-plugins.d.mts +5 -3
  108. package/dist/client-plugins.d.ts +5 -3
  109. package/dist/client.cjs +6 -6
  110. package/dist/client.d.mts +10 -8
  111. package/dist/client.d.ts +10 -8
  112. package/dist/client.mjs +5 -5
  113. package/dist/config.d.mts +5 -3
  114. package/dist/config.d.ts +5 -3
  115. package/dist/deployment.cjs +4 -2
  116. package/dist/deployment.d.mts +15 -1
  117. package/dist/deployment.d.ts +15 -1
  118. package/dist/deployment.mjs +3 -1
  119. package/dist/desktop.d.mts +6 -4
  120. package/dist/desktop.d.ts +6 -4
  121. package/dist/{devtools-RZVT4JVN.cjs → devtools-7HNDS4SY.cjs} +7 -7
  122. package/dist/{devtools-UFQYT3VA.mjs → devtools-BP4EBTKQ.mjs} +6 -6
  123. package/dist/docs.cjs +11 -9
  124. package/dist/docs.d.mts +19 -5
  125. package/dist/docs.d.ts +19 -5
  126. package/dist/docs.mjs +11 -9
  127. package/dist/environment/vite.cjs +5 -5
  128. package/dist/environment/vite.d.mts +1 -1
  129. package/dist/environment/vite.d.ts +1 -1
  130. package/dist/environment/vite.mjs +4 -4
  131. package/dist/{generate-route-types.d-BL2pq6xC.d.ts → generate-route-types.d-B76M5R11.d.ts} +1 -1
  132. package/dist/{generate-route-types.d-BoVDU8qX.d.mts → generate-route-types.d-CaGMIaNI.d.mts} +1 -1
  133. package/dist/image/server.cjs +2 -2
  134. package/dist/image/server.mjs +1 -1
  135. package/dist/image/sharp.cjs +9 -9
  136. package/dist/image/sharp.mjs +1 -1
  137. package/dist/index.cjs +45 -39
  138. package/dist/{index.d-Bdm6866n.d.mts → index.d-B1MpEJAo.d.mts} +1 -1
  139. package/dist/{index.d-Dey5T14f.d.ts → index.d-CVFk37uX.d.ts} +1 -1
  140. package/dist/index.d.mts +26 -23
  141. package/dist/index.d.ts +26 -23
  142. package/dist/index.mjs +48 -42
  143. package/dist/instrumentation.cjs +3 -3
  144. package/dist/instrumentation.mjs +2 -2
  145. package/dist/integrations/orm.d.mts +5 -3
  146. package/dist/integrations/orm.d.ts +5 -3
  147. package/dist/integrations.d.mts +5 -3
  148. package/dist/integrations.d.ts +5 -3
  149. package/dist/internal/app-markdown-runtime.cjs +2 -2
  150. package/dist/internal/app-markdown-runtime.d.mts +12 -5
  151. package/dist/internal/app-markdown-runtime.d.ts +12 -5
  152. package/dist/internal/app-markdown-runtime.mjs +1 -1
  153. package/dist/internal/build-runtime.cjs +34 -32
  154. package/dist/internal/build-runtime.d.mts +7 -5
  155. package/dist/internal/build-runtime.d.ts +7 -5
  156. package/dist/internal/build-runtime.mjs +33 -31
  157. package/dist/internal/cli-runtime.cjs +10 -10
  158. package/dist/internal/cli-runtime.mjs +9 -9
  159. package/dist/internal/client-error-overlay.cjs +4 -4
  160. package/dist/internal/client-error-overlay.mjs +1 -1
  161. package/dist/internal/client-runtime.cjs +31 -36
  162. package/dist/internal/client-runtime.d.mts +9 -7
  163. package/dist/internal/client-runtime.d.ts +9 -7
  164. package/dist/internal/client-runtime.mjs +22 -27
  165. package/dist/internal/compression-runtime.d.mts +5 -3
  166. package/dist/internal/compression-runtime.d.ts +5 -3
  167. package/dist/internal/config-runtime.cjs +8 -8
  168. package/dist/internal/config-runtime.d.mts +9 -7
  169. package/dist/internal/config-runtime.d.ts +9 -7
  170. package/dist/internal/config-runtime.mjs +7 -7
  171. package/dist/internal/form-actions.cjs +7 -2
  172. package/dist/internal/form-actions.d.mts +10 -3
  173. package/dist/internal/form-actions.d.ts +10 -3
  174. package/dist/internal/form-actions.mjs +8 -3
  175. package/dist/internal/infra-analytics-runtime.cjs +6 -6
  176. package/dist/internal/infra-analytics-runtime.mjs +4 -4
  177. package/dist/internal/islands-boot.cjs +6 -1
  178. package/dist/internal/islands-boot.mjs +6 -1
  179. package/dist/internal/native-server-fns.cjs +4 -4
  180. package/dist/internal/native-server-fns.mjs +3 -3
  181. package/dist/internal/product-telemetry-runtime.cjs +3 -3
  182. package/dist/internal/product-telemetry-runtime.mjs +2 -2
  183. package/dist/internal/production-node-env.cjs +4 -2
  184. package/dist/internal/production-node-env.d.mts +22 -1
  185. package/dist/internal/production-node-env.d.ts +22 -1
  186. package/dist/internal/production-node-env.mjs +3 -1
  187. package/dist/internal/production-runtime.cjs +17 -9
  188. package/dist/internal/production-runtime.d.mts +31 -19
  189. package/dist/internal/production-runtime.d.ts +31 -19
  190. package/dist/internal/production-runtime.mjs +18 -10
  191. package/dist/internal/server-tree.cjs +2 -2
  192. package/dist/internal/server-tree.d.mts +0 -5
  193. package/dist/internal/server-tree.d.ts +0 -5
  194. package/dist/internal/server-tree.mjs +1 -1
  195. package/dist/internal/vercel-edge-middleware.cjs +87 -0
  196. package/dist/internal/vercel-edge-middleware.d.mts +39 -0
  197. package/dist/internal/vercel-edge-middleware.d.ts +39 -0
  198. package/dist/internal/vercel-edge-middleware.mjs +87 -0
  199. package/dist/layers-7P4RLKVX.cjs +20 -0
  200. package/dist/{layers-T55SA47E.mjs → layers-XQ7VFMWO.mjs} +4 -2
  201. package/dist/{layers.d-CcS42OGR.d.mts → layers.d-CH0bC4QL.d.mts} +2 -1
  202. package/dist/{layers.d-CcS42OGR.d.ts → layers.d-CH0bC4QL.d.ts} +2 -1
  203. package/dist/markdown.d.mts +5 -3
  204. package/dist/markdown.d.ts +5 -3
  205. package/dist/middleware.cjs +4 -4
  206. package/dist/middleware.d.mts +8 -5
  207. package/dist/middleware.d.ts +8 -5
  208. package/dist/middleware.mjs +6 -6
  209. package/dist/mobile.d.mts +4 -4
  210. package/dist/mobile.d.ts +4 -4
  211. package/dist/{mount.d-BP0nLYQO.d.mts → mount.d-CBqr-LfI.d.mts} +1 -1
  212. package/dist/{mount.d-CkiPky_F.d.ts → mount.d-CGzN61Kq.d.ts} +1 -1
  213. package/dist/{navigation-delegate.d-CdBP-hkZ.d.mts → navigation-delegate.d-BwCOhpj7.d.mts} +1 -1
  214. package/dist/{navigation-delegate.d-DchcGzAQ.d.ts → navigation-delegate.d-CLH2dXjy.d.ts} +1 -1
  215. package/dist/navigation.cjs +5 -5
  216. package/dist/navigation.d.mts +8 -6
  217. package/dist/navigation.d.ts +8 -6
  218. package/dist/navigation.mjs +4 -4
  219. package/dist/{nitro-55YOZWRA.mjs → nitro-NSTXT7LB.mjs} +2 -2
  220. package/dist/{nitro-EEX2J3KB.cjs → nitro-Y3LGITW3.cjs} +4 -4
  221. package/dist/node-module-bundle-LIZ2KMVW.cjs +13 -0
  222. package/dist/node-module-bundle-VR6NV6AI.mjs +13 -0
  223. package/dist/{plugin-WIU4GDD4.cjs → plugin-F2O4BFTK.cjs} +2 -2
  224. package/dist/{plugin-SAS22JL7.mjs → plugin-VEBRN7A3.mjs} +1 -1
  225. package/dist/plugin.cjs +23 -23
  226. package/dist/plugin.d.mts +7 -5
  227. package/dist/plugin.d.ts +7 -5
  228. package/dist/plugin.mjs +22 -22
  229. package/dist/{production-runtime.d-Dou_Htas.d.ts → production-runtime.d-BMyyLGBB.d.ts} +3 -57
  230. package/dist/{production-runtime.d-VwsBzIee.d.mts → production-runtime.d-DMZY3OgV.d.mts} +3 -57
  231. package/dist/query/client.cjs +6 -6
  232. package/dist/query/client.mjs +2 -2
  233. package/dist/{render-plan.d-LKymStDJ.d.mts → render-plan.d-CzGDjcT0.d.mts} +1 -1
  234. package/dist/{render-plan.d-D8UakAIk.d.ts → render-plan.d-W6LmjD6y.d.ts} +1 -1
  235. package/dist/renderer/react/server.cjs +2 -2
  236. package/dist/renderer/react/server.mjs +1 -1
  237. package/dist/renderer-client.cjs +5 -5
  238. package/dist/renderer-client.d.mts +8 -6
  239. package/dist/renderer-client.d.ts +8 -6
  240. package/dist/renderer-client.mjs +2 -2
  241. package/dist/renderer.d.mts +5 -0
  242. package/dist/renderer.d.ts +5 -0
  243. package/dist/{request.d-B928QjWy.d.ts → request.d-CTVRZiQv.d.ts} +1 -1
  244. package/dist/{request.d-KG-4d2eG.d.mts → request.d-CgNVderU.d.mts} +1 -1
  245. package/dist/request.d.mts +6 -4
  246. package/dist/request.d.ts +6 -4
  247. package/dist/{route-rendering.d-NIHQeb4m.d.mts → route-rendering.d-D0bmZVJA.d.mts} +1 -1
  248. package/dist/{route-rendering.d-DoEe_w9t.d.ts → route-rendering.d-FDSNtCMg.d.ts} +1 -1
  249. package/dist/{router.d-DYnRHQwz.d.ts → router.d-DZ3ldniI.d.ts} +1 -1
  250. package/dist/{router.d-B8PkJSGp.d.mts → router.d-GRKm_uAV.d.mts} +1 -1
  251. package/dist/{routes.d-uUBZyWoK.d.ts → routes.d-9GFFNioh.d.ts} +1 -1
  252. package/dist/{routes.d-DgZ_jgGG.d.mts → routes.d-CrEy0lJS.d.mts} +1 -1
  253. package/dist/routes.d.mts +5 -3
  254. package/dist/routes.d.ts +5 -3
  255. package/dist/{rsc-pipeline-7K5H2RPH.cjs → rsc-pipeline-J4KKBSCH.cjs} +10 -10
  256. package/dist/{rsc-pipeline-4OJ5ZQNZ.mjs → rsc-pipeline-PJZOVYSY.mjs} +9 -9
  257. package/dist/{runtime-X52Q7JFR.cjs → runtime-OLEO5NXF.cjs} +20 -20
  258. package/dist/{runtime-U7O3HZOZ.mjs → runtime-QDBSE4H6.mjs} +12 -12
  259. package/dist/{runtime.d-BxQIzwfy.d.mts → runtime.d-DqXihlxm.d.mts} +1 -1
  260. package/dist/{runtime.d-DP7mEkEF.d.ts → runtime.d-pqFQBU2N.d.ts} +1 -1
  261. package/dist/server-http.d-rAe7lAQc.d.mts +70 -0
  262. package/dist/server-http.d-rAe7lAQc.d.ts +70 -0
  263. package/dist/server-plugins.d.mts +6 -4
  264. package/dist/server-plugins.d.ts +6 -4
  265. package/dist/server.cjs +52 -50
  266. package/dist/server.d-C5FFrZAo.d.ts +57 -0
  267. package/dist/server.d-DgC8xew5.d.mts +57 -0
  268. package/dist/server.d.mts +13 -11
  269. package/dist/server.d.ts +13 -11
  270. package/dist/server.mjs +31 -29
  271. package/dist/{spa-router.d-DsFDHTsv.d.ts → spa-router.d-DhOhaQ-7.d.ts} +2 -2
  272. package/dist/{spa-router.d-BgHPVMhz.d.mts → spa-router.d-Dhvy60p4.d.mts} +2 -2
  273. package/dist/testing.d.mts +5 -3
  274. package/dist/testing.d.ts +5 -3
  275. package/dist/types.d-xCIhyjOq.d.mts +233 -0
  276. package/dist/types.d-xCIhyjOq.d.ts +233 -0
  277. package/dist/{utils.d-zxAVcf_V.d.ts → utils.d-BVCMRRau.d.ts} +1 -1
  278. package/dist/{utils.d-BKyKDBR1.d.mts → utils.d-Q8EHCpkF.d.mts} +1 -1
  279. package/dist/version.cjs +2 -2
  280. package/dist/version.mjs +1 -1
  281. package/dist/vite.cjs +23 -23
  282. package/dist/vite.d.mts +10 -8
  283. package/dist/vite.d.ts +10 -8
  284. package/dist/vite.mjs +22 -22
  285. package/dist/workflows.cjs +2 -2
  286. package/dist/workflows.d.mts +121 -1
  287. package/dist/workflows.d.ts +121 -1
  288. package/dist/workflows.mjs +1 -1
  289. package/package.json +7 -2
  290. package/dist/analyzer-KVZGVY5Q.cjs +0 -16
  291. package/dist/chunk-CLFEQGET.cjs +0 -60
  292. package/dist/chunk-MK5E44WP.mjs +0 -60
  293. package/dist/layers-DMRXRL7F.cjs +0 -18
  294. package/dist/node-module-bundle-7JHPPF6B.mjs +0 -11
  295. package/dist/node-module-bundle-YJGYBOGK.cjs +0 -11
  296. package/dist/workflows.d-CRMzQZ3k.d.mts +0 -188
  297. package/dist/workflows.d-CRMzQZ3k.d.ts +0 -188
@@ -5,7 +5,7 @@
5
5
  var _chunk65Y5SIBHcjs = require('./chunk-65Y5SIBH.cjs');
6
6
 
7
7
 
8
- var _chunk5IQ2ERQAcjs = require('./chunk-5IQ2ERQA.cjs');
8
+ var _chunkO47W53D3cjs = require('./chunk-O47W53D3.cjs');
9
9
 
10
10
 
11
11
 
@@ -27,24 +27,28 @@ var _chunk5IQ2ERQAcjs = require('./chunk-5IQ2ERQA.cjs');
27
27
 
28
28
 
29
29
 
30
- var _chunkN5DQMOAGcjs = require('./chunk-N5DQMOAG.cjs');
31
30
 
32
31
 
33
32
 
34
- var _chunkJSOCDYERcjs = require('./chunk-JSOCDYER.cjs');
33
+ var _chunkDHR2WDSLcjs = require('./chunk-DHR2WDSL.cjs');
35
34
 
36
35
 
37
- var _chunkWUTFJOV7cjs = require('./chunk-WUTFJOV7.cjs');
38
36
 
39
37
 
38
+ var _chunkQ4HH5Q6Acjs = require('./chunk-Q4HH5Q6A.cjs');
40
39
 
41
- var _chunkYVTS3S3Fcjs = require('./chunk-YVTS3S3F.cjs');
40
+
41
+ var _chunkJFPKARWMcjs = require('./chunk-JFPKARWM.cjs');
42
42
 
43
43
 
44
44
  var _chunkAQLHD6HZcjs = require('./chunk-AQLHD6HZ.cjs');
45
45
 
46
46
 
47
47
 
48
+ var _chunkQOGIZKSOcjs = require('./chunk-QOGIZKSO.cjs');
49
+
50
+
51
+
48
52
 
49
53
  var _chunkPIUTGRDIcjs = require('./chunk-PIUTGRDI.cjs');
50
54
 
@@ -75,13 +79,13 @@ var _chunk3HLQTOVUcjs = require('./chunk-3HLQTOVU.cjs');
75
79
 
76
80
 
77
81
 
78
- var _chunkLPIZMU7Dcjs = require('./chunk-LPIZMU7D.cjs');
82
+ var _chunkGQ6QOH7Tcjs = require('./chunk-GQ6QOH7T.cjs');
79
83
 
80
84
 
81
85
  var _chunkX3MHKLCOcjs = require('./chunk-X3MHKLCO.cjs');
82
86
 
83
87
 
84
- var _chunk6V5YWI4Wcjs = require('./chunk-6V5YWI4W.cjs');
88
+ var _chunkGUMKIQJLcjs = require('./chunk-GUMKIQJL.cjs');
85
89
 
86
90
 
87
91
  var _chunk7EPYN7GWcjs = require('./chunk-7EPYN7GW.cjs');
@@ -113,7 +117,10 @@ var _chunk7EPYN7GWcjs = require('./chunk-7EPYN7GW.cjs');
113
117
 
114
118
 
115
119
 
116
- var _chunk4DRINDGNcjs = require('./chunk-4DRINDGN.cjs');
120
+
121
+
122
+
123
+ var _chunkVO65MYJDcjs = require('./chunk-VO65MYJD.cjs');
117
124
 
118
125
 
119
126
 
@@ -127,7 +134,7 @@ var _chunkERMUL73Lcjs = require('./chunk-ERMUL73L.cjs');
127
134
  var _chunkUVV3I5QAcjs = require('./chunk-UVV3I5QA.cjs');
128
135
 
129
136
 
130
- var _chunk22IWL4YDcjs = require('./chunk-22IWL4YD.cjs');
137
+ var _chunkOCNV4CI2cjs = require('./chunk-OCNV4CI2.cjs');
131
138
 
132
139
 
133
140
 
@@ -148,7 +155,7 @@ var _chunkRE5E2G5Scjs = require('./chunk-RE5E2G5S.cjs');
148
155
 
149
156
 
150
157
 
151
- var _chunk5Y2P454Ocjs = require('./chunk-5Y2P454O.cjs');
158
+ var _chunkMTBDJ326cjs = require('./chunk-MTBDJ326.cjs');
152
159
 
153
160
 
154
161
 
@@ -170,7 +177,7 @@ var _chunk3EIPOTZVcjs = require('./chunk-3EIPOTZV.cjs');
170
177
 
171
178
 
172
179
 
173
- var _chunkQ37INCXGcjs = require('./chunk-Q37INCXG.cjs');
180
+ var _chunk3EEINK7Gcjs = require('./chunk-3EEINK7G.cjs');
174
181
 
175
182
 
176
183
 
@@ -271,7 +278,7 @@ var _chunkSUCDVKUBcjs = require('./chunk-SUCDVKUB.cjs');
271
278
  var _chunkEVIWKPJVcjs = require('./chunk-EVIWKPJV.cjs');
272
279
 
273
280
 
274
- var _chunkHM7AGSKUcjs = require('./chunk-HM7AGSKU.cjs');
281
+ var _chunk22LGTSBAcjs = require('./chunk-22LGTSBA.cjs');
275
282
 
276
283
 
277
284
  var _chunkPMJSG4JScjs = require('./chunk-PMJSG4JS.cjs');
@@ -289,7 +296,7 @@ var _chunk6IOZPJ3Icjs = require('./chunk-6IOZPJ3I.cjs');
289
296
 
290
297
 
291
298
 
292
- var _chunkF43OG25Pcjs = require('./chunk-F43OG25P.cjs');
299
+ var _chunkI7J5RLGOcjs = require('./chunk-I7J5RLGO.cjs');
293
300
 
294
301
 
295
302
  var _chunkDBYNZIIQcjs = require('./chunk-DBYNZIIQ.cjs');
@@ -335,6 +342,7 @@ function transformFarmFormActionModule(options) {
335
342
 
336
343
  // src/vite.ts
337
344
  var _vite = require('vite');
345
+ var _esmodulelexer = require('es-module-lexer');
338
346
  var _async_hooks = require('async_hooks');
339
347
  var _module = require('module');
340
348
 
@@ -453,8 +461,8 @@ async function realpathOr(directory) {
453
461
  }
454
462
  }
455
463
  function isInside(directory, file) {
456
- const relative3 = path2.relative(directory, file);
457
- return relative3 !== "" && relative3 !== ".." && !relative3.startsWith(`..${path2.sep}`) && !path2.isAbsolute(relative3);
464
+ const relative4 = path2.relative(directory, file);
465
+ return relative4 !== "" && relative4 !== ".." && !relative4.startsWith(`..${path2.sep}`) && !path2.isAbsolute(relative4);
458
466
  }
459
467
 
460
468
  // src/server/dev-cors.ts
@@ -1060,7 +1068,7 @@ function loadFarmWorkflowsDevRuntime() {
1060
1068
  return import("./workflows.cjs");
1061
1069
  }
1062
1070
  function loadFarmDevtoolsSnapshotRuntime() {
1063
- return import("./devtools-RZVT4JVN.cjs");
1071
+ return import("./devtools-7HNDS4SY.cjs");
1064
1072
  }
1065
1073
  function loadFarmDevtoolsUIRuntime() {
1066
1074
  return import("./devtools-ui-SYRUXUA7.cjs");
@@ -1090,6 +1098,18 @@ var farmReactServerFiles = /* @__PURE__ */ new Set();
1090
1098
  var FARM_SERVER_ONLY_PACKAGE_ID = "\0farm:server-only";
1091
1099
  var FARM_PLATFORM_ENTRY = "@farm.js/core/platform";
1092
1100
  var FARM_PLATFORM_CLIENT_ID = "\0farm:platform-client";
1101
+ var FARM_SERVER_ONLY_ENTRIES_RESOLVE_FILTER = [
1102
+ _chunkDHR2WDSLcjs.exactIdPattern.call(void 0, [FARM_PLATFORM_ENTRY, SERVER_ONLY_PACKAGE, ...FARM_SERVER_ONLY_ENTRIES]),
1103
+ new RegExp(`^${_chunkVO65MYJDcjs.FARM_RESOLVE_FROM_PREFIX}`),
1104
+ // What isBuiltin() accepts: `node:` ids and the builtin names, subpaths such as fs/promises
1105
+ // included.
1106
+ /^node:/,
1107
+ _chunkDHR2WDSLcjs.exactIdPattern.call(void 0, _module.builtinModules)
1108
+ ];
1109
+ var FARM_SERVER_ONLY_ENTRIES_LOAD_FILTER = [
1110
+ _chunkDHR2WDSLcjs.exactIdPattern.call(void 0, [FARM_SERVER_ONLY_PACKAGE_ID, FARM_PLATFORM_CLIENT_ID]),
1111
+ new RegExp(`^${_chunkVO65MYJDcjs.FARM_BROWSER_BUILTIN_PREFIX}`)
1112
+ ];
1093
1113
  function createFarmPlatformClientModule(platform) {
1094
1114
  return `export function platform() { return ${JSON.stringify(platform)}; }
1095
1115
  export function appDataDir() {
@@ -1116,11 +1136,11 @@ function farmServerOnlyEntriesPlugin(options = {}) {
1116
1136
  name: "farm:server-only-entries",
1117
1137
  enforce: "pre",
1118
1138
  config(config) {
1119
- const bundledPackages = _chunk4DRINDGNcjs.collectFarmServerBundledPackageInfo.call(void 0,
1139
+ const bundledPackages = _chunkVO65MYJDcjs.collectFarmServerBundledPackageInfo.call(void 0,
1120
1140
  path6.resolve(_nullishCoalesce(config.root, () => ( process.cwd())))
1121
1141
  );
1122
1142
  return {
1123
- optimizeDeps: { rolldownOptions: { plugins: [_chunk4DRINDGNcjs.farmBrowserBuiltinsOptimizerPlugin.call(void 0, )] } },
1143
+ optimizeDeps: { rolldownOptions: { plugins: [_chunkVO65MYJDcjs.farmBrowserBuiltinsOptimizerPlugin.call(void 0, )] } },
1124
1144
  ssr: {
1125
1145
  noExternal: [
1126
1146
  // Resolve `server-only` here rather than in Node, which would load its throwing build.
@@ -1135,40 +1155,59 @@ function farmServerOnlyEntriesPlugin(options = {}) {
1135
1155
  configResolved(config) {
1136
1156
  root = config.root;
1137
1157
  },
1138
- resolveId(id, importer, options2) {
1139
- if (id === FARM_PLATFORM_ENTRY) return _optionalChain([options2, 'optionalAccess', _64 => _64.ssr]) ? null : FARM_PLATFORM_CLIENT_ID;
1140
- if (id === SERVER_ONLY_PACKAGE) {
1141
- if (_optionalChain([options2, 'optionalAccess', _65 => _65.ssr]) || _optionalChain([options2, 'optionalAccess', _66 => _66.scan])) {
1142
- return FARM_SERVER_ONLY_PACKAGE_ID;
1158
+ resolveId: {
1159
+ filter: { id: FARM_SERVER_ONLY_ENTRIES_RESOLVE_FILTER },
1160
+ handler(id, importer, options2) {
1161
+ if (id === FARM_PLATFORM_ENTRY) return _optionalChain([options2, 'optionalAccess', _64 => _64.ssr]) ? null : FARM_PLATFORM_CLIENT_ID;
1162
+ if (id === SERVER_ONLY_PACKAGE) {
1163
+ if (_optionalChain([options2, 'optionalAccess', _65 => _65.ssr]) || _optionalChain([options2, 'optionalAccess', _66 => _66.scan])) {
1164
+ return FARM_SERVER_ONLY_PACKAGE_ID;
1165
+ }
1166
+ this.error(
1167
+ `${_nullishCoalesce(importer, () => ( "A module"))} imports "server-only", so it must not reach the browser, but client code imports it. Move what the client needs out of that module, or call it from a server component, server function or API route.`
1168
+ );
1143
1169
  }
1144
- this.error(
1145
- `${_nullishCoalesce(importer, () => ( "A module"))} imports "server-only", so it must not reach the browser, but client code imports it. Move what the client needs out of that module, or call it from a server component, server function or API route.`
1146
- );
1147
- }
1148
- if (!_optionalChain([options2, 'optionalAccess', _67 => _67.ssr]) && _module.isBuiltin.call(void 0, id)) {
1149
- return _chunk4DRINDGNcjs.resolveFarmBrowserBuiltin.call(void 0, this, id, importer, options2);
1150
- }
1151
- if (!FARM_SERVER_ONLY_ENTRIES.has(id)) return null;
1152
- const importedBy = importer ? ` (imported by ${importer})` : "";
1153
- if (!_optionalChain([options2, 'optionalAccess', _68 => _68.ssr])) {
1154
- this.error(
1155
- `${id} is server-only and cannot be imported into client code${importedBy}. Use it from an API route or another server module.`
1156
- );
1157
- }
1158
- vercelOgInstalled || (vercelOgInstalled = _chunkKORZ6PREcjs.isOptionalPeerInstalled.call(void 0, root, "@vercel/og"));
1159
- if (!vercelOgInstalled) {
1160
- this.error(
1161
- `${id} needs @vercel/og, which is not installed${importedBy}. ${_chunkKORZ6PREcjs.VERCEL_OG_INSTALL_HINT}`
1162
- );
1170
+ if (!_optionalChain([options2, 'optionalAccess', _67 => _67.ssr]) && _module.isBuiltin.call(void 0, id)) {
1171
+ return _chunkVO65MYJDcjs.resolveFarmBrowserBuiltin.call(void 0, this, id, importer, options2);
1172
+ }
1173
+ const resolveFrom = importer ? _chunkVO65MYJDcjs.parseFarmResolveFrom.call(void 0, id, importer.split("?", 1)[0]) : null;
1174
+ if (resolveFrom) {
1175
+ const directory = path6.dirname(resolveFrom.importer);
1176
+ return this.resolve(resolveFrom.specifier, resolveFrom.importer, {
1177
+ ...options2,
1178
+ skipSelf: true
1179
+ }).then((resolved) => {
1180
+ if (resolved) return resolved;
1181
+ return this.error(
1182
+ `Could not resolve "${resolveFrom.specifier}" from ${directory}, the package whose server component renders it. Install it in that package, or run your package manager's install again.`
1183
+ );
1184
+ });
1185
+ }
1186
+ if (!FARM_SERVER_ONLY_ENTRIES.has(id)) return null;
1187
+ const importedBy = importer ? ` (imported by ${importer})` : "";
1188
+ if (!_optionalChain([options2, 'optionalAccess', _68 => _68.ssr])) {
1189
+ this.error(
1190
+ `${id} is server-only and cannot be imported into client code${importedBy}. Use it from an API route or another server module.`
1191
+ );
1192
+ }
1193
+ vercelOgInstalled || (vercelOgInstalled = _chunkKORZ6PREcjs.isOptionalPeerInstalled.call(void 0, root, "@vercel/og"));
1194
+ if (!vercelOgInstalled) {
1195
+ this.error(
1196
+ `${id} needs @vercel/og, which is not installed${importedBy}. ${_chunkKORZ6PREcjs.VERCEL_OG_INSTALL_HINT}`
1197
+ );
1198
+ }
1199
+ return null;
1163
1200
  }
1164
- return null;
1165
1201
  },
1166
- load(id) {
1167
- if (id === FARM_SERVER_ONLY_PACKAGE_ID) return "export {};";
1168
- if (id === FARM_PLATFORM_CLIENT_ID) {
1169
- return createFarmPlatformClientModule(_nullishCoalesce(options.platform, () => ( _chunkAQLHD6HZcjs.resolveFarmPlatform.call(void 0, ))));
1202
+ load: {
1203
+ filter: { id: FARM_SERVER_ONLY_ENTRIES_LOAD_FILTER },
1204
+ handler(id) {
1205
+ if (id === FARM_SERVER_ONLY_PACKAGE_ID) return "export {};";
1206
+ if (id === FARM_PLATFORM_CLIENT_ID) {
1207
+ return createFarmPlatformClientModule(_nullishCoalesce(options.platform, () => ( _chunkAQLHD6HZcjs.resolveFarmPlatform.call(void 0, ))));
1208
+ }
1209
+ return _nullishCoalesce(_chunkVO65MYJDcjs.loadFarmBrowserBuiltin.call(void 0, id), () => ( null));
1170
1210
  }
1171
- return _nullishCoalesce(_chunk4DRINDGNcjs.loadFarmBrowserBuiltin.call(void 0, id), () => ( null));
1172
1211
  }
1173
1212
  };
1174
1213
  }
@@ -1263,11 +1302,18 @@ function createFarmDevMiddlewareErrorResponse() {
1263
1302
  headers: { "Content-Type": "application/json", "Cache-Control": "private, no-store" }
1264
1303
  });
1265
1304
  }
1266
- function sendFarmDevRuntimeHookError(res, json) {
1305
+ function setFarmDevRuntimeHookErrorHead(res, json) {
1306
+ for (const name of res.getHeaderNames()) res.removeHeader(name);
1267
1307
  res.statusCode = 500;
1268
1308
  res.setHeader("Content-Type", json ? "application/json" : "text/plain; charset=utf-8");
1309
+ }
1310
+ function sendFarmDevRuntimeHookError(res, json) {
1311
+ setFarmDevRuntimeHookErrorHead(res, json);
1269
1312
  res.end(json ? _chunkXGTFLG73cjs.FARM_INTERNAL_SERVER_ERROR_BODY : "Internal Server Error");
1270
1313
  }
1314
+ function opensFarmDevRuntimeSession(pm) {
1315
+ return pm.hasRuntimeRequestHooks() || _chunkQ4HH5Q6Acjs.hasFarmServerRuntimePlugins.call(void 0, pm.getPlugins());
1316
+ }
1271
1317
  var FARM_CONFIG_ROUTE_PLUGIN_NAMES = /* @__PURE__ */ new Set([
1272
1318
  _chunkAKIQ54FKcjs.FARM_CONFIG_HEADERS_PLUGIN_NAME,
1273
1319
  _chunkAKIQ54FKcjs.FARM_CONFIG_REDIRECTS_PLUGIN_NAME,
@@ -1379,7 +1425,7 @@ function interceptFarmDevPageResponse(options) {
1379
1425
  res.end = originalEnd;
1380
1426
  res.writeHead = originalWriteHead;
1381
1427
  if (originalFlushHeaders) res.flushHeaders = originalFlushHeaders;
1382
- delete res[_chunkWUTFJOV7cjs.FARM_NODE_RESPONSE_END_PENDING];
1428
+ delete res[_chunkJFPKARWMcjs.FARM_NODE_RESPONSE_END_PENDING];
1383
1429
  };
1384
1430
  let runtimeHookFailed = false;
1385
1431
  const endRuntimeRequest = (response) => pm.endRuntimeRequest(runtimeSession, response).catch((error) => {
@@ -1391,12 +1437,7 @@ function interceptFarmDevPageResponse(options) {
1391
1437
  console.error("Error in afterResponse hook:", error);
1392
1438
  };
1393
1439
  const writeRuntimeHookFailure = () => {
1394
- res.statusCode = 500;
1395
- res.removeHeader("Content-Length");
1396
- res.setHeader(
1397
- "Content-Type",
1398
- options.jsonError ? "application/json" : "text/plain; charset=utf-8"
1399
- );
1440
+ setFarmDevRuntimeHookErrorHead(res, Boolean(options.jsonError));
1400
1441
  originalWriteHead(500);
1401
1442
  originalWrite(options.jsonError ? _chunkXGTFLG73cjs.FARM_INTERNAL_SERVER_ERROR_BODY : "Internal Server Error");
1402
1443
  };
@@ -1508,7 +1549,7 @@ function interceptFarmDevPageResponse(options) {
1508
1549
  });
1509
1550
  res.end = ((...args) => {
1510
1551
  interceptedEnd = true;
1511
- res[_chunkWUTFJOV7cjs.FARM_NODE_RESPONSE_END_PENDING] = true;
1552
+ res[_chunkJFPKARWMcjs.FARM_NODE_RESPONSE_END_PENDING] = true;
1512
1553
  if (afterResponseCalled) return res;
1513
1554
  afterResponseCalled = true;
1514
1555
  options.logResponse(method, urlPath, res.statusCode || 200, Date.now() - startTime, "PAGE");
@@ -1591,7 +1632,7 @@ function interceptFarmDevPageResponse(options) {
1591
1632
  res.end = originalEnd;
1592
1633
  res.writeHead = originalWriteHead;
1593
1634
  if (originalFlushHeaders) res.flushHeaders = originalFlushHeaders;
1594
- delete res[_chunkWUTFJOV7cjs.FARM_NODE_RESPONSE_END_PENDING];
1635
+ delete res[_chunkJFPKARWMcjs.FARM_NODE_RESPONSE_END_PENDING];
1595
1636
  originalEnd(...originalEndArgs);
1596
1637
  }).catch((error) => {
1597
1638
  reportFailure(error);
@@ -1608,14 +1649,14 @@ function interceptFarmDevPageResponse(options) {
1608
1649
  res.end = originalEnd;
1609
1650
  res.writeHead = originalWriteHead;
1610
1651
  if (originalFlushHeaders) res.flushHeaders = originalFlushHeaders;
1611
- delete res[_chunkWUTFJOV7cjs.FARM_NODE_RESPONSE_END_PENDING];
1652
+ delete res[_chunkJFPKARWMcjs.FARM_NODE_RESPONSE_END_PENDING];
1612
1653
  originalEnd(body, callback);
1613
1654
  } else {
1614
1655
  res.write = originalWrite;
1615
1656
  res.end = originalEnd;
1616
1657
  res.writeHead = originalWriteHead;
1617
1658
  if (originalFlushHeaders) res.flushHeaders = originalFlushHeaders;
1618
- delete res[_chunkWUTFJOV7cjs.FARM_NODE_RESPONSE_END_PENDING];
1659
+ delete res[_chunkJFPKARWMcjs.FARM_NODE_RESPONSE_END_PENDING];
1619
1660
  originalEnd(...originalEndArgs);
1620
1661
  }
1621
1662
  });
@@ -1681,25 +1722,57 @@ function fileContainsProgrammaticPageRoute(file) {
1681
1722
  return false;
1682
1723
  }
1683
1724
  }
1684
- function rewriteEarlySsrRelativeImports(options) {
1685
- const cleanId = options.id.split("?", 1)[0];
1686
- if (!path6.isAbsolute(cleanId) || cleanId.replace(/\\/g, "/").includes("/node_modules/")) {
1725
+ var moduleLexerReady = false;
1726
+ function lexModuleSpecifiers(code) {
1727
+ if (!moduleLexerReady) {
1728
+ _esmodulelexer.initSync.call(void 0, );
1729
+ moduleLexerReady = true;
1730
+ }
1731
+ let imports;
1732
+ try {
1733
+ [imports] = _esmodulelexer.parse.call(void 0, code);
1734
+ } catch (e16) {
1687
1735
  return null;
1688
1736
  }
1689
- const replacements = [];
1737
+ const specifiers = [];
1738
+ for (const entry of imports) {
1739
+ if (entry.n === void 0 || entry.d === -2) continue;
1740
+ const start = entry.d === -1 ? entry.s - 1 : entry.s;
1741
+ const end = entry.d === -1 ? entry.e + 1 : entry.e;
1742
+ const quote = code[start];
1743
+ if (quote !== '"' && quote !== "'" || code[end - 1] !== quote) continue;
1744
+ specifiers.push({ value: entry.n, start, end });
1745
+ }
1746
+ return specifiers;
1747
+ }
1748
+ function parseModuleSpecifiers(options) {
1690
1749
  let ast;
1691
1750
  try {
1692
1751
  ast = options.parse(options.code);
1693
- } catch (e16) {
1752
+ } catch (e17) {
1694
1753
  return null;
1695
1754
  }
1755
+ const specifiers = [];
1696
1756
  walkModuleAst(ast, (node) => {
1697
1757
  if (node.type !== "ImportDeclaration" && node.type !== "ExportNamedDeclaration" && node.type !== "ExportAllDeclaration" && node.type !== "ImportExpression") {
1698
1758
  return;
1699
1759
  }
1700
1760
  const source = node.source;
1701
1761
  if (!isFarmModuleAstNode(source) || typeof source.value !== "string") return;
1702
- if (!source.value.startsWith(".")) return;
1762
+ specifiers.push({ value: source.value, start: source.start, end: source.end });
1763
+ });
1764
+ return specifiers;
1765
+ }
1766
+ function rewriteEarlySsrRelativeImports(options) {
1767
+ const cleanId = options.id.split("?", 1)[0];
1768
+ if (!path6.isAbsolute(cleanId) || cleanId.replace(/\\/g, "/").includes("/node_modules/")) {
1769
+ return null;
1770
+ }
1771
+ const sources = _nullishCoalesce(lexModuleSpecifiers(options.code), () => ( parseModuleSpecifiers(options)));
1772
+ if (!sources) return null;
1773
+ const replacements = [];
1774
+ for (const source of sources) {
1775
+ if (!source.value.startsWith(".")) continue;
1703
1776
  const suffixIndex = source.value.search(/[?#]/);
1704
1777
  const sourcePath = suffixIndex === -1 ? source.value : source.value.slice(0, suffixIndex);
1705
1778
  const suffix = suffixIndex === -1 ? "" : source.value.slice(suffixIndex);
@@ -1711,13 +1784,15 @@ function rewriteEarlySsrRelativeImports(options) {
1711
1784
  end: source.end,
1712
1785
  code: JSON.stringify(`${specifier}${suffix}`)
1713
1786
  });
1714
- });
1787
+ }
1715
1788
  if (replacements.length === 0) return null;
1716
- let output = options.code;
1717
- for (const replacement of replacements.sort((left, right) => right.start - left.start)) {
1718
- output = output.slice(0, replacement.start) + replacement.code + output.slice(replacement.end);
1789
+ let output = "";
1790
+ let copied = 0;
1791
+ for (const replacement of replacements.sort((left, right) => left.start - right.start)) {
1792
+ output += options.code.slice(copied, replacement.start) + replacement.code;
1793
+ copied = replacement.end;
1719
1794
  }
1720
- return output;
1795
+ return output + options.code.slice(copied);
1721
1796
  }
1722
1797
  function transformIsolatedClientBoundaryModule(options) {
1723
1798
  if (options.slots) {
@@ -1729,18 +1804,18 @@ function transformIsolatedClientBoundaryModule(options) {
1729
1804
  from: "@farm.js/core/internal/islx-react"
1730
1805
  });
1731
1806
  if (rewritten) options = { ...options, code: rewritten.code };
1732
- } catch (e17) {
1807
+ } catch (e18) {
1733
1808
  return null;
1734
1809
  }
1735
1810
  }
1736
1811
  let ast;
1737
1812
  try {
1738
1813
  ast = options.parse(options.code);
1739
- } catch (e18) {
1814
+ } catch (e19) {
1740
1815
  return null;
1741
1816
  }
1742
1817
  const body = Array.isArray(ast.body) ? ast.body : [];
1743
- const everyExportIsComponent = options.code.includes(_chunk4DRINDGNcjs.FARM_CLIENT_REFERENCE_PRAGMA) || options.moduleReference.includes(_chunk4DRINDGNcjs.FARM_CLIENT_REFERENCE_DIRECTORY);
1818
+ const everyExportIsComponent = options.code.includes(_chunkVO65MYJDcjs.FARM_CLIENT_REFERENCE_PRAGMA) || options.moduleReference.includes(_chunkVO65MYJDcjs.FARM_CLIENT_REFERENCE_DIRECTORY);
1744
1819
  const replacements = [];
1745
1820
  const wrapperStatements = [];
1746
1821
  const originalEntries = [];
@@ -1837,8 +1912,13 @@ function transformIsolatedClientBoundaryModule(options) {
1837
1912
  for (const replacement of replacements.sort((left, right) => right.start - left.start)) {
1838
1913
  output = output.slice(0, replacement.start) + replacement.code + output.slice(replacement.end);
1839
1914
  }
1840
- const runtimeImport = options.slots ? options.browser ? "const __farm_islx_island__ = (component) => component;" : `import { createIsland as __farm_islx_island__ } from "@farm.js/core/internal/islx-react";` : `import * as __farm_isolated_react__ from "react";
1841
- import { createFarmIsolatedClientBoundary as __farm_create_isolated_boundary__ } from "@farm.js/core/internal/isolated-boundary";`;
1915
+ const isComponent = `(value) => typeof value === "function" || (typeof value === "object" && value !== null && [Symbol.for("react.memo"), Symbol.for("react.forward_ref"), Symbol.for("react.lazy")].includes(value.$$typeof))`;
1916
+ const runtimeImport = options.slots ? options.browser ? "const __farm_islx_island__ = (component) => component;" : `import { createIsland as __farm_islx_create_island__ } from "@farm.js/core/internal/islx-react";
1917
+ const __farm_is_component__ = ${isComponent};
1918
+ const __farm_islx_island__ = (component, ...rest) => __farm_is_component__(component) ? __farm_islx_create_island__(component, ...rest) : component;` : `import * as __farm_isolated_react__ from "react";
1919
+ import { createFarmIsolatedClientBoundary as __farm_create_boundary__ } from "@farm.js/core/internal/isolated-boundary";
1920
+ const __farm_is_component__ = ${isComponent};
1921
+ const __farm_create_isolated_boundary__ = (react, component, ...rest) => __farm_is_component__(component) ? __farm_create_boundary__(react, component, ...rest) : component;`;
1842
1922
  return `${runtimeImport}
1843
1923
  ${output}
1844
1924
  ${wrapperStatements.join("\n")}
@@ -1869,8 +1949,8 @@ function isFarmModuleAstNode(value) {
1869
1949
  function isFarmConfigFile(file, root) {
1870
1950
  const normalized = file.replace(/\\/g, "/");
1871
1951
  const rootSlug = root.replace(/\\/g, "/").replace(/\/+$/, "");
1872
- const relative3 = normalized.startsWith(`${rootSlug}/`) ? normalized.slice(rootSlug.length + 1) : normalized;
1873
- return FARM_CONFIG_FILENAMES.has(relative3);
1952
+ const relative4 = normalized.startsWith(`${rootSlug}/`) ? normalized.slice(rootSlug.length + 1) : normalized;
1953
+ return FARM_CONFIG_FILENAMES.has(relative4);
1874
1954
  }
1875
1955
  var warnedClientBoundaryIds = /* @__PURE__ */ new Set();
1876
1956
  function warnClientBoundaryOnce(context, id, code, config) {
@@ -1878,7 +1958,7 @@ function warnClientBoundaryOnce(context, id, code, config) {
1878
1958
  let program;
1879
1959
  try {
1880
1960
  program = context.parse(code);
1881
- } catch (e19) {
1961
+ } catch (e20) {
1882
1962
  return;
1883
1963
  }
1884
1964
  const publicKeys = new Set(Object.keys(_nullishCoalesce(_optionalChain([config, 'access', _93 => _93.env, 'optionalAccess', _94 => _94.public]), () => ( {}))));
@@ -1902,7 +1982,7 @@ function hasViteAlias(alias, find) {
1902
1982
  function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
1903
1983
  const rendererDisabled = _chunk67MZTLTFcjs.isFarmRendererDisabled.call(void 0, options.renderer);
1904
1984
  const imageImports = farmImageImportsPlugin();
1905
- const fontImports = _chunkN5DQMOAGcjs.farmFontImportsPlugin.call(void 0, {
1985
+ const fontImports = _chunkDHR2WDSLcjs.farmFontImportsPlugin.call(void 0, {
1906
1986
  root: options.root,
1907
1987
  basePath: options.basePath,
1908
1988
  publicDir: options.publicDir
@@ -1946,8 +2026,8 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
1946
2026
  api: { getProgrammaticClientRoutes },
1947
2027
  config(userConfig, configEnv) {
1948
2028
  isBuild = configEnv.command === "build";
1949
- const layerAliases = _chunk5Y2P454Ocjs.getFarmLayerAliases.call(void 0, options.layers);
1950
- const sourceAlias = hasViteAlias(_optionalChain([userConfig, 'access', _105 => _105.resolve, 'optionalAccess', _106 => _106.alias]), "@") ? {} : _chunkN5DQMOAGcjs.createFarmSourceAlias.call(void 0, options.root || process.cwd(), options.srcDir);
2029
+ const layerAliases = _chunkMTBDJ326cjs.getFarmLayerAliases.call(void 0, options.layers);
2030
+ const sourceAlias = hasViteAlias(_optionalChain([userConfig, 'access', _105 => _105.resolve, 'optionalAccess', _106 => _106.alias]), "@") ? {} : _chunkDHR2WDSLcjs.createFarmSourceAlias.call(void 0, options.root || process.cwd(), options.srcDir);
1951
2031
  const layerRoots = (_nullishCoalesce(options.layers, () => ( []))).map((layer) => layer.root);
1952
2032
  farmOwnsDevCors = !isBuild && _optionalChain([userConfig, 'access', _107 => _107.server, 'optionalAccess', _108 => _108.cors]) === void 0;
1953
2033
  return {
@@ -1987,7 +2067,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
1987
2067
  async configureServer(viteServer) {
1988
2068
  viteServer.middlewares.use(
1989
2069
  createFarmDevPreviewGuard(viteServer, {
1990
- getSourceRoots: () => _chunk5Y2P454Ocjs.getFarmSourceRoots.call(void 0, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _114 => _114.getConfig, 'call', _115 => _115()]), () => ( options)))
2070
+ getSourceRoots: () => _chunkMTBDJ326cjs.getFarmSourceRoots.call(void 0, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _114 => _114.getConfig, 'call', _115 => _115()]), () => ( options)))
1991
2071
  })
1992
2072
  );
1993
2073
  if (typeof fontImports.configureServer === "function") {
@@ -2008,10 +2088,10 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2008
2088
  if (!pm) return;
2009
2089
  try {
2010
2090
  await pm.runHookParallel("onError", { phase, error, meta });
2011
- } catch (e20) {
2091
+ } catch (e21) {
2012
2092
  }
2013
2093
  };
2014
- farmApp = new (0, _chunkN5DQMOAGcjs.FarmApp)(
2094
+ farmApp = new (0, _chunkDHR2WDSLcjs.FarmApp)(
2015
2095
  {
2016
2096
  ...options,
2017
2097
  root: resolveDevelopmentRoot(options.root, server.config.root)
@@ -2019,7 +2099,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2019
2099
  server
2020
2100
  );
2021
2101
  farmApp.getRouteManager().usePackageClientBoundaryCacheFile(
2022
- _chunk4DRINDGNcjs.resolvePackageClientBoundaryCacheFile.call(void 0,
2102
+ _chunkVO65MYJDcjs.resolvePackageClientBoundaryCacheFile.call(void 0,
2023
2103
  farmApp.getConfig().root,
2024
2104
  options.distDir || ".farm"
2025
2105
  )
@@ -2029,7 +2109,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2029
2109
  let farmAppPackages;
2030
2110
  if (_optionalChain([farmConfig, 'access', _128 => _128.agent, 'optionalAccess', _129 => _129.noindexPreviews])) {
2031
2111
  farmMiddlewares.use((_req, res, next) => {
2032
- if (_chunk6V5YWI4Wcjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env)) {
2112
+ if (_chunkGUMKIQJLcjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env)) {
2033
2113
  res.setHeader("X-Robots-Tag", _chunk4E57QHPWcjs.FARM_PREVIEW_ROBOTS_TAG);
2034
2114
  }
2035
2115
  next();
@@ -2037,7 +2117,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2037
2117
  }
2038
2118
  const apiServerBasePath = _chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0, farmConfig.api);
2039
2119
  const devBuiltInRoutePaths = new Set(
2040
- _chunkLPIZMU7Dcjs.listFarmBuiltInRoutePaths.call(void 0, {
2120
+ _chunkGQ6QOH7Tcjs.listFarmBuiltInRoutePaths.call(void 0, {
2041
2121
  agent: {
2042
2122
  apiCatalog: true,
2043
2123
  mcp: true,
@@ -2053,7 +2133,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2053
2133
  let imageHandler = null;
2054
2134
  if (farmConfig.images.provider !== "none") {
2055
2135
  const { createNodeImageFetcher, createNodeImageUrlValidator, createSharpImageTransformer } = await import("./image/sharp.cjs");
2056
- imageHandler = _chunk5IQ2ERQAcjs.createFarmImageHandler.call(void 0, farmConfig.images, {
2136
+ imageHandler = _chunkO47W53D3cjs.createFarmImageHandler.call(void 0, farmConfig.images, {
2057
2137
  transform: createSharpImageTransformer(),
2058
2138
  fetchRemote: createNodeImageFetcher(farmConfig.images),
2059
2139
  validateRemoteUrl: createNodeImageUrlValidator(farmConfig.images),
@@ -2067,7 +2147,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2067
2147
  }
2068
2148
  });
2069
2149
  }
2070
- const sourceRoots = _chunk5Y2P454Ocjs.getFarmSourceRoots.call(void 0, farmConfig);
2150
+ const sourceRoots = _chunkMTBDJ326cjs.getFarmSourceRoots.call(void 0, farmConfig);
2071
2151
  server.watcher.add(sourceRoots.map((source) => path6.join(source.root, source.srcDir)));
2072
2152
  if (farmConfig.i18n.enabled) {
2073
2153
  server.watcher.add(
@@ -2087,7 +2167,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2087
2167
  );
2088
2168
  const generateTypeArtifacts = async (reason, selection = ALL_TYPE_ARTIFACTS, log = false) => {
2089
2169
  try {
2090
- const result = await _chunkYVTS3S3Fcjs.generateFarmTypeArtifacts.call(void 0, {
2170
+ const result = await _chunkQOGIZKSOcjs.generateFarmTypeArtifacts.call(void 0, {
2091
2171
  root: farmConfig.root,
2092
2172
  srcDir: farmConfig.srcDir,
2093
2173
  layers: farmConfig.layers,
@@ -2227,7 +2307,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2227
2307
  }
2228
2308
  });
2229
2309
  });
2230
- const appDirs = _chunk5Y2P454Ocjs.getFarmAppDirectories.call(void 0, farmConfig);
2310
+ const appDirs = _chunkMTBDJ326cjs.getFarmAppDirectories.call(void 0, farmConfig);
2231
2311
  const routeManager = farmApp.getRouteManager();
2232
2312
  const discoveredRoutes = [];
2233
2313
  for (const [pattern, entry] of routeManager.getRoutes()) {
@@ -2380,7 +2460,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2380
2460
  clientEntry: "/@farm/client.js",
2381
2461
  resolveLayoutFonts: resolveDocsLayoutFonts,
2382
2462
  fontStylesheetHref: "/@farm/fonts.css",
2383
- globalStylesheetHref: _chunkN5DQMOAGcjs.resolveDevGlobalStylesheetHref.call(void 0,
2463
+ globalStylesheetHref: _chunkDHR2WDSLcjs.resolveDevGlobalStylesheetHref.call(void 0,
2384
2464
  farmConfig.root,
2385
2465
  farmConfig.srcDir
2386
2466
  ),
@@ -2411,22 +2491,50 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2411
2491
  fontAssets: _chunkERMUL73Lcjs.toFarmDocsPublicFontAssets.call(void 0, farmDocsFontAssetList),
2412
2492
  resolveLayoutFonts: resolveDocsLayoutFonts,
2413
2493
  fontStylesheetHref: "/@farm/fonts.css",
2414
- globalStylesheetHref: _chunkN5DQMOAGcjs.resolveDevGlobalStylesheetHref.call(void 0,
2494
+ globalStylesheetHref: _chunkDHR2WDSLcjs.resolveDevGlobalStylesheetHref.call(void 0,
2415
2495
  farmConfig.root,
2416
2496
  farmConfig.srcDir
2417
2497
  ),
2418
2498
  isPathGuarded: isFarmDocsPathGuarded,
2419
2499
  basePath: farmConfig.basePath
2420
2500
  }) : null;
2501
+ const farmDocsListsPages = Boolean(
2502
+ farmDocsDevRuntime && _optionalChain([pm, 'optionalAccess', _163 => _163.getPlugins, 'call', _164 => _164(), 'access', _165 => _165.some, 'call', _166 => _166((plugin2) => plugin2.name === "farm:infra-analytics")])
2503
+ );
2504
+ let farmDocsPagePaths;
2505
+ const getFarmDocsPagePaths = () => {
2506
+ if (!farmDocsDevRuntime || !farmDocsListsPages) return void 0;
2507
+ _nullishCoalesce(farmDocsPagePaths, () => ( (farmDocsPagePaths = farmDocsDevRuntime.listFarmDocsPagePaths(farmConfig.docs, {
2508
+ root: farmConfig.root,
2509
+ srcDir: farmConfig.srcDir,
2510
+ adapter: farmDocsDevRuntime.hasFarmDocsRuntimeAdapter(farmConfig.docs)
2511
+ }).then(
2512
+ (pages) => new Set(pages),
2513
+ (error) => {
2514
+ _chunkQMNWKQL4cjs.logger.warn(
2515
+ `Farm Infra analytics reports docs pages by the docs route, not each page's path: listing them failed (${error instanceof Error ? error.message : String(error)}).`
2516
+ );
2517
+ return void 0;
2518
+ }
2519
+ ))));
2520
+ return farmDocsPagePaths;
2521
+ };
2522
+ if (farmDocsListsPages) {
2523
+ for (const event of ["add", "unlink"]) {
2524
+ server.watcher.on(event, () => {
2525
+ farmDocsPagePaths = void 0;
2526
+ });
2527
+ }
2528
+ }
2421
2529
  const wrapFarmDocsResponseWithLayouts = async (request, response) => {
2422
- if (request.method === "HEAD" || response.headers.has("x-farm-docs-adapter") || !_optionalChain([response, 'access', _163 => _163.headers, 'access', _164 => _164.get, 'call', _165 => _165("content-type"), 'optionalAccess', _166 => _166.toLowerCase, 'call', _167 => _167(), 'access', _168 => _168.includes, 'call', _169 => _169("text/html")])) {
2530
+ if (request.method === "HEAD" || response.headers.has("x-farm-docs-adapter") || !_optionalChain([response, 'access', _167 => _167.headers, 'access', _168 => _168.get, 'call', _169 => _169("content-type"), 'optionalAccess', _170 => _170.toLowerCase, 'call', _171 => _171(), 'access', _172 => _172.includes, 'call', _173 => _173("text/html")])) {
2423
2531
  return response;
2424
2532
  }
2425
2533
  const pathname = new URL(request.url).pathname;
2426
2534
  const matchedRoute = routeManager.matchRoute(pathname);
2427
2535
  const layoutEntries = matchedRoute.layouts.map((layout) => ({
2428
2536
  ...layout,
2429
- metadata: _chunk4DRINDGNcjs.getClientModuleMetadata.call(void 0, layout.modulePath, farmConfig.root)
2537
+ metadata: _chunkVO65MYJDcjs.getClientModuleMetadata.call(void 0, layout.modulePath, farmConfig.root)
2430
2538
  }));
2431
2539
  if (!layoutEntries.some((layout) => layout.metadata.shouldHydrate)) {
2432
2540
  return response;
@@ -2440,7 +2548,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2440
2548
  headers: response.headers
2441
2549
  });
2442
2550
  }
2443
- const docsRenderer = _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, (_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _170 => _170.getConfig, 'call', _171 => _171()]), () => ( options))).renderer);
2551
+ const docsRenderer = _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, (_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _174 => _174.getConfig, 'call', _175 => _175()]), () => ( options))).renderer);
2444
2552
  const [rendererRuntime, layoutModules] = await Promise.all([
2445
2553
  _chunk67MZTLTFcjs.isReactRenderer.call(void 0, docsRenderer) ? import("./renderer/react/server.cjs") : _chunkJYNNIGQOcjs.loadFarmDevModule.call(void 0, server, docsRenderer.server),
2446
2554
  Promise.all(
@@ -2469,7 +2577,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2469
2577
  ])
2470
2578
  );
2471
2579
  const inlineValue = (value) => JSON.stringify(value).replace(/</g, "\\u003c").replace(/>/g, "\\u003e");
2472
- const pageModulePath = _optionalChain([matchedRoute, 'access', _172 => _172.route, 'optionalAccess', _173 => _173.modulePath]) ? toUrlPath(matchedRoute.route.modulePath) : "";
2580
+ const pageModulePath = _optionalChain([matchedRoute, 'access', _176 => _176.route, 'optionalAccess', _177 => _177.modulePath]) ? toUrlPath(matchedRoute.route.modulePath) : "";
2473
2581
  const bootstrapScript = `<script>
2474
2582
  window.__FARM_PROPS__ = ${inlineValue({ params })};
2475
2583
  window.__FARM_ROUTE_SLOTS__ = [];
@@ -2566,7 +2674,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2566
2674
  }
2567
2675
  },
2568
2676
  (request) => {
2569
- const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _174 => _174.getConfig, 'call', _175 => _175()]), () => ( options));
2677
+ const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _178 => _178.getConfig, 'call', _179 => _179()]), () => ( options));
2570
2678
  const currentServerConfig = _chunkCFG4QERRcjs.resolveFarmServerConfig.call(void 0, currentConfig.server);
2571
2679
  return _chunkHDPT6OYEcjs.resolveFarmRequestURL.call(void 0, request, {
2572
2680
  trustProxy: currentServerConfig.trustProxy
@@ -2582,7 +2690,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2582
2690
  withAPIRequestTracing(async function handleFarmDevRequest(req, res, next) {
2583
2691
  const requestUrl = req.url || "/";
2584
2692
  const requestMethod = req.method || "GET";
2585
- const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _176 => _176.getConfig, 'call', _177 => _177()]), () => ( options));
2693
+ const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _180 => _180.getConfig, 'call', _181 => _181()]), () => ( options));
2586
2694
  const currentServerConfig = _chunkCFG4QERRcjs.resolveFarmServerConfig.call(void 0, currentConfig.server);
2587
2695
  const parsedRequestUrl = _chunkHDPT6OYEcjs.resolveFarmRequestURL.call(void 0, req, {
2588
2696
  trustProxy: currentServerConfig.trustProxy
@@ -2605,7 +2713,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2605
2713
  }
2606
2714
  }
2607
2715
  if (requestMethod === "OPTIONS" && req.headers.origin && req.headers["access-control-request-method"]) {
2608
- const preflightHeaders = _chunk22IWL4YDcjs.resolveRouteRuleCorsPreflightHeaders.call(void 0,
2716
+ const preflightHeaders = _chunkOCNV4CI2cjs.resolveRouteRuleCorsPreflightHeaders.call(void 0,
2609
2717
  currentConfig.routeRules,
2610
2718
  requestPathname
2611
2719
  );
@@ -2650,7 +2758,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2650
2758
  if (referrerUrl.origin === parsedRequestUrl.origin && !referrerUrl.pathname.startsWith(_chunkSTF6VDYQcjs.FARM_DEVTOOLS_PATH)) {
2651
2759
  launchUrl = referrerUrl;
2652
2760
  }
2653
- } catch (e21) {
2761
+ } catch (e22) {
2654
2762
  }
2655
2763
  }
2656
2764
  launchUrl.searchParams.set(_chunkSTF6VDYQcjs.FARM_DEVTOOLS_LAUNCH_PARAM, "1");
@@ -2676,7 +2784,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2676
2784
  openapi: options.openapi
2677
2785
  },
2678
2786
  workflows: discoveredWorkflows,
2679
- plugins: _optionalChain([pm, 'optionalAccess', _178 => _178.getSortedPlugins, 'call', _179 => _179()])
2787
+ plugins: _optionalChain([pm, 'optionalAccess', _182 => _182.getSortedPlugins, 'call', _183 => _183()])
2680
2788
  });
2681
2789
  res.statusCode = 200;
2682
2790
  res.setHeader(
@@ -2727,7 +2835,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2727
2835
  status: redirect.statusCode,
2728
2836
  headers: { Location: redirect.destination }
2729
2837
  });
2730
- if (pm.hasRuntimeRequestHooks()) {
2838
+ if (opensFarmDevRuntimeSession(pm)) {
2731
2839
  const redirectResponse = response;
2732
2840
  try {
2733
2841
  response = await pm.runRuntimeRequest(
@@ -2738,7 +2846,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2738
2846
  route: { pathname: requestPathname }
2739
2847
  }
2740
2848
  );
2741
- } catch (e22) {
2849
+ } catch (e23) {
2742
2850
  sendFarmDevRuntimeHookError(res, runtimeHookErrorAnswersJSON);
2743
2851
  logResponse(requestMethod, requestUrl, 500, 0, "PAGE");
2744
2852
  return;
@@ -2750,7 +2858,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2750
2858
  }
2751
2859
  }
2752
2860
  const runAppMiddlewareForContentRoute = async () => {
2753
- if (!_optionalChain([middlewareManager, 'optionalAccess', _180 => _180.hasMiddleware, 'call', _181 => _181()])) return false;
2861
+ if (!_optionalChain([middlewareManager, 'optionalAccess', _184 => _184.hasMiddleware, 'call', _185 => _185()])) return false;
2754
2862
  const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
2755
2863
  return runFarmMiddlewareWithNavigation(
2756
2864
  farmApp.getServerRenderer(),
@@ -2760,8 +2868,35 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2760
2868
  () => middlewareManager.execute(req, res)
2761
2869
  );
2762
2870
  };
2871
+ const sendDevErrorPage = (error) => {
2872
+ if (!res.headersSent) {
2873
+ res.setHeader("Content-Type", "text/html; charset=utf-8");
2874
+ res.setHeader("Cache-Control", "private, no-store");
2875
+ }
2876
+ next(error);
2877
+ };
2878
+ const sendMiddlewareErrorJSON = async (runtimeSession2, error) => {
2879
+ let response = createFarmDevMiddlewareErrorResponse();
2880
+ if (runtimeSession2) {
2881
+ const errorResponse = response;
2882
+ try {
2883
+ response = await pm.completeRuntimeRequest(
2884
+ runtimeSession2,
2885
+ async (_request, runtime) => {
2886
+ await runtime.reportError(error);
2887
+ return errorResponse;
2888
+ }
2889
+ );
2890
+ } catch (e24) {
2891
+ sendFarmDevRuntimeHookError(res, runtimeHookErrorAnswersJSON);
2892
+ return 500;
2893
+ }
2894
+ }
2895
+ await _chunkYIHRZBD7cjs.sendWebResponse.call(void 0, res, response);
2896
+ return response.status;
2897
+ };
2763
2898
  const runAppMiddlewareInRuntimeSession = async (runtimeSession2, logResponse2) => {
2764
- const interceptor = runtimeSession2 && _optionalChain([pm, 'optionalAccess', _182 => _182.hasRuntimeHook, 'call', _183 => _183("after")]) && _optionalChain([middlewareManager, 'optionalAccess', _184 => _184.hasMiddleware, 'call', _185 => _185()]) ? interceptFarmDevPageResponse({
2899
+ const interceptor = runtimeSession2 && _optionalChain([pm, 'optionalAccess', _186 => _186.hasRuntimeHook, 'call', _187 => _187("after")]) && _optionalChain([middlewareManager, 'optionalAccess', _188 => _188.hasMiddleware, 'call', _189 => _189()]) ? interceptFarmDevPageResponse({
2765
2900
  req,
2766
2901
  res,
2767
2902
  pm,
@@ -2774,7 +2909,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2774
2909
  urlPath: requestUrl,
2775
2910
  pathname: requestPathname,
2776
2911
  startTime: Date.now(),
2777
- logResponse: (_method, _path, status) => _optionalChain([logResponse2, 'optionalCall', _186 => _186(status)]),
2912
+ logResponse: (_method, _path, status) => _optionalChain([logResponse2, 'optionalCall', _190 => _190(status)]),
2778
2913
  // The runtime reports a runtime.after failure itself.
2779
2914
  emitError: async () => {
2780
2915
  },
@@ -2784,14 +2919,19 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2784
2919
  try {
2785
2920
  handled = await runAppMiddlewareForContentRoute();
2786
2921
  } catch (error) {
2787
- _optionalChain([interceptor, 'optionalAccess', _187 => _187.release, 'call', _188 => _188()]);
2788
- throw error;
2922
+ if (runtimeHookErrorAnswersJSON || res.headersSent) {
2923
+ _optionalChain([interceptor, 'optionalAccess', _191 => _191.release, 'call', _192 => _192()]);
2924
+ throw error;
2925
+ }
2926
+ if (runtimeSession2) await pm.reportRuntimeRequestError(runtimeSession2, error);
2927
+ sendDevErrorPage(error);
2928
+ return true;
2789
2929
  }
2790
2930
  if (!handled) {
2791
- _optionalChain([interceptor, 'optionalAccess', _189 => _189.release, 'call', _190 => _190()]);
2931
+ _optionalChain([interceptor, 'optionalAccess', _193 => _193.release, 'call', _194 => _194()]);
2792
2932
  return false;
2793
2933
  }
2794
- if (!_optionalChain([interceptor, 'optionalAccess', _191 => _191.isEnded, 'call', _192 => _192()])) _optionalChain([logResponse2, 'optionalCall', _193 => _193(res.statusCode || 200)]);
2934
+ if (!_optionalChain([interceptor, 'optionalAccess', _195 => _195.isEnded, 'call', _196 => _196()])) _optionalChain([logResponse2, 'optionalCall', _197 => _197(res.statusCode || 200)]);
2795
2935
  return true;
2796
2936
  };
2797
2937
  const serveBuiltInRoute = async (respond, {
@@ -2800,32 +2940,32 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2800
2940
  label
2801
2941
  } = {}) => {
2802
2942
  const discard = async () => {
2803
- await _optionalChain([computed, 'optionalAccess', _194 => _194.body, 'optionalAccess', _195 => _195.cancel, 'call', _196 => _196(), 'access', _197 => _197.catch, 'call', _198 => _198(() => {
2943
+ await _optionalChain([computed, 'optionalAccess', _198 => _198.body, 'optionalAccess', _199 => _199.cancel, 'call', _200 => _200(), 'access', _201 => _201.catch, 'call', _202 => _202(() => {
2804
2944
  })]);
2805
2945
  };
2806
2946
  const sendRuntimeResponse = async (runtimeSession3, response2) => {
2807
2947
  let runtimeResponse;
2808
2948
  try {
2809
2949
  runtimeResponse = await pm.endRuntimeRequest(runtimeSession3, response2);
2810
- } catch (e23) {
2950
+ } catch (e25) {
2811
2951
  sendFarmDevRuntimeHookError(res, runtimeHookErrorAnswersJSON);
2812
2952
  return;
2813
2953
  }
2814
2954
  await _chunkYIHRZBD7cjs.sendWebResponse.call(void 0, res, runtimeResponse);
2815
2955
  };
2816
2956
  let runtimeSession2;
2817
- if (_optionalChain([pm, 'optionalAccess', _199 => _199.hasRuntimeRequestHooks, 'call', _200 => _200()])) {
2957
+ if (pm && opensFarmDevRuntimeSession(pm)) {
2818
2958
  try {
2819
2959
  const routePathname = _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath);
2820
- const route = _chunkLPIZMU7Dcjs.setFarmRouteLabel.call(void 0,
2960
+ const route = _chunkGQ6QOH7Tcjs.setFarmRouteLabel.call(void 0,
2821
2961
  { pathname: requestPathname },
2822
- label !== void 0 ? label : devBuiltInRoutePaths.has(routePathname) ? routePathname : _chunkLPIZMU7Dcjs.resolveFarmMCPRouteLabel.call(void 0, routePathname, apiServerBasePath)
2962
+ label !== void 0 ? label : devBuiltInRoutePaths.has(routePathname) ? routePathname : _chunkGQ6QOH7Tcjs.resolveFarmMCPRouteLabel.call(void 0, routePathname, apiServerBasePath)
2823
2963
  );
2824
2964
  runtimeSession2 = await pm.beginRuntimeRequest(
2825
2965
  createRequestFromNodeRequest(req, new URL(fullUrl)),
2826
2966
  { kind, route }
2827
2967
  );
2828
- } catch (e24) {
2968
+ } catch (e26) {
2829
2969
  await discard();
2830
2970
  sendFarmDevRuntimeHookError(res, runtimeHookErrorAnswersJSON);
2831
2971
  return;
@@ -2847,11 +2987,17 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2847
2987
  }
2848
2988
  responding = true;
2849
2989
  response = await respond(
2850
- _nullishCoalesce(_optionalChain([runtimeSession2, 'optionalAccess', _201 => _201.request]), () => ( createRequestFromNodeRequest(req, new URL(fullUrl))))
2990
+ _nullishCoalesce(_optionalChain([runtimeSession2, 'optionalAccess', _203 => _203.request]), () => ( createRequestFromNodeRequest(req, new URL(fullUrl))))
2851
2991
  );
2852
2992
  } catch (error) {
2993
+ if (!responding && !res.headersSent) {
2994
+ _chunkQMNWKQL4cjs.logger.error(`Middleware error: ${error}`);
2995
+ await discard();
2996
+ await sendMiddlewareErrorJSON(runtimeSession2, error);
2997
+ return;
2998
+ }
2853
2999
  if (runtimeSession2) await pm.failRuntimeRequest(runtimeSession2, error);
2854
- if (!runtimeSession2 || !responding || res.headersSent) throw error;
3000
+ if (!runtimeSession2 || res.headersSent) throw error;
2855
3001
  console.error("[FARM] Built-in route error:", error);
2856
3002
  sendFarmDevRuntimeHookError(res, runtimeHookErrorAnswersJSON);
2857
3003
  return;
@@ -2861,7 +3007,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2861
3007
  else await _chunkYIHRZBD7cjs.sendWebResponse.call(void 0, res, response);
2862
3008
  };
2863
3009
  const openAPIRequestPathname = openAPIManager ? _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) : requestPathname;
2864
- if (openAPIManager && _optionalChain([options, 'access', _202 => _202.openapi, 'optionalAccess', _203 => _203.specRoute]) && openAPIRequestPathname === options.openapi.specRoute) {
3010
+ if (openAPIManager && _optionalChain([options, 'access', _204 => _204.openapi, 'optionalAccess', _205 => _205.specRoute]) && openAPIRequestPathname === options.openapi.specRoute) {
2865
3011
  const specManager = openAPIManager;
2866
3012
  await serveBuiltInRoute(async () => {
2867
3013
  if (requestMethod !== "GET" && requestMethod !== "HEAD") {
@@ -2881,7 +3027,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2881
3027
  });
2882
3028
  return;
2883
3029
  }
2884
- if (openAPIManager && openAPIRequestPathname === _optionalChain([options, 'access', _204 => _204.openapi, 'optionalAccess', _205 => _205.route])) {
3030
+ if (openAPIManager && openAPIRequestPathname === _optionalChain([options, 'access', _206 => _206.openapi, 'optionalAccess', _207 => _207.route])) {
2885
3031
  const docsManager = openAPIManager;
2886
3032
  await serveBuiltInRoute(
2887
3033
  async () => {
@@ -2892,20 +3038,20 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2892
3038
  );
2893
3039
  return;
2894
3040
  }
2895
- if (_optionalChain([options, 'access', _206 => _206.agent, 'optionalAccess', _207 => _207.manifest]) !== false && _chunkLPIZMU7Dcjs.isFarmAppManifestPath.call(void 0, _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath))) {
3041
+ if (_optionalChain([options, 'access', _208 => _208.agent, 'optionalAccess', _209 => _209.manifest]) !== false && _chunkGQ6QOH7Tcjs.isFarmAppManifestPath.call(void 0, _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath))) {
2896
3042
  await serveBuiltInRoute(async () => {
2897
- _nullishCoalesce(farmAppPackages, () => ( (farmAppPackages = _chunkN5DQMOAGcjs.resolveFarmAppPackages.call(void 0, _nullishCoalesce(farmConfig.root, () => ( process.cwd()))))));
2898
- const manifest = await _chunkLPIZMU7Dcjs.createFarmAppManifestResponse.call(void 0,
3043
+ _nullishCoalesce(farmAppPackages, () => ( (farmAppPackages = _chunkDHR2WDSLcjs.resolveFarmAppPackages.call(void 0, _nullishCoalesce(farmConfig.root, () => ( process.cwd()))))));
3044
+ const manifest = await _chunkGQ6QOH7Tcjs.createFarmAppManifestResponse.call(void 0,
2899
3045
  new Request(parsedRequestUrl, {
2900
3046
  method: requestMethod,
2901
3047
  headers: { "if-none-match": String(_nullishCoalesce(req.headers["if-none-match"], () => ( ""))) }
2902
3048
  }),
2903
3049
  {
2904
- ..._chunkLPIZMU7Dcjs.resolveFarmAppManifestInput.call(void 0, farmConfig, {
3050
+ ..._chunkGQ6QOH7Tcjs.resolveFarmAppManifestInput.call(void 0, farmConfig, {
2905
3051
  build: "development",
2906
3052
  packages: farmAppPackages,
2907
3053
  // Read again on each request; unchanged files come from a cache.
2908
- webmcpTools: _optionalChain([farmConfig, 'access', _208 => _208.plugins, 'optionalAccess', _209 => _209.some, 'call', _210 => _210(({ name }) => name === "farm:webmcp")]) ? _chunkN5DQMOAGcjs.collectFarmWebMCPTools.call(void 0, _nullishCoalesce(farmConfig.root, () => ( process.cwd())), farmConfig.srcDir) : []
3054
+ webmcpTools: _optionalChain([farmConfig, 'access', _210 => _210.plugins, 'optionalAccess', _211 => _211.some, 'call', _212 => _212(({ name }) => name === "farm:webmcp")]) ? _chunkDHR2WDSLcjs.collectFarmWebMCPTools.call(void 0, _nullishCoalesce(farmConfig.root, () => ( process.cwd())), farmConfig.srcDir) : []
2909
3055
  }),
2910
3056
  defaultMCP: () => farmApp.getServerRenderer().getDefaultMCPServer(),
2911
3057
  // A guard written for an MCP server's path keeps its tools out of the public view.
@@ -2923,11 +3069,11 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2923
3069
  });
2924
3070
  return;
2925
3071
  }
2926
- if (_optionalChain([options, 'access', _211 => _211.agent, 'optionalAccess', _212 => _212.apiCatalog]) && _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) === _chunkLPIZMU7Dcjs.FARM_API_CATALOG_PATH) {
3072
+ if (_optionalChain([options, 'access', _213 => _213.agent, 'optionalAccess', _214 => _214.apiCatalog]) && _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) === _chunkGQ6QOH7Tcjs.FARM_API_CATALOG_PATH) {
2927
3073
  await serveBuiltInRoute(
2928
- () => _chunkLPIZMU7Dcjs.createFarmApiCatalogResponse.call(void 0,
3074
+ () => _chunkGQ6QOH7Tcjs.createFarmApiCatalogResponse.call(void 0,
2929
3075
  requestMethod,
2930
- _chunkLPIZMU7Dcjs.resolveFarmApiCatalogInput.call(void 0, { ...options, api: farmConfig.api }),
3076
+ _chunkGQ6QOH7Tcjs.resolveFarmApiCatalogInput.call(void 0, { ...options, api: farmConfig.api }),
2931
3077
  new Request(parsedRequestUrl, {
2932
3078
  headers: { "user-agent": String(_nullishCoalesce(req.headers["user-agent"], () => ( ""))) }
2933
3079
  })
@@ -2935,8 +3081,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2935
3081
  );
2936
3082
  return;
2937
3083
  }
2938
- if (_optionalChain([options, 'access', _213 => _213.agent, 'optionalAccess', _214 => _214.aiCatalog]) !== false) {
2939
- const aiCatalog = _chunkLPIZMU7Dcjs.createFarmAiCatalogResponse.call(void 0,
3084
+ if (_optionalChain([options, 'access', _215 => _215.agent, 'optionalAccess', _216 => _216.aiCatalog]) !== false) {
3085
+ const aiCatalog = _chunkGQ6QOH7Tcjs.createFarmAiCatalogResponse.call(void 0,
2940
3086
  new Request(parsedRequestUrl, {
2941
3087
  method: requestMethod,
2942
3088
  headers: {
@@ -2984,11 +3130,12 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2984
3130
  {
2985
3131
  kind: "docs",
2986
3132
  computed: docsResponse,
2987
- label: _chunkLPIZMU7Dcjs.resolveFarmDocsEngineRouteLabel.call(void 0,
3133
+ label: _chunkGQ6QOH7Tcjs.resolveFarmDocsEngineRouteLabel.call(void 0,
2988
3134
  _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath),
2989
3135
  {
2990
- path: _optionalChain([farmConfig, 'access', _215 => _215.docs, 'optionalAccess', _216 => _216.entry]) || "/docs",
2991
- roots: _optionalChain([farmConfig, 'access', _217 => _217.docs, 'optionalAccess', _218 => _218.roots, 'optionalAccess', _219 => _219.map, 'call', _220 => _220((root) => root.entry)])
3136
+ path: _optionalChain([farmConfig, 'access', _217 => _217.docs, 'optionalAccess', _218 => _218.entry]) || "/docs",
3137
+ roots: _optionalChain([farmConfig, 'access', _219 => _219.docs, 'optionalAccess', _220 => _220.roots, 'optionalAccess', _221 => _221.map, 'call', _222 => _222((root) => root.entry)]),
3138
+ pages: await getFarmDocsPagePaths()
2992
3139
  }
2993
3140
  )
2994
3141
  }
@@ -2996,7 +3143,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
2996
3143
  return;
2997
3144
  }
2998
3145
  }
2999
- if (options.mobileClient && !viteModuleRequest && (requestMethod === "GET" || requestMethod === "HEAD" || requestMethod === "POST") && _optionalChain([req, 'access', _221 => _221.headers, 'access', _222 => _222.accept, 'optionalAccess', _223 => _223.includes, 'call', _224 => _224(_chunk3HLQTOVUcjs.FARM_NATIVE_TREE_CONTENT_TYPE)])) {
3146
+ if (options.mobileClient && !viteModuleRequest && (requestMethod === "GET" || requestMethod === "HEAD" || requestMethod === "POST") && _optionalChain([req, 'access', _223 => _223.headers, 'access', _224 => _224.accept, 'optionalAccess', _225 => _225.includes, 'call', _226 => _226(_chunk3HLQTOVUcjs.FARM_NATIVE_TREE_CONTENT_TYPE)])) {
3000
3147
  const { createFarmNativeTreeResponse } = await import("./native-tree-W2SSJB3Y.cjs");
3001
3148
  const treeBodyInit = requestMethod === "POST" ? { body: _chunkCFG4QERRcjs.createFarmNodeRequestBodyStream.call(void 0, req), duplex: "half" } : {};
3002
3149
  const treeResponse = await createFarmNativeTreeResponse({
@@ -3014,18 +3161,18 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3014
3161
  });
3015
3162
  await serveBuiltInRoute(() => treeResponse, {
3016
3163
  computed: treeResponse,
3017
- label: _nullishCoalesce(_optionalChain([farmApp, 'access', _225 => _225.getRouteManager, 'call', _226 => _226(), 'access', _227 => _227.matchRoute, 'call', _228 => _228(_chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath)), 'access', _229 => _229.route, 'optionalAccess', _230 => _230.pattern]), () => ( null))
3164
+ label: _nullishCoalesce(_optionalChain([farmApp, 'access', _227 => _227.getRouteManager, 'call', _228 => _228(), 'access', _229 => _229.matchRoute, 'call', _230 => _230(_chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath)), 'access', _231 => _231.route, 'optionalAccess', _232 => _232.pattern]), () => ( null))
3018
3165
  });
3019
3166
  return;
3020
3167
  }
3021
3168
  const markdownRouteLabel = () => (
3022
3169
  // On the route path, as production labels it: /fr/index.md is /index.md.
3023
- _chunkLPIZMU7Dcjs.resolveFarmMarkdownRouteLabel.call(void 0,
3170
+ _chunkGQ6QOH7Tcjs.resolveFarmMarkdownRouteLabel.call(void 0,
3024
3171
  toRoutePathname(requestPathname),
3025
- (page) => _optionalChain([farmApp, 'access', _231 => _231.getRouteManager, 'call', _232 => _232(), 'access', _233 => _233.matchRoute, 'call', _234 => _234(page), 'access', _235 => _235.route, 'optionalAccess', _236 => _236.pattern])
3172
+ (page) => _optionalChain([farmApp, 'access', _233 => _233.getRouteManager, 'call', _234 => _234(), 'access', _235 => _235.matchRoute, 'call', _236 => _236(page), 'access', _237 => _237.route, 'optionalAccess', _238 => _238.pattern])
3026
3173
  )
3027
3174
  );
3028
- const markdownSourceResponse = viteModuleRequest ? null : await _chunkQ37INCXGcjs.createFarmMarkdownSourceResponse.call(void 0, {
3175
+ const markdownSourceResponse = viteModuleRequest ? null : await _chunk3EEINK7Gcjs.createFarmMarkdownSourceResponse.call(void 0, {
3029
3176
  request: new Request(fullUrl, {
3030
3177
  method: requestMethod,
3031
3178
  headers: docsHeaders
@@ -3034,7 +3181,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3034
3181
  routePathname: toRoutePathname,
3035
3182
  resolveSource: async (pathname2) => {
3036
3183
  const match = farmApp.getRouteManager().matchRoute(pathname2);
3037
- const sourcePath = _optionalChain([match, 'access', _237 => _237.route, 'optionalAccess', _238 => _238.markdownSourcePath]) || (match.route && _chunkQ37INCXGcjs.isFarmMarkdownPageFile.call(void 0, match.route.modulePath) ? match.route.modulePath : null);
3184
+ const sourcePath = _optionalChain([match, 'access', _239 => _239.route, 'optionalAccess', _240 => _240.markdownSourcePath]) || (match.route && _chunk3EEINK7Gcjs.isFarmMarkdownPageFile.call(void 0, match.route.modulePath) ? match.route.modulePath : null);
3038
3185
  if (!sourcePath) {
3039
3186
  return null;
3040
3187
  }
@@ -3092,7 +3239,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3092
3239
  return;
3093
3240
  }
3094
3241
  if (!viteModuleRequest && _chunkFT6KJHS3cjs.farmRequestWantsMarkdown.call(void 0, requestPathname, req.headers.accept)) {
3095
- const markdownRoute = farmApp.getRouteManager().matchRoute(_chunkQ37INCXGcjs.normalizeFarmMarkdownRoutePath.call(void 0, requestPathname, toRoutePathname));
3242
+ const markdownRoute = farmApp.getRouteManager().matchRoute(_chunk3EEINK7Gcjs.normalizeFarmMarkdownRoutePath.call(void 0, requestPathname, toRoutePathname));
3096
3243
  if (!markdownRoute.route) {
3097
3244
  await serveBuiltInRoute(
3098
3245
  () => new Response(
@@ -3176,7 +3323,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3176
3323
  "beforeRequest",
3177
3324
  (plugin2) => {
3178
3325
  const owner = _chunkBDYM2TN3cjs.getFarmIntegrationPluginOwner.call(void 0, plugin2);
3179
- return !isFarmConfigRoutePlugin(plugin2) && (_optionalChain([owner, 'optionalAccess', _239 => _239.source]) !== "lifecycle" || owner.key !== matchedRoute.key);
3326
+ return !isFarmConfigRoutePlugin(plugin2) && (_optionalChain([owner, 'optionalAccess', _241 => _241.source]) !== "lifecycle" || owner.key !== matchedRoute.key);
3180
3327
  },
3181
3328
  req,
3182
3329
  res
@@ -3213,7 +3360,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3213
3360
  isProd: false
3214
3361
  },
3215
3362
  request,
3216
- { clientAddress: _optionalChain([req, 'access', _240 => _240.socket, 'optionalAccess', _241 => _241.remoteAddress]) }
3363
+ { clientAddress: _optionalChain([req, 'access', _242 => _242.socket, 'optionalAccess', _243 => _243.remoteAddress]) }
3217
3364
  );
3218
3365
  if (!result) {
3219
3366
  throw new Error(`Matched integration route did not return a response`);
@@ -3221,7 +3368,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3221
3368
  return result;
3222
3369
  } catch (error) {
3223
3370
  _chunkQMNWKQL4cjs.logger.error(`Integration route error: ${error}`);
3224
- await _optionalChain([runtime, 'optionalAccess', _242 => _242.reportError, 'call', _243 => _243(error)]);
3371
+ await _optionalChain([runtime, 'optionalAccess', _244 => _244.reportError, 'call', _245 => _245(error)]);
3225
3372
  return _chunkXGTFLG73cjs.createFarmInternalServerErrorResponse.call(void 0, );
3226
3373
  }
3227
3374
  };
@@ -3272,7 +3419,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3272
3419
  _chunkBDYM2TN3cjs.matchIntegrationRoute.call(void 0, configuredIntegrations, {
3273
3420
  pathname: requestPathname,
3274
3421
  method: requestMethod
3275
- }) || routeManager3.matchRedirect(requestPathname) || apiRouteManager.matchRoute(requestPathname) || farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _244 => _244.isFarmDocsAPIRequest, 'call', _245 => _245(requestPathname)]) || routeManager3.matchRoute(requestPathname).route || routeManager3.matchMetadataRoute(requestPathname) || routeManager3.matchMetadataImage(requestPathname)
3422
+ }) || routeManager3.matchRedirect(requestPathname) || apiRouteManager.matchRoute(requestPathname) || farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _246 => _246.isFarmDocsAPIRequest, 'call', _247 => _247(requestPathname)]) || routeManager3.matchRoute(requestPathname).route || routeManager3.matchMetadataRoute(requestPathname) || routeManager3.matchMetadataImage(requestPathname)
3276
3423
  );
3277
3424
  };
3278
3425
  try {
@@ -3364,21 +3511,21 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3364
3511
  });
3365
3512
  };
3366
3513
  const isDocsAPIRequest = Boolean(
3367
- farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _246 => _246.isFarmDocsAPIRequest, 'call', _247 => _247(pathname2)])
3514
+ farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _248 => _248.isFarmDocsAPIRequest, 'call', _249 => _249(pathname2)])
3368
3515
  );
3369
3516
  const docsRuntimeOptions = () => ({
3370
3517
  kind: "docs",
3371
- route: _chunkLPIZMU7Dcjs.setFarmRouteLabel.call(void 0,
3518
+ route: _chunkGQ6QOH7Tcjs.setFarmRouteLabel.call(void 0,
3372
3519
  { pathname: pathname2, pattern: urlPath2 },
3373
- _chunkLPIZMU7Dcjs.resolveFarmDocsRouteLabel.call(void 0, pathname2, {
3374
- path: _optionalChain([farmConfig, 'access', _248 => _248.docs, 'optionalAccess', _249 => _249.entry]) || "/docs",
3375
- roots: _optionalChain([farmConfig, 'access', _250 => _250.docs, 'optionalAccess', _251 => _251.roots, 'optionalAccess', _252 => _252.map, 'call', _253 => _253((root) => root.entry)])
3520
+ _chunkGQ6QOH7Tcjs.resolveFarmDocsRouteLabel.call(void 0, pathname2, {
3521
+ path: _optionalChain([farmConfig, 'access', _250 => _250.docs, 'optionalAccess', _251 => _251.entry]) || "/docs",
3522
+ roots: _optionalChain([farmConfig, 'access', _252 => _252.docs, 'optionalAccess', _253 => _253.roots, 'optionalAccess', _254 => _254.map, 'call', _255 => _255((root) => root.entry)])
3376
3523
  })
3377
3524
  )
3378
3525
  });
3379
3526
  let runtimeSession2;
3380
3527
  let sessionRequestUrl;
3381
- if (_optionalChain([pm, 'optionalAccess', _254 => _254.hasRuntimeRequestHooks, 'call', _255 => _255()])) {
3528
+ if (pm && opensFarmDevRuntimeSession(pm)) {
3382
3529
  try {
3383
3530
  runtimeSession2 = await pm.beginRuntimeRequest(
3384
3531
  await createAPIRequest(),
@@ -3410,9 +3557,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3410
3557
  return;
3411
3558
  }
3412
3559
  _chunkQMNWKQL4cjs.logger.error(`API route error: ${error}`);
3413
- res.statusCode = 500;
3414
- res.setHeader("Content-Type", "application/json");
3415
- res.end(_chunkXGTFLG73cjs.FARM_INTERNAL_SERVER_ERROR_BODY);
3560
+ sendFarmDevRuntimeHookError(res, true);
3416
3561
  return;
3417
3562
  }
3418
3563
  pm.copyRequestContext(runtimeSession2.request, req);
@@ -3432,25 +3577,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3432
3577
  throw error;
3433
3578
  }
3434
3579
  _chunkQMNWKQL4cjs.logger.error(`Middleware error: ${error}`);
3435
- let response = createFarmDevMiddlewareErrorResponse();
3436
- if (runtimeSession2) {
3437
- const errorResponse = response;
3438
- try {
3439
- response = await pm.completeRuntimeRequest(
3440
- runtimeSession2,
3441
- async (_request, runtime) => {
3442
- await runtime.reportError(error);
3443
- return errorResponse;
3444
- }
3445
- );
3446
- } catch (e25) {
3447
- logResponse(method2, urlPath2, 500, Date.now() - startTime2, "API");
3448
- sendFarmDevRuntimeHookError(res, runtimeHookErrorAnswersJSON);
3449
- return;
3450
- }
3451
- }
3452
- logResponse(method2, urlPath2, response.status, Date.now() - startTime2, "API");
3453
- await _chunkYIHRZBD7cjs.sendWebResponse.call(void 0, res, response);
3580
+ const status = await sendMiddlewareErrorJSON(runtimeSession2, error);
3581
+ logResponse(method2, urlPath2, status, Date.now() - startTime2, "API");
3454
3582
  return;
3455
3583
  }
3456
3584
  const createHandlerRequest = async () => {
@@ -3557,9 +3685,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3557
3685
  return;
3558
3686
  }
3559
3687
  _chunkQMNWKQL4cjs.logger.error(`API route error: ${error}`);
3560
- res.statusCode = 500;
3561
- res.setHeader("Content-Type", "application/json");
3562
- res.end(_chunkXGTFLG73cjs.FARM_INTERNAL_SERVER_ERROR_BODY);
3688
+ sendFarmDevRuntimeHookError(res, true);
3563
3689
  return;
3564
3690
  }
3565
3691
  }
@@ -3601,9 +3727,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3601
3727
  return;
3602
3728
  }
3603
3729
  _chunkQMNWKQL4cjs.logger.error(`Docs API route error: ${error}`);
3604
- res.statusCode = 500;
3605
- res.setHeader("Content-Type", "application/json");
3606
- res.end(_chunkXGTFLG73cjs.FARM_INTERNAL_SERVER_ERROR_BODY);
3730
+ sendFarmDevRuntimeHookError(res, true);
3607
3731
  return;
3608
3732
  }
3609
3733
  }
@@ -3627,9 +3751,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3627
3751
  await _chunkYIHRZBD7cjs.sendWebResponse.call(void 0, res, response);
3628
3752
  } catch (error) {
3629
3753
  _chunkQMNWKQL4cjs.logger.error(`API route error: ${error}`);
3630
- res.statusCode = 500;
3631
- res.setHeader("Content-Type", "application/json");
3632
- res.end(_chunkXGTFLG73cjs.FARM_INTERNAL_SERVER_ERROR_BODY);
3754
+ sendFarmDevRuntimeHookError(res, true);
3633
3755
  }
3634
3756
  return;
3635
3757
  }
@@ -3656,14 +3778,14 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3656
3778
  urlObj,
3657
3779
  _chunkCFG4QERRcjs.createFarmNodeRequestAbortSignal.call(void 0, req, res)
3658
3780
  );
3659
- const deploymentMismatch = _chunkF43OG25Pcjs.getFarmDeploymentMismatch.call(void 0,
3781
+ const deploymentMismatch = _chunkI7J5RLGOcjs.getFarmDeploymentMismatch.call(void 0,
3660
3782
  request,
3661
3783
  farmConfig.deploymentId
3662
3784
  );
3663
3785
  if (deploymentMismatch) {
3664
3786
  await _chunkYIHRZBD7cjs.sendWebResponse.call(void 0,
3665
3787
  res,
3666
- _chunkF43OG25Pcjs.createFarmDeploymentMismatchResponse.call(void 0, deploymentMismatch)
3788
+ _chunkI7J5RLGOcjs.createFarmDeploymentMismatchResponse.call(void 0, deploymentMismatch)
3667
3789
  );
3668
3790
  return;
3669
3791
  }
@@ -3736,7 +3858,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3736
3858
  );
3737
3859
  const loadingModule = loadingBoundary ? await routeManager3.loadRouteModule(loadingBoundary.modulePath) : null;
3738
3860
  const navigationManifest = routeManager3.generateClientManifest(server.config.root);
3739
- const moduleMetadata = _nullishCoalesce(navigationManifest.routes.find((entry) => entry.pattern === route.pattern), () => ( _chunk4DRINDGNcjs.getClientModuleMetadata.call(void 0, route.modulePath, server.config.root)));
3861
+ const moduleMetadata = _nullishCoalesce(navigationManifest.routes.find((entry) => entry.pattern === route.pattern), () => ( _chunkVO65MYJDcjs.getClientModuleMetadata.call(void 0, route.modulePath, server.config.root)));
3740
3862
  const isClientComponent = moduleMetadata.isClientComponent;
3741
3863
  const shouldHydrate = moduleMetadata.shouldHydrate;
3742
3864
  let mergedMetadata = {};
@@ -3744,7 +3866,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3744
3866
  layouts.map((layout) => routeManager3.loadLayoutModule(layout.modulePath))
3745
3867
  );
3746
3868
  const layoutHydrationMetadata = layouts.map(
3747
- (layout) => _nullishCoalesce(navigationManifest.layouts.find((entry) => entry.pattern === layout.pattern), () => ( _chunk4DRINDGNcjs.getClientModuleMetadata.call(void 0, layout.modulePath, server.config.root)))
3869
+ (layout) => _nullishCoalesce(navigationManifest.layouts.find((entry) => entry.pattern === layout.pattern), () => ( _chunkVO65MYJDcjs.getClientModuleMetadata.call(void 0, layout.modulePath, server.config.root)))
3748
3870
  );
3749
3871
  const shouldHydrateLayout = layoutHydrationMetadata.some(
3750
3872
  (metadata) => metadata.shouldHydrate
@@ -3757,7 +3879,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3757
3879
  ];
3758
3880
  const hydrationIslandStrategy = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0,
3759
3881
  _optionalChain([(_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _278 => _278.getConfig, 'call', _279 => _279()]), () => ( options))), 'access', _280 => _280.experimental, 'optionalAccess', _281 => _281.serverComponents])
3760
- ) === "islands" ? _chunkN5DQMOAGcjs.resolveFarmRouteRootStrategy.call(void 0,
3882
+ ) === "islands" ? _chunkDHR2WDSLcjs.resolveFarmRouteRootStrategy.call(void 0,
3761
3883
  route,
3762
3884
  { shouldHydrate, islandStrategy: _nullishCoalesce(moduleMetadata.islandStrategy, () => ( null)) },
3763
3885
  layouts.map((layout, index) => ({
@@ -3823,7 +3945,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3823
3945
  const slotModule = await routeManager3.loadRouteModule(slot.route.modulePath);
3824
3946
  const slotMetadata = _nullishCoalesce(navigationManifest.slots.find(
3825
3947
  (entry) => entry.name === slot.name && entry.ownerPattern === slot.ownerPattern && entry.pattern === slot.route.pattern
3826
- ), () => ( _chunk4DRINDGNcjs.getClientModuleMetadata.call(void 0, slot.route.modulePath, server.config.root)));
3948
+ ), () => ( _chunkVO65MYJDcjs.getClientModuleMetadata.call(void 0, slot.route.modulePath, server.config.root)));
3827
3949
  const slotContext = await _chunkX333W5KVcjs.resolveFarmRouteContext.call(void 0, farmApp.getConfig(), {
3828
3950
  request: targetRequest,
3829
3951
  params: slot.params,
@@ -3873,7 +3995,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3873
3995
  pageShouldHydrate: shouldHydrate,
3874
3996
  layoutShouldHydrate: shouldHydrateLayout,
3875
3997
  islandStrategy: hydrationIslandStrategy,
3876
- rendering: _chunkYVTS3S3Fcjs.resolveRouteRenderingConfig.call(void 0, routeModule)
3998
+ rendering: _chunkQOGIZKSOcjs.resolveRouteRenderingConfig.call(void 0, routeModule)
3877
3999
  });
3878
4000
  const destinationLayoutPatterns = layouts.map((layout) => layout.pattern);
3879
4001
  const layoutStartIndex = _chunkUPOYKX4Scjs.getSharedLayoutPrefixLength.call(void 0,
@@ -3961,7 +4083,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
3961
4083
  "Cache-Control": _chunkUPOYKX4Scjs.getFarmFragmentCacheControl.call(void 0, renderPlan),
3962
4084
  "X-Farm-Navigation": "html-fragment",
3963
4085
  Vary: "X-Farm-Layout-Chain",
3964
- [_chunkF43OG25Pcjs.FARM_DEPLOYMENT_ID_HEADER]: farmConfig.deploymentId
4086
+ [_chunkI7J5RLGOcjs.FARM_DEPLOYMENT_ID_HEADER]: farmConfig.deploymentId
3965
4087
  }
3966
4088
  },
3967
4089
  {
@@ -4006,29 +4128,29 @@ window.__FARM_MANIFEST__ = ${inlineValue({
4006
4128
  const hasBeforeRenderHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _295 => _295.hasHook, 'call', _296 => _296("beforeRender")]), () => ( false));
4007
4129
  const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _297 => _297.hasHook, 'call', _298 => _298("afterResponse")]), () => ( false));
4008
4130
  const hasHTMLTransformHook = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _299 => _299.hasHook, 'call', _300 => _300("transformHTML")]), () => ( false))) || (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _301 => _301.hasHook, 'call', _302 => _302("afterRender")]), () => ( false)));
4009
- const hasRuntimeRequestHooks = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _303 => _303.hasRuntimeRequestHooks, 'call', _304 => _304()]), () => ( false));
4010
- const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _305 => _305.hasRuntimeHook, 'call', _306 => _306("after")]), () => ( false));
4131
+ const opensRuntimeSession = pm ? opensFarmDevRuntimeSession(pm) : false;
4132
+ const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _303 => _303.hasRuntimeHook, 'call', _304 => _304("after")]), () => ( false));
4011
4133
  const requestedMatch = routeManager2.matchRoute(requestedPathname);
4012
4134
  const pageBuiltInRouteLabel = (pathname2) => {
4013
4135
  const routePathname = _chunkD22BUQKWcjs.stripFarmBasePath.call(void 0, pathname2, farmConfig.basePath);
4014
- const mcpLabel = _chunkLPIZMU7Dcjs.resolveFarmMCPRouteLabel.call(void 0, routePathname, apiServerBasePath);
4136
+ const mcpLabel = _chunkGQ6QOH7Tcjs.resolveFarmMCPRouteLabel.call(void 0, routePathname, apiServerBasePath);
4015
4137
  if (mcpLabel) return mcpLabel;
4016
4138
  if (farmAgentGeneratedPaths(farmConfig).includes(routePathname)) return routePathname;
4017
4139
  return routePathname === _chunkX3MHKLCOcjs.FARM_DEFAULT_MCP_PATH && farmApp.getServerRenderer().getDefaultMCPServer() ? _chunkX3MHKLCOcjs.FARM_DEFAULT_MCP_PATH : null;
4018
4140
  };
4019
4141
  let runtimeSession;
4020
4142
  let pathname = requestedPathname;
4021
- if (pm && hasRuntimeRequestHooks) {
4143
+ if (pm && opensRuntimeSession) {
4022
4144
  try {
4023
4145
  const sessionOptions = {
4024
4146
  kind: "page",
4025
- route: _chunkLPIZMU7Dcjs.setFarmRouteLabel.call(void 0,
4147
+ route: _chunkGQ6QOH7Tcjs.setFarmRouteLabel.call(void 0,
4026
4148
  {
4027
4149
  pathname: requestedPathname,
4028
- pattern: _optionalChain([requestedMatch, 'optionalAccess', _307 => _307.route, 'optionalAccess', _308 => _308.pattern]) || null,
4029
- params: _optionalChain([requestedMatch, 'optionalAccess', _309 => _309.params]) || {}
4150
+ pattern: _optionalChain([requestedMatch, 'optionalAccess', _305 => _305.route, 'optionalAccess', _306 => _306.pattern]) || null,
4151
+ params: _optionalChain([requestedMatch, 'optionalAccess', _307 => _307.params]) || {}
4030
4152
  },
4031
- _optionalChain([requestedMatch, 'optionalAccess', _310 => _310.route]) ? null : pageBuiltInRouteLabel(requestedPathname)
4153
+ _optionalChain([requestedMatch, 'optionalAccess', _308 => _308.route]) ? null : pageBuiltInRouteLabel(requestedPathname)
4032
4154
  )
4033
4155
  };
4034
4156
  runtimeSession = await pm.beginRuntimeRequest(
@@ -4055,20 +4177,39 @@ window.__FARM_MANIFEST__ = ${inlineValue({
4055
4177
  }
4056
4178
  }
4057
4179
  const routeMatch = pathname === requestedPathname ? requestedMatch : routeManager2.matchRoute(pathname);
4058
- if (pm && hasBeforeRouteMatchHook) {
4059
- await pm.runHookParallel("beforeRouteMatch", {
4060
- pathname,
4061
- method
4062
- });
4063
- }
4064
- if (pm && hasAfterRouteMatchHook) {
4065
- await pm.runHookParallel("afterRouteMatch", {
4066
- pathname,
4067
- matched: !!_optionalChain([routeMatch, 'optionalAccess', _311 => _311.route]),
4068
- routePattern: _optionalChain([routeMatch, 'optionalAccess', _312 => _312.route, 'optionalAccess', _313 => _313.pattern]) || null,
4069
- params: _optionalChain([routeMatch, 'optionalAccess', _314 => _314.params]) || {},
4070
- layoutPatterns: (_optionalChain([routeMatch, 'optionalAccess', _315 => _315.layouts]) || []).map((l) => l.pattern)
4071
- });
4180
+ const failPageHook = async (error, interceptor) => {
4181
+ _optionalChain([interceptor, 'optionalAccess', _309 => _309.release, 'call', _310 => _310()]);
4182
+ logResponse(method, urlPath, 500, Date.now() - startTime, "PAGE");
4183
+ if (runtimeSession) {
4184
+ await pm.failRuntimeRequest(runtimeSession, error);
4185
+ } else {
4186
+ await emitPluginError("runtime", error, {
4187
+ kind: "page",
4188
+ pathname,
4189
+ durationMs: Date.now() - startTime
4190
+ });
4191
+ }
4192
+ if (!res.headersSent) sendFarmDevRuntimeHookError(res, runtimeHookErrorAnswersJSON);
4193
+ };
4194
+ try {
4195
+ if (pm && hasBeforeRouteMatchHook) {
4196
+ await pm.runHookParallel("beforeRouteMatch", {
4197
+ pathname,
4198
+ method
4199
+ });
4200
+ }
4201
+ if (pm && hasAfterRouteMatchHook) {
4202
+ await pm.runHookParallel("afterRouteMatch", {
4203
+ pathname,
4204
+ matched: !!_optionalChain([routeMatch, 'optionalAccess', _311 => _311.route]),
4205
+ routePattern: _optionalChain([routeMatch, 'optionalAccess', _312 => _312.route, 'optionalAccess', _313 => _313.pattern]) || null,
4206
+ params: _optionalChain([routeMatch, 'optionalAccess', _314 => _314.params]) || {},
4207
+ layoutPatterns: (_optionalChain([routeMatch, 'optionalAccess', _315 => _315.layouts]) || []).map((l) => l.pattern)
4208
+ });
4209
+ }
4210
+ } catch (error) {
4211
+ await failPageHook(error);
4212
+ return;
4072
4213
  }
4073
4214
  const renderPayload = {
4074
4215
  pathname,
@@ -4135,7 +4276,12 @@ window.__FARM_MANIFEST__ = ${inlineValue({
4135
4276
  }
4136
4277
  const renderer = farmApp.getServerRenderer();
4137
4278
  if (pm && hasBeforeRenderHook) {
4138
- await pm.runHookParallel("beforeRender", renderPayload);
4279
+ try {
4280
+ await pm.runHookParallel("beforeRender", renderPayload);
4281
+ } catch (error) {
4282
+ await failPageHook(error, responseInterceptor);
4283
+ return;
4284
+ }
4139
4285
  }
4140
4286
  await renderer.renderPage(req, res);
4141
4287
  if (!shouldInterceptResponse) {
@@ -4145,24 +4291,29 @@ window.__FARM_MANIFEST__ = ${inlineValue({
4145
4291
  const duration = Date.now() - startTime;
4146
4292
  logResponse(method, urlPath, 500, duration, "PAGE");
4147
4293
  if (pm && runtimeSession) {
4148
- await pm.failRuntimeRequest(runtimeSession, error);
4149
- }
4150
- if (!(middlewareFailed && runtimeSession)) {
4294
+ if (middlewareFailed) {
4295
+ await pm.reportRuntimeRequestError(runtimeSession, error);
4296
+ } else {
4297
+ await pm.failRuntimeRequest(runtimeSession, error);
4298
+ if (!res.headersSent && !_optionalChain([responseInterceptor, 'optionalAccess', _327 => _327.isEnded, 'call', _328 => _328()])) {
4299
+ _optionalChain([responseInterceptor, 'optionalAccess', _329 => _329.release, 'call', _330 => _330()]);
4300
+ console.error("[FARM] Page error:", error);
4301
+ sendFarmDevRuntimeHookError(res, runtimeHookErrorAnswersJSON);
4302
+ return;
4303
+ }
4304
+ }
4305
+ } else {
4151
4306
  await emitPluginError("render-page", error, { pathname });
4152
4307
  }
4153
4308
  if (rendererDisabled && !res.headersSent) {
4154
4309
  sendFarmDevErrorJSON(res);
4155
4310
  return;
4156
4311
  }
4157
- if (!res.headersSent) {
4158
- res.setHeader("Content-Type", "text/html; charset=utf-8");
4159
- res.setHeader("Cache-Control", "private, no-store");
4160
- }
4161
- next(error);
4312
+ sendDevErrorPage(error);
4162
4313
  }
4163
4314
  })
4164
4315
  );
4165
- const farmRequestMiddleware = _optionalChain([farmMiddlewares, 'access', _327 => _327.stack, 'access', _328 => _328.at, 'call', _329 => _329(-1), 'optionalAccess', _330 => _330.handle]);
4316
+ const farmRequestMiddleware = _optionalChain([farmMiddlewares, 'access', _331 => _331.stack, 'access', _332 => _332.at, 'call', _333 => _333(-1), 'optionalAccess', _334 => _334.handle]);
4166
4317
  if (farmOwnsDevCors && viteServer.config.server.cors === false) {
4167
4318
  farmMiddlewares.use(createFarmDevViteCorsMiddleware());
4168
4319
  }
@@ -4184,6 +4335,16 @@ window.__FARM_MANIFEST__ = ${inlineValue({
4184
4335
  };
4185
4336
  },
4186
4337
  async resolveId(id, importer, resolveOptions) {
4338
+ if (id.startsWith("@farm.js/core/internal/") && importer) {
4339
+ const root = _optionalChain([farmApp, 'optionalAccess', _335 => _335.getConfig, 'call', _336 => _336(), 'access', _337 => _337.root]) || _optionalChain([server, 'optionalAccess', _338 => _338.config, 'access', _339 => _339.root]) || options.root;
4340
+ const relative4 = root ? path6.relative(root, importer.split("?", 1)[0]) : "";
4341
+ if (root && (relative4.startsWith("..") || path6.isAbsolute(relative4))) {
4342
+ return this.resolve(id, path6.join(root, "package.json"), {
4343
+ ...resolveOptions,
4344
+ skipSelf: true
4345
+ });
4346
+ }
4347
+ }
4187
4348
  if (typeof fontImports.resolveId === "function") {
4188
4349
  const fontId = await fontImports.resolveId.call(this, id, importer, resolveOptions);
4189
4350
  if (fontId) return fontId;
@@ -4206,7 +4367,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
4206
4367
  }
4207
4368
  },
4208
4369
  async load(id, loadOptions) {
4209
- if (pendingClientSetup && !_optionalChain([loadOptions, 'optionalAccess', _331 => _331.ssr]) && !farmSetupContext.getStore()) {
4370
+ if (pendingClientSetup && !_optionalChain([loadOptions, 'optionalAccess', _340 => _340.ssr]) && !farmSetupContext.getStore()) {
4210
4371
  await pendingClientSetup;
4211
4372
  }
4212
4373
  if (_chunkPIUTGRDIcjs.isFarmServerFnBoundaryId.call(void 0, id) && islandsServerFns()) {
@@ -4224,8 +4385,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
4224
4385
  if (imageModule) return imageModule;
4225
4386
  }
4226
4387
  if (_chunkE7QOEV5Zcjs.parseProgrammaticRouteModuleId.call(void 0, id)) {
4227
- const renderer = _optionalChain([farmApp, 'optionalAccess', _332 => _332.getConfig, 'call', _333 => _333(), 'access', _334 => _334.renderer]) || _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, options.renderer);
4228
- const root = _optionalChain([server, 'optionalAccess', _335 => _335.config, 'access', _336 => _336.root]) || options.root;
4388
+ const renderer = _optionalChain([farmApp, 'optionalAccess', _341 => _341.getConfig, 'call', _342 => _342(), 'access', _343 => _343.renderer]) || _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, options.renderer);
4389
+ const root = _optionalChain([server, 'optionalAccess', _344 => _344.config, 'access', _345 => _345.root]) || options.root;
4229
4390
  if (isClientEnvironment(this, loadOptions)) {
4230
4391
  return generateProgrammaticClientRouteModuleForId(
4231
4392
  id,
@@ -4241,21 +4402,21 @@ window.__FARM_MANIFEST__ = ${inlineValue({
4241
4402
  return FARM_DEV_CLIENT_BOOT_MODULE;
4242
4403
  }
4243
4404
  if (isFarmClientVirtualId(id)) {
4244
- const resolvedConfig = _optionalChain([farmApp, 'optionalAccess', _337 => _337.getConfig, 'call', _338 => _338()]);
4245
- const renderer = _optionalChain([resolvedConfig, 'optionalAccess', _339 => _339.renderer]) || _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, options.renderer);
4246
- const integrations = _optionalChain([resolvedConfig, 'optionalAccess', _340 => _340.integrations]) || options.integrations;
4247
- const root = _optionalChain([resolvedConfig, 'optionalAccess', _341 => _341.root]) || _optionalChain([server, 'optionalAccess', _342 => _342.config, 'access', _343 => _343.root]) || process.cwd();
4248
- const docs = _optionalChain([resolvedConfig, 'optionalAccess', _344 => _344.docs]);
4405
+ const resolvedConfig = _optionalChain([farmApp, 'optionalAccess', _346 => _346.getConfig, 'call', _347 => _347()]);
4406
+ const renderer = _optionalChain([resolvedConfig, 'optionalAccess', _348 => _348.renderer]) || _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, options.renderer);
4407
+ const integrations = _optionalChain([resolvedConfig, 'optionalAccess', _349 => _349.integrations]) || options.integrations;
4408
+ const root = _optionalChain([resolvedConfig, 'optionalAccess', _350 => _350.root]) || _optionalChain([server, 'optionalAccess', _351 => _351.config, 'access', _352 => _352.root]) || process.cwd();
4409
+ const docs = _optionalChain([resolvedConfig, 'optionalAccess', _353 => _353.docs]);
4249
4410
  const adapterOwnsDocsRuntime = Boolean(
4250
- _chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([docs, 'optionalAccess', _345 => _345.adapter, 'optionalAccess', _346 => _346.server]) && docs.adapter.react
4411
+ _chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([docs, 'optionalAccess', _354 => _354.adapter, 'optionalAccess', _355 => _355.server]) && docs.adapter.react
4251
4412
  );
4252
- const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _347 => _347.devtools]), () => ( _chunkSTF6VDYQcjs.resolveFarmDevtoolsConfig.call(void 0, false, "production")));
4413
+ const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _356 => _356.devtools]), () => ( _chunkSTF6VDYQcjs.resolveFarmDevtoolsConfig.call(void 0, false, "production")));
4253
4414
  const [docsRuntime, docsSearchRuntime, devtoolsClientRuntime] = await Promise.all([
4254
- _optionalChain([docs, 'optionalAccess', _348 => _348.enabled]) ? loadFarmDocsDevRuntime() : null,
4255
- _optionalChain([docs, 'optionalAccess', _349 => _349.enabled]) && !adapterOwnsDocsRuntime ? loadFarmDocsSearchDevRuntime() : null,
4415
+ _optionalChain([docs, 'optionalAccess', _357 => _357.enabled]) ? loadFarmDocsDevRuntime() : null,
4416
+ _optionalChain([docs, 'optionalAccess', _358 => _358.enabled]) && !adapterOwnsDocsRuntime ? loadFarmDocsSearchDevRuntime() : null,
4256
4417
  devtools.enabled ? loadFarmDevtoolsClientRuntime() : null
4257
4418
  ]);
4258
- const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess', _350 => _350.isFarmDocsSearchEnabled, 'call', _351 => _351(docs)]), () => ( false));
4419
+ const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess', _359 => _359.isFarmDocsSearchEnabled, 'call', _360 => _360(docs)]), () => ( false));
4259
4420
  const generatedDocsSearchRuntime = docsSearchRuntime ? docsSearchRuntime.generateFarmDocsSearchClientRuntime(
4260
4421
  docsSearchEnabled,
4261
4422
  docsSearchEnabled ? docsSearchRuntime.resolveFarmDocsSearchClientModule(root) : void 0
@@ -4263,10 +4424,10 @@ window.__FARM_MANIFEST__ = ${inlineValue({
4263
4424
  const generatedDevtoolsClientRuntime = devtoolsClientRuntime ? devtoolsClientRuntime.generateFarmDevtoolsClientRuntime(devtools) : "";
4264
4425
  const generatedDevIndicatorsClientRuntime = farmApp ? _chunkUVV3I5QAcjs.generateFarmDevIndicatorsClientRuntime.call(void 0, farmApp.getConfig().devIndicators) : "";
4265
4426
  const integrationProviders = _chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) ? _chunkBDYM2TN3cjs.getIntegrationProviders.call(void 0, integrations) : [];
4266
- const isolatedHydrationMode = _chunk4DRINDGNcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
4267
- _optionalChain([resolvedConfig, 'optionalAccess', _352 => _352.experimental, 'optionalAccess', _353 => _353.isolatedClientHydration]),
4427
+ const isolatedHydrationMode = _chunkVO65MYJDcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
4428
+ _optionalChain([resolvedConfig, 'optionalAccess', _361 => _361.experimental, 'optionalAccess', _362 => _362.isolatedClientHydration]),
4268
4429
  {
4269
- serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess', _354 => _354.experimental, 'optionalAccess', _355 => _355.serverComponents])) === "rsc",
4430
+ serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess', _363 => _363.experimental, 'optionalAccess', _364 => _364.serverComponents])) === "rsc",
4270
4431
  hasUnsupportedIntegrationProvider: integrationProviders.filter((provider) => provider.component || provider.type === "clerk").some((provider) => provider.supportsIsolatedHydration !== true)
4271
4432
  }
4272
4433
  );
@@ -4274,32 +4435,32 @@ window.__FARM_MANIFEST__ = ${inlineValue({
4274
4435
  integrationProviders,
4275
4436
  [
4276
4437
  ..._chunkBDYM2TN3cjs.getIntegrationDocumentNavigationMatchers.call(void 0, integrations),
4277
- ..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess', _356 => _356.getFarmDocsDocumentNavigationMatchers, 'call', _357 => _357(docs)]), () => ( []))
4438
+ ..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess', _365 => _365.getFarmDocsDocumentNavigationMatchers, 'call', _366 => _366(docs)]), () => ( []))
4278
4439
  ],
4279
4440
  generatedDocsSearchRuntime,
4280
4441
  `${generatedDevtoolsClientRuntime}
4281
4442
  ${generatedDevIndicatorsClientRuntime}`,
4282
- _optionalChain([resolvedConfig, 'optionalAccess', _358 => _358.plugins]) || [],
4443
+ _optionalChain([resolvedConfig, 'optionalAccess', _367 => _367.plugins]) || [],
4283
4444
  root,
4284
- _optionalChain([resolvedConfig, 'optionalAccess', _359 => _359.srcDir]) || options.srcDir || "src",
4285
- _optionalChain([resolvedConfig, 'optionalAccess', _360 => _360.publicRuntimeConfig]) || options.publicRuntimeConfig,
4286
- _chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) ? _optionalChain([docs, 'optionalAccess', _361 => _361.adapter, 'optionalAccess', _362 => _362.react]) : void 0,
4445
+ _optionalChain([resolvedConfig, 'optionalAccess', _368 => _368.srcDir]) || options.srcDir || "src",
4446
+ _optionalChain([resolvedConfig, 'optionalAccess', _369 => _369.publicRuntimeConfig]) || options.publicRuntimeConfig,
4447
+ _chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) ? _optionalChain([docs, 'optionalAccess', _370 => _370.adapter, 'optionalAccess', _371 => _371.react]) : void 0,
4287
4448
  renderer,
4288
- isolatedHydrationMode === "enabled" || _chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([(_nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _363 => _363.getRouteManager, 'call', _364 => _364(), 'access', _365 => _365.getIsolatedClientBoundaryModules, 'call', _366 => _366(root)])))), 'optionalAccess', _367 => _367.size]) > 0,
4289
- _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _368 => _368.trailingSlash]), () => ( false)),
4290
- _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _369 => _369.basePath]), () => ( "/")),
4291
- _chunkN5DQMOAGcjs.generateClientCachePersistenceCode.call(void 0,
4292
- _chunkN5DQMOAGcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, _optionalChain([resolvedConfig, 'optionalAccess', _370 => _370.cache]))
4449
+ isolatedHydrationMode === "enabled" || _chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([(_nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _372 => _372.getRouteManager, 'call', _373 => _373(), 'access', _374 => _374.getIsolatedClientBoundaryModules, 'call', _375 => _375(root)])))), 'optionalAccess', _376 => _376.size]) > 0,
4450
+ _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _377 => _377.trailingSlash]), () => ( false)),
4451
+ _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _378 => _378.basePath]), () => ( "/")),
4452
+ _chunkDHR2WDSLcjs.generateClientCachePersistenceCode.call(void 0,
4453
+ _chunkDHR2WDSLcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, _optionalChain([resolvedConfig, 'optionalAccess', _379 => _379.cache]))
4293
4454
  ),
4294
4455
  _chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) ? _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, docs) : void 0,
4295
- _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess', _371 => _371.experimental, 'optionalAccess', _372 => _372.serverComponents])) === "islands"
4456
+ _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([resolvedConfig, 'optionalAccess', _380 => _380.experimental, 'optionalAccess', _381 => _381.serverComponents])) === "islands"
4296
4457
  );
4297
4458
  }
4298
4459
  if (id === "/@farm/server") {
4299
4460
  return generateServerCode();
4300
4461
  }
4301
4462
  if (id === "/@farm/manifest") {
4302
- const routeManager = _optionalChain([farmApp, 'optionalAccess', _373 => _373.getRouteManager, 'call', _374 => _374()]);
4463
+ const routeManager = _optionalChain([farmApp, 'optionalAccess', _382 => _382.getRouteManager, 'call', _383 => _383()]);
4303
4464
  if (!routeManager) {
4304
4465
  return `
4305
4466
  export const getManifest = () => ({
@@ -4312,9 +4473,9 @@ export const getManifest = () => ({
4312
4473
  `;
4313
4474
  }
4314
4475
  const manifest = routeManager.generateClientManifest(server.config.root);
4315
- const globalStylesheetHref = _chunkN5DQMOAGcjs.resolveDevGlobalStylesheetHref.call(void 0,
4476
+ const globalStylesheetHref = _chunkDHR2WDSLcjs.resolveDevGlobalStylesheetHref.call(void 0,
4316
4477
  server.config.root,
4317
- _optionalChain([farmApp, 'optionalAccess', _375 => _375.getConfig, 'call', _376 => _376(), 'access', _377 => _377.srcDir])
4478
+ _optionalChain([farmApp, 'optionalAccess', _384 => _384.getConfig, 'call', _385 => _385(), 'access', _386 => _386.srcDir])
4318
4479
  );
4319
4480
  const fullManifest = {
4320
4481
  clientEntry: "/@farm/client.js",
@@ -4370,54 +4531,54 @@ export const manifest = getManifest();
4370
4531
  }
4371
4532
  },
4372
4533
  async transform(code, id, transformOptions) {
4373
- if (pendingClientSetup && !_optionalChain([transformOptions, 'optionalAccess', _378 => _378.ssr]) && !farmSetupContext.getStore()) {
4534
+ if (pendingClientSetup && !_optionalChain([transformOptions, 'optionalAccess', _387 => _387.ssr]) && !farmSetupContext.getStore()) {
4374
4535
  await pendingClientSetup;
4375
4536
  }
4376
- const actionConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _379 => _379.getConfig, 'call', _380 => _380()]), () => ( options));
4537
+ const actionConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _388 => _388.getConfig, 'call', _389 => _389()]), () => ( options));
4377
4538
  let rewrotePackageImports = false;
4378
- if (_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([actionConfig, 'access', _381 => _381.experimental, 'optionalAccess', _382 => _382.serverComponents])) === "islands" && (!id.includes("/node_modules/") || _optionalChain([transformOptions, 'optionalAccess', _383 => _383.ssr]) === true && farmReactServerFiles.has(id.split("?", 1)[0])) && !id.startsWith("\0") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id) && !_chunk4DRINDGNcjs.hasUseClientDirective.call(void 0, code)) {
4539
+ if (_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([actionConfig, 'access', _390 => _390.experimental, 'optionalAccess', _391 => _391.serverComponents])) === "islands" && (!id.includes("/node_modules/") || _optionalChain([transformOptions, 'optionalAccess', _392 => _392.ssr]) === true && farmReactServerFiles.has(id.split("?", 1)[0])) && !id.startsWith("\0") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id) && !_chunkVO65MYJDcjs.hasUseClientDirective.call(void 0, code)) {
4379
4540
  const file = id.split("?", 1)[0];
4380
- const projectRoot = actionConfig.root || _optionalChain([server, 'optionalAccess', _384 => _384.config, 'access', _385 => _385.root]) || process.cwd();
4381
- if (_optionalChain([transformOptions, 'optionalAccess', _386 => _386.ssr]) === true) {
4541
+ const projectRoot = actionConfig.root || _optionalChain([server, 'optionalAccess', _393 => _393.config, 'access', _394 => _394.root]) || process.cwd();
4542
+ if (_optionalChain([transformOptions, 'optionalAccess', _395 => _395.ssr]) === true) {
4382
4543
  if (farmReactServerFiles.has(file)) {
4383
- for (const child of _chunk4DRINDGNcjs.farmRelativeImportFiles.call(void 0, code, file))
4544
+ for (const child of _chunkVO65MYJDcjs.farmRelativeImportFiles.call(void 0, code, file))
4384
4545
  farmReactServerFiles.add(child);
4385
4546
  }
4386
- const serverModule = farmReactServerFiles.has(file) || !_chunk4DRINDGNcjs.getFarmClientReachableModules.call(void 0,
4547
+ const serverModule = farmReactServerFiles.has(file) || !_chunkVO65MYJDcjs.getFarmClientReachableModules.call(void 0,
4387
4548
  path6.resolve(projectRoot, actionConfig.srcDir || "src"),
4388
4549
  projectRoot
4389
4550
  ).has(path6.resolve(file));
4390
- const reactServer = !serverModule ? null : _chunk4DRINDGNcjs.rewriteFarmReactServerImports.call(void 0, {
4551
+ const reactServer = !serverModule ? null : _chunkVO65MYJDcjs.rewriteFarmReactServerImports.call(void 0, {
4391
4552
  code,
4392
4553
  file,
4393
- reference: (specifier, exportName) => _chunk4DRINDGNcjs.ensureFarmPackageClientReference.call(void 0, projectRoot, specifier, exportName),
4554
+ reference: (specifier, exportName) => _chunkVO65MYJDcjs.ensureFarmPackageClientReference.call(void 0, projectRoot, specifier, exportName, file),
4394
4555
  onServerFile: (serverFile) => farmReactServerFiles.add(serverFile)
4395
4556
  });
4396
4557
  if (reactServer !== null) {
4397
4558
  code = reactServer;
4398
4559
  rewrotePackageImports = true;
4399
4560
  }
4400
- const internal = farmReactServerFiles.has(file) ? _chunk4DRINDGNcjs.rewriteFarmReactServerClientModuleImports.call(void 0, {
4561
+ const internal = farmReactServerFiles.has(file) ? _chunkVO65MYJDcjs.rewriteFarmReactServerClientModuleImports.call(void 0, {
4401
4562
  code,
4402
4563
  file,
4403
- reference: (clientFile) => _chunk4DRINDGNcjs.ensureFarmInternalClientReference.call(void 0, projectRoot, clientFile)
4564
+ reference: (clientFile) => _chunkVO65MYJDcjs.ensureFarmInternalClientReference.call(void 0, projectRoot, clientFile)
4404
4565
  }) : null;
4405
4566
  if (internal !== null) {
4406
4567
  code = internal;
4407
4568
  rewrotePackageImports = true;
4408
4569
  }
4409
4570
  }
4410
- const referenced = _chunk4DRINDGNcjs.rewriteFarmPackageClientImports.call(void 0, {
4571
+ const referenced = _chunkVO65MYJDcjs.rewriteFarmPackageClientImports.call(void 0, {
4411
4572
  code,
4412
4573
  file,
4413
4574
  root: projectRoot,
4414
- isClientPackage: (specifier) => _chunk4DRINDGNcjs.isFarmPackageClientBoundary.call(void 0, file, specifier, projectRoot)
4575
+ isClientPackage: (specifier) => _chunkVO65MYJDcjs.isFarmPackageClientBoundary.call(void 0, file, specifier, projectRoot)
4415
4576
  });
4416
4577
  if (referenced !== null) {
4417
4578
  code = referenced;
4418
4579
  rewrotePackageImports = true;
4419
4580
  }
4420
- if (_optionalChain([transformOptions, 'optionalAccess', _387 => _387.ssr]) === true) {
4581
+ if (_optionalChain([transformOptions, 'optionalAccess', _396 => _396.ssr]) === true) {
4421
4582
  const cached = rewriteFarmReactCacheImport(code, file);
4422
4583
  if (cached !== null) {
4423
4584
  code = cached;
@@ -4427,43 +4588,43 @@ export const manifest = getManifest();
4427
4588
  }
4428
4589
  if (islandsServerFns() && !_chunkPIUTGRDIcjs.isFarmServerFnBoundaryId.call(void 0, id) && !id.includes("/node_modules/") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id)) {
4429
4590
  const serverFns = _chunkPIUTGRDIcjs.transformFarmServerFns.call(void 0, code, id, {
4430
- environment: _optionalChain([transformOptions, 'optionalAccess', _388 => _388.ssr]) === true ? "rsc" : "client"
4591
+ environment: _optionalChain([transformOptions, 'optionalAccess', _397 => _397.ssr]) === true ? "rsc" : "client"
4431
4592
  });
4432
4593
  if (serverFns) {
4433
4594
  if (!serverFns.code.includes("use server")) return { code: serverFns.code, map: null };
4434
4595
  code = serverFns.code;
4435
4596
  }
4436
4597
  }
4437
- if (_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([actionConfig, 'access', _389 => _389.experimental, 'optionalAccess', _390 => _390.serverComponents])) === "islands" && code.includes("use server") && !id.includes("/node_modules/") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id)) {
4598
+ if (_chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([actionConfig, 'access', _398 => _398.experimental, 'optionalAccess', _399 => _399.serverComponents])) === "islands" && code.includes("use server") && !id.includes("/node_modules/") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id)) {
4438
4599
  const file = id.split("?", 1)[0];
4439
4600
  const actionModule = transformFarmFormActionModule({
4440
4601
  code,
4441
4602
  id,
4442
- root: actionConfig.root || _optionalChain([server, 'optionalAccess', _391 => _391.config, 'access', _392 => _392.root]) || process.cwd(),
4443
- ssr: _optionalChain([transformOptions, 'optionalAccess', _393 => _393.ssr]) === true,
4603
+ root: actionConfig.root || _optionalChain([server, 'optionalAccess', _400 => _400.config, 'access', _401 => _401.root]) || process.cwd(),
4604
+ ssr: _optionalChain([transformOptions, 'optionalAccess', _402 => _402.ssr]) === true,
4444
4605
  // Parsed by file type: page components are TSX.
4445
4606
  parse: (source) => _vite.parseSync.call(void 0, file, source).program
4446
4607
  });
4447
4608
  if (actionModule) return { code: actionModule, map: null };
4448
4609
  }
4449
- if (!_optionalChain([transformOptions, 'optionalAccess', _394 => _394.ssr])) {
4450
- const docsConfigModule = _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, _optionalChain([farmApp, 'optionalAccess', _395 => _395.getConfig, 'call', _396 => _396(), 'optionalAccess', _397 => _397.docs]));
4451
- if (_chunkN5DQMOAGcjs.isFarmDocsClientConfigModule.call(void 0, id, docsConfigModule)) {
4452
- const redacted = _chunkN5DQMOAGcjs.redactFarmDocsClientConfig.call(void 0, code, id.split("?")[0]);
4610
+ if (!_optionalChain([transformOptions, 'optionalAccess', _403 => _403.ssr])) {
4611
+ const docsConfigModule = _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, _optionalChain([farmApp, 'optionalAccess', _404 => _404.getConfig, 'call', _405 => _405(), 'optionalAccess', _406 => _406.docs]));
4612
+ if (_chunkDHR2WDSLcjs.isFarmDocsClientConfigModule.call(void 0, id, docsConfigModule)) {
4613
+ const redacted = _chunkDHR2WDSLcjs.redactFarmDocsClientConfig.call(void 0, code, id.split("?")[0]);
4453
4614
  if (redacted !== null) return { code: redacted, map: null };
4454
4615
  }
4455
4616
  }
4456
- if (!_optionalChain([transformOptions, 'optionalAccess', _398 => _398.ssr])) {
4457
- const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _399 => _399.getConfig, 'call', _400 => _400()]), () => ( options));
4458
- if ((_optionalChain([currentConfig, 'access', _401 => _401.experimental, 'optionalAccess', _402 => _402.serverActions]) !== true || !serverFnTransformActive) && !islandsServerFns()) {
4617
+ if (!_optionalChain([transformOptions, 'optionalAccess', _407 => _407.ssr])) {
4618
+ const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _408 => _408.getConfig, 'call', _409 => _409()]), () => ( options));
4619
+ if ((_optionalChain([currentConfig, 'access', _410 => _410.experimental, 'optionalAccess', _411 => _411.serverActions]) !== true || !serverFnTransformActive) && !islandsServerFns()) {
4459
4620
  const violation = findClientServerFnViolation(code, id);
4460
4621
  if (violation) {
4461
4622
  this.error(formatServerFnBoundaryError(violation, id));
4462
4623
  }
4463
4624
  }
4464
4625
  }
4465
- if (!_optionalChain([transformOptions, 'optionalAccess', _403 => _403.ssr]) && shouldInspectClientBoundary(id, code)) {
4466
- warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _404 => _404.getConfig, 'call', _405 => _405()]), () => ( options)));
4626
+ if (!_optionalChain([transformOptions, 'optionalAccess', _412 => _412.ssr]) && shouldInspectClientBoundary(id, code)) {
4627
+ warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _413 => _413.getConfig, 'call', _414 => _414()]), () => ( options)));
4467
4628
  }
4468
4629
  if (typeof imageImports.transform === "function") {
4469
4630
  const imageModule = await imageImports.transform.call(this, code, id, transformOptions);
@@ -4478,13 +4639,13 @@ export const manifest = getManifest();
4478
4639
  id,
4479
4640
  transformOptions
4480
4641
  );
4481
- const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess', _406 => _406.code, 'optionalAccess', _407 => _407.toString, 'call', _408 => _408()]);
4642
+ const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess', _415 => _415.code, 'optionalAccess', _416 => _416.toString, 'call', _417 => _417()]);
4482
4643
  if (fontCode) {
4483
4644
  transformedCode = fontCode;
4484
4645
  transformed = true;
4485
4646
  }
4486
4647
  }
4487
- if (_optionalChain([transformOptions, 'optionalAccess', _409 => _409.ssr]) && server) {
4648
+ if (_optionalChain([transformOptions, 'optionalAccess', _418 => _418.ssr]) && server) {
4488
4649
  const rewrittenImports = rewriteEarlySsrRelativeImports({
4489
4650
  code: transformedCode,
4490
4651
  id,
@@ -4496,26 +4657,26 @@ export const manifest = getManifest();
4496
4657
  transformed = true;
4497
4658
  }
4498
4659
  }
4499
- if (_chunk4DRINDGNcjs.hasUseClientDirective.call(void 0, transformedCode)) {
4660
+ if (_chunkVO65MYJDcjs.hasUseClientDirective.call(void 0, transformedCode)) {
4500
4661
  const clientBoundarySource = transformedCode;
4501
4662
  const moduleInfo = this.getModuleInfo(id);
4502
4663
  if (moduleInfo) {
4503
4664
  moduleInfo.isClientComponent = true;
4504
4665
  }
4505
- transformedCode = _chunk4DRINDGNcjs.stripUseClientDirective.call(void 0, transformedCode);
4666
+ transformedCode = _chunkVO65MYJDcjs.stripUseClientDirective.call(void 0, transformedCode);
4506
4667
  transformed = true;
4507
- const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _410 => _410.getConfig, 'call', _411 => _411()]), () => ( options));
4668
+ const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _419 => _419.getConfig, 'call', _420 => _420()]), () => ( options));
4508
4669
  let isolatedModuleReference = null;
4509
- const root = currentConfig.root || _optionalChain([server, 'optionalAccess', _412 => _412.config, 'access', _413 => _413.root]) || process.cwd();
4670
+ const root = currentConfig.root || _optionalChain([server, 'optionalAccess', _421 => _421.config, 'access', _422 => _422.root]) || process.cwd();
4510
4671
  const cleanId = id.split("?", 1)[0];
4511
- const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _414 => _414.getRouteManager, 'call', _415 => _415(), 'access', _416 => _416.getIsolatedClientBoundaryModules, 'call', _417 => _417(root)])));
4512
- const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess', _418 => _418.has, 'call', _419 => _419(path6.resolve(cleanId))]) === true;
4513
- if (_chunk67MZTLTFcjs.isReactRenderer.call(void 0, _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, currentConfig.renderer)) && selectedForIsolatedHydration && (_chunk4DRINDGNcjs.isIsolatableClientBoundarySource.call(void 0, clientBoundarySource) || // A generated client reference, whose marker comment compiled TSX no longer has.
4514
- cleanId.replace(/\\/g, "/").includes(_chunk4DRINDGNcjs.FARM_CLIENT_REFERENCE_DIRECTORY))) {
4672
+ const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _423 => _423.getRouteManager, 'call', _424 => _424(), 'access', _425 => _425.getIsolatedClientBoundaryModules, 'call', _426 => _426(root)])));
4673
+ const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess', _427 => _427.has, 'call', _428 => _428(path6.resolve(cleanId))]) === true;
4674
+ if (_chunk67MZTLTFcjs.isReactRenderer.call(void 0, _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, currentConfig.renderer)) && selectedForIsolatedHydration && (_chunkVO65MYJDcjs.isIsolatableClientBoundarySource.call(void 0, clientBoundarySource) || // A generated client reference, whose marker comment compiled TSX no longer has.
4675
+ cleanId.replace(/\\/g, "/").includes(_chunkVO65MYJDcjs.FARM_CLIENT_REFERENCE_DIRECTORY))) {
4515
4676
  isolatedModuleReference = _chunkQMNWKQL4cjs.toViteModuleId.call(void 0, cleanId, root);
4516
- const islandsMode = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([currentConfig, 'access', _420 => _420.experimental, 'optionalAccess', _421 => _421.serverComponents])) === "islands";
4517
- const explicitStrategy = _chunk4DRINDGNcjs.getIslandStrategyExport.call(void 0, clientBoundarySource);
4518
- const inference = islandsMode && explicitStrategy === null ? _chunkN5DQMOAGcjs.inferFarmIslandStrategy.call(void 0, cleanId, root) : null;
4677
+ const islandsMode = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([currentConfig, 'access', _429 => _429.experimental, 'optionalAccess', _430 => _430.serverComponents])) === "islands";
4678
+ const explicitStrategy = _chunkVO65MYJDcjs.getIslandStrategyExport.call(void 0, clientBoundarySource);
4679
+ const inference = islandsMode && explicitStrategy === null ? _chunkDHR2WDSLcjs.inferFarmIslandStrategy.call(void 0, cleanId, root) : null;
4519
4680
  if (inference) {
4520
4681
  for (const file of inference.files) {
4521
4682
  if (file !== path6.resolve(cleanId)) this.addWatchFile(file);
@@ -4528,8 +4689,8 @@ export const manifest = getManifest();
4528
4689
  islandStrategy: _nullishCoalesce(explicitStrategy, () => ( "load")),
4529
4690
  parse: (source) => this.parse(source),
4530
4691
  slots: islandsMode,
4531
- browser: _optionalChain([transformOptions, 'optionalAccess', _422 => _422.ssr]) !== true,
4532
- inferredInteraction: _optionalChain([inference, 'optionalAccess', _423 => _423.strategy]) === "interaction"
4692
+ browser: _optionalChain([transformOptions, 'optionalAccess', _431 => _431.ssr]) !== true,
4693
+ inferredInteraction: _optionalChain([inference, 'optionalAccess', _432 => _432.strategy]) === "interaction"
4533
4694
  });
4534
4695
  if (!transformedBoundary) {
4535
4696
  this.error(
@@ -4559,7 +4720,7 @@ export const manifest = getManifest();
4559
4720
  );
4560
4721
  return;
4561
4722
  }` : "";
4562
- const hmrCode = _optionalChain([transformOptions, 'optionalAccess', _424 => _424.ssr]) || reactRefreshActive || !shouldEmitFarmClientRootHmr(currentConfig.renderer) ? "" : `
4723
+ const hmrCode = _optionalChain([transformOptions, 'optionalAccess', _433 => _433.ssr]) || reactRefreshActive || !shouldEmitFarmClientRootHmr(currentConfig.renderer) ? "" : `
4563
4724
  if (import.meta.hot) {
4564
4725
  import.meta.hot.accept((newModule) => {
4565
4726
  ${isolatedHmrUpdate}
@@ -4615,14 +4776,14 @@ if (import.meta.hot) {
4615
4776
  }
4616
4777
  _chunkQMNWKQL4cjs.logger.info(`Found ${ssgPages.length} SSG pages, ${ssrRoutes.length} SSR routes`);
4617
4778
  _chunkQMNWKQL4cjs.logger.info("Pre-rendering SSG pages...");
4618
- const outDir = path6.join(_optionalChain([server, 'optionalAccess', _425 => _425.config, 'access', _426 => _426.root]) || process.cwd(), options.outDir || "dist");
4779
+ const outDir = path6.join(_optionalChain([server, 'optionalAccess', _434 => _434.config, 'access', _435 => _435.root]) || process.cwd(), options.outDir || "dist");
4619
4780
  const clientDir = path6.join(outDir, "client");
4620
4781
  for (const page of ssgPages) {
4621
4782
  try {
4622
4783
  const staticRequest = new Request(new URL(page.urlPath, "http://farm.static"));
4623
4784
  await farmApp.getServerRenderer().runWithRequestContext(staticRequest, async () => {
4624
4785
  const mod = await routeManager.loadRouteModule(page.filePath);
4625
- if (!_optionalChain([mod, 'optionalAccess', _427 => _427.default])) return;
4786
+ if (!_optionalChain([mod, 'optionalAccess', _436 => _436.default])) return;
4626
4787
  const { layouts } = routeManager.matchRoute(page.urlPath);
4627
4788
  const layoutModules = await Promise.all(
4628
4789
  layouts.map((l) => routeManager.loadLayoutModule(l.modulePath))
@@ -4654,7 +4815,7 @@ if (import.meta.hot) {
4654
4815
  const i18nSnapshot = _chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0, );
4655
4816
  const i18nHead = renderFarmI18nStaticHead(page.urlPath, i18nSnapshot);
4656
4817
  const fullHtml = `<!DOCTYPE html>
4657
- <html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess', _428 => _428.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}>
4818
+ <html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess', _437 => _437.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}>
4658
4819
  <head>
4659
4820
  <meta charset="utf-8">
4660
4821
  <meta name="viewport" content="width=device-width, initial-scale=1">
@@ -4697,8 +4858,8 @@ if (import.meta.hot) {
4697
4858
  }
4698
4859
  },
4699
4860
  watchChange() {
4700
- _chunk4DRINDGNcjs.invalidateFarmClientReachableModules.call(void 0, );
4701
- _chunk4DRINDGNcjs.invalidateFarmClientOnlyScan.call(void 0, );
4861
+ _chunkVO65MYJDcjs.invalidateFarmClientReachableModules.call(void 0, );
4862
+ _chunkVO65MYJDcjs.invalidateFarmClientOnlyScan.call(void 0, );
4702
4863
  },
4703
4864
  async handleHotUpdate(ctx) {
4704
4865
  if (pendingClientSetup && !farmSetupContext.getStore()) await pendingClientSetup;
@@ -4723,23 +4884,23 @@ if (import.meta.hot) {
4723
4884
  server2.moduleGraph.invalidateModule(mod);
4724
4885
  }
4725
4886
  }
4726
- const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess', _429 => _429.getConfig, 'call', _430 => _430()]);
4887
+ const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess', _438 => _438.getConfig, 'call', _439 => _439()]);
4727
4888
  const normalizedFile = file.replace(/\\/g, "/");
4728
- if (currentFarmConfig && /\/route\.(?:ts|tsx|js|jsx)$/.test(normalizedFile) && _chunk5Y2P454Ocjs.getFarmAppDirectories.call(void 0, currentFarmConfig).some(
4889
+ if (currentFarmConfig && /\/route\.(?:ts|tsx|js|jsx)$/.test(normalizedFile) && _chunkMTBDJ326cjs.getFarmAppDirectories.call(void 0, currentFarmConfig).some(
4729
4890
  (appDir) => normalizedFile.startsWith(`${_chunkQMNWKQL4cjs.toPosixPath.call(void 0, appDir)}/api/`)
4730
4891
  )) {
4731
4892
  for (const mod of modules) server2.moduleGraph.invalidateModule(mod);
4732
- await _optionalChain([refreshRouteDiscovery, 'optionalCall', _431 => _431(`updated ${file}`)]);
4893
+ await _optionalChain([refreshRouteDiscovery, 'optionalCall', _440 => _440(`updated ${file}`)]);
4733
4894
  server2.ws.send({ type: "full-reload", path: "*" });
4734
4895
  return [];
4735
4896
  }
4736
- const currentSrcRoot = currentFarmConfig ? _chunk5Y2P454Ocjs.getFarmSourceRoots.call(void 0, currentFarmConfig).map((source) => path6.join(source.root, source.srcDir).replace(/\\/g, "/")).find((sourceRoot) => normalizedFile.startsWith(`${sourceRoot}/`)) || null : null;
4897
+ const currentSrcRoot = currentFarmConfig ? _chunkMTBDJ326cjs.getFarmSourceRoots.call(void 0, currentFarmConfig).map((source) => path6.join(source.root, source.srcDir).replace(/\\/g, "/")).find((sourceRoot) => normalizedFile.startsWith(`${sourceRoot}/`)) || null : null;
4737
4898
  if (currentSrcRoot && normalizedFile.startsWith(`${currentSrcRoot}/`) && _chunkE7QOEV5Zcjs.isProgrammaticRoutesFileName.call(void 0, normalizedFile)) {
4738
4899
  logUpdate("PAGE", `updated ${path6.basename(file)}`);
4739
4900
  for (const mod of modules) {
4740
4901
  server2.moduleGraph.invalidateModule(mod);
4741
4902
  }
4742
- await _optionalChain([refreshRouteDiscovery, 'optionalCall', _432 => _432(`updated ${file}`)]);
4903
+ await _optionalChain([refreshRouteDiscovery, 'optionalCall', _441 => _441(`updated ${file}`)]);
4743
4904
  server2.ws.send({
4744
4905
  type: "full-reload",
4745
4906
  path: "*"
@@ -4752,7 +4913,7 @@ if (import.meta.hot) {
4752
4913
  for (const mod of modules) {
4753
4914
  server2.moduleGraph.invalidateModule(mod);
4754
4915
  }
4755
- await _optionalChain([refreshRouteDiscovery, 'optionalCall', _433 => _433(`updated ${file}`)]);
4916
+ await _optionalChain([refreshRouteDiscovery, 'optionalCall', _442 => _442(`updated ${file}`)]);
4756
4917
  server2.ws.send({
4757
4918
  type: "full-reload",
4758
4919
  path: "*"
@@ -4760,12 +4921,13 @@ if (import.meta.hot) {
4760
4921
  return [];
4761
4922
  }
4762
4923
  if (apiRouteManager && _chunkJYNNIGQOcjs.invalidateFarmDevDependents.call(void 0, server2, file, apiRouteManager.getSourceFiles()).length > 0) {
4763
- await _optionalChain([refreshRouteDiscovery, 'optionalCall', _434 => _434(`updated ${file}`)]);
4924
+ await _optionalChain([refreshRouteDiscovery, 'optionalCall', _443 => _443(`updated ${file}`)]);
4764
4925
  }
4765
- const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess', _435 => _435.experimental, 'optionalAccess', _436 => _436.isolatedClientHydration]);
4766
- const planRouteManager = _optionalChain([farmApp, 'optionalAccess', _437 => _437.getRouteManager, 'call', _438 => _438()]);
4926
+ const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess', _444 => _444.experimental, 'optionalAccess', _445 => _445.isolatedClientHydration]);
4927
+ const planRouteManager = _optionalChain([farmApp, 'optionalAccess', _446 => _446.getRouteManager, 'call', _447 => _447()]);
4767
4928
  const isHydrationPlanSource = currentSrcRoot !== null && normalizedFile.startsWith(`${currentSrcRoot}/`) && /\.[cm]?[jt]sx?$/.test(normalizedFile);
4768
- const tracksAsyncOwnerIslands = _chunk67MZTLTFcjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess', _439 => _439.renderer])) && planRouteManager !== void 0;
4929
+ const tracksAsyncOwnerIslands = _chunk67MZTLTFcjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess', _448 => _448.renderer])) && planRouteManager !== void 0;
4930
+ let clientPlanCurrent = false;
4769
4931
  if (isHydrationPlanSource && (isolatedHydrationMode === "enabled" || isolatedHydrationMode === "analyze" || tracksAsyncOwnerIslands)) {
4770
4932
  const routeManager = planRouteManager;
4771
4933
  if (routeManager) {
@@ -4800,6 +4962,7 @@ if (import.meta.hot) {
4800
4962
  server2.ws.send({ type: "full-reload", path: "*" });
4801
4963
  return [];
4802
4964
  }
4965
+ clientPlanCurrent = true;
4803
4966
  } catch (error) {
4804
4967
  _chunkQMNWKQL4cjs.logger.warn(
4805
4968
  `[Farm.js] Could not refresh the client hydration plan after ${file}: ${error instanceof Error ? error.message : String(error)}`
@@ -4825,7 +4988,7 @@ if (import.meta.hot) {
4825
4988
  }
4826
4989
  return [];
4827
4990
  }
4828
- _optionalChain([farmApp, 'optionalAccess', _440 => _440.getRouteManager, 'call', _441 => _441(), 'access', _442 => _442.invalidateClientManifest, 'call', _443 => _443()]);
4991
+ if (!clientPlanCurrent) _optionalChain([farmApp, 'optionalAccess', _449 => _449.getRouteManager, 'call', _450 => _450(), 'access', _451 => _451.invalidateClientManifest, 'call', _452 => _452()]);
4829
4992
  const manifestModule = server2.moduleGraph.getModuleById("/@farm/manifest");
4830
4993
  if (manifestModule) {
4831
4994
  server2.moduleGraph.invalidateModule(manifestModule);
@@ -4929,7 +5092,7 @@ function createPageDataMiddlewareResponse(res) {
4929
5092
  return (...args) => {
4930
5093
  if (captures(target.statusCode, target.getHeader("location"))) {
4931
5094
  const callback = args.find((arg) => typeof arg === "function");
4932
- _optionalChain([callback, 'optionalCall', _444 => _444()]);
5095
+ _optionalChain([callback, 'optionalCall', _453 => _453()]);
4933
5096
  return property === "write" ? true : response;
4934
5097
  }
4935
5098
  return target[property](...args);
@@ -4964,7 +5127,7 @@ async function sendFarmPageDataRedirect(res, redirect, deploymentId) {
4964
5127
  for (const name of ["location", "content-length", "content-type"]) res.removeHeader(name);
4965
5128
  await _chunkYIHRZBD7cjs.sendWebResponse.call(void 0,
4966
5129
  res,
4967
- _chunkF43OG25Pcjs.withFarmDeploymentResponse.call(void 0, _chunkRWR7SMD7cjs.createFarmPageDataRedirectResponse.call(void 0, redirect), deploymentId)
5130
+ _chunkI7J5RLGOcjs.withFarmDeploymentResponse.call(void 0, _chunkRWR7SMD7cjs.createFarmPageDataRedirectResponse.call(void 0, redirect), deploymentId)
4968
5131
  );
4969
5132
  }
4970
5133
  function resolveDevelopmentRoot(farmRoot, viteRoot) {
@@ -4974,7 +5137,7 @@ function resolveDevelopmentRoot(farmRoot, viteRoot) {
4974
5137
  if (fs2.realpathSync(farmRoot) === fs2.realpathSync(viteRoot)) {
4975
5138
  return path6.resolve(viteRoot);
4976
5139
  }
4977
- } catch (e26) {
5140
+ } catch (e27) {
4978
5141
  }
4979
5142
  return farmRoot;
4980
5143
  }
@@ -4993,12 +5156,12 @@ function isFarmClientVirtualId(id) {
4993
5156
  }
4994
5157
  function isClientEnvironment(context, loadOptions) {
4995
5158
  const environment = context.environment;
4996
- if (_optionalChain([environment, 'optionalAccess', _445 => _445.config, 'optionalAccess', _446 => _446.consumer])) return environment.config.consumer === "client";
4997
- if (_optionalChain([environment, 'optionalAccess', _447 => _447.name])) return environment.name === "client";
4998
- return _optionalChain([loadOptions, 'optionalAccess', _448 => _448.ssr]) !== true;
5159
+ if (_optionalChain([environment, 'optionalAccess', _454 => _454.config, 'optionalAccess', _455 => _455.consumer])) return environment.config.consumer === "client";
5160
+ if (_optionalChain([environment, 'optionalAccess', _456 => _456.name])) return environment.name === "client";
5161
+ return _optionalChain([loadOptions, 'optionalAccess', _457 => _457.ssr]) !== true;
4999
5162
  }
5000
5163
  function invalidateProgrammaticClientRouteModules(server) {
5001
- const graph = _optionalChain([server, 'access', _449 => _449.environments, 'optionalAccess', _450 => _450.client, 'optionalAccess', _451 => _451.moduleGraph]);
5164
+ const graph = _optionalChain([server, 'access', _458 => _458.environments, 'optionalAccess', _459 => _459.client, 'optionalAccess', _460 => _460.moduleGraph]);
5002
5165
  if (!graph) return;
5003
5166
  for (const [id, module] of graph.idToModuleMap) {
5004
5167
  if (_chunkE7QOEV5Zcjs.parseProgrammaticRouteModuleId.call(void 0, id)) graph.invalidateModule(module);
@@ -5008,22 +5171,22 @@ function generateProgrammaticClientRouteModuleForId(moduleId, root, renderer, cl
5008
5171
  const parsed = _chunkE7QOEV5Zcjs.parseProgrammaticRouteModuleId.call(void 0, moduleId);
5009
5172
  const routesFile = resolveRealModuleFile(parsed.filePath, root);
5010
5173
  watchFile(routesFile);
5011
- return _chunk4DRINDGNcjs.generateProgrammaticClientRouteModule.call(void 0, {
5174
+ return _chunkVO65MYJDcjs.generateProgrammaticClientRouteModule.call(void 0, {
5012
5175
  kind: parsed.kind,
5013
5176
  routePath: parsed.routePath,
5014
5177
  routesFile,
5015
- route: parsed.kind === "api" ? void 0 : _optionalChain([clientRoutes, 'optionalAccess', _452 => _452.routes, 'access', _453 => _453.get, 'call', _454 => _454(
5016
- _chunk4DRINDGNcjs.programmaticClientRouteKey.call(void 0, routesFile, parsed.kind, parsed.routePath)
5178
+ route: parsed.kind === "api" ? void 0 : _optionalChain([clientRoutes, 'optionalAccess', _461 => _461.routes, 'access', _462 => _462.get, 'call', _463 => _463(
5179
+ _chunkVO65MYJDcjs.programmaticClientRouteKey.call(void 0, routesFile, parsed.kind, parsed.routePath)
5017
5180
  )]),
5018
5181
  rendererServer: renderer.server,
5019
5182
  toImportSpecifier: (file) => toProgrammaticRouteImportSpecifier(file, root)
5020
5183
  });
5021
5184
  }
5022
5185
  function resolveRealModuleFile(filePath, root) {
5023
- const resolved = _nullishCoalesce(_chunk4DRINDGNcjs.resolveModuleSourcePath.call(void 0, filePath, root), () => ( filePath));
5186
+ const resolved = _nullishCoalesce(_chunkVO65MYJDcjs.resolveModuleSourcePath.call(void 0, filePath, root), () => ( filePath));
5024
5187
  try {
5025
5188
  return _chunkQMNWKQL4cjs.toPosixPath.call(void 0, fs2.realpathSync(resolved));
5026
- } catch (e27) {
5189
+ } catch (e28) {
5027
5190
  return _chunkQMNWKQL4cjs.toPosixPath.call(void 0, resolved);
5028
5191
  }
5029
5192
  }
@@ -5334,12 +5497,12 @@ async function parseRouteModuleProps(routeModule, input) {
5334
5497
  }
5335
5498
  const schemas = routeModule.__farmRouteSchemas;
5336
5499
  const params = parseRouteModuleSchema(
5337
- _optionalChain([schemas, 'optionalAccess', _455 => _455.params]),
5500
+ _optionalChain([schemas, 'optionalAccess', _464 => _464.params]),
5338
5501
  input.props.params,
5339
5502
  "params",
5340
5503
  input.routePath
5341
5504
  );
5342
- const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess', _456 => _456.search]), input.search, "search", input.routePath);
5505
+ const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess', _465 => _465.search]), input.search, "search", input.routePath);
5343
5506
  return {
5344
5507
  ...input.props,
5345
5508
  params,
@@ -5359,12 +5522,12 @@ function parseRouteModuleSchema(schema, value, label, routePath) {
5359
5522
  }
5360
5523
  }
5361
5524
  function generateClientCode(integrationProviders = [], documentNavigationMatchers = [], docsSearchClientRuntime = EMPTY_FARM_DOCS_SEARCH_CLIENT_RUNTIME, devtoolsClientRuntime = "", plugins = [], root = process.cwd(), srcDir = "src", publicRuntimeConfig = void 0, docsAdapterReact, renderer = _chunk67MZTLTFcjs.REACT_RENDERER, isolatedHydrationEnabled = false, trailingSlash = false, basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule, islandValues = false) {
5362
- const providerClientCode = _chunkN5DQMOAGcjs.generateFarmIntegrationProviderClientCode.call(void 0,
5525
+ const providerClientCode = _chunkDHR2WDSLcjs.generateFarmIntegrationProviderClientCode.call(void 0,
5363
5526
  integrationProviders,
5364
5527
  root,
5365
5528
  _nullishCoalesce(renderer.componentExtensions, () => ( []))
5366
5529
  );
5367
- const clientPluginEntry = _chunkJSOCDYERcjs.generateFarmClientPluginEntryCode.call(void 0,
5530
+ const clientPluginEntry = _chunkQ4HH5Q6Acjs.generateFarmClientPluginEntryCode.call(void 0,
5368
5531
  plugins,
5369
5532
  root,
5370
5533
  srcDir,
@@ -5412,7 +5575,7 @@ async function createFarmServerTreePageElement(source, pathname) {
5412
5575
  return null;
5413
5576
  }
5414
5577
  }
5415
- ${islandValues ? `${_chunkN5DQMOAGcjs.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE}
5578
+ ${islandValues ? `${_chunkDHR2WDSLcjs.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE}
5416
5579
  let farmLastRouteState = null;
5417
5580
 
5418
5581
  // A hot update to a layout tree's client module renders the route again.
@@ -6223,7 +6386,7 @@ async function loadLayoutComponents(layouts = [], params = {}, source) {
6223
6386
  return loadedLayouts;
6224
6387
  }
6225
6388
 
6226
- ${_chunkN5DQMOAGcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
6389
+ ${_chunkDHR2WDSLcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
6227
6390
  function wrapWithLoadedLayouts(element, loadedLayouts, params) {
6228
6391
  let wrapped = element;
6229
6392
  for (let index = loadedLayouts.length - 1; index >= 0; index--) {
@@ -6508,14 +6671,11 @@ function readActiveLayoutPatterns() {
6508
6671
  .filter(Boolean);
6509
6672
  }
6510
6673
 
6674
+ ${_chunkDHR2WDSLcjs.FARM_NAVIGATION_SCRIPT_SOURCE}
6675
+
6511
6676
  function activateFragmentScripts(root) {
6512
6677
  for (const script of Array.from(root.querySelectorAll?.('script') || [])) {
6513
- const freshScript = document.createElement('script');
6514
- for (const attribute of Array.from(script.attributes)) {
6515
- freshScript.setAttribute(attribute.name, attribute.value);
6516
- }
6517
- freshScript.textContent = script.textContent || '';
6518
- script.replaceWith(freshScript);
6678
+ script.replaceWith(createFarmNavigationScript(script));
6519
6679
  }
6520
6680
  }
6521
6681
 
@@ -6556,7 +6716,13 @@ function getLayoutShell(root, patterns, index, find) {
6556
6716
  : shell.querySelector('#__farm_page__');
6557
6717
  inner?.replaceChildren();
6558
6718
  removeSuspenseContent(shell);
6559
- shell.querySelectorAll('script').forEach((script) => script.remove());
6719
+ // Each island's props stay, without its id, so new props count as a change.
6720
+ shell.querySelectorAll('script').forEach((script) => {
6721
+ if (script.type !== 'f/props') return script.remove();
6722
+ Array.from(script.attributes).forEach((attribute) => {
6723
+ if (attribute.name !== 'type') script.removeAttribute(attribute.name);
6724
+ });
6725
+ });
6560
6726
  shell.querySelectorAll('f-island').forEach((island) => {
6561
6727
  island.replaceChildren();
6562
6728
  Array.from(island.attributes).forEach((attribute) => island.removeAttribute(attribute.name));
@@ -6564,7 +6730,7 @@ function getLayoutShell(root, patterns, index, find) {
6564
6730
  return shell.innerHTML;
6565
6731
  }
6566
6732
 
6567
- function replaceNavigationBoundary(
6733
+ ${islandValues ? _chunkDHR2WDSLcjs.FARM_REFRESH_FIELDS_SOURCE : ""}function replaceNavigationBoundary(
6568
6734
  container,
6569
6735
  fragment,
6570
6736
  currentPatterns,
@@ -6572,6 +6738,8 @@ function replaceNavigationBoundary(
6572
6738
  refresh = false,
6573
6739
  find = findLayoutBoundary,
6574
6740
  ) {
6741
+ // A refresh keeps the islands still on the page: the ones in streamed Suspense content too.
6742
+ if (refresh) revealFarmStreamedContent(fragment);
6575
6743
  let sharedCount = 0;
6576
6744
  while (
6577
6745
  sharedCount < currentPatterns.length &&
@@ -6601,11 +6769,13 @@ function replaceNavigationBoundary(
6601
6769
  activateFragmentScripts(container);
6602
6770
  return container;
6603
6771
  }
6604
-
6772
+ ${islandValues ? `
6773
+ // A refresh renders the same layouts again: their fields keep what was typed, and the focus.
6774
+ const fields = refresh ? captureFarmServerFields(currentTarget) : null;` : ""}
6605
6775
  ${isolatedHydrationEnabled ? `${islandValues ? `// A refresh keeps the islands still on the page, with their state and new props.
6606
6776
  if (refresh) farmIsolatedHydrationRuntime.carryOver(currentTarget, nextTarget);
6607
6777
  ` : ""}disposeFarmIsolatedClientBoundaries(currentTarget);` : ""}
6608
- currentTarget.replaceWith(nextTarget);
6778
+ currentTarget.replaceWith(nextTarget);${islandValues ? "\n if (fields) restoreFarmServerFields(fields, nextTarget);" : ""}
6609
6779
  activateFragmentScripts(nextTarget);
6610
6780
  if (fragmentTreeRoot && fragmentTreeRoot !== nextTarget) fragmentTreeRoot.remove();
6611
6781
 
@@ -6615,7 +6785,17 @@ function replaceNavigationBoundary(
6615
6785
  const support = document.createElement('div');
6616
6786
  support.hidden = true;
6617
6787
  support.dataset.farmFragmentSupport = 'true';
6618
- support.append(fragment);
6788
+ while (fragment.firstChild) {
6789
+ const node = fragment.firstChild;
6790
+ // React's staged Suspense content stays in the root, where a later flush of a streamed
6791
+ // navigation reveals it; React removes it then.
6792
+ if (node.nodeType === 1 && node.matches('div[hidden][id^="S:"]')) {
6793
+ container.appendChild(node);
6794
+ activateFragmentScripts(node);
6795
+ } else {
6796
+ support.appendChild(node);
6797
+ }
6798
+ }
6619
6799
  document.body.appendChild(support);
6620
6800
  activateFragmentScripts(support);
6621
6801
  setTimeout(() => support.remove(), 0);
@@ -6623,7 +6803,7 @@ function replaceNavigationBoundary(
6623
6803
  return nextTarget;
6624
6804
  }
6625
6805
 
6626
- ${islandValues ? `${_chunkN5DQMOAGcjs.FARM_NAVIGATION_STREAM_READER_SOURCE}
6806
+ ${islandValues ? `${_chunkDHR2WDSLcjs.FARM_NAVIGATION_STREAM_READER_SOURCE}
6627
6807
 
6628
6808
  // Islands mode navigates as the production client does: it fetches the page itself, names the
6629
6809
  // layouts it shows by key (F-Layouts), and asks for flush markers (F-Stream), so the shell arrives
@@ -6700,7 +6880,8 @@ async function fetchFarmNavigationDocument(path, context) {
6700
6880
  redirect: 'manual',
6701
6881
  headers: createFarmDeploymentRequestHeaders(deploymentId, {
6702
6882
  Accept: 'text/html',
6703
- ...(context.prefetch ? {} : { 'F-Stream': 'flush' }),
6883
+ // A refresh arrives whole, like a transition: the islands it keeps are all in it.
6884
+ ...(context.prefetch || context.refresh ? {} : { 'F-Stream': 'flush' }),
6704
6885
  ...getFarmIslandValueHeaders(),
6705
6886
  // A prefetch names its layouts even when it keeps none: that marks it as a navigation,
6706
6887
  // which the server answers without loading.tsx.
@@ -7317,10 +7498,10 @@ function generateClientManifest(bundle) {
7317
7498
  return manifest;
7318
7499
  }
7319
7500
  async function defineConfig(config = {}) {
7320
- const tailwindVitePlugin = await _chunkJSOCDYERcjs.loadTailwindVitePlugin.call(void 0, );
7501
+ const tailwindVitePlugin = await _chunkQ4HH5Q6Acjs.loadTailwindVitePlugin.call(void 0, );
7321
7502
  const appRoot = path6.resolve(config.root || process.cwd());
7322
- if (_optionalChain([config, 'access', _457 => _457.extends, 'optionalAccess', _458 => _458.length])) {
7323
- const { config: layeredConfig } = await import("./layers-DMRXRL7F.cjs").then(
7503
+ if (_optionalChain([config, 'access', _466 => _466.extends, 'optionalAccess', _467 => _467.length])) {
7504
+ const { config: layeredConfig } = await import("./layers-7P4RLKVX.cjs").then(
7324
7505
  ({ resolveFarmLayers }) => resolveFarmLayers(config, {
7325
7506
  root: appRoot,
7326
7507
  mode: process.env.NODE_ENV === "production" ? "production" : "development"
@@ -7329,7 +7510,7 @@ async function defineConfig(config = {}) {
7329
7510
  config = layeredConfig;
7330
7511
  }
7331
7512
  config.renderer = _chunk67MZTLTFcjs.resolveFarmRenderer.call(void 0, config.renderer);
7332
- config.images = _chunkN5DQMOAGcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, { root: appRoot, dev: true });
7513
+ config.images = _chunkDHR2WDSLcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, { root: appRoot, dev: true });
7333
7514
  const rendererVitePlugins = await _chunk67MZTLTFcjs.loadFarmRendererVitePlugins.call(void 0, config.renderer, appRoot, {
7334
7515
  ssr: true
7335
7516
  });
@@ -7421,13 +7602,13 @@ async function defineConfig(config = {}) {
7421
7602
  if (!serverStarted) {
7422
7603
  serverStarted = true;
7423
7604
  const elapsed = Date.now() - startTime;
7424
- const address = _optionalChain([server, 'access', _459 => _459.httpServer, 'optionalAccess', _460 => _460.address, 'call', _461 => _461()]);
7605
+ const address = _optionalChain([server, 'access', _468 => _468.httpServer, 'optionalAccess', _469 => _469.address, 'call', _470 => _470()]);
7425
7606
  const resolvedPort = typeof address === "object" && address ? address.port : server.config.server.port || port || 3e3;
7426
7607
  const hostConfig = server.config.server.host;
7427
7608
  const isExposed = hostConfig === true || hostConfig === "0.0.0.0";
7428
7609
  console.log("");
7429
7610
  console.log(
7430
- ` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${_chunkHM7AGSKUcjs.FARM_VERSION}`)} ${pc.dim(`ready in ${elapsed}ms`)}`
7611
+ ` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${_chunk22LGTSBAcjs.FARM_VERSION}`)} ${pc.dim(`ready in ${elapsed}ms`)}`
7431
7612
  );
7432
7613
  console.log("");
7433
7614
  console.log(
@@ -7461,7 +7642,7 @@ async function defineConfig(config = {}) {
7461
7642
  plugins: [
7462
7643
  // `farm dev --desktop`: only the desktop window gets an answer, as in the packaged app.
7463
7644
  _chunk65Y5SIBHcjs.farmDesktopDevGuardPlugin.call(void 0, config.basePath),
7464
- _chunkN5DQMOAGcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
7645
+ _chunkDHR2WDSLcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
7465
7646
  tailwindVitePlugin,
7466
7647
  ...rendererVitePlugins,
7467
7648
  ...reactRefreshPlugins,
@@ -7469,16 +7650,16 @@ async function defineConfig(config = {}) {
7469
7650
  farmI18nClientBridgePlugin(),
7470
7651
  farmServerOnlyEntriesPlugin(),
7471
7652
  farmPlugin(config),
7472
- _chunk4DRINDGNcjs.farmEnvironmentFunctionsPlugin.call(void 0, config),
7653
+ _chunkVO65MYJDcjs.farmEnvironmentFunctionsPlugin.call(void 0, config),
7473
7654
  farmBrandingPlugin
7474
7655
  ],
7475
7656
  customLogger: farmLogger,
7476
7657
  clearScreen: false,
7477
7658
  optimizeDeps: {
7478
- ..._chunkN5DQMOAGcjs.createFarmClientOptimizeDepsConfig.call(void 0,
7479
- _chunkN5DQMOAGcjs.createFarmClientOptimizeDepsEntries.call(void 0,
7659
+ ..._chunkDHR2WDSLcjs.createFarmClientOptimizeDepsConfig.call(void 0,
7660
+ _chunkDHR2WDSLcjs.createFarmClientOptimizeDepsEntries.call(void 0,
7480
7661
  appRoot,
7481
- _chunk5Y2P454Ocjs.getFarmAppDirectories.call(void 0, { ...config, root: appRoot })
7662
+ _chunkMTBDJ326cjs.getFarmAppDirectories.call(void 0, { ...config, root: appRoot })
7482
7663
  ),
7483
7664
  config.renderer
7484
7665
  ),
@@ -7518,8 +7699,8 @@ async function defineConfig(config = {}) {
7518
7699
  dedupe: [...config.renderer.dedupe || []],
7519
7700
  // Stub out problematic server-only modules during dev mode
7520
7701
  alias: {
7521
- ..._chunk5Y2P454Ocjs.getFarmLayerAliases.call(void 0, config.layers),
7522
- ..._chunkN5DQMOAGcjs.createFarmSourceAlias.call(void 0, appRoot, config.srcDir),
7702
+ ..._chunkMTBDJ326cjs.getFarmLayerAliases.call(void 0, config.layers),
7703
+ ..._chunkDHR2WDSLcjs.createFarmSourceAlias.call(void 0, appRoot, config.srcDir),
7523
7704
  // Nitro internals that should not be resolved in browser
7524
7705
  "supports-color": "data:text/javascript,export default false; export const supportsColor = false; export const stdout = false; export const stderr = false;",
7525
7706
  "@poppinss/dumper": "data:text/javascript,export default {};",