@farm.js/core 0.1.48 → 0.1.50

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 (322) hide show
  1. package/dist/{agent-mcp-DAjB8Eyu.d.ts → agent-mcp-9BMbRgg_.d.ts} +1 -1
  2. package/dist/{agent-mcp-CXN3g0eX.d.mts → agent-mcp-CIMH324y.d.mts} +1 -1
  3. package/dist/agent-runtime.cjs +3 -3
  4. package/dist/agent-runtime.d.mts +6 -6
  5. package/dist/agent-runtime.d.ts +6 -6
  6. package/dist/agent-runtime.mjs +2 -2
  7. package/dist/analyzer-CN7C74WX.cjs +1066 -0
  8. package/dist/analyzer-DDW34OMC.mjs +1066 -0
  9. package/dist/api/client.d.mts +0 -1
  10. package/dist/api/client.d.ts +0 -1
  11. package/dist/api/route-manager.cjs +5 -5
  12. package/dist/api/route-manager.d.mts +10 -10
  13. package/dist/api/route-manager.d.ts +10 -10
  14. package/dist/api/route-manager.mjs +4 -4
  15. package/dist/api/runtime.cjs +3 -3
  16. package/dist/api/runtime.d.mts +7 -7
  17. package/dist/api/runtime.d.ts +7 -7
  18. package/dist/api/runtime.mjs +2 -2
  19. package/dist/api.cjs +6 -6
  20. package/dist/api.d.mts +10 -10
  21. package/dist/api.d.ts +10 -10
  22. package/dist/api.mjs +5 -5
  23. package/dist/{app-VK9sHDn5.d.ts → app-BWibTHVT.d.ts} +7 -7
  24. package/dist/{app-DytgRPjJ.d.mts → app-DVJ13FPA.d.mts} +7 -7
  25. package/dist/{app-manifest-DPgW5ke5.d.mts → app-manifest-CQDJOKL2.d.mts} +1 -1
  26. package/dist/{app-manifest-BUu7YGAx.d.ts → app-manifest-D0kaXdwu.d.ts} +1 -1
  27. package/dist/app-markdown.d.mts +7 -7
  28. package/dist/app-markdown.d.ts +7 -7
  29. package/dist/cache.d.mts +4 -3
  30. package/dist/cache.d.ts +4 -3
  31. package/dist/{chunk-VJXLUTBM.mjs → chunk-2DEPNLXK.mjs} +7 -7
  32. package/dist/chunk-2G63BIRL.mjs +227 -0
  33. package/dist/chunk-2GLQSIZD.mjs +55 -0
  34. package/dist/{chunk-HRLYO2XJ.mjs → chunk-2VCC3GVC.mjs} +1 -1
  35. package/dist/chunk-3ATXWZPH.cjs +227 -0
  36. package/dist/{chunk-YSPMY4B7.cjs → chunk-474FO3UE.cjs} +233 -157
  37. package/dist/{chunk-QNQEK3OF.cjs → chunk-4T25YCZ5.cjs} +14 -14
  38. package/dist/{chunk-ATHPRVP2.mjs → chunk-5V4KZOZO.mjs} +1 -1
  39. package/dist/{chunk-FGJQS4EC.cjs → chunk-6QA2SXVH.cjs} +2 -2
  40. package/dist/{chunk-XLYXG73A.mjs → chunk-75WWOZ5C.mjs} +22 -0
  41. package/dist/{chunk-QFQDRJKJ.mjs → chunk-76R5GJER.mjs} +2 -2
  42. package/dist/{chunk-NG44F7AH.mjs → chunk-7ONZDKVY.mjs} +2 -2
  43. package/dist/{chunk-MZZA6ZQV.mjs → chunk-7PZVXMWG.mjs} +4 -4
  44. package/dist/{chunk-4IICUBQX.cjs → chunk-A5BJKSZE.cjs} +2 -2
  45. package/dist/{chunk-TTYXOAB7.mjs → chunk-ANHZ6SUL.mjs} +1 -1
  46. package/dist/{chunk-ZBS3GOQZ.cjs → chunk-AQLHD6HZ.cjs} +35 -61
  47. package/dist/{chunk-Q2ZKQ6GD.cjs → chunk-B5S2JS6M.cjs} +127 -125
  48. package/dist/{chunk-AXRNEVCS.cjs → chunk-B6PREBN6.cjs} +8 -8
  49. package/dist/{chunk-JOHXK4BB.mjs → chunk-BW6SCVYX.mjs} +1 -1
  50. package/dist/{chunk-LZBM35DH.mjs → chunk-C73RIAEF.mjs} +4 -4
  51. package/dist/chunk-CGCJ2TJU.cjs +55 -0
  52. package/dist/{chunk-UYQOIPXE.mjs → chunk-CPXDDWGL.mjs} +1 -1
  53. package/dist/{chunk-JPAVNDZH.cjs → chunk-CY7H5KS4.cjs} +25 -25
  54. package/dist/{chunk-4S7M63WX.cjs → chunk-DGOLAZLV.cjs} +22 -1
  55. package/dist/{chunk-73XBJRZW.cjs → chunk-E2BMCNMJ.cjs} +2 -2
  56. package/dist/{chunk-WUEDTW6E.cjs → chunk-F5LERVY3.cjs} +23 -5
  57. package/dist/{chunk-A7DK663W.cjs → chunk-FACTMUPI.cjs} +27 -27
  58. package/dist/chunk-G2KTRMWA.mjs +40 -0
  59. package/dist/{chunk-C6U66WWF.mjs → chunk-GFT5AHAT.mjs} +13 -0
  60. package/dist/{chunk-ZGS3ZDF7.cjs → chunk-GOOK2J2W.cjs} +7 -7
  61. package/dist/{chunk-NW2BKDVT.mjs → chunk-HHFMECFO.mjs} +1 -1
  62. package/dist/{chunk-6M3HXUBQ.mjs → chunk-HWCHIBJZ.mjs} +21 -3
  63. package/dist/{chunk-HUL4LTC6.cjs → chunk-HYN3LLG7.cjs} +63 -20
  64. package/dist/{chunk-HELQXYVI.cjs → chunk-I2DQGS56.cjs} +11 -9
  65. package/dist/{chunk-SSNN55Q6.cjs → chunk-IQXGHGZF.cjs} +5 -5
  66. package/dist/{chunk-ZSIGEHSE.cjs → chunk-IUBDMDZZ.cjs} +21 -180
  67. package/dist/{chunk-TQWGOQ7O.mjs → chunk-IWJKJDNW.mjs} +116 -40
  68. package/dist/{chunk-NRFUVDTH.mjs → chunk-JJOWY3XD.mjs} +2 -2
  69. package/dist/{chunk-6XFGJBYX.cjs → chunk-JYNNIGQO.cjs} +16 -7
  70. package/dist/{chunk-XO6WL6NL.mjs → chunk-KGP76FSV.mjs} +1 -1
  71. package/dist/{chunk-GXSMF7UR.mjs → chunk-KO2NWUKN.mjs} +1 -1
  72. package/dist/{chunk-VDLF2DJA.cjs → chunk-KZH6YLND.cjs} +375 -162
  73. package/dist/{chunk-5566GNEG.cjs → chunk-LIFUPCXW.cjs} +13 -0
  74. package/dist/{chunk-I2SWKWO7.mjs → chunk-LJDIFIJ2.mjs} +1 -1
  75. package/dist/{chunk-KZT2VHRQ.cjs → chunk-LYWAGXXW.cjs} +11 -11
  76. package/dist/{chunk-N6SIQJEJ.mjs → chunk-M7LKA632.mjs} +54 -11
  77. package/dist/{chunk-6LH33DLL.cjs → chunk-NJVFPJ2Y.cjs} +2 -2
  78. package/dist/{chunk-JWP56HCP.mjs → chunk-OD6WM3I7.mjs} +2 -2
  79. package/dist/{chunk-MJ6IC4K2.mjs → chunk-OTOOJIUB.mjs} +1 -1
  80. package/dist/{chunk-TFA6BUAE.cjs → chunk-OY5XDG24.cjs} +4 -4
  81. package/dist/{chunk-R2SEZEBC.cjs → chunk-OYNNA4DD.cjs} +4 -4
  82. package/dist/{chunk-GBPDSUFE.mjs → chunk-OZK2DS44.mjs} +1 -1
  83. package/dist/chunk-QXJADAQB.cjs +40 -0
  84. package/dist/{chunk-JLS6ZLFM.cjs → chunk-RHOR2J6V.cjs} +1 -1
  85. package/dist/{chunk-YQGZLCT4.cjs → chunk-RWT2BTJT.cjs} +6 -6
  86. package/dist/{chunk-3HBFI373.cjs → chunk-S5AQ7CAC.cjs} +14 -14
  87. package/dist/{chunk-HNAUK3SC.mjs → chunk-SHJJM6OG.mjs} +40 -199
  88. package/dist/{chunk-LL7TDMOM.mjs → chunk-SMUW7UST.mjs} +33 -59
  89. package/dist/{chunk-VCFBQFOV.mjs → chunk-SN5VSO3Q.mjs} +9 -7
  90. package/dist/{chunk-DM3TFCC2.cjs → chunk-SUV6YO4Q.cjs} +5 -5
  91. package/dist/{chunk-JUMPFVMK.mjs → chunk-TUOO6IK3.mjs} +9 -0
  92. package/dist/chunk-UB7RVEMX.mjs +73 -0
  93. package/dist/{chunk-CDTIXBKN.mjs → chunk-UN6N623E.mjs} +2 -2
  94. package/dist/{chunk-BEXYFR2R.cjs → chunk-UY6HS5PF.cjs} +2 -2
  95. package/dist/{chunk-HAH4FBTA.mjs → chunk-VAHBCI6X.mjs} +1 -1
  96. package/dist/{chunk-C2R5RVLA.cjs → chunk-VCKGOXFI.cjs} +73 -1
  97. package/dist/{chunk-N25RPPO5.cjs → chunk-WAPQWAE6.cjs} +10 -10
  98. package/dist/{chunk-NE33FRQ5.mjs → chunk-WVBUXNBX.mjs} +274 -61
  99. package/dist/{chunk-ALD2WMLA.mjs → chunk-WXHDVXJE.mjs} +2 -2
  100. package/dist/{chunk-EVCQX243.cjs → chunk-X2EL3BLH.cjs} +2 -2
  101. package/dist/{chunk-EA5PMJDU.mjs → chunk-X3HOVNHI.mjs} +1 -1
  102. package/dist/{chunk-XXB37YET.cjs → chunk-XLRLSTJ6.cjs} +7 -7
  103. package/dist/{chunk-DRFADSKY.mjs → chunk-XXXRRVY6.mjs} +4 -4
  104. package/dist/{chunk-EXHEPWFJ.cjs → chunk-YAXOEAND.cjs} +10 -10
  105. package/dist/{chunk-PEHL3IZL.cjs → chunk-YB44NKC2.cjs} +2 -2
  106. package/dist/chunk-YKHRCY4T.cjs +73 -0
  107. package/dist/{chunk-NIPKC4DA.mjs → chunk-ZIBIE7AH.mjs} +72 -0
  108. package/dist/{chunk-N7SPZJLY.mjs → chunk-ZLOQQ2UF.mjs} +33 -31
  109. package/dist/client/lifecycle.d.mts +1 -1
  110. package/dist/client/lifecycle.d.ts +1 -1
  111. package/dist/{client-plugins-DqjCsKMN.d.ts → client-plugins-BPfltM5m.d.ts} +19 -10
  112. package/dist/{client-plugins-BlEzV5FO.d.mts → client-plugins-D4RO59f0.d.mts} +19 -10
  113. package/dist/client-plugins.d.mts +6 -6
  114. package/dist/client-plugins.d.ts +6 -6
  115. package/dist/client.cjs +11 -8
  116. package/dist/client.d.mts +11 -10
  117. package/dist/client.d.ts +11 -10
  118. package/dist/client.mjs +12 -9
  119. package/dist/client.react-server.mjs +1 -1
  120. package/dist/config-CnhyvvmT.d.mts +188 -0
  121. package/dist/config-CnhyvvmT.d.ts +188 -0
  122. package/dist/config.d.mts +6 -6
  123. package/dist/config.d.ts +6 -6
  124. package/dist/desktop.d.mts +7 -7
  125. package/dist/desktop.d.ts +7 -7
  126. package/dist/{dev-guard-MPZUJFIV.mjs → dev-guard-4PFQNXQX.mjs} +4 -2
  127. package/dist/{dev-guard-4NQ3LFO5.cjs → dev-guard-YLO5DE3H.cjs} +7 -5
  128. package/dist/{devtools-A37WWJZL.cjs → devtools-N5XTOECL.cjs} +8 -8
  129. package/dist/{devtools-BLKHPY3C.mjs → devtools-STG7HPRV.mjs} +7 -7
  130. package/dist/docs.cjs +10 -10
  131. package/dist/docs.d.mts +7 -7
  132. package/dist/docs.d.ts +7 -7
  133. package/dist/docs.mjs +9 -9
  134. package/dist/environment/vite.d.mts +1 -1
  135. package/dist/environment/vite.d.ts +1 -1
  136. package/dist/generate-route-types-DQP0cUzk.d.ts +33 -0
  137. package/dist/generate-route-types-TF5Wwtvz.d.mts +33 -0
  138. package/dist/i18n/client.d.mts +2 -2
  139. package/dist/i18n/client.d.ts +2 -2
  140. package/dist/i18n/index.d.mts +3 -3
  141. package/dist/i18n/index.d.ts +3 -3
  142. package/dist/i18n/server.d.mts +5 -5
  143. package/dist/i18n/server.d.ts +5 -5
  144. package/dist/image/server.cjs +3 -3
  145. package/dist/image/server.mjs +2 -2
  146. package/dist/image/sharp.cjs +10 -10
  147. package/dist/image/sharp.mjs +2 -2
  148. package/dist/{index-CMigAr9f.d.mts → index-C-N3Pwg-.d.ts} +2 -2
  149. package/dist/{index-MocnSP3a.d.ts → index-D3l4tREW.d.ts} +2 -2
  150. package/dist/{index-Cl3akY5U.d.mts → index-DPUAPho_.d.mts} +2 -2
  151. package/dist/{index-n3hjOvVC.d.ts → index-k8o8eUOd.d.mts} +2 -2
  152. package/dist/index.cjs +73 -66
  153. package/dist/index.d.mts +29 -45
  154. package/dist/index.d.ts +29 -45
  155. package/dist/index.mjs +78 -71
  156. package/dist/integrations.cjs +3 -3
  157. package/dist/integrations.d.mts +6 -6
  158. package/dist/integrations.d.ts +6 -6
  159. package/dist/integrations.mjs +2 -2
  160. package/dist/internal/app-markdown-runtime.d.mts +7 -7
  161. package/dist/internal/app-markdown-runtime.d.ts +7 -7
  162. package/dist/internal/build-runtime.cjs +36 -32
  163. package/dist/internal/build-runtime.d.mts +9 -9
  164. package/dist/internal/build-runtime.d.ts +9 -9
  165. package/dist/internal/build-runtime.mjs +35 -31
  166. package/dist/internal/cli-runtime.cjs +16 -15
  167. package/dist/internal/cli-runtime.mjs +16 -15
  168. package/dist/internal/client-error-overlay.cjs +4 -4
  169. package/dist/internal/client-error-overlay.mjs +1 -1
  170. package/dist/internal/client-runtime.cjs +19 -2
  171. package/dist/internal/client-runtime.d.mts +45 -3
  172. package/dist/internal/client-runtime.d.ts +45 -3
  173. package/dist/internal/client-runtime.mjs +19 -2
  174. package/dist/internal/compression-runtime.d.mts +6 -6
  175. package/dist/internal/compression-runtime.d.ts +6 -6
  176. package/dist/internal/config-runtime.cjs +17 -10
  177. package/dist/internal/config-runtime.d.mts +259 -18
  178. package/dist/internal/config-runtime.d.ts +259 -18
  179. package/dist/internal/config-runtime.mjs +15 -8
  180. package/dist/internal/desktop-guard.cjs +2 -2
  181. package/dist/internal/desktop-guard.d.mts +7 -0
  182. package/dist/internal/desktop-guard.d.ts +7 -0
  183. package/dist/internal/desktop-guard.mjs +1 -1
  184. package/dist/internal/form-actions.cjs +4 -4
  185. package/dist/internal/form-actions.mjs +3 -3
  186. package/dist/internal/infra-analytics-runtime.cjs +6 -6
  187. package/dist/internal/infra-analytics-runtime.mjs +4 -4
  188. package/dist/internal/islands-runtime.cjs +4 -1
  189. package/dist/internal/islands-runtime.d.mts +9 -12
  190. package/dist/internal/islands-runtime.d.ts +9 -12
  191. package/dist/internal/islands-runtime.mjs +5 -2
  192. package/dist/internal/metadata-image-runtime.cjs +3 -3
  193. package/dist/internal/metadata-image-runtime.mjs +2 -2
  194. package/dist/internal/product-telemetry-runtime.cjs +2 -2
  195. package/dist/internal/product-telemetry-runtime.mjs +1 -1
  196. package/dist/internal/production-runtime.cjs +13 -13
  197. package/dist/internal/production-runtime.d.mts +19 -19
  198. package/dist/internal/production-runtime.d.ts +19 -19
  199. package/dist/internal/production-runtime.mjs +15 -15
  200. package/dist/{layers-D9fbe-rz.d.ts → layers-CcS42OGR.d.mts} +1 -1
  201. package/dist/{layers-D9fbe-rz.d.mts → layers-CcS42OGR.d.ts} +1 -1
  202. package/dist/{lifecycle-DK06VuKP.d.ts → lifecycle-C2aLBOwu.d.mts} +1 -1
  203. package/dist/{lifecycle-DK06VuKP.d.mts → lifecycle-C2aLBOwu.d.ts} +1 -1
  204. package/dist/markdown.d.mts +6 -6
  205. package/dist/markdown.d.ts +6 -6
  206. package/dist/middleware.cjs +7 -7
  207. package/dist/middleware.d.mts +8 -8
  208. package/dist/middleware.d.ts +8 -8
  209. package/dist/middleware.mjs +6 -6
  210. package/dist/mobile.cjs +9 -0
  211. package/dist/mobile.d.mts +67 -0
  212. package/dist/mobile.d.ts +67 -0
  213. package/dist/mobile.mjs +9 -0
  214. package/dist/navigation-delegate-8xg3Zvp4.d.ts +29 -0
  215. package/dist/navigation-delegate-ji6elCKy.d.mts +29 -0
  216. package/dist/navigation.cjs +5 -5
  217. package/dist/navigation.d.mts +9 -9
  218. package/dist/navigation.d.ts +9 -9
  219. package/dist/navigation.mjs +4 -4
  220. package/dist/{nitro-UT2J5A5D.mjs → nitro-2Q5NVY7L.mjs} +2 -2
  221. package/dist/{nitro-BIXIKJZS.cjs → nitro-YPSZBYDK.cjs} +3 -3
  222. package/dist/platform.cjs +2 -1
  223. package/dist/platform.d.mts +4 -3
  224. package/dist/platform.d.ts +4 -3
  225. package/dist/platform.mjs +2 -1
  226. package/dist/{plugin-4KYXV7BB.mjs → plugin-53SY5YBS.mjs} +1 -1
  227. package/dist/{plugin-WBANOZQM.cjs → plugin-HZIBL3DW.cjs} +2 -2
  228. package/dist/plugin.cjs +31 -29
  229. package/dist/plugin.d.mts +13 -8
  230. package/dist/plugin.d.ts +13 -8
  231. package/dist/plugin.mjs +30 -28
  232. package/dist/{production-runtime-bWZJMcQb.d.mts → production-runtime-DXnQQkQf.d.mts} +3 -3
  233. package/dist/{production-runtime-YVDGYWBG.d.ts → production-runtime-TdKaYRj0.d.ts} +3 -3
  234. package/dist/production-vite-BQFAlG7n.d.mts +13 -0
  235. package/dist/production-vite-BQFAlG7n.d.ts +13 -0
  236. package/dist/{programmatic-routes-client-DviwGeAv.d.ts → programmatic-routes-client-BwiTndEC.d.ts} +2 -2
  237. package/dist/{programmatic-routes-client-BFKOTEXN.d.mts → programmatic-routes-client-Dh1SDLSM.d.mts} +2 -2
  238. package/dist/query/client.cjs +6 -6
  239. package/dist/query/client.mjs +2 -2
  240. package/dist/{render-plan-DqWXo3-B.d.ts → render-plan-BPbwRbuN.d.ts} +1 -1
  241. package/dist/{render-plan-CS8l0zaK.d.mts → render-plan-BvCGXF6K.d.mts} +1 -1
  242. package/dist/renderer-client.cjs +9 -6
  243. package/dist/renderer-client.d.mts +9 -8
  244. package/dist/renderer-client.d.ts +9 -8
  245. package/dist/renderer-client.mjs +6 -3
  246. package/dist/{request-CBrHpaCC.d.ts → request-B8PGTZNR.d.ts} +1 -1
  247. package/dist/{request-D4XqmnJF.d.mts → request-C_xTkJib.d.mts} +1 -1
  248. package/dist/request.d.mts +7 -7
  249. package/dist/request.d.ts +7 -7
  250. package/dist/{resolver-DC57A4vz.d.ts → resolver-CJ-D9nP-.d.ts} +1 -1
  251. package/dist/{resolver-C2G-3Tm6.d.mts → resolver-TDyZKgKI.d.mts} +1 -1
  252. package/dist/{route-rendering-3pRPtyO2.d.mts → route-rendering-DlddURL1.d.mts} +1 -1
  253. package/dist/{route-rendering-Bltnu8a3.d.ts → route-rendering-RNtcj607.d.ts} +1 -1
  254. package/dist/{router-BFSmKGtI.d.mts → router-B97eB0Mq.d.mts} +1 -1
  255. package/dist/{router-DDT7bkg7.d.ts → router-qUVaoEN8.d.ts} +1 -1
  256. package/dist/routes-8PT9cl60.d.ts +121 -0
  257. package/dist/routes-kEUsXHx3.d.mts +121 -0
  258. package/dist/routes.d.mts +6 -6
  259. package/dist/routes.d.ts +6 -6
  260. package/dist/{rsc-pipeline-4KOITP64.cjs → rsc-pipeline-L4XOZ2TE.cjs} +13 -10
  261. package/dist/{rsc-pipeline-ULFIB3UT.mjs → rsc-pipeline-T3775JUA.mjs} +12 -9
  262. package/dist/runtime-BIBGJO7V.cjs +1005 -0
  263. package/dist/{runtime-B9HmxiZc.d.ts → runtime-C4CmlOOh.d.ts} +2 -2
  264. package/dist/{runtime-C6yG64je.d.ts → runtime-C8GUnNeP.d.ts} +1 -1
  265. package/dist/{runtime-Cpylaypt.d.mts → runtime-CaDswfWi.d.mts} +1 -1
  266. package/dist/{runtime-CCxTmGuf.d.mts → runtime-CihDZ2Rn.d.mts} +2 -2
  267. package/dist/runtime-HRSFC4ZC.mjs +1005 -0
  268. package/dist/{schema-dev-notice-O3I5HLXK.mjs → schema-dev-notice-LZ5NXGLN.mjs} +2 -2
  269. package/dist/{schema-dev-notice-Z73J3NJ6.cjs → schema-dev-notice-XV7GZ3QJ.cjs} +4 -4
  270. package/dist/server-action-security.cjs +3 -3
  271. package/dist/server-action-security.mjs +2 -2
  272. package/dist/server-fn-client.d.mts +0 -1
  273. package/dist/server-fn-client.d.ts +0 -1
  274. package/dist/server-fn.cjs +4 -4
  275. package/dist/server-fn.d.mts +0 -1
  276. package/dist/server-fn.d.ts +0 -1
  277. package/dist/server-fn.mjs +3 -3
  278. package/dist/server-plugins.cjs +1 -1
  279. package/dist/server-plugins.d.mts +7 -7
  280. package/dist/server-plugins.d.ts +7 -7
  281. package/dist/server-plugins.mjs +1 -1
  282. package/dist/server-query-client.d.mts +0 -1
  283. package/dist/server-query-client.d.ts +0 -1
  284. package/dist/server-query.cjs +5 -5
  285. package/dist/server-query.d.mts +0 -1
  286. package/dist/server-query.d.ts +0 -1
  287. package/dist/server-query.mjs +4 -4
  288. package/dist/server.cjs +89 -66
  289. package/dist/server.d.mts +22 -17
  290. package/dist/server.d.ts +22 -17
  291. package/dist/server.mjs +64 -41
  292. package/dist/{spa-router-CkTPnA4L.d.mts → spa-router-Dlv5ofg0.d.mts} +4 -4
  293. package/dist/{spa-router-CKuS81mi.d.ts → spa-router-qapSboKz.d.ts} +4 -4
  294. package/dist/testing.cjs +7 -7
  295. package/dist/testing.d.mts +6 -6
  296. package/dist/testing.d.ts +6 -6
  297. package/dist/testing.mjs +5 -5
  298. package/dist/{types--Wh02r5_.d.mts → types-C41ePjvP.d.mts} +1 -1
  299. package/dist/{types--Wh02r5_.d.ts → types-C41ePjvP.d.ts} +1 -1
  300. package/dist/{utils-C0ORLYXc.d.ts → utils-A-cYF81u.d.ts} +1 -1
  301. package/dist/{utils-IA9wVkef.d.mts → utils-DyvlSxFk.d.mts} +1 -1
  302. package/dist/version.cjs +2 -2
  303. package/dist/version.mjs +1 -1
  304. package/dist/vite.cjs +31 -29
  305. package/dist/vite.d.mts +9 -9
  306. package/dist/vite.d.ts +9 -9
  307. package/dist/vite.mjs +30 -28
  308. package/dist/{workflows-Df1C_7OG.d.mts → workflows-CRMzQZ3k.d.mts} +2 -1
  309. package/dist/{workflows-Df1C_7OG.d.ts → workflows-CRMzQZ3k.d.ts} +2 -1
  310. package/dist/workflows.cjs +3 -3
  311. package/dist/workflows.d.mts +1 -1
  312. package/dist/workflows.d.ts +1 -1
  313. package/dist/workflows.mjs +2 -2
  314. package/package.json +10 -2
  315. package/dist/cache-invalidation-BD0z_lfu.d.mts +0 -4
  316. package/dist/cache-invalidation-BD0z_lfu.d.ts +0 -4
  317. package/dist/chunk-45EUIICW.mjs +0 -15
  318. package/dist/chunk-V7KTQR4C.cjs +0 -15
  319. package/dist/{chunk-BR5FSKZ5.cjs → chunk-EQWWOQTK.cjs} +0 -0
  320. package/dist/{chunk-5OJVKXFV.cjs → chunk-N7JQXQAV.cjs} +2 -2
  321. package/dist/{chunk-VR4SEDEM.mjs → chunk-VOZ5DI7D.mjs} +0 -0
  322. package/dist/{chunk-72KABRWN.mjs → chunk-WSDKXV4E.mjs} +4 -4
