@farm.js/core 0.1.78 → 0.1.81

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 (467) hide show
  1. package/dist/{agent-mcp-handler-EDJNU224.mjs → agent-mcp-handler-GDY5CPPW.mjs} +5 -5
  2. package/dist/{agent-mcp-handler-LNBYLRTZ.cjs → agent-mcp-handler-IUL6OPC3.cjs} +6 -6
  3. package/dist/{agent-mcp.d-BErtnhV2.d.ts → agent-mcp.d-Cxi3214_.d.ts} +1 -1
  4. package/dist/{agent-mcp.d-CYHfcjur.d.mts → agent-mcp.d-DMqOqnOA.d.mts} +1 -1
  5. package/dist/agent-runtime.cjs +2 -2
  6. package/dist/agent-runtime.d.mts +5 -4
  7. package/dist/agent-runtime.d.ts +5 -4
  8. package/dist/agent-runtime.mjs +1 -1
  9. package/dist/analyzer-435DCIQ6.cjs +17 -0
  10. package/dist/{analyzer-M2BG6QYU.mjs → analyzer-IC66UJCU.mjs} +3 -2
  11. package/dist/api/client.cjs +1 -1
  12. package/dist/api/client.mjs +1 -1
  13. package/dist/api/client.native.cjs +1 -1
  14. package/dist/api/client.native.mjs +1 -1
  15. package/dist/api/node.cjs +7 -7
  16. package/dist/api/node.d.mts +7 -6
  17. package/dist/api/node.d.ts +7 -6
  18. package/dist/api/node.mjs +6 -6
  19. package/dist/api/route-manager.cjs +10 -10
  20. package/dist/api/route-manager.d.mts +7 -6
  21. package/dist/api/route-manager.d.ts +7 -6
  22. package/dist/api/route-manager.mjs +9 -9
  23. package/dist/api/runtime.cjs +6 -6
  24. package/dist/api/runtime.d.mts +6 -5
  25. package/dist/api/runtime.d.ts +6 -5
  26. package/dist/api/runtime.mjs +5 -5
  27. package/dist/api.cjs +12 -12
  28. package/dist/api.d.mts +8 -7
  29. package/dist/api.d.ts +8 -7
  30. package/dist/api.mjs +11 -11
  31. package/dist/{app-manifest.d-6NCkLQ1y.d.mts → app-manifest.d-Bbxp5kes.d.mts} +1 -1
  32. package/dist/{app-manifest.d-DuqLBcmi.d.ts → app-manifest.d-C8Cswd31.d.ts} +1 -1
  33. package/dist/app-markdown.cjs +5 -5
  34. package/dist/app-markdown.d.mts +8 -7
  35. package/dist/app-markdown.d.ts +8 -7
  36. package/dist/app-markdown.mjs +4 -4
  37. package/dist/{app.d-Dk2HkvPh.d.mts → app.d-BJuSurgy.d.mts} +13 -4
  38. package/dist/{app.d-Bz6vYBFF.d.ts → app.d-DGIoFt5D.d.ts} +13 -4
  39. package/dist/cache.cjs +3 -3
  40. package/dist/cache.mjs +2 -2
  41. package/dist/{chunk-PG7J7XYT.cjs → chunk-26WP75W5.cjs} +38 -22
  42. package/dist/{chunk-QYOAGT3E.cjs → chunk-2BEGVSDF.cjs} +6 -5
  43. package/dist/{chunk-GCRT6GJG.mjs → chunk-2HMSSPCZ.mjs} +26 -0
  44. package/dist/{chunk-2YJ4DHTD.cjs → chunk-2NOHVIJ3.cjs} +2 -2
  45. package/dist/{chunk-GDM3ZD2O.cjs → chunk-2OFP3IVA.cjs} +5 -1
  46. package/dist/{chunk-7KDCVSTR.mjs → chunk-2PFGA6PB.mjs} +2 -2
  47. package/dist/chunk-2UYYXSUS.mjs +401 -0
  48. package/dist/{chunk-DD2ANOEF.cjs → chunk-2Y2HRZQY.cjs} +843 -627
  49. package/dist/{chunk-PL7MCYYD.mjs → chunk-3AV4DCXY.mjs} +58 -358
  50. package/dist/{chunk-3GNHJ3RN.cjs → chunk-3BTN3NP7.cjs} +2 -2
  51. package/dist/{chunk-XT2CHTDN.mjs → chunk-3RVLJTFZ.mjs} +6 -6
  52. package/dist/{chunk-VJ6L7TII.cjs → chunk-3SPECQXI.cjs} +31 -20
  53. package/dist/{chunk-ODYKCC6W.cjs → chunk-46UV2E7I.cjs} +156 -104
  54. package/dist/{chunk-F4ID7BGO.cjs → chunk-4OFWG4IK.cjs} +7 -7
  55. package/dist/{chunk-VRI43FDN.mjs → chunk-4WXNTAOM.mjs} +1 -1
  56. package/dist/{chunk-QMR2TUVZ.cjs → chunk-52Q4OB4A.cjs} +4 -4
  57. package/dist/chunk-5MMKNW7Q.cjs +54 -0
  58. package/dist/{chunk-RIMEFQYO.mjs → chunk-5N526T7Q.mjs} +116 -86
  59. package/dist/{chunk-CYNQPKA4.cjs → chunk-5ZHC6QGD.cjs} +2 -2
  60. package/dist/{chunk-ALEUMLJN.mjs → chunk-67JTJCAS.mjs} +3 -2
  61. package/dist/{chunk-CBP7AKZH.mjs → chunk-6GJZJAED.mjs} +1 -1
  62. package/dist/{chunk-5REIO5DT.mjs → chunk-6WVRVGKC.mjs} +6 -6
  63. package/dist/{chunk-GC5ROI3A.cjs → chunk-7U4XF76R.cjs} +1 -1
  64. package/dist/{chunk-FOULIN4S.cjs → chunk-ADQ2LATR.cjs} +2 -2
  65. package/dist/{chunk-K3ZELA6U.cjs → chunk-AHVF5GI2.cjs} +10 -10
  66. package/dist/{chunk-CSAIIMY3.mjs → chunk-ATISIC6G.mjs} +1 -1
  67. package/dist/{chunk-MGKWYPE3.mjs → chunk-AYDVUCXD.mjs} +1 -0
  68. package/dist/chunk-B7L24VPX.cjs +401 -0
  69. package/dist/{chunk-DPBQRDWW.cjs → chunk-BBVLOEND.cjs} +4 -4
  70. package/dist/{chunk-DASQJ5UD.mjs → chunk-BCQIXH7L.mjs} +1 -1
  71. package/dist/{chunk-BNCKXPCU.cjs → chunk-BIAGSYIZ.cjs} +30 -30
  72. package/dist/{chunk-R77D7TCZ.mjs → chunk-BJWJP5A4.mjs} +20 -13
  73. package/dist/{chunk-X2SEYK7I.mjs → chunk-BPWTSPK6.mjs} +3 -3
  74. package/dist/{chunk-CKNZJFK5.cjs → chunk-BSX5OGSD.cjs} +4 -4
  75. package/dist/{chunk-ERT6HQAI.mjs → chunk-BVJUFVCU.mjs} +2 -2
  76. package/dist/chunk-C5QHZ626.cjs +85 -0
  77. package/dist/{chunk-HVMQAVZK.cjs → chunk-CL7BUGVB.cjs} +656 -521
  78. package/dist/{chunk-TZ2YPXLB.cjs → chunk-CN2JOTRO.cjs} +7 -7
  79. package/dist/{chunk-ZCYGYIC2.cjs → chunk-CPZZBCPO.cjs} +22 -21
  80. package/dist/{chunk-RK4MGL6Q.mjs → chunk-CYRO3WP4.mjs} +4 -3
  81. package/dist/chunk-D2VAANBS.mjs +48 -0
  82. package/dist/{chunk-VRJAMU34.mjs → chunk-D77OGI6X.mjs} +1 -1
  83. package/dist/{chunk-6XDDE7M6.cjs → chunk-DJ3PVHTW.cjs} +3 -3
  84. package/dist/{chunk-XGS76V7L.cjs → chunk-E3HBD2K3.cjs} +22 -22
  85. package/dist/{chunk-F35C3TJZ.mjs → chunk-E4E4Y5FD.mjs} +1 -1
  86. package/dist/{chunk-KUXEII7V.mjs → chunk-ECVSRE4Y.mjs} +3 -2
  87. package/dist/{chunk-2DA7CLY7.mjs → chunk-EILUVBKS.mjs} +14 -0
  88. package/dist/chunk-EZYKV24V.mjs +385 -0
  89. package/dist/{chunk-TVCFY3KK.cjs → chunk-FB4CWSC2.cjs} +12 -12
  90. package/dist/{chunk-ZO6TOLHL.mjs → chunk-FS55CNTC.mjs} +1 -1
  91. package/dist/{chunk-IYFBLWXU.cjs → chunk-FULX5RYX.cjs} +61 -361
  92. package/dist/{chunk-5KISFWD2.cjs → chunk-FYZD7DUS.cjs} +12 -12
  93. package/dist/{chunk-H5OVJHXY.cjs → chunk-GAWSWJJ2.cjs} +27 -27
  94. package/dist/{chunk-A37D6LOS.mjs → chunk-GY63XD6K.mjs} +1 -1
  95. package/dist/{chunk-OVUU2RCQ.mjs → chunk-HD5FLXP2.mjs} +1 -1
  96. package/dist/{chunk-5QZT2EQN.cjs → chunk-HQEYZSF3.cjs} +4 -3
  97. package/dist/{chunk-JA6RML7C.mjs → chunk-HR4N2K4V.mjs} +2 -2
  98. package/dist/{chunk-6D3CJFNU.cjs → chunk-HR5GU4UU.cjs} +7 -7
  99. package/dist/{chunk-7RQ5KAK6.mjs → chunk-HTNJ7A4D.mjs} +88 -36
  100. package/dist/chunk-I4WZRG73.mjs +54 -0
  101. package/dist/{chunk-BGUTIQII.mjs → chunk-ICOJ2BC6.mjs} +24 -8
  102. package/dist/{chunk-SX535SU5.cjs → chunk-IJPRCQHW.cjs} +10 -10
  103. package/dist/{chunk-E7V2GYBP.mjs → chunk-IM3UINTZ.mjs} +67 -9
  104. package/dist/{chunk-MNIR7I7B.mjs → chunk-INKVDO42.mjs} +1 -1
  105. package/dist/{chunk-AHGOHPRN.mjs → chunk-IPG6B25T.mjs} +235 -100
  106. package/dist/{chunk-PE2LEWXA.mjs → chunk-J2VUPCCR.mjs} +4 -4
  107. package/dist/{chunk-Q2EKSSEG.cjs → chunk-JB4BHRFK.cjs} +17 -17
  108. package/dist/{chunk-YN7G22MP.cjs → chunk-JCYDWJVO.cjs} +3 -3
  109. package/dist/{chunk-LPXJEZJK.mjs → chunk-KCJBIWBM.mjs} +2 -2
  110. package/dist/{chunk-NSNQLBHR.cjs → chunk-KMGHXIDA.cjs} +2 -2
  111. package/dist/{chunk-SVCUSOEF.mjs → chunk-KR5DF7WK.mjs} +1 -1
  112. package/dist/{chunk-5DREJN4G.cjs → chunk-LKIG5SM6.cjs} +17 -17
  113. package/dist/{chunk-OGVOKAQU.mjs → chunk-LTOT5KVJ.mjs} +2 -2
  114. package/dist/{chunk-Z2FFLTF5.mjs → chunk-LTXKRIST.mjs} +2 -2
  115. package/dist/{chunk-67MZTLTF.cjs → chunk-M6DAIE4T.cjs} +27 -1
  116. package/dist/{chunk-IWGGRXD2.cjs → chunk-MHKPXX3J.cjs} +2 -2
  117. package/dist/{chunk-F7PKUP6P.cjs → chunk-MOGRRZMW.cjs} +38 -38
  118. package/dist/{chunk-DZZHTMWM.cjs → chunk-N3H7UPBM.cjs} +3 -2
  119. package/dist/{chunk-WGNGM6MJ.mjs → chunk-N3VMHPIY.mjs} +2 -2
  120. package/dist/{chunk-EBFTAVGD.mjs → chunk-NOYKBGUK.mjs} +672 -456
  121. package/dist/{chunk-LMXGCFAM.cjs → chunk-NSLRK5DK.cjs} +1 -1
  122. package/dist/{chunk-EVVV2XZ2.cjs → chunk-NW3DL2PM.cjs} +53 -7
  123. package/dist/{chunk-6ZFGWB75.cjs → chunk-OFVCWV2D.cjs} +5 -5
  124. package/dist/{chunk-NB2ZEBIS.cjs → chunk-OIWDEDUO.cjs} +540 -510
  125. package/dist/{chunk-WRWJ7IWT.cjs → chunk-OLKYHTLN.cjs} +5 -5
  126. package/dist/{chunk-QES76U42.mjs → chunk-ONSZP5JK.mjs} +4 -4
  127. package/dist/{chunk-H76C5AOU.mjs → chunk-OO4GVGM3.mjs} +4 -4
  128. package/dist/{chunk-BZJYPIFZ.cjs → chunk-OUDNUFVR.cjs} +12 -12
  129. package/dist/{chunk-EVIWKPJV.cjs → chunk-PLJMEUAN.cjs} +15 -1
  130. package/dist/{chunk-GFXKO4UW.mjs → chunk-PO5MZIWK.mjs} +49 -49
  131. package/dist/{chunk-VCW6BR6U.mjs → chunk-POL5RCVU.mjs} +2 -2
  132. package/dist/{chunk-EMTN5ABC.mjs → chunk-POVHO46S.mjs} +1 -1
  133. package/dist/{chunk-ASYOWPSR.cjs → chunk-PWDBWXQI.cjs} +2 -1
  134. package/dist/{chunk-X3Y6JWJG.cjs → chunk-PWMJBCAN.cjs} +3 -3
  135. package/dist/{chunk-IGE5BAWK.mjs → chunk-QBJ6N5MT.mjs} +53 -7
  136. package/dist/{chunk-62DZHPDK.cjs → chunk-QCKSYYXK.cjs} +10 -10
  137. package/dist/{chunk-PKXGFQZS.mjs → chunk-QD34VE4N.mjs} +1 -1
  138. package/dist/{chunk-57QAQU4F.mjs → chunk-QRNYSISP.mjs} +1 -1
  139. package/dist/{chunk-PRL7FXG4.cjs → chunk-RDNKQ5MK.cjs} +12 -13
  140. package/dist/{chunk-VJI2LWTL.cjs → chunk-RFNQTQ44.cjs} +2 -2
  141. package/dist/{chunk-IG2JE6WJ.mjs → chunk-RLEAVG6G.mjs} +1 -1
  142. package/dist/{chunk-VO5XDZHK.mjs → chunk-RPA45OQS.mjs} +2 -2
  143. package/dist/{chunk-PNWRH6TR.mjs → chunk-RZ6XUEQS.mjs} +4 -4
  144. package/dist/{chunk-S6RUJRWI.mjs → chunk-S3IWDDQ3.mjs} +1 -1
  145. package/dist/{chunk-EGHPFXPZ.cjs → chunk-SAPG45RA.cjs} +23 -23
  146. package/dist/{chunk-FE6KYDHC.cjs → chunk-SHDCKRP4.cjs} +3 -3
  147. package/dist/{chunk-DUSTJ6A5.mjs → chunk-SLEHAGGV.mjs} +2 -2
  148. package/dist/{chunk-26CNCIFI.cjs → chunk-T3SMMLSB.cjs} +2 -2
  149. package/dist/{chunk-K6DXKHFE.mjs → chunk-TE7AX6HB.mjs} +1 -1
  150. package/dist/{chunk-A7EJATEW.mjs → chunk-TLSGRK7E.mjs} +4 -4
  151. package/dist/{chunk-KHS3T3E5.mjs → chunk-TYHWZOA2.mjs} +1 -1
  152. package/dist/{chunk-Z3QXQN4U.mjs → chunk-U6GMCDRS.mjs} +1 -1
  153. package/dist/{chunk-URQW27KO.mjs → chunk-UBLKPREL.mjs} +1 -1
  154. package/dist/chunk-UDMBUTJD.mjs +85 -0
  155. package/dist/{chunk-WJ4NUY2H.mjs → chunk-UF4BNKKJ.mjs} +4 -4
  156. package/dist/{chunk-L7Y65BQU.cjs → chunk-UGD53SNO.cjs} +50 -50
  157. package/dist/{chunk-DD22NQFX.cjs → chunk-UGLTOLTJ.cjs} +2 -2
  158. package/dist/{chunk-G7B6NU4X.cjs → chunk-VFMHE5D3.cjs} +3 -3
  159. package/dist/{chunk-4SLHSODZ.cjs → chunk-VGHDPEPQ.cjs} +15 -15
  160. package/dist/{chunk-IXO6O2EL.cjs → chunk-VGVRGGP4.cjs} +2 -2
  161. package/dist/{chunk-47R7CX4A.mjs → chunk-VPGEYX5Y.mjs} +4 -4
  162. package/dist/chunk-VS7HLH4S.cjs +385 -0
  163. package/dist/{chunk-YRXPDKMM.cjs → chunk-W53Z4WDI.cjs} +8 -8
  164. package/dist/{chunk-NNGBTJCX.cjs → chunk-W6C3LEXX.cjs} +83 -25
  165. package/dist/{chunk-4VLXQ55O.cjs → chunk-WIZRYFB2.cjs} +3 -3
  166. package/dist/chunk-WMRGIQTA.cjs +48 -0
  167. package/dist/{chunk-52LTENRE.cjs → chunk-WOAXQ5MZ.cjs} +9 -9
  168. package/dist/{chunk-C6HGUTXB.mjs → chunk-XBSIGZ4J.mjs} +2 -3
  169. package/dist/{chunk-S7QEQCVV.mjs → chunk-XGL42MQ7.mjs} +1 -1
  170. package/dist/{chunk-JHZ6HULQ.cjs → chunk-XOFJUSWC.cjs} +4 -4
  171. package/dist/{chunk-LJKTJNOF.cjs → chunk-XOGCNKB7.cjs} +3 -3
  172. package/dist/{chunk-7JTVN6IJ.mjs → chunk-XOXCQGAF.mjs} +7 -6
  173. package/dist/{chunk-LIC6CMLB.mjs → chunk-YH7ENV3K.mjs} +18 -18
  174. package/dist/{chunk-ZJGFAW5U.mjs → chunk-YHHOTKUT.mjs} +5 -1
  175. package/dist/{chunk-B3IRRANH.mjs → chunk-YHM4PXJY.mjs} +1 -1
  176. package/dist/{chunk-PDACTAVX.mjs → chunk-YOVSWY2E.mjs} +1 -1
  177. package/dist/{chunk-ZEWIWAS2.mjs → chunk-YSU3WCW6.mjs} +2 -2
  178. package/dist/{chunk-R5X7FDOG.mjs → chunk-YU2MNIIY.mjs} +1 -1
  179. package/dist/{chunk-42EUEYW6.cjs → chunk-YUQUGVSV.cjs} +8 -8
  180. package/dist/{chunk-4STJ6LGR.mjs → chunk-Z3RM3VA2.mjs} +1 -1
  181. package/dist/{chunk-MBD34AS5.cjs → chunk-Z5BANEQD.cjs} +6 -6
  182. package/dist/{chunk-4PWGLPL6.mjs → chunk-ZIEO3DQ3.mjs} +26 -15
  183. package/dist/{chunk-2G6JPLSL.cjs → chunk-ZIYJWJV2.cjs} +27 -20
  184. package/dist/{chunk-KZ5BOWJS.cjs → chunk-ZKNXCRUQ.cjs} +28 -28
  185. package/dist/{cli-runtime.d-CGMGs1Zz.d.mts → cli-runtime.d-D8O1v2_X.d.mts} +7 -6
  186. package/dist/{cli-runtime.d-BG9q2_vC.d.ts → cli-runtime.d-hf4L1MNP.d.ts} +7 -6
  187. package/dist/client/lifecycle.d.mts +1 -1
  188. package/dist/client/lifecycle.d.ts +1 -1
  189. package/dist/{client-component.d-B84GPb_u.d.ts → client-component.d-CX8UCQh-.d.ts} +1 -1
  190. package/dist/{client-component.d-CdsG1E7p.d.mts → client-component.d-DFwUHlOz.d.mts} +1 -1
  191. package/dist/{client-plugins.d-DX-iCJWE.d.mts → client-plugins.d-BflSNO-b.d.mts} +5 -16
  192. package/dist/{client-plugins.d-FptsHgls.d.ts → client-plugins.d-qWp8hNwd.d.ts} +5 -16
  193. package/dist/client-plugins.d.mts +5 -4
  194. package/dist/client-plugins.d.ts +5 -4
  195. package/dist/client.cjs +9 -8
  196. package/dist/client.d.mts +23 -154
  197. package/dist/client.d.ts +23 -154
  198. package/dist/client.mjs +8 -7
  199. package/dist/config.d.mts +5 -4
  200. package/dist/config.d.ts +5 -4
  201. package/dist/cron.cjs +3 -3
  202. package/dist/cron.mjs +2 -2
  203. package/dist/desktop.d.mts +6 -5
  204. package/dist/desktop.d.ts +6 -5
  205. package/dist/{devtools-TMATFNUY.cjs → devtools-EI5N366Z.cjs} +17 -17
  206. package/dist/{devtools-7P3OUNLV.mjs → devtools-XJHODO5H.mjs} +14 -14
  207. package/dist/docs.cjs +18 -18
  208. package/dist/docs.d.mts +7 -6
  209. package/dist/docs.d.ts +7 -6
  210. package/dist/docs.mjs +17 -17
  211. package/dist/environment/vite.cjs +8 -7
  212. package/dist/environment/vite.d.mts +9 -0
  213. package/dist/environment/vite.d.ts +9 -0
  214. package/dist/environment/vite.mjs +7 -6
  215. package/dist/{handler.d-Cy3XbY_W.d.ts → handler.d-C2oRihfa.d.ts} +1 -1
  216. package/dist/{handler.d-DSwLTpa5.d.mts → handler.d-DoH5Krkq.d.mts} +1 -1
  217. package/dist/{headers.d-DiL9YTH3.d.mts → headers.d-BrX53wFQ.d.mts} +1 -1
  218. package/dist/{headers.d-Qbjo38a0.d.ts → headers.d-Dj0mfYpb.d.ts} +1 -1
  219. package/dist/index.cjs +90 -82
  220. package/dist/{index.d-OccJoC6I.d.ts → index.d-Dhc2scRl.d.ts} +1 -1
  221. package/dist/{index.d-CqQKX3s6.d.mts → index.d-DzDHOttz.d.mts} +1 -1
  222. package/dist/index.d.mts +29 -27
  223. package/dist/index.d.ts +29 -27
  224. package/dist/index.mjs +92 -84
  225. package/dist/instrumentation.cjs +3 -3
  226. package/dist/instrumentation.mjs +2 -2
  227. package/dist/integrations/orm.cjs +3 -3
  228. package/dist/integrations/orm.d.mts +5 -4
  229. package/dist/integrations/orm.d.ts +5 -4
  230. package/dist/integrations/orm.mjs +2 -2
  231. package/dist/integrations.cjs +2 -2
  232. package/dist/integrations.d.mts +5 -4
  233. package/dist/integrations.d.ts +5 -4
  234. package/dist/integrations.mjs +1 -1
  235. package/dist/internal/app-markdown-runtime.cjs +4 -4
  236. package/dist/internal/app-markdown-runtime.d.mts +15 -8
  237. package/dist/internal/app-markdown-runtime.d.ts +15 -8
  238. package/dist/internal/app-markdown-runtime.mjs +3 -3
  239. package/dist/internal/build-runtime.cjs +63 -62
  240. package/dist/internal/build-runtime.d.mts +8 -7
  241. package/dist/internal/build-runtime.d.ts +8 -7
  242. package/dist/internal/build-runtime.mjs +62 -61
  243. package/dist/internal/cli-runtime.cjs +37 -34
  244. package/dist/internal/cli-runtime.d.mts +12 -11
  245. package/dist/internal/cli-runtime.d.ts +12 -11
  246. package/dist/internal/cli-runtime.mjs +39 -36
  247. package/dist/internal/client-error-overlay.cjs +4 -4
  248. package/dist/internal/client-error-overlay.mjs +1 -1
  249. package/dist/internal/client-runtime.cjs +112 -14
  250. package/dist/internal/client-runtime.d.mts +29 -22
  251. package/dist/internal/client-runtime.d.ts +29 -22
  252. package/dist/internal/client-runtime.mjs +104 -6
  253. package/dist/internal/compression-runtime.d.mts +5 -4
  254. package/dist/internal/compression-runtime.d.ts +5 -4
  255. package/dist/internal/config-runtime.cjs +16 -16
  256. package/dist/internal/config-runtime.d.mts +7 -6
  257. package/dist/internal/config-runtime.d.ts +7 -6
  258. package/dist/internal/config-runtime.mjs +15 -15
  259. package/dist/internal/docs-precompiled-runtime.cjs +1 -1
  260. package/dist/internal/docs-precompiled-runtime.mjs +1 -1
  261. package/dist/internal/form-actions.cjs +3 -3
  262. package/dist/internal/form-actions.mjs +2 -2
  263. package/dist/internal/infra-analytics-runtime.cjs +11 -11
  264. package/dist/internal/infra-analytics-runtime.mjs +9 -9
  265. package/dist/internal/island-codec.cjs +3 -3
  266. package/dist/internal/island-codec.mjs +2 -2
  267. package/dist/internal/island-value-store.d.mts +1 -1
  268. package/dist/internal/island-value-store.d.ts +1 -1
  269. package/dist/internal/islands-boot.cjs +39 -5
  270. package/dist/internal/islands-boot.d.mts +19 -1
  271. package/dist/internal/islands-boot.d.ts +19 -1
  272. package/dist/internal/islands-boot.mjs +38 -4
  273. package/dist/internal/islands-runtime.cjs +10 -56
  274. package/dist/internal/islands-runtime.mjs +6 -52
  275. package/dist/internal/islands-server.cjs +4 -4
  276. package/dist/internal/islands-server.mjs +3 -3
  277. package/dist/internal/islx-actions-client.cjs +36 -0
  278. package/dist/internal/islx-actions-client.d.mts +13 -0
  279. package/dist/internal/islx-actions-client.d.ts +13 -0
  280. package/dist/internal/islx-actions-client.mjs +36 -0
  281. package/dist/internal/islx-actions-server.cjs +8 -0
  282. package/dist/internal/islx-actions-server.d.mts +6 -0
  283. package/dist/internal/islx-actions-server.d.ts +6 -0
  284. package/dist/internal/islx-actions-server.mjs +8 -0
  285. package/dist/internal/islx-client.d.mts +0 -4
  286. package/dist/internal/islx-client.d.ts +0 -4
  287. package/dist/internal/isolated-boundary.cjs +3 -3
  288. package/dist/internal/isolated-boundary.d.mts +1 -1
  289. package/dist/internal/isolated-boundary.d.ts +1 -1
  290. package/dist/internal/isolated-boundary.mjs +2 -2
  291. package/dist/internal/metadata-image-runtime.cjs +4 -2
  292. package/dist/internal/metadata-image-runtime.d.mts +18 -2
  293. package/dist/internal/metadata-image-runtime.d.ts +18 -2
  294. package/dist/internal/metadata-image-runtime.mjs +5 -3
  295. package/dist/internal/native-server-fns.cjs +5 -4
  296. package/dist/internal/native-server-fns.mjs +4 -3
  297. package/dist/internal/navigation-neutral.cjs +36 -0
  298. package/dist/internal/navigation-neutral.d.mts +14 -0
  299. package/dist/internal/navigation-neutral.d.ts +14 -0
  300. package/dist/internal/navigation-neutral.mjs +36 -0
  301. package/dist/internal/product-telemetry-runtime.cjs +3 -3
  302. package/dist/internal/product-telemetry-runtime.mjs +2 -2
  303. package/dist/internal/production-runtime.cjs +36 -36
  304. package/dist/internal/production-runtime.d.mts +15 -13
  305. package/dist/internal/production-runtime.d.ts +15 -13
  306. package/dist/internal/production-runtime.mjs +46 -46
  307. package/dist/internal/server-tree.cjs +5 -4
  308. package/dist/internal/server-tree.d.mts +3 -4
  309. package/dist/internal/server-tree.d.ts +3 -4
  310. package/dist/internal/server-tree.mjs +4 -3
  311. package/dist/internal/spa-router.cjs +44 -0
  312. package/dist/internal/spa-router.d.mts +42 -0
  313. package/dist/internal/spa-router.d.ts +42 -0
  314. package/dist/internal/spa-router.mjs +44 -0
  315. package/dist/internal/start-manifest.d.mts +5 -4
  316. package/dist/internal/start-manifest.d.ts +5 -4
  317. package/dist/internal/vercel-edge-middleware.cjs +4 -4
  318. package/dist/internal/vercel-edge-middleware.mjs +3 -3
  319. package/dist/island-value-protocol.d-fEoc1m8e.d.mts +27 -0
  320. package/dist/island-value-protocol.d-fEoc1m8e.d.ts +27 -0
  321. package/dist/{layers-5ZD4764G.mjs → layers-744BBUY5.mjs} +2 -2
  322. package/dist/layers-XLOMMQP7.cjs +21 -0
  323. package/dist/{lifecycle.d-VzcXyEyn.d.ts → lifecycle.d-OtGWAvJT.d.mts} +1 -1
  324. package/dist/{lifecycle.d-VzcXyEyn.d.mts → lifecycle.d-OtGWAvJT.d.ts} +1 -1
  325. package/dist/markdown.cjs +3 -3
  326. package/dist/markdown.d.mts +5 -4
  327. package/dist/markdown.d.ts +5 -4
  328. package/dist/markdown.mjs +2 -2
  329. package/dist/middleware.cjs +10 -10
  330. package/dist/middleware.d.mts +5 -4
  331. package/dist/middleware.d.ts +5 -4
  332. package/dist/middleware.mjs +9 -9
  333. package/dist/{mount.d-AcJaUtHF.d.mts → mount.d-DOaeUoWq.d.mts} +1 -1
  334. package/dist/{mount.d-CPzqOm-a.d.ts → mount.d-DwXjaOHY.d.ts} +1 -1
  335. package/dist/{native-server-fn-handler-XRTZR7SZ.cjs → native-server-fn-handler-57TCQPSM.cjs} +6 -6
  336. package/dist/{native-server-fn-handler-WYYY4YBN.mjs → native-server-fn-handler-PYK65A46.mjs} +5 -5
  337. package/dist/{native-tree-MNUFN5G6.cjs → native-tree-5TENEQ7Y.cjs} +4 -4
  338. package/dist/{native-tree-JDI3LJSH.mjs → native-tree-LNO7K6JR.mjs} +3 -3
  339. package/dist/{navigation-delegate.d-C4i5Y39E.d.mts → navigation-delegate.d-BElGUMgt.d.mts} +1 -1
  340. package/dist/{navigation-delegate.d-_Df9DnPY.d.ts → navigation-delegate.d-o3pPd9VI.d.ts} +1 -1
  341. package/dist/navigation-errors.d-DwHtoMyR.d.mts +13 -0
  342. package/dist/navigation-errors.d-DwHtoMyR.d.ts +13 -0
  343. package/dist/navigation.cjs +6 -6
  344. package/dist/navigation.d.mts +10 -9
  345. package/dist/navigation.d.ts +10 -9
  346. package/dist/navigation.mjs +5 -5
  347. package/dist/{nitro-NUCTYEKJ.cjs → nitro-XGIO6EQN.cjs} +7 -7
  348. package/dist/{nitro-VCJ6QQSI.mjs → nitro-YLTGVGK4.mjs} +3 -3
  349. package/dist/node-module-bundle-TNSY5PAC.cjs +15 -0
  350. package/dist/{node-module-bundle-XPLBMXRD.mjs → node-module-bundle-ZWCQJCKA.mjs} +3 -1
  351. package/dist/observability.cjs +8 -2
  352. package/dist/{observability.d-DdJRiaIX.d.mts → observability.d-mXSbp4jc.d.mts} +17 -1
  353. package/dist/{observability.d-DdJRiaIX.d.ts → observability.d-mXSbp4jc.d.ts} +17 -1
  354. package/dist/observability.d.mts +1 -1
  355. package/dist/observability.d.ts +1 -1
  356. package/dist/observability.mjs +7 -1
  357. package/dist/{plugin-TV6W7YNK.mjs → plugin-33I3V42N.mjs} +1 -1
  358. package/dist/{plugin-AGEFSU7K.cjs → plugin-LN3JBZRR.cjs} +2 -2
  359. package/dist/plugin.cjs +50 -48
  360. package/dist/plugin.d.mts +9 -8
  361. package/dist/plugin.d.ts +9 -8
  362. package/dist/plugin.mjs +49 -47
  363. package/dist/query/client.cjs +10 -10
  364. package/dist/query/client.mjs +5 -5
  365. package/dist/{render-plan.d-CslZE7o7.d.ts → render-plan.d-BD06tqFA.d.ts} +1 -1
  366. package/dist/{render-plan.d-4V_NmaA6.d.mts → render-plan.d-xWCRAJeR.d.mts} +1 -1
  367. package/dist/renderer/none/server.cjs +5 -1
  368. package/dist/renderer/none/server.d.mts +3 -1
  369. package/dist/renderer/none/server.d.ts +3 -1
  370. package/dist/renderer/none/server.mjs +4 -0
  371. package/dist/renderer/react/server.cjs +6 -6
  372. package/dist/renderer/react/server.mjs +3 -3
  373. package/dist/renderer-client.cjs +34 -15
  374. package/dist/renderer-client.d.mts +16 -100
  375. package/dist/renderer-client.d.ts +16 -100
  376. package/dist/renderer-client.mjs +23 -4
  377. package/dist/renderer.cjs +4 -2
  378. package/dist/renderer.d.mts +49 -6
  379. package/dist/renderer.d.ts +49 -6
  380. package/dist/renderer.mjs +3 -1
  381. package/dist/{request.d-CbV3y7j3.d.ts → request.d-DUMuWxSN.d.ts} +1 -1
  382. package/dist/{request.d-CmLTxEgS.d.mts → request.d-Dx82V8bz.d.mts} +1 -1
  383. package/dist/request.d.mts +6 -5
  384. package/dist/request.d.ts +6 -5
  385. package/dist/{route-rendering.d-CETnXNez.d.ts → route-rendering.d-BwBVpLtD.d.ts} +1 -1
  386. package/dist/{route-rendering.d-CmoqfOmj.d.mts → route-rendering.d-DJh6GauM.d.mts} +1 -1
  387. package/dist/{router.d-ktz7pwYm.d.mts → router.d-BtkKDxUB.d.mts} +1 -1
  388. package/dist/{router.d-Dga3N5YO.d.ts → router.d-CJBSG5jr.d.ts} +1 -1
  389. package/dist/routes.cjs +5 -5
  390. package/dist/routes.d.mts +5 -4
  391. package/dist/routes.d.ts +5 -4
  392. package/dist/routes.mjs +4 -4
  393. package/dist/{rsc-pipeline-N7CWJW7T.mjs → rsc-pipeline-GD6KLOIG.mjs} +20 -20
  394. package/dist/{rsc-pipeline-JLYD26AR.cjs → rsc-pipeline-H5AXQA7A.cjs} +21 -21
  395. package/dist/{runtime-QXX2A4TS.mjs → runtime-OJ7FXFUI.mjs} +22 -22
  396. package/dist/{runtime-F5NSS4DD.cjs → runtime-YWQVBC3V.cjs} +32 -32
  397. package/dist/{runtime.d-BWLZUOfA.d.ts → runtime.d-BQnD0cfC.d.ts} +1 -1
  398. package/dist/{runtime.d-DuaXEM0p.d.mts → runtime.d-C4SuZXf6.d.mts} +1 -1
  399. package/dist/{schema-dev-notice-2GN5V7Y2.mjs → schema-dev-notice-EUPAUJVN.mjs} +2 -2
  400. package/dist/{schema-dev-notice-6VCOZGG2.cjs → schema-dev-notice-ZSCL47CT.cjs} +5 -5
  401. package/dist/search-client-A7YJT7JZ.cjs +15 -0
  402. package/dist/{search-client-W4PEFAQB.mjs → search-client-GIXIEU75.mjs} +1 -1
  403. package/dist/server-action-security.cjs +1 -1
  404. package/dist/server-action-security.mjs +1 -1
  405. package/dist/{server-components-status.d-CqxtJmqP.d.mts → server-components-status.d-9rH7ZoEq.d.mts} +1 -1
  406. package/dist/{server-components-status.d-C5JpC7_Y.d.ts → server-components-status.d-rfKOcE0N.d.ts} +1 -1
  407. package/dist/server-fn.cjs +5 -5
  408. package/dist/server-fn.mjs +4 -4
  409. package/dist/server-plugins.cjs +1 -1
  410. package/dist/server-plugins.d.mts +7 -6
  411. package/dist/server-plugins.d.ts +7 -6
  412. package/dist/server-plugins.mjs +1 -1
  413. package/dist/server-query.cjs +6 -6
  414. package/dist/server-query.mjs +5 -5
  415. package/dist/server.cjs +95 -90
  416. package/dist/server.d.mts +16 -15
  417. package/dist/server.d.ts +16 -15
  418. package/dist/server.mjs +61 -56
  419. package/dist/{session-AK2OA5UZ.mjs → session-4IB34X35.mjs} +2 -2
  420. package/dist/session-MOYQJ7E6.cjs +24 -0
  421. package/dist/{spa-router.d-C3LzwTlY.d.ts → spa-router.d-DMKiBsHH.d.ts} +20 -4
  422. package/dist/{spa-router.d-BLE188EL.d.mts → spa-router.d-V6XLSTCy.d.mts} +20 -4
  423. package/dist/{ssg.d-QrFyU6T4.d.mts → ssg.d-BnCKPQL0.d.mts} +2 -2
  424. package/dist/{ssg.d-DisOfj0I.d.ts → ssg.d-MNedvvMB.d.ts} +2 -2
  425. package/dist/storage.cjs +2 -2
  426. package/dist/storage.d.mts +112 -96
  427. package/dist/storage.d.ts +112 -96
  428. package/dist/storage.mjs +1 -1
  429. package/dist/store-core.d-Ad5biajo.d.ts +301 -0
  430. package/dist/store-core.d-BqJI1-ix.d.mts +301 -0
  431. package/dist/testing.cjs +13 -13
  432. package/dist/testing.d.mts +5 -4
  433. package/dist/testing.d.ts +5 -4
  434. package/dist/testing.mjs +10 -10
  435. package/dist/{types.d-DW2vyaUq.d.mts → types.d-C5hlNbHa.d.mts} +8 -1
  436. package/dist/{types.d-DW2vyaUq.d.ts → types.d-C5hlNbHa.d.ts} +8 -1
  437. package/dist/{utils.d-BlWZFgdL.d.mts → utils.d-BEKLWa0Z.d.mts} +1 -1
  438. package/dist/{utils.d-7YcgfTCK.d.ts → utils.d-BdjHKDuT.d.ts} +1 -1
  439. package/dist/version.cjs +2 -2
  440. package/dist/version.mjs +1 -1
  441. package/dist/vite.cjs +55 -49
  442. package/dist/vite.d.mts +26 -10
  443. package/dist/vite.d.ts +26 -10
  444. package/dist/vite.mjs +54 -48
  445. package/dist/workflows.cjs +3 -3
  446. package/dist/workflows.mjs +2 -2
  447. package/package.json +23 -2
  448. package/types/images.d.ts +9 -0
  449. package/dist/analyzer-KVTUYGTT.cjs +0 -16
  450. package/dist/chunk-CQL5ZGFU.cjs +0 -50
  451. package/dist/chunk-HONTCUK6.mjs +0 -203
  452. package/dist/chunk-K6PGK7DC.cjs +0 -203
  453. package/dist/chunk-NBIVGHAT.mjs +0 -50
  454. package/dist/island-value-protocol.d-BRayRghM.d.mts +0 -12
  455. package/dist/island-value-protocol.d-BRayRghM.d.ts +0 -12
  456. package/dist/layers-HMEGUEXM.cjs +0 -21
  457. package/dist/node-module-bundle-M6BISE2P.cjs +0 -13
  458. package/dist/search-client-6NVC6HM2.cjs +0 -15
  459. package/dist/session-H4TWP73H.cjs +0 -24
  460. package/dist/{chunk-JKFN3YVG.mjs → chunk-6JWXHPVR.mjs} +0 -0
  461. package/dist/{chunk-522K362I.mjs → chunk-C2OLXVUC.mjs} +0 -0
  462. package/dist/{chunk-MALGIHIC.cjs → chunk-HS4JPIGR.cjs} +0 -0
  463. package/dist/{chunk-PBJ7MEOV.cjs → chunk-OZUINP2P.cjs} +2 -2
  464. package/dist/{chunk-CUZT7474.cjs → chunk-TCMRLW3K.cjs} +0 -0
  465. package/dist/{chunk-Q3DO7MVK.mjs → chunk-URBP6DLH.mjs} +0 -0
  466. package/dist/{chunk-7FQFK3OA.mjs → chunk-V7HNYR76.mjs} +3 -3
  467. /package/dist/{chunk-AOTD2N5P.cjs → chunk-WGWWRV2M.cjs} +0 -0
@@ -28,11 +28,11 @@ var _chunkNG2EZ6QScjs = require('./chunk-NG2EZ6QS.cjs');
28
28
  var _chunkVM57CK74cjs = require('./chunk-VM57CK74.cjs');
29
29
 
30
30
 
31
- var _chunkIWGGRXD2cjs = require('./chunk-IWGGRXD2.cjs');
31
+ var _chunkMHKPXX3Jcjs = require('./chunk-MHKPXX3J.cjs');
32
32
 
33
33
 
34
34
 
35
- var _chunkLJKTJNOFcjs = require('./chunk-LJKTJNOF.cjs');
35
+ var _chunkXOGCNKB7cjs = require('./chunk-XOGCNKB7.cjs');
36
36
 
37
37
 
38
38
 
@@ -41,7 +41,7 @@ var _chunkLJKTJNOFcjs = require('./chunk-LJKTJNOF.cjs');
41
41
 
42
42
 
43
43
 
44
- var _chunkXGS76V7Lcjs = require('./chunk-XGS76V7L.cjs');
44
+ var _chunkE3HBD2K3cjs = require('./chunk-E3HBD2K3.cjs');
45
45
 
46
46
 
47
47
 
@@ -54,18 +54,18 @@ var _chunkXGS76V7Lcjs = require('./chunk-XGS76V7L.cjs');
54
54
 
55
55
 
56
56
 
57
- var _chunk6D3CJFNUcjs = require('./chunk-6D3CJFNU.cjs');
57
+ var _chunkHR5GU4UUcjs = require('./chunk-HR5GU4UU.cjs');
58
58
 
59
59
 
60
60
 
61
61
 
62
- var _chunkDZZHTMWMcjs = require('./chunk-DZZHTMWM.cjs');
62
+ var _chunkN3H7UPBMcjs = require('./chunk-N3H7UPBM.cjs');
63
63
 
64
64
 
65
- var _chunk42EUEYW6cjs = require('./chunk-42EUEYW6.cjs');
65
+ var _chunkYUQUGVSVcjs = require('./chunk-YUQUGVSV.cjs');
66
66
 
67
67
 
68
- var _chunkNNGBTJCXcjs = require('./chunk-NNGBTJCX.cjs');
68
+ var _chunkW6C3LEXXcjs = require('./chunk-W6C3LEXX.cjs');
69
69
 
70
70
 
71
71
  var _chunkNDOE76QCcjs = require('./chunk-NDOE76QC.cjs');
@@ -74,10 +74,10 @@ var _chunkNDOE76QCcjs = require('./chunk-NDOE76QC.cjs');
74
74
 
75
75
 
76
76
 
77
- var _chunkF7PKUP6Pcjs = require('./chunk-F7PKUP6P.cjs');
77
+ var _chunkMOGRRZMWcjs = require('./chunk-MOGRRZMW.cjs');
78
78
 
79
79
 
80
- var _chunk3GNHJ3RNcjs = require('./chunk-3GNHJ3RN.cjs');
80
+ var _chunk3BTN3NP7cjs = require('./chunk-3BTN3NP7.cjs');
81
81
 
82
82
 
83
83
  var _chunkOCS3PSYRcjs = require('./chunk-OCS3PSYR.cjs');
@@ -116,26 +116,26 @@ var _chunkO4JYMU5Ncjs = require('./chunk-O4JYMU5N.cjs');
116
116
 
117
117
 
118
118
 
119
- var _chunkHVMQAVZKcjs = require('./chunk-HVMQAVZK.cjs');
120
119
 
121
120
 
122
121
 
122
+ var _chunkCL7BUGVBcjs = require('./chunk-CL7BUGVB.cjs');
123
123
 
124
124
 
125
125
 
126
- var _chunkMBD34AS5cjs = require('./chunk-MBD34AS5.cjs');
127
126
 
128
127
 
129
- var _chunkCUZT7474cjs = require('./chunk-CUZT7474.cjs');
130
128
 
129
+ var _chunkZ5BANEQDcjs = require('./chunk-Z5BANEQD.cjs');
131
130
 
132
131
 
132
+ var _chunkTCMRLW3Kcjs = require('./chunk-TCMRLW3K.cjs');
133
133
 
134
134
 
135
- var _chunkBZJYPIFZcjs = require('./chunk-BZJYPIFZ.cjs');
136
135
 
137
136
 
138
137
 
138
+ var _chunkOUDNUFVRcjs = require('./chunk-OUDNUFVR.cjs');
139
139
 
140
140
 
141
141
 
@@ -145,7 +145,10 @@ var _chunkBZJYPIFZcjs = require('./chunk-BZJYPIFZ.cjs');
145
145
 
146
146
 
147
147
 
148
- var _chunk6ZFGWB75cjs = require('./chunk-6ZFGWB75.cjs');
148
+
149
+
150
+
151
+ var _chunkOFVCWV2Dcjs = require('./chunk-OFVCWV2D.cjs');
149
152
 
150
153
 
151
154
  var _chunk3HLQTOVUcjs = require('./chunk-3HLQTOVU.cjs');
@@ -159,15 +162,15 @@ var _chunk47JV57DAcjs = require('./chunk-47JV57DA.cjs');
159
162
 
160
163
 
161
164
 
162
- var _chunk5KISFWD2cjs = require('./chunk-5KISFWD2.cjs');
165
+ var _chunkFYZD7DUScjs = require('./chunk-FYZD7DUS.cjs');
163
166
 
164
167
 
165
168
 
166
169
 
167
- var _chunkYRXPDKMMcjs = require('./chunk-YRXPDKMM.cjs');
170
+ var _chunkW53Z4WDIcjs = require('./chunk-W53Z4WDI.cjs');
168
171
 
169
172
 
170
- var _chunkFOULIN4Scjs = require('./chunk-FOULIN4S.cjs');
173
+ var _chunkADQ2LATRcjs = require('./chunk-ADQ2LATR.cjs');
171
174
 
172
175
 
173
176
  var _chunk4EBC7EMWcjs = require('./chunk-4EBC7EMW.cjs');
@@ -188,7 +191,7 @@ var _chunk4EBC7EMWcjs = require('./chunk-4EBC7EMW.cjs');
188
191
 
189
192
 
190
193
 
191
- var _chunkODYKCC6Wcjs = require('./chunk-ODYKCC6W.cjs');
194
+ var _chunk46UV2E7Icjs = require('./chunk-46UV2E7I.cjs');
192
195
 
193
196
 
194
197
 
@@ -210,7 +213,7 @@ var _chunk6JHZPB52cjs = require('./chunk-6JHZPB52.cjs');
210
213
  var _chunkRE5E2G5Scjs = require('./chunk-RE5E2G5S.cjs');
211
214
 
212
215
 
213
- var _chunkQMR2TUVZcjs = require('./chunk-QMR2TUVZ.cjs');
216
+ var _chunk52Q4OB4Acjs = require('./chunk-52Q4OB4A.cjs');
214
217
 
215
218
 
216
219
 
@@ -220,14 +223,14 @@ var _chunkQMR2TUVZcjs = require('./chunk-QMR2TUVZ.cjs');
220
223
 
221
224
 
222
225
 
223
- var _chunk67MZTLTFcjs = require('./chunk-67MZTLTF.cjs');
226
+ var _chunkM6DAIE4Tcjs = require('./chunk-M6DAIE4T.cjs');
224
227
 
225
228
 
226
229
 
227
230
 
228
231
 
229
232
 
230
- var _chunkCYNQPKA4cjs = require('./chunk-CYNQPKA4.cjs');
233
+ var _chunk5ZHC6QGDcjs = require('./chunk-5ZHC6QGD.cjs');
231
234
 
232
235
 
233
236
  var _chunkXRFGOYXGcjs = require('./chunk-XRFGOYXG.cjs');
@@ -239,39 +242,39 @@ var _chunk3EIPOTZVcjs = require('./chunk-3EIPOTZV.cjs');
239
242
 
240
243
 
241
244
 
242
- var _chunkPG7J7XYTcjs = require('./chunk-PG7J7XYT.cjs');
245
+ var _chunk26WP75W5cjs = require('./chunk-26WP75W5.cjs');
243
246
 
244
247
 
245
248
 
246
249
  var _chunk2HW5LWAHcjs = require('./chunk-2HW5LWAH.cjs');
247
250
 
248
251
 
249
- var _chunk2YJ4DHTDcjs = require('./chunk-2YJ4DHTD.cjs');
252
+ var _chunk2NOHVIJ3cjs = require('./chunk-2NOHVIJ3.cjs');
250
253
 
251
254
 
252
- var _chunkASYOWPSRcjs = require('./chunk-ASYOWPSR.cjs');
255
+ var _chunkPWDBWXQIcjs = require('./chunk-PWDBWXQI.cjs');
253
256
 
254
257
 
255
258
 
256
- var _chunkCKNZJFK5cjs = require('./chunk-CKNZJFK5.cjs');
259
+ var _chunkBSX5OGSDcjs = require('./chunk-BSX5OGSD.cjs');
257
260
 
258
261
 
259
262
 
260
- var _chunkAOTD2N5Pcjs = require('./chunk-AOTD2N5P.cjs');
263
+ var _chunkWGWWRV2Mcjs = require('./chunk-WGWWRV2M.cjs');
261
264
 
262
265
 
263
266
  var _chunkQKW6DLDTcjs = require('./chunk-QKW6DLDT.cjs');
264
267
 
265
268
 
266
- var _chunkEVVV2XZ2cjs = require('./chunk-EVVV2XZ2.cjs');
269
+ var _chunkNW3DL2PMcjs = require('./chunk-NW3DL2PM.cjs');
267
270
 
268
271
 
269
272
 
270
273
 
271
- var _chunkFE6KYDHCcjs = require('./chunk-FE6KYDHC.cjs');
274
+ var _chunkSHDCKRP4cjs = require('./chunk-SHDCKRP4.cjs');
272
275
 
273
276
 
274
- var _chunk5DREJN4Gcjs = require('./chunk-5DREJN4G.cjs');
277
+ var _chunkLKIG5SM6cjs = require('./chunk-LKIG5SM6.cjs');
275
278
 
276
279
 
277
280
  var _chunkCYOTNHDFcjs = require('./chunk-CYOTNHDF.cjs');
@@ -292,14 +295,14 @@ var _chunkIUKBPBM7cjs = require('./chunk-IUKBPBM7.cjs');
292
295
 
293
296
 
294
297
 
295
- var _chunkGC5ROI3Acjs = require('./chunk-GC5ROI3A.cjs');
298
+ var _chunk7U4XF76Rcjs = require('./chunk-7U4XF76R.cjs');
296
299
 
297
300
 
298
301
 
299
302
  var _chunk2OF5RPVUcjs = require('./chunk-2OF5RPVU.cjs');
300
303
 
301
304
 
302
- var _chunkLMXGCFAMcjs = require('./chunk-LMXGCFAM.cjs');
305
+ var _chunkNSLRK5DKcjs = require('./chunk-NSLRK5DK.cjs');
303
306
 
304
307
 
305
308
  var _chunkY3DO7BIJcjs = require('./chunk-Y3DO7BIJ.cjs');
@@ -606,7 +609,7 @@ function getDocsTitle(docs) {
606
609
  return typeof docs.config.nav === "object" && docs.config.nav && "title" in docs.config.nav ? String(docs.config.nav.title || "Documentation") : "Documentation";
607
610
  }
608
611
  function loadPages(contentDir, docs) {
609
- return _chunk6D3CJFNUcjs.discoverFarmDocsPages.call(void 0, contentDir, docs).map((page) => _chunk6D3CJFNUcjs.loadFarmDocsPage.call(void 0, contentDir, docs, page.slug)).filter((page) => Boolean(page)).sort((a, b) => a.href.localeCompare(b.href));
612
+ return _chunkHR5GU4UUcjs.discoverFarmDocsPages.call(void 0, contentDir, docs).map((page) => _chunkHR5GU4UUcjs.loadFarmDocsPage.call(void 0, contentDir, docs, page.slug)).filter((page) => Boolean(page)).sort((a, b) => a.href.localeCompare(b.href));
610
613
  }
611
614
  function findSocialImagePath(html, basePath) {
612
615
  const match = /<meta\s+property=["']og:image["']\s+content=["']([^"']+)["']/i.exec(html) || /<meta\s+content=["']([^"']+)["']\s+property=["']og:image["']/i.exec(html);
@@ -624,7 +627,7 @@ async function addHandlerRoute(routes, pathname, handler, absolutePaths) {
624
627
  return response;
625
628
  }
626
629
  async function compileFarmDocsManifest(docs, options) {
627
- const contentDir = _chunk6D3CJFNUcjs.resolveFarmDocsContentDir.call(void 0, docs, options);
630
+ const contentDir = _chunkHR5GU4UUcjs.resolveFarmDocsContentDir.call(void 0, docs, options);
628
631
  const pages = loadPages(contentDir, docs);
629
632
  const basePath = _chunkD22BUQKWcjs.normalizeFarmBasePath.call(void 0, options.basePath);
630
633
  const absolutePaths = [
@@ -632,7 +635,7 @@ async function compileFarmDocsManifest(docs, options) {
632
635
  _path2.default.resolve(contentDir),
633
636
  docs.configPath || ""
634
637
  ];
635
- const handler = _chunk6D3CJFNUcjs.createFarmDocsHandler.call(void 0, docs, {
638
+ const handler = _chunkHR5GU4UUcjs.createFarmDocsHandler.call(void 0, docs, {
636
639
  root: options.root,
637
640
  srcDir: options.srcDir,
638
641
  clientEntry: options.clientEntry,
@@ -642,7 +645,7 @@ async function compileFarmDocsManifest(docs, options) {
642
645
  isPathGuarded: options.isPathGuarded,
643
646
  basePath
644
647
  });
645
- const apiHandler = _chunkXGS76V7Lcjs.createFarmDocsAPIHandler.call(void 0, {
648
+ const apiHandler = _chunkE3HBD2K3cjs.createFarmDocsAPIHandler.call(void 0, {
646
649
  rootDir: options.root,
647
650
  srcDir: options.srcDir,
648
651
  docs,
@@ -654,7 +657,7 @@ async function compileFarmDocsManifest(docs, options) {
654
657
  const apiMarkdown = {};
655
658
  for (const page of pages) {
656
659
  const htmlResponse = await addHandlerRoute(routes, page.href, handler, absolutePaths);
657
- const markdownPath = _chunk6D3CJFNUcjs.getFarmDocsMarkdownPath.call(void 0, page.href);
660
+ const markdownPath = _chunkHR5GU4UUcjs.getFarmDocsMarkdownPath.call(void 0, page.href);
658
661
  await addHandlerRoute(routes, markdownPath, handler, absolutePaths);
659
662
  if (htmlResponse) {
660
663
  const socialImagePath = findSocialImagePath(await htmlResponse.text(), basePath);
@@ -739,7 +742,7 @@ async function compileFarmDocsManifest(docs, options) {
739
742
  post: await compileResponse(postResponse, absolutePaths),
740
743
  search: {
741
744
  pages: publicPages.map((page) => ({
742
- ..._chunk6D3CJFNUcjs.toFarmDocsMarkdownPage.call(void 0, page, basePath),
745
+ ..._chunkHR5GU4UUcjs.toFarmDocsMarkdownPage.call(void 0, page, basePath),
743
746
  sourcePath: `farm-docs:${page.slug || "index"}`
744
747
  })),
745
748
  search: _nullishCoalesce(searchConfig, () => ( true)),
@@ -792,26 +795,31 @@ function collectFarmClientModulePreloads(bundle, options) {
792
795
  const moduleId = chunk.facadeModuleId.split("?")[0];
793
796
  if (!_path2.default.isAbsolute(moduleId)) continue;
794
797
  const loaded = /* @__PURE__ */ new Set([...entryLoaded, chunk.fileName]);
795
- modules[_chunkGC5ROI3Acjs.toViteModuleId.call(void 0, moduleId, options.root)] = [
798
+ modules[_chunk7U4XF76Rcjs.toViteModuleId.call(void 0, moduleId, options.root)] = [
796
799
  chunk.fileName,
797
800
  ...staticImports(chunk, loaded, [])
798
801
  ].map(index);
799
802
  }
800
- const routerFiles = [];
801
- const routerLoaded = new Set(entryLoaded);
802
- for (const routerModule of _nullishCoalesce(options.routerModules, () => ( []))) {
803
- const chunk = chunks.find(
804
- (candidate) => candidate.isDynamicEntry && candidate.facadeModuleId && _path2.default.resolve(candidate.facadeModuleId.split("?")[0]) === _path2.default.resolve(routerModule)
805
- );
806
- if (!chunk || routerLoaded.has(chunk.fileName)) continue;
807
- routerLoaded.add(chunk.fileName);
808
- routerFiles.push(chunk.fileName);
809
- staticImports(chunk, routerLoaded, routerFiles);
810
- }
803
+ const dynamicFiles = (moduleIds) => {
804
+ const into = [];
805
+ const loaded = new Set(entryLoaded);
806
+ for (const moduleId of _nullishCoalesce(moduleIds, () => ( []))) {
807
+ const chunk = chunks.find(
808
+ (candidate) => candidate.isDynamicEntry && candidate.facadeModuleId && _path2.default.resolve(candidate.facadeModuleId.split("?")[0]) === _path2.default.resolve(moduleId)
809
+ );
810
+ if (!chunk || loaded.has(chunk.fileName)) continue;
811
+ loaded.add(chunk.fileName);
812
+ into.push(chunk.fileName);
813
+ staticImports(chunk, loaded, into);
814
+ }
815
+ return into;
816
+ };
817
+ const rendererFiles = dynamicFiles(options.rendererModules);
811
818
  return {
812
819
  files,
813
820
  entry: entryFiles.map(index),
814
- router: routerFiles.map(index),
821
+ router: dynamicFiles(options.routerModules).map(index),
822
+ ...rendererFiles.length > 0 ? { renderer: rendererFiles.map(index) } : {},
815
823
  modules
816
824
  };
817
825
  }
@@ -820,10 +828,15 @@ function createFarmClientModulePreloadPlugin(options) {
820
828
  name: "farm-client-module-preloads",
821
829
  enforce: "post",
822
830
  async generateBundle(_output, bundle) {
831
+ const rendererModules = [];
832
+ for (const specifier of _nullishCoalesce(options.rendererImports, () => ( []))) {
833
+ const resolved = await this.resolve(specifier, options.rendererImporter);
834
+ if (resolved) rendererModules.push(resolved.id);
835
+ }
823
836
  await _promises2.default.mkdir(options.buildDir, { recursive: true });
824
837
  await _promises2.default.writeFile(
825
838
  _path2.default.join(options.buildDir, FARM_CLIENT_MODULE_PRELOADS_FILE),
826
- JSON.stringify(collectFarmClientModulePreloads(bundle, options))
839
+ JSON.stringify(collectFarmClientModulePreloads(bundle, { ...options, rendererModules }))
827
840
  );
828
841
  }
829
842
  };
@@ -1009,7 +1022,7 @@ async function createFarmRouteRuntimeManifest(options) {
1009
1022
  const routes = [];
1010
1023
  for (const [pattern, entry] of options.routeManager.getRoutes()) {
1011
1024
  const routeModule = await options.routeManager.loadRouteModule(entry.modulePath);
1012
- const rendering = await _chunkBZJYPIFZcjs.resolveRouteRenderingConfigFromFile.call(void 0, routeModule, entry.modulePath);
1025
+ const rendering = await _chunkOUDNUFVRcjs.resolveRouteRenderingConfigFromFile.call(void 0, routeModule, entry.modulePath);
1013
1026
  const runtimeConfig = await options.routeManager.resolveRouteRuntimeConfig(pattern);
1014
1027
  routes.push({
1015
1028
  kind: "page",
@@ -1622,7 +1635,7 @@ function farmStripPlatformConfigPlugin(configFiles) {
1622
1635
  // removed block used (`readFileSync` for a version, say).
1623
1636
  enforce: "pre",
1624
1637
  transform: {
1625
- filter: { id: _chunkHVMQAVZKcjs.fileNamePattern.call(void 0, configFiles) },
1638
+ filter: { id: _chunkCL7BUGVBcjs.fileNamePattern.call(void 0, configFiles) },
1626
1639
  async handler(code, id) {
1627
1640
  const file = id.split("?", 1)[0];
1628
1641
  if (!files.has(_path2.default.resolve(file)) && !files.has(realPath(file))) return null;
@@ -1701,12 +1714,15 @@ function createFarmPrivateClientSourcemapsPlugin(options) {
1701
1714
  return {
1702
1715
  name: "farm-private-client-sourcemaps",
1703
1716
  enforce: "post",
1704
- generateBundle(_output, bundle) {
1705
- maps = [];
1706
- for (const [fileName, output] of Object.entries(bundle)) {
1707
- if (output.type !== "asset" || !fileName.endsWith(".map")) continue;
1708
- maps.push([fileName, _nullishCoalesce(output.source, () => ( ""))]);
1709
- delete bundle[fileName];
1717
+ generateBundle: {
1718
+ order: "post",
1719
+ handler(_output, bundle) {
1720
+ maps = [];
1721
+ for (const [fileName, output] of Object.entries(bundle)) {
1722
+ if (output.type !== "asset" || !fileName.endsWith(".map")) continue;
1723
+ maps.push([fileName, _nullishCoalesce(output.source, () => ( ""))]);
1724
+ delete bundle[fileName];
1725
+ }
1710
1726
  }
1711
1727
  },
1712
1728
  async writeBundle() {
@@ -1720,6 +1736,42 @@ function createFarmPrivateClientSourcemapsPlugin(options) {
1720
1736
  };
1721
1737
  }
1722
1738
 
1739
+ // src/nitro/client-brotli-assets.ts
1740
+
1741
+
1742
+
1743
+
1744
+ var _zlib = require('zlib');
1745
+ var compress = _util.promisify.call(void 0, _zlib.brotliCompress);
1746
+ var SCRIPT_OR_STYLESHEET = /\.(?:m?js|css)$/;
1747
+ var MIN_COMPRESSED_BYTES = 1024;
1748
+ async function writeFarmClientBrotliAssets(clientOutputDir) {
1749
+ const entries = await _promises.readdir.call(void 0, clientOutputDir, { recursive: true, withFileTypes: true });
1750
+ const files = new Set(
1751
+ entries.filter((entry) => entry.isFile()).map((entry) => _path2.default.join(entry.parentPath, entry.name))
1752
+ );
1753
+ const pending = [...files].filter(
1754
+ (file) => SCRIPT_OR_STYLESHEET.test(file) && !files.has(`${file}.br`)
1755
+ );
1756
+ const next = async () => {
1757
+ const file = pending.pop();
1758
+ if (file === void 0) return;
1759
+ const source = await _promises.readFile.call(void 0, file);
1760
+ if (source.length >= MIN_COMPRESSED_BYTES) {
1761
+ const compressed = await compress(source, {
1762
+ params: {
1763
+ [_zlib.constants.BROTLI_PARAM_MODE]: _zlib.constants.BROTLI_MODE_TEXT,
1764
+ [_zlib.constants.BROTLI_PARAM_QUALITY]: _zlib.constants.BROTLI_MAX_QUALITY,
1765
+ [_zlib.constants.BROTLI_PARAM_SIZE_HINT]: source.length
1766
+ }
1767
+ });
1768
+ await _promises.writeFile.call(void 0, `${file}.br`, compressed);
1769
+ }
1770
+ return next();
1771
+ };
1772
+ await Promise.all(Array.from({ length: _os.availableParallelism.call(void 0, ) }, next));
1773
+ }
1774
+
1723
1775
  // src/middleware/static-config.ts
1724
1776
  function literalMatcher(node) {
1725
1777
  if (!node) return void 0;
@@ -1785,8 +1837,8 @@ function readStaticMiddlewareConfig(program) {
1785
1837
  }
1786
1838
  async function readMiddlewareFileConfig(filePath) {
1787
1839
  try {
1788
- const [{ readFile }, vite] = await Promise.all([import("fs/promises"), import("vite")]);
1789
- const parsed = vite.parseSync(filePath, await readFile(filePath, "utf8"));
1840
+ const [{ readFile: readFile2 }, vite] = await Promise.all([import("fs/promises"), import("vite")]);
1841
+ const parsed = vite.parseSync(filePath, await readFile2(filePath, "utf8"));
1790
1842
  if (_optionalChain([parsed, 'access', _45 => _45.errors, 'optionalAccess', _46 => _46.length])) return "unknown";
1791
1843
  return readStaticMiddlewareConfig(parsed.program);
1792
1844
  } catch (e13) {
@@ -1797,7 +1849,7 @@ async function readMiddlewareFileConfig(filePath) {
1797
1849
  // src/nitro/vercel-edge-middleware.ts
1798
1850
 
1799
1851
 
1800
- var _zlib = require('zlib');
1852
+
1801
1853
  var FARM_VERCEL_EDGE_MIDDLEWARE_FUNCTION = "_farm_middleware";
1802
1854
  var FARM_VERCEL_EDGE_NOT_FOUND_PATH = "/__farm/not-found";
1803
1855
  var EDGE_NODE_MODULES = /* @__PURE__ */ new Set(["async_hooks", "events", "buffer", "assert", "util"]);
@@ -1902,7 +1954,7 @@ async function writeFarmVercelEdgeMiddlewareFunction(options) {
1902
1954
  logLevel: "silent",
1903
1955
  plugins: [edgeNodeModulesPlugin(coreDir, unsupported)],
1904
1956
  resolve: {
1905
- alias: _chunkHVMQAVZKcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
1957
+ alias: _chunkCL7BUGVBcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
1906
1958
  conditionNames: ["edge-light", "worker", "browser", "import", "module", "default"]
1907
1959
  },
1908
1960
  transform: {
@@ -1921,7 +1973,7 @@ async function writeFarmVercelEdgeMiddlewareFunction(options) {
1921
1973
  await bundle.close();
1922
1974
  }
1923
1975
  } catch (error) {
1924
- throw _chunkASYOWPSRcjs.withPlainDiagnostics.call(void 0, error);
1976
+ throw _chunkPWDBWXQIcjs.withPlainDiagnostics.call(void 0, error);
1925
1977
  } finally {
1926
1978
  await fs5.rm(entryPath, { force: true });
1927
1979
  }
@@ -1942,11 +1994,11 @@ Remove them from the middleware (Edge provides ${[...EDGE_NODE_MODULES].join(",
1942
1994
  );
1943
1995
  const gzippedBytes = _zlib.gzipSync.call(void 0, code).length;
1944
1996
  if (gzippedBytes > EDGE_FUNCTION_SIZE_WARNING_BYTES) {
1945
- _chunkGC5ROI3Acjs.logger.warn(
1997
+ _chunk7U4XF76Rcjs.logger.warn(
1946
1998
  `Vercel edge middleware is ${(gzippedBytes / 1024 / 1024).toFixed(2)} MB gzipped, over the Hobby plan's 1 MB Edge function limit (Pro allows 2 MB, Enterprise 4 MB).`
1947
1999
  );
1948
2000
  }
1949
- _chunkGC5ROI3Acjs.logger.info(
2001
+ _chunk7U4XF76Rcjs.logger.info(
1950
2002
  `\u{1F6E1}\uFE0F Vercel edge middleware: ${routes.length} middleware file(s) guard their prerendered pages before the CDN serves them`
1951
2003
  );
1952
2004
  }
@@ -2124,7 +2176,7 @@ function createPrerenderMarkdownPagesPlugin(pages) {
2124
2176
  const compiled = await pages;
2125
2177
  if (compiled.size === 0) return "";
2126
2178
  return `globalThis[Symbol.for(${JSON.stringify(
2127
- _chunkPG7J7XYTcjs.FARM_MARKDOWN_PRECOMPILED_PAGES.description
2179
+ _chunk26WP75W5cjs.FARM_MARKDOWN_PRECOMPILED_PAGES.description
2128
2180
  )})] = new Map(${JSON.stringify([...compiled])});`;
2129
2181
  }
2130
2182
  };
@@ -2155,7 +2207,7 @@ function createPrerenderRuntimeResolverPlugin(root, resolveNitroEntry = resolveN
2155
2207
  };
2156
2208
  }
2157
2209
  function createFarmStorageModuleRegistration(config) {
2158
- const modules = _chunkEVVV2XZ2cjs._collectFarmStorageModules.call(void 0, config.storage);
2210
+ const modules = _chunkNW3DL2PMcjs._collectFarmStorageModules.call(void 0, config.storage);
2159
2211
  if (modules.length === 0) return "";
2160
2212
  const root = config.root || process.cwd();
2161
2213
  const projectRequire = _module.createRequire.call(void 0, _path2.default.join(root, "package.json"));
@@ -2262,7 +2314,7 @@ function hasReactDomEdgeServerBuild(root) {
2262
2314
  }
2263
2315
  }
2264
2316
  function shouldAliasReactServerToWebBuild(renderer, preset) {
2265
- return _chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) && _chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset) === "edge";
2317
+ return _chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, renderer) && _chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset) === "edge";
2266
2318
  }
2267
2319
  function isCloudflareImagePreset(preset) {
2268
2320
  return preset === "cloudflare" || preset === "cloudflare-pages" || preset === "cloudflare-module";
@@ -2304,7 +2356,7 @@ function createOmittedMetadataImageRuntimePlugin(externalizeOtherImports) {
2304
2356
  return {
2305
2357
  name: "farm-omitted-metadata-image-runtime",
2306
2358
  resolveId: {
2307
- filter: { id: _chunkHVMQAVZKcjs.exactIdPattern.call(void 0, ["@vercel/og"]) },
2359
+ filter: { id: _chunkCL7BUGVBcjs.exactIdPattern.call(void 0, ["@vercel/og"]) },
2308
2360
  handler(source, importer) {
2309
2361
  if (source !== "@vercel/og") return null;
2310
2362
  const fromCoreRuntime = importer !== void 0 && isFarmCoreModule(importer) && !/^og\.[cm]?[jt]sx?$/.test(_path2.default.basename(importer.split("?", 1)[0]));
@@ -2313,7 +2365,7 @@ function createOmittedMetadataImageRuntimePlugin(externalizeOtherImports) {
2313
2365
  }
2314
2366
  },
2315
2367
  load: {
2316
- filter: { id: _chunkHVMQAVZKcjs.exactIdPattern.call(void 0, [FARM_OMITTED_METADATA_IMAGE_RUNTIME_ID]) },
2368
+ filter: { id: _chunkCL7BUGVBcjs.exactIdPattern.call(void 0, [FARM_OMITTED_METADATA_IMAGE_RUNTIME_ID]) },
2317
2369
  handler(id) {
2318
2370
  if (id !== FARM_OMITTED_METADATA_IMAGE_RUNTIME_ID) return null;
2319
2371
  return `
@@ -2362,7 +2414,7 @@ function createEdgeMetadataImageRuntimePlugin({
2362
2414
  return null;
2363
2415
  }
2364
2416
  const resolvedPath = _path2.default.resolve(_path2.default.dirname(importer.split("?", 1)[0]), source);
2365
- return { id: _chunkGC5ROI3Acjs.toPosixPath.call(void 0, resolvedPath), external: "absolute" };
2417
+ return { id: _chunk7U4XF76Rcjs.toPosixPath.call(void 0, resolvedPath), external: "absolute" };
2366
2418
  }
2367
2419
  };
2368
2420
  }
@@ -2642,9 +2694,9 @@ function hasFarmPluginRoutes(config) {
2642
2694
  }
2643
2695
  function farmServerRuntimePluginsMayHandlePath(config, pathname) {
2644
2696
  return (config.plugins || []).some(
2645
- (plugin) => _chunkAOTD2N5Pcjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) !== false && // Mobile session tokens change only bearer requests and cookie-clearing responses, which a
2697
+ (plugin) => _chunkWGWWRV2Mcjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) !== false && // Mobile session tokens change only bearer requests and cookie-clearing responses, which a
2646
2698
  // prerendered file never answers or sends; its endpoints live under /__farm/.
2647
- plugin.name !== _chunkIWGGRXD2cjs.FARM_MOBILE_SESSION_PLUGIN && _chunk47JV57DAcjs.farmPluginMayAffectRuntimePath.call(void 0, plugin, pathname)
2699
+ plugin.name !== _chunkMHKPXX3Jcjs.FARM_MOBILE_SESSION_PLUGIN && _chunk47JV57DAcjs.farmPluginMayAffectRuntimePath.call(void 0, plugin, pathname)
2648
2700
  );
2649
2701
  }
2650
2702
  async function discoverMiddlewareRoutes(appDir) {
@@ -2674,8 +2726,8 @@ async function discoverMiddlewareRoutes(appDir) {
2674
2726
  }
2675
2727
  await walk(
2676
2728
  _path2.default.join(dir, entry.name),
2677
- _chunkFE6KYDHCcjs.appendMiddlewareRoutePath.call(void 0, routePath, entry.name),
2678
- _chunkFE6KYDHCcjs.appendMiddlewareDirectory.call(void 0, directory, entry.name),
2729
+ _chunkSHDCKRP4cjs.appendMiddlewareRoutePath.call(void 0, routePath, entry.name),
2730
+ _chunkSHDCKRP4cjs.appendMiddlewareDirectory.call(void 0, directory, entry.name),
2679
2731
  discovered
2680
2732
  );
2681
2733
  }
@@ -2687,7 +2739,7 @@ async function discoverMiddlewareRoutes(appDir) {
2687
2739
  routes.set(route.directory, route);
2688
2740
  }
2689
2741
  }
2690
- return Array.from(routes.values()).sort(_chunkFE6KYDHCcjs.compareMiddlewareRouteLocations).map(({ path: routePath, filePath }) => ({ path: routePath, filePath }));
2742
+ return Array.from(routes.values()).sort(_chunkSHDCKRP4cjs.compareMiddlewareRouteLocations).map(({ path: routePath, filePath }) => ({ path: routePath, filePath }));
2691
2743
  }
2692
2744
  function assertFarmDocsRuntimeSupported(config, preset) {
2693
2745
  if (!_optionalChain([config, 'access', _77 => _77.docs, 'optionalAccess', _78 => _78.enabled]) || !_optionalChain([config, 'access', _79 => _79.docs, 'access', _80 => _80.adapter, 'optionalAccess', _81 => _81.server]) || _chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset) !== "edge" || Boolean(config.docs.adapter.edgeCompiler)) {
@@ -2708,7 +2760,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
2708
2760
  Promise.resolve(_nullishCoalesce(options.productionVite, () => ( _chunkMF3IA2AWcjs.loadFarmProductionVite.call(void 0, ))))
2709
2761
  ]);
2710
2762
  const nitroBuilderResultPromise = preloadFarmNitroBuilder();
2711
- _chunkGC5ROI3Acjs.logger.info(`\u{1F69C} Building Farm.js application (universal) with preset: ${preset}...`);
2763
+ _chunk7U4XF76Rcjs.logger.info(`\u{1F69C} Building Farm.js application (universal) with preset: ${preset}...`);
2712
2764
  const rendererBuild = options.rendererBuildLifetime ? void 0 : new AbortController();
2713
2765
  const rendererBuildLifetime = _nullishCoalesce(options.rendererBuildLifetime, () => ( rendererBuild.signal));
2714
2766
  let markdownPrecompile;
@@ -2725,7 +2777,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
2725
2777
  routeManager.getSearchPreserveRoutes().map((route) => [route.pattern, route])
2726
2778
  );
2727
2779
  for (const [pattern, entry] of routeManager.getRoutes()) {
2728
- const markdownSourcePath = entry.markdownSourcePath || (_chunkPG7J7XYTcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? entry.modulePath : void 0);
2780
+ const markdownSourcePath = entry.markdownSourcePath || (_chunk26WP75W5cjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? entry.modulePath : void 0);
2729
2781
  const searchPreserve = searchPreserveRoutes.get(entry.pattern);
2730
2782
  pageRoutes.push({
2731
2783
  pattern,
@@ -2755,13 +2807,13 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
2755
2807
  fallback: entry.fallback
2756
2808
  })
2757
2809
  );
2758
- _chunkGC5ROI3Acjs.logger.info(`\u{1F4CB} Found ${pageRoutes.length} page routes`);
2810
+ _chunk7U4XF76Rcjs.logger.info(`\u{1F4CB} Found ${pageRoutes.length} page routes`);
2759
2811
  const fs5 = await import("fs/promises");
2760
2812
  const layoutRoutes = Array.from(routeManager.getLayouts(), ([pattern, { modulePath }]) => ({
2761
2813
  pattern,
2762
2814
  modulePath
2763
2815
  }));
2764
- _chunkGC5ROI3Acjs.logger.info(`\u{1F4CB} Found ${pageRoutes.length} page routes and ${layoutRoutes.length} layouts`);
2816
+ _chunk7U4XF76Rcjs.logger.info(`\u{1F4CB} Found ${pageRoutes.length} page routes and ${layoutRoutes.length} layouts`);
2765
2817
  const isolatedClientBoundaryModules = routeManager.getIsolatedClientBoundaryModules(root);
2766
2818
  const islandsErrors = routeManager.getIslandsErrors(root);
2767
2819
  if (islandsErrors.length > 0) {
@@ -2780,9 +2832,9 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
2780
2832
  throw productionViteResult.reason;
2781
2833
  }
2782
2834
  const productionVite = productionViteResult.value;
2783
- _chunkGC5ROI3Acjs.logger.info("\u26A1 Building application bundles with Vite Rolldown");
2835
+ _chunk7U4XF76Rcjs.logger.info("\u26A1 Building application bundles with Vite Rolldown");
2784
2836
  const mobileClient = shouldBuildFarmMobileClient(config);
2785
- const rendererDisabled = _chunk67MZTLTFcjs.isFarmRendererDisabled.call(void 0, config.renderer);
2837
+ const rendererDisabled = _chunkM6DAIE4Tcjs.isFarmRendererDisabled.call(void 0, config.renderer);
2786
2838
  const buildClientBundle = async () => {
2787
2839
  if (rendererDisabled) {
2788
2840
  await fs5.rm(clientOutputDir, { recursive: true, force: true });
@@ -2825,11 +2877,11 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
2825
2877
  let clientBuildResult;
2826
2878
  let ssrBuildResult;
2827
2879
  if (!rendererDisabled && config.renderer.buildConcurrency === "serial") {
2828
- _chunkGC5ROI3Acjs.logger.info(`\u{1F4E6} Building client and SSR bundles serially for ${config.renderer.name}...`);
2880
+ _chunk7U4XF76Rcjs.logger.info(`\u{1F4E6} Building client and SSR bundles serially for ${config.renderer.name}...`);
2829
2881
  [clientBuildResult] = await Promise.allSettled([buildClientBundle()]);
2830
2882
  [ssrBuildResult] = await Promise.allSettled([buildSSRBundle()]);
2831
2883
  } else {
2832
- _chunkGC5ROI3Acjs.logger.info(
2884
+ _chunk7U4XF76Rcjs.logger.info(
2833
2885
  rendererDisabled ? "\u{1F4E6} Building the server bundle (renderer: false, no client bundle)..." : "\u{1F4E6} Building client and SSR bundles in parallel..."
2834
2886
  );
2835
2887
  [clientBuildResult, ssrBuildResult] = await Promise.allSettled([
@@ -2846,7 +2898,7 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
2846
2898
  if (productionVite.builder !== "rolldown" || !(clientBuildResult.reason instanceof IncompleteClientBuildOutputError)) {
2847
2899
  throw clientBuildResult.reason;
2848
2900
  }
2849
- _chunkGC5ROI3Acjs.logger.warn("Client bundle was incomplete; retrying after the SSR build...");
2901
+ _chunk7U4XF76Rcjs.logger.warn("Client bundle was incomplete; retrying after the SSR build...");
2850
2902
  try {
2851
2903
  await buildClient(
2852
2904
  productionVite,
@@ -2876,7 +2928,7 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
2876
2928
  const routeRuntimeManifest = routeRuntimeManifestResult.value;
2877
2929
  const runtimeValidation = validateFarmRouteRuntimeDeployment(routeRuntimeManifest, preset);
2878
2930
  for (const warning of runtimeValidation.warnings) {
2879
- _chunkGC5ROI3Acjs.logger.warn(warning);
2931
+ _chunk7U4XF76Rcjs.logger.warn(warning);
2880
2932
  }
2881
2933
  const { bundle: ssrBundle, entryFile: ssrEntryFile, configuredHeaderRoutes } = ssrResult;
2882
2934
  assertServerReadSSRAssetsSupported(ssrBundle, preset, root);
@@ -2887,7 +2939,7 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
2887
2939
  if (config.docs.enabled) {
2888
2940
  await copyFarmDocsFontAssetsToClient(root, clientOutputDir);
2889
2941
  }
2890
- _chunkGC5ROI3Acjs.logger.info(`\u{1F680} Building server with Nitro (preset: ${preset})...`);
2942
+ _chunk7U4XF76Rcjs.logger.info(`\u{1F680} Building server with Nitro (preset: ${preset})...`);
2891
2943
  await buildNitroUniversal(
2892
2944
  config,
2893
2945
  routeManager,
@@ -2909,7 +2961,7 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
2909
2961
  _path2.default.join(root, distDir),
2910
2962
  routeRuntimeManifest
2911
2963
  );
2912
- _chunkGC5ROI3Acjs.logger.info(`\u{1F4CB} Route runtime manifest: ${_path2.default.relative(root, runtimeManifestPath)}`);
2964
+ _chunk7U4XF76Rcjs.logger.info(`\u{1F4CB} Route runtime manifest: ${_path2.default.relative(root, runtimeManifestPath)}`);
2913
2965
  } catch (error) {
2914
2966
  if (lifecyclePluginManager) {
2915
2967
  await lifecyclePluginManager.runHookParallel("onError", {
@@ -2921,7 +2973,7 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
2921
2973
  }
2922
2974
  });
2923
2975
  }
2924
- _chunkGC5ROI3Acjs.logger.error(`\u274C Build failed: ${error}`);
2976
+ _chunk7U4XF76Rcjs.logger.error(`\u274C Build failed: ${error}`);
2925
2977
  throw error;
2926
2978
  } finally {
2927
2979
  _optionalChain([rendererBuild, 'optionalAccess', _85 => _85.abort, 'call', _86 => _86()]);
@@ -2931,10 +2983,10 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
2931
2983
  function collectFarmPrerenderedMarkdownBodies(pageRoutes) {
2932
2984
  const bodies = [];
2933
2985
  for (const route of pageRoutes) {
2934
- if (route.source === void 0 || !_chunkPG7J7XYTcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath)) continue;
2935
- const { body } = _chunkPG7J7XYTcjs.parseMarkdownFrontmatter.call(void 0, route.source);
2936
- const rendering = _chunkBZJYPIFZcjs.resolveRouteRenderingConfig.call(void 0,
2937
- _chunkPG7J7XYTcjs.readFarmMarkdownRouteConfig.call(void 0, body),
2986
+ if (route.source === void 0 || !_chunk26WP75W5cjs.isFarmMarkdownPageFile.call(void 0, route.modulePath)) continue;
2987
+ const { body } = _chunk26WP75W5cjs.parseMarkdownFrontmatter.call(void 0, route.source);
2988
+ const rendering = _chunkOUDNUFVRcjs.resolveRouteRenderingConfig.call(void 0,
2989
+ _chunk26WP75W5cjs.readFarmMarkdownRouteConfig.call(void 0, body),
2938
2990
  route.source
2939
2991
  );
2940
2992
  if (rendering.ssg && rendering.revalidate === void 0) bodies.push(body);
@@ -2977,7 +3029,7 @@ async function writeFarmVideoPlayerToClient(outputDir) {
2977
3029
  const filePath = _path2.default.join(outputDir, _chunkY3DO7BIJcjs.FARM_VIDEO_PLAYER_PATH.slice(1));
2978
3030
  await fs5.mkdir(_path2.default.dirname(filePath), { recursive: true });
2979
3031
  try {
2980
- await fs5.writeFile(filePath, _chunkHVMQAVZKcjs.FARM_VIDEO_PLAYER_HTML, { flag: "wx" });
3032
+ await fs5.writeFile(filePath, _chunkCL7BUGVBcjs.FARM_VIDEO_PLAYER_HTML, { flag: "wx" });
2981
3033
  } catch (error) {
2982
3034
  if (error.code !== "EEXIST") throw error;
2983
3035
  }
@@ -3011,7 +3063,7 @@ async function mergeBuiltFontCss(outputDir, fontCssSource) {
3011
3063
  }
3012
3064
  const normalizedFontCss = typeof fontCss === "string" ? fontCss : Buffer.from(fontCss).toString("utf8");
3013
3065
  await fs5.writeFile(fontCssPath, normalizedFontCss);
3014
- await fs5.writeFile(clientCssPath, _chunkHVMQAVZKcjs.mergeFarmFontCss.call(void 0, clientCss, normalizedFontCss));
3066
+ await fs5.writeFile(clientCssPath, _chunkCL7BUGVBcjs.mergeFarmFontCss.call(void 0, clientCss, normalizedFontCss));
3015
3067
  }
3016
3068
  function importsFarmClientBlockedPackage(id, packageName) {
3017
3069
  return id === packageName || id.startsWith(`${packageName}/`);
@@ -3061,10 +3113,10 @@ async function validateClientBuildOutput(root, srcDir, outputDir) {
3061
3113
  }
3062
3114
  }
3063
3115
  function getCachedClientModuleHydrationPlan(modulePath, root, mode, cache, options = {}) {
3064
- const key = _chunkODYKCC6Wcjs.getClientModuleHydrationPlanKey.call(void 0, modulePath, root, mode, options);
3116
+ const key = _chunk46UV2E7Icjs.getClientModuleHydrationPlanKey.call(void 0, modulePath, root, mode, options);
3065
3117
  let plan = cache.get(key);
3066
3118
  if (!plan) {
3067
- plan = _chunkODYKCC6Wcjs.getClientModuleHydrationPlan.call(void 0, modulePath, root, mode, options);
3119
+ plan = _chunk46UV2E7Icjs.getClientModuleHydrationPlan.call(void 0, modulePath, root, mode, options);
3068
3120
  cache.set(key, plan);
3069
3121
  }
3070
3122
  return { ...plan, isolatedBoundaries: [...plan.isolatedBoundaries] };
@@ -3072,8 +3124,13 @@ function getCachedClientModuleHydrationPlan(modulePath, root, mode, cache, optio
3072
3124
  async function buildClient(productionVite, config, root, srcDir, outputDir, pageRoutes, layoutRoutes = [], routeSlots = [], isolatedClientBoundaryModules = /* @__PURE__ */ new Set(), hydrationPlanCache = /* @__PURE__ */ new Map(), rendererBuildLifetime, programmaticClientRoutes, mobile = false, sourceSnapshot) {
3073
3125
  if (!mobile) await _chunkE5UN4OWXcjs.removeFarmMobileClientManifest.call(void 0, _path2.default.dirname(outputDir));
3074
3126
  const viteBuild = productionVite.build;
3075
- const { farmIslandContainersPlugin, farmPlugin, farmServerOnlyEntriesPlugin } = await import("./vite.cjs");
3076
- const { PluginManager: PluginManager2 } = await import("./plugin-AGEFSU7K.cjs");
3127
+ const {
3128
+ farmIslandContainersPlugin,
3129
+ farmNavigationPlugin,
3130
+ farmPlugin,
3131
+ farmServerOnlyEntriesPlugin
3132
+ } = await import("./vite.cjs");
3133
+ const { PluginManager: PluginManager2 } = await import("./plugin-LN3JBZRR.cjs");
3077
3134
  const fs5 = await import("fs/promises");
3078
3135
  const pluginManager = new PluginManager2({
3079
3136
  config,
@@ -3082,25 +3139,25 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3082
3139
  });
3083
3140
  pluginManager.addPlugins(config.plugins || []);
3084
3141
  const clientPages = [];
3085
- const integrationProviders = _chunkAOTD2N5Pcjs.getIntegrationProviders.call(void 0, config.integrations).filter(
3142
+ const integrationProviders = _chunkWGWWRV2Mcjs.getIntegrationProviders.call(void 0, config.integrations).filter(
3086
3143
  (provider) => provider.component || provider.type === "clerk"
3087
3144
  );
3088
3145
  const unsupportedIntegrationProvider = integrationProviders.find(
3089
3146
  (provider) => provider.supportsIsolatedHydration !== true
3090
3147
  );
3091
3148
  if (_optionalChain([config, 'access', _91 => _91.experimental, 'optionalAccess', _92 => _92.isolatedClientHydration]) === "enabled" && _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _93 => _93.experimental, 'optionalAccess', _94 => _94.serverComponents])) !== "rsc" && unsupportedIntegrationProvider) {
3092
- _chunkGC5ROI3Acjs.logger.warn(
3149
+ _chunk7U4XF76Rcjs.logger.warn(
3093
3150
  `[Farm.js] isolated hydration kept route-wide because integration provider "${unsupportedIntegrationProvider.name}" does not declare supportsIsolatedHydration: true.`
3094
3151
  );
3095
3152
  }
3096
- const isolatedMode = _chunkODYKCC6Wcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
3153
+ const isolatedMode = _chunk46UV2E7Icjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
3097
3154
  _optionalChain([config, 'access', _95 => _95.experimental, 'optionalAccess', _96 => _96.isolatedClientHydration]),
3098
3155
  {
3099
3156
  serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _97 => _97.experimental, 'optionalAccess', _98 => _98.serverComponents])) === "rsc",
3100
3157
  hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
3101
3158
  }
3102
3159
  );
3103
- const planOptions = _chunkODYKCC6Wcjs.getFarmClientHydrationPlanOptions.call(void 0,
3160
+ const planOptions = _chunk46UV2E7Icjs.getFarmClientHydrationPlanOptions.call(void 0,
3104
3161
  config.renderer,
3105
3162
  Boolean(unsupportedIntegrationProvider)
3106
3163
  );
@@ -3112,13 +3169,13 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3112
3169
  ...planOptions,
3113
3170
  serverTreeLayouts: pagePlanOptions.serverOwners
3114
3171
  };
3115
- const layoutAppliesToRoute = _chunk6ZFGWB75cjs.routeBoundaryCoversDirectory;
3172
+ const layoutAppliesToRoute = _chunkOFVCWV2Dcjs.routeBoundaryCoversDirectory;
3116
3173
  const routeDirectory = (route) => _nullishCoalesce(route.directory, () => ( route.pattern));
3117
3174
  const islandsMode = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _101 => _101.experimental, 'optionalAccess', _102 => _102.serverComponents])) === "islands";
3118
3175
  const adapterOwnsDocsRuntime = Boolean(
3119
- _chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _103 => _103.docs, 'optionalAccess', _104 => _104.enabled]) && _optionalChain([config, 'access', _105 => _105.docs, 'access', _106 => _106.adapter, 'optionalAccess', _107 => _107.server]) && config.docs.adapter.react
3176
+ _chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _103 => _103.docs, 'optionalAccess', _104 => _104.enabled]) && _optionalChain([config, 'access', _105 => _105.docs, 'access', _106 => _106.adapter, 'optionalAccess', _107 => _107.server]) && config.docs.adapter.react
3120
3177
  );
3121
- const docsEntries = _optionalChain([config, 'access', _108 => _108.docs, 'optionalAccess', _109 => _109.enabled]) ? _chunk6D3CJFNUcjs.getFarmDocsRoots.call(void 0, config.docs).map(
3178
+ const docsEntries = _optionalChain([config, 'access', _108 => _108.docs, 'optionalAccess', _109 => _109.enabled]) ? _chunkHR5GU4UUcjs.getFarmDocsRoots.call(void 0, config.docs).map(
3122
3179
  (docsRoot) => `/${docsRoot.entry || "docs"}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/"
3123
3180
  ) : [];
3124
3181
  const adapterDocsEntry = _nullishCoalesce(docsEntries[0], () => ( null));
@@ -3127,7 +3184,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3127
3184
  );
3128
3185
  const syntheticDocsEntry = _optionalChain([config, 'access', _110 => _110.docs, 'optionalAccess', _111 => _111.enabled]) && !adapterOwnsDocsRuntime ? adapterDocsEntry : null;
3129
3186
  const syntheticDocsPatterns = syntheticDocsEntry ? syntheticDocsEntry === "/" ? ["/", "/[...slug]"] : [syntheticDocsEntry, `${syntheticDocsEntry}/[...slug]`] : [];
3130
- const plan = (operation) => sourceSnapshot ? _chunkODYKCC6Wcjs.withFarmSourceSnapshotOf.call(void 0, sourceSnapshot, operation) : _chunkODYKCC6Wcjs.withFarmSourceSnapshot.call(void 0, operation);
3187
+ const plan = (operation) => sourceSnapshot ? _chunk46UV2E7Icjs.withFarmSourceSnapshotOf.call(void 0, sourceSnapshot, operation) : _chunk46UV2E7Icjs.withFarmSourceSnapshot.call(void 0, operation);
3131
3188
  const { clientLayouts, clientRouteSlots } = plan(() => {
3132
3189
  const clientLayouts2 = layoutRoutes.map((layout) => {
3133
3190
  try {
@@ -3155,7 +3212,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3155
3212
  serverTreeLayout: metadata.serverTreeLayout
3156
3213
  };
3157
3214
  } catch (error) {
3158
- _chunkGC5ROI3Acjs.logger.warn(`\u26A0\uFE0F Could not inspect layout file ${layout.modulePath}: ${error}`);
3215
+ _chunk7U4XF76Rcjs.logger.warn(`\u26A0\uFE0F Could not inspect layout file ${layout.modulePath}: ${error}`);
3159
3216
  return {
3160
3217
  ...layout,
3161
3218
  shouldHydrate: false,
@@ -3174,7 +3231,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3174
3231
  };
3175
3232
  }
3176
3233
  });
3177
- const markdownPagePlan = _chunkODYKCC6Wcjs.createMarkdownPageHydrationPlanner.call(void 0,
3234
+ const markdownPagePlan = _chunk46UV2E7Icjs.createMarkdownPageHydrationPlanner.call(void 0,
3178
3235
  _chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, config.mdx), root),
3179
3236
  root,
3180
3237
  isolatedMode,
@@ -3182,7 +3239,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3182
3239
  );
3183
3240
  const routePlans = pageRoutes.map((route) => ({
3184
3241
  route,
3185
- metadata: _chunkPG7J7XYTcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
3242
+ metadata: _chunk26WP75W5cjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
3186
3243
  route.modulePath,
3187
3244
  root,
3188
3245
  isolatedMode,
@@ -3190,7 +3247,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3190
3247
  pagePlanOptions
3191
3248
  )
3192
3249
  }));
3193
- _chunkODYKCC6Wcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
3250
+ _chunk46UV2E7Icjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
3194
3251
  clientLayouts2.map((layout) => ({
3195
3252
  pattern: layout.pattern,
3196
3253
  depth: layout.pattern.split("/").filter(Boolean).length,
@@ -3199,7 +3256,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3199
3256
  [
3200
3257
  ...routePlans.map(({ route, metadata }) => ({
3201
3258
  pattern: routeDirectory(route),
3202
- depth: _chunk6ZFGWB75cjs.getRouteDirectoryDepth.call(void 0, routeDirectory(route)),
3259
+ depth: _chunkOFVCWV2Dcjs.getRouteDirectoryDepth.call(void 0, routeDirectory(route)),
3203
3260
  metadata
3204
3261
  })),
3205
3262
  ...syntheticDocsPatterns.map((pattern) => ({
@@ -3223,8 +3280,8 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3223
3280
  for (const layout of clientLayouts2) {
3224
3281
  const matchesBuiltRoute = pageRoutes.some((route) => layoutAppliesToRoute(layout.pattern, routeDirectory(route))) || docsEntries.some((docsEntry) => layoutAppliesToRoute(layout.pattern, docsEntry));
3225
3282
  if (matchesBuiltRoute && layout.suppressedAsyncHydration) {
3226
- _chunkGC5ROI3Acjs.logger.warn(
3227
- `\u26A0\uFE0F ${_chunkODYKCC6Wcjs.describeSuppressedAsyncHydration.call(void 0, layout.pattern, layout.fallbackReason)}`
3283
+ _chunk7U4XF76Rcjs.logger.warn(
3284
+ `\u26A0\uFE0F ${_chunk46UV2E7Icjs.describeSuppressedAsyncHydration.call(void 0, layout.pattern, layout.fallbackReason)}`
3228
3285
  );
3229
3286
  }
3230
3287
  }
@@ -3236,7 +3293,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3236
3293
  if (!("isolatedHydrationEligible" in metadata) || !metadata.isolatedHydrationEligible) {
3237
3294
  continue;
3238
3295
  }
3239
- _chunkGC5ROI3Acjs.logger.info(
3296
+ _chunk7U4XF76Rcjs.logger.info(
3240
3297
  `\u{1F4CA} Isolated hydration analysis: ${entry.modulePath} can exclude its server owner and hydrate ${metadata.isolatedBoundaries.length} client ${metadata.isolatedBoundaries.length === 1 ? "boundary" : "boundaries"}.`
3241
3298
  );
3242
3299
  }
@@ -3258,8 +3315,8 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3258
3315
  (layout) => (layout.shouldHydrate || layout.hasIsolatedClientBoundaries) && layoutAppliesToRoute(layout.pattern, routeDirectory(route))
3259
3316
  );
3260
3317
  if (metadata.suppressedAsyncHydration) {
3261
- _chunkGC5ROI3Acjs.logger.warn(
3262
- `\u26A0\uFE0F ${_chunkODYKCC6Wcjs.describeSuppressedAsyncHydration.call(void 0, route.pattern, metadata.fallbackReason)}`
3318
+ _chunk7U4XF76Rcjs.logger.warn(
3319
+ `\u26A0\uFE0F ${_chunk46UV2E7Icjs.describeSuppressedAsyncHydration.call(void 0, route.pattern, metadata.fallbackReason)}`
3263
3320
  );
3264
3321
  }
3265
3322
  const slotBoundaries = serverSlotPlans.filter(
@@ -3267,7 +3324,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3267
3324
  ).flatMap(({ plan: plan2 }) => plan2.isolatedBoundaries);
3268
3325
  if (metadata.shouldHydrate || metadata.hasIsolatedClientBoundaries || applicableClientLayouts.length > 0 || slotBoundaries.length > 0) {
3269
3326
  const relativePath = route.modulePath.replace(root, "").replace(/^\//, "");
3270
- const islandStrategy = _chunkHVMQAVZKcjs.resolveFarmRouteRootStrategy.call(void 0,
3327
+ const islandStrategy = _chunkCL7BUGVBcjs.resolveFarmRouteRootStrategy.call(void 0,
3271
3328
  route,
3272
3329
  metadata,
3273
3330
  clientLayouts2,
@@ -3286,12 +3343,12 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3286
3343
  ...applicableClientLayouts.filter((layout) => layout.hasIsolatedClientBoundaries || layout.serverTreeLayout).flatMap((layout) => layout.isolatedBoundaries)
3287
3344
  ],
3288
3345
  // The server renders a server tree only below a hydrating layout.
3289
- ..._chunkODYKCC6Wcjs.usesFarmServerTree.call(void 0, metadata) && applicableClientLayouts.some((layout) => layout.shouldHydrate) ? { serverTree: true } : {}
3346
+ ..._chunk46UV2E7Icjs.usesFarmServerTree.call(void 0, metadata) && applicableClientLayouts.some((layout) => layout.shouldHydrate) ? { serverTree: true } : {}
3290
3347
  });
3291
- _chunkGC5ROI3Acjs.logger.info(`\u{1F4F1} Found hydratable route: ${route.pattern} -> ${route.modulePath}`);
3348
+ _chunk7U4XF76Rcjs.logger.info(`\u{1F4F1} Found hydratable route: ${route.pattern} -> ${route.modulePath}`);
3292
3349
  }
3293
3350
  } catch (error) {
3294
- _chunkGC5ROI3Acjs.logger.warn(`\u26A0\uFE0F Could not inspect route file ${route.modulePath}: ${error}`);
3351
+ _chunk7U4XF76Rcjs.logger.warn(`\u26A0\uFE0F Could not inspect route file ${route.modulePath}: ${error}`);
3295
3352
  }
3296
3353
  }
3297
3354
  if (syntheticDocsEntry) {
@@ -3323,10 +3380,10 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3323
3380
  }
3324
3381
  const clientRouteSlots2 = routeSlots.filter((slot) => {
3325
3382
  try {
3326
- const metadata = _chunkODYKCC6Wcjs.getClientModuleMetadata.call(void 0, slot.modulePath, root);
3383
+ const metadata = _chunk46UV2E7Icjs.getClientModuleMetadata.call(void 0, slot.modulePath, root);
3327
3384
  return metadata.shouldHydrate && (!islandsMode || metadata.isClientComponent);
3328
3385
  } catch (error) {
3329
- _chunkGC5ROI3Acjs.logger.warn(`\u26A0\uFE0F Could not inspect route slot ${slot.modulePath}: ${error}`);
3386
+ _chunk7U4XF76Rcjs.logger.warn(`\u26A0\uFE0F Could not inspect route slot ${slot.modulePath}: ${error}`);
3330
3387
  return false;
3331
3388
  }
3332
3389
  });
@@ -3335,20 +3392,20 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3335
3392
  const docsEntryOwns = (pattern) => syntheticDocsEntry === "/" || pattern === syntheticDocsEntry || pattern.startsWith(`${syntheticDocsEntry}/`);
3336
3393
  if (syntheticDocsEntry && clientPages.some((page) => !page.docs && docsEntryOwns(page.pattern))) {
3337
3394
  const docsPagePaths = new Set(
3338
- _chunk6D3CJFNUcjs.discoverFarmDocsPages.call(void 0,
3339
- _chunk6D3CJFNUcjs.resolveFarmDocsContentDir.call(void 0, config.docs, { root: config.root, srcDir: config.srcDir }),
3395
+ _chunkHR5GU4UUcjs.discoverFarmDocsPages.call(void 0,
3396
+ _chunkHR5GU4UUcjs.resolveFarmDocsContentDir.call(void 0, config.docs, { root: config.root, srcDir: config.srcDir }),
3340
3397
  config.docs
3341
3398
  ).map((page) => page.href)
3342
3399
  );
3343
3400
  const resolved = resolveFarmDocsClientRoutes(clientPages, docsPagePaths);
3344
3401
  for (const page of resolved.shadowed) {
3345
- _chunkGC5ROI3Acjs.logger.warn(
3402
+ _chunk7U4XF76Rcjs.logger.warn(
3346
3403
  `\u26A0\uFE0F ${page.pattern} has the URL shape of the docs route ${syntheticDocsPatterns[1]}, whose pages answer first: the page renders only at paths without a docs page, and does not hydrate as a page there.`
3347
3404
  );
3348
3405
  }
3349
3406
  clientPages.splice(0, clientPages.length, ...resolved.pages);
3350
3407
  }
3351
- _chunkGC5ROI3Acjs.logger.info(
3408
+ _chunk7U4XF76Rcjs.logger.info(
3352
3409
  `\u{1F4F1} Total hydratable routes detected: ${clientPages.length} pages, ${clientLayouts.filter((layout) => layout.shouldHydrate || layout.hasIsolatedClientBoundaries).length} layouts, and ${clientRouteSlots.length} slots`
3353
3410
  );
3354
3411
  const clientRouteTable = createFarmClientRouteTable(clientPages);
@@ -3365,22 +3422,22 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3365
3422
  clientRouteSlots,
3366
3423
  root,
3367
3424
  srcDir,
3368
- adapterOwnsDocsRuntime ? false : _chunkDZZHTMWMcjs.isFarmDocsSearchEnabled.call(void 0, config.docs),
3369
- adapterOwnsDocsRuntime ? void 0 : _chunkDZZHTMWMcjs.resolveFarmDocsSearchClientModule.call(void 0, root),
3370
- _optionalChain([config, 'access', _112 => _112.docs, 'optionalAccess', _113 => _113.enabled]) ? _chunk6D3CJFNUcjs.getFarmDocsRoots.call(void 0, config.docs).map((docsRoot) => docsRoot.entry) : void 0,
3425
+ adapterOwnsDocsRuntime ? false : _chunkN3H7UPBMcjs.isFarmDocsSearchEnabled.call(void 0, config.docs),
3426
+ adapterOwnsDocsRuntime ? void 0 : _chunkN3H7UPBMcjs.resolveFarmDocsSearchClientModule.call(void 0, root),
3427
+ _optionalChain([config, 'access', _112 => _112.docs, 'optionalAccess', _113 => _113.enabled]) ? _chunkHR5GU4UUcjs.getFarmDocsRoots.call(void 0, config.docs).map((docsRoot) => docsRoot.entry) : void 0,
3371
3428
  adapterOwnsDocsRuntime ? _optionalChain([config, 'access', _114 => _114.docs, 'access', _115 => _115.adapter, 'optionalAccess', _116 => _116.react]) : void 0,
3372
3429
  config.i18n,
3373
3430
  config.plugins,
3374
3431
  config.renderer,
3375
3432
  config.publicRuntimeConfig,
3376
3433
  config.trailingSlash,
3377
- _chunkAOTD2N5Pcjs.getIntegrationProviders.call(void 0, config.integrations),
3434
+ _chunkWGWWRV2Mcjs.getIntegrationProviders.call(void 0, config.integrations),
3378
3435
  config.basePath,
3379
- _chunkHVMQAVZKcjs.generateClientCachePersistenceCode.call(void 0, _chunkHVMQAVZKcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, config.cache)),
3436
+ _chunkCL7BUGVBcjs.generateClientCachePersistenceCode.call(void 0, _chunkCL7BUGVBcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, config.cache)),
3380
3437
  adapterOwnsDocsRuntime ? _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0,
3381
3438
  _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _117 => _117.experimental, 'optionalAccess', _118 => _118.serverComponents])) === "islands",
3382
3439
  platform,
3383
- islandsMode ? _chunkODYKCC6Wcjs.collectFarmServerStylesheets.call(void 0,
3440
+ islandsMode ? _chunk46UV2E7Icjs.collectFarmServerStylesheets.call(void 0,
3384
3441
  [
3385
3442
  ...layoutRoutes.map((layout) => layout.modulePath),
3386
3443
  ...pageRoutes.filter((route) => !isAdapterDocsRoute(route.pattern)).map((route) => route.modulePath)
@@ -3399,7 +3456,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3399
3456
  await fs5.writeFile(_path2.default.join(clientEntryDir, "farm-client-router.tsx"), clientEntry.router);
3400
3457
  }
3401
3458
  const clientInput = { [entryName]: clientEntryPath };
3402
- if (platform === "web" && _chunkHVMQAVZKcjs.canBootFarmIslandsClient.call(void 0, config)) {
3459
+ if (platform === "web" && _chunkCL7BUGVBcjs.canBootFarmIslandsClient.call(void 0, config)) {
3403
3460
  const clientBootPath = _path2.default.join(clientEntryDir, "farm-client-boot.tsx");
3404
3461
  await fs5.writeFile(
3405
3462
  clientBootPath,
@@ -3410,17 +3467,17 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3410
3467
  const hasScopedPostcssConfig = hasProjectPostcssConfig(root);
3411
3468
  let postcssSearchPath;
3412
3469
  let tailwindVitePlugin = void 0;
3413
- const rendererVitePlugins = await _chunk67MZTLTFcjs.loadFarmRendererVitePlugins.call(void 0, config.renderer, root, {
3470
+ const rendererVitePlugins = await _chunkM6DAIE4Tcjs.loadFarmRendererVitePlugins.call(void 0, config.renderer, root, {
3414
3471
  ssr: false,
3415
3472
  buildLifetime: rendererBuildLifetime
3416
3473
  });
3417
3474
  if (hasScopedPostcssConfig) {
3418
- _chunkGC5ROI3Acjs.logger.info("\u{1F4E6} Using project PostCSS/Tailwind configuration");
3475
+ _chunk7U4XF76Rcjs.logger.info("\u{1F4E6} Using project PostCSS/Tailwind configuration");
3419
3476
  } else {
3420
3477
  const postcssConfigPath = _path2.default.join(clientEntryDir, "postcss.config.cjs");
3421
3478
  await fs5.writeFile(postcssConfigPath, "module.exports = { plugins: [] };\n");
3422
3479
  postcssSearchPath = clientEntryDir;
3423
- tailwindVitePlugin = await _chunkMBD34AS5cjs.loadTailwindVitePlugin.call(void 0, {
3480
+ tailwindVitePlugin = await _chunkZ5BANEQDcjs.loadTailwindVitePlugin.call(void 0, {
3424
3481
  builder: productionVite.builder,
3425
3482
  announce: true
3426
3483
  });
@@ -3441,7 +3498,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3441
3498
  target: FARM_CLIENT_BUILD_TARGET,
3442
3499
  // Tailwind CSS 4 already requires newer browsers than that baseline. An app's own
3443
3500
  // `build.target` or `build.cssTarget` still decides, as Vite derives one from the other.
3444
- ..._optionalChain([config, 'access', _119 => _119.vite, 'optionalAccess', _120 => _120.build, 'optionalAccess', _121 => _121.target]) === void 0 && _optionalChain([config, 'access', _122 => _122.vite, 'optionalAccess', _123 => _123.build, 'optionalAccess', _124 => _124.cssTarget]) === void 0 && (_chunkMBD34AS5cjs.includesTailwindVitePlugin.call(void 0, tailwindVitePlugin) || _chunkMBD34AS5cjs.includesTailwindVitePlugin.call(void 0, _optionalChain([config, 'access', _125 => _125.vite, 'optionalAccess', _126 => _126.plugins]))) ? { cssTarget: _chunkMBD34AS5cjs.TAILWIND_CSS_BROWSER_TARGET } : {},
3501
+ ..._optionalChain([config, 'access', _119 => _119.vite, 'optionalAccess', _120 => _120.build, 'optionalAccess', _121 => _121.target]) === void 0 && _optionalChain([config, 'access', _122 => _122.vite, 'optionalAccess', _123 => _123.build, 'optionalAccess', _124 => _124.cssTarget]) === void 0 && (_chunkZ5BANEQDcjs.includesTailwindVitePlugin.call(void 0, tailwindVitePlugin) || _chunkZ5BANEQDcjs.includesTailwindVitePlugin.call(void 0, _optionalChain([config, 'access', _125 => _125.vite, 'optionalAccess', _126 => _126.plugins]))) ? { cssTarget: _chunkZ5BANEQDcjs.TAILWIND_CSS_BROWSER_TARGET } : {},
3445
3502
  outDir: outputDir,
3446
3503
  emptyOutDir: platform === "web",
3447
3504
  // Never public: see resolveFarmClientSourcemap.
@@ -3474,7 +3531,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3474
3531
  }
3475
3532
  },
3476
3533
  plugins: [
3477
- _chunkHVMQAVZKcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
3534
+ _chunkCL7BUGVBcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
3478
3535
  createFarmPrivateClientSourcemapsPlugin({
3479
3536
  outDir: _path2.default.join(
3480
3537
  _path2.default.dirname(outputDir),
@@ -3492,7 +3549,16 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3492
3549
  routerModules: [
3493
3550
  _path2.default.join(clientEntryDir, "farm-client-router.tsx"),
3494
3551
  _path2.default.join(clientEntryDir, `${FARM_CLIENT_ROUTE_TABLE_MODULE}.tsx`)
3495
- ]
3552
+ ],
3553
+ // What the islands entry loads with its first render or hydration (RFC 0010).
3554
+ ...islandsMode && _chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, config.renderer) ? {
3555
+ rendererImports: [
3556
+ "react",
3557
+ "react-dom/client",
3558
+ "@farm.js/core/internal/islands-runtime"
3559
+ ],
3560
+ rendererImporter: clientEntryPath
3561
+ } : {}
3496
3562
  }),
3497
3563
  ...adapterOwnsDocsRuntime && platform === "web" ? [
3498
3564
  createFarmDocsModulePreloadPlugin({
@@ -3510,7 +3576,8 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3510
3576
  ...rendererVitePlugins,
3511
3577
  ...config.vite.plugins || [],
3512
3578
  farmServerOnlyEntriesPlugin({ platform, distDir: config.distDir || ".farm" }),
3513
- _chunkHVMQAVZKcjs.farmDocsClientConfigPlugin.call(void 0,
3579
+ farmNavigationPlugin(config.renderer),
3580
+ _chunkCL7BUGVBcjs.farmDocsClientConfigPlugin.call(void 0,
3514
3581
  adapterOwnsDocsRuntime ? _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0
3515
3582
  ),
3516
3583
  // Plugin to redirect @farm.js/core imports to client-only exports
@@ -3543,7 +3610,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3543
3610
  },
3544
3611
  load: {
3545
3612
  filter: {
3546
- id: _chunkHVMQAVZKcjs.exactIdPattern.call(void 0, [
3613
+ id: _chunkCL7BUGVBcjs.exactIdPattern.call(void 0, [
3547
3614
  "\0empty-module",
3548
3615
  "\0empty-api-route",
3549
3616
  "\0farm-i18n-client-bridge",
@@ -3581,7 +3648,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3581
3648
  { ...config, isolatedClientBoundaryModules, programmaticClientRoutes, sourceSnapshot },
3582
3649
  pluginManager
3583
3650
  ),
3584
- _chunkODYKCC6Wcjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
3651
+ _chunk46UV2E7Icjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
3585
3652
  ],
3586
3653
  mode: "production",
3587
3654
  css: postcssSearchPath ? {
@@ -3589,7 +3656,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3589
3656
  } : void 0,
3590
3657
  // Ensure React is bundled for client
3591
3658
  resolve: {
3592
- alias: _chunkHVMQAVZKcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
3659
+ alias: _chunkCL7BUGVBcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
3593
3660
  dedupe: [...config.renderer.dedupe || []]
3594
3661
  },
3595
3662
  // Optimize dependencies - exclude server-side code from client bundle
@@ -3603,7 +3670,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
3603
3670
  }
3604
3671
  };
3605
3672
  await viteBuild(
3606
- _chunkHVMQAVZKcjs.mergeFarmProductionViteConfig.call(void 0, clientViteConfig, config.vite, { clientOutput: true })
3673
+ _chunkCL7BUGVBcjs.mergeFarmProductionViteConfig.call(void 0, clientViteConfig, config.vite, { clientOutput: true })
3607
3674
  );
3608
3675
  if (platform === "mobile") {
3609
3676
  await fs5.rm(_path2.default.join(outputDir, `${entryName}.css`), { force: true });
@@ -3665,11 +3732,12 @@ function createHistoryState(path, pageState, currentState) {
3665
3732
 
3666
3733
  async function fetchFarmNavigationDocument(url, headers, recover = true, signal) {
3667
3734
  const deploymentId = window.__FARM_DEPLOYMENT_ID__;
3668
- const response = await fetch(url, {
3669
- headers: createFarmDeploymentRequestHeaders(deploymentId, headers),
3735
+ const requestHeaders = createFarmDeploymentRequestHeaders(deploymentId, headers);
3736
+ const response = await (${streamNavigations ? "(recover && takeFarmEarlyNavigation(url, requestHeaders, signal)) || " : ""}fetch(url, {
3737
+ headers: requestHeaders,
3670
3738
  signal,
3671
3739
  redirect: "manual",
3672
- });
3740
+ }));
3673
3741
  // Let a document navigation follow redirects, including cross-origin chains
3674
3742
  // and fragment inheritance. Never cache/swap their HTML under the source URL.
3675
3743
  if (response.type === "opaqueredirect" || response.redirected) {
@@ -3696,7 +3764,9 @@ async function fetchFarmNavigationDocument(url, headers, recover = true, signal)
3696
3764
  return response;
3697
3765
  }
3698
3766
 
3699
- ${streamNavigations ? _chunkHVMQAVZKcjs.FARM_NAVIGATION_STREAM_READER_SOURCE : ""}
3767
+ ${streamNavigations ? `${_chunkCL7BUGVBcjs.FARM_NAVIGATION_STREAM_READER_SOURCE}
3768
+
3769
+ ${_chunkCL7BUGVBcjs.FARM_EARLY_NAVIGATION_SOURCE}` : ""}
3700
3770
 
3701
3771
  function clearFarmPrefetchCacheOnDeploymentMismatch(router, error) {
3702
3772
  if (error?.name === "FarmDeploymentMismatchError") {
@@ -4425,9 +4495,9 @@ ${streamNavigations ? ` // A streamed navigation swaps in the page's shell; its
4425
4495
  const response = await fetchFarmNavigationDocument(url, {
4426
4496
  "Accept": "text/html",
4427
4497
  ...(interceptFrom ? { "X-Farm-Intercept-From": interceptFrom } : {}),
4428
- // Islands mode: the server leaves out island values this browser holds, and the
4429
- // layouts it shows.
4430
- ...getFarmIslandValueHeaders(),
4498
+ // Islands mode: the server leaves out island values this browser holds (the swap keeps
4499
+ // the ones only the page holds, keepFarmIslandValues), and the layouts it shows.
4500
+ ...getFarmIslandValueHeaders(${streamNavigations ? 'document.getElementById("root") || document.body' : ""}),
4431
4501
  ...partialHeaders,
4432
4502
  ...(streamShell ? { "F-Stream": "flush" } : {}),
4433
4503
  }, recover, signal);
@@ -4847,22 +4917,31 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
4847
4917
  secure: false
4848
4918
  },
4849
4919
  direction: {}
4850
- }, plugins = [], renderer = _chunk67MZTLTFcjs.REACT_RENDERER, publicRuntimeConfig = void 0, trailingSlash = false, integrationProviders = [], basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule, islandValues = false, platform, serverStylesheets = []) {
4920
+ }, plugins = [], renderer = _chunkM6DAIE4Tcjs.REACT_RENDERER, publicRuntimeConfig = void 0, trailingSlash = false, integrationProviders = [], basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule, islandValues = false, platform, serverStylesheets = []) {
4851
4921
  const toImportPath = (targetPath) => targetPath.replace(/\\/g, "/");
4852
- const clientPluginEntry = _chunkMBD34AS5cjs.generateFarmClientPluginEntryCode.call(void 0,
4922
+ const clientPluginEntry = _chunkZ5BANEQDcjs.generateFarmClientPluginEntryCode.call(void 0,
4853
4923
  plugins,
4854
4924
  root,
4855
4925
  srcDir,
4856
4926
  publicRuntimeConfig,
4857
4927
  platform
4858
4928
  );
4859
- const appSetupPath = _chunk67MZTLTFcjs.resolveFarmRendererAppSetup.call(void 0, root, renderer);
4860
- const rendererClientImports = _chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) ? `import React from "react";
4929
+ const appSetupPath = _chunkM6DAIE4Tcjs.resolveFarmRendererAppSetup.call(void 0, root, renderer);
4930
+ const lazyRenderer = islandValues && platform !== "mobile" && _chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, renderer) && clientRouteSlots.length === 0;
4931
+ const rendererClientImports = lazyRenderer ? `import { holdFarmIslandInteractions, restorePagePosition, watchFarmIslandTriggers } from "@farm.js/core/internal/client-runtime";` : _chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, renderer) ? `import React from "react";
4861
4932
  import { createRoot, hydrateRoot } from "react-dom/client";
4862
- import { restorePagePosition } from "@farm.js/core/internal/client-runtime";` : appSetupPath ? `import React, { createRoot, hydrateRoot, configureApp as __farmConfigureApp } from ${JSON.stringify(renderer.client)};
4863
- import __farmAppSetup from ${JSON.stringify(_chunkGC5ROI3Acjs.toPosixPath.call(void 0, appSetupPath))};
4864
- __farmConfigureApp(__farmAppSetup);` : `import React, { createRoot, hydrateRoot } from ${JSON.stringify(renderer.client)};`;
4865
- const providerClientCode = _chunkHVMQAVZKcjs.generateFarmIntegrationProviderClientCode.call(void 0,
4933
+ import { restorePagePosition } from "@farm.js/core/internal/client-runtime";` : (
4934
+ // Named exports only, as the server entry and the development client read them. A copy
4935
+ // of the namespace, so feature checks of optional exports don't make Rolldown warn.
4936
+ appSetupPath ? `import * as __farmRendererClient from ${JSON.stringify(renderer.client)};
4937
+ import { createRoot, hydrateRoot, configureApp as __farmConfigureApp } from ${JSON.stringify(renderer.client)};
4938
+ import __farmAppSetup from ${JSON.stringify(_chunk7U4XF76Rcjs.toPosixPath.call(void 0, appSetupPath))};
4939
+ const React = { ...__farmRendererClient };
4940
+ __farmConfigureApp(__farmAppSetup);` : `import * as __farmRendererClient from ${JSON.stringify(renderer.client)};
4941
+ import { createRoot, hydrateRoot } from ${JSON.stringify(renderer.client)};
4942
+ const React = { ...__farmRendererClient };`
4943
+ );
4944
+ const providerClientCode = _chunkCL7BUGVBcjs.generateFarmIntegrationProviderClientCode.call(void 0,
4866
4945
  integrationProviders,
4867
4946
  root,
4868
4947
  _nullishCoalesce(renderer.componentExtensions, () => ( []))
@@ -4885,18 +4964,18 @@ __farmConfigureApp(__farmAppSetup);` : `import React, { createRoot, hydrateRoot
4885
4964
  const layoutImportStatements = [];
4886
4965
  const layoutRegistrations = [];
4887
4966
  const hydratingLayoutPatterns = layoutRoutes.filter((layout) => layout.shouldHydrate).map((layout) => layout.pattern);
4888
- const treeLayoutPatterns = islandValues ? _chunk6ZFGWB75cjs.getFarmServerTreeLayoutPatterns.call(void 0, layoutRoutes) : /* @__PURE__ */ new Set();
4967
+ const treeLayoutPatterns = islandValues ? _chunkOFVCWV2Dcjs.getFarmServerTreeLayoutPatterns.call(void 0, layoutRoutes) : /* @__PURE__ */ new Set();
4889
4968
  layoutRoutes.forEach((layout, index) => {
4890
4969
  const relativePath = toImportPath(layout.modulePath);
4891
4970
  const treeLayout = treeLayoutPatterns.has(layout.pattern);
4892
4971
  const rendersOnClient = treeLayout || !layout.hasIsolatedClientBoundaries && hydratingLayoutPatterns.some(
4893
- (pattern) => _chunk6ZFGWB75cjs.layoutsCanCoverSamePage.call(void 0, layout.pattern, pattern)
4972
+ (pattern) => _chunkOFVCWV2Dcjs.layoutsCanCoverSamePage.call(void 0, layout.pattern, pattern)
4894
4973
  );
4895
4974
  if (rendersOnClient && !treeLayout) {
4896
4975
  layoutImportStatements.push(`import Layout${index} from "${relativePath}";`);
4897
4976
  }
4898
- const groupScope = _chunk6ZFGWB75cjs.getRouteGroupScope.call(void 0, layout.pattern);
4899
- const groupFields = groupScope ? `, urlPattern: ${JSON.stringify(_chunk6ZFGWB75cjs.stripRouteGroups.call(void 0, layout.pattern))}, groupScope: ${JSON.stringify(groupScope)}` : "";
4977
+ const groupScope = _chunkOFVCWV2Dcjs.getRouteGroupScope.call(void 0, layout.pattern);
4978
+ const groupFields = groupScope ? `, urlPattern: ${JSON.stringify(_chunkOFVCWV2Dcjs.stripRouteGroups.call(void 0, layout.pattern))}, groupScope: ${JSON.stringify(groupScope)}` : "";
4900
4979
  layoutRegistrations.push(
4901
4980
  ` { 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" : ""} }`
4902
4981
  );
@@ -4973,7 +5052,7 @@ ${clientCachePersistence.imports}
4973
5052
  ${i18nClientRuntime}
4974
5053
  ${docsNavigationRuntime}
4975
5054
  ${docsAdapterRuntime}
4976
- ${_chunkDZZHTMWMcjs.generateFarmDocsSearchClientRuntime.call(void 0, docsSearchEnabled, docsSearchModuleId)}
5055
+ ${_chunkN3H7UPBMcjs.generateFarmDocsSearchClientRuntime.call(void 0, docsSearchEnabled, docsSearchModuleId)}
4977
5056
 
4978
5057
  setFarmBasePath(${JSON.stringify(basePath)});
4979
5058
  setFarmTrailingSlashPreference(${JSON.stringify(trailingSlash)});
@@ -4983,7 +5062,7 @@ mountFarmDocsSearch();
4983
5062
 
4984
5063
  ${generateUniversalRouterStateRuntime()}
4985
5064
 
4986
- ${_chunkHVMQAVZKcjs.FARM_NAVIGATION_SCRIPT_SOURCE}
5065
+ ${_chunkCL7BUGVBcjs.FARM_NAVIGATION_SCRIPT_SOURCE}
4987
5066
 
4988
5067
  // SPA Router for server-rendered pages (HTML swap)
4989
5068
  const spaRouter = {
@@ -5273,7 +5352,7 @@ installFarmLinkPrefetch();
5273
5352
  clientPages.forEach((page) => {
5274
5353
  for (const boundary of page.isolatedBoundaries) {
5275
5354
  isolatedBoundaryModules.set(
5276
- _chunkGC5ROI3Acjs.toViteModuleId.call(void 0, boundary.modulePath, root),
5355
+ _chunk7U4XF76Rcjs.toViteModuleId.call(void 0, boundary.modulePath, root),
5277
5356
  toImportPath(boundary.modulePath)
5278
5357
  );
5279
5358
  }
@@ -5285,7 +5364,45 @@ installFarmLinkPrefetch();
5285
5364
  });
5286
5365
  const isolatedHydrationEnabled = isolatedBoundaryModules.size > 0;
5287
5366
  const serverTreeEnabled = isolatedHydrationEnabled && clientPages.some((page) => page.serverTree);
5288
- const isolatedHydrationImport = isolatedHydrationEnabled ? `${islandValues ? `import { createFarmIsolatedHydrationRuntime, createFarmServerPageBoundary, wrapFarmIsolatedClientGraph, createFarmServerTreeElement${hasServerTreeLayouts ? ", createFarmServerTreeLayout" : ""} } from "@farm.js/core/internal/islands-runtime";` : 'import { createFarmIsolatedHydrationRuntime, createFarmServerPageBoundary, wrapFarmIsolatedClientGraph } from "@farm.js/core/internal/isolated-boundary";'}${serverTreeEnabled && !islandValues ? '\nimport { createFarmServerTreeElement } from "@farm.js/core/internal/server-tree";' : ""}` : "";
5367
+ const islandsRuntimeExports = [
5368
+ "createFarmIsolatedHydrationRuntime",
5369
+ "createFarmServerPageBoundary",
5370
+ "wrapFarmIsolatedClientGraph",
5371
+ ...serverTreeEnabled ? ["createFarmServerTreeElement"] : [],
5372
+ ...hasServerTreeLayouts ? ["createFarmServerTreeLayout"] : []
5373
+ ].join(", ");
5374
+ const lazyRendererRuntime = lazyRenderer ? `// React, React DOM${isolatedHydrationEnabled ? " and islx" : ""} load with the first render or hydration (RFC 0010).
5375
+ let React;
5376
+ let createRoot;
5377
+ let hydrateRoot;
5378
+ let farmRendererLoading = null;
5379
+ let farmRendererLoaded = false;${isolatedHydrationEnabled ? `
5380
+ // The boot stops holding interactions once this entry runs. Until islx loads, islands that have not
5381
+ // hydrated hold them here, for their schedulers to replay.
5382
+ const releaseFarmIslandInteractions = holdFarmIslandInteractions("f-island");` : ""}
5383
+ function loadFarmRenderer() {
5384
+ return farmRendererLoading || (farmRendererLoading = Promise.all([
5385
+ import("react"),
5386
+ import("react-dom/client"),${isolatedHydrationEnabled ? `
5387
+ // Named here, so the build keeps only these of islx's exports.
5388
+ import("@farm.js/core/internal/islands-runtime").then(function({ ${islandsRuntimeExports} }) {
5389
+ return { ${islandsRuntimeExports} };
5390
+ }),` : ""}
5391
+ ]).then(function(modules) {
5392
+ React = modules[0].default;
5393
+ createRoot = modules[1].createRoot;
5394
+ hydrateRoot = modules[1].hydrateRoot;${isolatedHydrationEnabled ? "\n startFarmIslandsRuntime(modules[2]);\n releaseFarmIslandInteractions();\n runFarmIslandsWaiting();" : ""}
5395
+ farmRendererLoaded = true;
5396
+ }, function(error) {${isolatedHydrationEnabled ? `
5397
+ // Without islx a held click would never replay: the page acts natively again.
5398
+ releaseFarmIslandInteractions();` : ""}
5399
+ // A chunk that failed to load can load on a later call.
5400
+ farmRendererLoading = null;
5401
+ throw error;
5402
+ }));
5403
+ }
5404
+ ` : "";
5405
+ const isolatedHydrationImport = lazyRenderer ? "" : isolatedHydrationEnabled ? `${islandValues ? `import { createFarmIsolatedHydrationRuntime, createFarmServerPageBoundary, wrapFarmIsolatedClientGraph, createFarmServerTreeElement${hasServerTreeLayouts ? ", createFarmServerTreeLayout" : ""} } from "@farm.js/core/internal/islands-runtime";` : 'import { createFarmIsolatedHydrationRuntime, createFarmServerPageBoundary, wrapFarmIsolatedClientGraph } from "@farm.js/core/internal/isolated-boundary";'}${serverTreeEnabled && !islandValues ? '\nimport { createFarmServerTreeElement } from "@farm.js/core/internal/server-tree";' : ""}` : "";
5289
5406
  const isolatedHydrationRuntime = isolatedHydrationEnabled ? `const farmIsolatedBoundaryLoaders = {
5290
5407
  ${Array.from(isolatedBoundaryModules.entries()).map(
5291
5408
  ([reference, modulePath]) => ` ${JSON.stringify(reference)}: () => import(${JSON.stringify(modulePath)}),`
@@ -5296,7 +5413,72 @@ async function loadFarmIsolatedBoundary(reference) {
5296
5413
  if (!loader) throw new Error("isolated client boundary loader was not found: " + reference);
5297
5414
  return loader();
5298
5415
  }
5299
- const farmIsolatedHydrationRuntime = createFarmIsolatedHydrationRuntime({
5416
+ ${lazyRenderer ? `let farmIslandsRuntime = null;
5417
+ let FarmServerPage;
5418
+ let wrapFarmIsolatedClientGraph;${serverTreeEnabled ? "\nlet createFarmServerTreeElement;" : ""}${hasServerTreeLayouts ? "\nlet createFarmServerTreeLayout;" : ""}
5419
+ function startFarmIslandsRuntime(islands) {
5420
+ wrapFarmIsolatedClientGraph = islands.wrapFarmIsolatedClientGraph;${serverTreeEnabled ? "\n createFarmServerTreeElement = islands.createFarmServerTreeElement;" : ""}${hasServerTreeLayouts ? "\n createFarmServerTreeLayout = islands.createFarmServerTreeLayout;" : ""}
5421
+ farmIslandsRuntime = islands.createFarmIsolatedHydrationRuntime({
5422
+ ReactRuntime: React,
5423
+ hydrateRoot,
5424
+ load: loadFarmIsolatedBoundary,
5425
+ schedule: scheduleFarmIslandHydration,
5426
+ wrap: wrapWithIntegrationProviders,
5427
+ });
5428
+ // A hydrating layout keeps a non-hydrating page as server HTML; this wrapper runs its islands.
5429
+ FarmServerPage = islands.createFarmServerPageBoundary(React, farmIslandsRuntime);
5430
+ }
5431
+ // islx loads with the first island that is due, as the boot decides on a first load: at once for
5432
+ // one that hydrates at load, else on its trigger. A page or navigation of islands that wait loads
5433
+ // none of it. Until it loads, calls wait here in the order they were made and run with it.
5434
+ const farmIslandsWaiting = [];
5435
+ function runFarmIslandsWaiting() {
5436
+ for (const entry of farmIslandsWaiting.splice(0)) {
5437
+ if (entry.stop) entry.stop();
5438
+ entry.run(farmIslandsRuntime);
5439
+ }
5440
+ }
5441
+ // Behind a load under way, calls wait for it; one that fails reports itself to whoever awaited it.
5442
+ function whenFarmIslandsRuntime(scope, call) {
5443
+ if (farmIslandsRuntime) call(farmIslandsRuntime);
5444
+ else if (farmRendererLoading) farmRendererLoading.then(function() { call(farmIslandsRuntime); }, function() {});
5445
+ else farmIslandsWaiting.push({ scope: scope, run: call });
5446
+ }
5447
+ const farmIsolatedHydrationRuntime = {
5448
+ hydrate: function(scope, signal) {
5449
+ if (farmIslandsRuntime) return farmIslandsRuntime.hydrate(scope, signal);
5450
+ const stop = farmRendererLoading
5451
+ ? null
5452
+ : watchFarmIslandTriggers(scope, "f-island", function() { void loadFarmRenderer(); });
5453
+ if (!stop) return loadFarmRenderer().then(function() { return farmIslandsRuntime.hydrate(scope, signal); });
5454
+ farmIslandsWaiting.push({
5455
+ scope: scope,
5456
+ stop: stop,
5457
+ run: function(runtime) {
5458
+ if (!signal || !signal.aborted) void runtime.hydrate(scope, signal);
5459
+ },
5460
+ });
5461
+ return Promise.resolve();
5462
+ },
5463
+ dispose: function(scope) {
5464
+ if (farmIslandsRuntime) return farmIslandsRuntime.dispose(scope);
5465
+ // Nothing has hydrated yet: what removed DOM waits for goes with it.
5466
+ for (let index = farmIslandsWaiting.length - 1; index >= 0; index--) {
5467
+ const entry = farmIslandsWaiting[index];
5468
+ if (!scope.contains(entry.scope)) continue;
5469
+ farmIslandsWaiting.splice(index, 1);
5470
+ if (entry.stop) entry.stop();
5471
+ }
5472
+ if (farmRendererLoading) farmRendererLoading.then(function() { farmIslandsRuntime.dispose(scope); }, function() {});
5473
+ },
5474
+ // Only a hydrated island has state to carry over.
5475
+ carryOver: function(from, to) {
5476
+ if (farmIslandsRuntime) farmIslandsRuntime.carryOver(from, to);
5477
+ },
5478
+ endStream: function(root) {
5479
+ whenFarmIslandsRuntime(root, function(runtime) { runtime.endStream(root); });
5480
+ },
5481
+ };` : `const farmIsolatedHydrationRuntime = createFarmIsolatedHydrationRuntime({
5300
5482
  ReactRuntime: React,
5301
5483
  hydrateRoot,
5302
5484
  load: loadFarmIsolatedBoundary,
@@ -5305,7 +5487,7 @@ const farmIsolatedHydrationRuntime = createFarmIsolatedHydrationRuntime({
5305
5487
  });
5306
5488
 
5307
5489
  // A hydrating layout keeps a non-hydrating page as server HTML; this wrapper runs its islands.
5308
- const FarmServerPage = createFarmServerPageBoundary(React, farmIsolatedHydrationRuntime);
5490
+ const FarmServerPage = createFarmServerPageBoundary(React, farmIsolatedHydrationRuntime);`}
5309
5491
 
5310
5492
  function disposeFarmIsolatedClientBoundaries(scope) {
5311
5493
  farmIsolatedHydrationRuntime.dispose(scope);
@@ -5352,7 +5534,7 @@ ${layoutImports}
5352
5534
  ${rendererClientImports}
5353
5535
  ${isolatedHydrationImport}
5354
5536
  ${providerClientCode.imports}
5355
- import { createClientCancellation, createClientPluginManager, createPluginlessClientRuntime, getFarmIslandValueHeaders, getHashTargetElement, installChunkErrorRecovery, installFarmLinkPrefetch, isFarmBlockedNavigationURL, isFarmExternalNavigationURL, readFarmLinkNavigateOptions, rememberFarmLinkLocale, reconcileFarmDocumentHead, runFarmNavigationDelegates, scheduleFarmIslandHydration, createFarmSearchParams, searchParamsToObject, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from "@farm.js/core/internal/client-runtime";
5537
+ import { createClientCancellation, createClientPluginManager, createPluginlessClientRuntime, getFarmIslandValueHeaders, getHashTargetElement, keepFarmIslandValues, installChunkErrorRecovery, installFarmLinkPrefetch, isFarmBlockedNavigationURL, isFarmExternalNavigationURL, readFarmLinkNavigateOptions, rememberFarmLinkLocale, reconcileFarmDocumentHead, runFarmNavigationDelegates, scheduleFarmIslandHydration, createFarmSearchParams, searchParamsToObject, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from "@farm.js/core/internal/client-runtime";
5356
5538
  import { createFarmDeploymentMismatchError, createFarmDeploymentRequestHeaders, isFarmDeploymentMismatchResponse } from "@farm.js/core/deployment";
5357
5539
  import { createFarmRouter, isFarmRouteActive, matchFarmRoute } from "@farm.js/core/router";
5358
5540
  ${clientPluginEntry.imports}
@@ -5362,7 +5544,7 @@ ${docsNavigationRuntime}
5362
5544
  ${docsAdapterRuntime}
5363
5545
 
5364
5546
  ${imports.join("\n")}
5365
- ${_chunkDZZHTMWMcjs.generateFarmDocsSearchClientRuntime.call(void 0, docsSearchEnabled, docsSearchModuleId)}
5547
+ ${_chunkN3H7UPBMcjs.generateFarmDocsSearchClientRuntime.call(void 0, docsSearchEnabled, docsSearchModuleId, void 0, lazyRenderer ? "loadFarmRenderer" : void 0)}
5366
5548
 
5367
5549
  ${providerClientCode.runtime}
5368
5550
 
@@ -5382,7 +5564,7 @@ ${generateFarmClientRouteTableRuntime({
5382
5564
  })}
5383
5565
  ${generateClientPageDirectorySource()}
5384
5566
 
5385
- ${isolatedHydrationRuntime}
5567
+ ${lazyRendererRuntime}${isolatedHydrationRuntime}
5386
5568
  ${routeClientGraphRuntime}
5387
5569
 
5388
5570
  const clientRouteSlots = [
@@ -5431,7 +5613,7 @@ function hasHydratableLayout(pathname) {
5431
5613
  });
5432
5614
  }
5433
5615
 
5434
- ${_chunkHVMQAVZKcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
5616
+ ${_chunkCL7BUGVBcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
5435
5617
  // Wrap a page element with applicable layouts
5436
5618
  function wrapWithLayouts(pageElement, pathname, params) {
5437
5619
  const layouts = getApplicableLayouts(pathname);
@@ -5466,7 +5648,7 @@ function createLayoutPageBoundary(route, pageElement, serverHtml) {
5466
5648
  return React.createElement("div", props, pageElement);
5467
5649
  }
5468
5650
  let farmLastRouteState = null;
5469
- ${hasServerTreeLayouts && islandValues && isolatedHydrationEnabled ? `${_chunkHVMQAVZKcjs.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE}
5651
+ ${hasServerTreeLayouts && islandValues && isolatedHydrationEnabled ? `${_chunkCL7BUGVBcjs.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE}
5470
5652
  function farmTreeLayoutsOf(pathname) {
5471
5653
  return getApplicableLayouts(pathname).filter(function(layout) {
5472
5654
  return layout.serverTree === true;
@@ -5506,10 +5688,15 @@ function matchRoute(pathname) {
5506
5688
  }
5507
5689
 
5508
5690
  async function loadRouteComponent(route) {
5509
- if (!route.load) return null;
5691
+ if (!route.load) return null;${lazyRenderer ? `
5692
+ // A page component renders with React DOM, which loads beside it (RFC 0010).
5693
+ const renderer = loadFarmRenderer();
5694
+ if (!route.Component) route.Component = await route.load();
5695
+ await renderer;
5696
+ return route.Component;` : `
5510
5697
  if (route.Component) return route.Component;
5511
5698
  route.Component = await route.load();
5512
- return route.Component;
5699
+ return route.Component;`}
5513
5700
  }
5514
5701
 
5515
5702
  // The props the server rendered this document with, as the page receives them:
@@ -5525,7 +5712,9 @@ function reviveServerPageProps(serverProps) {
5525
5712
  async function createMatchedHydrationRoute(matched, pathname, searchParams, navigationPage, serverProps, layoutSource, hydrationContainer) {
5526
5713
  const hydrateLayouts = hasHydratableLayout(pathname);
5527
5714
  const params = matched.params;
5528
- let pageElement = null;
5715
+ let pageElement = null;${lazyRenderer ? `
5716
+ // Only a route that renders a page or its layouts needs React DOM; one of islands hydrates them.
5717
+ if (hydrateLayouts || matched.route.pageShouldHydrate) await loadFarmRenderer();` : ""}
5529
5718
  // Layouts rendered as server trees rebuild from the HTML that carries them.
5530
5719
  if (hydrateLayouts && !(await prepareFarmTreeLayouts(pathname, params, layoutSource))) return null;
5531
5720
 
@@ -5580,7 +5769,7 @@ async function createMatchedHydrationRoute(matched, pathname, searchParams, navi
5580
5769
 
5581
5770
  if (!pageElement) return null;
5582
5771
  if (!hydrateLayouts) {
5583
- ${_chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) ? "if (hydrationContainer) pageElement = restorePagePosition(React, hydrationContainer, pageElement);" : ""}
5772
+ ${_chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, renderer) ? "if (hydrationContainer) pageElement = restorePagePosition(React, hydrationContainer, pageElement);" : ""}
5584
5773
  return createFarmRouteState(pageElement, pathname, params, false);
5585
5774
  }
5586
5775
  if (matched.route.pageShouldHydrate) {
@@ -5609,7 +5798,7 @@ function createFarmRouteState(page, pathname, params, includeLayouts) {
5609
5798
 
5610
5799
  function hydrateFarmRoute(container, route) {
5611
5800
  farmLastRouteState = route;
5612
- ${_chunk67MZTLTFcjs.isReactRenderer.call(void 0, renderer) ? "return hydrateRoot(container, route.element);" : "return route.layouts.length > 0 ? hydrateRoot(container, route.element, route) : hydrateRoot(container, route.element);"}
5801
+ ${_chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, renderer) ? "return hydrateRoot(container, route.element);" : "return route.layouts.length > 0 ? hydrateRoot(container, route.element, route) : hydrateRoot(container, route.element);"}
5613
5802
  }
5614
5803
 
5615
5804
  function renderFarmRoute(root, route) {
@@ -5895,7 +6084,9 @@ async function hydrate() {
5895
6084
  );
5896
6085
  window.__FARM_PROPS__ = initialPayload.page;
5897
6086
  window.__FARM_ROUTE_SLOTS__ = initialPayload.slots;
5898
-
6087
+ ${lazyRenderer ? ` // React DOM and islx load with what first renders or hydrates, not here (RFC 0010): a root
6088
+ // that waits for its trigger, or a navigation that swaps its page in, does not wait for them.
6089
+ ` : ""}
5899
6090
  if (await hydrateFarmDocsAdapterRuntime()) {
5900
6091
  return;
5901
6092
  }
@@ -5932,101 +6123,82 @@ async function hydrate() {
5932
6123
  return;
5933
6124
  }
5934
6125
 
6126
+ const pageHydration = scheduleFarmRouteHydration(matched, pathname, container, window.__FARM_PROPS__);
6127
+ ${isolatedHydrationEnabled ? `// Not cancelled with the page: a navigation disposes the islands it removes, and one in a
6128
+ // layout it keeps still waits for its trigger, as on a page of islands only.
6129
+ const isolatedHydration =
6130
+ !hasHydratableLayout(pathname) &&
6131
+ document.querySelector('f-island[src]')
6132
+ ? hydrateFarmIsolatedClientBoundaries(document)
6133
+ : Promise.resolve();
6134
+ await Promise.all([pageHydration, isolatedHydration]);` : "await pageHydration;"}
6135
+ }
6136
+
6137
+ // Hydrates the route's page or layout root in \`container\` when its strategy is due: at once, or
6138
+ // on its idle, visible or interaction trigger (RFC 0003, section 11). The first load schedules it,
6139
+ // and so does a navigation that swaps a page into a root that never hydrated (RFC 0011): nothing
6140
+ // in that root ran, so it waits for the next page's trigger as a first load of that page would.
6141
+ function scheduleFarmRouteHydration(matched, pathname, container, serverProps) {
5935
6142
  container.dataset.farmIsland = "page";
5936
6143
  container.dataset.farmIslandStrategy = matched.route.islandStrategy || "load";
5937
6144
 
5938
6145
  const hydrationController = new AbortController();
5939
6146
  pendingPageHydrationController = hydrationController;
5940
- try {
5941
- const pageHydration = scheduleFarmIslandHydration({
5942
- container,
5943
- strategy: matched.route.islandStrategy,
5944
- signal: hydrationController.signal,
5945
- hydrate: async function() {
5946
- if (
5947
- hydrationController.signal.aborted ||
5948
- !container.isConnected ||
5949
- window.location.pathname !== pathname
5950
- ) {
5951
- return;
5952
- }
5953
- const searchParams = searchParamsToObject(new URLSearchParams(window.location.search));
5954
- const shouldHydrate = !isHydrated && Boolean(container.innerHTML.trim());
5955
- const routeState = await createMatchedHydrationRoute(
5956
- matched,
5957
- pathname,
5958
- searchParams,
5959
- undefined,
5960
- window.__FARM_PROPS__,
5961
- undefined,
5962
- shouldHydrate ? container : undefined,
5963
- );
5964
- if (!routeState) return;
5965
- const hydrationSession = await farmClientRuntime.beginHydration({
5966
- container,
5967
- mode: shouldHydrate ? "hydrate" : "render",
5968
- });
6147
+ return scheduleFarmIslandHydration({
6148
+ container,
6149
+ strategy: matched.route.islandStrategy,
6150
+ signal: hydrationController.signal,
6151
+ hydrate: async function() {
6152
+ if (
6153
+ hydrationController.signal.aborted ||
6154
+ !container.isConnected ||
6155
+ window.location.pathname !== pathname
6156
+ ) {
6157
+ return;
6158
+ }
6159
+ const searchParams = searchParamsToObject(new URLSearchParams(window.location.search));
6160
+ const shouldHydrate = !isHydrated && Boolean(container.innerHTML.trim());
6161
+ const routeState = await createMatchedHydrationRoute(
6162
+ matched,
6163
+ pathname,
6164
+ searchParams,
6165
+ undefined,
6166
+ serverProps,
6167
+ undefined,
6168
+ shouldHydrate ? container : undefined,
6169
+ );
6170
+ if (!routeState) return;
6171
+ const hydrationSession = await farmClientRuntime.beginHydration({
6172
+ container,
6173
+ mode: shouldHydrate ? "hydrate" : "render",
6174
+ });
5969
6175
 
5970
- try {
5971
- // A navigation replaced this route before it hydrated. Like a superseded
5972
- // navigation, that is not a failure, so error hooks never see it.
5973
- if (hydrationController.signal.aborted || !container.isConnected) return;
5974
- if (shouldHydrate) {
5975
- reactRoot = hydrateFarmRoute(container, routeState);
6176
+ try {
6177
+ // A navigation replaced this route before it hydrated. Like a superseded
6178
+ // navigation, that is not a failure, so error hooks never see it.
6179
+ if (hydrationController.signal.aborted || !container.isConnected) return;
6180
+ if (shouldHydrate) {
6181
+ reactRoot = hydrateFarmRoute(container, routeState);
6182
+ reactRootContainer = container;
6183
+ isHydrated = true;
6184
+ } else {
6185
+ if (!reactRoot) {
6186
+ reactRoot = createRoot(container);
5976
6187
  reactRootContainer = container;
5977
- isHydrated = true;
5978
- } else {
5979
- if (!reactRoot) {
5980
- reactRoot = createRoot(container);
5981
- reactRootContainer = container;
5982
- }
5983
- renderFarmRoute(reactRoot, routeState);
5984
6188
  }
5985
- await farmClientRuntime.completeHydration(hydrationSession);
5986
- } catch (error) {
5987
- await farmClientRuntime.failHydration(hydrationSession, error);
5988
- console.error("[Farm.js] Hydration error:", error);
6189
+ renderFarmRoute(reactRoot, routeState);
5989
6190
  }
5990
- },
5991
- });
5992
- ${islandValues ? `// A layout root that waits for a click renders again on a navigation, and a link under the
5993
- // pointer is a navigation on its way: hydrate the root now, as a focus would, so the click
5994
- // updates it instead of rendering it from the start.
5995
- if (hasHydratableLayout(pathname) && (matched.route.islandStrategy || "load") !== "load") {
5996
- const hydrateForLink = function(target) {
5997
- const anchor = target instanceof Element ? target.closest("a[href]") : null;
5998
- const href = anchor && anchor.getAttribute("href");
5999
- if (!href || href.startsWith("#") || hasAbsoluteNavigationHref(href)) return false;
6000
- if (!container.contains(anchor)) return false;
6001
- document.dispatchEvent(
6002
- new CustomEvent("farm:island-interaction", { detail: { target: anchor, kind: null } }),
6003
- );
6004
- return true;
6005
- };
6006
- const onLinkIntent = function(event) {
6007
- if (hydrateForLink(event.target)) document.removeEventListener("mouseover", onLinkIntent, true);
6008
- };
6009
- // The hover that loaded this entry fired before it ran.
6010
- if (!hydrateForLink(container.querySelector("a[href]:hover"))) {
6011
- document.addEventListener("mouseover", onLinkIntent, true);
6012
- void pageHydration.finally(function() {
6013
- document.removeEventListener("mouseover", onLinkIntent, true);
6014
- });
6191
+ await farmClientRuntime.completeHydration(hydrationSession);
6192
+ } catch (error) {
6193
+ await farmClientRuntime.failHydration(hydrationSession, error);
6194
+ console.error("[Farm.js] Hydration error:", error);
6015
6195
  }
6016
- }` : ""}
6017
- ${isolatedHydrationEnabled ? `// Not cancelled with the page: a navigation disposes the islands it removes, and one in a
6018
- // layout it keeps still waits for its trigger, as on a page of islands only.
6019
- const isolatedHydration =
6020
- !hasHydratableLayout(pathname) &&
6021
- document.querySelector('f-island[src]')
6022
- ? hydrateFarmIsolatedClientBoundaries(document)
6023
- : Promise.resolve();
6024
- await Promise.all([pageHydration, isolatedHydration]);` : "await pageHydration;"}
6025
- } finally {
6196
+ },
6197
+ }).finally(function() {
6026
6198
  if (pendingPageHydrationController === hydrationController) {
6027
6199
  pendingPageHydrationController = null;
6028
6200
  }
6029
- }
6201
+ });
6030
6202
  }
6031
6203
 
6032
6204
  /*farm-router-start*/
@@ -6065,7 +6237,7 @@ function fitsSegmentResponse(currentRoot, nextRoot) {
6065
6237
  return true;
6066
6238
  }` : ""}
6067
6239
 
6068
- ${_chunkHVMQAVZKcjs.FARM_NAVIGATION_SCRIPT_SOURCE}
6240
+ ${_chunkCL7BUGVBcjs.FARM_NAVIGATION_SCRIPT_SOURCE}
6069
6241
 
6070
6242
  function activateNavigationScripts(root) {
6071
6243
  for (const script of Array.from(root?.querySelectorAll?.("script") || [])) {
@@ -6168,7 +6340,7 @@ function getLayoutShell(root, patterns, index) {
6168
6340
  return shell.innerHTML;
6169
6341
  }
6170
6342
 
6171
- ${islandValues ? _chunkHVMQAVZKcjs.FARM_REFRESH_FIELDS_SOURCE : ""}function replaceSharedLayoutBoundary(currentRoot, nextRoot, refresh = false) {
6343
+ ${islandValues ? _chunkCL7BUGVBcjs.FARM_REFRESH_FIELDS_SOURCE : ""}function replaceSharedLayoutBoundary(currentRoot, nextRoot, refresh = false) {
6172
6344
  // A refresh keeps the islands still on the page: the ones in streamed Suspense content too.
6173
6345
  if (refresh) revealFarmStreamedContent(nextRoot);
6174
6346
  const currentPatterns = getLayoutPatterns(currentRoot);
@@ -6235,11 +6407,9 @@ ${islandValues ? ` // Islands mode: navigations name the layouts on screen, and
6235
6407
  partialNavigationHeaders: function() {
6236
6408
  const root = document.getElementById("root") || document.body;
6237
6409
  const layouts = getLayoutPatterns(root);
6238
- // The root React owns, or one whose layouts hydrate together but have not yet: the
6239
- // navigation creates it (swapContent).
6240
- const rendersTree = reactRoot
6241
- ? reactRootContainer === root
6242
- : root.id === "root" && hasHydratableLayout(window.location.pathname);
6410
+ // Only a root React owns rebuilds the next page from its tree. One that has not hydrated
6411
+ // swaps the next page's HTML in and keeps waiting (swapContent), without React DOM.
6412
+ const rendersTree = Boolean(reactRoot) && reactRootContainer === root;
6243
6413
  return {
6244
6414
  ...(layouts.length ? { "F-Layouts": JSON.stringify(layouts) } : {}),
6245
6415
  ...(rendersTree ? { "F-Render": "tree" } : {}),
@@ -6578,30 +6748,6 @@ ${islandValues ? ` // Islands mode: navigations name the layouts on screen, and
6578
6748
  const hydrateLayouts = hasHydratableLayout(newPathname);
6579
6749
  const nextPage = newRoot.querySelector("#__farm_page__");
6580
6750
 
6581
- ${islandValues ? `// A layout that hydrates as one root but has not yet (its client components wait for a
6582
- // click): its first navigation renders the page's payload in a new root, as later ones do.
6583
- if (
6584
- matched && hydrateLayouts && !reactRoot && currentRoot.id === "root" &&
6585
- nextPage?.querySelector('script[type="f/tree"][partial]')
6586
- ) {
6587
- const routeState = await createMatchedHydrationRoute(
6588
- matched,
6589
- newPathname,
6590
- searchParamsToObject(targetUrl.searchParams),
6591
- nextPage,
6592
- nextPageProps,
6593
- newRoot,
6594
- );
6595
- if (!isNavigationCurrent()) return false;
6596
- if (!routeState) return "segment-mismatch";
6597
- cancelPendingPageHydration();
6598
- resetRouteSlotRoots();
6599
- setFarmReactRoot(createRoot(currentRoot), currentRoot);
6600
- renderFarmRoute(reactRoot, routeState);
6601
- window.__FARM_ROUTE_SLOTS__ = nextRouteSlots;
6602
- setFarmHydrated();
6603
- return true;
6604
- }` : ""}
6605
6751
  // If React already owns the shared layout, update that root. React keeps
6606
6752
  // matching layout component instances and their state mounted.
6607
6753
  if (matched && hydrateLayouts && reactRoot && reactRootContainer === currentRoot) {
@@ -6625,6 +6771,7 @@ ${islandValues ? ` // Islands mode: navigations name the layouts on screen, and
6625
6771
 
6626
6772
  ${islandValues ? `// A payload-only page renders only in a React root that rebuilds it.
6627
6773
  if (nextPage?.querySelector('script[type="f/tree"][partial]')) return "segment-mismatch";` : ""}
6774
+ ${islandValues ? "const keepValues = keepFarmIslandValues(currentRoot);" : ""}
6628
6775
  const rootWasReactOwned = reactRootContainer === currentRoot;
6629
6776
  resetReactRoot();
6630
6777
  resetRouteSlotRoots();
@@ -6641,29 +6788,57 @@ ${islandValues ? ` // Islands mode: navigations name the layouts on screen, and
6641
6788
  activateNavigationScripts(currentRoot);
6642
6789
  isolatedHydrationScope = currentRoot;
6643
6790
  }
6791
+ ${islandValues ? "keepValues();" : ""}
6644
6792
  window.__FARM_ROUTE_SLOTS__ = nextRouteSlots;
6645
6793
  hydrateInitialRouteSlots();
6646
6794
 
6647
6795
  // Check if the new HTML contains an interactive route boundary.
6648
6796
  if (matched) {
6649
- const searchParams = searchParamsToObject(targetUrl.searchParams);
6650
6797
  const pageContainer =
6651
6798
  hydrateLayouts ? currentRoot : document.getElementById("__farm_page__") || currentRoot;
6652
- const routeState = await createMatchedHydrationRoute(
6653
- matched,
6654
- newPathname,
6655
- searchParams,
6656
- undefined,
6657
- nextPageProps,
6658
- undefined,
6659
- pageContainer,
6660
- );
6661
- if (!isNavigationCurrent()) return false;
6662
- if (routeState) {
6663
- setFarmReactRoot(hydrateFarmRoute(pageContainer, routeState), pageContainer);
6664
- setFarmHydrated();
6799
+ if (
6800
+ (hydrateLayouts || matched.route.pageShouldHydrate) &&
6801
+ (matched.route.islandStrategy || "load") !== "load"
6802
+ ) {
6803
+ // A root that waits for its trigger waits after a navigation too, as on a first load:
6804
+ // the page is server HTML and its tree until then, and React DOM loads when it hydrates.
6805
+ scheduleFarmRouteHydration(matched, newPathname, pageContainer, nextPageProps).catch(
6806
+ function(error) {
6807
+ console.error("[Farm.js] Hydration error:", error);
6808
+ },
6809
+ );
6810
+ } else {
6811
+ const searchParams = searchParamsToObject(targetUrl.searchParams);
6812
+ const routeState = await createMatchedHydrationRoute(
6813
+ matched,
6814
+ newPathname,
6815
+ searchParams,
6816
+ undefined,
6817
+ nextPageProps,
6818
+ undefined,
6819
+ pageContainer,
6820
+ );
6821
+ if (!isNavigationCurrent()) return false;
6822
+ if (routeState) {
6823
+ setFarmReactRoot(hydrateFarmRoute(pageContainer, routeState), pageContainer);
6824
+ setFarmHydrated();
6825
+ }
6665
6826
  }
6666
- ${isolatedHydrationEnabled ? `if (matched.route.hasIsolatedClientBoundaries && !hydrateLayouts) {
6827
+ ${isolatedHydrationEnabled ? lazyRenderer ? `if (matched.route.hasIsolatedClientBoundaries && !hydrateLayouts) {
6828
+ if (farmRendererLoaded) {
6829
+ await hydrateFarmIsolatedClientBoundaries(
6830
+ isolatedHydrationScope,
6831
+ navigation.controller.signal,
6832
+ );
6833
+ if (!isNavigationCurrent()) return false;
6834
+ } else {
6835
+ // React DOM and islx are still on their way (RFC 0010): the page shows now, and its
6836
+ // islands hydrate once they arrive. A navigation that removes them first disposes them.
6837
+ hydrateFarmIsolatedClientBoundaries(isolatedHydrationScope).catch(function(error) {
6838
+ console.error("[Farm.js] Hydrating the page's islands failed:", error);
6839
+ });
6840
+ }
6841
+ }` : `if (matched.route.hasIsolatedClientBoundaries && !hydrateLayouts) {
6667
6842
  await hydrateFarmIsolatedClientBoundaries(
6668
6843
  isolatedHydrationScope,
6669
6844
  navigation.controller.signal,
@@ -6815,8 +6990,13 @@ void hydrate();
6815
6990
  }
6816
6991
  async function buildSSRInMemory(productionVite, config, root, routeManager, apiRouteManager, serverRenderer, preset, collectedPageRoutes, collectedLayoutRoutes, collectedRouteSlots, isolatedClientBoundaryModules, hydrationPlanCache, rendererBuildLifetime, sourceSnapshot) {
6817
6992
  const viteBuild = productionVite.build;
6818
- const { farmIslandContainersPlugin, farmPlugin, farmServerOnlyEntriesPlugin } = await import("./vite.cjs");
6819
- const { PluginManager: PluginManager2 } = await import("./plugin-AGEFSU7K.cjs");
6993
+ const {
6994
+ farmIslandContainersPlugin,
6995
+ farmNavigationPlugin,
6996
+ farmPlugin,
6997
+ farmServerOnlyEntriesPlugin
6998
+ } = await import("./vite.cjs");
6999
+ const { PluginManager: PluginManager2 } = await import("./plugin-LN3JBZRR.cjs");
6820
7000
  const fs5 = await import("fs/promises");
6821
7001
  const pluginManager = new PluginManager2({
6822
7002
  config,
@@ -6827,7 +7007,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
6827
7007
  const hasScopedPostcssConfig = hasProjectPostcssConfig(root);
6828
7008
  let postcssConfigDir;
6829
7009
  let tailwindVitePlugin = void 0;
6830
- const rendererVitePlugins = await _chunk67MZTLTFcjs.loadFarmRendererVitePlugins.call(void 0, config.renderer, root, {
7010
+ const rendererVitePlugins = await _chunkM6DAIE4Tcjs.loadFarmRendererVitePlugins.call(void 0, config.renderer, root, {
6831
7011
  ssr: true,
6832
7012
  buildLifetime: rendererBuildLifetime
6833
7013
  });
@@ -6837,7 +7017,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
6837
7017
  _path2.default.join(postcssConfigDir, "postcss.config.cjs"),
6838
7018
  "module.exports = { plugins: [] };\n"
6839
7019
  );
6840
- tailwindVitePlugin = await _chunkMBD34AS5cjs.loadTailwindVitePlugin.call(void 0, {
7020
+ tailwindVitePlugin = await _chunkZ5BANEQDcjs.loadTailwindVitePlugin.call(void 0, {
6841
7021
  builder: productionVite.builder,
6842
7022
  label: "for SSR"
6843
7023
  });
@@ -6916,7 +7096,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
6916
7096
  modulePath: entry.modulePath
6917
7097
  })) : [];
6918
7098
  const i18nCatalogs = config.i18n.enabled ? (await _chunkCYOTNHDFcjs.readFarmI18nCatalogs.call(void 0, config.i18n)).catalogs : {};
6919
- const appDirs = _chunkQMR2TUVZcjs.getFarmAppDirectories.call(void 0, config);
7099
+ const appDirs = _chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, config);
6920
7100
  let openAPIReference = null;
6921
7101
  if (config.openapi.enabled && config.openapi.route) {
6922
7102
  const { OpenAPIManager, renderOpenAPIReferenceHTML } = await import("./manager-PX4QN4HK.cjs");
@@ -6943,15 +7123,15 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
6943
7123
  config: await readMiddlewareFileConfig(route.filePath)
6944
7124
  }))
6945
7125
  );
6946
- const instrumentationPath = _chunk3GNHJ3RNcjs.resolveFarmInstrumentationFile.call(void 0, root, config.srcDir || "src");
6947
- const notFoundPath = _chunkHVMQAVZKcjs.resolveFarmNotFoundComponentPath.call(void 0, config, appDirs);
6948
- if (notFoundPath) _chunkGC5ROI3Acjs.logger.info(`\u{1F4CB} Found custom 404 page: ${notFoundPath}`);
7126
+ const instrumentationPath = _chunk3BTN3NP7cjs.resolveFarmInstrumentationFile.call(void 0, root, config.srcDir || "src");
7127
+ const notFoundPath = _chunkCL7BUGVBcjs.resolveFarmNotFoundComponentPath.call(void 0, config, appDirs);
7128
+ if (notFoundPath) _chunk7U4XF76Rcjs.logger.info(`\u{1F4CB} Found custom 404 page: ${notFoundPath}`);
6949
7129
  layoutRoutes.sort((a, b) => {
6950
7130
  const depthA = a.pattern.split("/").filter(Boolean).length;
6951
7131
  const depthB = b.pattern.split("/").filter(Boolean).length;
6952
7132
  return depthA - depthB;
6953
7133
  });
6954
- _chunkGC5ROI3Acjs.logger.info(
7134
+ _chunk7U4XF76Rcjs.logger.info(
6955
7135
  `\u{1F4CB} Found ${pageRoutes.length} page routes, ${layoutRoutes.length} layouts, ${apiRoutes.length} API routes, ${applicationMetadataRoutes.length} metadata routes, and ${middlewareRoutes.length} middleware files`
6956
7136
  );
6957
7137
  const configuredIntegrationValues = Object.values(config.integrations || {});
@@ -6961,14 +7141,14 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
6961
7141
  const hasServerRuntimeIntegrations = configuredIntegrationValues.some(
6962
7142
  (integration) => typeof integration === "object" && integration !== null && (!("serverRuntime" in integration) || integration.serverRuntime !== false)
6963
7143
  );
6964
- const hasIntegrationProviders = _chunkAOTD2N5Pcjs.getIntegrationProviders.call(void 0, config.integrations).some(
7144
+ const hasIntegrationProviders = _chunkWGWWRV2Mcjs.getIntegrationProviders.call(void 0, config.integrations).some(
6965
7145
  (provider) => provider.component || provider.type === "clerk"
6966
7146
  );
6967
7147
  const hasObservabilityHandler = !!config.observability && typeof config.observability === "object" && "onEvent" in config.observability;
6968
7148
  const hasMdxComponentConfig = Boolean(_optionalChain([config, 'access', _136 => _136.mdx, 'optionalAccess', _137 => _137.components]));
6969
- const hasMiddlewareConfig = _chunk6ZFGWB75cjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
6970
- const hasRouteContextConfig = _chunkF7PKUP6Pcjs.hasCustomFarmRouteContext.call(void 0, config);
6971
- const hasServerRuntimePlugins = _chunkMBD34AS5cjs.hasFarmServerRuntimePlugins.call(void 0, config.plugins);
7149
+ const hasMiddlewareConfig = _chunkOFVCWV2Dcjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
7150
+ const hasRouteContextConfig = _chunkMOGRRZMWcjs.hasCustomFarmRouteContext.call(void 0, config);
7151
+ const hasServerRuntimePlugins = _chunkZ5BANEQDcjs.hasFarmServerRuntimePlugins.call(void 0, config.plugins);
6972
7152
  const hasPluginRoutes = hasFarmPluginRoutes(config);
6973
7153
  const hasServerCacheConfig = hasFarmServerCacheConfig(config.cache);
6974
7154
  const configModulePath = hasServerRuntimeIntegrations || hasObservabilityHandler || hasMdxComponentConfig || hasMiddlewareConfig || hasRouteContextConfig || hasServerRuntimePlugins || hasPluginRoutes || hasServerCacheConfig || hasFarmServerStorageConfig(config.storage) || hasIntegrationProviders ? await findFarmConfigPath(root) : null;
@@ -6977,9 +7157,9 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
6977
7157
  const hasConfiguredRuntimePlugins = Boolean(
6978
7158
  hasRuntimeConfigModule && (config.plugins || []).length > 0
6979
7159
  );
6980
- if (_chunkXGS76V7Lcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
7160
+ if (_chunkE3HBD2K3cjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
6981
7161
  const adapterGuardedPaths = new Set(getFarmDocsGuardedPaths(config, middlewareRoutes));
6982
- _chunkXGS76V7Lcjs.assertFarmDocsAdapterServesNoGuardedPages.call(void 0,
7162
+ _chunkE3HBD2K3cjs.assertFarmDocsAdapterServesNoGuardedPages.call(void 0,
6983
7163
  config.docs,
6984
7164
  { root, srcDir: config.srcDir },
6985
7165
  (pathname) => adapterGuardedPaths.has(pathname),
@@ -6989,7 +7169,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
6989
7169
  const farmDocsCspNonceMarker = _chunk6JHZPB52cjs.createFarmCspNonce.call(void 0, config.security);
6990
7170
  const farmDocsPrecompiledManifest = _optionalChain([config, 'access', _138 => _138.docs, 'optionalAccess', _139 => _139.enabled]) && _chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset) === "edge" ? await _chunk2RSVYJT6cjs._runWithFarmCspNonce.call(void 0,
6991
7171
  farmDocsCspNonceMarker,
6992
- async () => _optionalChain([config, 'access', _140 => _140.docs, 'access', _141 => _141.adapter, 'optionalAccess', _142 => _142.server]) ? await _chunkXGS76V7Lcjs.compileFarmDocsAdapterEdgeManifest.call(void 0, config.docs, {
7172
+ async () => _optionalChain([config, 'access', _140 => _140.docs, 'access', _141 => _141.adapter, 'optionalAccess', _142 => _142.server]) ? await _chunkE3HBD2K3cjs.compileFarmDocsAdapterEdgeManifest.call(void 0, config.docs, {
6993
7173
  root,
6994
7174
  srcDir: config.srcDir,
6995
7175
  clientEntry: FARM_CLIENT_JS_SRC_PLACEHOLDER,
@@ -7049,7 +7229,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
7049
7229
  (image) => image.sourceType === "module"
7050
7230
  );
7051
7231
  const externalMetadataImageRuntime = useExternalMetadataImageRuntime && !omitCoreMetadataImageRuntime ? ["@vercel/og"] : [];
7052
- const rendererOptionalExternals = _chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) ? [] : [
7232
+ const rendererOptionalExternals = _chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, config.renderer) ? [] : [
7053
7233
  "react",
7054
7234
  "react/jsx-runtime",
7055
7235
  "react/jsx-dev-runtime",
@@ -7156,7 +7336,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
7156
7336
  __FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _148 => _148.env, 'optionalAccess', _149 => _149.public]) || {})
7157
7337
  },
7158
7338
  plugins: [
7159
- _chunkHVMQAVZKcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
7339
+ _chunkCL7BUGVBcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
7160
7340
  ...tailwindVitePlugin ? [tailwindVitePlugin] : [],
7161
7341
  ...rendererVitePlugins,
7162
7342
  ...config.vite.plugins || [],
@@ -7178,6 +7358,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
7178
7358
  ] : [],
7179
7359
  { ..._chunkNG2EZ6QScjs.createReactProductionModePlugin.call(void 0, ), enforce: "pre" },
7180
7360
  farmServerOnlyEntriesPlugin({ distDir: config.distDir || ".farm" }),
7361
+ farmNavigationPlugin(config.renderer),
7181
7362
  farmIslandContainersPlugin(config),
7182
7363
  farmPlugin(
7183
7364
  {
@@ -7187,7 +7368,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
7187
7368
  },
7188
7369
  pluginManager
7189
7370
  ),
7190
- _chunkODYKCC6Wcjs.farmEnvironmentFunctionsPlugin.call(void 0, config),
7371
+ _chunk46UV2E7Icjs.farmEnvironmentFunctionsPlugin.call(void 0, config),
7191
7372
  ...hasRuntimeConfigModule ? [
7192
7373
  farmStripPlatformConfigPlugin(
7193
7374
  [
@@ -7199,7 +7380,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
7199
7380
  {
7200
7381
  name: "farm-virtual-ssr-entry",
7201
7382
  resolveId: {
7202
- filter: { id: _chunkHVMQAVZKcjs.exactIdPattern.call(void 0, [virtualEntryId, "\0virtual:farm-ssr-entry"]) },
7383
+ filter: { id: _chunkCL7BUGVBcjs.exactIdPattern.call(void 0, [virtualEntryId, "\0virtual:farm-ssr-entry"]) },
7203
7384
  handler(id) {
7204
7385
  if (id === virtualEntryId || id === "\0virtual:farm-ssr-entry") {
7205
7386
  return virtualEntryId;
@@ -7208,7 +7389,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
7208
7389
  }
7209
7390
  },
7210
7391
  load: {
7211
- filter: { id: _chunkHVMQAVZKcjs.exactIdPattern.call(void 0, [virtualEntryId]) },
7392
+ filter: { id: _chunkCL7BUGVBcjs.exactIdPattern.call(void 0, [virtualEntryId]) },
7212
7393
  handler(id) {
7213
7394
  if (id === virtualEntryId) {
7214
7395
  return virtualEntryCode;
@@ -7240,7 +7421,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
7240
7421
  resolve: {
7241
7422
  alias: [
7242
7423
  ...shouldAliasReactServerToWebBuild(config.renderer, preset) ? [createFarmReactWebServerAlias(hasReactDomEdgeServerBuild(root))] : [],
7243
- ...Object.entries(_chunkHVMQAVZKcjs.createFarmSourceAlias.call(void 0, root, config.srcDir)).map(
7424
+ ...Object.entries(_chunkCL7BUGVBcjs.createFarmSourceAlias.call(void 0, root, config.srcDir)).map(
7244
7425
  ([find, replacement]) => ({ find, replacement })
7245
7426
  )
7246
7427
  ],
@@ -7248,7 +7429,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
7248
7429
  dedupe: [...config.renderer.dedupe || []]
7249
7430
  }
7250
7431
  };
7251
- await viteBuild(_chunkHVMQAVZKcjs.mergeFarmProductionViteConfig.call(void 0, serverViteConfig, config.vite));
7432
+ await viteBuild(_chunkCL7BUGVBcjs.mergeFarmProductionViteConfig.call(void 0, serverViteConfig, config.vite));
7252
7433
  } finally {
7253
7434
  if (postcssConfigDir) {
7254
7435
  try {
@@ -7290,9 +7471,9 @@ function getFarmDocsGuardedPaths(config, middlewareRoutes) {
7290
7471
  config: { middleware: config.middleware, integrations: config.integrations },
7291
7472
  middlewareRoutes
7292
7473
  };
7293
- return _chunk6D3CJFNUcjs.getFarmDocsRoots.call(void 0, config.docs).flatMap(
7294
- (docsRoot) => _chunk6D3CJFNUcjs.discoverFarmDocsPages.call(void 0, _chunk6D3CJFNUcjs.resolveFarmDocsContentDir.call(void 0, docsRoot, options), docsRoot)
7295
- ).flatMap((page) => [page.href, _chunk6D3CJFNUcjs.getFarmDocsMarkdownPath.call(void 0, page.href)]).filter((pathname) => _chunk6ZFGWB75cjs.farmPathGuardCoversPage.call(void 0, guards, pathname));
7474
+ return _chunkHR5GU4UUcjs.getFarmDocsRoots.call(void 0, config.docs).flatMap(
7475
+ (docsRoot) => _chunkHR5GU4UUcjs.discoverFarmDocsPages.call(void 0, _chunkHR5GU4UUcjs.resolveFarmDocsContentDir.call(void 0, docsRoot, options), docsRoot)
7476
+ ).flatMap((page) => [page.href, _chunkHR5GU4UUcjs.getFarmDocsMarkdownPath.call(void 0, page.href)]).filter((pathname) => _chunkOFVCWV2Dcjs.farmPathGuardCoversPage.call(void 0, guards, pathname));
7296
7477
  }
7297
7478
  function getFarmAppOwnedDocsEnginePaths(agent, applicationMetadataRoutes) {
7298
7479
  const llmsTxt = _optionalChain([agent, 'optionalAccess', _152 => _152.llmsTxt]);
@@ -7682,23 +7863,24 @@ async function applyFarmPreloadBudget(response, pathname, request) {
7682
7863
  `.trim();
7683
7864
  }
7684
7865
  function generateFarmRendererAppSetupServerCode(config) {
7685
- const appSetupPath = _chunk67MZTLTFcjs.resolveFarmRendererAppSetup.call(void 0, config.root || process.cwd(), config.renderer);
7866
+ const appSetupPath = _chunkM6DAIE4Tcjs.resolveFarmRendererAppSetup.call(void 0, config.root || process.cwd(), config.renderer);
7686
7867
  if (!appSetupPath) return "";
7687
7868
  return `
7688
- import __farmAppSetup from ${JSON.stringify(_chunkGC5ROI3Acjs.toPosixPath.call(void 0, appSetupPath))};
7869
+ import __farmAppSetup from ${JSON.stringify(_chunk7U4XF76Rcjs.toPosixPath.call(void 0, appSetupPath))};
7689
7870
  if (typeof ReactDOMServer.configureApp !== "function") {
7690
7871
  throw new Error(${JSON.stringify(`Renderer \`${config.renderer.name}\` does not support \`appSetup\`: its server module must export configureApp().`)});
7691
7872
  }
7692
7873
  ReactDOMServer.configureApp(__farmAppSetup);`;
7693
7874
  }
7694
7875
  function generateVirtualEntryCode(apiRoutes, pageRoutes, layoutRoutes, routeSlots, errorRoutes, metadataImageRoutes, applicationMetadataRoutes, middlewareRoutes, redirectRoutes, configuredRewriteRoutes, configuredHeaderRoutes, openAPIReference, notFoundPath, instrumentationPath, config, farmDocsPrecompiledManifest, configModulePath, hasServerRuntimeIntegrations, hasRuntimeIntegrationConfig, hasConfiguredRuntimePlugins, hasServerRuntimePlugins, preset, i18nCatalogs, isolatedClientBoundaryModules, hydrationPlanCache, mobileShellLoadingRoutes = [], farmDocsAnalyticsPages = []) {
7695
- const farmRendererDisabled = _chunk67MZTLTFcjs.isFarmRendererDisabled.call(void 0, config.renderer);
7876
+ const farmRendererDisabled = _chunkM6DAIE4Tcjs.isFarmRendererDisabled.call(void 0, config.renderer);
7696
7877
  const searchPreserveRoutes = pageRoutes.flatMap(
7697
7878
  (route) => route.searchPreserve ? [route.searchPreserve] : []
7698
7879
  );
7699
7880
  const searchPreserveRoutesSource = searchPreserveRoutes.length > 0 ? JSON.stringify(searchPreserveRoutes) : "";
7700
7881
  const farmIslandsMode = _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _166 => _166.experimental, 'optionalAccess', _167 => _167.serverComponents])) === "islands";
7701
- const farmClientBoot = _chunkHVMQAVZKcjs.canBootFarmIslandsClient.call(void 0, config);
7882
+ const farmRendererActions = _chunkCL7BUGVBcjs.resolveFarmIslxActionsMode.call(void 0, config) === "renderer";
7883
+ const farmClientBoot = _chunkCL7BUGVBcjs.canBootFarmIslandsClient.call(void 0, config);
7702
7884
  const farmMobileClient = shouldBuildFarmMobileClient(config);
7703
7885
  const farmMobileShells = farmMobileClient && config.mobileShells ? config.mobileShells : null;
7704
7886
  const hasCompressionRuntime = config.compress && _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) === "nodejs";
@@ -7708,13 +7890,13 @@ function generateVirtualEntryCode(apiRoutes, pageRoutes, layoutRoutes, routeSlot
7708
7890
  const servesAgentSitemap = Boolean(_optionalChain([config, 'access', _171 => _171.agent, 'optionalAccess', _172 => _172.sitemap, 'optionalAccess', _173 => _173.enabled])) && !applicationMetadataRoutes.some(
7709
7891
  (metadata) => metadata.kind === "sitemap" && metadata.pattern === "/"
7710
7892
  );
7711
- const servesDefaultMCP = _optionalChain([config, 'access', _174 => _174.agent, 'optionalAccess', _175 => _175.mcp]) === true && !_chunkYRXPDKMMcjs.farmConfigMountsMCP.call(void 0, config) && !apiRoutes.some((route) => route.path === "/api/mcp");
7893
+ const servesDefaultMCP = _optionalChain([config, 'access', _174 => _174.agent, 'optionalAccess', _175 => _175.mcp]) === true && !_chunkW53Z4WDIcjs.farmConfigMountsMCP.call(void 0, config) && !apiRoutes.some((route) => route.path === "/api/mcp");
7712
7894
  const servesAiCatalog = _optionalChain([config, 'access', _176 => _176.agent, 'optionalAccess', _177 => _177.aiCatalog]) !== false;
7713
7895
  const hasPluginRuntime = hasRuntimeIntegrationConfig || hasServerRuntimePlugins;
7714
7896
  const hasInfraAnalyticsRuntime = config.analytics !== false && _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) === "nodejs";
7715
7897
  const hasPrecompiledDocs = Boolean(farmDocsPrecompiledManifest);
7716
7898
  const adapterOwnsDocsRuntime = Boolean(
7717
- _chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _178 => _178.docs, 'optionalAccess', _179 => _179.enabled]) && _optionalChain([config, 'access', _180 => _180.docs, 'access', _181 => _181.adapter, 'optionalAccess', _182 => _182.server]) && config.docs.adapter.react
7899
+ _chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _178 => _178.docs, 'optionalAccess', _179 => _179.enabled]) && _optionalChain([config, 'access', _180 => _180.docs, 'access', _181 => _181.adapter, 'optionalAccess', _182 => _182.server]) && config.docs.adapter.react
7718
7900
  );
7719
7901
  if (_optionalChain([config, 'access', _183 => _183.docs, 'optionalAccess', _184 => _184.enabled]) && _optionalChain([config, 'access', _185 => _185.docs, 'access', _186 => _186.roots, 'optionalAccess', _187 => _187.length]) && !adapterOwnsDocsRuntime) {
7720
7902
  throw new Error(
@@ -7723,15 +7905,23 @@ function generateVirtualEntryCode(apiRoutes, pageRoutes, layoutRoutes, routeSlot
7723
7905
  }
7724
7906
  const docsConfigModulePath = adapterOwnsDocsRuntime && !hasPrecompiledDocs && config.docs.configPath && !config.docs.configPath.endsWith(".json") ? config.docs.configPath : void 0;
7725
7907
  const adapterHandler = generateFarmDocsAdapterHandlerArguments(config.docs, docsConfigModulePath);
7726
- const hasIsolatedClientGraphRuntime = _chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) && isolatedClientBoundaryModules.size > 0;
7727
- const rendererStreamingCapabilities = _chunk67MZTLTFcjs.getFarmRendererStreamingCapabilitiesForRuntime.call(void 0,
7908
+ const hasIsolatedClientGraphRuntime = _chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, config.renderer) && isolatedClientBoundaryModules.size > 0;
7909
+ const rendererStreamingCapabilities = _chunkM6DAIE4Tcjs.getFarmRendererStreamingCapabilitiesForRuntime.call(void 0,
7728
7910
  config.renderer,
7729
7911
  _chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset)
7730
7912
  );
7731
- const hasReactSyncRender = _chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer);
7732
- const rendererServerImports = _chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) ? `import * as React from "react";
7913
+ const hasReactSyncRender = _chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, config.renderer);
7914
+ const rendererServerImports = _chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, config.renderer) ? `import * as React from "react";
7733
7915
  import * as ReactDOMServer from "react-dom/server";
7734
- import { markPagePosition, markLayoutPosition } from "@farm.js/core/internal/production-runtime";${hasIsolatedClientGraphRuntime ? farmIslandsMode ? '\nimport { isolateFarmServerPageGraph, wrapFarmIsolatedClientGraph, renderFarmServerTreePage, renderFarmServerTreeLayout, withFarmIslandsRender } from "@farm.js/core/internal/islands-runtime";' : '\nimport { isolateFarmServerPageGraph, wrapFarmIsolatedClientGraph } from "@farm.js/core/internal/isolated-boundary";\nimport { renderFarmServerTreePage } from "@farm.js/core/internal/server-tree";' : ""}` : `import React, * as ReactDOMServer from ${JSON.stringify(config.renderer.server)};${generateFarmRendererAppSetupServerCode(config)}`;
7916
+ import { markPagePosition, markLayoutPosition } from "@farm.js/core/internal/production-runtime";${hasIsolatedClientGraphRuntime ? farmIslandsMode ? '\nimport { isolateFarmServerPageGraph, wrapFarmIsolatedClientGraph, renderFarmServerTreePage, renderFarmServerTreeLayout, withFarmIslandsRender } from "@farm.js/core/internal/islands-runtime";' : '\nimport { isolateFarmServerPageGraph, wrapFarmIsolatedClientGraph } from "@farm.js/core/internal/isolated-boundary";\nimport { renderFarmServerTreePage } from "@farm.js/core/internal/server-tree";' : ""}` : (
7917
+ // The renderer contract is the server module's named exports, which the development
7918
+ // server reads too; a renderer needs no default export. The entry feature-checks optional
7919
+ // exports (streaming, `capabilities`, `generateHydrationScript`) on a copy of the
7920
+ // namespace, because Rolldown warns about each such read off the namespace itself.
7921
+ `import * as __farmRendererServer from ${JSON.stringify(config.renderer.server)};
7922
+ const ReactDOMServer = { ...__farmRendererServer };
7923
+ const React = ReactDOMServer;${generateFarmRendererAppSetupServerCode(config)}`
7924
+ );
7735
7925
  const routeClientGraphServerRuntime = hasIsolatedClientGraphRuntime ? `function wrapFarmRouteClientGraph(element) {
7736
7926
  return wrapFarmIsolatedClientGraph(React, element);
7737
7927
  }
@@ -7767,18 +7957,18 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7767
7957
  (image) => image.sourceType === "module"
7768
7958
  );
7769
7959
  const edgeMiddlewareFilePaths = farmTargetRunsEdgeMiddleware(preset) ? middlewareRoutes.filter(isFarmEdgeMiddlewareRoute).map((route) => route.filePath) : [];
7770
- const hasMiddlewareRuntime = middlewareRoutes.length > 0 || _chunk6ZFGWB75cjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
7960
+ const hasMiddlewareRuntime = middlewareRoutes.length > 0 || _chunkOFVCWV2Dcjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
7771
7961
  const farmDocsFontAssets = _optionalChain([config, 'access', _188 => _188.docs, 'optionalAccess', _189 => _189.enabled]) ? _chunkERMUL73Lcjs.toFarmDocsPublicFontAssets.call(void 0, _chunkERMUL73Lcjs.resolveFarmDocsFontAssets.call(void 0, config.root)) : [];
7772
- const integrationProviders = _chunkAOTD2N5Pcjs.getIntegrationProviders.call(void 0, config.integrations);
7962
+ const integrationProviders = _chunkWGWWRV2Mcjs.getIntegrationProviders.call(void 0, config.integrations);
7773
7963
  const renderedIntegrationProviders = integrationProviders.filter(
7774
7964
  (provider) => provider.component || provider.type === "clerk"
7775
7965
  );
7776
- if (renderedIntegrationProviders.length > 0 && !_chunk67MZTLTFcjs.getFarmRendererCapabilities.call(void 0, config.renderer).functionComponents) {
7966
+ if (renderedIntegrationProviders.length > 0 && !_chunkM6DAIE4Tcjs.getFarmRendererCapabilities.call(void 0, config.renderer).functionComponents) {
7777
7967
  throw new Error(
7778
7968
  `Integration provider components are not supported by the "${config.renderer.name}" renderer.`
7779
7969
  );
7780
7970
  }
7781
- const providerServerModules = _chunkHVMQAVZKcjs.generateFarmIntegrationProviderServerModules.call(void 0,
7971
+ const providerServerModules = _chunkCL7BUGVBcjs.generateFarmIntegrationProviderServerModules.call(void 0,
7782
7972
  renderedIntegrationProviders,
7783
7973
  config.root,
7784
7974
  _nullishCoalesce(config.renderer.componentExtensions, () => ( []))
@@ -7798,14 +7988,14 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7798
7988
  const unsupportedIntegrationProvider = renderedIntegrationProviders.find(
7799
7989
  (provider) => provider.supportsIsolatedHydration !== true
7800
7990
  );
7801
- const isolatedHydrationMode = _chunkODYKCC6Wcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
7991
+ const isolatedHydrationMode = _chunk46UV2E7Icjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
7802
7992
  _optionalChain([config, 'access', _192 => _192.experimental, 'optionalAccess', _193 => _193.isolatedClientHydration]),
7803
7993
  {
7804
7994
  serverComponents: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _194 => _194.experimental, 'optionalAccess', _195 => _195.serverComponents])) === "rsc",
7805
7995
  hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
7806
7996
  }
7807
7997
  );
7808
- const hydrationPlanOptions = _chunkODYKCC6Wcjs.getFarmClientHydrationPlanOptions.call(void 0,
7998
+ const hydrationPlanOptions = _chunk46UV2E7Icjs.getFarmClientHydrationPlanOptions.call(void 0,
7809
7999
  config.renderer,
7810
8000
  Boolean(unsupportedIntegrationProvider)
7811
8001
  );
@@ -7813,7 +8003,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7813
8003
  ...hydrationPlanOptions,
7814
8004
  serverOwners: _chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _196 => _196.experimental, 'optionalAccess', _197 => _197.serverComponents])) === "islands"
7815
8005
  };
7816
- const { layoutHydrationPlans, pageHydrationPlans } = _chunkODYKCC6Wcjs.withFarmSourceSnapshot.call(void 0, () => {
8006
+ const { layoutHydrationPlans, pageHydrationPlans } = _chunk46UV2E7Icjs.withFarmSourceSnapshot.call(void 0, () => {
7817
8007
  const layoutHydrationPlans2 = layoutRoutes.map((layout) => ({
7818
8008
  ...layout,
7819
8009
  hydration: getCachedClientModuleHydrationPlan(
@@ -7824,7 +8014,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7824
8014
  { ...hydrationPlanOptions, serverTreeLayouts: pageHydrationPlanOptions.serverOwners }
7825
8015
  )
7826
8016
  }));
7827
- const markdownPagePlan = _chunkODYKCC6Wcjs.createMarkdownPageHydrationPlanner.call(void 0,
8017
+ const markdownPagePlan = _chunk46UV2E7Icjs.createMarkdownPageHydrationPlanner.call(void 0,
7828
8018
  _chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, config.mdx), config.root),
7829
8019
  config.root,
7830
8020
  isolatedHydrationMode,
@@ -7833,7 +8023,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7833
8023
  const pageHydrationPlans2 = new Map(
7834
8024
  pageRoutes.map((route) => [
7835
8025
  route.modulePath,
7836
- _chunkPG7J7XYTcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
8026
+ _chunk26WP75W5cjs.isFarmMarkdownPageFile.call(void 0, route.modulePath) ? markdownPagePlan() : getCachedClientModuleHydrationPlan(
7837
8027
  route.modulePath,
7838
8028
  config.root,
7839
8029
  isolatedHydrationMode,
@@ -7844,7 +8034,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7844
8034
  );
7845
8035
  return { layoutHydrationPlans: layoutHydrationPlans2, pageHydrationPlans: pageHydrationPlans2 };
7846
8036
  });
7847
- _chunkODYKCC6Wcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
8037
+ _chunk46UV2E7Icjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
7848
8038
  layoutHydrationPlans.map((layout) => ({
7849
8039
  pattern: layout.pattern,
7850
8040
  depth: layout.pattern.split("/").filter(Boolean).length,
@@ -7853,10 +8043,10 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7853
8043
  pageRoutes.map((route) => ({
7854
8044
  // Compared by directory so a grouped layout applies only inside its group.
7855
8045
  pattern: _nullishCoalesce(route.directory, () => ( route.pattern)),
7856
- depth: _chunk6ZFGWB75cjs.getRouteDirectoryDepth.call(void 0, _nullishCoalesce(route.directory, () => ( route.pattern))),
8046
+ depth: _chunkOFVCWV2Dcjs.getRouteDirectoryDepth.call(void 0, _nullishCoalesce(route.directory, () => ( route.pattern))),
7857
8047
  metadata: pageHydrationPlans.get(route.modulePath)
7858
8048
  })),
7859
- _chunk6ZFGWB75cjs.routeBoundaryCoversDirectory,
8049
+ _chunkOFVCWV2Dcjs.routeBoundaryCoversDirectory,
7860
8050
  { serverOwners: pageHydrationPlanOptions.serverOwners }
7861
8051
  );
7862
8052
  const providerServerImports = [
@@ -7887,9 +8077,9 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7887
8077
  }).map(({ route }) => route);
7888
8078
  orderedPageRoutes.forEach((route, index) => {
7889
8079
  const varName = `pageRoute${index}`;
7890
- if (_chunkPG7J7XYTcjs.isFarmMarkdownPageFile.call(void 0, route.modulePath)) {
7891
- const renderingDirective2 = _chunkBZJYPIFZcjs.readRouteRenderingDirectiveFromFile.call(void 0, route.modulePath);
7892
- const markdownServerTree = pageHydrationPlanOptions.serverOwners && _chunkODYKCC6Wcjs.usesFarmServerTree.call(void 0, pageHydrationPlans.get(route.modulePath));
8080
+ if (_chunk26WP75W5cjs.isFarmMarkdownPageFile.call(void 0, route.modulePath)) {
8081
+ const renderingDirective2 = _chunkOUDNUFVRcjs.readRouteRenderingDirectiveFromFile.call(void 0, route.modulePath);
8082
+ const markdownServerTree = pageHydrationPlanOptions.serverOwners && _chunk46UV2E7Icjs.usesFarmServerTree.call(void 0, pageHydrationPlans.get(route.modulePath));
7893
8083
  pageRegistrations.push(`
7894
8084
  {
7895
8085
  pattern: ${JSON.stringify(route.pattern)},${route.directory ? `
@@ -7897,14 +8087,14 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7897
8087
  rendering: ${JSON.stringify(renderingDirective2)},` : ""}${markdownServerTree ? "\n serverTree: true," : ""}
7898
8088
  module: createFarmMarkdownRouteModule({
7899
8089
  source: ${JSON.stringify(_nullishCoalesce(route.source, () => ( "")))},
7900
- filePath: ${JSON.stringify(_chunkHVMQAVZKcjs.toBakedMarkdownSourcePath.call(void 0, config.root, route.modulePath))},
8090
+ filePath: ${JSON.stringify(_chunkCL7BUGVBcjs.toBakedMarkdownSourcePath.call(void 0, config.root, route.modulePath))},
7901
8091
  components: farmMdxComponents,
7902
- config: farmMdxConfig,
8092
+ config: farmMdxConfig,${_chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, config.renderer) ? "" : "\n renderer: React,"}
7903
8093
  }),
7904
8094
  markdownSource: {
7905
8095
  source: ${JSON.stringify(_nullishCoalesce(route.source, () => ( "")))},
7906
8096
  filePath: ${JSON.stringify(
7907
- _chunkHVMQAVZKcjs.toBakedMarkdownSourcePath.call(void 0, config.root, _nullishCoalesce(route.markdownSourcePath, () => ( route.modulePath)))
8097
+ _chunkCL7BUGVBcjs.toBakedMarkdownSourcePath.call(void 0, config.root, _nullishCoalesce(route.markdownSourcePath, () => ( route.modulePath)))
7908
8098
  )},
7909
8099
  },
7910
8100
  }`);
@@ -7914,16 +8104,16 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7914
8104
  `import * as ${varName} from ${toVirtualEntryImportSpecifier(route.modulePath)};`
7915
8105
  );
7916
8106
  const clientMetadata = pageHydrationPlans.get(route.modulePath);
7917
- const renderingDirective = _chunkBZJYPIFZcjs.readRouteRenderingDirectiveFromFile.call(void 0, route.modulePath);
8107
+ const renderingDirective = _chunkOUDNUFVRcjs.readRouteRenderingDirectiveFromFile.call(void 0, route.modulePath);
7918
8108
  pageRegistrations.push(`
7919
8109
  {
7920
8110
  pattern: ${JSON.stringify(route.pattern)},${route.directory ? `
7921
8111
  directory: ${JSON.stringify(route.directory)},` : ""}
7922
8112
  module: ${varName},
7923
8113
  shouldHydrate: ${JSON.stringify(clientMetadata.shouldHydrate)},${clientMetadata.shouldHydrate ? `
7924
- clientModule: ${JSON.stringify(_chunkGC5ROI3Acjs.toViteModuleId.call(void 0, route.modulePath, config.root))},` : ""}
7925
- islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${_chunkODYKCC6Wcjs.usesFarmServerTree.call(void 0, clientMetadata) ? "\n serverTree: true," : ""}${(() => {
7926
- const rootStrategy = _chunkHVMQAVZKcjs.resolveFarmRouteRootStrategy.call(void 0,
8114
+ clientModule: ${JSON.stringify(_chunk7U4XF76Rcjs.toViteModuleId.call(void 0, route.modulePath, config.root))},` : ""}
8115
+ islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${_chunk46UV2E7Icjs.usesFarmServerTree.call(void 0, clientMetadata) ? "\n serverTree: true," : ""}${(() => {
8116
+ const rootStrategy = _chunkCL7BUGVBcjs.resolveFarmRouteRootStrategy.call(void 0,
7927
8117
  route,
7928
8118
  clientMetadata,
7929
8119
  layoutHydrationPlans.map((layout) => ({ ...layout, ...layout.hydration })),
@@ -7936,13 +8126,13 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7936
8126
  rendering: ${JSON.stringify(renderingDirective)},` : ""}
7937
8127
  ${route.source !== void 0 ? `markdownSource: {
7938
8128
  source: ${JSON.stringify(route.source)},
7939
- filePath: ${JSON.stringify(_chunkHVMQAVZKcjs.toBakedMarkdownSourcePath.call(void 0, config.root, route.markdownSourcePath))},
8129
+ filePath: ${JSON.stringify(_chunkCL7BUGVBcjs.toBakedMarkdownSourcePath.call(void 0, config.root, route.markdownSourcePath))},
7940
8130
  },` : ""}
7941
8131
  }`);
7942
8132
  });
7943
8133
  const layoutImports = [];
7944
8134
  const layoutRegistrations = [];
7945
- const treeLayoutPatterns = farmIslandsMode ? _chunk6ZFGWB75cjs.getFarmServerTreeLayoutPatterns.call(void 0,
8135
+ const treeLayoutPatterns = farmIslandsMode ? _chunkOFVCWV2Dcjs.getFarmServerTreeLayoutPatterns.call(void 0,
7946
8136
  layoutHydrationPlans.map((layout) => ({
7947
8137
  pattern: layout.pattern,
7948
8138
  shouldHydrate: layout.hydration.shouldHydrate,
@@ -7960,7 +8150,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7960
8150
  pattern: ${JSON.stringify(layout.pattern)},
7961
8151
  module: ${varName},
7962
8152
  shouldHydrate: ${JSON.stringify(clientMetadata.shouldHydrate)},
7963
- islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${treeLayoutPatterns.has(layout.pattern) ? "\n serverTree: true," : ""}${farmIslandsMode && _chunkHVMQAVZKcjs.canFarmSkipKeptLayoutRender.call(void 0, layout.modulePath, config.root) ? "\n skipKeptRender: true," : ""}${// A layout whose client components hydrate as islands of their own (islands mode,
8153
+ islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${treeLayoutPatterns.has(layout.pattern) ? "\n serverTree: true," : ""}${farmIslandsMode && _chunkCL7BUGVBcjs.canFarmSkipKeptLayoutRender.call(void 0, layout.modulePath, config.root) ? "\n skipKeptRender: true," : ""}${// A layout whose client components hydrate as islands of their own (islands mode,
7964
8154
  // isolatedClientHydration, or an async layout): it wraps a docs page as an app page.
7965
8155
  clientMetadata.hasIsolatedClientBoundaries ? "\n islands: true," : ""}
7966
8156
  }`);
@@ -7988,7 +8178,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7988
8178
  containerId: ${JSON.stringify(slot.containerId)},
7989
8179
  interception: ${JSON.stringify(slot.interception)},
7990
8180
  fallback: ${JSON.stringify(slot.fallback)},
7991
- hydrates: ${!farmIslandsMode || _chunkODYKCC6Wcjs.getClientModuleMetadata.call(void 0, slot.modulePath, config.root).isClientComponent},
8181
+ hydrates: ${!farmIslandsMode || _chunk46UV2E7Icjs.getClientModuleMetadata.call(void 0, slot.modulePath, config.root).isClientComponent},
7992
8182
  module: ${varName},
7993
8183
  }`);
7994
8184
  });
@@ -7999,12 +8189,12 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
7999
8189
  errorImports.push(
8000
8190
  `import * as ${varName} from ${toVirtualEntryImportSpecifier(errorRoute.modulePath)};`
8001
8191
  );
8002
- const groupScope = _chunk6ZFGWB75cjs.getRouteGroupScope.call(void 0, errorRoute.pattern);
8192
+ const groupScope = _chunkOFVCWV2Dcjs.getRouteGroupScope.call(void 0, errorRoute.pattern);
8003
8193
  errorRegistrations.push(`
8004
8194
  {
8005
- pattern: ${JSON.stringify(_chunk6ZFGWB75cjs.stripRouteGroups.call(void 0, errorRoute.pattern))},${groupScope ? `
8195
+ pattern: ${JSON.stringify(_chunkOFVCWV2Dcjs.stripRouteGroups.call(void 0, errorRoute.pattern))},${groupScope ? `
8006
8196
  groupScope: ${JSON.stringify(groupScope)},
8007
- directoryDepth: ${_chunk6ZFGWB75cjs.getRouteDirectoryDepth.call(void 0, errorRoute.pattern)},` : ""}
8197
+ directoryDepth: ${_chunkOFVCWV2Dcjs.getRouteDirectoryDepth.call(void 0, errorRoute.pattern)},` : ""}
8008
8198
  module: ${varName},
8009
8199
  }`);
8010
8200
  });
@@ -8016,12 +8206,12 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
8016
8206
  loadingImports.push(
8017
8207
  `import * as ${varName} from ${toVirtualEntryImportSpecifier(loadingRoute.modulePath)};`
8018
8208
  );
8019
- const groupScope = _chunk6ZFGWB75cjs.getRouteGroupScope.call(void 0, loadingRoute.pattern);
8209
+ const groupScope = _chunkOFVCWV2Dcjs.getRouteGroupScope.call(void 0, loadingRoute.pattern);
8020
8210
  loadingRegistrations.push(`
8021
8211
  {
8022
- pattern: ${JSON.stringify(_chunk6ZFGWB75cjs.stripRouteGroups.call(void 0, loadingRoute.pattern))},${groupScope ? `
8212
+ pattern: ${JSON.stringify(_chunkOFVCWV2Dcjs.stripRouteGroups.call(void 0, loadingRoute.pattern))},${groupScope ? `
8023
8213
  groupScope: ${JSON.stringify(groupScope)},
8024
- directoryDepth: ${_chunk6ZFGWB75cjs.getRouteDirectoryDepth.call(void 0, loadingRoute.pattern)},` : ""}
8214
+ directoryDepth: ${_chunkOFVCWV2Dcjs.getRouteDirectoryDepth.call(void 0, loadingRoute.pattern)},` : ""}
8025
8215
  module: ${varName},
8026
8216
  }`);
8027
8217
  });
@@ -8034,12 +8224,13 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
8034
8224
  metadataImageImports.push(
8035
8225
  `import * as ${varName} from ${toVirtualEntryImportSpecifier(image.modulePath)};`
8036
8226
  );
8227
+ const component = !_chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, config.renderer) && _chunkCL7BUGVBcjs.isRendererCompiledComponent.call(void 0, image.modulePath, _nullishCoalesce(_optionalChain([config, 'access', _201 => _201.renderer, 'optionalAccess', _202 => _202.componentExtensions]), () => ( [])));
8037
8228
  metadataImageRegistrations.push(`
8038
8229
  {
8039
8230
  pattern: ${JSON.stringify(image.pattern)},
8040
8231
  kind: ${JSON.stringify(image.kind)},
8041
8232
  fileName: ${JSON.stringify(image.fileName)},
8042
- sourceType: "module",
8233
+ sourceType: "module",${component ? "\n component: true," : ""}
8043
8234
  module: ${varName},
8044
8235
  }`);
8045
8236
  return;
@@ -8108,7 +8299,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
8108
8299
  createDefaultErrorMarkup,
8109
8300
  createFarmInstrumentationLifecycle,
8110
8301
  createFarmLayoutSelector,
8111
- createFarmLayoutBoundary,${_optionalChain([config, 'access', _201 => _201.docs, 'optionalAccess', _202 => _202.enabled]) ? "\n createFarmDocsLayoutTree,\n farmDocsLayoutsWrapPage,\n placeFarmDocsLayoutRoot," : ""}
8302
+ createFarmLayoutBoundary,${_optionalChain([config, 'access', _203 => _203.docs, 'optionalAccess', _204 => _204.enabled]) ? "\n createFarmDocsLayoutTree,\n farmDocsLayoutsWrapPage,\n placeFarmDocsLayoutRoot," : ""}
8112
8303
  isInFarmRouteGroupScope,
8113
8304
  routeBoundaryCoversDirectory,
8114
8305
  createFarmCacheKey,
@@ -8191,7 +8382,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
8191
8382
  createFarmDeploymentMismatchResponse,
8192
8383
  FARM_DEPLOYMENT_ID_HEADER,
8193
8384
  getFarmDeploymentMismatch,
8194
- withoutFarmDeploymentCookie,${config.mobileClient ? "\n createFarmNativeTreeResponse," : ""}${config.trailingSlash && (_optionalChain([config, 'access', _203 => _203.md, 'optionalAccess', _204 => _204.enabled]) || hasMarkdownPages) ? "\n toFarmTrailingSlashPageRequest," : ""}${hasInfraAnalyticsRuntime ? "\n resolveFarmDocsEngineRouteLabel,\n resolveFarmDocsRouteLabel,\n resolveFarmMarkdownRouteLabel,\n resolveFarmMCPRouteLabel,\n setFarmRouteLabel," : ""}${hasFarmServerStorageConfig(config.storage) ? "\n _registerFarmStorageModules,\n disposeFarmStorage,\n initFarmStorage," : ""}${searchPreserveRoutesSource ? "\n _setFarmSearchPreserveRoutes," : ""}
8385
+ withoutFarmDeploymentCookie,${config.mobileClient ? "\n createFarmNativeTreeResponse," : ""}${config.trailingSlash && (_optionalChain([config, 'access', _205 => _205.md, 'optionalAccess', _206 => _206.enabled]) || hasMarkdownPages) ? "\n toFarmTrailingSlashPageRequest," : ""}${hasInfraAnalyticsRuntime ? "\n resolveFarmDocsEngineRouteLabel,\n resolveFarmDocsRouteLabel,\n resolveFarmMarkdownRouteLabel,\n resolveFarmMCPRouteLabel,\n setFarmRouteLabel," : ""}${hasFarmServerStorageConfig(config.storage) ? "\n _registerFarmStorageModules,\n disposeFarmStorage,\n initFarmStorage," : ""}${searchPreserveRoutesSource ? "\n _setFarmSearchPreserveRoutes," : ""}
8195
8386
  } from "@farm.js/core/internal/production-runtime";${farmMobileClient ? `
8196
8387
  import { _applyFarmMobileShellClient } from "@farm.js/core/internal/production-runtime";
8197
8388
  // The mobile client documents load when a mobile shell asks for them (RFC 0004, 7.2), filled in
@@ -8250,35 +8441,38 @@ import { installFarmIslandsServer } from "@farm.js/core/internal/islands-server"
8250
8441
  installFarmIslandsServer();
8251
8442
  const farmFormActionsConfig = ${JSON.stringify(_chunkXRFGOYXGcjs.resolveServerActionsConfig.call(void 0, config.serverActions))};
8252
8443
  installFarmIslandValues();
8253
- ${islandsActionKeyCode()}
8254
- ${FARM_SEGMENT_NAVIGATION_SERVER_RUNTIME}` : `
8444
+ ${islandsActionKeyCode("@farm.js/core/internal/islx-server")}
8445
+ ${FARM_SEGMENT_NAVIGATION_SERVER_RUNTIME}` : `${farmRendererActions ? `
8446
+ import { handleFarmFormActionRequest } from "@farm.js/core/internal/production-runtime";
8447
+ const farmFormActionsConfig = ${JSON.stringify(_chunkXRFGOYXGcjs.resolveServerActionsConfig.call(void 0, config.serverActions))};
8448
+ ${islandsActionKeyCode("@farm.js/core/internal/islx-actions-server")}` : ""}
8255
8449
  function farmFormState() { return undefined; }
8256
8450
  function farmFormStateScript() { return ""; }`}`;
8257
8451
  const productionSiteTelemetryImport = config.telemetry ? `import { createFarmProductionSiteReporter } from "@farm.js/core/internal/product-telemetry-runtime";` : "";
8258
- const metadataImageRuntimeImport = hasGeneratedMetadataImages ? `import { createFarmMetadataImageResponse } from "@farm.js/core/internal/metadata-image-runtime";` : "";
8452
+ const metadataImageRuntimeImport = hasGeneratedMetadataImages ? `import { createFarmMetadataImageResponse, resolveFarmMetadataImageValue } from "@farm.js/core/internal/metadata-image-runtime";` : "";
8259
8453
  const pluginRuntimeImport = hasPluginRuntime ? `import { PluginManager } from "@farm.js/core/plugin";` : "";
8260
8454
  const infraAnalyticsImport = hasInfraAnalyticsRuntime ? `import { ${hasPluginRuntime ? "createFarmInfraAnalyticsPlugin" : "createFarmInfraAnalyticsRecorder"} } from "@farm.js/core/internal/infra-analytics-runtime";` : "";
8261
8455
  const compressionRuntimeImport = hasCompressionRuntime ? `import { compressFarmResponse${hasPluginRuntime ? ", createCompressionPlugin" : ""} } from "@farm.js/core/internal/compression-runtime";` : "";
8262
8456
  const i18nServerImport = config.i18n.enabled ? `import { _runWithFarmI18nRequest, _setDefaultFarmI18nRuntime, createFarmI18nRuntime, getFarmI18nClientSnapshot } from "@farm.js/core/i18n/server";` : "";
8263
- const docsHandlerImport = _optionalChain([config, 'access', _205 => _205.docs, 'optionalAccess', _206 => _206.enabled]) ? hasPrecompiledDocs ? `import { createFarmDocsPrecompiledRuntime } from "@farm.js/core/internal/docs-precompiled-runtime";
8457
+ const docsHandlerImport = _optionalChain([config, 'access', _207 => _207.docs, 'optionalAccess', _208 => _208.enabled]) ? hasPrecompiledDocs ? `import { createFarmDocsPrecompiledRuntime } from "@farm.js/core/internal/docs-precompiled-runtime";
8264
8458
  const isFarmDocsAPIRequest = (requestOrPathname) => {
8265
8459
  const pathname = typeof requestOrPathname === "string"
8266
8460
  ? requestOrPathname
8267
8461
  : new URL(requestOrPathname.url).pathname;
8268
- const apiPath = ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _207 => _207.apiPath]) || "/api/docs")};
8462
+ const apiPath = ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _209 => _209.apiPath]) || "/api/docs")};
8269
8463
  return pathname === apiPath || pathname.startsWith(apiPath + "/");
8270
8464
  };` : adapterOwnsDocsRuntime ? `import { ${docsConfigModulePath ? "getFarmDocsConfigModuleRoot, " : ""}isFarmDocsAPIRequest } from "@farm.js/core/docs";
8271
- import { ${_optionalChain([config, 'access', _208 => _208.docs, 'access', _209 => _209.roots, 'optionalAccess', _210 => _210.length]) ? "createFarmDocsMultiRuntimeHandler as createFarmDocsAdapterMultiRuntimeHandler" : "createFarmDocsRuntimeHandler as createFarmDocsAdapterRuntimeHandler"} } from ${JSON.stringify(config.docs.adapter.server)};
8465
+ import { ${_optionalChain([config, 'access', _210 => _210.docs, 'access', _211 => _211.roots, 'optionalAccess', _212 => _212.length]) ? "createFarmDocsMultiRuntimeHandler as createFarmDocsAdapterMultiRuntimeHandler" : "createFarmDocsRuntimeHandler as createFarmDocsAdapterRuntimeHandler"} } from ${JSON.stringify(config.docs.adapter.server)};
8272
8466
  import * as FarmDocsAdapterReact from ${JSON.stringify(config.docs.adapter.react)};${docsConfigModulePath ? `
8273
8467
  import * as farmDocsConfigModule from ${toVirtualEntryImportSpecifier(docsConfigModulePath)};` : ""}` : `import { createFarmDocsAPIHandler, createFarmDocsHandler, isFarmDocsAPIRequest } from "@farm.js/core/docs";` : "";
8274
- const docsFontImport = _optionalChain([config, 'access', _211 => _211.docs, 'optionalAccess', _212 => _212.enabled]) && !hasPrecompiledDocs ? `import { resolveFarmLayoutFonts } from "@farm.js/core/font";` : "";
8275
- const docsRuntimeImport = _optionalChain([config, 'access', _213 => _213.docs, 'optionalAccess', _214 => _214.enabled]) && !hasPrecompiledDocs ? `import { existsSync as farmDocsExistsSync } from "node:fs";
8468
+ const docsFontImport = _optionalChain([config, 'access', _213 => _213.docs, 'optionalAccess', _214 => _214.enabled]) && !hasPrecompiledDocs ? `import { resolveFarmLayoutFonts } from "@farm.js/core/font";` : "";
8469
+ const docsRuntimeImport = _optionalChain([config, 'access', _215 => _215.docs, 'optionalAccess', _216 => _216.enabled]) && !hasPrecompiledDocs ? `import { existsSync as farmDocsExistsSync } from "node:fs";
8276
8470
  import { dirname as farmDocsDirname, join as farmDocsJoin } from "node:path";
8277
8471
  import { fileURLToPath as farmDocsFileURLToPath } from "node:url";` : "";
8278
- const markdownHandlerImport = _optionalChain([config, 'access', _215 => _215.md, 'optionalAccess', _216 => _216.enabled]) ? `import { applyMarkdownNegotiationHeaders, createMarkdownMirrorResponse, getFarmMarkdownAlternatePath } from "@farm.js/core/markdown";` : "";
8472
+ const markdownHandlerImport = _optionalChain([config, 'access', _217 => _217.md, 'optionalAccess', _218 => _218.enabled]) ? `import { applyMarkdownNegotiationHeaders, createMarkdownMirrorResponse, getFarmMarkdownAlternatePath } from "@farm.js/core/markdown";` : "";
8279
8473
  const appMarkdownImport = hasMarkdownPages ? `import { FARM_MARKDOWN_ANONYMOUS_CLIENT_ADDRESS, createFarmMarkdownRouteModule, createFarmMarkdownSourceResponse, isFarmMarkdownPublicSourceResponse } from "@farm.js/core/internal/app-markdown-runtime";` : "const createFarmMarkdownSourceResponse = null;\nconst isFarmMarkdownPublicSourceResponse = null;";
8280
8474
  const markdownErrorImport = `import { FARM_MARKDOWN_CONTENT_TYPE, FARM_MARKDOWN_PAGE_CHECK_HEADER, _isFarmMarkdownPageCheck, createFarmMarkdownErrorBody, farmRequestWantsMarkdown } from "@farm.js/core/markdown";`;
8281
- const mdxComponentsPath = typeof _optionalChain([config, 'access', _217 => _217.mdx, 'optionalAccess', _218 => _218.components]) === "string" ? _path2.default.isAbsolute(config.mdx.components) ? config.mdx.components : _path2.default.join(config.root, config.mdx.components) : null;
8475
+ const mdxComponentsPath = typeof _optionalChain([config, 'access', _219 => _219.mdx, 'optionalAccess', _220 => _220.components]) === "string" ? _path2.default.isAbsolute(config.mdx.components) ? config.mdx.components : _path2.default.join(config.root, config.mdx.components) : null;
8282
8476
  const mdxComponentsImport = mdxComponentsPath ? `import * as FarmMdxComponentsModule from ${toVirtualEntryImportSpecifier(mdxComponentsPath)};` : "";
8283
8477
  const layerConfigPaths = (config.layers || []).map((layer) => layer.configFile).filter((configFile) => Boolean(configFile)).filter((configFile) => configFile !== configModulePath);
8284
8478
  const layerConfigImports = layerConfigPaths.map(
@@ -8298,14 +8492,14 @@ import { fileURLToPath as farmDocsFileURLToPath } from "node:url";` : "";
8298
8492
  const nativeAuth = generateNativeAuthIntegrationSource(config.auth);
8299
8493
  const nativeMCP = _chunkVM57CK74cjs.generateNativeMCPPluginSource.call(void 0, config.mcp);
8300
8494
  const mobileSession = (config.plugins || []).some(
8301
- (plugin) => _optionalChain([plugin, 'optionalAccess', _219 => _219.name]) === _chunkIWGGRXD2cjs.FARM_MOBILE_SESSION_PLUGIN
8495
+ (plugin) => _optionalChain([plugin, 'optionalAccess', _221 => _221.name]) === _chunkMHKPXX3Jcjs.FARM_MOBILE_SESSION_PLUGIN
8302
8496
  );
8303
8497
  const nativeServerFns = (config.plugins || []).some(
8304
- (plugin) => _optionalChain([plugin, 'optionalAccess', _220 => _220.name]) === _chunk4EBC7EMWcjs.FARM_NATIVE_SERVER_FN_PLUGIN
8305
- ) ? _chunkLJKTJNOFcjs.collectFarmNativeServerFns.call(void 0, {
8498
+ (plugin) => _optionalChain([plugin, 'optionalAccess', _222 => _222.name]) === _chunk4EBC7EMWcjs.FARM_NATIVE_SERVER_FN_PLUGIN
8499
+ ) ? _chunkXOGCNKB7cjs.collectFarmNativeServerFns.call(void 0, {
8306
8500
  root: config.root,
8307
8501
  srcDir: config.srcDir,
8308
- entries: _chunkLJKTJNOFcjs.findFarmNativeScreenFiles.call(void 0, _chunkQMR2TUVZcjs.getFarmAppDirectories.call(void 0, config))
8502
+ entries: _chunkXOGCNKB7cjs.findFarmNativeScreenFiles.call(void 0, _chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, config))
8309
8503
  }) : void 0;
8310
8504
  const integrationImports = `
8311
8505
  ${configModulePath ? `import * as FarmUserConfigModule from ${toVirtualEntryImportSpecifier(configModulePath)};` : ""}
@@ -8320,7 +8514,7 @@ ${nativeServerFns ? `const __farmNativeServerFnRegistry = Object.assign(Object.c
8320
8514
  ${nativeServerFns.flatMap((module, index) => module.exports.map((entry) => ` ${JSON.stringify(entry.id)}: __farmNativeServerFns${index}[${JSON.stringify(entry.name)}],`)).join("\n")}
8321
8515
  });` : ""}
8322
8516
  `;
8323
- const imageRuntime = _chunkHVMQAVZKcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
8517
+ const imageRuntime = _chunkCL7BUGVBcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
8324
8518
  const imageRuntimeImport = imageRuntime === "none" ? "" : `import { _withFarmImageSourceClientAddress, createCloudflareImageTransformer, createFarmImageHandler } from "@farm.js/core/image/server";`;
8325
8519
  const imageNodeRuntimeImport = imageRuntime === "node" ? `import { createNodeImageFetcher, createNodeImageUrlValidator, createSharpImageTransformer } from "@farm.js/core/image/sharp";` : "";
8326
8520
  const apiHandlerCode = apiRoutes.length > 0 ? `
@@ -8502,7 +8696,7 @@ const farmResolvedRuntimeConfig = Object.assign({}, ...farmRuntimeConfigs);
8502
8696
 
8503
8697
  function renderFarmDefault404Page() {
8504
8698
  return React.createElement(React.Fragment, null,
8505
- React.createElement("style", null, ${JSON.stringify(_chunkHVMQAVZKcjs.DEFAULT_NOT_FOUND_STYLES)}),
8699
+ React.createElement("style", null, ${JSON.stringify(_chunkCL7BUGVBcjs.DEFAULT_NOT_FOUND_STYLES)}),
8506
8700
  React.createElement("main", {
8507
8701
  className: "farm-default-not-found",
8508
8702
  "aria-labelledby": "farm-default-not-found-title",
@@ -8645,24 +8839,24 @@ const farmImageHandler = ${imageRuntime === "none" ? "null" : imageRuntime === "
8645
8839
  validateRemoteUrl: createNodeImageUrlValidator(${JSON.stringify(config.images)}),
8646
8840
  onError(error) { console.error("[Farm Image]", error); },
8647
8841
  })`};
8648
- const farmMarkdownConfig = ${JSON.stringify(config.md)};${_optionalChain([config, 'access', _221 => _221.md, 'optionalAccess', _222 => _222.enabled]) || hasMarkdownPages ? config.trailingSlash ? `
8842
+ const farmMarkdownConfig = ${JSON.stringify(config.md)};${_optionalChain([config, 'access', _223 => _223.md, 'optionalAccess', _224 => _224.enabled]) || hasMarkdownPages ? config.trailingSlash ? `
8649
8843
  // A Markdown mirror, and a page.md source's page check, read the page at the URL it answers at
8650
8844
  // ('/about/'), so the trailing-slash 308 never answers in its place.
8651
8845
  const toFarmMarkdownPageRequest = (request) => toFarmTrailingSlashPageRequest(request, true);` : `
8652
8846
  const toFarmMarkdownPageRequest = (request) => request;` : ""}
8653
- const farmLlmsTxtConfig = ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _223 => _223.agent, 'optionalAccess', _224 => _224.llmsTxt]), () => ( { enabled: false, include: [], exclude: [] })))};
8654
- ${_optionalChain([config, 'access', _225 => _225.agent, 'optionalAccess', _226 => _226.llmsTxt, 'optionalAccess', _227 => _227.enabled]) ? "const farmLlmsFullRenderer = createFarmLlmsFullRenderer({ revalidate: farmLlmsTxtConfig.revalidate });\n" : ""}${servesAgentRobotsTxt ? `const farmAgentCrawlers = ${JSON.stringify(config.agent.crawlers)};` : ""}
8847
+ const farmLlmsTxtConfig = ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _225 => _225.agent, 'optionalAccess', _226 => _226.llmsTxt]), () => ( { enabled: false, include: [], exclude: [] })))};
8848
+ ${_optionalChain([config, 'access', _227 => _227.agent, 'optionalAccess', _228 => _228.llmsTxt, 'optionalAccess', _229 => _229.enabled]) ? "const farmLlmsFullRenderer = createFarmLlmsFullRenderer({ revalidate: farmLlmsTxtConfig.revalidate });\n" : ""}${servesAgentRobotsTxt ? `const farmAgentCrawlers = ${JSON.stringify(config.agent.crawlers)};` : ""}
8655
8849
  const farmMdxConfig = ${JSON.stringify({
8656
8850
  ...config.mdx,
8657
- components: typeof _optionalChain([config, 'access', _228 => _228.mdx, 'optionalAccess', _229 => _229.components]) === "string" ? config.mdx.components : void 0
8851
+ components: typeof _optionalChain([config, 'access', _230 => _230.mdx, 'optionalAccess', _231 => _231.components]) === "string" ? config.mdx.components : void 0
8658
8852
  })};
8659
8853
  const configuredFarmMdxComponents = farmUserConfig?.mdx?.components;
8660
- ${_optionalChain([config, 'access', _230 => _230.agent, 'optionalAccess', _231 => _231.noindexPreviews]) ? `// agent.noindexPreviews: the runtime environment decides, falling back to the
8854
+ ${_optionalChain([config, 'access', _232 => _232.agent, 'optionalAccess', _233 => _233.noindexPreviews]) ? `// agent.noindexPreviews: the runtime environment decides, falling back to the
8661
8855
  // environment this was built in, since Netlify exposes its deploy context only
8662
8856
  // to the build.
8663
8857
  const farmNoindexPreview = resolveFarmPreviewDeployment(
8664
8858
  globalThis.process?.env,
8665
- ${JSON.stringify(_chunkFOULIN4Scjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env))},
8859
+ ${JSON.stringify(_chunkADQ2LATRcjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env))},
8666
8860
  );` : ""}
8667
8861
  const farmMdxComponents = ${mdxComponentsPath ? `(FarmMdxComponentsModule.components || Reflect.get(FarmMdxComponentsModule, "default") || {})` : `(configuredFarmMdxComponents && typeof configuredFarmMdxComponents === "object" ? configuredFarmMdxComponents : {})`};
8668
8862
  const farmObservabilityConfig = farmUserConfig?.observability ?? ${JSON.stringify(
@@ -8708,7 +8902,7 @@ export const farmProductionLifecycle = createFarmProductionLifecycle({
8708
8902
  });
8709
8903
  const farmI18nRuntime = ${config.i18n.enabled ? `createFarmI18nRuntime(farmI18nConfig, ${JSON.stringify(i18nCatalogs)})` : "null"};
8710
8904
  ${config.i18n.enabled ? "_setDefaultFarmI18nRuntime(farmI18nRuntime);" : ""}
8711
- const farmDocsBundledContentDir = ${_optionalChain([config, 'access', _232 => _232.docs, 'optionalAccess', _233 => _233.enabled]) && !hasPrecompiledDocs ? `(() => {
8905
+ const farmDocsBundledContentDir = ${_optionalChain([config, 'access', _234 => _234.docs, 'optionalAccess', _235 => _235.enabled]) && !hasPrecompiledDocs ? `(() => {
8712
8906
  try {
8713
8907
  const currentDir = farmDocsDirname(farmDocsFileURLToPath(import.meta.url));
8714
8908
  const candidates = [
@@ -8720,7 +8914,7 @@ const farmDocsBundledContentDir = ${_optionalChain([config, 'access', _232 => _2
8720
8914
  } catch {
8721
8915
  return null;
8722
8916
  }
8723
- })()` : "null"};${_optionalChain([config, 'access', _234 => _234.docs, 'optionalAccess', _235 => _235.enabled]) && !hasPrecompiledDocs && _optionalChain([config, 'access', _236 => _236.docs, 'access', _237 => _237.roots, 'optionalAccess', _238 => _238.length]) ? `
8917
+ })()` : "null"};${_optionalChain([config, 'access', _236 => _236.docs, 'optionalAccess', _237 => _237.enabled]) && !hasPrecompiledDocs && _optionalChain([config, 'access', _238 => _238.docs, 'access', _239 => _239.roots, 'optionalAccess', _240 => _240.length]) ? `
8724
8918
  const farmDocsBundledRootsDir = (() => {
8725
8919
  try {
8726
8920
  const currentDir = farmDocsDirname(farmDocsFileURLToPath(import.meta.url));
@@ -8772,7 +8966,7 @@ const farmDocsModulePreloadPaths = farmDocsModulePreloads
8772
8966
  ),
8773
8967
  }
8774
8968
  : undefined;
8775
- const farmDocsHandler = ${_optionalChain([config, 'access', _239 => _239.docs, 'optionalAccess', _240 => _240.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleDocsRequest" : adapterOwnsDocsRuntime ? `${adapterHandler.factory}(${adapterHandler.config}, {
8969
+ const farmDocsHandler = ${_optionalChain([config, 'access', _241 => _241.docs, 'optionalAccess', _242 => _242.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleDocsRequest" : adapterOwnsDocsRuntime ? `${adapterHandler.factory}(${adapterHandler.config}, {
8776
8970
  rootDir: farmDocsRuntimeRoot,
8777
8971
  // A production build's content cannot change, so the adapter reads its
8778
8972
  // navigation once instead of scanning the content directory per request.
@@ -8793,7 +8987,7 @@ const farmDocsHandler = ${_optionalChain([config, 'access', _239 => _239.docs, '
8793
8987
  registerMCPServer: registerFarmMCPServer,
8794
8988
  // A page built with this keeps its HTML string, so the preload budget and the response
8795
8989
  // writer use it instead of reading and re-encoding the body. Older adapters ignore it.
8796
- createHtmlResponse: farmOwnedHtmlResponse,${_chunkXGS76V7Lcjs.farmDocsAdapterServesGuardedPages.call(void 0, config.docs) ? `
8990
+ createHtmlResponse: farmOwnedHtmlResponse,${_chunkE3HBD2K3cjs.farmDocsAdapterServesGuardedPages.call(void 0, config.docs) ? `
8797
8991
  // The adapter keeps pages a path guard covers off search, llms.txt, the sitemap and MCP. It
8798
8992
  // asks about any path its own content lists, so the guards decide here, not a page list.
8799
8993
  isPathGuarded: (pathname) =>
@@ -8819,11 +9013,11 @@ const farmDocsHandler = ${_optionalChain([config, 'access', _239 => _239.docs, '
8819
9013
  isPathGuarded: isFarmDocsPathGuarded,
8820
9014
  basePath: ${JSON.stringify(config.basePath)},
8821
9015
  })` : "null"};
8822
- const farmDocsAPIHandler = ${_optionalChain([config, 'access', _241 => _241.docs, 'optionalAccess', _242 => _242.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleAPIRequest" : adapterOwnsDocsRuntime ? "null" : `createFarmDocsAPIHandler({ rootDir: farmDocsRuntimeRoot, srcDir: ${JSON.stringify(config.srcDir)}, docs: farmDocsResolvedConfig, isPathGuarded: isFarmDocsPathGuarded, basePath: ${JSON.stringify(config.basePath)} })` : "null"};
9016
+ const farmDocsAPIHandler = ${_optionalChain([config, 'access', _243 => _243.docs, 'optionalAccess', _244 => _244.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleAPIRequest" : adapterOwnsDocsRuntime ? "null" : `createFarmDocsAPIHandler({ rootDir: farmDocsRuntimeRoot, srcDir: ${JSON.stringify(config.srcDir)}, docs: farmDocsResolvedConfig, isPathGuarded: isFarmDocsPathGuarded, basePath: ${JSON.stringify(config.basePath)} })` : "null"};
8823
9017
 
8824
9018
  // API routes bundled at build time
8825
9019
  const apiRoutes = ${apiRoutes.length > 0 ? "mergePluginAPIRoutes(" : ""}[${apiRegistrations.join(",")}
8826
- ]${apiRoutes.length > 0 ? `, configuredPlugins, ${JSON.stringify(apiRoutes.map(({ path: path18, methods }) => ({ path: path18, methods })))}, { bodySizeLimit: ${JSON.stringify(config.server.bodySizeLimit)}, dispatch: dispatchFarmPluginAPIRequest })` : ""};
9020
+ ]${apiRoutes.length > 0 ? `, configuredPlugins, ${JSON.stringify(apiRoutes.map(({ path: path19, methods }) => ({ path: path19, methods })))}, { bodySizeLimit: ${JSON.stringify(config.server.bodySizeLimit)}, dispatch: dispatchFarmPluginAPIRequest })` : ""};
8827
9021
  // A plugin calling an app endpoint (an MCP tool, say) goes through the whole
8828
9022
  // pipeline, so the endpoint's middleware and integration guards run for it.
8829
9023
  function dispatchFarmPluginAPIRequest(request) {
@@ -8854,12 +9048,12 @@ const farmDeploymentCookiePath = ${JSON.stringify(config.basePath || "/")};
8854
9048
  // runtime request.
8855
9049
  const farmRuntimeErrorSlot = Symbol("farm.runtime.error.slot");
8856
9050
  const farmOpenAPIReference = ${JSON.stringify(openAPIReference)};
8857
- ${_optionalChain([config, 'access', _243 => _243.agent, 'optionalAccess', _244 => _244.apiCatalog]) ? `const farmApiCatalogInput = ${JSON.stringify(_chunk5KISFWD2cjs.resolveFarmApiCatalogInput.call(void 0, config))};
8858
- ` : ""}${_optionalChain([config, 'access', _245 => _245.agent, 'optionalAccess', _246 => _246.manifest]) !== false ? `const farmAppManifestInput = ${JSON.stringify(
8859
- _chunk5KISFWD2cjs.resolveFarmAppManifestInput.call(void 0, config, {
9051
+ ${_optionalChain([config, 'access', _245 => _245.agent, 'optionalAccess', _246 => _246.apiCatalog]) ? `const farmApiCatalogInput = ${JSON.stringify(_chunkFYZD7DUScjs.resolveFarmApiCatalogInput.call(void 0, config))};
9052
+ ` : ""}${_optionalChain([config, 'access', _247 => _247.agent, 'optionalAccess', _248 => _248.manifest]) !== false ? `const farmAppManifestInput = ${JSON.stringify(
9053
+ _chunkFYZD7DUScjs.resolveFarmAppManifestInput.call(void 0, config, {
8860
9054
  build: config.deploymentId,
8861
- packages: _chunkHVMQAVZKcjs.resolveFarmAppPackages.call(void 0, config.root),
8862
- webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ? _chunkHVMQAVZKcjs.collectFarmWebMCPTools.call(void 0, config.root, config.srcDir) : []
9055
+ packages: _chunkCL7BUGVBcjs.resolveFarmAppPackages.call(void 0, config.root),
9056
+ webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ? _chunkCL7BUGVBcjs.collectFarmWebMCPTools.call(void 0, config.root, config.srcDir) : []
8863
9057
  })
8864
9058
  )};
8865
9059
  ${servesDefaultMCP ? "farmAppManifestInput.defaultMCP = getFarmDefaultMCPServer;\n" : ""}// A guard written for an MCP server's path keeps its tools out of the public view.
@@ -8872,7 +9066,7 @@ farmAppManifestInput.guardCoversPath = (path) =>
8872
9066
  path,
8873
9067
  farmLocalAPIBasePath,
8874
9068
  );
8875
- ${_optionalChain([config, 'access', _247 => _247.docs, 'optionalAccess', _248 => _248.enabled]) ? `// A docs runtime's MCP server lists its tools when asked over MCP, in process. A build
9069
+ ${_optionalChain([config, 'access', _249 => _249.docs, 'optionalAccess', _250 => _250.enabled]) ? `// A docs runtime's MCP server lists its tools when asked over MCP, in process. A build
8876
9070
  // can't change them, so they are read once.
8877
9071
  if (farmDocsHandler) {
8878
9072
  farmAppManifestInput.registeredMCP = (request) =>
@@ -8966,7 +9160,10 @@ function serializeFarmInlineValue(value) {
8966
9160
  .replace(/\\u2029/g, "\\\\u2029");
8967
9161
  }
8968
9162
 
8969
- function renderFarmClientBootstrapScript(canonicalPath, selectedRouteSlots, pageProps, routePathname) {
9163
+ // \`statusDocument\`: the not-found or error page, which renders without the route's layout
9164
+ // boundaries and page segment. It names no route for its URL, so the client hydrates none over it
9165
+ // (development writes no hydration flags for it either); its links still navigate.
9166
+ function renderFarmClientBootstrapScript(canonicalPath, selectedRouteSlots, pageProps, routePathname, statusDocument) {
8970
9167
  const integrationManifest = ${hasRuntimeIntegrationConfig ? "getRegisteredIntegrationAPIManifest()" : "{}"};
8971
9168
  const serializedRouteSlots = serializeFarmInlineValue(selectedRouteSlots || []);
8972
9169
  const serializedPageProps = serializeFarmInlineValue(pageProps || {});
@@ -8977,11 +9174,13 @@ function renderFarmClientBootstrapScript(canonicalPath, selectedRouteSlots, page
8977
9174
  ';window.__FARM_DEPLOYMENT_ID__=' + serializeFarmInlineValue(farmDeploymentId) + ';'${searchPreserveRoutesSource ? ` +
8978
9175
  'window[Symbol.for("farm.searchPreserveRoutes")]=' + serializeFarmInlineValue(farmSearchPreserveRoutes) + ';'` : ""};
8979
9176
  // The client boots at the canonical path when the script below moves it there.
8980
- const bootRoutes = getFarmClientBootRoutes(
8981
- typeof canonicalPath === "string" && canonicalPath.startsWith("/")
8982
- ? getFarmRoutePathname(canonicalPath.split(/[?#]/)[0])
8983
- : routePathname
8984
- );
9177
+ const bootRoutes = statusDocument
9178
+ ? typeof routePathname === "string" ? { path: routePathname, routes: [] } : undefined
9179
+ : getFarmClientBootRoutes(
9180
+ typeof canonicalPath === "string" && canonicalPath.startsWith("/")
9181
+ ? getFarmRoutePathname(canonicalPath.split(/[?#]/)[0])
9182
+ : routePathname
9183
+ );
8985
9184
  if (bootRoutes) source += 'window.__FARM_CLIENT_ROUTES__=' + serializeFarmInlineValue(bootRoutes) + ';';
8986
9185
  if (typeof canonicalPath === "string" && canonicalPath.startsWith("/")) {
8987
9186
  const serializedPath = serializeFarmInlineValue(canonicalPath);
@@ -9037,9 +9236,9 @@ function farmDocumentBootsClient(markup, hydratesAtLoad, routeSlots) {
9037
9236
  // The boot entry runs the client entry from the URL on its script, with the files listed for what
9038
9237
  // started it. A root that waits (the element a hydrating layout or client page hydrates) is named
9039
9238
  // with its strategy, for the boot to watch.
9040
- function renderFarmClientBootScript(root, rootStrategy, markup, pageModule) {
9239
+ function renderFarmClientBootScript(root, rootStrategy, markup, pageModule, navigation) {
9041
9240
  return stampFarmCspNonce('<script type="module" src="${farmClientBoot ? FARM_CLIENT_BOOT_SRC_PLACEHOLDER : ""}" data-farm-runtime="/__farm_client_js_src__"' +
9042
- renderFarmClientBootPreloads(markup, pageModule, root, rootStrategy) +
9241
+ renderFarmClientBootPreloads(markup, pageModule, root, rootStrategy, navigation) +
9043
9242
  (root ? ' data-farm-root="' + root + '" data-farm-root-strategy="' + rootStrategy + '"' : '') +
9044
9243
  '></script>');
9045
9244
  }
@@ -9642,7 +9841,7 @@ function peelFarmDocumentPrefix(markup) {
9642
9841
  let inner = markup.replace(/^\\s+/, "");
9643
9842
  let hoisted = "";
9644
9843
  const wrapper = /^<div\\b[^>]*style=["']display\\s*:\\s*contents;?\\s*["'][^>]*>/i;
9645
- const hoistable = /${_chunk6ZFGWB75cjs.HOISTED_HEAD_ELEMENT.source}/i;
9844
+ const hoistable = /${_chunkOFVCWV2Dcjs.HOISTED_HEAD_ELEMENT.source}/i;
9646
9845
  let match;
9647
9846
  while ((match = wrapper.exec(inner) || hoistable.exec(inner))) {
9648
9847
  if (!/^<div/i.test(match[0])) hoisted += match[0];
@@ -9671,7 +9870,7 @@ function opensFarmFullDocument(markup) {
9671
9870
  // them: its own head takes them. Matches the dev renderer's takeFarmHoistedHead.
9672
9871
  function takeFarmHoistedHead(markup) {
9673
9872
  if (opensFarmFullDocument(markup)) return { head: "", body: markup };
9674
- const hoistable = /${_chunk6ZFGWB75cjs.HOISTED_HEAD_ELEMENT.source}/i;
9873
+ const hoistable = /${_chunkOFVCWV2Dcjs.HOISTED_HEAD_ELEMENT.source}/i;
9675
9874
  let head = "";
9676
9875
  let body = markup;
9677
9876
  let match;
@@ -9769,7 +9968,7 @@ function addFarmFallbackIcon(markup, hasFavicon) {
9769
9968
  return markup.replace(/<\\/head>/i, function() { return ' <link rel="icon" href="data:,">\\n</head>'; });
9770
9969
  }
9771
9970
 
9772
- function createFarmErrorDocument(html, title) {
9971
+ function createFarmErrorDocument(html, title, routePathname) {
9773
9972
  const escapedTitle = escapeFarmHtmlAttribute(title || "Application Error");
9774
9973
  const fullDocument = extractFarmFullDocument(html);
9775
9974
  const hasFullDocument = fullDocument !== null;
@@ -9784,7 +9983,7 @@ function createFarmErrorDocument(html, title) {
9784
9983
  renderFarmRendererHydrationScript() + '\\n' +
9785
9984
  '</head>\\n<body>\\n' +
9786
9985
  ' <div id="root">' + html + '</div>\\n' +
9787
- ' ' + renderFarmClientBootstrapScript() + '\\n' +
9986
+ ' ' + renderFarmClientBootstrapScript(undefined, undefined, undefined, routePathname, true) + '\\n' +
9788
9987
  ' ' + renderFarmClientEntryScript() + '\\n' +
9789
9988
  '</body>\\n</html>';
9790
9989
  }
@@ -9803,7 +10002,7 @@ function createFarmErrorDocument(html, title) {
9803
10002
  .replace(
9804
10003
  /<\\/body>/i,
9805
10004
  function() {
9806
- return ' ' + renderFarmClientBootstrapScript() + '\\n' +
10005
+ return ' ' + renderFarmClientBootstrapScript(undefined, undefined, undefined, routePathname, true) + '\\n' +
9807
10006
  ' ' + renderFarmClientEntryScript() + '\\n</body>';
9808
10007
  },
9809
10008
  );
@@ -9829,6 +10028,11 @@ ${generateFarmClientBootRoutesServerSource(`"${FARM_CLIENT_ROUTE_TABLE_PLACEHOLD
9829
10028
  const farmClientEntryPreloadTags = farmClientModulePreloads
9830
10029
  ? farmClientModulePreloads.entry.map(renderFarmClientModulePreload).join("")
9831
10030
  : "";
10031
+ // A document that runs the entry at once (no boot) hydrates with the renderer it imports lazily
10032
+ // (RFC 0010). A client navigation's response runs neither, so it leaves them out.
10033
+ const farmClientRendererPreloadTags = farmClientModulePreloads
10034
+ ? (farmClientModulePreloads.renderer || []).map(renderFarmClientModulePreload).join("")
10035
+ : "";
9832
10036
  // The client modules a document's markup loads: its islands' boundaries and the
9833
10037
  // client references of its server tree. An island with a deferred strategy loads its
9834
10038
  // module on its own trigger, so it is not preloaded.
@@ -9863,14 +10067,14 @@ function collectFarmClientDocumentModules(markup, pageModule, listed) {
9863
10067
  return indexes;
9864
10068
  }
9865
10069
 
9866
- // The modulepreload links for a document: the entry's static imports, then the
9867
- // modules its hydrating page and its markup load.
9868
- function renderFarmClientModulePreloads(markup, pageModule) {
10070
+ // The modulepreload links for a document: the entry's static imports and, unless it answers a
10071
+ // client navigation, the renderer, then the modules its hydrating page and its markup load.
10072
+ function renderFarmClientModulePreloads(markup, pageModule, navigation) {
9869
10073
  // A nonce policy blocks parser-inserted links without the nonce, and the
9870
10074
  // response filter manages nonces on script elements only, so CSP nonce mode
9871
10075
  // keeps the documents it had.
9872
10076
  if (!farmClientModulePreloads || (farmSecurityConfig.csp && farmSecurityConfig.csp.nonce)) return "";
9873
- return farmClientEntryPreloadTags +
10077
+ return farmClientEntryPreloadTags + (navigation ? "" : farmClientRendererPreloadTags) +
9874
10078
  collectFarmClientDocumentModules(markup, pageModule, new Set())
9875
10079
  .map(renderFarmClientModulePreload)
9876
10080
  .join("");
@@ -9878,11 +10082,12 @@ function renderFarmClientModulePreloads(markup, pageModule) {
9878
10082
 
9879
10083
  // What a boot document's runtime fetches as it starts, for the boot to request with it rather
9880
10084
  // than each a round trip after the file that imports it: the entry's static imports, the router
9881
- // and route table a link's intent loads, and the modules the root hydrates with. A root that
10085
+ // and route table a link's intent loads, the renderer the entry renders and hydrates with (RFC
10086
+ // 0010), and the modules the root hydrates with. A root that
9882
10087
  // waits for its time hydrates once the runtime runs, so its modules come with the entry's; one
9883
10088
  // that waits for a click hydrates on an interaction in it, and the boot fetches them then. The
9884
10089
  // boot adds the links itself with the script's nonce, so CSP nonce mode keeps them.
9885
- function renderFarmClientBootPreloads(markup, pageModule, root, rootStrategy) {
10090
+ function renderFarmClientBootPreloads(markup, pageModule, root, rootStrategy, navigation) {
9886
10091
  if (!farmClientModulePreloads) return "";
9887
10092
  const files = farmClientModulePreloads.files;
9888
10093
  const attribute = function(name, indexes) {
@@ -9898,6 +10103,7 @@ function renderFarmClientBootPreloads(markup, pageModule, root, rootStrategy) {
9898
10103
  const waitsForClick = rootStrategy === "interaction";
9899
10104
  return attribute("data-farm-preload", waitsForClick ? entry : entry.concat(rootModules)) +
9900
10105
  attribute("data-farm-preload-router", farmClientModulePreloads.router || []) +
10106
+ attribute("data-farm-preload-renderer", navigation ? [] : farmClientModulePreloads.renderer || []) +
9901
10107
  (waitsForClick ? attribute("data-farm-preload-root", rootModules) : "");
9902
10108
  }
9903
10109
 
@@ -10149,13 +10355,11 @@ async function handleMetadataImageRequest(request, routePathname) {
10149
10355
  searchParams: createFarmSearchParams(searchParams),
10150
10356
  path: match.pagePath,
10151
10357
  };
10152
- const value = typeof imageModule.default === "function"
10153
- ? await imageModule.default(props)
10154
- : imageModule.default;
10155
10358
 
10156
- ${hasGeneratedMetadataImages ? `return createFarmMetadataImageResponse(value, imageModule, {
10359
+ ${hasGeneratedMetadataImages ? `const value = await resolveFarmMetadataImageValue(imageModule, props${_chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, config.renderer) ? "" : ", {\n renderer: ReactDOMServer,\n component: image.component === true,\n }"});
10360
+ return createFarmMetadataImageResponse(value, imageModule, {
10157
10361
  method,
10158
- ifNoneMatch: request.headers.get("if-none-match"),${_chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) ? "" : "\n renderer: ReactDOMServer,"}
10362
+ ifNoneMatch: request.headers.get("if-none-match"),${_chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, config.renderer) ? "" : "\n renderer: ReactDOMServer,"}
10159
10363
  });` : 'throw new Error("Generated metadata image runtime is unavailable");'}
10160
10364
  } catch (error) {
10161
10365
  console.error("Metadata image render failed:", error);
@@ -10234,7 +10438,7 @@ function createFarmAgentRobotsResponse(request) {
10234
10438
  // its nearest layout's.
10235
10439
  const farmAgentGuardedPages = new Set(${JSON.stringify(
10236
10440
  pageRoutes.map((route) => route.pattern).filter(
10237
- (pattern) => !pattern.includes("[") && _chunk6ZFGWB75cjs.farmPathGuardCoversPage.call(void 0,
10441
+ (pattern) => !pattern.includes("[") && _chunkOFVCWV2Dcjs.farmPathGuardCoversPage.call(void 0,
10238
10442
  {
10239
10443
  config: { middleware: config.middleware, integrations: config.integrations },
10240
10444
  middlewareRoutes
@@ -10289,12 +10493,12 @@ ${servesDefaultMCP ? `// agent.mcp: the default read-only MCP server at /mcp, as
10289
10493
  // aside for a page route that answers /mcp and for any MCP server published or
10290
10494
  // registered at runtime, such as the docs engine's.
10291
10495
  const farmDefaultMCPServer = ${JSON.stringify(
10292
- _chunkYRXPDKMMcjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root), _chunkLMXGCFAMcjs.FARM_VERSION)
10496
+ _chunkW53Z4WDIcjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root), _chunkNSLRK5DKcjs.FARM_VERSION)
10293
10497
  )};
10294
10498
  let farmDefaultMCPRouteFree;
10295
10499
  function getFarmDefaultMCPServer() {
10296
10500
  if (farmDefaultMCPRouteFree === undefined) {
10297
- farmDefaultMCPRouteFree = !matchPageRoute(${JSON.stringify(_chunkYRXPDKMMcjs.FARM_DEFAULT_MCP_PATH)});
10501
+ farmDefaultMCPRouteFree = !matchPageRoute(${JSON.stringify(_chunkW53Z4WDIcjs.FARM_DEFAULT_MCP_PATH)});
10298
10502
  }
10299
10503
  return farmDefaultMCPRouteFree ? resolveFarmDefaultMCPServer(farmDefaultMCPServer) : undefined;
10300
10504
  }
@@ -10483,7 +10687,7 @@ ${edgeMiddlewareFilePaths.length > 0 ? `
10483
10687
  // middleware guards is never prerendered. Read once: Nitro's prerender worker sets the variable.
10484
10688
  const farmEdgeMiddlewareFiles = new Set(${JSON.stringify(edgeMiddlewareFilePaths)});
10485
10689
  const farmPrerendering =
10486
- typeof process !== "undefined" && process.env?.${_chunkNNGBTJCXcjs.FARM_PRERENDER_ENV} === "1";
10690
+ typeof process !== "undefined" && process.env?.${_chunkW6C3LEXXcjs.FARM_PRERENDER_ENV} === "1";
10487
10691
  ` : ""}
10488
10692
  const farmMiddlewareRunner = ${hasMiddlewareRuntime ? `createProductionMiddlewareRunner({
10489
10693
  config: farmMiddlewareConfig,
@@ -10627,7 +10831,7 @@ function hasLocalRequestRoute(request, routePathname) {
10627
10831
  if (${imageRuntime === "none" ? "false" : `pathname === ${JSON.stringify(config.images.path)}`}) {
10628
10832
  return true;
10629
10833
  }
10630
- ${_optionalChain([config, 'access', _249 => _249.docs, 'optionalAccess', _250 => _250.enabled]) ? `const docsPath = normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs");
10834
+ ${_optionalChain([config, 'access', _251 => _251.docs, 'optionalAccess', _252 => _252.enabled]) ? `const docsPath = normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs");
10631
10835
  // The docs answer below the basePath; their API stays at /api/docs, as API routes do.
10632
10836
  const docsRoutePathname = stripFarmBasePath(pathname);
10633
10837
  if (
@@ -10655,7 +10859,7 @@ function getFarmPluginRequestOptions(request) {
10655
10859
  route: { ...route, pattern: normalizeRuntimePath(farmOpenAPIReference.route) },
10656
10860
  };
10657
10861
  }
10658
- const isDocsAPIRequest = ${_optionalChain([config, 'access', _251 => _251.docs, 'optionalAccess', _252 => _252.enabled]) ? "isFarmDocsAPIRequest(pathname)" : "false"};
10862
+ const isDocsAPIRequest = ${_optionalChain([config, 'access', _253 => _253.docs, 'optionalAccess', _254 => _254.enabled]) ? "isFarmDocsAPIRequest(pathname)" : "false"};
10659
10863
  const integrationMatch = ${hasServerRuntimeIntegrations ? `matchIntegrationRoute(serverRuntimeIntegrations, {
10660
10864
  pathname,
10661
10865
  method: request.method,
@@ -10739,7 +10943,7 @@ ${hasInfraAnalyticsRuntime ? `
10739
10943
  // endpoints, Markdown mirrors, and docs pages have no app route pattern, so they are
10740
10944
  // labeled here; route.pattern keeps meaning the matched app route for plugins.
10741
10945
  const farmBuiltInRoutePaths = new Set(${JSON.stringify(
10742
- _chunk5KISFWD2cjs.listFarmBuiltInRoutePaths.call(void 0, {
10946
+ _chunkFYZD7DUScjs.listFarmBuiltInRoutePaths.call(void 0, {
10743
10947
  agent: {
10744
10948
  ...config.agent,
10745
10949
  aiCatalog: servesAiCatalog,
@@ -10750,9 +10954,9 @@ const farmBuiltInRoutePaths = new Set(${JSON.stringify(
10750
10954
  openapi: openAPIReference
10751
10955
  })
10752
10956
  )});
10753
- ${_optionalChain([config, 'access', _253 => _253.docs, 'optionalAccess', _254 => _254.enabled]) ? `const farmDocsRouteLabelInput = {
10957
+ ${_optionalChain([config, 'access', _255 => _255.docs, 'optionalAccess', _256 => _256.enabled]) ? `const farmDocsRouteLabelInput = {
10754
10958
  path: normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs"),
10755
- apiPath: ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _255 => _255.apiPath]) || "/api/docs")},${_optionalChain([config, 'access', _256 => _256.docs, 'access', _257 => _257.roots, 'optionalAccess', _258 => _258.length]) ? "\n roots: farmDocsResolvedConfig.roots.map((farmDocsRoot) => farmDocsRoot.entry)," : ""}${farmDocsAnalyticsPages.length ? `
10959
+ apiPath: ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _257 => _257.apiPath]) || "/api/docs")},${_optionalChain([config, 'access', _258 => _258.docs, 'access', _259 => _259.roots, 'optionalAccess', _260 => _260.length]) ? "\n roots: farmDocsResolvedConfig.roots.map((farmDocsRoot) => farmDocsRoot.entry)," : ""}${farmDocsAnalyticsPages.length ? `
10756
10960
  pages: new Set(${JSON.stringify(farmDocsAnalyticsPages)}),` : ""}
10757
10961
  };
10758
10962
  ` : ""}// The request's route payload, for a handler that learns what answered while it handles.
@@ -10768,11 +10972,11 @@ function labelFarmRequestOptions(options) {
10768
10972
  setFarmRouteLabel(options.route, mcpLabel);
10769
10973
  return options;
10770
10974
  }
10771
- ${_optionalChain([config, 'access', _259 => _259.docs, 'optionalAccess', _260 => _260.enabled]) ? `if (options.kind === "docs") {
10975
+ ${_optionalChain([config, 'access', _261 => _261.docs, 'optionalAccess', _262 => _262.enabled]) ? `if (options.kind === "docs") {
10772
10976
  setFarmRouteLabel(options.route, resolveFarmDocsRouteLabel(routePathname, farmDocsRouteLabelInput));
10773
10977
  return options;
10774
10978
  }` : ""}
10775
- ${_optionalChain([config, 'access', _261 => _261.md, 'optionalAccess', _262 => _262.enabled]) || hasMarkdownPages ? `const markdownLabel = resolveFarmMarkdownRouteLabel(
10979
+ ${_optionalChain([config, 'access', _263 => _263.md, 'optionalAccess', _264 => _264.enabled]) || hasMarkdownPages ? `const markdownLabel = resolveFarmMarkdownRouteLabel(
10776
10980
  routePathname,
10777
10981
  (page) => matchPageRoute(page)?.route.pattern,
10778
10982
  );
@@ -10807,7 +11011,7 @@ function getApplicableLayouts(pathname, directory) {
10807
11011
  return applicable;
10808
11012
  }
10809
11013
 
10810
- ${_optionalChain([config, 'access', _263 => _263.docs, 'optionalAccess', _264 => _264.enabled]) ? `async function wrapFarmDocsResponseWithLayouts(request, response) {
11014
+ ${_optionalChain([config, 'access', _265 => _265.docs, 'optionalAccess', _266 => _266.enabled]) ? `async function wrapFarmDocsResponseWithLayouts(request, response) {
10811
11015
  if (request.method === "HEAD") return response;
10812
11016
  if (response.headers.get("x-farm-docs-adapter")) return response;
10813
11017
 
@@ -10913,7 +11117,7 @@ ${_optionalChain([config, 'access', _263 => _263.docs, 'optionalAccess', _264 =>
10913
11117
 
10914
11118
  // Shells keep their own LRU so query-string variants never evict app cache entries.
10915
11119
  const pprShellCache = getFarmDataCache().pprShellCache;
10916
- const experimentalPPREnabled = ${JSON.stringify(_optionalChain([config, 'access', _265 => _265.experimental, 'optionalAccess', _266 => _266.ppr]) === true)};
11120
+ const experimentalPPREnabled = ${JSON.stringify(_optionalChain([config, 'access', _267 => _267.experimental, 'optionalAccess', _268 => _268.ppr]) === true)};
10917
11121
 
10918
11122
  function resolveRouteRenderingView(route) {
10919
11123
  // The same merge development uses: baked directive config under the
@@ -11033,7 +11237,7 @@ async function handleFarmRequest(request, adapterContext) {
11033
11237
  },
11034
11238
  { redirect: !isFarmLocalAPIPathname(requestUrl.pathname) }
11035
11239
  )` : "handleFarmRequestInContext(request, null, false, Date.now(), adapterContext, requestUrl)"};
11036
- ${_optionalChain([config, 'access', _267 => _267.md, 'optionalAccess', _268 => _268.enabled]) ? `const pathname = getFarmRoutePathname(requestUrl.pathname);
11240
+ ${_optionalChain([config, 'access', _269 => _269.md, 'optionalAccess', _270 => _270.enabled]) ? `const pathname = getFarmRoutePathname(requestUrl.pathname);
11037
11241
  if (matchPageRoute(pathname)) {
11038
11242
  // The Link header advertises the public .md URL, like the head alternate.
11039
11243
  return applyMarkdownNegotiationHeaders(response, {
@@ -11250,7 +11454,7 @@ ${hasServerRuntimeIntegrations ? `
11250
11454
  return renderFarmErrorJSONResponse();` : `
11251
11455
  if (isFarmLocalAPIPathname(pathname)) return renderFarmErrorJSONResponse();
11252
11456
  // No page was selected, so only the root error boundary and layouts apply.
11253
- const errorResponse = await renderFarmErrorResponse(middlewareResult.error, "/", {}, null);${_optionalChain([config, 'access', _269 => _269.md, 'optionalAccess', _270 => _270.enabled]) ? `
11457
+ const errorResponse = await renderFarmErrorResponse(middlewareResult.error, "/", {}, null);${_optionalChain([config, 'access', _271 => _271.md, 'optionalAccess', _272 => _272.enabled]) ? `
11254
11458
  // An agent asking for Markdown reads the error document as Markdown, as it
11255
11459
  // does when a page throws. The helper answers null when Markdown is off.
11256
11460
  const markdownErrorResponse = await createMarkdownMirrorResponse({
@@ -11292,7 +11496,7 @@ ${hasServerRuntimeIntegrations ? `
11292
11496
  }
11293
11497
  ` : ""}
11294
11498
 
11295
- ${_optionalChain([config, 'access', _271 => _271.docs, 'optionalAccess', _272 => _272.enabled]) ? `
11499
+ ${_optionalChain([config, 'access', _273 => _273.docs, 'optionalAccess', _274 => _274.enabled]) ? `
11296
11500
  // Docs responses are served after app middleware so route guards and
11297
11501
  // middleware headers apply to the docs engine like any other page content.
11298
11502
  // An app's own llms.txt, llms-full.txt, sitemap.xml, and robots.txt take
@@ -11408,7 +11612,7 @@ ${hasServerRuntimeIntegrations ? `
11408
11612
  }
11409
11613
  ` : ""}
11410
11614
 
11411
- ${_optionalChain([config, 'access', _273 => _273.md, 'optionalAccess', _274 => _274.enabled]) ? `
11615
+ ${_optionalChain([config, 'access', _275 => _275.md, 'optionalAccess', _276 => _276.enabled]) ? `
11412
11616
  if (farmMarkdownConfig?.enabled) {
11413
11617
  const markdownResponse = await createMarkdownMirrorResponse({
11414
11618
  // The mirror helper only reads metadata and creates its own GET request.
@@ -11512,11 +11716,11 @@ ${hasServerRuntimeIntegrations ? `
11512
11716
  return applyProductionMiddlewareHeaders(applicationMetadataResponse, middlewareHeaders);
11513
11717
  }
11514
11718
  ` : ""}
11515
- ${_optionalChain([config, 'access', _275 => _275.agent, 'optionalAccess', _276 => _276.manifest]) !== false ? `
11719
+ ${_optionalChain([config, 'access', _277 => _277.agent, 'optionalAccess', _278 => _278.manifest]) !== false ? `
11516
11720
  // agent.manifest: /.well-known/farmjs.json (and 0.1.34's /.well-known/farmjs), the app's
11517
11721
  // public manifest, the same document for every request.
11518
11722
  if (
11519
- [${JSON.stringify(_chunk5KISFWD2cjs.FARM_APP_MANIFEST_PATH)}, ${JSON.stringify(_chunk5KISFWD2cjs.FARM_APP_MANIFEST_LEGACY_PATH)}].includes(
11723
+ [${JSON.stringify(_chunkFYZD7DUScjs.FARM_APP_MANIFEST_PATH)}, ${JSON.stringify(_chunkFYZD7DUScjs.FARM_APP_MANIFEST_LEGACY_PATH)}].includes(
11520
11724
  normalizeRuntimePath(routePathname),
11521
11725
  )
11522
11726
  ) {
@@ -11526,9 +11730,9 @@ ${hasServerRuntimeIntegrations ? `
11526
11730
  );
11527
11731
  }
11528
11732
  ` : ""}
11529
- ${_optionalChain([config, 'access', _277 => _277.agent, 'optionalAccess', _278 => _278.apiCatalog]) ? `
11733
+ ${_optionalChain([config, 'access', _279 => _279.agent, 'optionalAccess', _280 => _280.apiCatalog]) ? `
11530
11734
  // agent.apiCatalog: list the OpenAPI and MCP surfaces at the RFC 9727 path.
11531
- if (normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunk5KISFWD2cjs.FARM_API_CATALOG_PATH)}) {
11735
+ if (normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkFYZD7DUScjs.FARM_API_CATALOG_PATH)}) {
11532
11736
  return applyProductionMiddlewareHeaders(
11533
11737
  createFarmApiCatalogResponse(request.method, farmApiCatalogInput, request),
11534
11738
  middlewareHeaders,
@@ -11553,11 +11757,11 @@ ${hasServerRuntimeIntegrations ? `
11553
11757
  );
11554
11758
  }
11555
11759
  ` : ""}
11556
- ${_optionalChain([config, 'access', _279 => _279.agent, 'optionalAccess', _280 => _280.llmsTxt, 'optionalAccess', _281 => _281.enabled]) ? `
11760
+ ${_optionalChain([config, 'access', _281 => _281.agent, 'optionalAccess', _282 => _282.llmsTxt, 'optionalAccess', _283 => _283.enabled]) ? `
11557
11761
  // agent.llmsTxt with no llms.ts or llms-full.ts: serve the generated files.
11558
11762
  const farmGeneratedLlmsKind = normalizeRuntimePath(routePathname) === "/llms.txt"
11559
11763
  ? "llms"
11560
- : ${_optionalChain([config, 'access', _282 => _282.agent, 'optionalAccess', _283 => _283.llmsTxt, 'optionalAccess', _284 => _284.full]) ? `normalizeRuntimePath(routePathname) === "/llms-full.txt" ? "llms-full" : ` : ""}null;
11764
+ : ${_optionalChain([config, 'access', _284 => _284.agent, 'optionalAccess', _285 => _285.llmsTxt, 'optionalAccess', _286 => _286.full]) ? `normalizeRuntimePath(routePathname) === "/llms-full.txt" ? "llms-full" : ` : ""}null;
11561
11765
  if (farmGeneratedLlmsKind) {
11562
11766
  const llmsContext = createFarmLlmsTxtContext(request, farmGeneratedLlmsKind === "llms-full");
11563
11767
  // Renders are shared per origin the request reached, which is where pages are read.
@@ -11593,7 +11797,7 @@ ${hasServerRuntimeIntegrations ? `
11593
11797
  }
11594
11798
  ` : ""}
11595
11799
 
11596
- ${_optionalChain([config, 'access', _285 => _285.docs, 'optionalAccess', _286 => _286.enabled]) ? `if (farmDocsAPIHandler && isFarmDocsAPIRequest(pathname)) {
11800
+ ${_optionalChain([config, 'access', _287 => _287.docs, 'optionalAccess', _288 => _288.enabled]) ? `if (farmDocsAPIHandler && isFarmDocsAPIRequest(pathname)) {
11597
11801
  const docsAPIResponse = await farmDocsAPIHandler(cloneFarmRequestWithContext(request));
11598
11802
  if (docsAPIResponse) {
11599
11803
  return applyProductionMiddlewareHeaders(
@@ -11622,7 +11826,7 @@ ${hasServerRuntimeIntegrations ? `
11622
11826
  if (farmDeploymentMismatch) return createFarmDeploymentMismatchResponse(farmDeploymentMismatch);
11623
11827
  farmCacheGuard.deploymentPage = true;
11624
11828
  }
11625
- ${farmIslandsMode ? `// Islands mode: a form or client component posting a server action to this page.
11829
+ ${farmIslandsMode || farmRendererActions ? `// A form or client component posting a server action to this page.
11626
11830
  if (matchedRoute && request.method === "POST") {
11627
11831
  const actionResponse = await _runWithMiddlewareData(middlewareData || {}, () =>
11628
11832
  _runWithMiddlewareContext(middlewareContext || {}, () =>
@@ -12052,11 +12256,11 @@ ${hasServerRuntimeIntegrations ? `
12052
12256
  // outer request handler exactly like sync render errors.
12053
12257
  if (typeof PageComponent === "function" && PageComponent.constructor.name === "AsyncFunction") {
12054
12258
  const result = await PageComponent(pageProps);
12055
- if (React.isValidElement(result)) {
12056
- pageElement = result;
12057
- } else {
12058
- pageElement = React.createElement("div", null, String(result));
12059
- }
12259
+ // Anything else (text, a number, null) renders as the renderer renders a child,
12260
+ // as in development.
12261
+ pageElement = React.isValidElement(result)
12262
+ ? result
12263
+ : React.createElement(React.Fragment, null, result);
12060
12264
  } else {
12061
12265
  // Sync component - create element directly
12062
12266
  pageElement = React.createElement(PageComponent, pageProps);
@@ -12088,7 +12292,7 @@ ${hasServerRuntimeIntegrations ? `
12088
12292
  pageElement,
12089
12293
  );
12090
12294
 
12091
- ${_chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) ? "if (route.shouldHydrate && !shouldHydrateLayout) pageElement = markPagePosition(React, pageElement);" : ""}
12295
+ ${_chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, config.renderer) ? "if (route.shouldHydrate && !shouldHydrateLayout) pageElement = markPagePosition(React, pageElement);" : ""}
12092
12296
  // Wrap with layouts (from innermost to outermost)
12093
12297
  // Layouts are sorted by depth (root first), so we process in reverse
12094
12298
  let wrappedElement = pageElement;
@@ -12160,7 +12364,7 @@ ${hasServerRuntimeIntegrations ? `
12160
12364
  wrappedElement = wrapFarmRouteClientGraph(wrappedElement);
12161
12365
  }
12162
12366
 
12163
- ${_chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) ? "if (route.shouldHydrate && !shouldHydrateLayout) wrappedElement = markLayoutPosition(React, wrappedElement);" : ""}
12367
+ ${_chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, config.renderer) ? "if (route.shouldHydrate && !shouldHydrateLayout) wrappedElement = markLayoutPosition(React, wrappedElement);" : ""}
12164
12368
  wrappedElement = wrapWithFarmIntegrationProviders(wrappedElement);
12165
12369
  return renderFarmElement(ReactDOMServer, wrappedElement, route.pattern, farmFlushToken);
12166
12370
  };
@@ -12231,7 +12435,7 @@ ${hasServerRuntimeIntegrations ? `
12231
12435
  );
12232
12436
  }
12233
12437
  }
12234
- ${_optionalChain([config, 'access', _287 => _287.md, 'optionalAccess', _288 => _288.enabled]) ? `
12438
+ ${_optionalChain([config, 'access', _289 => _289.md, 'optionalAccess', _290 => _290.enabled]) ? `
12235
12439
  // Advertise the Markdown mirror in the head as well as the Link header,
12236
12440
  // using the public path the .md request will be resolved against.
12237
12441
  mergedMetadata = addMetadataMarkdownAlternate(
@@ -12260,7 +12464,7 @@ ${hasServerRuntimeIntegrations ? `
12260
12464
  emitFarmEvent({ type: "cache.bypass", route: pathname, reason: "cookie" });
12261
12465
  }
12262
12466
 
12263
- const renderedMetadata = renderMetadataHead(mergedMetadata, { pathname, jsonLd: ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _289 => _289.agent, 'optionalAccess', _290 => _290.jsonLd]), () => ( false)))} });
12467
+ const renderedMetadata = renderMetadataHead(mergedMetadata, { pathname, jsonLd: ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _291 => _291.agent, 'optionalAccess', _292 => _292.jsonLd]), () => ( false)))} });
12264
12468
  const title = renderedMetadata.title;
12265
12469
  const metaTags = renderedMetadata.tags;
12266
12470
  const hasFavicon = renderedMetadata.hasFavicon;
@@ -12338,6 +12542,10 @@ ${hasServerRuntimeIntegrations ? `
12338
12542
  // Set once the whole document is rendered: whether it starts with the boot entry, which
12339
12543
  // preloads nothing.
12340
12544
  let farmBootsClient = false;
12545
+ // A client navigation swaps this document in without running its scripts. A route a
12546
+ // shared cache stores renders the same for every request.
12547
+ const farmNavigationRequest = ${farmIslandsMode ? `!farmSharedCacheableRoute &&
12548
+ (request.headers.has("f-stream") || request.headers.has("f-render"))` : "false"};
12341
12549
  // A layout's own <html> document with Farm's head assets merged in and the #root the client
12342
12550
  // hydrates opening its body: the whole document, or a streamed one's opening.
12343
12551
  const composeFarmFullDocument = function(markup) {
@@ -12347,7 +12555,7 @@ ${hasServerRuntimeIntegrations ? `
12347
12555
  );
12348
12556
  composed = composed
12349
12557
  // Inject CSS link after opening head tag or first meta tag
12350
- .replace(/<head([^>]*)>/i, function(match, attrs) { return '<head' + attrs + '>\\n <link rel="stylesheet" href="/__farm_client_css_href__">' + (farmBootsClient ? "" : renderFarmClientModulePreloads(composed, route.clientModule)); })
12558
+ .replace(/<head([^>]*)>/i, function(match, attrs) { return '<head' + attrs + '>\\n <link rel="stylesheet" href="/__farm_client_css_href__">' + (farmBootsClient ? "" : renderFarmClientModulePreloads(composed, route.clientModule, farmNavigationRequest)); })
12351
12559
  .replace(/<\\/head>/i, () => renderFarmRendererHydrationScript() + '\\n</head>')
12352
12560
  // Explicit metadata wins over renderer and layout titles. Without
12353
12561
  // explicit metadata, a renderer title wins over the layout title.
@@ -12545,7 +12753,8 @@ ${hasServerRuntimeIntegrations ? `
12545
12753
  farmHydratesRoot ? (shouldHydrateLayout ? "root" : "__farm_page__") : "",
12546
12754
  route.rootStrategy,
12547
12755
  html,
12548
- route.clientModule
12756
+ route.clientModule,
12757
+ farmNavigationRequest
12549
12758
  )
12550
12759
  : renderFarmClientEntryScript();
12551
12760
 
@@ -12576,7 +12785,7 @@ ${hasServerRuntimeIntegrations ? `
12576
12785
  \${viewportTags}
12577
12786
  \${hasFavicon ? "" : '<link rel="icon" href="data:,">'}
12578
12787
  \${suppressDefaultTitle ? "" : "<title>" + title + "</title>"}\${metaTags}\${rendererHead ? "\\n " + rendererHead : ""}
12579
- <link rel="stylesheet" href="/__farm_client_css_href__">\${farmBootsClient ? "" : renderFarmClientModulePreloads(html, route.clientModule)}
12788
+ <link rel="stylesheet" href="/__farm_client_css_href__">\${farmBootsClient ? "" : renderFarmClientModulePreloads(html, route.clientModule, farmNavigationRequest)}
12580
12789
  \${renderFarmRendererHydrationScript()}
12581
12790
  </head>
12582
12791
  <body>
@@ -12712,7 +12921,7 @@ ${hasServerRuntimeIntegrations ? `
12712
12921
  ${servesDefaultMCP ? `
12713
12922
  // agent.mcp: no app route answered /mcp, so the default read-only server may.
12714
12923
  if (
12715
- normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkYRXPDKMMcjs.FARM_DEFAULT_MCP_PATH)} &&
12924
+ normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkW53Z4WDIcjs.FARM_DEFAULT_MCP_PATH)} &&
12716
12925
  getFarmDefaultMCPServer()
12717
12926
  ) {
12718
12927
  return applyProductionMiddlewareHeaders(
@@ -12776,7 +12985,7 @@ ${servesDefaultMCP ? `
12776
12985
  )` : "await renderErrorElement()"};
12777
12986
  const errorDocument = applyFarmThemeDocument(
12778
12987
  applyFarmI18nDocument(
12779
- createFarmErrorDocument(errorHtml, "Application Error"),
12988
+ createFarmErrorDocument(errorHtml, "Application Error", routePathname),
12780
12989
  pathname,
12781
12990
  getFarmI18nSnapshot(),
12782
12991
  request
@@ -12817,7 +13026,8 @@ ${servesDefaultMCP ? `
12817
13026
  applyFarmI18nDocument(
12818
13027
  createFarmErrorDocument(
12819
13028
  fallbackHtml,
12820
- errorStatus + " - " + errorStatusText
13029
+ errorStatus + " - " + errorStatusText,
13030
+ routePathname
12821
13031
  ),
12822
13032
  pathname,
12823
13033
  getFarmI18nSnapshot(),
@@ -12940,7 +13150,7 @@ ${farmRendererDisabled ? `
12940
13150
  .replace(/<\\/head>/i, () => renderFarmRendererHydrationScript() + '\\n</head>')
12941
13151
  .replace(
12942
13152
  /<\\/body>/i,
12943
- () => ' ' + renderFarmClientBootstrapScript(undefined, undefined, undefined, routePathname) + '\\n' +
13153
+ () => ' ' + renderFarmClientBootstrapScript(undefined, undefined, undefined, routePathname, true) + '\\n' +
12944
13154
  ' ' + renderFarmClientEntryScript() + '\\n</body>',
12945
13155
  );
12946
13156
  fullHtml = ensureFarmDocumentMeta(fullHtml, notFoundMetadata.viewport);
@@ -12960,7 +13170,7 @@ ${farmRendererDisabled ? `
12960
13170
  </head>
12961
13171
  <body>
12962
13172
  <div id="root">\${html}</div>
12963
- \${renderFarmClientBootstrapScript(undefined, undefined, undefined, routePathname)}
13173
+ \${renderFarmClientBootstrapScript(undefined, undefined, undefined, routePathname, true)}
12964
13174
  \${renderFarmClientEntryScript()}
12965
13175
  </body>
12966
13176
  </html>\`;
@@ -13088,11 +13298,11 @@ function createFarmRuntimeHookErrorResponse(request, error) {
13088
13298
  export async function fetch(request, context) {${imageRuntime === "none" ? "" : `
13089
13299
  // The image optimizer's fetch of a local source is not a loopback visitor.
13090
13300
  context = _withFarmImageSourceClientAddress(request, context);`}
13091
- ${_optionalChain([config, 'access', _291 => _291.agent, 'optionalAccess', _292 => _292.noindexPreviews]) ? "const response = await" : "return"} _runWithAPIRequestRuntime({
13301
+ ${_optionalChain([config, 'access', _293 => _293.agent, 'optionalAccess', _294 => _294.noindexPreviews]) ? "const response = await" : "return"} _runWithAPIRequestRuntime({
13092
13302
  basePath: farmLocalAPIBasePath,
13093
13303
  dispatch: async (localRequest) =>
13094
13304
  (await handleAPIRequest(localRequest)) ?? Response.json({ error: "Not Found" }, { status: 404 }),
13095
- }, () => handleFarmFetch(request, context));${_optionalChain([config, 'access', _293 => _293.agent, 'optionalAccess', _294 => _294.noindexPreviews]) ? `
13305
+ }, () => handleFarmFetch(request, context));${_optionalChain([config, 'access', _295 => _295.agent, 'optionalAccess', _296 => _296.noindexPreviews]) ? `
13096
13306
  // Keep every response of a preview deployment out of search indexes.
13097
13307
  return farmNoindexPreview ? applyFarmPreviewRobotsTag(response) : response;` : ""}
13098
13308
  }
@@ -13302,11 +13512,11 @@ function getManifestPageEntry(manifest, pathname) {
13302
13512
  })).sort((left, right) => _chunkML4TOUZPcjs.compareRouteSpecificity.call(void 0, left.specificity, right.specificity)).map(({ entry, matches }) => ({ entry, matches }));
13303
13513
  manifestPageMatchers.set(manifest.routes, pages);
13304
13514
  }
13305
- return _optionalChain([pages, 'access', _295 => _295.find, 'call', _296 => _296((page) => page.matches(pathname)), 'optionalAccess', _297 => _297.entry]);
13515
+ return _optionalChain([pages, 'access', _297 => _297.find, 'call', _298 => _298((page) => page.matches(pathname)), 'optionalAccess', _299 => _299.entry]);
13306
13516
  }
13307
13517
  function withFarmEdgeGuardedPrerenderHeaders(headers, edgeGuarded) {
13308
13518
  if (!edgeGuarded) return headers;
13309
- const cacheHeaders = /* @__PURE__ */ new Set(["cache-control", ..._chunk42EUEYW6cjs.CDN_CACHE_CONTROL_HEADERS]);
13519
+ const cacheHeaders = /* @__PURE__ */ new Set(["cache-control", ..._chunkYUQUGVSVcjs.CDN_CACHE_CONTROL_HEADERS]);
13310
13520
  return {
13311
13521
  ...Object.fromEntries(
13312
13522
  Object.entries(headers).filter(([name]) => !cacheHeaders.has(name.toLowerCase()))
@@ -13339,13 +13549,13 @@ function getPhysicalPrerenderBypassReason(options) {
13339
13549
  if (rewriteSources.some((source) => middlewarePatternMatches(source, pathname))) {
13340
13550
  return "rewrite";
13341
13551
  }
13342
- if (_chunk6ZFGWB75cjs.appMiddlewareMayHandlePath.call(void 0, middlewareRoutes, pathname)) return "app middleware";
13343
- if (_chunk6ZFGWB75cjs.configMiddlewareMayHandlePath.call(void 0, config.middleware, pathname)) return "configured middleware";
13344
- if (_chunkF7PKUP6Pcjs.hasCustomFarmRouteContext.call(void 0, config)) return "request context";
13552
+ if (_chunkOFVCWV2Dcjs.appMiddlewareMayHandlePath.call(void 0, middlewareRoutes, pathname)) return "app middleware";
13553
+ if (_chunkOFVCWV2Dcjs.configMiddlewareMayHandlePath.call(void 0, config.middleware, pathname)) return "configured middleware";
13554
+ if (_chunkMOGRRZMWcjs.hasCustomFarmRouteContext.call(void 0, config)) return "request context";
13345
13555
  if (farmServerRuntimePluginsMayHandlePath(config, pathname)) return "server runtime plugin";
13346
13556
  const manifestEntry = getManifestPageEntry(routeRuntimeManifest, pathname);
13347
- if (_optionalChain([manifestEntry, 'optionalAccess', _298 => _298.rendering]) === "dynamic") return "dynamic runtime manifest";
13348
- if (manifestEntry && (manifestEntry.runtime !== "auto" || Boolean(_optionalChain([manifestEntry, 'access', _299 => _299.regions, 'optionalAccess', _300 => _300.length])) || manifestEntry.maxDuration !== void 0)) {
13557
+ if (_optionalChain([manifestEntry, 'optionalAccess', _300 => _300.rendering]) === "dynamic") return "dynamic runtime manifest";
13558
+ if (manifestEntry && (manifestEntry.runtime !== "auto" || Boolean(_optionalChain([manifestEntry, 'access', _301 => _301.regions, 'optionalAccess', _302 => _302.length])) || manifestEntry.maxDuration !== void 0)) {
13349
13559
  return "route runtime controls";
13350
13560
  }
13351
13561
  const routeRule = getEffectiveRouteRule(config, pathname);
@@ -13358,34 +13568,34 @@ function getPhysicalPrerenderBypassReason(options) {
13358
13568
  return void 0;
13359
13569
  }
13360
13570
  async function getFarmDocsPrerenderPages(config, root, preset) {
13361
- if (!_optionalChain([config, 'access', _301 => _301.docs, 'optionalAccess', _302 => _302.enabled]) || !config.docs.prerender) return [];
13571
+ if (!_optionalChain([config, 'access', _303 => _303.docs, 'optionalAccess', _304 => _304.enabled]) || !config.docs.prerender) return [];
13362
13572
  if (_chunkNLBHLPEOcjs.getFarmPresetRuntime.call(void 0, preset) === "edge") {
13363
- _chunkGC5ROI3Acjs.logger.info(
13573
+ _chunk7U4XF76Rcjs.logger.info(
13364
13574
  `\u21AA Keeping docs pages in the edge docs snapshot: docs.prerender writes static files on Node and serverless targets, not "${preset}".`
13365
13575
  );
13366
13576
  return [];
13367
13577
  }
13368
- if (!_chunkXGS76V7Lcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
13369
- const { pages: pages2, originDependent } = _chunk6D3CJFNUcjs.listFarmDocsBuiltInPrerenderPages.call(void 0, config.docs, {
13578
+ if (!_chunkE3HBD2K3cjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
13579
+ const { pages: pages2, originDependent } = _chunkHR5GU4UUcjs.listFarmDocsBuiltInPrerenderPages.call(void 0, config.docs, {
13370
13580
  root,
13371
13581
  srcDir: config.srcDir
13372
13582
  });
13373
13583
  if (originDependent.length > 0) {
13374
- _chunkGC5ROI3Acjs.logger.info(
13584
+ _chunk7U4XF76Rcjs.logger.info(
13375
13585
  `\u21AA Keeping ${originDependent.length} docs page(s) rendering on request: their social image metadata is an absolute URL built from the request's origin. Set docs.socialImage.baseUrl to prerender them.`
13376
13586
  );
13377
13587
  }
13378
13588
  return pages2;
13379
13589
  }
13380
- if (!_chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer)) {
13381
- _chunkGC5ROI3Acjs.logger.warn(
13590
+ if (!_chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, config.renderer)) {
13591
+ _chunk7U4XF76Rcjs.logger.warn(
13382
13592
  `The docs adapter ${JSON.stringify(config.docs.adapter.id)} renders with React; docs.prerender keeps its pages rendering on request with the "${config.renderer.name}" renderer.`
13383
13593
  );
13384
13594
  return [];
13385
13595
  }
13386
- const pages = await _chunkXGS76V7Lcjs.listFarmDocsAdapterPages.call(void 0, config.docs, { root, srcDir: config.srcDir });
13596
+ const pages = await _chunkE3HBD2K3cjs.listFarmDocsAdapterPages.call(void 0, config.docs, { root, srcDir: config.srcDir });
13387
13597
  if (!pages) {
13388
- _chunkGC5ROI3Acjs.logger.warn(
13598
+ _chunk7U4XF76Rcjs.logger.warn(
13389
13599
  `The docs adapter ${JSON.stringify(config.docs.adapter.id)} does not list its pages for prerendering; upgrade it to prerender docs pages. They render on request until then.`
13390
13600
  );
13391
13601
  return [];
@@ -13393,17 +13603,17 @@ async function getFarmDocsPrerenderPages(config, root, preset) {
13393
13603
  return pages;
13394
13604
  }
13395
13605
  async function listFarmDocsAnalyticsPages(config, root, preset) {
13396
- if (!_optionalChain([config, 'access', _303 => _303.docs, 'optionalAccess', _304 => _304.enabled]) || config.analytics === false || _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) !== "nodejs") {
13606
+ if (!_optionalChain([config, 'access', _305 => _305.docs, 'optionalAccess', _306 => _306.enabled]) || config.analytics === false || _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) !== "nodejs") {
13397
13607
  return [];
13398
13608
  }
13399
13609
  try {
13400
- return await _chunkXGS76V7Lcjs.listFarmDocsPagePaths.call(void 0, config.docs, {
13610
+ return await _chunkE3HBD2K3cjs.listFarmDocsPagePaths.call(void 0, config.docs, {
13401
13611
  root,
13402
13612
  srcDir: config.srcDir,
13403
- adapter: _chunk67MZTLTFcjs.isReactRenderer.call(void 0, config.renderer) && _chunkXGS76V7Lcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)
13613
+ adapter: _chunkM6DAIE4Tcjs.isReactRenderer.call(void 0, config.renderer) && _chunkE3HBD2K3cjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)
13404
13614
  });
13405
13615
  } catch (error) {
13406
- _chunkGC5ROI3Acjs.logger.warn(
13616
+ _chunk7U4XF76Rcjs.logger.warn(
13407
13617
  `Farm Infra analytics reports docs pages by the docs route, not each page's path: listing them failed (${error instanceof Error ? error.message : String(error)}).`
13408
13618
  );
13409
13619
  return [];
@@ -13411,9 +13621,9 @@ async function listFarmDocsAnalyticsPages(config, root, preset) {
13411
13621
  }
13412
13622
  function hasFarmNitroCacheRouteRule(routeRules) {
13413
13623
  return Object.values(routeRules || {}).some((rule) => {
13414
- const swr = _optionalChain([rule, 'optionalAccess', _305 => _305.swr]);
13415
- const cache = _optionalChain([rule, 'optionalAccess', _306 => _306.cache]);
13416
- const headers = _optionalChain([rule, 'optionalAccess', _307 => _307.headers]);
13624
+ const swr = _optionalChain([rule, 'optionalAccess', _307 => _307.swr]);
13625
+ const cache = _optionalChain([rule, 'optionalAccess', _308 => _308.cache]);
13626
+ const headers = _optionalChain([rule, 'optionalAccess', _309 => _309.headers]);
13417
13627
  return swr !== void 0 && swr !== false || cache !== void 0 && cache !== false || !!headers && typeof headers === "object" && Object.keys(headers).length > 0;
13418
13628
  });
13419
13629
  }
@@ -13426,10 +13636,10 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
13426
13636
  const nitroBuilder = nitroBuilderResult.value;
13427
13637
  const isVercel = preset === "vercel";
13428
13638
  const isCloudflareWorker = preset === "cloudflare-module";
13429
- const outputDir = _chunkF7PKUP6Pcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
13639
+ const outputDir = _chunkMOGRRZMWcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
13430
13640
  const runtimeServerOutputDir = isVercel ? _path2.default.join(outputDir, "functions", "__nitro.func") : _path2.default.join(outputDir, "server");
13431
13641
  const ssrOutputDir = _path2.default.join(root, distDir, "ssr");
13432
- const imageRuntime = _chunkHVMQAVZKcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
13642
+ const imageRuntime = _chunkCL7BUGVBcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
13433
13643
  const hasGeneratedMetadataImages = Array.from(routeManager.getMetadataImages().values()).some(
13434
13644
  (image) => image.sourceType === "module"
13435
13645
  );
@@ -13447,15 +13657,15 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
13447
13657
  (packageName) => copiedRuntimePackages.has(packageName)
13448
13658
  );
13449
13659
  const isPrebuiltSSRCandidate = preset === "node-server" && ssrExternalsArePackaged;
13450
- _chunkGC5ROI3Acjs.logger.info(`\u{1F4E6} Nitro output directory: ${outputDir}`);
13451
- _chunkGC5ROI3Acjs.logger.info(`\u{1F4E6} SSR entry file: ${ssrEntryFile}`);
13452
- _chunkGC5ROI3Acjs.logger.info(`\u{1F4E6} Preset: ${preset}`);
13660
+ _chunk7U4XF76Rcjs.logger.info(`\u{1F4E6} Nitro output directory: ${outputDir}`);
13661
+ _chunk7U4XF76Rcjs.logger.info(`\u{1F4E6} SSR entry file: ${ssrEntryFile}`);
13662
+ _chunk7U4XF76Rcjs.logger.info(`\u{1F4E6} Preset: ${preset}`);
13453
13663
  const ssgCollectionPromise = routeManager.collectSSGPages();
13454
- const middlewareRoutesPromise = discoverMiddlewareRoutes(_chunkQMR2TUVZcjs.getFarmAppDirectories.call(void 0, config));
13664
+ const middlewareRoutesPromise = discoverMiddlewareRoutes(_chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, config));
13455
13665
  const configuredResponseRoutesPromise = Promise.all([config.redirects(), config.rewrites()]);
13456
13666
  const docsPrerenderPagesPromise = getFarmDocsPrerenderPages(config, root, preset);
13457
- const farmWorkflows = await _chunkCKNZJFK5cjs.prepareFarmWorkflowsForNitro.call(void 0, config);
13458
- const farmCron = await _chunkCYNQPKA4cjs.prepareFarmCronForNitro.call(void 0, config);
13667
+ const farmWorkflows = await _chunkBSX5OGSDcjs.prepareFarmWorkflowsForNitro.call(void 0, config);
13668
+ const farmCron = await _chunk5ZHC6QGDcjs.prepareFarmCronForNitro.call(void 0, config);
13459
13669
  const [
13460
13670
  { ssg: ssgPages },
13461
13671
  middlewareRoutes,
@@ -13485,7 +13695,7 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
13485
13695
  const edgeGuardedPrerenderRoutes = [];
13486
13696
  const addPrerenderRoute = (pathname) => {
13487
13697
  prerenderRoutes.push(pathname);
13488
- if (_chunk6ZFGWB75cjs.appMiddlewareMayHandlePath.call(void 0, edgeMiddlewareRoutes, pathname)) {
13698
+ if (_chunkOFVCWV2Dcjs.appMiddlewareMayHandlePath.call(void 0, edgeMiddlewareRoutes, pathname)) {
13489
13699
  edgeGuardedPrerenderRoutes.push(pathname);
13490
13700
  }
13491
13701
  };
@@ -13527,29 +13737,29 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
13527
13737
  addPrerenderRoute(pathname);
13528
13738
  }
13529
13739
  for (const skipped of skippedPrerenderRoutes) {
13530
- _chunkGC5ROI3Acjs.logger.info(`\u21AA Keeping SSG route ${skipped.pathname} server-handled (${skipped.reason})`);
13740
+ _chunk7U4XF76Rcjs.logger.info(`\u21AA Keeping SSG route ${skipped.pathname} server-handled (${skipped.reason})`);
13531
13741
  }
13532
13742
  if (farmWorkflows.workflows.length > 0) {
13533
- _chunkGC5ROI3Acjs.logger.info(`\u23F1\uFE0F Found ${farmWorkflows.workflows.length} Farm workflow task(s)`);
13743
+ _chunk7U4XF76Rcjs.logger.info(`\u23F1\uFE0F Found ${farmWorkflows.workflows.length} Farm workflow task(s)`);
13534
13744
  }
13535
13745
  if (farmCron.jobs.length > 0 && farmCron.provider === "farmjs") {
13536
- _chunkGC5ROI3Acjs.logger.info(
13746
+ _chunk7U4XF76Rcjs.logger.info(
13537
13747
  `\u23F1\uFE0F ${farmCron.jobs.length} Farm cron job(s) for Infra; run farm cron sync after deployment`
13538
13748
  );
13539
13749
  } else if (farmCron.jobs.length > 0) {
13540
- _chunkGC5ROI3Acjs.logger.info(`\u23F1\uFE0F Configured ${farmCron.jobs.length} Farm cron route(s)`);
13750
+ _chunk7U4XF76Rcjs.logger.info(`\u23F1\uFE0F Configured ${farmCron.jobs.length} Farm cron route(s)`);
13541
13751
  }
13542
13752
  if (preset === "cloudflare-pages" && farmCron.jobs.length > 0 && farmCron.provider === "host") {
13543
- _chunkGC5ROI3Acjs.logger.warn(
13753
+ _chunk7U4XF76Rcjs.logger.warn(
13544
13754
  "Cloudflare Pages does not install Cron Triggers. Use the cloudflare-module preset or an external scheduler with .farm/cron-manifest.json."
13545
13755
  );
13546
13756
  }
13547
- const portableScheduledTasks = _chunkCYNQPKA4cjs.mergeScheduledTasks.call(void 0,
13757
+ const portableScheduledTasks = _chunk5ZHC6QGDcjs.mergeScheduledTasks.call(void 0,
13548
13758
  farmWorkflows.scheduledTasks,
13549
13759
  farmCron.scheduledTasks
13550
13760
  );
13551
- const scheduledTasks = preset.startsWith("cloudflare") ? _chunkCYNQPKA4cjs.toFarmCronCloudflareScheduledTasks.call(void 0, portableScheduledTasks) : portableScheduledTasks;
13552
- const cloudflareCronConfig = farmCron.provider === "host" ? _chunkCYNQPKA4cjs.createFarmCronCloudflareConfig.call(void 0, farmCron.jobs) : void 0;
13761
+ const scheduledTasks = preset.startsWith("cloudflare") ? _chunk5ZHC6QGDcjs.toFarmCronCloudflareScheduledTasks.call(void 0, portableScheduledTasks) : portableScheduledTasks;
13762
+ const cloudflareCronConfig = farmCron.provider === "host" ? _chunk5ZHC6QGDcjs.createFarmCronCloudflareConfig.call(void 0, farmCron.jobs) : void 0;
13553
13763
  const [
13554
13764
  clientCssHref,
13555
13765
  clientJsSrc,
@@ -13576,7 +13786,7 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
13576
13786
  webEntry: clientJsSrc,
13577
13787
  webBoot: clientBootSrc,
13578
13788
  stylesheet: clientCssHref,
13579
- webFiles: _nullishCoalesce(_optionalChain([clientModulePreloads, 'optionalAccess', _308 => _308.files]), () => ( []))
13789
+ webFiles: _nullishCoalesce(_optionalChain([clientModulePreloads, 'optionalAccess', _310 => _310.files]), () => ( []))
13580
13790
  })
13581
13791
  ) : null;
13582
13792
  for (const output of Object.values(ssrBundle)) {
@@ -13899,7 +14109,7 @@ function toFarmNodeResponse(request, response) {
13899
14109
  varyFarmNitroCacheRules(_chunkIIHZ2BEEcjs.routeRulesToNitroRouteRules.call(void 0, config.routeRules), [
13900
14110
  ...config.md.enabled ? ["accept"] : [],
13901
14111
  ...shouldBuildFarmMobileClient(config) ? ["x-farm-shell"] : [],
13902
- ..._chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _309 => _309.experimental, 'optionalAccess', _310 => _310.serverComponents])) === "islands" ? ["f-layouts"] : []
14112
+ ..._chunkRE5E2G5Scjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _311 => _311.experimental, 'optionalAccess', _312 => _312.serverComponents])) === "islands" ? ["f-layouts"] : []
13903
14113
  ]),
13904
14114
  config.basePath,
13905
14115
  _chunk2OF5RPVUcjs.resolveFarmAPIServerBasePath.call(void 0, config.api)
@@ -13927,6 +14137,7 @@ function toFarmNodeResponse(request, response) {
13927
14137
  ];
13928
14138
  })
13929
14139
  );
14140
+ if (preset === "node-server") await writeFarmClientBrotliAssets(clientOutputDir);
13930
14141
  const immutableAssets = isVercel ? { publicAssets: [], routeRules: {} } : planFarmImmutableAssets({
13931
14142
  clientOutputDir,
13932
14143
  files: await listFarmClientOutputFiles(clientOutputDir),
@@ -13960,11 +14171,13 @@ function toFarmNodeResponse(request, response) {
13960
14171
  // Nitro gives the root directory no Cache-Control on any preset (it falls through to the
13961
14172
  // app), so public files keep revalidating; the hashed directories carry their own maxAge.
13962
14173
  publicAssets: [{ dir: clientOutputDir, baseURL: "/" }, ...immutableAssets.publicAssets],
13963
- // A self-hosted Node server sends static files itself, so precompress them
13964
- // with gzip and let Nitro serve that by Accept-Encoding. Brotli at Nitro's
13965
- // fixed top quality cost a docs app ~20 s of build CPU for a small further
13966
- // saving. Serverless and edge targets sit behind a CDN that compresses.
13967
- ...preset === "node-server" ? { compressPublicAssets: { gzip: true } } : {},
14174
+ // A self-hosted Node or Bun server sends static files itself, so precompress
14175
+ // them with gzip and let Nitro serve that by Accept-Encoding. Brotli at Nitro's
14176
+ // fixed top quality on every file cost a docs app ~20 s of build CPU, so only
14177
+ // client scripts and stylesheets get a brotli copy, on node-server
14178
+ // (writeFarmClientBrotliAssets). Serverless and edge targets sit behind a CDN
14179
+ // that compresses.
14180
+ ...preset === "node-server" || preset === "bun" ? { compressPublicAssets: { gzip: true } } : {},
13968
14181
  // Nitro gzips every server output file at level 9, node_modules included, to
13969
14182
  // print sizes after the build. A self-hosted server is never shipped compressed,
13970
14183
  // so list plain sizes; zipped serverless and edge bundles keep the gzip column.
@@ -14002,7 +14215,7 @@ function toFarmNodeResponse(request, response) {
14002
14215
  } : {},
14003
14216
  // Use serverHandlers to define our workflow handler first, then the catch-all handler.
14004
14217
  handlers: [
14005
- ...farmCloudflareEnvPath ? [{ route: "/**", middleware: true, handler: _chunkGC5ROI3Acjs.toPosixPath.call(void 0, farmCloudflareEnvPath) }] : [],
14218
+ ...farmCloudflareEnvPath ? [{ route: "/**", middleware: true, handler: _chunk7U4XF76Rcjs.toPosixPath.call(void 0, farmCloudflareEnvPath) }] : [],
14006
14219
  ...farmWorkflows.handlerPath ? [
14007
14220
  {
14008
14221
  route: `${config.workflows.route}/**`,
@@ -14011,7 +14224,7 @@ function toFarmNodeResponse(request, response) {
14011
14224
  ] : [],
14012
14225
  {
14013
14226
  route: "/**",
14014
- handler: _chunkGC5ROI3Acjs.toPosixPath.call(void 0, nitroEntryPath)
14227
+ handler: _chunk7U4XF76Rcjs.toPosixPath.call(void 0, nitroEntryPath)
14015
14228
  }
14016
14229
  ],
14017
14230
  routeRules: {
@@ -14060,22 +14273,22 @@ function toFarmNodeResponse(request, response) {
14060
14273
  snapshotSSRRebundleOptions(nitroConfig)
14061
14274
  );
14062
14275
  const requestedBuilder = _nullishCoalesce(nitroConfig.builder, () => ( process.env.NITRO_BUILDER));
14063
- const nitroBuildIsFarms = (requestedBuilder === void 0 || requestedBuilder === "rollup" || requestedBuilder === "rolldown") && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig && !hasUnsupportedSSRRebundleOverrides && _optionalChain([nitroConfig, 'access', _311 => _311.rollupConfig, 'optionalAccess', _312 => _312.external]) === nitroRollupExternal && !hasRollupPlugins(_optionalChain([nitroConfig, 'access', _313 => _313.rollupConfig, 'optionalAccess', _314 => _314.plugins])) && customRollupKeys.length === 0 && Boolean(
14064
- _optionalChain([nitroConfig, 'access', _315 => _315.handlers, 'optionalAccess', _316 => _316.some, 'call', _317 => _317(
14065
- (handler) => _path2.default.resolve(_optionalChain([handler, 'optionalAccess', _318 => _318.handler]) || "") === nitroEntryPath
14276
+ const nitroBuildIsFarms = (requestedBuilder === void 0 || requestedBuilder === "rollup" || requestedBuilder === "rolldown") && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig && !hasUnsupportedSSRRebundleOverrides && _optionalChain([nitroConfig, 'access', _313 => _313.rollupConfig, 'optionalAccess', _314 => _314.external]) === nitroRollupExternal && !hasRollupPlugins(_optionalChain([nitroConfig, 'access', _315 => _315.rollupConfig, 'optionalAccess', _316 => _316.plugins])) && customRollupKeys.length === 0 && Boolean(
14277
+ _optionalChain([nitroConfig, 'access', _317 => _317.handlers, 'optionalAccess', _318 => _318.some, 'call', _319 => _319(
14278
+ (handler) => _path2.default.resolve(_optionalChain([handler, 'optionalAccess', _320 => _320.handler]) || "") === nitroEntryPath
14066
14279
  )])
14067
14280
  );
14068
- const canReusePrebuiltSSR = isPrebuiltSSRCandidate && nitroConfig.preset === "node-server" && nitroBuildIsFarms && _path2.default.resolve(_optionalChain([nitroConfig, 'access', _319 => _319.output, 'optionalAccess', _320 => _320.serverDir]) || "") === _path2.default.resolve(expectedServerDir);
14281
+ const canReusePrebuiltSSR = isPrebuiltSSRCandidate && nitroConfig.preset === "node-server" && nitroBuildIsFarms && _path2.default.resolve(_optionalChain([nitroConfig, 'access', _321 => _321.output, 'optionalAccess', _322 => _322.serverDir]) || "") === _path2.default.resolve(expectedServerDir);
14069
14282
  const prerenderReusesPrebuiltSSR = prerenderRoutes.length > 0 && ssrExternalsArePackaged && nitroBuildIsFarms;
14070
14283
  const selectRolldownBuilder = canReusePrebuiltSSR && requestedBuilder === void 0 && await canUseRolldownBuilder();
14071
14284
  if (selectRolldownBuilder) nitroConfig.builder = "rolldown";
14072
14285
  const useRolldownBuilder = canReusePrebuiltSSR && (_nullishCoalesce(nitroConfig.builder, () => ( process.env.NITRO_BUILDER))) === "rolldown";
14073
14286
  const shouldMinify = nitroConfig.minify !== false;
14074
- const keepServerNames = !(_optionalChain([config, 'access', _321 => _321.docs, 'optionalAccess', _322 => _322.enabled]) && _optionalChain([config, 'access', _323 => _323.docs, 'access', _324 => _324.adapter, 'optionalAccess', _325 => _325.server]));
14287
+ const keepServerNames = !(_optionalChain([config, 'access', _323 => _323.docs, 'optionalAccess', _324 => _324.enabled]) && _optionalChain([config, 'access', _325 => _325.docs, 'access', _326 => _326.adapter, 'optionalAccess', _327 => _327.server]));
14075
14288
  const useFarmServerMinifier = shouldMinify && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig;
14076
14289
  const serverChunkMinifier = useFarmServerMinifier ? createServerChunkMinifyPlugin({ keepNames: keepServerNames, target: "esnext" }) : null;
14077
14290
  const ssrRollupPlugin = canReusePrebuiltSSR ? prebuiltSSRPlugin : createServerReadSSRAssetsPlugin(ssrBundle, ssrOutputDir);
14078
- const configuredRollupPlugins = _optionalChain([nitroConfig, 'access', _326 => _326.rollupConfig, 'optionalAccess', _327 => _327.plugins]);
14291
+ const configuredRollupPlugins = _optionalChain([nitroConfig, 'access', _328 => _328.rollupConfig, 'optionalAccess', _329 => _329.plugins]);
14079
14292
  nitroConfig.rollupConfig = {
14080
14293
  ...nitroConfig.rollupConfig,
14081
14294
  plugins: [
@@ -14114,21 +14327,21 @@ function toFarmNodeResponse(request, response) {
14114
14327
  let skippedNonHtmlPrerenderRoute = false;
14115
14328
  nitroInstance.hooks.hook("prerender:generate", (route) => {
14116
14329
  if (route.error || !prerenderPagePaths.has(route.route)) return;
14117
- if (_optionalChain([route, 'access', _328 => _328.contentType, 'optionalAccess', _329 => _329.toLowerCase, 'call', _330 => _330(), 'access', _331 => _331.includes, 'call', _332 => _332("html")])) return;
14330
+ if (_optionalChain([route, 'access', _330 => _330.contentType, 'optionalAccess', _331 => _331.toLowerCase, 'call', _332 => _332(), 'access', _333 => _333.includes, 'call', _334 => _334("html")])) return;
14118
14331
  route.skip = true;
14119
14332
  skippedNonHtmlPrerenderRoute = true;
14120
14333
  const configuredRule = configuredNitroRouteRules[route.route];
14121
14334
  if (configuredRule) nitroInstance.options.routeRules[route.route] = configuredRule;
14122
14335
  else delete nitroInstance.options.routeRules[route.route];
14123
- _chunkGC5ROI3Acjs.logger.info(`\u21AA Keeping SSG route ${route.route} server-handled (it does not render HTML)`);
14336
+ _chunk7U4XF76Rcjs.logger.info(`\u21AA Keeping SSG route ${route.route} server-handled (it does not render HTML)`);
14124
14337
  });
14125
14338
  nitroInstance.hooks.hook("prerender:done", () => {
14126
14339
  if (skippedNonHtmlPrerenderRoute) nitroInstance.routing.sync();
14127
14340
  });
14128
- if (_optionalChain([config, 'access', _333 => _333.md, 'optionalAccess', _334 => _334.enabled])) {
14341
+ if (_optionalChain([config, 'access', _335 => _335.md, 'optionalAccess', _336 => _336.enabled])) {
14129
14342
  nitroInstance.hooks.hook("prerender:generate", (route) => {
14130
- if (!route.contents || !_optionalChain([route, 'access', _335 => _335.contentType, 'optionalAccess', _336 => _336.toLowerCase, 'call', _337 => _337(), 'access', _338 => _338.includes, 'call', _339 => _339("html")])) return;
14131
- const alternatePath = _chunk2YJ4DHTDcjs.getFarmMarkdownAlternatePath.call(void 0, config.md, route.route, {
14343
+ if (!route.contents || !_optionalChain([route, 'access', _337 => _337.contentType, 'optionalAccess', _338 => _338.toLowerCase, 'call', _339 => _339(), 'access', _340 => _340.includes, 'call', _341 => _341("html")])) return;
14344
+ const alternatePath = _chunk2NOHVIJ3cjs.getFarmMarkdownAlternatePath.call(void 0, config.md, route.route, {
14132
14345
  routePathname: (pathname) => routeManager.toRoutePathname(pathname)
14133
14346
  });
14134
14347
  if (!alternatePath) return;
@@ -14150,7 +14363,7 @@ function toFarmNodeResponse(request, response) {
14150
14363
  }
14151
14364
  if (config.security.csp && config.security.csp.nonce) {
14152
14365
  nitroInstance.hooks.hook("prerender:generate", async (route) => {
14153
- if (!route.contents || !_optionalChain([route, 'access', _340 => _340.contentType, 'optionalAccess', _341 => _341.toLowerCase, 'call', _342 => _342(), 'access', _343 => _343.includes, 'call', _344 => _344("html")])) return;
14366
+ if (!route.contents || !_optionalChain([route, 'access', _342 => _342.contentType, 'optionalAccess', _343 => _343.toLowerCase, 'call', _344 => _344(), 'access', _345 => _345.includes, 'call', _346 => _346("html")])) return;
14154
14367
  const staticCsp = await _chunk6JHZPB52cjs.applyFarmCspHashesToHtml.call(void 0, route.contents, config.security);
14155
14368
  if (!staticCsp) return;
14156
14369
  route.contents = staticCsp.html;
@@ -14186,7 +14399,7 @@ function toFarmNodeResponse(request, response) {
14186
14399
  await nitroBuilder.copyPublicAssets(nitroInstance);
14187
14400
  if (prerenderReusesPrebuiltSSR && !canReusePrebuiltSSR) {
14188
14401
  nitroInstance.hooks.hook("prerender:config", (prerendererConfig) => {
14189
- const configuredPlugins = _optionalChain([prerendererConfig, 'access', _345 => _345.rollupConfig, 'optionalAccess', _346 => _346.plugins]);
14402
+ const configuredPlugins = _optionalChain([prerendererConfig, 'access', _347 => _347.rollupConfig, 'optionalAccess', _348 => _348.plugins]);
14190
14403
  const plugins = Array.isArray(configuredPlugins) ? configuredPlugins : configuredPlugins ? [configuredPlugins] : [];
14191
14404
  prerendererConfig.rollupConfig = {
14192
14405
  ...prerendererConfig.rollupConfig,
@@ -14242,14 +14455,14 @@ function toFarmNodeResponse(request, response) {
14242
14455
  });
14243
14456
  }
14244
14457
  if (prerenderRoutes.length > 0) {
14245
- _chunkGC5ROI3Acjs.logger.info(`\u{1F4C4} Pre-rendering ${prerenderRoutes.length} SSG page(s)`);
14246
- const previousPrerender = process.env[_chunkNNGBTJCXcjs.FARM_PRERENDER_ENV];
14247
- process.env[_chunkNNGBTJCXcjs.FARM_PRERENDER_ENV] = "1";
14458
+ _chunk7U4XF76Rcjs.logger.info(`\u{1F4C4} Pre-rendering ${prerenderRoutes.length} SSG page(s)`);
14459
+ const previousPrerender = process.env[_chunkW6C3LEXXcjs.FARM_PRERENDER_ENV];
14460
+ process.env[_chunkW6C3LEXXcjs.FARM_PRERENDER_ENV] = "1";
14248
14461
  try {
14249
14462
  await nitroBuilder.prerender(nitroInstance);
14250
14463
  } finally {
14251
- if (previousPrerender === void 0) delete process.env[_chunkNNGBTJCXcjs.FARM_PRERENDER_ENV];
14252
- else process.env[_chunkNNGBTJCXcjs.FARM_PRERENDER_ENV] = previousPrerender;
14464
+ if (previousPrerender === void 0) delete process.env[_chunkW6C3LEXXcjs.FARM_PRERENDER_ENV];
14465
+ else process.env[_chunkW6C3LEXXcjs.FARM_PRERENDER_ENV] = previousPrerender;
14253
14466
  }
14254
14467
  }
14255
14468
  const sharpRuntimeStagePromise = imageRuntime === "node" ? stageSharpRuntime(config, root, distDir, fs5, preset) : Promise.resolve(null);
@@ -14301,10 +14514,10 @@ function toFarmNodeResponse(request, response) {
14301
14514
  if (failedCopy) throw failedCopy.reason;
14302
14515
  if (canReusePrebuiltSSR) {
14303
14516
  await registerPrebuiltSSRPackageImport(_path2.default.join(outputDir, "server"), ssrEntryFile, fs5);
14304
- _chunkGC5ROI3Acjs.logger.info("\u26A1 Reused Farm's prebuilt SSR bundle for the Node output");
14517
+ _chunk7U4XF76Rcjs.logger.info("\u26A1 Reused Farm's prebuilt SSR bundle for the Node output");
14305
14518
  }
14306
14519
  if (useRolldownBuilder) {
14307
- _chunkGC5ROI3Acjs.logger.info("\u26A1 Built the Node adapter with Rolldown");
14520
+ _chunk7U4XF76Rcjs.logger.info("\u26A1 Built the Node adapter with Rolldown");
14308
14521
  }
14309
14522
  if (preset === "node-server" && !desktopServerEntry) {
14310
14523
  await installFarmCompileCacheLauncher(_path2.default.join(outputDir, "server"), fs5);
@@ -14337,7 +14550,7 @@ function toFarmNodeResponse(request, response) {
14337
14550
  prerenderRoutes.map(toPrerenderPublicPath)
14338
14551
  );
14339
14552
  }
14340
- _chunkGC5ROI3Acjs.logger.success(`\u2705 Nitro build completed with preset: ${preset}`);
14553
+ _chunk7U4XF76Rcjs.logger.success(`\u2705 Nitro build completed with preset: ${preset}`);
14341
14554
  }
14342
14555
  function resolveFarmNitroOutputConfig(preset, outputDir) {
14343
14556
  const isVercel = preset === "vercel";
@@ -14426,7 +14639,7 @@ async function moveVercelOutputPath(src, dest, fs5) {
14426
14639
  await fs5.rename(src, dest);
14427
14640
  return;
14428
14641
  } catch (error) {
14429
- const code = _optionalChain([error, 'optionalAccess', _347 => _347.code]);
14642
+ const code = _optionalChain([error, 'optionalAccess', _349 => _349.code]);
14430
14643
  if (code !== "EPERM" && code !== "EACCES" && code !== "EXDEV" && code !== "ENOTEMPTY") {
14431
14644
  throw error;
14432
14645
  }
@@ -14452,7 +14665,7 @@ async function postProcessVercelOutput(root, outputDir, fs5, config, farmWorkflo
14452
14665
  try {
14453
14666
  await moveVercelOutputPath(publicDir, staticDir, fs5);
14454
14667
  } catch (error) {
14455
- if (_optionalChain([error, 'optionalAccess', _348 => _348.code]) !== "ENOENT") throw error;
14668
+ if (_optionalChain([error, 'optionalAccess', _350 => _350.code]) !== "ENOENT") throw error;
14456
14669
  }
14457
14670
  await copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs5);
14458
14671
  await copyPrismaClientForVercel(root, nitroFuncDir, fs5);
@@ -14466,7 +14679,7 @@ async function postProcessVercelOutput(root, outputDir, fs5, config, farmWorkflo
14466
14679
  config.basePath
14467
14680
  );
14468
14681
  const edgeMiddlewareRoutes = edgeMiddleware.middlewareRoutes.filter(
14469
- (route) => edgeMiddleware.guardedPages.some((pathname) => _chunk6ZFGWB75cjs.appMiddlewareMayHandlePath.call(void 0, [route], pathname))
14682
+ (route) => edgeMiddleware.guardedPages.some((pathname) => _chunkOFVCWV2Dcjs.appMiddlewareMayHandlePath.call(void 0, [route], pathname))
14470
14683
  );
14471
14684
  if (edgeMiddlewareRoutes.length > 0) {
14472
14685
  await writeFarmVercelEdgeMiddlewareFunction({
@@ -14485,17 +14698,17 @@ async function postProcessVercelOutput(root, outputDir, fs5, config, farmWorkflo
14485
14698
  middlewareRoutes: edgeMiddlewareRoutes.length > 0 ? createFarmVercelEdgeMiddlewareRoutes(edgeMiddleware.guardedPages, config.basePath) : [],
14486
14699
  canonicalSlashRoutes: createFarmVercelCanonicalSlashRoutes(prerenderedPages)
14487
14700
  });
14488
- const vercelConfigWithWorkflowCrons = _chunkCKNZJFK5cjs.applyFarmWorkflowVercelCrons.call(void 0,
14701
+ const vercelConfigWithWorkflowCrons = _chunkBSX5OGSDcjs.applyFarmWorkflowVercelCrons.call(void 0,
14489
14702
  vercelConfig,
14490
14703
  farmWorkflows.workflows
14491
14704
  );
14492
- const vercelConfigWithCrons = _chunkCYNQPKA4cjs.applyFarmCronVercelCrons.call(void 0, vercelConfigWithWorkflowCrons, cronJobs);
14705
+ const vercelConfigWithCrons = _chunk5ZHC6QGDcjs.applyFarmCronVercelCrons.call(void 0, vercelConfigWithWorkflowCrons, cronJobs);
14493
14706
  await fs5.writeFile(configPath, JSON.stringify(vercelConfigWithCrons, null, 2));
14494
- _chunkGC5ROI3Acjs.logger.info("\u2705 Post-processed Vercel output for Build Output API v3");
14707
+ _chunk7U4XF76Rcjs.logger.info("\u2705 Post-processed Vercel output for Build Output API v3");
14495
14708
  }
14496
14709
  async function copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs5) {
14497
- if (!_optionalChain([config, 'access', _349 => _349.docs, 'optionalAccess', _350 => _350.enabled])) return;
14498
- const [mainRoot, ...extraRoots] = _chunk6D3CJFNUcjs.getFarmDocsRoots.call(void 0, config.docs);
14710
+ if (!_optionalChain([config, 'access', _351 => _351.docs, 'optionalAccess', _352 => _352.enabled])) return;
14711
+ const [mainRoot, ...extraRoots] = _chunkHR5GU4UUcjs.getFarmDocsRoots.call(void 0, config.docs);
14499
14712
  await copyFarmDocsRootContent(
14500
14713
  mainRoot,
14501
14714
  root,
@@ -14516,12 +14729,12 @@ async function copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs5) {
14516
14729
  async function copyFarmDocsRootContent(docs, root, srcDir, bundledContentDir, fs5) {
14517
14730
  const docsContentDir = resolveBuildDocsContentDir(docs, root, srcDir);
14518
14731
  if (!docsContentDir) return;
14519
- const lastModifiedManifest = _chunk6D3CJFNUcjs.createFarmDocsLastModifiedManifest.call(void 0, docsContentDir, {
14732
+ const lastModifiedManifest = _chunkHR5GU4UUcjs.createFarmDocsLastModifiedManifest.call(void 0, docsContentDir, {
14520
14733
  fallback: "now"
14521
14734
  });
14522
- const undatedPages = _nullishCoalesce(_optionalChain([lastModifiedManifest, 'access', _351 => _351.unknown, 'optionalAccess', _352 => _352.length]), () => ( 0));
14735
+ const undatedPages = _nullishCoalesce(_optionalChain([lastModifiedManifest, 'access', _353 => _353.unknown, 'optionalAccess', _354 => _354.length]), () => ( 0));
14523
14736
  if (undatedPages > 0) {
14524
- _chunkGC5ROI3Acjs.logger.warn(
14737
+ _chunk7U4XF76Rcjs.logger.warn(
14525
14738
  `${undatedPages} docs page(s) were last changed before this shallow clone's Git history, so they show no "Last updated" date. Build from a full clone (git fetch --unshallow) or set lastModified in the page's frontmatter.`
14526
14739
  );
14527
14740
  }
@@ -14533,11 +14746,11 @@ async function copyFarmDocsRootContent(docs, root, srcDir, bundledContentDir, fs
14533
14746
  dereference: true
14534
14747
  });
14535
14748
  await fs5.writeFile(
14536
- _path2.default.join(bundledContentDir, _chunk6D3CJFNUcjs.FARM_DOCS_LAST_MODIFIED_MANIFEST),
14749
+ _path2.default.join(bundledContentDir, _chunkHR5GU4UUcjs.FARM_DOCS_LAST_MODIFIED_MANIFEST),
14537
14750
  `${JSON.stringify(lastModifiedManifest, null, 2)}
14538
14751
  `
14539
14752
  );
14540
- _chunkGC5ROI3Acjs.logger.info(`\u{1F4DA} Bundled docs content for Vercel: ${_path2.default.relative(root, docsContentDir)}`);
14753
+ _chunk7U4XF76Rcjs.logger.info(`\u{1F4DA} Bundled docs content for Vercel: ${_path2.default.relative(root, docsContentDir)}`);
14541
14754
  }
14542
14755
  function resolveServerFunctionPlatform(preset) {
14543
14756
  return preset === "vercel" || preset === "netlify" ? { os: "linux", cpu: "x64", libc: "glibc" } : null;
@@ -14604,7 +14817,7 @@ async function stageSharpRuntime(config, root, distDir, fs5, preset) {
14604
14817
  try {
14605
14818
  await copyPackage("sharp", sharpRequire);
14606
14819
  if (!copiedPackages.has("sharp")) {
14607
- throw new Error(`Farm image optimization requires sharp. ${_chunkHVMQAVZKcjs.SHARP_INSTALL_HINT}`);
14820
+ throw new Error(`Farm image optimization requires sharp. ${_chunkCL7BUGVBcjs.SHARP_INSTALL_HINT}`);
14608
14821
  }
14609
14822
  } catch (error) {
14610
14823
  await fs5.rm(stageDir, { recursive: true, force: true });
@@ -14631,7 +14844,7 @@ async function installStagedSharpRuntime(staged, nitroFuncDir, fs5) {
14631
14844
  } finally {
14632
14845
  await fs5.rm(staged.stageDir, { recursive: true, force: true });
14633
14846
  }
14634
- _chunkGC5ROI3Acjs.logger.info(
14847
+ _chunk7U4XF76Rcjs.logger.info(
14635
14848
  `\u{1F5BC}\uFE0F Bundled Sharp image runtime (${Object.keys(staged.dependencies).length} packages)`
14636
14849
  );
14637
14850
  }
@@ -14675,7 +14888,7 @@ async function mergeStagedDirectory(sourceDir, targetDir, fs5) {
14675
14888
  function assertMetadataImageRuntimeInstalled(root, metadataImageRoutes) {
14676
14889
  const generated = metadataImageRoutes.find((image) => image.sourceType === "module");
14677
14890
  if (!generated || resolveMetadataImageRuntimePackageJson(root)) return;
14678
- const file = generated.modulePath ? _chunkGC5ROI3Acjs.toPosixPath.call(void 0, _path2.default.relative(root, generated.modulePath)) : "";
14891
+ const file = generated.modulePath ? _chunk7U4XF76Rcjs.toPosixPath.call(void 0, _path2.default.relative(root, generated.modulePath)) : "";
14679
14892
  throw new Error(
14680
14893
  `${file || "A generated metadata image"} renders with @vercel/og, which is not installed. ${_chunkKORZ6PREcjs.VERCEL_OG_INSTALL_HINT}`
14681
14894
  );
@@ -14709,7 +14922,7 @@ async function copyMetadataImageRuntime(root, nitroFuncDir, fs5) {
14709
14922
  "@vercel/og": String(packageJson.version || "0.11.1")
14710
14923
  };
14711
14924
  await writeNitroOutputPackage(nitroFuncDir, functionPackage, fs5);
14712
- _chunkGC5ROI3Acjs.logger.info("\u{1F5BC}\uFE0F Bundled generated metadata image runtime");
14925
+ _chunk7U4XF76Rcjs.logger.info("\u{1F5BC}\uFE0F Bundled generated metadata image runtime");
14713
14926
  }
14714
14927
  async function readNitroOutputPackage(outputDir, fs5) {
14715
14928
  const packagePath = _path2.default.join(outputDir, "package.json");
@@ -14805,9 +15018,9 @@ async function copyPrismaClientForVercel(root, nitroFuncDir, fs5) {
14805
15018
  };
14806
15019
  await writeNitroOutputPackage(nitroFuncDir, functionPackage, fs5);
14807
15020
  }
14808
- function islandsActionKeyCode() {
15021
+ function islandsActionKeyCode(runtimeModule) {
14809
15022
  const key = _crypto.randomBytes.call(void 0, 32).toString("base64url");
14810
- return `import { setBuildDefaults as __farmIslxBuildDefaults } from "@farm.js/core/internal/islx-server";
15023
+ return `import { setBuildDefaults as __farmIslxBuildDefaults } from ${JSON.stringify(runtimeModule)};
14811
15024
  __farmIslxBuildDefaults({ key: ${JSON.stringify(key)} });`;
14812
15025
  }
14813
15026
 
@@ -14837,7 +15050,7 @@ async function createFarmProjectModuleSsrEnvironment() {
14837
15050
  // src/build/index.ts
14838
15051
  async function build(config, options = {}) {
14839
15052
  return _chunkNG2EZ6QScjs.withProductionNodeEnv.call(void 0,
14840
- () => _chunkODYKCC6Wcjs.withPackageClientBoundaryCache.call(void 0, () => buildWithProductionNodeEnv(config, options))
15053
+ () => _chunk46UV2E7Icjs.withPackageClientBoundaryCache.call(void 0, () => buildWithProductionNodeEnv(config, options))
14841
15054
  );
14842
15055
  }
14843
15056
  function createBuildTargetBaseline(config) {
@@ -14848,7 +15061,7 @@ function createBuildTargetBaseline(config) {
14848
15061
  preset,
14849
15062
  distDir,
14850
15063
  outputDir,
14851
- outputWasDerived: outputDir === _chunkF7PKUP6Pcjs.getDefaultDeployOutputDir.call(void 0, config.deploy.target, preset, distDir)
15064
+ outputWasDerived: outputDir === _chunkMOGRRZMWcjs.getDefaultDeployOutputDir.call(void 0, config.deploy.target, preset, distDir)
14852
15065
  };
14853
15066
  }
14854
15067
  function resolveBuildTargets(config, options, baseline) {
@@ -14857,8 +15070,8 @@ function resolveBuildTargets(config, options, baseline) {
14857
15070
  const distDir = config.distDir || ".farm";
14858
15071
  const outputWasReplaced = config.deploy.outputDir !== baseline.outputDir;
14859
15072
  const shouldRefreshDerivedOutput = baseline.outputWasDerived && !outputWasReplaced && (preset !== baseline.preset || distDir !== baseline.distDir);
14860
- const deployTarget = preset === config.deploy.preset ? config.deploy.target : _chunkF7PKUP6Pcjs.getDeployTargetForPreset.call(void 0, preset);
14861
- const outputDir = shouldRefreshDerivedOutput ? _chunkF7PKUP6Pcjs.getDefaultDeployOutputDir.call(void 0, deployTarget, preset, distDir) : config.deploy.outputDir;
15073
+ const deployTarget = preset === config.deploy.preset ? config.deploy.target : _chunkMOGRRZMWcjs.getDeployTargetForPreset.call(void 0, preset);
15074
+ const outputDir = shouldRefreshDerivedOutput ? _chunkMOGRRZMWcjs.getDefaultDeployOutputDir.call(void 0, deployTarget, preset, distDir) : config.deploy.outputDir;
14862
15075
  return {
14863
15076
  root,
14864
15077
  preset,
@@ -14866,7 +15079,7 @@ function resolveBuildTargets(config, options, baseline) {
14866
15079
  distDir,
14867
15080
  deployTarget,
14868
15081
  outputDir,
14869
- deployOutputDir: _chunkF7PKUP6Pcjs.resolveDeployOutputPath.call(void 0, root, outputDir)
15082
+ deployOutputDir: _chunkMOGRRZMWcjs.resolveDeployOutputPath.call(void 0, root, outputDir)
14870
15083
  };
14871
15084
  }
14872
15085
  async function buildWithProductionNodeEnv(inputConfig, options) {
@@ -14874,7 +15087,7 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
14874
15087
  const targetBaseline = createBuildTargetBaseline(config);
14875
15088
  let targets;
14876
15089
  const productionViteResultPromise = options.universal === false ? void 0 : Promise.allSettled([Promise.resolve(_nullishCoalesce(options.productionVite, () => ( _chunkMF3IA2AWcjs.loadFarmProductionVite.call(void 0, ))))]);
14877
- const pluginManager = new (0, _chunkCUZT7474cjs.PluginManager)({
15090
+ const pluginManager = new (0, _chunkTCMRLW3Kcjs.PluginManager)({
14878
15091
  config,
14879
15092
  isDev: false,
14880
15093
  isProd: true
@@ -14903,16 +15116,16 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
14903
15116
  };
14904
15117
  config = {
14905
15118
  ...config,
14906
- images: _chunkHVMQAVZKcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, {
15119
+ images: _chunkCL7BUGVBcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, {
14907
15120
  root: targets.root,
14908
15121
  preset: targets.preset
14909
15122
  })
14910
15123
  };
14911
- if (_optionalChain([config, 'access', _353 => _353.docs, 'optionalAccess', _354 => _354.enabled])) await _chunkNDOE76QCcjs.loadFarmDocsEngine.call(void 0, );
15124
+ if (_optionalChain([config, 'access', _355 => _355.docs, 'optionalAccess', _356 => _356.enabled])) await _chunkNDOE76QCcjs.loadFarmDocsEngine.call(void 0, );
14912
15125
  pluginManager.updateContext({ config });
14913
15126
  const { root, preset, srcDir, distDir, deployOutputDir } = targets;
14914
- _chunkODYKCC6Wcjs.usePackageClientBoundaryCacheFile.call(void 0, _chunkODYKCC6Wcjs.resolvePackageClientBoundaryCacheFile.call(void 0, root, distDir));
14915
- _chunkGC5ROI3Acjs.logger.info(`\u{1F69C} Building Farm.js application with preset: ${preset}...`);
15127
+ _chunk46UV2E7Icjs.usePackageClientBoundaryCacheFile.call(void 0, _chunk46UV2E7Icjs.resolvePackageClientBoundaryCacheFile.call(void 0, root, distDir));
15128
+ _chunk7U4XF76Rcjs.logger.info(`\u{1F69C} Building Farm.js application with preset: ${preset}...`);
14916
15129
  await pluginManager.setupPlugins();
14917
15130
  await pluginManager.runHookParallel("beforeBundle", {
14918
15131
  root,
@@ -14921,10 +15134,10 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
14921
15134
  distDir,
14922
15135
  outputDir: deployOutputDir
14923
15136
  });
14924
- _chunkGC5ROI3Acjs.logger.info("\u{1F50D} Discovering routes and API endpoints...");
15137
+ _chunk7U4XF76Rcjs.logger.info("\u{1F50D} Discovering routes and API endpoints...");
14925
15138
  const productionViteResult = productionViteResultPromise ? (await productionViteResultPromise)[0] : void 0;
14926
- if (_optionalChain([productionViteResult, 'optionalAccess', _355 => _355.status]) === "rejected") throw productionViteResult.reason;
14927
- const productionVite = _optionalChain([productionViteResult, 'optionalAccess', _356 => _356.value]);
15139
+ if (_optionalChain([productionViteResult, 'optionalAccess', _357 => _357.status]) === "rejected") throw productionViteResult.reason;
15140
+ const productionVite = _optionalChain([productionViteResult, 'optionalAccess', _358 => _358.value]);
14928
15141
  const createViteServer = productionVite ? productionVite.createServer : (await import("vite")).createServer;
14929
15142
  projectModuleServer = await createProjectModuleServer(
14930
15143
  createViteServer,
@@ -14932,30 +15145,30 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
14932
15145
  root,
14933
15146
  rendererBuild.signal
14934
15147
  );
14935
- const farmApp = _chunkHVMQAVZKcjs.createFarmApp.call(void 0, config, projectModuleServer);
15148
+ const farmApp = _chunkCL7BUGVBcjs.createFarmApp.call(void 0, config, projectModuleServer);
14936
15149
  if (options.universal !== false) farmApp.getRouteManager().keepBuildSourceSnapshot();
14937
15150
  await farmApp.initialize();
14938
15151
  const routeManager = farmApp.getRouteManager();
14939
15152
  const serverRenderer = farmApp.getServerRenderer();
14940
- const typeArtifacts = _chunkBZJYPIFZcjs.generateFarmTypeArtifacts.call(void 0, {
15153
+ const typeArtifacts = _chunkOUDNUFVRcjs.generateFarmTypeArtifacts.call(void 0, {
14941
15154
  root,
14942
15155
  srcDir,
14943
15156
  layers: config.layers,
14944
15157
  storage: config.storage,
14945
15158
  plugins: config.plugins,
14946
15159
  extraRoutes: [
14947
- ..._optionalChain([config, 'access', _357 => _357.openapi, 'optionalAccess', _358 => _358.enabled]) && config.openapi.route ? [config.openapi.route] : [],
14948
- ..._chunk6D3CJFNUcjs.getFarmDocsRouteTypeEntries.call(void 0, config.docs)
15160
+ ..._optionalChain([config, 'access', _359 => _359.openapi, 'optionalAccess', _360 => _360.enabled]) && config.openapi.route ? [config.openapi.route] : [],
15161
+ ..._chunkHR5GU4UUcjs.getFarmDocsRouteTypeEntries.call(void 0, config.docs)
14949
15162
  ],
14950
15163
  suppressLintOnLink: config.suppressLintOnLink,
14951
15164
  componentExtensions: config.renderer.componentExtensions,
14952
15165
  i18nConfig: config.i18n
14953
15166
  }).catch((error) => {
14954
15167
  const message = error instanceof Error ? error.message : String(error);
14955
- _chunkGC5ROI3Acjs.logger.warn(`Route type generation failed (farm.d.ts may be stale): ${message}`);
15168
+ _chunk7U4XF76Rcjs.logger.warn(`Route type generation failed (farm.d.ts may be stale): ${message}`);
14956
15169
  });
14957
- const apiRouteManager = new (0, _chunk5DREJN4Gcjs.APIRouteManager)(
14958
- _chunkQMR2TUVZcjs.getFarmAppDirectories.call(void 0, config),
15170
+ const apiRouteManager = new (0, _chunkLKIG5SM6cjs.APIRouteManager)(
15171
+ _chunk52Q4OB4Acjs.getFarmAppDirectories.call(void 0, config),
14959
15172
  projectModuleServer,
14960
15173
  {
14961
15174
  throwOnLoadError: true,
@@ -14980,11 +15193,11 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
14980
15193
  });
14981
15194
  } else {
14982
15195
  const { build: legacyViteBuild } = await import("vite");
14983
- _chunkGC5ROI3Acjs.logger.info("\u{1F4E6} Building client bundle...");
15196
+ _chunk7U4XF76Rcjs.logger.info("\u{1F4E6} Building client bundle...");
14984
15197
  await buildClient2(legacyViteBuild, config, root, srcDir, _path2.default.join(root, distDir, "client"));
14985
- _chunkGC5ROI3Acjs.logger.info("\u{1F4E6} Building SSR bundle...");
15198
+ _chunk7U4XF76Rcjs.logger.info("\u{1F4E6} Building SSR bundle...");
14986
15199
  await buildSSR(legacyViteBuild, config, root, srcDir, _path2.default.join(root, distDir, "server"));
14987
- _chunkGC5ROI3Acjs.logger.info(`\u{1F680} Building server with Nitro (preset: ${preset})...`);
15200
+ _chunk7U4XF76Rcjs.logger.info(`\u{1F680} Building server with Nitro (preset: ${preset})...`);
14988
15201
  await buildNitro(
14989
15202
  config,
14990
15203
  routeManager,
@@ -15005,8 +15218,8 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
15005
15218
  outputDir: deployOutputDir,
15006
15219
  success: true
15007
15220
  });
15008
- _chunkGC5ROI3Acjs.logger.success(`\u2705 Build completed successfully! (preset: ${preset})`);
15009
- _chunkGC5ROI3Acjs.logger.info(`\u{1F4C1} Output directory: ${deployOutputDir}`);
15221
+ _chunk7U4XF76Rcjs.logger.success(`\u2705 Build completed successfully! (preset: ${preset})`);
15222
+ _chunk7U4XF76Rcjs.logger.info(`\u{1F4C1} Output directory: ${deployOutputDir}`);
15010
15223
  } catch (error) {
15011
15224
  const { root, preset, distDir, deployOutputDir } = _nullishCoalesce(targets, () => ( resolveBuildTargets(config, options, targetBaseline)));
15012
15225
  await pluginManager.runHookParallel("onError", {
@@ -15025,23 +15238,23 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
15025
15238
  outputDir: deployOutputDir,
15026
15239
  success: false
15027
15240
  });
15028
- _chunkGC5ROI3Acjs.logger.error(`\u274C Build failed: ${error}`);
15241
+ _chunk7U4XF76Rcjs.logger.error(`\u274C Build failed: ${error}`);
15029
15242
  throw error;
15030
15243
  } finally {
15031
15244
  try {
15032
- await _optionalChain([projectModuleServer, 'optionalAccess', _359 => _359.close, 'call', _360 => _360()]);
15245
+ await _optionalChain([projectModuleServer, 'optionalAccess', _361 => _361.close, 'call', _362 => _362()]);
15033
15246
  } finally {
15034
15247
  rendererBuild.abort();
15035
15248
  }
15036
15249
  }
15037
15250
  }
15038
15251
  async function createProjectModuleServer(createViteServer, config, root, buildLifetime) {
15039
- const { farmServerOnlyEntriesPlugin } = await import("./vite.cjs");
15040
- const rendererVitePlugins = await _chunk67MZTLTFcjs.loadFarmRendererVitePlugins.call(void 0, config.renderer, root, {
15252
+ const { farmNavigationPlugin, farmServerOnlyEntriesPlugin } = await import("./vite.cjs");
15253
+ const rendererVitePlugins = await _chunkM6DAIE4Tcjs.loadFarmRendererVitePlugins.call(void 0, config.renderer, root, {
15041
15254
  ssr: true,
15042
15255
  buildLifetime
15043
15256
  });
15044
- const viteConfig = _chunkHVMQAVZKcjs.mergeFarmViteConfig.call(void 0,
15257
+ const viteConfig = _chunkCL7BUGVBcjs.mergeFarmViteConfig.call(void 0,
15045
15258
  {
15046
15259
  root,
15047
15260
  appType: "custom",
@@ -15053,12 +15266,12 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
15053
15266
  },
15054
15267
  plugins: [
15055
15268
  ...rendererVitePlugins,
15056
- _chunkHVMQAVZKcjs.farmFontImportsPlugin.call(void 0, {
15269
+ _chunkCL7BUGVBcjs.farmFontImportsPlugin.call(void 0, {
15057
15270
  root,
15058
15271
  basePath: config.basePath,
15059
15272
  publicDir: config.publicDir
15060
15273
  }),
15061
- _chunkODYKCC6Wcjs.farmEnvironmentFunctionsPlugin.call(void 0, ),
15274
+ _chunk46UV2E7Icjs.farmEnvironmentFunctionsPlugin.call(void 0, { renderer: config.renderer }),
15062
15275
  // Route modules load here at build time (rendering config, prerendering): `server-only`
15063
15276
  // resolves as it does in the server build. Module-entry packages load pre-bundled, as in
15064
15277
  // `farm dev`: unbundled, lucide-react alone is ~1,750 modules through the module runner,
@@ -15066,14 +15279,15 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
15066
15279
  farmServerOnlyEntriesPlugin({
15067
15280
  prebundleServerPackages: true,
15068
15281
  distDir: config.distDir || ".farm"
15069
- })
15282
+ }),
15283
+ farmNavigationPlugin(config.renderer)
15070
15284
  ],
15071
15285
  server: {
15072
15286
  middlewareMode: true,
15073
15287
  hmr: false
15074
15288
  },
15075
15289
  resolve: {
15076
- alias: _chunkHVMQAVZKcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
15290
+ alias: _chunkCL7BUGVBcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
15077
15291
  dedupe: [...config.renderer.dedupe || []]
15078
15292
  },
15079
15293
  optimizeDeps: {
@@ -15112,10 +15326,10 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
15112
15326
  noDiscovery: true
15113
15327
  },
15114
15328
  // An app or plugin that brings its own SSR environment keeps it.
15115
- environments: _optionalChain([viteConfig, 'access', _361 => _361.environments, 'optionalAccess', _362 => _362.ssr, 'optionalAccess', _363 => _363.dev, 'optionalAccess', _364 => _364.createEnvironment]) ? viteConfig.environments : {
15329
+ environments: _optionalChain([viteConfig, 'access', _363 => _363.environments, 'optionalAccess', _364 => _364.ssr, 'optionalAccess', _365 => _365.dev, 'optionalAccess', _366 => _366.createEnvironment]) ? viteConfig.environments : {
15116
15330
  ...viteConfig.environments,
15117
15331
  ssr: {
15118
- ..._optionalChain([viteConfig, 'access', _365 => _365.environments, 'optionalAccess', _366 => _366.ssr]),
15332
+ ..._optionalChain([viteConfig, 'access', _367 => _367.environments, 'optionalAccess', _368 => _368.ssr]),
15119
15333
  ...await createFarmProjectModuleSsrEnvironment()
15120
15334
  }
15121
15335
  }
@@ -15125,10 +15339,11 @@ async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
15125
15339
  const {
15126
15340
  farmI18nClientBridgePlugin,
15127
15341
  farmIslandContainersPlugin,
15342
+ farmNavigationPlugin,
15128
15343
  farmPlugin,
15129
15344
  farmServerOnlyEntriesPlugin
15130
15345
  } = await import("./vite.cjs");
15131
- const { PluginManager: PluginManager2 } = await import("./plugin-AGEFSU7K.cjs");
15346
+ const { PluginManager: PluginManager2 } = await import("./plugin-LN3JBZRR.cjs");
15132
15347
  const pluginManager = new PluginManager2({
15133
15348
  config,
15134
15349
  isDev: false,
@@ -15147,16 +15362,17 @@ async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
15147
15362
  plugins: [
15148
15363
  farmI18nClientBridgePlugin(),
15149
15364
  farmServerOnlyEntriesPlugin({ distDir: config.distDir || ".farm" }),
15365
+ farmNavigationPlugin(config.renderer),
15150
15366
  farmIslandContainersPlugin(config),
15151
15367
  farmPlugin(config, pluginManager),
15152
- _chunkODYKCC6Wcjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
15368
+ _chunk46UV2E7Icjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
15153
15369
  ],
15154
15370
  mode: "production"
15155
15371
  });
15156
15372
  }
15157
15373
  async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
15158
15374
  const { farmI18nClientBridgePlugin, farmIslandContainersPlugin, farmPlugin } = await import("./vite.cjs");
15159
- const { PluginManager: PluginManager2 } = await import("./plugin-AGEFSU7K.cjs");
15375
+ const { PluginManager: PluginManager2 } = await import("./plugin-LN3JBZRR.cjs");
15160
15376
  const pluginManager = new PluginManager2({
15161
15377
  config,
15162
15378
  isDev: false,
@@ -15177,20 +15393,20 @@ async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
15177
15393
  define: {
15178
15394
  __FARM_API_BASE_URL__: JSON.stringify(config.api.baseURL),
15179
15395
  __FARM_ENV__: JSON.stringify(_chunk3EIPOTZVcjs.createBundledEnv.call(void 0, config.env)),
15180
- __FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _367 => _367.env, 'optionalAccess', _368 => _368.public]) || {})
15396
+ __FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _369 => _369.env, 'optionalAccess', _370 => _370.public]) || {})
15181
15397
  },
15182
15398
  plugins: [
15183
15399
  farmI18nClientBridgePlugin(),
15184
15400
  farmIslandContainersPlugin(config),
15185
15401
  farmPlugin(config, pluginManager),
15186
- _chunkODYKCC6Wcjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
15402
+ _chunk46UV2E7Icjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
15187
15403
  ],
15188
15404
  mode: "production"
15189
15405
  });
15190
15406
  }
15191
15407
  function resolveLegacyPageEntry(config, root, srcDir) {
15192
15408
  const appDir = _path2.default.join(root, srcDir, "app");
15193
- for (const extension of _chunk67MZTLTFcjs.getFarmRendererComponentExtensions.call(void 0, config.renderer)) {
15409
+ for (const extension of _chunkM6DAIE4Tcjs.getFarmRendererComponentExtensions.call(void 0, config.renderer)) {
15194
15410
  const candidate = _path2.default.join(appDir, `page${extension}`);
15195
15411
  if (_fs.existsSync.call(void 0, candidate)) return candidate;
15196
15412
  }
@@ -15198,7 +15414,7 @@ function resolveLegacyPageEntry(config, root, srcDir) {
15198
15414
  }
15199
15415
  async function buildNitro(config, routeManager, apiRouteManager, serverRenderer, preset, root, distDir, pluginManager) {
15200
15416
  const [{ createNitroConfig }, { createNitro, build: nitroBuild }] = await Promise.all([
15201
- import("./nitro-NUCTYEKJ.cjs"),
15417
+ import("./nitro-XGIO6EQN.cjs"),
15202
15418
  import("nitro/builder")
15203
15419
  ]);
15204
15420
  let nitroConfig = await createNitroConfig(
@@ -15211,7 +15427,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
15211
15427
  if (pluginManager) {
15212
15428
  nitroConfig = await pluginManager.runHookSerial("beforeNitroBuild", nitroConfig);
15213
15429
  }
15214
- const outputDir = _chunkF7PKUP6Pcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
15430
+ const outputDir = _chunkMOGRRZMWcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
15215
15431
  const serverOutputDir = _path2.default.join(outputDir, "server");
15216
15432
  const publicOutputDir = _path2.default.join(outputDir, "public");
15217
15433
  const { mkdir, cp } = await import("fs/promises");
@@ -15221,7 +15437,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
15221
15437
  try {
15222
15438
  await mkdir(publicOutputDir, { recursive: true });
15223
15439
  await cp(clientDir, publicOutputDir, { recursive: true });
15224
- _chunkGC5ROI3Acjs.logger.info("\u{1F4E6} Copied client assets to public directory");
15440
+ _chunk7U4XF76Rcjs.logger.info("\u{1F4E6} Copied client assets to public directory");
15225
15441
  const manifestPath = _path2.default.join(publicOutputDir, "farm-client-manifest.json");
15226
15442
  const assetsDir = _path2.default.join(publicOutputDir, "assets");
15227
15443
  const manifestExists = await import("fs/promises").then(
@@ -15231,12 +15447,12 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
15231
15447
  (fs5) => fs5.access(assetsDir).then(() => true).catch(() => false)
15232
15448
  );
15233
15449
  if (manifestExists && assetsExist) {
15234
- _chunkGC5ROI3Acjs.logger.info("\u2705 Verified client assets are present");
15450
+ _chunk7U4XF76Rcjs.logger.info("\u2705 Verified client assets are present");
15235
15451
  } else {
15236
- _chunkGC5ROI3Acjs.logger.warn("\u26A0\uFE0F Some client assets may be missing");
15452
+ _chunk7U4XF76Rcjs.logger.warn("\u26A0\uFE0F Some client assets may be missing");
15237
15453
  }
15238
15454
  } catch (error) {
15239
- _chunkGC5ROI3Acjs.logger.error(`\u274C Failed to copy client assets: ${error}`);
15455
+ _chunk7U4XF76Rcjs.logger.error(`\u274C Failed to copy client assets: ${error}`);
15240
15456
  throw error;
15241
15457
  }
15242
15458
  const serverDir = _path2.default.join(root, distDir, "server");
@@ -15244,9 +15460,9 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
15244
15460
  try {
15245
15461
  await mkdir(nitroServerDir, { recursive: true });
15246
15462
  await cp(serverDir, nitroServerDir, { recursive: true });
15247
- _chunkGC5ROI3Acjs.logger.info("\u{1F4E6} Copied SSR bundles to Nitro server directory");
15463
+ _chunk7U4XF76Rcjs.logger.info("\u{1F4E6} Copied SSR bundles to Nitro server directory");
15248
15464
  } catch (error) {
15249
- _chunkGC5ROI3Acjs.logger.warn(`Could not copy SSR bundles: ${error}`);
15465
+ _chunk7U4XF76Rcjs.logger.warn(`Could not copy SSR bundles: ${error}`);
15250
15466
  }
15251
15467
  const nitro = await createNitro(nitroConfig);
15252
15468
  const registryPath = _path2.default.join(root, distDir, ".nitro", "server", "farm-registry.ts");
@@ -15267,14 +15483,14 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
15267
15483
  farmRegistry.routePaths = routePaths;
15268
15484
  try {
15269
15485
  const clientManifestPath = _path2.default.join(root, distDir, "client", "farm-client-manifest.json");
15270
- const { readFile } = await import("fs/promises");
15271
- const manifestContent = await readFile(clientManifestPath, "utf-8");
15486
+ const { readFile: readFile2 } = await import("fs/promises");
15487
+ const manifestContent = await readFile2(clientManifestPath, "utf-8");
15272
15488
  farmRegistry.clientManifest = JSON.parse(manifestContent);
15273
15489
  } catch (e47) {
15274
15490
  farmRegistry.clientManifest = {};
15275
15491
  }
15276
15492
  } catch (error) {
15277
- _chunkGC5ROI3Acjs.logger.warn(`Could not populate registry: ${error}`);
15493
+ _chunk7U4XF76Rcjs.logger.warn(`Could not populate registry: ${error}`);
15278
15494
  }
15279
15495
  await nitroBuild(nitro);
15280
15496
  if (pluginManager) {
@@ -15282,7 +15498,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
15282
15498
  root,
15283
15499
  preset,
15284
15500
  distDir,
15285
- outputDir: _chunkF7PKUP6Pcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir)
15501
+ outputDir: _chunkMOGRRZMWcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir)
15286
15502
  });
15287
15503
  }
15288
15504
  }