@@ -1,15 +1,15 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var _chunkMF3IA2AWcjs = require('./chunk-MF3IA2AW.cjs');
4
3
 
5
4
 
6
5
 
7
6
 
8
7
 
9
8
 
9
+ var _chunkVZY7MAVScjs = require('./chunk-VZY7MAVS.cjs');
10
10
 
11
11
 
12
- var _chunkVZY7MAVScjs = require('./chunk-VZY7MAVS.cjs');
12
+ var _chunkMF3IA2AWcjs = require('./chunk-MF3IA2AW.cjs');
13
13
 
14
14
 
15
15
  var _chunkVM57CK74cjs = require('./chunk-VM57CK74.cjs');
@@ -18,7 +18,7 @@ var _chunkVM57CK74cjs = require('./chunk-VM57CK74.cjs');
18
18
 
19
19
 
20
20
 
21
- var _chunkQNQEK3OFcjs = require('./chunk-QNQEK3OF.cjs');
21
+ var _chunk4T25YCZ5cjs = require('./chunk-4T25YCZ5.cjs');
22
22
 
23
23
 
24
24
 
@@ -29,7 +29,7 @@ var _chunkQNQEK3OFcjs = require('./chunk-QNQEK3OF.cjs');
29
29
 
30
30
 
31
31
 
32
- var _chunkEVCQX243cjs = require('./chunk-EVCQX243.cjs');
32
+ var _chunkX2EL3BLHcjs = require('./chunk-X2EL3BLH.cjs');
33
33
 
34
34
 
35
35
 
@@ -37,7 +37,7 @@ var _chunkEVCQX243cjs = require('./chunk-EVCQX243.cjs');
37
37
  var _chunkEQMTJBB7cjs = require('./chunk-EQMTJBB7.cjs');
38
38
 
39
39
 
40
- var _chunkHUL4LTC6cjs = require('./chunk-HUL4LTC6.cjs');
40
+ var _chunkHYN3LLG7cjs = require('./chunk-HYN3LLG7.cjs');
41
41
 
42
42
 
43
43
  var _chunkBRWIVOV4cjs = require('./chunk-BRWIVOV4.cjs');
@@ -52,7 +52,7 @@ var _chunkV3UOEWCBcjs = require('./chunk-V3UOEWCB.cjs');
52
52
 
53
53
 
54
54
 
55
- var _chunkKZT2VHRQcjs = require('./chunk-KZT2VHRQ.cjs');
55
+ var _chunkLYWAGXXWcjs = require('./chunk-LYWAGXXW.cjs');
56
56
 
57
57
 
58
58
 
@@ -84,7 +84,7 @@ var _chunkKZT2VHRQcjs = require('./chunk-KZT2VHRQ.cjs');
84
84
 
85
85
 
86
86
 
87
- var _chunkYSPMY4B7cjs = require('./chunk-YSPMY4B7.cjs');
87
+ var _chunk474FO3UEcjs = require('./chunk-474FO3UE.cjs');
88
88
 
89
89
 
90
90
  var _chunkIXSMFKZ2cjs = require('./chunk-IXSMFKZ2.cjs');
@@ -95,7 +95,7 @@ var _chunk3EEET2Q5cjs = require('./chunk-3EEET2Q5.cjs');
95
95
 
96
96
 
97
97
 
98
- var _chunkZSIGEHSEcjs = require('./chunk-ZSIGEHSE.cjs');
98
+ var _chunkIUBDMDZZcjs = require('./chunk-IUBDMDZZ.cjs');
99
99
 
100
100
 
101
101
 
@@ -108,18 +108,21 @@ var _chunkZSIGEHSEcjs = require('./chunk-ZSIGEHSE.cjs');
108
108
 
109
109
 
110
110
 
111
- var _chunkC2R5RVLAcjs = require('./chunk-C2R5RVLA.cjs');
111
+ var _chunkVCKGOXFIcjs = require('./chunk-VCKGOXFI.cjs');
112
112
 
113
113
 
114
114
  var _chunk47JV57DAcjs = require('./chunk-47JV57DA.cjs');
115
115
 
116
116
 
117
+ var _chunkSGBNF56Scjs = require('./chunk-SGBNF56S.cjs');
118
+
119
+
117
120
 
118
121
 
119
122
 
120
123
 
121
124
 
122
- var _chunkZGS3ZDF7cjs = require('./chunk-ZGS3ZDF7.cjs');
125
+ var _chunkGOOK2J2Wcjs = require('./chunk-GOOK2J2W.cjs');
123
126
 
124
127
 
125
128
 
@@ -127,10 +130,10 @@ var _chunkZGS3ZDF7cjs = require('./chunk-ZGS3ZDF7.cjs');
127
130
  var _chunkSBABQKPTcjs = require('./chunk-SBABQKPT.cjs');
128
131
 
129
132
 
130
- var _chunkSGBNF56Scjs = require('./chunk-SGBNF56S.cjs');
133
+ var _chunkJ37KTQIAcjs = require('./chunk-J37KTQIA.cjs');
131
134
 
132
135
 
133
- var _chunkJ37KTQIAcjs = require('./chunk-J37KTQIA.cjs');
136
+ var _chunkJATTVAHAcjs = require('./chunk-JATTVAHA.cjs');
134
137
 
135
138
 
136
139
 
@@ -167,23 +170,20 @@ var _chunk5Y2P454Ocjs = require('./chunk-5Y2P454O.cjs');
167
170
 
168
171
 
169
172
 
170
- var _chunkSSNN55Q6cjs = require('./chunk-SSNN55Q6.cjs');
171
-
172
-
173
+ var _chunk2HW5LWAHcjs = require('./chunk-2HW5LWAH.cjs');
173
174
 
174
175
 
175
176
 
176
- var _chunkC7425KDGcjs = require('./chunk-C7425KDG.cjs');
177
+ var _chunkIQXGHGZFcjs = require('./chunk-IQXGHGZF.cjs');
177
178
 
178
179
 
179
- var _chunkFGJQS4ECcjs = require('./chunk-FGJQS4EC.cjs');
180
180
 
181
181
 
182
- var _chunkJATTVAHAcjs = require('./chunk-JATTVAHA.cjs');
183
182
 
183
+ var _chunkC7425KDGcjs = require('./chunk-C7425KDG.cjs');
184
184
 
185
185
 
186
- var _chunk2HW5LWAHcjs = require('./chunk-2HW5LWAH.cjs');
186
+ var _chunk6QA2SXVHcjs = require('./chunk-6QA2SXVH.cjs');
187
187
 
188
188
 
189
189
  var _chunkWJFFPXCVcjs = require('./chunk-WJFFPXCV.cjs');
@@ -193,7 +193,7 @@ var _chunkJMYXO572cjs = require('./chunk-JMYXO572.cjs');
193
193
 
194
194
 
195
195
 
196
- var _chunkN25RPPO5cjs = require('./chunk-N25RPPO5.cjs');
196
+ var _chunkWAPQWAE6cjs = require('./chunk-WAPQWAE6.cjs');
197
197
 
198
198
 
199
199
  var _chunkPFV2KPDZcjs = require('./chunk-PFV2KPDZ.cjs');
@@ -204,7 +204,7 @@ var _chunkPFV2KPDZcjs = require('./chunk-PFV2KPDZ.cjs');
204
204
  var _chunkL6QDME5Zcjs = require('./chunk-L6QDME5Z.cjs');
205
205
 
206
206
 
207
- var _chunkEXHEPWFJcjs = require('./chunk-EXHEPWFJ.cjs');
207
+ var _chunkYAXOEANDcjs = require('./chunk-YAXOEAND.cjs');
208
208
 
209
209
 
210
210
  var _chunkBBPDJGCUcjs = require('./chunk-BBPDJGCU.cjs');
@@ -231,7 +231,7 @@ var _chunkXN2MB4QZcjs = require('./chunk-XN2MB4QZ.cjs');
231
231
  var _chunkB5BBTPJQcjs = require('./chunk-B5BBTPJQ.cjs');
232
232
 
233
233
 
234
- var _chunkJLS6ZLFMcjs = require('./chunk-JLS6ZLFM.cjs');
234
+ var _chunkRHOR2J6Vcjs = require('./chunk-RHOR2J6V.cjs');
235
235
 
236
236
 
237
237
  var _chunkE552H232cjs = require('./chunk-E552H232.cjs');
@@ -338,7 +338,7 @@ function getDocsTitle(docs) {
338
338
  return typeof docs.config.nav === "object" && docs.config.nav && "title" in docs.config.nav ? String(docs.config.nav.title || "Documentation") : "Documentation";
339
339
  }
340
340
  function loadPages(contentDir, docs) {
341
- return _chunkEVCQX243cjs.discoverFarmDocsPages.call(void 0, contentDir, docs).map((page) => _chunkEVCQX243cjs.loadFarmDocsPage.call(void 0, contentDir, docs, page.slug)).filter((page) => Boolean(page)).sort((a, b) => a.href.localeCompare(b.href));
341
+ return _chunkX2EL3BLHcjs.discoverFarmDocsPages.call(void 0, contentDir, docs).map((page) => _chunkX2EL3BLHcjs.loadFarmDocsPage.call(void 0, contentDir, docs, page.slug)).filter((page) => Boolean(page)).sort((a, b) => a.href.localeCompare(b.href));
342
342
  }
343
343
  function findSocialImagePath(html) {
344
344
  const match = /<meta\s+property=["']og:image["']\s+content=["']([^"']+)["']/i.exec(html) || /<meta\s+content=["']([^"']+)["']\s+property=["']og:image["']/i.exec(html);
@@ -356,14 +356,14 @@ async function addHandlerRoute(routes, pathname, handler, absolutePaths) {
356
356
  return response;
357
357
  }
358
358
  async function compileFarmDocsManifest(docs, options) {
359
- const contentDir = _chunkEVCQX243cjs.resolveFarmDocsContentDir.call(void 0, docs, options);
359
+ const contentDir = _chunkX2EL3BLHcjs.resolveFarmDocsContentDir.call(void 0, docs, options);
360
360
  const pages = loadPages(contentDir, docs);
361
361
  const absolutePaths = [
362
362
  _path2.default.resolve(options.root),
363
363
  _path2.default.resolve(contentDir),
364
364
  docs.configPath || ""
365
365
  ];
366
- const handler = _chunkEVCQX243cjs.createFarmDocsHandler.call(void 0, docs, {
366
+ const handler = _chunkX2EL3BLHcjs.createFarmDocsHandler.call(void 0, docs, {
367
367
  root: options.root,
368
368
  srcDir: options.srcDir,
369
369
  clientEntry: options.clientEntry,
@@ -372,7 +372,7 @@ async function compileFarmDocsManifest(docs, options) {
372
372
  globalStylesheetHref: options.globalStylesheetHref,
373
373
  isPathGuarded: options.isPathGuarded
374
374
  });
375
- const apiHandler = _chunkQNQEK3OFcjs.createFarmDocsAPIHandler.call(void 0, {
375
+ const apiHandler = _chunk4T25YCZ5cjs.createFarmDocsAPIHandler.call(void 0, {
376
376
  rootDir: options.root,
377
377
  srcDir: options.srcDir,
378
378
  docs,
@@ -383,7 +383,7 @@ async function compileFarmDocsManifest(docs, options) {
383
383
  const apiMarkdown = {};
384
384
  for (const page of pages) {
385
385
  const htmlResponse = await addHandlerRoute(routes, page.href, handler, absolutePaths);
386
- const markdownPath = _chunkEVCQX243cjs.getFarmDocsMarkdownPath.call(void 0, page.href);
386
+ const markdownPath = _chunkX2EL3BLHcjs.getFarmDocsMarkdownPath.call(void 0, page.href);
387
387
  await addHandlerRoute(routes, markdownPath, handler, absolutePaths);
388
388
  if (htmlResponse) {
389
389
  const socialImagePath = findSocialImagePath(await htmlResponse.text());
@@ -467,7 +467,7 @@ async function compileFarmDocsManifest(docs, options) {
467
467
  post: await compileResponse(postResponse, absolutePaths),
468
468
  search: {
469
469
  pages: publicPages.map((page) => ({
470
- ..._chunkEVCQX243cjs.toFarmDocsMarkdownPage.call(void 0, page),
470
+ ..._chunkX2EL3BLHcjs.toFarmDocsMarkdownPage.call(void 0, page),
471
471
  sourcePath: `farm-docs:${page.slug || "index"}`
472
472
  })),
473
473
  search: _nullishCoalesce(searchConfig, () => ( true)),
@@ -645,7 +645,7 @@ async function createFarmRouteRuntimeManifest(options) {
645
645
  const routes = [];
646
646
  for (const [pattern, entry] of options.routeManager.getRoutes()) {
647
647
  const routeModule = await options.routeManager.loadRouteModule(entry.modulePath);
648
- const rendering = await _chunkZSIGEHSEcjs.resolveRouteRenderingConfigFromFile.call(void 0, routeModule, entry.modulePath);
648
+ const rendering = await _chunkIUBDMDZZcjs.resolveRouteRenderingConfigFromFile.call(void 0, routeModule, entry.modulePath);
649
649
  const runtimeConfig = await options.routeManager.resolveRouteRuntimeConfig(pattern);
650
650
  routes.push({
651
651
  kind: "page",
@@ -957,7 +957,7 @@ export default async function farmNetlifyHandler(request, context) {
957
957
  // src/build/strip-platform-config.ts
958
958
 
959
959
 
960
- var PLATFORM_CONFIG_KEYS = /* @__PURE__ */ new Set(["desktop"]);
960
+ var PLATFORM_CONFIG_KEYS = /* @__PURE__ */ new Set(["desktop", "mobile"]);
961
961
  var CONFIG_FACTORIES = /* @__PURE__ */ new Set(["defineConfig", "defineFarmConfig"]);
962
962
  function isConfigObject(node) {
963
963
  return _optionalChain([node, 'optionalAccess', _15 => _15.type]) === "ObjectExpression";
@@ -992,23 +992,33 @@ function collectConfigObjects(node, found) {
992
992
  }
993
993
  }
994
994
  function stripPlatformConfigSource(code, parse) {
995
- if (!code.includes("desktop")) return null;
995
+ if (!code.includes("desktop") && !code.includes("mobile")) return null;
996
996
  const objects = [];
997
997
  collectConfigObjects(parse(code), objects);
998
998
  const removals = [];
999
999
  for (const object of objects) {
1000
1000
  const properties = object.properties;
1001
- properties.forEach((property, index) => {
1001
+ const removed = properties.map((property) => {
1002
1002
  const name = propertyName(property);
1003
- if (!name || !PLATFORM_CONFIG_KEYS.has(name)) return;
1004
- if (index < properties.length - 1)
1005
- removals.push([property.start, properties[index + 1].start]);
1006
- else if (index > 0) removals.push([properties[index - 1].end, property.end]);
1007
- else {
1008
- const trailingComma = /^\s*,/.exec(code.slice(property.end));
1009
- removals.push([property.start, property.end + (_nullishCoalesce(_optionalChain([trailingComma, 'optionalAccess', _18 => _18[0], 'access', _19 => _19.length]), () => ( 0)))]);
1010
- }
1003
+ return !!name && PLATFORM_CONFIG_KEYS.has(name);
1011
1004
  });
1005
+ for (let first = 0; first < properties.length; first++) {
1006
+ if (!removed[first]) continue;
1007
+ let last = first;
1008
+ while (last + 1 < properties.length && removed[last + 1]) last++;
1009
+ if (last < properties.length - 1) {
1010
+ removals.push([properties[first].start, properties[last + 1].start]);
1011
+ } else if (first > 0) {
1012
+ removals.push([properties[first - 1].end, properties[last].end]);
1013
+ } else {
1014
+ const trailingComma = /^\s*,/.exec(code.slice(properties[last].end));
1015
+ removals.push([
1016
+ properties[first].start,
1017
+ properties[last].end + (_nullishCoalesce(_optionalChain([trailingComma, 'optionalAccess', _18 => _18[0], 'access', _19 => _19.length]), () => ( 0)))
1018
+ ]);
1019
+ }
1020
+ first = last;
1021
+ }
1012
1022
  }
1013
1023
  if (removals.length === 0) return null;
1014
1024
  removals.sort((left, right) => right[0] - left[0]);
@@ -1667,7 +1677,7 @@ async function findFarmConfigPath(root) {
1667
1677
  }
1668
1678
  function hasFarmServerRuntimePlugins(config) {
1669
1679
  return (config.plugins || []).some((plugin) => {
1670
- if (_chunkN25RPPO5cjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) === false) return false;
1680
+ if (_chunkWAPQWAE6cjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) === false) return false;
1671
1681
  return Boolean(
1672
1682
  plugin.setup || plugin.init || plugin.ready || plugin.shutdown || plugin.runtime || plugin.router || plugin.render || plugin.beforeRouteMatch || plugin.afterRouteMatch || plugin.beforeRender || plugin.afterRender || plugin.onError || plugin.transformHTML
1673
1683
  );
@@ -1678,7 +1688,7 @@ function hasFarmPluginRoutes(config) {
1678
1688
  }
1679
1689
  function farmServerRuntimePluginsMayHandlePath(config, pathname) {
1680
1690
  return (config.plugins || []).some(
1681
- (plugin) => _chunkN25RPPO5cjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) !== false && _chunk47JV57DAcjs.farmPluginMayAffectRuntimePath.call(void 0, plugin, pathname)
1691
+ (plugin) => _chunkWAPQWAE6cjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) !== false && _chunk47JV57DAcjs.farmPluginMayAffectRuntimePath.call(void 0, plugin, pathname)
1682
1692
  );
1683
1693
  }
1684
1694
  async function discoverMiddlewareRoutes(appDir) {
@@ -1737,7 +1747,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
1737
1747
  assertFarmDocsRuntimeSupported(config, preset);
1738
1748
  const srcDir = config.srcDir || "src";
1739
1749
  const distDir = config.distDir || ".farm";
1740
- const deployOutputDir = _chunkKZT2VHRQcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
1750
+ const deployOutputDir = _chunkLYWAGXXWcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
1741
1751
  const lifecyclePluginManager = options.pluginManager;
1742
1752
  const productionViteResultPromise = Promise.allSettled([
1743
1753
  Promise.resolve(_nullishCoalesce(options.productionVite, () => ( _chunkMF3IA2AWcjs.loadFarmProductionVite.call(void 0, ))))
@@ -1993,7 +2003,7 @@ async function mergeBuiltFontCss(outputDir, fontCssSource) {
1993
2003
  }
1994
2004
  const normalizedFontCss = typeof fontCss === "string" ? fontCss : Buffer.from(fontCss).toString("utf8");
1995
2005
  await fs4.writeFile(fontCssPath, normalizedFontCss);
1996
- await fs4.writeFile(clientCssPath, _chunkYSPMY4B7cjs.mergeFarmFontCss.call(void 0, clientCss, normalizedFontCss));
2006
+ await fs4.writeFile(clientCssPath, _chunk474FO3UEcjs.mergeFarmFontCss.call(void 0, clientCss, normalizedFontCss));
1997
2007
  }
1998
2008
  var IncompleteClientBuildOutputError = class extends Error {
1999
2009
  constructor(detail) {
@@ -2039,7 +2049,7 @@ function getCachedClientModuleHydrationPlan(modulePath, root, mode, cache, optio
2039
2049
  const key = `${_path2.default.resolve(root)}\0${mode}\0${options.asyncOwnerIslands === true}\0${options.serverOwners === true}\0${options.serverTreeLayouts === true}\0${_path2.default.resolve(modulePath)}`;
2040
2050
  let plan = cache.get(key);
2041
2051
  if (!plan) {
2042
- plan = _chunkYSPMY4B7cjs.getClientModuleHydrationPlan.call(void 0, modulePath, root, mode, options);
2052
+ plan = _chunk474FO3UEcjs.getClientModuleHydrationPlan.call(void 0, modulePath, root, mode, options);
2043
2053
  cache.set(key, plan);
2044
2054
  }
2045
2055
  return { ...plan, isolatedBoundaries: [...plan.isolatedBoundaries] };
@@ -2047,7 +2057,7 @@ function getCachedClientModuleHydrationPlan(modulePath, root, mode, cache, optio
2047
2057
  async function buildClient(productionVite, config, root, srcDir, outputDir, pageRoutes, layoutRoutes = [], routeSlots = [], isolatedClientBoundaryModules = /* @__PURE__ */ new Set(), hydrationPlanCache = /* @__PURE__ */ new Map(), rendererBuildLifetime, programmaticClientRoutes) {
2048
2058
  const viteBuild = productionVite.build;
2049
2059
  const { farmPlugin, farmServerOnlyEntriesPlugin } = await import("./vite.cjs");
2050
- const { PluginManager: PluginManager2 } = await import("./plugin-WBANOZQM.cjs");
2060
+ const { PluginManager: PluginManager2 } = await import("./plugin-HZIBL3DW.cjs");
2051
2061
  const fs4 = await import("fs/promises");
2052
2062
  const pluginManager = new PluginManager2({
2053
2063
  config,
@@ -2056,7 +2066,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2056
2066
  });
2057
2067
  pluginManager.addPlugins(config.plugins || []);
2058
2068
  const clientPages = [];
2059
- const integrationProviders = _chunkN25RPPO5cjs.getIntegrationProviders.call(void 0, config.integrations).filter(
2069
+ const integrationProviders = _chunkWAPQWAE6cjs.getIntegrationProviders.call(void 0, config.integrations).filter(
2060
2070
  (provider) => provider.component || provider.type === "clerk"
2061
2071
  );
2062
2072
  const unsupportedIntegrationProvider = integrationProviders.find(
@@ -2067,14 +2077,14 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2067
2077
  `[Farm.js] isolated hydration kept route-wide because integration provider "${unsupportedIntegrationProvider.name}" does not declare supportsIsolatedHydration: true.`
2068
2078
  );
2069
2079
  }
2070
- const isolatedMode = _chunkYSPMY4B7cjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
2080
+ const isolatedMode = _chunk474FO3UEcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
2071
2081
  _optionalChain([config, 'access', _47 => _47.experimental, 'optionalAccess', _48 => _48.isolatedClientHydration]),
2072
2082
  {
2073
2083
  serverComponents: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _49 => _49.experimental, 'optionalAccess', _50 => _50.serverComponents])) === "rsc",
2074
2084
  hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
2075
2085
  }
2076
2086
  );
2077
- const planOptions = _chunkYSPMY4B7cjs.getFarmClientHydrationPlanOptions.call(void 0,
2087
+ const planOptions = _chunk474FO3UEcjs.getFarmClientHydrationPlanOptions.call(void 0,
2078
2088
  config.renderer,
2079
2089
  Boolean(unsupportedIntegrationProvider)
2080
2090
  );
@@ -2131,7 +2141,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2131
2141
  };
2132
2142
  }
2133
2143
  });
2134
- const layoutAppliesToRoute = _chunkC2R5RVLAcjs.routeBoundaryCoversDirectory;
2144
+ const layoutAppliesToRoute = _chunkVCKGOXFIcjs.routeBoundaryCoversDirectory;
2135
2145
  const routeDirectory = (route) => _nullishCoalesce(route.directory, () => ( route.pattern));
2136
2146
  const adapterOwnsDocsRuntime = Boolean(
2137
2147
  _chunkRD623KW4cjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _53 => _53.docs, 'optionalAccess', _54 => _54.enabled]) && _optionalChain([config, 'access', _55 => _55.docs, 'access', _56 => _56.adapter, 'optionalAccess', _57 => _57.server]) && config.docs.adapter.react
@@ -2142,7 +2152,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2142
2152
  );
2143
2153
  const syntheticDocsEntry = _optionalChain([config, 'access', _60 => _60.docs, 'optionalAccess', _61 => _61.enabled]) && !adapterOwnsDocsRuntime ? adapterDocsEntry : null;
2144
2154
  const syntheticDocsPatterns = syntheticDocsEntry ? syntheticDocsEntry === "/" ? ["/", "/[...slug]"] : [syntheticDocsEntry, `${syntheticDocsEntry}/[...slug]`] : [];
2145
- const markdownPagePlan = _chunkYSPMY4B7cjs.createMarkdownPageHydrationPlanner.call(void 0,
2155
+ const markdownPagePlan = _chunk474FO3UEcjs.createMarkdownPageHydrationPlanner.call(void 0,
2146
2156
  _chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, config.mdx), root),
2147
2157
  root,
2148
2158
  isolatedMode,
@@ -2158,7 +2168,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2158
2168
  pagePlanOptions
2159
2169
  )
2160
2170
  }));
2161
- _chunkYSPMY4B7cjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
2171
+ _chunk474FO3UEcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
2162
2172
  clientLayouts.map((layout) => ({
2163
2173
  pattern: layout.pattern,
2164
2174
  depth: layout.pattern.split("/").filter(Boolean).length,
@@ -2167,7 +2177,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2167
2177
  [
2168
2178
  ...routePlans.map(({ route, metadata }) => ({
2169
2179
  pattern: routeDirectory(route),
2170
- depth: _chunkC2R5RVLAcjs.getRouteDirectoryDepth.call(void 0, routeDirectory(route)),
2180
+ depth: _chunkVCKGOXFIcjs.getRouteDirectoryDepth.call(void 0, routeDirectory(route)),
2171
2181
  metadata
2172
2182
  })),
2173
2183
  ...syntheticDocsPatterns.map((pattern) => ({
@@ -2190,7 +2200,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2190
2200
  for (const layout of clientLayouts) {
2191
2201
  const matchesBuiltRoute = pageRoutes.some((route) => layoutAppliesToRoute(layout.pattern, routeDirectory(route))) || Boolean(adapterDocsEntry && layoutAppliesToRoute(layout.pattern, adapterDocsEntry));
2192
2202
  if (matchesBuiltRoute && layout.suppressedAsyncHydration) {
2193
- _chunkXN2MB4QZcjs.logger.warn(`\u26A0\uFE0F ${_chunkYSPMY4B7cjs.describeSuppressedAsyncHydration.call(void 0, layout.pattern, layout.fallbackReason)}`);
2203
+ _chunkXN2MB4QZcjs.logger.warn(`\u26A0\uFE0F ${_chunk474FO3UEcjs.describeSuppressedAsyncHydration.call(void 0, layout.pattern, layout.fallbackReason)}`);
2194
2204
  }
2195
2205
  }
2196
2206
  if (isolatedMode === "analyze") {
@@ -2214,7 +2224,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2214
2224
  );
2215
2225
  if (metadata.suppressedAsyncHydration) {
2216
2226
  _chunkXN2MB4QZcjs.logger.warn(
2217
- `\u26A0\uFE0F ${_chunkYSPMY4B7cjs.describeSuppressedAsyncHydration.call(void 0, route.pattern, metadata.fallbackReason)}`
2227
+ `\u26A0\uFE0F ${_chunk474FO3UEcjs.describeSuppressedAsyncHydration.call(void 0, route.pattern, metadata.fallbackReason)}`
2218
2228
  );
2219
2229
  }
2220
2230
  if (metadata.shouldHydrate || metadata.hasIsolatedClientBoundaries || applicableClientLayouts.length > 0) {
@@ -2239,7 +2249,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2239
2249
  ...applicableClientLayouts.filter((layout) => layout.hasIsolatedClientBoundaries || layout.serverTreeLayout).flatMap((layout) => layout.isolatedBoundaries)
2240
2250
  ],
2241
2251
  // The server renders a server tree only below a hydrating layout.
2242
- ..._chunkYSPMY4B7cjs.usesFarmServerTree.call(void 0, metadata) && applicableClientLayouts.some((layout) => layout.shouldHydrate) ? { serverTree: true } : {}
2252
+ ..._chunk474FO3UEcjs.usesFarmServerTree.call(void 0, metadata) && applicableClientLayouts.some((layout) => layout.shouldHydrate) ? { serverTree: true } : {}
2243
2253
  });
2244
2254
  _chunkXN2MB4QZcjs.logger.info(`\u{1F4F1} Found hydratable route: ${route.pattern} -> ${route.modulePath}`);
2245
2255
  }
@@ -2275,7 +2285,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2275
2285
  }
2276
2286
  const clientRouteSlots = routeSlots.filter((slot) => {
2277
2287
  try {
2278
- return _chunkYSPMY4B7cjs.getClientModuleMetadata.call(void 0, slot.modulePath, root).shouldHydrate;
2288
+ return _chunk474FO3UEcjs.getClientModuleMetadata.call(void 0, slot.modulePath, root).shouldHydrate;
2279
2289
  } catch (error) {
2280
2290
  _chunkXN2MB4QZcjs.logger.warn(`\u26A0\uFE0F Could not inspect route slot ${slot.modulePath}: ${error}`);
2281
2291
  return false;
@@ -2303,9 +2313,9 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2303
2313
  config.renderer,
2304
2314
  config.publicRuntimeConfig,
2305
2315
  config.trailingSlash,
2306
- _chunkN25RPPO5cjs.getIntegrationProviders.call(void 0, config.integrations),
2316
+ _chunkWAPQWAE6cjs.getIntegrationProviders.call(void 0, config.integrations),
2307
2317
  config.basePath,
2308
- _chunkYSPMY4B7cjs.generateClientCachePersistenceCode.call(void 0, _chunkYSPMY4B7cjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, config.cache)),
2318
+ _chunk474FO3UEcjs.generateClientCachePersistenceCode.call(void 0, _chunk474FO3UEcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, config.cache)),
2309
2319
  adapterOwnsDocsRuntime ? _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0,
2310
2320
  _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _67 => _67.experimental, 'optionalAccess', _68 => _68.serverComponents])) === "islands"
2311
2321
  );
@@ -2394,7 +2404,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2394
2404
  }
2395
2405
  },
2396
2406
  plugins: [
2397
- _chunkYSPMY4B7cjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
2407
+ _chunk474FO3UEcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
2398
2408
  createFarmPrivateClientSourcemapsPlugin({
2399
2409
  outDir: _path2.default.join(_path2.default.dirname(outputDir), FARM_CLIENT_SOURCEMAPS_DIR)
2400
2410
  }),
@@ -2419,7 +2429,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2419
2429
  ...rendererVitePlugins,
2420
2430
  ...config.vite.plugins || [],
2421
2431
  farmServerOnlyEntriesPlugin(),
2422
- _chunkYSPMY4B7cjs.farmDocsClientConfigPlugin.call(void 0,
2432
+ _chunk474FO3UEcjs.farmDocsClientConfigPlugin.call(void 0,
2423
2433
  adapterOwnsDocsRuntime ? _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0
2424
2434
  ),
2425
2435
  // Plugin to redirect @farm.js/core imports to client-only exports
@@ -2481,7 +2491,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2481
2491
  } : void 0,
2482
2492
  // Ensure React is bundled for client
2483
2493
  resolve: {
2484
- alias: _chunkYSPMY4B7cjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
2494
+ alias: _chunk474FO3UEcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
2485
2495
  dedupe: [...config.renderer.dedupe || []]
2486
2496
  },
2487
2497
  // Optimize dependencies - exclude server-side code from client bundle
@@ -2494,7 +2504,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2494
2504
  ]
2495
2505
  }
2496
2506
  };
2497
- await viteBuild(_chunkYSPMY4B7cjs.mergeFarmProductionViteConfig.call(void 0, clientViteConfig, config.vite));
2507
+ await viteBuild(_chunk474FO3UEcjs.mergeFarmProductionViteConfig.call(void 0, clientViteConfig, config.vite));
2498
2508
  await mergeBuiltFontCss(outputDir);
2499
2509
  await validateClientBuildOutput(root, srcDir, outputDir);
2500
2510
  } finally {
@@ -2513,7 +2523,7 @@ function toBakedMarkdownSourcePath(root, filePath) {
2513
2523
  }
2514
2524
  return relative.split(_path2.default.sep).join("/");
2515
2525
  }
2516
- function generateUniversalRouterStateRuntime() {
2526
+ function generateUniversalRouterStateRuntime(streamNavigations = false) {
2517
2527
  return `
2518
2528
  const FARM_PAGE_STATE_KEY = "__farmPageState";
2519
2529
  const FARM_HISTORY_INDEX_KEY = "__farmHistoryIndex";
@@ -2581,6 +2591,46 @@ async function fetchFarmNavigationDocument(url, headers, recover = true, signal)
2581
2591
  return response;
2582
2592
  }
2583
2593
 
2594
+ ${streamNavigations ? `const FARM_FLUSH_MARKER = "<!--farm-flush-->";
2595
+
2596
+ // Reads a streamed navigation (F-Stream) up to the end of React's shell. \`next\` then resolves
2597
+ // with each later flush as it ends, and null at the end; a document without a marker is all shell.
2598
+ async function readFarmNavigationStream(body) {
2599
+ const reader = body.getReader();
2600
+ const decoder = new TextDecoder();
2601
+ let text = "";
2602
+ let done = false;
2603
+ const next = async function() {
2604
+ for (;;) {
2605
+ const at = text.indexOf(FARM_FLUSH_MARKER);
2606
+ if (at !== -1) {
2607
+ const flush = text.slice(0, at);
2608
+ text = text.slice(at + FARM_FLUSH_MARKER.length);
2609
+ return flush;
2610
+ }
2611
+ if (done) {
2612
+ const flush = text;
2613
+ text = "";
2614
+ return flush ? flush : null;
2615
+ }
2616
+ const result = await reader.read();
2617
+ if (result.done) {
2618
+ done = true;
2619
+ text += decoder.decode();
2620
+ } else {
2621
+ text += decoder.decode(result.value, { stream: true });
2622
+ }
2623
+ }
2624
+ };
2625
+ const shell = await next();
2626
+ if (done && !text) return { shell: shell || "" };
2627
+ return {
2628
+ shell: shell,
2629
+ next: next,
2630
+ cancel: function() { reader.cancel().catch(function() {}); },
2631
+ };
2632
+ }` : ""}
2633
+
2584
2634
  function clearFarmPrefetchCacheOnDeploymentMismatch(router, error) {
2585
2635
  if (error?.name === "FarmDeploymentMismatchError") {
2586
2636
  router.clearCache();
@@ -2784,9 +2834,35 @@ function interpolateRedirectDestination(destination, params) {
2784
2834
  }
2785
2835
  `.trim();
2786
2836
  }
2787
- function generateUniversalRouterStateProperties() {
2837
+ function generateUniversalRouterStateProperties(streamNavigations = false) {
2788
2838
  return `
2789
- blockers: new Set(),
2839
+ ${streamNavigations ? ` // A streamed navigation swaps in the page's shell; its Suspense content follows flush by flush.
2840
+ navigationStream: null,
2841
+ streamingNavigation: null,
2842
+ takeNavigationStream: function(html) {
2843
+ const stream = this.navigationStream;
2844
+ this.navigationStream = null;
2845
+ if (!stream) return;
2846
+ if (stream.html !== html) {
2847
+ stream.cancel();
2848
+ return;
2849
+ }
2850
+ this.streamingNavigation = stream;
2851
+ void streamFarmNavigation(
2852
+ stream,
2853
+ document.getElementById("root") || document.body,
2854
+ () => this.streamingNavigation === stream,
2855
+ );
2856
+ },
2857
+ stopNavigationStream: function() {
2858
+ this.navigationStream?.cancel();
2859
+ this.streamingNavigation?.cancel();
2860
+ this.navigationStream = null;
2861
+ this.streamingNavigation = null;
2862
+ },
2863
+ ` : ` takeNavigationStream: function() {},
2864
+ stopNavigationStream: function() {},
2865
+ `} blockers: new Set(),
2790
2866
  unloadBlockers: new Map(),
2791
2867
  navigationListeners: new Set(),
2792
2868
  navigationState: IDLE_NAVIGATION_STATE,
@@ -3080,6 +3156,11 @@ function generateUniversalRouterStateProperties() {
3080
3156
  // Only speculative requests have shared ownership. Ordinary navigations
3081
3157
  // keep their own abort signal and cannot cancel another caller's work.
3082
3158
  const record = recover ? null : { valid: true, deploymentId, promise: null };
3159
+ // A navigation (not a prefetch) streams when the router supports it: the page goes in as
3160
+ // soon as its shell arrives, and its Suspense content follows (takeNavigationStream). A page
3161
+ // whose layouts hydrate, or one rendered in this page's React root, arrives whole.
3162
+ const streamShell = ${streamNavigations ? `recover && !interceptFrom && !partialHeaders["F-Render"] &&
3163
+ !hasHydratableLayout(new URL(url, window.location.href).pathname)` : "false"};
3083
3164
  const request = async () => {
3084
3165
  const response = await fetchFarmNavigationDocument(url, {
3085
3166
  "Accept": "text/html",
@@ -3088,13 +3169,28 @@ function generateUniversalRouterStateProperties() {
3088
3169
  // layouts it shows.
3089
3170
  ...getFarmIslandValueHeaders(),
3090
3171
  ...partialHeaders,
3172
+ ...(streamShell ? { "F-Stream": "flush" } : {}),
3091
3173
  }, recover, signal);
3092
3174
  if (!response.ok) throw new Error("Failed to fetch page");
3093
- const html = await response.text();
3094
- if (cacheResult && !signal?.aborted && generation === this.prefetchGeneration &&
3095
- deploymentId === window.__FARM_DEPLOYMENT_ID__ && (!record || record.valid)) {
3096
- this.storePrefetchedHtml(cacheKey, html);
3175
+ const store = (html) => {
3176
+ if (cacheResult && !signal?.aborted && generation === this.prefetchGeneration &&
3177
+ deploymentId === window.__FARM_DEPLOYMENT_ID__ && (!record || record.valid)) {
3178
+ this.storePrefetchedHtml(cacheKey, html);
3179
+ }
3180
+ };
3181
+ ${streamNavigations ? ` if (streamShell && response.body) {
3182
+ const streamed = await readFarmNavigationStream(response.body);
3183
+ if (!streamed.next) {
3184
+ store(streamed.shell);
3185
+ return streamed.shell;
3186
+ }
3187
+ this.stopNavigationStream();
3188
+ this.navigationStream = { html: streamed.shell, next: streamed.next, cancel: streamed.cancel, store };
3189
+ return streamed.shell;
3097
3190
  }
3191
+ ` : ""}
3192
+ const html = await response.text();
3193
+ store(html);
3098
3194
  return html;
3099
3195
  };
3100
3196
  if (!record) return request();
@@ -3283,7 +3379,7 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
3283
3379
  direction: {}
3284
3380
  }, plugins = [], renderer = _chunkRD623KW4cjs.REACT_RENDERER, publicRuntimeConfig = void 0, trailingSlash = false, integrationProviders = [], basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule, islandValues = false) {
3285
3381
  const toImportPath = (targetPath) => targetPath.replace(/\\/g, "/");
3286
- const clientPluginEntry = _chunkYSPMY4B7cjs.generateFarmClientPluginEntryCode.call(void 0,
3382
+ const clientPluginEntry = _chunk474FO3UEcjs.generateFarmClientPluginEntryCode.call(void 0,
3287
3383
  plugins,
3288
3384
  root,
3289
3385
  srcDir,
@@ -3294,7 +3390,7 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
3294
3390
  import { createRoot, hydrateRoot } from "react-dom/client";` : appSetupPath ? `import React, { createRoot, hydrateRoot, configureApp as __farmConfigureApp } from ${JSON.stringify(renderer.client)};
3295
3391
  import __farmAppSetup from ${JSON.stringify(_chunkXN2MB4QZcjs.toPosixPath.call(void 0, appSetupPath))};
3296
3392
  __farmConfigureApp(__farmAppSetup);` : `import React, { createRoot, hydrateRoot } from ${JSON.stringify(renderer.client)};`;
3297
- const providerClientCode = _chunkYSPMY4B7cjs.generateFarmIntegrationProviderClientCode.call(void 0,
3393
+ const providerClientCode = _chunk474FO3UEcjs.generateFarmIntegrationProviderClientCode.call(void 0,
3298
3394
  integrationProviders,
3299
3395
  root,
3300
3396
  _nullishCoalesce(renderer.componentExtensions, () => ( []))
@@ -3304,18 +3400,18 @@ __farmConfigureApp(__farmAppSetup);` : `import React, { createRoot, hydrateRoot
3304
3400
  const layoutImportStatements = [];
3305
3401
  const layoutRegistrations = [];
3306
3402
  const hydratingLayoutPatterns = layoutRoutes.filter((layout) => layout.shouldHydrate).map((layout) => layout.pattern);
3307
- const treeLayoutPatterns = islandValues ? _chunkC2R5RVLAcjs.getFarmServerTreeLayoutPatterns.call(void 0, layoutRoutes) : /* @__PURE__ */ new Set();
3403
+ const treeLayoutPatterns = islandValues ? _chunkVCKGOXFIcjs.getFarmServerTreeLayoutPatterns.call(void 0, layoutRoutes) : /* @__PURE__ */ new Set();
3308
3404
  layoutRoutes.forEach((layout, index) => {
3309
3405
  const relativePath = toImportPath(layout.modulePath);
3310
3406
  const treeLayout = treeLayoutPatterns.has(layout.pattern);
3311
3407
  const rendersOnClient = treeLayout || !layout.hasIsolatedClientBoundaries && hydratingLayoutPatterns.some(
3312
- (pattern) => _chunkC2R5RVLAcjs.layoutsCanCoverSamePage.call(void 0, layout.pattern, pattern)
3408
+ (pattern) => _chunkVCKGOXFIcjs.layoutsCanCoverSamePage.call(void 0, layout.pattern, pattern)
3313
3409
  );
3314
3410
  if (rendersOnClient && !treeLayout) {
3315
3411
  layoutImportStatements.push(`import Layout${index} from "${relativePath}";`);
3316
3412
  }
3317
- const groupScope = _chunkC2R5RVLAcjs.getRouteGroupScope.call(void 0, layout.pattern);
3318
- const groupFields = groupScope ? `, urlPattern: ${JSON.stringify(_chunkC2R5RVLAcjs.stripRouteGroups.call(void 0, layout.pattern))}, groupScope: ${JSON.stringify(groupScope)}` : "";
3413
+ const groupScope = _chunkVCKGOXFIcjs.getRouteGroupScope.call(void 0, layout.pattern);
3414
+ const groupFields = groupScope ? `, urlPattern: ${JSON.stringify(_chunkVCKGOXFIcjs.stripRouteGroups.call(void 0, layout.pattern))}, groupScope: ${JSON.stringify(groupScope)}` : "";
3319
3415
  layoutRegistrations.push(
3320
3416
  ` { pattern: ${JSON.stringify(layout.pattern)}${groupFields}, Component: ${rendersOnClient ? treeLayout ? `getFarmTreeLayoutComponent(${JSON.stringify(layout.pattern)})` : `Layout${index}` : "null"}, shouldHydrate: ${JSON.stringify(layout.shouldHydrate)}, islandStrategy: ${JSON.stringify(layout.islandStrategy)}${treeLayout ? ", serverTree: true" : ""} }`
3321
3417
  );
@@ -3375,7 +3471,7 @@ function isFarmDocsPath() {
3375
3471
  // Farm.js Client Runtime (no client components)
3376
3472
  ${cssImport}
3377
3473
  ${layoutImports}
3378
- import { createClientCancellation, createClientPluginManager, getFarmIslandValueHeaders, getHashTargetElement, installChunkErrorRecovery, isFarmBlockedNavigationURL, isFarmExternalNavigationURL, reconcileFarmDocumentHead, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from "@farm.js/core/internal/client-runtime";
3474
+ import { createClientCancellation, createClientPluginManager, getFarmIslandValueHeaders, getHashTargetElement, installChunkErrorRecovery, isFarmBlockedNavigationURL, isFarmExternalNavigationURL, reconcileFarmDocumentHead, runFarmNavigationDelegates, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from "@farm.js/core/internal/client-runtime";
3379
3475
  import { createFarmDeploymentMismatchError, createFarmDeploymentRequestHeaders, isFarmDeploymentMismatchResponse } from "@farm.js/core/deployment";
3380
3476
  ${clientPluginEntry.imports}
3381
3477
  ${clientCachePersistence.imports}
@@ -3440,6 +3536,15 @@ ${generateUniversalRouterStateProperties()}
3440
3536
  if (action === "pop") this.revertBlockedPopState(from);
3441
3537
  return;
3442
3538
  }
3539
+ // A refresh re-renders the page on screen; only a move to another page is offered.
3540
+ if (
3541
+ action !== "pop" &&
3542
+ !(options.refresh && to === from) &&
3543
+ (await runFarmNavigationDelegates({ url: url.href, from, to, action }))
3544
+ ) {
3545
+ this.cancelActiveNavigation();
3546
+ return;
3547
+ }
3443
3548
  if (action === "pop") {
3444
3549
  this.currentHistoryIndex = readHistoryIndex(options.popState);
3445
3550
  this.currentHistoryState = options.popState;
@@ -3740,7 +3845,7 @@ ${layoutImports}
3740
3845
  ${rendererClientImports}
3741
3846
  ${isolatedHydrationImport}
3742
3847
  ${providerClientCode.imports}
3743
- import { createClientCancellation, createClientPluginManager, getFarmIslandValueHeaders, getHashTargetElement, installChunkErrorRecovery, isFarmBlockedNavigationURL, isFarmExternalNavigationURL, reconcileFarmDocumentHead, scheduleFarmIslandHydration, searchParamsToObject, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from "@farm.js/core/internal/client-runtime";
3848
+ import { createClientCancellation, createClientPluginManager, getFarmIslandValueHeaders, getHashTargetElement, installChunkErrorRecovery, isFarmBlockedNavigationURL, isFarmExternalNavigationURL, reconcileFarmDocumentHead, runFarmNavigationDelegates, scheduleFarmIslandHydration, searchParamsToObject, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from "@farm.js/core/internal/client-runtime";
3744
3849
  import { createFarmDeploymentMismatchError, createFarmDeploymentRequestHeaders, isFarmDeploymentMismatchResponse } from "@farm.js/core/deployment";
3745
3850
  import { createFarmRouter, isFarmRouteActive, matchFarmRoute } from "@farm.js/core/router";
3746
3851
  ${clientPluginEntry.imports}
@@ -3819,7 +3924,7 @@ function hasHydratableLayout(pathname) {
3819
3924
  });
3820
3925
  }
3821
3926
 
3822
- ${_chunkYSPMY4B7cjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
3927
+ ${_chunk474FO3UEcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
3823
3928
  // Wrap a page element with applicable layouts
3824
3929
  function wrapWithLayouts(pageElement, pathname, params) {
3825
3930
  const layouts = getApplicableLayouts(pathname);
@@ -3854,7 +3959,7 @@ function createLayoutPageBoundary(route, pageElement, serverHtml) {
3854
3959
  return React.createElement("div", props, pageElement);
3855
3960
  }
3856
3961
  let farmLastRouteState = null;
3857
- ${hasServerTreeLayouts && islandValues && isolatedHydrationEnabled ? `${_chunkYSPMY4B7cjs.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE}
3962
+ ${hasServerTreeLayouts && islandValues && isolatedHydrationEnabled ? `${_chunk474FO3UEcjs.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE}
3858
3963
  function farmTreeLayoutsOf(pathname) {
3859
3964
  return getApplicableLayouts(pathname).filter(function(layout) {
3860
3965
  return layout.serverTree === true;
@@ -4172,7 +4277,7 @@ let currentPathname = null;
4172
4277
  let isHydrated = false;
4173
4278
  let pendingPageHydrationController = null;
4174
4279
 
4175
- ${generateUniversalRouterStateRuntime()}
4280
+ ${generateUniversalRouterStateRuntime(islandValues)}
4176
4281
 
4177
4282
  function cancelPendingPageHydration() {
4178
4283
  pendingPageHydrationController?.abort();
@@ -4360,6 +4465,55 @@ function activateNavigationScripts(root) {
4360
4465
  }
4361
4466
  }
4362
4467
 
4468
+ ${islandValues ? `// Adds the flushes after a streamed navigation's shell: React's staged Suspense content and the
4469
+ // scripts that reveal it. In islands mode, the islands React reveals hydrate as they appear, and
4470
+ // the ones it removes (a replaced fallback) are released.
4471
+ async function streamFarmNavigation(stream, root, isCurrent) {
4472
+ let html = stream.html;
4473
+ let streaming = true;
4474
+ ${isolatedHydrationEnabled ? `const removed = new Set();
4475
+ let queued = false;
4476
+ const run = function() {
4477
+ queued = false;
4478
+ if (!isCurrent()) return observer.disconnect();
4479
+ for (const node of removed) if (!node.isConnected) disposeFarmIsolatedClientBoundaries(node);
4480
+ removed.clear();
4481
+ if (!streaming && !root.querySelector('div[hidden][id^="S:"]')) observer.disconnect();
4482
+ hydrateFarmIsolatedClientBoundaries(root).catch(function(error) {
4483
+ console.error("[Farm.js] Hydrating streamed islands failed:", error);
4484
+ });
4485
+ };
4486
+ const observer = new MutationObserver(function(records) {
4487
+ for (const record of records) for (const node of record.removedNodes) removed.add(node);
4488
+ if (queued) return;
4489
+ queued = true;
4490
+ queueMicrotask(run);
4491
+ });
4492
+ observer.observe(root, { childList: true, subtree: true });` : "const observer = { disconnect: function() {} };"}
4493
+ try {
4494
+ for (let flush = await stream.next(); flush !== null; flush = await stream.next()) {
4495
+ if (!isCurrent()) return stream.cancel();
4496
+ html += flush;
4497
+ const parsed = new DOMParser().parseFromString('<div id="root">' + flush, "text/html");
4498
+ const fragment = document.createDocumentFragment();
4499
+ for (const node of Array.from(parsed.getElementById("root").childNodes)) fragment.appendChild(node);
4500
+ activateNavigationScripts(fragment);
4501
+ root.appendChild(fragment);
4502
+ }
4503
+ } catch (error) {
4504
+ streaming = false;
4505
+ if (!isCurrent()) return observer.disconnect();
4506
+ console.error("[Farm.js] A streamed navigation failed:", error);
4507
+ ${isolatedHydrationEnabled ? "farmIsolatedHydrationRuntime.endStream?.(root);\n if (!queued) run();" : ""}
4508
+ return;
4509
+ }
4510
+ // A cancelled stream ends early: keep its partial document out of the cache.
4511
+ if (!isCurrent()) return observer.disconnect();
4512
+ streaming = false;
4513
+ stream.store(html);
4514
+ ${isolatedHydrationEnabled ? "farmIsolatedHydrationRuntime.endStream?.(root);\n if (!queued) run();" : ""}
4515
+ }` : ""}
4516
+
4363
4517
  function replaceSharedLayoutBoundary(currentRoot, nextRoot, refresh = false) {
4364
4518
  const currentPatterns = getLayoutPatterns(currentRoot);
4365
4519
  const nextPatterns = getLayoutPatterns(nextRoot);
@@ -4402,7 +4556,7 @@ function replaceSharedLayoutBoundary(currentRoot, nextRoot, refresh = false) {
4402
4556
 
4403
4557
  // SPA Router
4404
4558
  const spaRouter = {
4405
- ${generateUniversalRouterStateProperties()}
4559
+ ${generateUniversalRouterStateProperties(islandValues)}
4406
4560
  prefetchCache: new Map(),
4407
4561
  ${islandValues ? ` // Islands mode: navigations name the layouts on screen, and say when this page renders the
4408
4562
  // next one in its own React root; the server leaves out what the browser keeps or rebuilds.
@@ -4414,7 +4568,7 @@ ${islandValues ? ` // Islands mode: navigations name the layouts on screen, and
4414
4568
  ...(reactRoot && reactRootContainer === root ? { "F-Render": "tree" } : {}),
4415
4569
  };
4416
4570
  },
4417
- ` : ""}
4571
+ ` : ""}
4418
4572
  navigate: async function(href, options = {}) {
4419
4573
  const url = new URL(href, window.location.href);
4420
4574
  if (isFarmBlockedNavigationURL(url)) return;
@@ -4460,6 +4614,15 @@ ${islandValues ? ` // Islands mode: navigations name the layouts on screen, and
4460
4614
  if (action === "pop") this.revertBlockedPopState(from);
4461
4615
  return;
4462
4616
  }
4617
+ // A refresh re-renders the page on screen; only a move to another page is offered.
4618
+ if (
4619
+ action !== "pop" &&
4620
+ !(options.refresh && to === from) &&
4621
+ (await runFarmNavigationDelegates({ url: url.href, from, to, action }))
4622
+ ) {
4623
+ this.cancelActiveNavigation();
4624
+ return;
4625
+ }
4463
4626
  if (action === "pop") {
4464
4627
  this.currentHistoryIndex = readHistoryIndex(options.popState);
4465
4628
  this.currentHistoryState = options.popState;
@@ -4467,6 +4630,7 @@ ${islandValues ? ` // Islands mode: navigations name the layouts on screen, and
4467
4630
 
4468
4631
  // A route transition invalidates any trigger waiting on the previous DOM boundary.
4469
4632
  cancelPendingPageHydration();
4633
+ this.stopNavigationStream();
4470
4634
  this.saveScrollPosition(window.location.pathname + window.location.search);
4471
4635
  const navigation = this.startNavigation(from, url, action);
4472
4636
  // A refresh keeps the islands still on the page (islands mode).
@@ -4591,6 +4755,7 @@ ${islandValues ? ` // Islands mode: navigations name the layouts on screen, and
4591
4755
  if (!this.isCurrentNavigation(navigation, clientNavigation)) return;
4592
4756
  await this.runViewTransition(options.viewTransition, async () => {
4593
4757
  if (!this.isCurrentNavigation(navigation, clientNavigation)) return;
4758
+ let swappedHtml = html;
4594
4759
  let swapped = await this.swapContent(
4595
4760
  html,
4596
4761
  url.pathname + url.search,
@@ -4610,6 +4775,7 @@ ${islandValues ? ` // Islands mode: navigations name the layouts on screen, and
4610
4775
  false,
4611
4776
  );
4612
4777
  if (!this.isCurrentNavigation(navigation, clientNavigation)) return;
4778
+ swappedHtml = documentHtml;
4613
4779
  swapped = await this.swapContent(
4614
4780
  documentHtml,
4615
4781
  url.pathname + url.search,
@@ -4621,6 +4787,7 @@ ${islandValues ? ` // Islands mode: navigations name the layouts on screen, and
4621
4787
  if (!swapped || swapped === "segment-mismatch") {
4622
4788
  throw new Error("Farm could not swap the target document");
4623
4789
  }
4790
+ this.takeNavigationStream(swappedHtml);
4624
4791
  this.writeHistoryEntry(action, url.pathname + url.search, options.state, url);
4625
4792
  currentPathname = pathname;
4626
4793
  this.currentPath = to;
@@ -4910,7 +5077,7 @@ void hydrate();
4910
5077
  async function buildSSRInMemory(productionVite, config, root, routeManager, apiRouteManager, serverRenderer, preset, collectedPageRoutes, collectedLayoutRoutes, collectedRouteSlots, isolatedClientBoundaryModules, hydrationPlanCache, rendererBuildLifetime) {
4911
5078
  const viteBuild = productionVite.build;
4912
5079
  const { farmPlugin, farmServerOnlyEntriesPlugin } = await import("./vite.cjs");
4913
- const { PluginManager: PluginManager2 } = await import("./plugin-WBANOZQM.cjs");
5080
+ const { PluginManager: PluginManager2 } = await import("./plugin-HZIBL3DW.cjs");
4914
5081
  const fs4 = await import("fs/promises");
4915
5082
  const pluginManager = new PluginManager2({
4916
5083
  config,
@@ -5027,7 +5194,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
5027
5194
  }
5028
5195
  const middlewareRoutes = await discoverMiddlewareRoutes(appDirs);
5029
5196
  const instrumentationPath = _chunkBRWIVOV4cjs.resolveFarmInstrumentationFile.call(void 0, root, config.srcDir || "src");
5030
- const notFoundPath = _chunkYSPMY4B7cjs.resolveFarmNotFoundComponentPath.call(void 0, config, appDirs);
5197
+ const notFoundPath = _chunk474FO3UEcjs.resolveFarmNotFoundComponentPath.call(void 0, config, appDirs);
5031
5198
  if (notFoundPath) _chunkXN2MB4QZcjs.logger.info(`\u{1F4CB} Found custom 404 page: ${notFoundPath}`);
5032
5199
  layoutRoutes.sort((a, b) => {
5033
5200
  const depthA = a.pattern.split("/").filter(Boolean).length;
@@ -5044,13 +5211,13 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
5044
5211
  const hasServerRuntimeIntegrations = configuredIntegrationValues.some(
5045
5212
  (integration) => typeof integration === "object" && integration !== null && (!("serverRuntime" in integration) || integration.serverRuntime !== false)
5046
5213
  );
5047
- const hasIntegrationProviders = _chunkN25RPPO5cjs.getIntegrationProviders.call(void 0, config.integrations).some(
5214
+ const hasIntegrationProviders = _chunkWAPQWAE6cjs.getIntegrationProviders.call(void 0, config.integrations).some(
5048
5215
  (provider) => provider.component || provider.type === "clerk"
5049
5216
  );
5050
5217
  const hasObservabilityHandler = !!config.observability && typeof config.observability === "object" && "onEvent" in config.observability;
5051
5218
  const hasMdxComponentConfig = Boolean(_optionalChain([config, 'access', _75 => _75.mdx, 'optionalAccess', _76 => _76.components]));
5052
- const hasMiddlewareConfig = _chunkC2R5RVLAcjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
5053
- const hasRouteContextConfig = _chunkKZT2VHRQcjs.hasCustomFarmRouteContext.call(void 0, config);
5219
+ const hasMiddlewareConfig = _chunkVCKGOXFIcjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
5220
+ const hasRouteContextConfig = _chunkLYWAGXXWcjs.hasCustomFarmRouteContext.call(void 0, config);
5054
5221
  const hasServerRuntimePlugins = hasFarmServerRuntimePlugins(config);
5055
5222
  const hasPluginRoutes = hasFarmPluginRoutes(config);
5056
5223
  const hasServerCacheConfig = hasFarmServerCacheConfig(config.cache);
@@ -5060,9 +5227,9 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
5060
5227
  const hasConfiguredRuntimePlugins = Boolean(
5061
5228
  hasRuntimeConfigModule && (config.plugins || []).length > 0
5062
5229
  );
5063
- if (_chunkQNQEK3OFcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
5230
+ if (_chunk4T25YCZ5cjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
5064
5231
  const adapterGuardedPaths = new Set(getFarmDocsGuardedPaths(config, middlewareRoutes));
5065
- _chunkQNQEK3OFcjs.assertFarmDocsAdapterServesNoGuardedPages.call(void 0,
5232
+ _chunk4T25YCZ5cjs.assertFarmDocsAdapterServesNoGuardedPages.call(void 0,
5066
5233
  config.docs,
5067
5234
  { root, srcDir: config.srcDir },
5068
5235
  (pathname) => adapterGuardedPaths.has(pathname)
@@ -5071,7 +5238,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
5071
5238
  const farmDocsCspNonceMarker = _chunk6JHZPB52cjs.createFarmCspNonce.call(void 0, config.security);
5072
5239
  const farmDocsPrecompiledManifest = _optionalChain([config, 'access', _77 => _77.docs, 'optionalAccess', _78 => _78.enabled]) && _chunkE552H232cjs.getFarmPresetRuntime.call(void 0, preset) === "edge" ? await _chunkHNAISJFDcjs._runWithFarmCspNonce.call(void 0,
5073
5240
  farmDocsCspNonceMarker,
5074
- async () => _optionalChain([config, 'access', _79 => _79.docs, 'access', _80 => _80.adapter, 'optionalAccess', _81 => _81.server]) ? await _chunkQNQEK3OFcjs.compileFarmDocsAdapterEdgeManifest.call(void 0, config.docs, {
5241
+ async () => _optionalChain([config, 'access', _79 => _79.docs, 'access', _80 => _80.adapter, 'optionalAccess', _81 => _81.server]) ? await _chunk4T25YCZ5cjs.compileFarmDocsAdapterEdgeManifest.call(void 0, config.docs, {
5075
5242
  root,
5076
5243
  srcDir: config.srcDir,
5077
5244
  clientEntry: FARM_CLIENT_JS_SRC_PLACEHOLDER,
@@ -5233,7 +5400,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
5233
5400
  __FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _87 => _87.env, 'optionalAccess', _88 => _88.public]) || {})
5234
5401
  },
5235
5402
  plugins: [
5236
- _chunkYSPMY4B7cjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
5403
+ _chunk474FO3UEcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
5237
5404
  ...tailwindVitePlugin ? [tailwindVitePlugin] : [],
5238
5405
  ...rendererVitePlugins,
5239
5406
  ...config.vite.plugins || [],
@@ -5294,7 +5461,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
5294
5461
  resolve: {
5295
5462
  alias: [
5296
5463
  ...shouldAliasReactServerToWebBuild(config.renderer, preset) ? [createFarmReactWebServerAlias(hasReactDomEdgeServerBuild(root))] : [],
5297
- ...Object.entries(_chunkYSPMY4B7cjs.createFarmSourceAlias.call(void 0, root, config.srcDir)).map(
5464
+ ...Object.entries(_chunk474FO3UEcjs.createFarmSourceAlias.call(void 0, root, config.srcDir)).map(
5298
5465
  ([find, replacement]) => ({ find, replacement })
5299
5466
  )
5300
5467
  ],
@@ -5302,7 +5469,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
5302
5469
  dedupe: [...config.renderer.dedupe || []]
5303
5470
  }
5304
5471
  };
5305
- await viteBuild(_chunkYSPMY4B7cjs.mergeFarmProductionViteConfig.call(void 0, serverViteConfig, config.vite));
5472
+ await viteBuild(_chunk474FO3UEcjs.mergeFarmProductionViteConfig.call(void 0, serverViteConfig, config.vite));
5306
5473
  } finally {
5307
5474
  if (postcssConfigDir) {
5308
5475
  try {
@@ -5339,7 +5506,7 @@ function readFarmPageLastModified(pageRoutes) {
5339
5506
  }
5340
5507
  function getFarmDocsGuardedPaths(config, middlewareRoutes) {
5341
5508
  if (!_optionalChain([config, 'access', _89 => _89.docs, 'optionalAccess', _90 => _90.enabled])) return [];
5342
- const contentDir = _chunkEVCQX243cjs.resolveFarmDocsContentDir.call(void 0, config.docs, {
5509
+ const contentDir = _chunkX2EL3BLHcjs.resolveFarmDocsContentDir.call(void 0, config.docs, {
5343
5510
  root: config.root,
5344
5511
  srcDir: config.srcDir
5345
5512
  });
@@ -5347,7 +5514,7 @@ function getFarmDocsGuardedPaths(config, middlewareRoutes) {
5347
5514
  config: { middleware: config.middleware, integrations: config.integrations },
5348
5515
  middlewareRoutes
5349
5516
  };
5350
- return _chunkEVCQX243cjs.discoverFarmDocsPages.call(void 0, contentDir, config.docs).flatMap((page) => [page.href, _chunkEVCQX243cjs.getFarmDocsMarkdownPath.call(void 0, page.href)]).filter((pathname) => _chunkC2R5RVLAcjs.farmPathGuardCoversPage.call(void 0, guards, pathname));
5517
+ return _chunkX2EL3BLHcjs.discoverFarmDocsPages.call(void 0, contentDir, config.docs).flatMap((page) => [page.href, _chunkX2EL3BLHcjs.getFarmDocsMarkdownPath.call(void 0, page.href)]).filter((pathname) => _chunkVCKGOXFIcjs.farmPathGuardCoversPage.call(void 0, guards, pathname));
5351
5518
  }
5352
5519
  function getFarmAppOwnedDocsEnginePaths(agent, applicationMetadataRoutes) {
5353
5520
  const llmsTxt = _optionalChain([agent, 'optionalAccess', _91 => _91.llmsTxt]);
@@ -5749,9 +5916,9 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
5749
5916
  const hasGeneratedMetadataImages = metadataImageRoutes.some(
5750
5917
  (image) => image.sourceType === "module"
5751
5918
  );
5752
- const hasMiddlewareRuntime = middlewareRoutes.length > 0 || _chunkC2R5RVLAcjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
5919
+ const hasMiddlewareRuntime = middlewareRoutes.length > 0 || _chunkVCKGOXFIcjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
5753
5920
  const farmDocsFontAssets = _optionalChain([config, 'access', _116 => _116.docs, 'optionalAccess', _117 => _117.enabled]) ? _chunkERMUL73Lcjs.toFarmDocsPublicFontAssets.call(void 0, _chunkERMUL73Lcjs.resolveFarmDocsFontAssets.call(void 0, config.root)) : [];
5754
- const integrationProviders = _chunkN25RPPO5cjs.getIntegrationProviders.call(void 0, config.integrations);
5921
+ const integrationProviders = _chunkWAPQWAE6cjs.getIntegrationProviders.call(void 0, config.integrations);
5755
5922
  const renderedIntegrationProviders = integrationProviders.filter(
5756
5923
  (provider) => provider.component || provider.type === "clerk"
5757
5924
  );
@@ -5760,7 +5927,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
5760
5927
  `Integration provider components are not supported by the "${config.renderer.name}" renderer.`
5761
5928
  );
5762
5929
  }
5763
- const providerServerModules = _chunkYSPMY4B7cjs.generateFarmIntegrationProviderServerModules.call(void 0,
5930
+ const providerServerModules = _chunk474FO3UEcjs.generateFarmIntegrationProviderServerModules.call(void 0,
5764
5931
  renderedIntegrationProviders,
5765
5932
  config.root,
5766
5933
  _nullishCoalesce(config.renderer.componentExtensions, () => ( []))
@@ -5780,14 +5947,14 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
5780
5947
  const unsupportedIntegrationProvider = renderedIntegrationProviders.find(
5781
5948
  (provider) => provider.supportsIsolatedHydration !== true
5782
5949
  );
5783
- const isolatedHydrationMode = _chunkYSPMY4B7cjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
5950
+ const isolatedHydrationMode = _chunk474FO3UEcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
5784
5951
  _optionalChain([config, 'access', _120 => _120.experimental, 'optionalAccess', _121 => _121.isolatedClientHydration]),
5785
5952
  {
5786
5953
  serverComponents: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _122 => _122.experimental, 'optionalAccess', _123 => _123.serverComponents])) === "rsc",
5787
5954
  hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
5788
5955
  }
5789
5956
  );
5790
- const hydrationPlanOptions = _chunkYSPMY4B7cjs.getFarmClientHydrationPlanOptions.call(void 0,
5957
+ const hydrationPlanOptions = _chunk474FO3UEcjs.getFarmClientHydrationPlanOptions.call(void 0,
5791
5958
  config.renderer,
5792
5959
  Boolean(unsupportedIntegrationProvider)
5793
5960
  );
@@ -5805,7 +5972,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
5805
5972
  { ...hydrationPlanOptions, serverTreeLayouts: pageHydrationPlanOptions.serverOwners }
5806
5973
  )
5807
5974
  }));
5808
- const markdownPagePlan = _chunkYSPMY4B7cjs.createMarkdownPageHydrationPlanner.call(void 0,
5975
+ const markdownPagePlan = _chunk474FO3UEcjs.createMarkdownPageHydrationPlanner.call(void 0,
5809
5976
  _chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, config.mdx), config.root),
5810
5977
  config.root,
5811
5978
  isolatedHydrationMode,
@@ -5823,7 +5990,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
5823
5990
  )
5824
5991
  ])
5825
5992
  );
5826
- _chunkYSPMY4B7cjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
5993
+ _chunk474FO3UEcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
5827
5994
  layoutHydrationPlans.map((layout) => ({
5828
5995
  pattern: layout.pattern,
5829
5996
  depth: layout.pattern.split("/").filter(Boolean).length,
@@ -5832,10 +5999,10 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
5832
5999
  pageRoutes.map((route) => ({
5833
6000
  // Compared by directory so a grouped layout applies only inside its group.
5834
6001
  pattern: _nullishCoalesce(route.directory, () => ( route.pattern)),
5835
- depth: _chunkC2R5RVLAcjs.getRouteDirectoryDepth.call(void 0, _nullishCoalesce(route.directory, () => ( route.pattern))),
6002
+ depth: _chunkVCKGOXFIcjs.getRouteDirectoryDepth.call(void 0, _nullishCoalesce(route.directory, () => ( route.pattern))),
5836
6003
  metadata: pageHydrationPlans.get(route.modulePath)
5837
6004
  })),
5838
- _chunkC2R5RVLAcjs.routeBoundaryCoversDirectory
6005
+ _chunkVCKGOXFIcjs.routeBoundaryCoversDirectory
5839
6006
  );
5840
6007
  const providerServerImports = [
5841
6008
  providerServerModules.hasClerkProvider ? `import { ClerkProvider as FarmClerkProvider } from "@clerk/react";` : "",
@@ -5889,7 +6056,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
5889
6056
  `import * as ${varName} from ${toVirtualEntryImportSpecifier(route.modulePath)};`
5890
6057
  );
5891
6058
  const clientMetadata = pageHydrationPlans.get(route.modulePath);
5892
- const renderingDirective = _chunkZSIGEHSEcjs.readRouteRenderingDirectiveFromFile.call(void 0, route.modulePath);
6059
+ const renderingDirective = _chunkIUBDMDZZcjs.readRouteRenderingDirectiveFromFile.call(void 0, route.modulePath);
5893
6060
  pageRegistrations.push(`
5894
6061
  {
5895
6062
  pattern: ${JSON.stringify(route.pattern)},${route.directory ? `
@@ -5897,7 +6064,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
5897
6064
  module: ${varName},
5898
6065
  shouldHydrate: ${JSON.stringify(clientMetadata.shouldHydrate)},${clientMetadata.shouldHydrate ? `
5899
6066
  clientModule: ${JSON.stringify(_chunkXN2MB4QZcjs.toViteModuleId.call(void 0, route.modulePath, config.root))},` : ""}
5900
- islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${_chunkYSPMY4B7cjs.usesFarmServerTree.call(void 0, clientMetadata) ? "\n serverTree: true," : ""}${renderingDirective ? `
6067
+ islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${_chunk474FO3UEcjs.usesFarmServerTree.call(void 0, clientMetadata) ? "\n serverTree: true," : ""}${renderingDirective ? `
5901
6068
  rendering: ${JSON.stringify(renderingDirective)},` : ""}
5902
6069
  ${route.source !== void 0 ? `markdownSource: {
5903
6070
  source: ${JSON.stringify(route.source)},
@@ -5907,7 +6074,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
5907
6074
  });
5908
6075
  const layoutImports = [];
5909
6076
  const layoutRegistrations = [];
5910
- const treeLayoutPatterns = farmIslandsMode ? _chunkC2R5RVLAcjs.getFarmServerTreeLayoutPatterns.call(void 0,
6077
+ const treeLayoutPatterns = farmIslandsMode ? _chunkVCKGOXFIcjs.getFarmServerTreeLayoutPatterns.call(void 0,
5911
6078
  layoutHydrationPlans.map((layout) => ({
5912
6079
  pattern: layout.pattern,
5913
6080
  shouldHydrate: layout.hydration.shouldHydrate,
@@ -5961,12 +6128,12 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
5961
6128
  errorImports.push(
5962
6129
  `import * as ${varName} from ${toVirtualEntryImportSpecifier(errorRoute.modulePath)};`
5963
6130
  );
5964
- const groupScope = _chunkC2R5RVLAcjs.getRouteGroupScope.call(void 0, errorRoute.pattern);
6131
+ const groupScope = _chunkVCKGOXFIcjs.getRouteGroupScope.call(void 0, errorRoute.pattern);
5965
6132
  errorRegistrations.push(`
5966
6133
  {
5967
- pattern: ${JSON.stringify(_chunkC2R5RVLAcjs.stripRouteGroups.call(void 0, errorRoute.pattern))},${groupScope ? `
6134
+ pattern: ${JSON.stringify(_chunkVCKGOXFIcjs.stripRouteGroups.call(void 0, errorRoute.pattern))},${groupScope ? `
5968
6135
  groupScope: ${JSON.stringify(groupScope)},
5969
- directoryDepth: ${_chunkC2R5RVLAcjs.getRouteDirectoryDepth.call(void 0, errorRoute.pattern)},` : ""}
6136
+ directoryDepth: ${_chunkVCKGOXFIcjs.getRouteDirectoryDepth.call(void 0, errorRoute.pattern)},` : ""}
5970
6137
  module: ${varName},
5971
6138
  }`);
5972
6139
  });
@@ -6116,7 +6283,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
6116
6283
  import { getSharedLayoutPrefixLength, handleFarmFormActionRequest, ignoreFarmHeldValues, installFarmIslandValues, parseFarmLayoutChainHeader } from "@farm.js/core/internal/production-runtime";
6117
6284
  import { installFarmIslandsServer } from "@farm.js/core/internal/islands-server";
6118
6285
  installFarmIslandsServer();
6119
- const farmFormActionsConfig = ${JSON.stringify(_chunkFGJQS4ECcjs.resolveServerActionsConfig.call(void 0, config.serverActions))};
6286
+ const farmFormActionsConfig = ${JSON.stringify(_chunk6QA2SXVHcjs.resolveServerActionsConfig.call(void 0, config.serverActions))};
6120
6287
  installFarmIslandValues();
6121
6288
  ${islandsActionKeyCode()}
6122
6289
  ${FARM_SEGMENT_NAVIGATION_SERVER_RUNTIME}` : ""}`;
@@ -6170,7 +6337,7 @@ ${integrationRuntimeImport}
6170
6337
  ${nativeAuth.importSource}
6171
6338
  ${nativeMCP.importSource}
6172
6339
  `;
6173
- const imageRuntime = _chunkYSPMY4B7cjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
6340
+ const imageRuntime = _chunk474FO3UEcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
6174
6341
  const imageRuntimeImport = imageRuntime === "none" ? "" : `import { _withFarmImageSourceClientAddress, createCloudflareImageTransformer, createFarmImageHandler } from "@farm.js/core/image/server";`;
6175
6342
  const imageNodeRuntimeImport = imageRuntime === "node" ? `import { createNodeImageFetcher, createNodeImageUrlValidator, createSharpImageTransformer } from "@farm.js/core/image/sharp";` : "";
6176
6343
  const apiHandlerCode = apiRoutes.length > 0 ? `
@@ -6349,7 +6516,7 @@ const farmResolvedRuntimeConfig = Object.assign({}, ...farmRuntimeConfigs);
6349
6516
 
6350
6517
  function FarmDefault404Page() {
6351
6518
  return React.createElement(React.Fragment, null,
6352
- React.createElement("style", null, ${JSON.stringify(_chunkYSPMY4B7cjs.DEFAULT_NOT_FOUND_STYLES)}),
6519
+ React.createElement("style", null, ${JSON.stringify(_chunk474FO3UEcjs.DEFAULT_NOT_FOUND_STYLES)}),
6353
6520
  React.createElement("main", {
6354
6521
  className: "farm-default-not-found",
6355
6522
  "aria-labelledby": "farm-default-not-found-title",
@@ -6652,12 +6819,12 @@ function fetchFarmInnerRequest(request, context) {
6652
6819
  }
6653
6820
  const farmLocalAPIBasePath = ${JSON.stringify(_chunkB5BBTPJQcjs.resolveFarmAPIServerBasePath.call(void 0, config.api))};
6654
6821
  const farmOpenAPIReference = ${JSON.stringify(openAPIReference)};
6655
- ${_optionalChain([config, 'access', _155 => _155.agent, 'optionalAccess', _156 => _156.apiCatalog]) ? `const farmApiCatalogInput = ${JSON.stringify(_chunkZGS3ZDF7cjs.resolveFarmApiCatalogInput.call(void 0, config))};
6822
+ ${_optionalChain([config, 'access', _155 => _155.agent, 'optionalAccess', _156 => _156.apiCatalog]) ? `const farmApiCatalogInput = ${JSON.stringify(_chunkGOOK2J2Wcjs.resolveFarmApiCatalogInput.call(void 0, config))};
6656
6823
  ` : ""}${_optionalChain([config, 'access', _157 => _157.agent, 'optionalAccess', _158 => _158.manifest]) !== false ? `const farmAppManifestInput = ${JSON.stringify(
6657
- _chunkZGS3ZDF7cjs.resolveFarmAppManifestInput.call(void 0, config, {
6824
+ _chunkGOOK2J2Wcjs.resolveFarmAppManifestInput.call(void 0, config, {
6658
6825
  build: config.deploymentId,
6659
- packages: _chunkYSPMY4B7cjs.resolveFarmAppPackages.call(void 0, config.root),
6660
- webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ? _chunkYSPMY4B7cjs.collectFarmWebMCPTools.call(void 0, config.root, config.srcDir) : []
6826
+ packages: _chunk474FO3UEcjs.resolveFarmAppPackages.call(void 0, config.root),
6827
+ webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ? _chunk474FO3UEcjs.collectFarmWebMCPTools.call(void 0, config.root, config.srcDir) : []
6661
6828
  })
6662
6829
  )};
6663
6830
  ${servesDefaultMCP ? "farmAppManifestInput.defaultMCP = getFarmDefaultMCPServer;\n" : ""}// A guard written for an MCP server's path keeps its tools out of the public view.
@@ -6799,11 +6966,16 @@ function escapeFarmHtmlAttribute(value) {
6799
6966
  .replace(/>/g, "&gt;");
6800
6967
  }
6801
6968
 
6802
- async function renderFarmElement(ReactDOMServer, element, routeKey) {
6969
+ async function renderFarmElement(ReactDOMServer, element, routeKey, flushMarkers = false) {
6970
+ // Written after each React flush in a streamed navigation (flushMarkers): the browser swaps in
6971
+ // the shell, then adds each Suspense boundary as soon as the flush that completed it ends.
6972
+ const FARM_FLUSH_MARKER = "<!--farm-flush-->";
6803
6973
  // Islands mode: each render writes its islands' values itself, so a request that renders twice
6804
6974
  // (notFound(), or a synchronous attempt that suspends and streams) still sends them.
6805
6975
  if (typeof farmIslandsRender === "function") element = farmIslandsRender(element);
6806
6976
  const streamErrors = [];
6977
+ // A browser that leaves the page cancels the stream: React's abort errors are not failures.
6978
+ let cancelled = false;
6807
6979
  const syncHtml = renderFarmElementSync(ReactDOMServer, element, routeKey);
6808
6980
  if (syncHtml !== undefined) return { html: syncHtml, shellHtml: syncHtml, streamErrors };
6809
6981
  let encoder;
@@ -6841,7 +7013,7 @@ async function renderFarmElement(ReactDOMServer, element, routeKey) {
6841
7013
  // request handler must still receive them to map the response status,
6842
7014
  // but they should not produce a misleading SSR failure log.
6843
7015
  streamErrors.push(error);
6844
- if (isFarmRedirectError(error) || isFarmNotFoundError(error)) return;
7016
+ if (cancelled || isFarmRedirectError(error) || isFarmNotFoundError(error)) return;
6845
7017
  console.error("[Farm SSR stream]", error);
6846
7018
  },
6847
7019
  });
@@ -6888,13 +7060,33 @@ async function renderFarmElement(ReactDOMServer, element, routeKey) {
6888
7060
  }
6889
7061
 
6890
7062
  let replayFirstChunk = true;
7063
+ let pendingRead = null;
7064
+ // A flush is the chunks React has queued when a task boundary passes.
7065
+ const drainFlush = async function(controller, waitForFirst) {
7066
+ for (let first = waitForFirst; ; first = false) {
7067
+ const read = pendingRead || (pendingRead = reader.read());
7068
+ const result = first
7069
+ ? await read
7070
+ : await Promise.race([read, new Promise(function(resolve) { setTimeout(resolve, 0); })]);
7071
+ if (!result) break;
7072
+ pendingRead = null;
7073
+ if (result.done) {
7074
+ controller.close();
7075
+ return;
7076
+ }
7077
+ controller.enqueue(normalizeChunk(result.value));
7078
+ }
7079
+ controller.enqueue(normalizeChunk(FARM_FLUSH_MARKER));
7080
+ };
6891
7081
  const replayStream = new ReadableStream({
6892
7082
  pull(controller) {
6893
7083
  if (replayFirstChunk) {
6894
7084
  replayFirstChunk = false;
6895
7085
  controller.enqueue(firstChunk);
7086
+ if (flushMarkers) return drainFlush(controller, false);
6896
7087
  return;
6897
7088
  }
7089
+ if (flushMarkers) return drainFlush(controller, true);
6898
7090
  return reader.read().then(
6899
7091
  function(result) {
6900
7092
  if (result.done) controller.close();
@@ -6906,6 +7098,7 @@ async function renderFarmElement(ReactDOMServer, element, routeKey) {
6906
7098
  );
6907
7099
  },
6908
7100
  cancel(reason) {
7101
+ cancelled = true;
6909
7102
  return reader.cancel(reason);
6910
7103
  },
6911
7104
  });
@@ -6930,6 +7123,7 @@ async function renderFarmElement(ReactDOMServer, element, routeKey) {
6930
7123
  let settleComplete;
6931
7124
  let rejectComplete;
6932
7125
  const chunks = [];
7126
+ let unflushed = false;
6933
7127
  const decision = new Promise(function(resolve, reject) {
6934
7128
  settleDecision = resolve;
6935
7129
  rejectDecision = reject;
@@ -6952,8 +7146,15 @@ async function renderFarmElement(ReactDOMServer, element, routeKey) {
6952
7146
  const normalized = normalizeChunk(chunk);
6953
7147
  if (streamStarted) streamController.enqueue(normalized);
6954
7148
  else chunks.push(normalized);
7149
+ unflushed = true;
6955
7150
  return true;
6956
7151
  },
7152
+ // React calls this after each flush.
7153
+ flush() {
7154
+ if (!flushMarkers || !streamStarted || streamClosed || !unflushed) return;
7155
+ unflushed = false;
7156
+ streamController.enqueue(normalizeChunk(FARM_FLUSH_MARKER));
7157
+ },
6957
7158
  end() {
6958
7159
  if (streamClosed) return;
6959
7160
  streamClosed = true;
@@ -6982,6 +7183,9 @@ async function renderFarmElement(ReactDOMServer, element, routeKey) {
6982
7183
  streamController = controller;
6983
7184
  },
6984
7185
  cancel(reason) {
7186
+ // React writes its abort instructions: the stream no longer takes them.
7187
+ cancelled = true;
7188
+ streamClosed = true;
6985
7189
  if (pipeableStream && typeof pipeableStream.abort === "function") {
6986
7190
  pipeableStream.abort(reason);
6987
7191
  }
@@ -7001,7 +7205,7 @@ async function renderFarmElement(ReactDOMServer, element, routeKey) {
7001
7205
  onError(error) {
7002
7206
  // Same control-flow guard as the readable-stream path above.
7003
7207
  streamErrors.push(error);
7004
- if (isFarmRedirectError(error) || isFarmNotFoundError(error)) return;
7208
+ if (cancelled || isFarmRedirectError(error) || isFarmNotFoundError(error)) return;
7005
7209
  console.error("[Farm SSR stream]", error);
7006
7210
  },
7007
7211
  });
@@ -7022,6 +7226,11 @@ async function renderFarmElement(ReactDOMServer, element, routeKey) {
7022
7226
 
7023
7227
  streamStarted = true;
7024
7228
  for (const chunk of chunks) streamController.enqueue(chunk);
7229
+ // What React wrote while its shell was ready is the shell; Suspense content follows.
7230
+ if (flushMarkers && unflushed) {
7231
+ unflushed = false;
7232
+ streamController.enqueue(normalizeChunk(FARM_FLUSH_MARKER));
7233
+ }
7025
7234
  if (streamClosed) streamController.close();
7026
7235
  return {
7027
7236
  stream,
@@ -7203,7 +7412,7 @@ function peelFarmDocumentPrefix(markup) {
7203
7412
  let inner = markup.replace(/^\\s+/, "");
7204
7413
  let hoisted = "";
7205
7414
  const wrapper = /^<div\\b[^>]*style=["']display\\s*:\\s*contents;?\\s*["'][^>]*>/i;
7206
- const hoistable = /${_chunkC2R5RVLAcjs.HOISTED_HEAD_ELEMENT.source}/i;
7415
+ const hoistable = /${_chunkVCKGOXFIcjs.HOISTED_HEAD_ELEMENT.source}/i;
7207
7416
  let match;
7208
7417
  while ((match = wrapper.exec(inner) || hoistable.exec(inner))) {
7209
7418
  if (!/^<div/i.test(match[0])) hoisted += match[0];
@@ -7734,7 +7943,7 @@ function createFarmAgentRobotsResponse(request) {
7734
7943
  // a route guard.
7735
7944
  const farmAgentGuardedPages = new Set(${JSON.stringify(
7736
7945
  pageRoutes.map((route) => route.pattern).filter(
7737
- (pattern) => !pattern.includes("[") && _chunkC2R5RVLAcjs.farmPathGuardCoversPage.call(void 0,
7946
+ (pattern) => !pattern.includes("[") && _chunkVCKGOXFIcjs.farmPathGuardCoversPage.call(void 0,
7738
7947
  {
7739
7948
  config: { middleware: config.middleware, integrations: config.integrations },
7740
7949
  middlewareRoutes
@@ -7781,7 +7990,7 @@ ${servesDefaultMCP ? `// agent.mcp: the default read-only MCP server at /mcp, as
7781
7990
  // aside for a page route that answers /mcp and for any MCP server published or
7782
7991
  // registered at runtime, such as the docs engine's.
7783
7992
  const farmDefaultMCPServer = ${JSON.stringify(
7784
- _chunkSBABQKPTcjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root), _chunkJLS6ZLFMcjs.FARM_VERSION)
7993
+ _chunkSBABQKPTcjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root), _chunkRHOR2J6Vcjs.FARM_VERSION)
7785
7994
  )};
7786
7995
  let farmDefaultMCPRouteFree;
7787
7996
  function getFarmDefaultMCPServer() {
@@ -8191,7 +8400,7 @@ ${hasInfraAnalyticsRuntime ? `
8191
8400
  // endpoints, Markdown mirrors, and docs pages have no app route pattern, so they are
8192
8401
  // labeled here; route.pattern keeps meaning the matched app route for plugins.
8193
8402
  const farmBuiltInRoutePaths = new Set(${JSON.stringify(
8194
- _chunkZGS3ZDF7cjs.listFarmBuiltInRoutePaths.call(void 0, {
8403
+ _chunkGOOK2J2Wcjs.listFarmBuiltInRoutePaths.call(void 0, {
8195
8404
  agent: {
8196
8405
  ...config.agent,
8197
8406
  aiCatalog: servesAiCatalog,
@@ -8879,7 +9088,7 @@ ${hasServerRuntimeIntegrations ? `
8879
9088
  // agent.manifest: /.well-known/farmjs.json (and 0.1.34's /.well-known/farmjs), the app's
8880
9089
  // public manifest, the same document for every request.
8881
9090
  if (
8882
- [${JSON.stringify(_chunkZGS3ZDF7cjs.FARM_APP_MANIFEST_PATH)}, ${JSON.stringify(_chunkZGS3ZDF7cjs.FARM_APP_MANIFEST_LEGACY_PATH)}].includes(
9091
+ [${JSON.stringify(_chunkGOOK2J2Wcjs.FARM_APP_MANIFEST_PATH)}, ${JSON.stringify(_chunkGOOK2J2Wcjs.FARM_APP_MANIFEST_LEGACY_PATH)}].includes(
8883
9092
  normalizeRuntimePath(routePathname),
8884
9093
  )
8885
9094
  ) {
@@ -8891,7 +9100,7 @@ ${hasServerRuntimeIntegrations ? `
8891
9100
  ` : ""}
8892
9101
  ${_optionalChain([config, 'access', _182 => _182.agent, 'optionalAccess', _183 => _183.apiCatalog]) ? `
8893
9102
  // agent.apiCatalog: list the OpenAPI and MCP surfaces at the RFC 9727 path.
8894
- if (normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkZGS3ZDF7cjs.FARM_API_CATALOG_PATH)}) {
9103
+ if (normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkGOOK2J2Wcjs.FARM_API_CATALOG_PATH)}) {
8895
9104
  return applyProductionMiddlewareHeaders(
8896
9105
  createFarmApiCatalogResponse(request.method, farmApiCatalogInput, request),
8897
9106
  middlewareHeaders,
@@ -9296,8 +9505,12 @@ ${hasServerRuntimeIntegrations ? `
9296
9505
  shouldHydrateLayout &&
9297
9506
  route.serverTree === true &&
9298
9507
  !route.shouldHydrate &&
9299
- request.headers.get("f-render") === "tree";` : `const farmLayoutKeyOf = null;
9300
- const farmPayloadOnlyNavigation = false;`}
9508
+ request.headers.get("f-render") === "tree";
9509
+ // A navigation the browser streams marks where each React flush ends, so the browser
9510
+ // shows the page before its Suspense content arrives (FARM_FLUSH_MARKER).
9511
+ const farmFlushMarkers = request.headers.get("f-stream") === "flush";` : `const farmLayoutKeyOf = null;
9512
+ const farmPayloadOnlyNavigation = false;
9513
+ const farmFlushMarkers = false;`}
9301
9514
  const renderPageElement = async () => {
9302
9515
  // First, render the page content
9303
9516
  let pageElement;
@@ -9419,7 +9632,7 @@ ${hasServerRuntimeIntegrations ? `
9419
9632
  }
9420
9633
 
9421
9634
  wrappedElement = wrapWithFarmIntegrationProviders(wrappedElement);
9422
- return renderFarmElement(ReactDOMServer, wrappedElement, route.pattern);
9635
+ return renderFarmElement(ReactDOMServer, wrappedElement, route.pattern, farmFlushMarkers);
9423
9636
  };
9424
9637
  const renderedPage = ${hasMiddlewareRuntime ? `await _runWithMiddlewareData(middlewareData, () =>
9425
9638
  _runWithMiddlewareContext(middlewareContext, renderPageElement)
@@ -9542,7 +9755,7 @@ ${hasServerRuntimeIntegrations ? `
9542
9755
  // gets HTML without them.
9543
9756
  responseHeaders["Vary"] = farmSharedCacheableRoute
9544
9757
  ? "F-Layouts"
9545
- : "F-Values, F-Layouts, F-Render";` : ""}
9758
+ : "F-Values, F-Layouts, F-Render, F-Stream";` : ""}
9546
9759
  let html = renderedPage.html;
9547
9760
 
9548
9761
  // Check if the layout already rendered a full HTML document
@@ -10391,9 +10604,9 @@ function getPhysicalPrerenderBypassReason(options) {
10391
10604
  if (rewriteSources.some((source) => middlewarePatternMatches(source, pathname))) {
10392
10605
  return "rewrite";
10393
10606
  }
10394
- if (_chunkC2R5RVLAcjs.appMiddlewareMayHandlePath.call(void 0, middlewareRoutes, pathname)) return "app middleware";
10395
- if (_chunkC2R5RVLAcjs.configMiddlewareMayHandlePath.call(void 0, config.middleware, pathname)) return "configured middleware";
10396
- if (_chunkKZT2VHRQcjs.hasCustomFarmRouteContext.call(void 0, config)) return "request context";
10607
+ if (_chunkVCKGOXFIcjs.appMiddlewareMayHandlePath.call(void 0, middlewareRoutes, pathname)) return "app middleware";
10608
+ if (_chunkVCKGOXFIcjs.configMiddlewareMayHandlePath.call(void 0, config.middleware, pathname)) return "configured middleware";
10609
+ if (_chunkLYWAGXXWcjs.hasCustomFarmRouteContext.call(void 0, config)) return "request context";
10397
10610
  if (farmServerRuntimePluginsMayHandlePath(config, pathname)) return "server runtime plugin";
10398
10611
  const manifestEntry = getManifestPageEntry(routeRuntimeManifest, pathname);
10399
10612
  if (_optionalChain([manifestEntry, 'optionalAccess', _200 => _200.rendering]) === "dynamic") return "dynamic runtime manifest";
@@ -10426,10 +10639,10 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
10426
10639
  const nitroBuilder = nitroBuilderResult.value;
10427
10640
  const isVercel = preset === "vercel" || preset === "vercel-edge";
10428
10641
  const isCloudflareWorker = preset === "cloudflare-module";
10429
- const outputDir = _chunkKZT2VHRQcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
10642
+ const outputDir = _chunkLYWAGXXWcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
10430
10643
  const runtimeServerOutputDir = isVercel ? _path2.default.join(outputDir, "functions", "__nitro.func") : _path2.default.join(outputDir, "server");
10431
10644
  const ssrOutputDir = _path2.default.join(root, distDir, "ssr");
10432
- const imageRuntime = _chunkYSPMY4B7cjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
10645
+ const imageRuntime = _chunk474FO3UEcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
10433
10646
  const hasGeneratedMetadataImages = Array.from(routeManager.getMetadataImages().values()).some(
10434
10647
  (image) => image.sourceType === "module"
10435
10648
  );
@@ -10450,7 +10663,7 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
10450
10663
  const ssgCollectionPromise = routeManager.collectSSGPages();
10451
10664
  const middlewareRoutesPromise = discoverMiddlewareRoutes(_chunk5Y2P454Ocjs.getFarmAppDirectories.call(void 0, config));
10452
10665
  const configuredResponseRoutesPromise = Promise.all([config.redirects(), config.rewrites()]);
10453
- const farmWorkflows = await _chunkSSNN55Q6cjs.prepareFarmWorkflowsForNitro.call(void 0, config);
10666
+ const farmWorkflows = await _chunkIQXGHGZFcjs.prepareFarmWorkflowsForNitro.call(void 0, config);
10454
10667
  const farmCron = await _chunkC7425KDGcjs.prepareFarmCronForNitro.call(void 0, config);
10455
10668
  const [{ ssg: ssgPages }, middlewareRoutes, [configuredRedirects, configuredRewrites]] = await Promise.all([
10456
10669
  ssgCollectionPromise,
@@ -11028,13 +11241,13 @@ function toFarmNodeResponse(request, response) {
11028
11241
  }
11029
11242
  if (prerenderRoutes.length > 0) {
11030
11243
  _chunkXN2MB4QZcjs.logger.info(`\u{1F4C4} Pre-rendering ${prerenderRoutes.length} SSG page(s)`);
11031
- const previousPrerender = process.env[_chunkHUL4LTC6cjs.FARM_PRERENDER_ENV];
11032
- process.env[_chunkHUL4LTC6cjs.FARM_PRERENDER_ENV] = "1";
11244
+ const previousPrerender = process.env[_chunkHYN3LLG7cjs.FARM_PRERENDER_ENV];
11245
+ process.env[_chunkHYN3LLG7cjs.FARM_PRERENDER_ENV] = "1";
11033
11246
  try {
11034
11247
  await nitroBuilder.prerender(nitroInstance);
11035
11248
  } finally {
11036
- if (previousPrerender === void 0) delete process.env[_chunkHUL4LTC6cjs.FARM_PRERENDER_ENV];
11037
- else process.env[_chunkHUL4LTC6cjs.FARM_PRERENDER_ENV] = previousPrerender;
11249
+ if (previousPrerender === void 0) delete process.env[_chunkHYN3LLG7cjs.FARM_PRERENDER_ENV];
11250
+ else process.env[_chunkHYN3LLG7cjs.FARM_PRERENDER_ENV] = previousPrerender;
11038
11251
  }
11039
11252
  }
11040
11253
  const sharpRuntimeStagePromise = imageRuntime === "node" ? stageSharpRuntime(config, root, distDir, fs4, preset) : Promise.resolve(null);
@@ -11202,7 +11415,7 @@ async function postProcessVercelOutput(root, outputDir, fs4, config, farmWorkflo
11202
11415
  presetRoutes: Array.isArray(vercelConfig.routes) ? vercelConfig.routes : [],
11203
11416
  runtimeRoutes
11204
11417
  });
11205
- const vercelConfigWithWorkflowCrons = _chunkSSNN55Q6cjs.applyFarmWorkflowVercelCrons.call(void 0,
11418
+ const vercelConfigWithWorkflowCrons = _chunkIQXGHGZFcjs.applyFarmWorkflowVercelCrons.call(void 0,
11206
11419
  vercelConfig,
11207
11420
  farmWorkflows.workflows
11208
11421
  );
@@ -11217,7 +11430,7 @@ async function copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs4) {
11217
11430
  const docsContentDir = resolveBuildDocsContentDir(config, root);
11218
11431
  if (!docsContentDir) return;
11219
11432
  const bundledContentDir = _path2.default.join(nitroFuncDir, "farm-docs-content");
11220
- const lastModifiedManifest = _chunkEVCQX243cjs.createFarmDocsLastModifiedManifest.call(void 0, docsContentDir, {
11433
+ const lastModifiedManifest = _chunkX2EL3BLHcjs.createFarmDocsLastModifiedManifest.call(void 0, docsContentDir, {
11221
11434
  fallback: "now"
11222
11435
  });
11223
11436
  await fs4.rm(bundledContentDir, { recursive: true, force: true });
@@ -11227,7 +11440,7 @@ async function copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs4) {
11227
11440
  force: true
11228
11441
  });
11229
11442
  await fs4.writeFile(
11230
- _path2.default.join(bundledContentDir, _chunkEVCQX243cjs.FARM_DOCS_LAST_MODIFIED_MANIFEST),
11443
+ _path2.default.join(bundledContentDir, _chunkX2EL3BLHcjs.FARM_DOCS_LAST_MODIFIED_MANIFEST),
11231
11444
  `${JSON.stringify(lastModifiedManifest, null, 2)}
11232
11445
  `
11233
11446
  );
@@ -11298,7 +11511,7 @@ async function stageSharpRuntime(config, root, distDir, fs4, preset) {
11298
11511
  try {
11299
11512
  await copyPackage("sharp", sharpRequire);
11300
11513
  if (!copiedPackages.has("sharp")) {
11301
- throw new Error(`Farm image optimization requires sharp. ${_chunkYSPMY4B7cjs.SHARP_INSTALL_HINT}`);
11514
+ throw new Error(`Farm image optimization requires sharp. ${_chunk474FO3UEcjs.SHARP_INSTALL_HINT}`);
11302
11515
  }
11303
11516
  } catch (error) {
11304
11517
  await fs4.rm(stageDir, { recursive: true, force: true });
@@ -11528,7 +11741,7 @@ function createBuildTargetBaseline(config) {
11528
11741
  preset,
11529
11742
  distDir,
11530
11743
  outputDir,
11531
- outputWasDerived: outputDir === _chunkKZT2VHRQcjs.getDefaultDeployOutputDir.call(void 0, config.deploy.target, preset, distDir)
11744
+ outputWasDerived: outputDir === _chunkLYWAGXXWcjs.getDefaultDeployOutputDir.call(void 0, config.deploy.target, preset, distDir)
11532
11745
  };
11533
11746
  }
11534
11747
  function resolveBuildTargets(config, options, baseline) {
@@ -11537,8 +11750,8 @@ function resolveBuildTargets(config, options, baseline) {
11537
11750
  const distDir = config.distDir || ".farm";
11538
11751
  const outputWasReplaced = config.deploy.outputDir !== baseline.outputDir;
11539
11752
  const shouldRefreshDerivedOutput = baseline.outputWasDerived && !outputWasReplaced && (preset !== baseline.preset || distDir !== baseline.distDir);
11540
- const deployTarget = preset === config.deploy.preset ? config.deploy.target : _chunkKZT2VHRQcjs.getDeployTargetForPreset.call(void 0, preset);
11541
- const outputDir = shouldRefreshDerivedOutput ? _chunkKZT2VHRQcjs.getDefaultDeployOutputDir.call(void 0, deployTarget, preset, distDir) : config.deploy.outputDir;
11753
+ const deployTarget = preset === config.deploy.preset ? config.deploy.target : _chunkLYWAGXXWcjs.getDeployTargetForPreset.call(void 0, preset);
11754
+ const outputDir = shouldRefreshDerivedOutput ? _chunkLYWAGXXWcjs.getDefaultDeployOutputDir.call(void 0, deployTarget, preset, distDir) : config.deploy.outputDir;
11542
11755
  return {
11543
11756
  root,
11544
11757
  preset,
@@ -11546,7 +11759,7 @@ function resolveBuildTargets(config, options, baseline) {
11546
11759
  distDir,
11547
11760
  deployTarget,
11548
11761
  outputDir,
11549
- deployOutputDir: _chunkKZT2VHRQcjs.resolveDeployOutputPath.call(void 0, root, outputDir)
11762
+ deployOutputDir: _chunkLYWAGXXWcjs.resolveDeployOutputPath.call(void 0, root, outputDir)
11550
11763
  };
11551
11764
  }
11552
11765
  async function buildWithProductionNodeEnv(inputConfig, options) {
@@ -11583,7 +11796,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
11583
11796
  };
11584
11797
  config = {
11585
11798
  ...config,
11586
- images: _chunkYSPMY4B7cjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, {
11799
+ images: _chunk474FO3UEcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, {
11587
11800
  root: targets.root,
11588
11801
  preset: targets.preset
11589
11802
  })
@@ -11611,18 +11824,18 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
11611
11824
  root,
11612
11825
  rendererBuild.signal
11613
11826
  );
11614
- const farmApp = _chunkYSPMY4B7cjs.createFarmApp.call(void 0, config, projectModuleServer);
11827
+ const farmApp = _chunk474FO3UEcjs.createFarmApp.call(void 0, config, projectModuleServer);
11615
11828
  await farmApp.initialize();
11616
11829
  const routeManager = farmApp.getRouteManager();
11617
11830
  const serverRenderer = farmApp.getServerRenderer();
11618
- const typeArtifacts = _chunkZSIGEHSEcjs.generateFarmTypeArtifacts.call(void 0, {
11831
+ const typeArtifacts = _chunkIUBDMDZZcjs.generateFarmTypeArtifacts.call(void 0, {
11619
11832
  root,
11620
11833
  srcDir,
11621
11834
  layers: config.layers,
11622
11835
  plugins: config.plugins,
11623
11836
  extraRoutes: [
11624
11837
  ..._optionalChain([config, 'access', _241 => _241.openapi, 'optionalAccess', _242 => _242.enabled]) && config.openapi.route ? [config.openapi.route] : [],
11625
- ..._chunkEVCQX243cjs.getFarmDocsRouteTypeEntries.call(void 0, config.docs)
11838
+ ..._chunkX2EL3BLHcjs.getFarmDocsRouteTypeEntries.call(void 0, config.docs)
11626
11839
  ],
11627
11840
  suppressLintOnLink: config.suppressLintOnLink,
11628
11841
  componentExtensions: config.renderer.componentExtensions,
@@ -11631,7 +11844,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
11631
11844
  const message = error instanceof Error ? error.message : String(error);
11632
11845
  _chunkXN2MB4QZcjs.logger.warn(`Route type generation failed (farm.d.ts may be stale): ${message}`);
11633
11846
  });
11634
- const apiRouteManager = new (0, _chunkEXHEPWFJcjs.APIRouteManager)(
11847
+ const apiRouteManager = new (0, _chunkYAXOEANDcjs.APIRouteManager)(
11635
11848
  _chunk5Y2P454Ocjs.getFarmAppDirectories.call(void 0, config),
11636
11849
  projectModuleServer,
11637
11850
  {
@@ -11717,7 +11930,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
11717
11930
  ssr: true,
11718
11931
  buildLifetime
11719
11932
  });
11720
- const viteConfig = _chunkYSPMY4B7cjs.mergeFarmViteConfig.call(void 0,
11933
+ const viteConfig = _chunk474FO3UEcjs.mergeFarmViteConfig.call(void 0,
11721
11934
  {
11722
11935
  root,
11723
11936
  appType: "custom",
@@ -11729,7 +11942,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
11729
11942
  },
11730
11943
  plugins: [
11731
11944
  ...rendererVitePlugins,
11732
- _chunkYSPMY4B7cjs.farmFontImportsPlugin.call(void 0, {
11945
+ _chunk474FO3UEcjs.farmFontImportsPlugin.call(void 0, {
11733
11946
  root,
11734
11947
  basePath: config.basePath,
11735
11948
  publicDir: config.publicDir
@@ -11741,7 +11954,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
11741
11954
  hmr: false
11742
11955
  },
11743
11956
  resolve: {
11744
- alias: _chunkYSPMY4B7cjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
11957
+ alias: _chunk474FO3UEcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
11745
11958
  dedupe: [...config.renderer.dedupe || []]
11746
11959
  },
11747
11960
  optimizeDeps: {
@@ -11785,7 +11998,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
11785
11998
  }
11786
11999
  async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
11787
12000
  const { farmI18nClientBridgePlugin, farmPlugin, farmServerOnlyEntriesPlugin } = await import("./vite.cjs");
11788
- const { PluginManager: PluginManager2 } = await import("./plugin-WBANOZQM.cjs");
12001
+ const { PluginManager: PluginManager2 } = await import("./plugin-HZIBL3DW.cjs");
11789
12002
  const pluginManager = new PluginManager2({
11790
12003
  config,
11791
12004
  isDev: false,
@@ -11812,7 +12025,7 @@ async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
11812
12025
  }
11813
12026
  async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
11814
12027
  const { farmI18nClientBridgePlugin, farmPlugin } = await import("./vite.cjs");
11815
- const { PluginManager: PluginManager2 } = await import("./plugin-WBANOZQM.cjs");
12028
+ const { PluginManager: PluginManager2 } = await import("./plugin-HZIBL3DW.cjs");
11816
12029
  const pluginManager = new PluginManager2({
11817
12030
  config,
11818
12031
  isDev: false,
@@ -11853,7 +12066,7 @@ function resolveLegacyPageEntry(config, root, srcDir) {
11853
12066
  }
11854
12067
  async function buildNitro(config, routeManager, apiRouteManager, serverRenderer, preset, root, distDir, pluginManager) {
11855
12068
  const [{ createNitroConfig }, { createNitro, build: nitroBuild }] = await Promise.all([
11856
- import("./nitro-BIXIKJZS.cjs"),
12069
+ import("./nitro-YPSZBYDK.cjs"),
11857
12070
  import("nitro/builder")
11858
12071
  ]);
11859
12072
  let nitroConfig = await createNitroConfig(
@@ -11866,7 +12079,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
11866
12079
  if (pluginManager) {
11867
12080
  nitroConfig = await pluginManager.runHookSerial("beforeNitroBuild", nitroConfig);
11868
12081
  }
11869
- const outputDir = _chunkKZT2VHRQcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
12082
+ const outputDir = _chunkLYWAGXXWcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
11870
12083
  const serverOutputDir = _path2.default.join(outputDir, "server");
11871
12084
  const publicOutputDir = _path2.default.join(outputDir, "public");
11872
12085
  const { mkdir, cp } = await import("fs/promises");
@@ -11937,7 +12150,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
11937
12150
  root,
11938
12151
  preset,
11939
12152
  distDir,
11940
- outputDir: _chunkKZT2VHRQcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir)
12153
+ outputDir: _chunkLYWAGXXWcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir)
11941
12154
  });
11942
12155
  }
11943
12156
  }