@farm.js/core 0.1.50 → 0.1.51-beta.1

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 (388) hide show
  1. package/README.md +163 -3
  2. package/dist/{agent-mcp-CIMH324y.d.mts → agent-mcp.d-BPzpKBHQ.d.mts} +1 -1
  3. package/dist/{agent-mcp-9BMbRgg_.d.ts → agent-mcp.d-ZuuNgrkQ.d.ts} +1 -1
  4. package/dist/agent-runtime.cjs +3 -3
  5. package/dist/agent-runtime.d.mts +13 -13
  6. package/dist/agent-runtime.d.ts +13 -13
  7. package/dist/agent-runtime.mjs +2 -2
  8. package/dist/{analyzer-CN7C74WX.cjs → analyzer-AZULAOPL.cjs} +2 -2
  9. package/dist/{analyzer-DDW34OMC.mjs → analyzer-V74FTD2F.mjs} +1 -1
  10. package/dist/api/client.d.mts +4 -4
  11. package/dist/api/client.d.ts +4 -4
  12. package/dist/api/route-manager.cjs +5 -5
  13. package/dist/api/route-manager.d.mts +19 -19
  14. package/dist/api/route-manager.d.ts +19 -19
  15. package/dist/api/route-manager.mjs +4 -4
  16. package/dist/api/runtime.d.mts +15 -15
  17. package/dist/api/runtime.d.ts +15 -15
  18. package/dist/{api-client-CvI5oOBE.d.ts → api-client.d-BWcqZciH.d.ts} +3 -3
  19. package/dist/{api-client-CFdv-Xgh.d.mts → api-client.d-CeA6tNA6.d.mts} +3 -3
  20. package/dist/api.cjs +7 -7
  21. package/dist/api.d.mts +21 -21
  22. package/dist/api.d.ts +21 -21
  23. package/dist/api.mjs +6 -6
  24. package/dist/{app-manifest-D0kaXdwu.d.ts → app-manifest.d-BJDcZn3W.d.mts} +1 -1
  25. package/dist/{app-manifest-CQDJOKL2.d.mts → app-manifest.d-HWhqbP2X.d.ts} +1 -1
  26. package/dist/app-markdown.d.mts +14 -14
  27. package/dist/app-markdown.d.ts +14 -14
  28. package/dist/{app-BWibTHVT.d.ts → app.d-B5EWdob-.d.ts} +12 -10
  29. package/dist/{app-DVJ13FPA.d.mts → app.d-DOGW1KI8.d.mts} +12 -10
  30. package/dist/base-path.d-BOUV5ozD.d.mts +10 -0
  31. package/dist/base-path.d-BOUV5ozD.d.ts +10 -0
  32. package/dist/{chunk-B5S2JS6M.cjs → chunk-2756SHCI.cjs} +372 -305
  33. package/dist/{chunk-RWT2BTJT.cjs → chunk-2IAPKPEB.cjs} +6 -6
  34. package/dist/{chunk-2G63BIRL.mjs → chunk-2KVDHNQS.mjs} +8 -11
  35. package/dist/{chunk-NJVFPJ2Y.cjs → chunk-3OWVWZ6R.cjs} +28 -2
  36. package/dist/{chunk-WVBUXNBX.mjs → chunk-5A5GAZ75.mjs} +296 -106
  37. package/dist/{chunk-GERUXONA.cjs → chunk-5A77OEIG.cjs} +4 -1
  38. package/dist/{chunk-4HBKBHVP.mjs → chunk-5ENW27SL.mjs} +1 -1
  39. package/dist/{chunk-FACTMUPI.cjs → chunk-5IONBVJY.cjs} +33 -22
  40. package/dist/{chunk-X2EL3BLH.cjs → chunk-5N7QAGEA.cjs} +36 -9
  41. package/dist/{chunk-DGOLAZLV.cjs → chunk-65Y5SIBH.cjs} +1 -1
  42. package/dist/{chunk-MTB57GOK.mjs → chunk-724WT3NI.mjs} +4 -2
  43. package/dist/{chunk-C73RIAEF.mjs → chunk-72NBDVWQ.mjs} +18 -7
  44. package/dist/{chunk-VCKGOXFI.cjs → chunk-76GHW3WI.cjs} +7 -1
  45. package/dist/{chunk-ZIBIE7AH.mjs → chunk-7UPCJDB5.mjs} +7 -1
  46. package/dist/{chunk-CPXDDWGL.mjs → chunk-AER5I65K.mjs} +1 -1
  47. package/dist/{chunk-RHOR2J6V.cjs → chunk-AGR7VJH2.cjs} +1 -1
  48. package/dist/{chunk-WB6XES4V.mjs → chunk-ALEUMLJN.mjs} +34 -5
  49. package/dist/{chunk-OD6WM3I7.mjs → chunk-AV26KHTG.mjs} +1 -1
  50. package/dist/{chunk-L6QDME5Z.cjs → chunk-B3GZAQSC.cjs} +3 -3
  51. package/dist/{chunk-ZLOQQ2UF.mjs → chunk-BSEKNTMS.mjs} +107 -40
  52. package/dist/{chunk-WAPQWAE6.cjs → chunk-CECUDGXQ.cjs} +9 -8
  53. package/dist/chunk-CKPTIEDX.cjs +12 -0
  54. package/dist/{chunk-IUQLRTTO.mjs → chunk-CO6UYM2D.mjs} +14 -1
  55. package/dist/{chunk-SHJJM6OG.mjs → chunk-CZ35L6PL.mjs} +9 -2
  56. package/dist/{chunk-EQMTJBB7.cjs → chunk-DZZHTMWM.cjs} +35 -6
  57. package/dist/{chunk-3ATXWZPH.cjs → chunk-E36C43IX.cjs} +13 -16
  58. package/dist/{chunk-J2ZEVDEK.cjs → chunk-EHB77D5U.cjs} +3 -3
  59. package/dist/{chunk-KO2NWUKN.mjs → chunk-EIMK7D2D.mjs} +33 -6
  60. package/dist/{chunk-CY7H5KS4.cjs → chunk-EKJYE4Y7.cjs} +2 -2
  61. package/dist/{chunk-2VCC3GVC.mjs → chunk-EOSFVNXZ.mjs} +1 -1
  62. package/dist/{chunk-IWJKJDNW.mjs → chunk-EWC76P5D.mjs} +53 -32
  63. package/dist/{chunk-WQGRD5BJ.cjs → chunk-EX6ZSN5P.cjs} +1 -16
  64. package/dist/{chunk-6QA2SXVH.cjs → chunk-FK25QSVC.cjs} +2 -1
  65. package/dist/{chunk-BW6SCVYX.mjs → chunk-FSQMN2MQ.mjs} +1 -0
  66. package/dist/{chunk-2H3FJYY6.mjs → chunk-FSXSQQTV.mjs} +3 -2
  67. package/dist/chunk-GNZIAJGB.mjs +358 -0
  68. package/dist/{chunk-TXK4D46O.mjs → chunk-H3ASZDT7.mjs} +21 -1
  69. package/dist/{chunk-B6PREBN6.cjs → chunk-HASX6DC7.cjs} +8 -8
  70. package/dist/{chunk-76R5GJER.mjs → chunk-I3EFXUAR.mjs} +60 -13
  71. package/dist/{chunk-HYN3LLG7.cjs → chunk-IFBINMI4.cjs} +3 -3
  72. package/dist/{chunk-CBJKDB6F.mjs → chunk-IRSS4HS4.mjs} +1 -1
  73. package/dist/{chunk-4T25YCZ5.cjs → chunk-JVBNKWLV.cjs} +81 -34
  74. package/dist/{chunk-VOZ5DI7D.mjs → chunk-JWI5PUO2.mjs} +6 -2
  75. package/dist/{chunk-YAXOEAND.cjs → chunk-KHXAJ2KA.cjs} +6 -6
  76. package/dist/{chunk-2DEPNLXK.mjs → chunk-KMB5BMFX.mjs} +122 -12
  77. package/dist/{chunk-M7LKA632.mjs → chunk-KU7MBLDZ.mjs} +1 -1
  78. package/dist/{chunk-WXHDVXJE.mjs → chunk-KY32FWK7.mjs} +2 -2
  79. package/dist/{chunk-EQWWOQTK.cjs → chunk-LEIXUFJN.cjs} +6 -2
  80. package/dist/{chunk-2GLQSIZD.mjs → chunk-LMFJCXDD.mjs} +1 -1
  81. package/dist/{chunk-IXSMFKZ2.cjs → chunk-LNM57D3H.cjs} +4 -4
  82. package/dist/{chunk-5V4KZOZO.mjs → chunk-LZ4SB57H.mjs} +2 -2
  83. package/dist/chunk-N4AQNEXR.cjs +17 -0
  84. package/dist/{chunk-J37KTQIA.cjs → chunk-NK2VWS7P.cjs} +52 -3
  85. package/dist/{chunk-X3HOVNHI.mjs → chunk-NN3MOPSI.mjs} +7 -7
  86. package/dist/{chunk-JZMZKABS.cjs → chunk-NWUHS6GV.cjs} +3 -2
  87. package/dist/{chunk-XLLVWLWO.mjs → chunk-PIHKO25G.mjs} +1 -1
  88. package/dist/chunk-PIUTGRDI.cjs +358 -0
  89. package/dist/{chunk-JJOWY3XD.mjs → chunk-QAIAFCRZ.mjs} +8 -6
  90. package/dist/{chunk-Q3UU2KXC.mjs → chunk-QMDU6QHN.mjs} +4 -1
  91. package/dist/{chunk-75WWOZ5C.mjs → chunk-QOSDWGKT.mjs} +1 -1
  92. package/dist/{chunk-GOOK2J2W.cjs → chunk-RMPNYUGT.cjs} +9 -7
  93. package/dist/{chunk-HWCHIBJZ.mjs → chunk-SCRC5AMM.mjs} +5 -5
  94. package/dist/{chunk-PXEXOQ5R.mjs → chunk-SHS6KXOZ.mjs} +1 -1
  95. package/dist/{chunk-ETF5C6HR.cjs → chunk-SJ23LJ3N.cjs} +3 -3
  96. package/dist/{chunk-JHXJBNLY.cjs → chunk-SUCDVKUB.cjs} +21 -1
  97. package/dist/{chunk-7ONZDKVY.mjs → chunk-T4EW7AAD.mjs} +2 -2
  98. package/dist/{chunk-F5LERVY3.cjs → chunk-TT66CP3P.cjs} +13 -13
  99. package/dist/{chunk-IUBDMDZZ.cjs → chunk-UQHIWZZ6.cjs} +15 -8
  100. package/dist/{chunk-LYWAGXXW.cjs → chunk-VITZRYW3.cjs} +131 -21
  101. package/dist/{chunk-XN2MB4QZ.cjs → chunk-VQJYGZNX.cjs} +4 -4
  102. package/dist/{chunk-KGP76FSV.mjs → chunk-VS7EHLLW.mjs} +1 -1
  103. package/dist/{chunk-5PKDHKQP.cjs → chunk-WFVSAT7Y.cjs} +6 -4
  104. package/dist/{chunk-UY6HS5PF.cjs → chunk-X2AMN2WV.cjs} +10 -10
  105. package/dist/{chunk-474FO3UE.cjs → chunk-X2M4XN4V.cjs} +213 -192
  106. package/dist/chunk-X3EFRVXY.mjs +12 -0
  107. package/dist/{chunk-UCQ52TJY.mjs → chunk-X3JNB2TB.mjs} +1 -1
  108. package/dist/{chunk-IQXGHGZF.cjs → chunk-XB24LZWI.cjs} +5 -5
  109. package/dist/{chunk-BNMHXVLL.mjs → chunk-XMHERKSE.mjs} +0 -15
  110. package/dist/{chunk-CGCJ2TJU.cjs → chunk-XPMC4E2G.cjs} +3 -3
  111. package/dist/{chunk-KZH6YLND.cjs → chunk-XY4DYGSU.cjs} +603 -413
  112. package/dist/{chunk-C7425KDG.cjs → chunk-XYL4HSVC.cjs} +2 -2
  113. package/dist/{chunk-HHFMECFO.mjs → chunk-Y2G5SJFB.mjs} +2 -1
  114. package/dist/{chunk-2SVJGOAX.mjs → chunk-Y3N5BFRJ.mjs} +3 -3
  115. package/dist/{chunk-Z5MZDFX4.cjs → chunk-YIHRZBD7.cjs} +14 -1
  116. package/dist/chunk-Z5A6CNV2.mjs +60 -0
  117. package/dist/chunk-Z64V4WZI.mjs +17 -0
  118. package/dist/{chunk-E2BMCNMJ.cjs → chunk-ZOWNWHK6.cjs} +2 -2
  119. package/dist/{chunk-C5JXCUKR.mjs → chunk-ZQ5BDNKW.mjs} +51 -2
  120. package/dist/client/lifecycle.d.mts +1 -1
  121. package/dist/client/lifecycle.d.ts +1 -1
  122. package/dist/{client-plugins-BPfltM5m.d.ts → client-plugins.d-C0n8Yhh-.d.ts} +60 -14
  123. package/dist/{client-plugins-D4RO59f0.d.mts → client-plugins.d-C_3CdALC.d.mts} +60 -14
  124. package/dist/client-plugins.d.mts +13 -13
  125. package/dist/client-plugins.d.ts +13 -13
  126. package/dist/client.cjs +5 -4
  127. package/dist/client.d.mts +24 -24
  128. package/dist/client.d.ts +24 -24
  129. package/dist/client.mjs +4 -3
  130. package/dist/config.d.mts +13 -13
  131. package/dist/config.d.ts +13 -13
  132. package/dist/cron.cjs +4 -4
  133. package/dist/cron.mjs +3 -3
  134. package/dist/desktop.d.mts +14 -14
  135. package/dist/desktop.d.ts +14 -14
  136. package/dist/{dev-guard-YLO5DE3H.cjs → dev-guard-2UW2KERP.cjs} +2 -2
  137. package/dist/{dev-guard-4PFQNXQX.mjs → dev-guard-ONNMVQUN.mjs} +1 -1
  138. package/dist/{devtools-STG7HPRV.mjs → devtools-BU5IT2PD.mjs} +8 -8
  139. package/dist/{devtools-N5XTOECL.cjs → devtools-KJFUE5FO.cjs} +10 -10
  140. package/dist/docs.cjs +14 -12
  141. package/dist/docs.d.mts +23 -15
  142. package/dist/docs.d.ts +23 -15
  143. package/dist/docs.mjs +13 -11
  144. package/dist/environment/vite.cjs +2 -2
  145. package/dist/environment/vite.d.mts +1 -1
  146. package/dist/environment/vite.d.ts +1 -1
  147. package/dist/environment/vite.mjs +1 -1
  148. package/dist/{generate-route-types-TF5Wwtvz.d.mts → generate-route-types.d-BL2pq6xC.d.ts} +1 -1
  149. package/dist/{generate-route-types-DQP0cUzk.d.ts → generate-route-types.d-BoVDU8qX.d.mts} +1 -1
  150. package/dist/i18n/client.d.mts +2 -2
  151. package/dist/i18n/client.d.ts +2 -2
  152. package/dist/i18n/index.d.mts +3 -3
  153. package/dist/i18n/index.d.ts +3 -3
  154. package/dist/i18n/server.d.mts +5 -5
  155. package/dist/i18n/server.d.ts +5 -5
  156. package/dist/image/server.d.mts +1 -1
  157. package/dist/image/server.d.ts +1 -1
  158. package/dist/image/sharp.d.mts +1 -1
  159. package/dist/image/sharp.d.ts +1 -1
  160. package/dist/image.d.mts +1 -1
  161. package/dist/image.d.ts +1 -1
  162. package/dist/index.cjs +48 -44
  163. package/dist/{index-C-N3Pwg-.d.ts → index.d-B6M_8kmo.d.ts} +2 -2
  164. package/dist/{index-D3l4tREW.d.ts → index.d-BNNDpql4.d.ts} +2 -2
  165. package/dist/{index-DPUAPho_.d.mts → index.d-BqcfqJvt.d.mts} +2 -2
  166. package/dist/{index-k8o8eUOd.d.mts → index.d-CsGxS-hZ.d.mts} +2 -2
  167. package/dist/index.d.mts +42 -42
  168. package/dist/index.d.ts +42 -42
  169. package/dist/index.mjs +47 -43
  170. package/dist/instrumentation.d.mts +2 -2
  171. package/dist/instrumentation.d.ts +2 -2
  172. package/dist/integrations.cjs +3 -3
  173. package/dist/integrations.d.mts +13 -13
  174. package/dist/integrations.d.ts +13 -13
  175. package/dist/integrations.mjs +2 -2
  176. package/dist/internal/app-markdown-runtime.d.mts +14 -14
  177. package/dist/internal/app-markdown-runtime.d.ts +14 -14
  178. package/dist/internal/build-runtime.cjs +36 -35
  179. package/dist/internal/build-runtime.d.mts +16 -16
  180. package/dist/internal/build-runtime.d.ts +16 -16
  181. package/dist/internal/build-runtime.mjs +35 -34
  182. package/dist/internal/cli-runtime.cjs +18 -18
  183. package/dist/internal/cli-runtime.mjs +17 -17
  184. package/dist/internal/client-error-overlay.cjs +4 -4
  185. package/dist/internal/client-error-overlay.mjs +1 -1
  186. package/dist/internal/client-runtime.cjs +4 -2
  187. package/dist/internal/client-runtime.d.mts +21 -21
  188. package/dist/internal/client-runtime.d.ts +21 -21
  189. package/dist/internal/client-runtime.mjs +3 -1
  190. package/dist/internal/compression-runtime.d.mts +13 -13
  191. package/dist/internal/compression-runtime.d.ts +13 -13
  192. package/dist/internal/config-runtime.cjs +10 -10
  193. package/dist/internal/config-runtime.d.mts +18 -18
  194. package/dist/internal/config-runtime.d.ts +18 -18
  195. package/dist/internal/config-runtime.mjs +9 -9
  196. package/dist/internal/form-actions.cjs +4 -3
  197. package/dist/internal/form-actions.d.mts +1 -1
  198. package/dist/internal/form-actions.d.ts +1 -1
  199. package/dist/internal/form-actions.mjs +3 -2
  200. package/dist/internal/infra-analytics-runtime.cjs +5 -5
  201. package/dist/internal/infra-analytics-runtime.mjs +3 -3
  202. package/dist/internal/island-value-store.d.mts +1 -1
  203. package/dist/internal/island-value-store.d.ts +1 -1
  204. package/dist/internal/islands-runtime.cjs +56 -0
  205. package/dist/internal/islands-runtime.d.mts +1 -1
  206. package/dist/internal/islands-runtime.d.ts +1 -1
  207. package/dist/internal/islands-runtime.mjs +57 -1
  208. package/dist/internal/isolated-boundary.d.mts +2 -2
  209. package/dist/internal/isolated-boundary.d.ts +2 -2
  210. package/dist/internal/product-telemetry-runtime.cjs +2 -2
  211. package/dist/internal/product-telemetry-runtime.mjs +1 -1
  212. package/dist/internal/production-runtime.cjs +15 -8
  213. package/dist/internal/production-runtime.d.mts +46 -30
  214. package/dist/internal/production-runtime.d.ts +46 -30
  215. package/dist/internal/production-runtime.mjs +14 -7
  216. package/dist/internal/server-fn-transform.cjs +13 -0
  217. package/dist/internal/server-fn-transform.d.mts +24 -0
  218. package/dist/internal/server-fn-transform.d.ts +24 -0
  219. package/dist/internal/server-fn-transform.mjs +13 -0
  220. package/dist/internal/server-tree.d.mts +1 -1
  221. package/dist/internal/server-tree.d.ts +1 -1
  222. package/dist/markdown.d.mts +13 -13
  223. package/dist/markdown.d.ts +13 -13
  224. package/dist/middleware.cjs +8 -8
  225. package/dist/middleware.d.mts +15 -15
  226. package/dist/middleware.d.ts +15 -15
  227. package/dist/middleware.mjs +7 -7
  228. package/dist/mobile.d.mts +37 -10
  229. package/dist/mobile.d.ts +37 -10
  230. package/dist/{navigation-delegate-8xg3Zvp4.d.ts → navigation-delegate.d-C0BbdUgN.d.mts} +1 -1
  231. package/dist/{navigation-delegate-ji6elCKy.d.mts → navigation-delegate.d-jArRF0ZP.d.ts} +1 -1
  232. package/dist/navigation.d.mts +17 -17
  233. package/dist/navigation.d.ts +17 -17
  234. package/dist/{nitro-YPSZBYDK.cjs → nitro-CK7M4RMY.cjs} +11 -11
  235. package/dist/{nitro-2Q5NVY7L.mjs → nitro-R444AF3O.mjs} +7 -7
  236. package/dist/observability.d.mts +1 -1
  237. package/dist/observability.d.ts +1 -1
  238. package/dist/plugin.cjs +29 -27
  239. package/dist/plugin.d.mts +17 -17
  240. package/dist/plugin.d.ts +17 -17
  241. package/dist/plugin.mjs +28 -26
  242. package/dist/{production-runtime-TdKaYRj0.d.ts → production-runtime.d-DFaQ1qaV.d.mts} +3 -3
  243. package/dist/{production-runtime-DXnQQkQf.d.mts → production-runtime.d-UnXmSS_S.d.ts} +3 -3
  244. package/dist/{programmatic-routes-client-Dh1SDLSM.d.mts → programmatic-routes-client.d-BIowUXQC.d.mts} +10 -2
  245. package/dist/{programmatic-routes-client-BwiTndEC.d.ts → programmatic-routes-client.d-VZ0qcbH4.d.ts} +10 -2
  246. package/dist/query/client.d.mts +1 -1
  247. package/dist/query/client.d.ts +1 -1
  248. package/dist/query/index.d.mts +1 -1
  249. package/dist/query/index.d.ts +1 -1
  250. package/dist/query/server.d.mts +1 -1
  251. package/dist/query/server.d.ts +1 -1
  252. package/dist/{render-plan-BPbwRbuN.d.ts → render-plan.d-BB6KrYjP.d.ts} +2 -2
  253. package/dist/{render-plan-BvCGXF6K.d.mts → render-plan.d-BNeqyPyJ.d.mts} +2 -2
  254. package/dist/renderer-client.cjs +8 -6
  255. package/dist/renderer-client.d.mts +19 -19
  256. package/dist/renderer-client.d.ts +19 -19
  257. package/dist/renderer-client.mjs +4 -2
  258. package/dist/{request-C_xTkJib.d.mts → request.d-BV1munmx.d.mts} +1 -1
  259. package/dist/{request-B8PGTZNR.d.ts → request.d-Bxhghm76.d.ts} +1 -1
  260. package/dist/request.d.mts +14 -14
  261. package/dist/request.d.ts +14 -14
  262. package/dist/{resolver-CJ-D9nP-.d.ts → resolver.d-BHyZgpa7.d.ts} +1 -1
  263. package/dist/{resolver-TDyZKgKI.d.mts → resolver.d-JnZKKsc5.d.mts} +1 -1
  264. package/dist/response.d-BolW0Vx_.d.mts +10 -0
  265. package/dist/response.d-BolW0Vx_.d.ts +10 -0
  266. package/dist/{route-rendering-DlddURL1.d.mts → route-rendering.d-BIf7zE9d.d.ts} +1 -1
  267. package/dist/{route-rendering-RNtcj607.d.ts → route-rendering.d-DShqKlgK.d.mts} +1 -1
  268. package/dist/{route-DFhZj6jN.d.ts → route.d-BaVH3V0w.d.mts} +1 -1
  269. package/dist/{route-2_yXC6gv.d.mts → route.d-DBTEqifW.d.ts} +1 -1
  270. package/dist/{router-B97eB0Mq.d.mts → router.d-BE7i84fb.d.mts} +1 -1
  271. package/dist/{router-qUVaoEN8.d.ts → router.d-Bw3K3b0a.d.ts} +1 -1
  272. package/dist/routes.cjs +3 -2
  273. package/dist/{routes-8PT9cl60.d.ts → routes.d-DVZQL0-H.d.ts} +3 -3
  274. package/dist/{routes-kEUsXHx3.d.mts → routes.d-_5tBQexL.d.mts} +3 -3
  275. package/dist/routes.d.mts +14 -14
  276. package/dist/routes.d.ts +14 -14
  277. package/dist/routes.mjs +2 -1
  278. package/dist/{rsc-pipeline-T3775JUA.mjs → rsc-pipeline-FBM6NFYY.mjs} +13 -13
  279. package/dist/{rsc-pipeline-L4XOZ2TE.cjs → rsc-pipeline-IQI5XQLS.cjs} +14 -14
  280. package/dist/{runtime-HRSFC4ZC.mjs → runtime-2JYIDUON.mjs} +14 -14
  281. package/dist/{runtime-BIBGJO7V.cjs → runtime-DXEVFYLE.cjs} +16 -16
  282. package/dist/{runtime-CihDZ2Rn.d.mts → runtime.d-3iJAKptR.d.mts} +2 -2
  283. package/dist/{runtime-C4CmlOOh.d.ts → runtime.d-BtL3PCL3.d.ts} +2 -2
  284. package/dist/{runtime-C8GUnNeP.d.ts → runtime.d-CQgoYR0Q.d.mts} +4 -4
  285. package/dist/{runtime-CaDswfWi.d.mts → runtime.d-CfhaLPl-.d.ts} +4 -4
  286. package/dist/{schema-dev-notice-LZ5NXGLN.mjs → schema-dev-notice-F6QYSOAI.mjs} +2 -2
  287. package/dist/{schema-dev-notice-XV7GZ3QJ.cjs → schema-dev-notice-UU7DMZEU.cjs} +3 -3
  288. package/dist/{search-client-BTXL5XWD.mjs → search-client-OXH6GBNO.mjs} +5 -3
  289. package/dist/search-client-ZZLKVO5R.cjs +15 -0
  290. package/dist/server-action-security.cjs +2 -2
  291. package/dist/server-action-security.d.mts +1 -1
  292. package/dist/server-action-security.d.ts +1 -1
  293. package/dist/server-action-security.mjs +1 -1
  294. package/dist/server-fn-client.d.mts +5 -5
  295. package/dist/server-fn-client.d.ts +5 -5
  296. package/dist/server-fn.cjs +3 -3
  297. package/dist/server-fn.d.mts +3 -3
  298. package/dist/server-fn.d.ts +3 -3
  299. package/dist/server-fn.mjs +2 -2
  300. package/dist/server-plugins.d.mts +14 -14
  301. package/dist/server-plugins.d.ts +14 -14
  302. package/dist/server-query-client.cjs +4 -3
  303. package/dist/server-query-client.d.mts +5 -5
  304. package/dist/server-query-client.d.ts +5 -5
  305. package/dist/server-query-client.mjs +3 -2
  306. package/dist/server-query.cjs +4 -4
  307. package/dist/server-query.d.mts +2 -2
  308. package/dist/server-query.d.ts +2 -2
  309. package/dist/server-query.mjs +3 -3
  310. package/dist/server.cjs +64 -62
  311. package/dist/server.d.mts +28 -29
  312. package/dist/server.d.ts +28 -29
  313. package/dist/server.mjs +38 -36
  314. package/dist/{spa-router-Dlv5ofg0.d.mts → spa-router.d-C5opIgXg.d.ts} +5 -5
  315. package/dist/{spa-router-qapSboKz.d.ts → spa-router.d-D63jb6nX.d.mts} +5 -5
  316. package/dist/storage.d.mts +2 -2
  317. package/dist/storage.d.ts +2 -2
  318. package/dist/testing.cjs +12 -11
  319. package/dist/testing.d.mts +14 -14
  320. package/dist/testing.d.ts +14 -14
  321. package/dist/testing.mjs +9 -8
  322. package/dist/theme/client.d.mts +1 -1
  323. package/dist/theme/client.d.ts +1 -1
  324. package/dist/theme/index.d.mts +2 -2
  325. package/dist/theme/index.d.ts +2 -2
  326. package/dist/theme/runtime.d.mts +1 -1
  327. package/dist/theme/runtime.d.ts +1 -1
  328. package/dist/theme/server.d.mts +1 -1
  329. package/dist/theme/server.d.ts +1 -1
  330. package/dist/{utils-DyvlSxFk.d.mts → utils.d-CO-U4OVZ.d.mts} +1 -1
  331. package/dist/{utils-A-cYF81u.d.ts → utils.d-CkpTqTsC.d.ts} +1 -1
  332. package/dist/version.cjs +2 -2
  333. package/dist/version.mjs +1 -1
  334. package/dist/vite.cjs +29 -27
  335. package/dist/vite.d.mts +20 -19
  336. package/dist/vite.d.ts +20 -19
  337. package/dist/vite.mjs +28 -26
  338. package/dist/workflows.cjs +4 -4
  339. package/dist/workflows.d.mts +1 -1
  340. package/dist/workflows.d.ts +1 -1
  341. package/dist/workflows.mjs +3 -3
  342. package/package.json +10 -5
  343. package/dist/base-path-leyrqXbX.d.mts +0 -19
  344. package/dist/base-path-leyrqXbX.d.ts +0 -19
  345. package/dist/chunk-OTOOJIUB.mjs +0 -34
  346. package/dist/search-client-QCYAL6AY.cjs +0 -13
  347. /package/dist/{chunk-recovery-lnQFzcQP.d.mts → chunk-recovery.d-lnQFzcQP.d.mts} +0 -0
  348. /package/dist/{chunk-recovery-lnQFzcQP.d.ts → chunk-recovery.d-lnQFzcQP.d.ts} +0 -0
  349. /package/dist/{client-cache-Deoqq-nM.d.ts → client-cache.d-Deoqq-nM.d.ts} +0 -0
  350. /package/dist/{client-cache-di_Nasxa.d.mts → client-cache.d-di_Nasxa.d.mts} +0 -0
  351. /package/dist/{config-CnhyvvmT.d.mts → config.d-CnhyvvmT.d.mts} +0 -0
  352. /package/dist/{config-CnhyvvmT.d.ts → config.d-CnhyvvmT.d.ts} +0 -0
  353. /package/dist/{endpoint-BgHn0lhl.d.ts → endpoint.d-BgHn0lhl.d.ts} +0 -0
  354. /package/dist/{endpoint-BkMSCRf6.d.mts → endpoint.d-BkMSCRf6.d.mts} +0 -0
  355. /package/dist/{image-config-CeDgNyX4.d.mts → image-config.d-CeDgNyX4.d.mts} +0 -0
  356. /package/dist/{image-config-CeDgNyX4.d.ts → image-config.d-CeDgNyX4.d.ts} +0 -0
  357. /package/dist/{instrumentation-runtime-CX9Zh-16.d.mts → instrumentation-runtime.d-CX9Zh-16.d.mts} +0 -0
  358. /package/dist/{instrumentation-runtime-CX9Zh-16.d.ts → instrumentation-runtime.d-CX9Zh-16.d.ts} +0 -0
  359. /package/dist/{island-value-protocol-BRayRghM.d.mts → island-value-protocol.d-BRayRghM.d.mts} +0 -0
  360. /package/dist/{island-value-protocol-BRayRghM.d.ts → island-value-protocol.d-BRayRghM.d.ts} +0 -0
  361. /package/dist/{island-CfGru1MO.d.mts → island.d-CfGru1MO.d.mts} +0 -0
  362. /package/dist/{island-CfGru1MO.d.ts → island.d-CfGru1MO.d.ts} +0 -0
  363. /package/dist/{layers-CcS42OGR.d.mts → layers.d-CcS42OGR.d.mts} +0 -0
  364. /package/dist/{layers-CcS42OGR.d.ts → layers.d-CcS42OGR.d.ts} +0 -0
  365. /package/dist/{lifecycle-C2aLBOwu.d.mts → lifecycle.d-C2aLBOwu.d.mts} +0 -0
  366. /package/dist/{lifecycle-C2aLBOwu.d.ts → lifecycle.d-C2aLBOwu.d.ts} +0 -0
  367. /package/dist/{observability-B2363jB6.d.mts → observability.d-B2363jB6.d.mts} +0 -0
  368. /package/dist/{observability-B2363jB6.d.ts → observability.d-B2363jB6.d.ts} +0 -0
  369. /package/dist/{params-BALtrRim.d.ts → params.d-BALtrRim.d.ts} +0 -0
  370. /package/dist/{params-ry-lxqmy.d.mts → params.d-ry-lxqmy.d.mts} +0 -0
  371. /package/dist/{production-vite-BQFAlG7n.d.mts → production-vite.d-BQFAlG7n.d.mts} +0 -0
  372. /package/dist/{production-vite-BQFAlG7n.d.ts → production-vite.d-BQFAlG7n.d.ts} +0 -0
  373. /package/dist/{route-pattern-CVsVbq5n.d.mts → route-pattern.d-CVsVbq5n.d.mts} +0 -0
  374. /package/dist/{route-pattern-CVsVbq5n.d.ts → route-pattern.d-CVsVbq5n.d.ts} +0 -0
  375. /package/dist/{server-client-bridge-DKWDl5NB.d.mts → server-client-bridge.d-DKWDl5NB.d.mts} +0 -0
  376. /package/dist/{server-client-bridge-DKWDl5NB.d.ts → server-client-bridge.d-DKWDl5NB.d.ts} +0 -0
  377. /package/dist/{server-fn-error-DrcH9cc1.d.mts → server-fn-error.d-DrcH9cc1.d.mts} +0 -0
  378. /package/dist/{server-fn-error-DrcH9cc1.d.ts → server-fn-error.d-DrcH9cc1.d.ts} +0 -0
  379. /package/dist/{server-query-runtime-DXRNhX_3.d.ts → server-query-runtime.d-DXRNhX_3.d.ts} +0 -0
  380. /package/dist/{server-query-runtime-aP52iuL5.d.mts → server-query-runtime.d-aP52iuL5.d.mts} +0 -0
  381. /package/dist/{types-BnIqOn9w.d.mts → types.d-BnIqOn9w.d.mts} +0 -0
  382. /package/dist/{types-BnIqOn9w.d.ts → types.d-BnIqOn9w.d.ts} +0 -0
  383. /package/dist/{types-C41ePjvP.d.mts → types.d-C41ePjvP.d.mts} +0 -0
  384. /package/dist/{types-C41ePjvP.d.ts → types.d-C41ePjvP.d.ts} +0 -0
  385. /package/dist/{types-DQnyD3VD.d.mts → types.d-DQnyD3VD.d.mts} +0 -0
  386. /package/dist/{types-DQnyD3VD.d.ts → types.d-DQnyD3VD.d.ts} +0 -0
  387. /package/dist/{workflows-CRMzQZ3k.d.mts → workflows.d-CRMzQZ3k.d.mts} +0 -0
  388. /package/dist/{workflows-CRMzQZ3k.d.ts → workflows.d-CRMzQZ3k.d.ts} +0 -0
@@ -1,15 +1,15 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
+ var _chunkMF3IA2AWcjs = require('./chunk-MF3IA2AW.cjs');
3
4
 
4
5
 
5
6
 
6
7
 
7
8
 
8
9
 
9
- var _chunkVZY7MAVScjs = require('./chunk-VZY7MAVS.cjs');
10
10
 
11
11
 
12
- var _chunkMF3IA2AWcjs = require('./chunk-MF3IA2AW.cjs');
12
+ var _chunkVZY7MAVScjs = require('./chunk-VZY7MAVS.cjs');
13
13
 
14
14
 
15
15
  var _chunkVM57CK74cjs = require('./chunk-VM57CK74.cjs');
@@ -18,8 +18,8 @@ var _chunkVM57CK74cjs = require('./chunk-VM57CK74.cjs');
18
18
 
19
19
 
20
20
 
21
- var _chunk4T25YCZ5cjs = require('./chunk-4T25YCZ5.cjs');
22
21
 
22
+ var _chunkJVBNKWLVcjs = require('./chunk-JVBNKWLV.cjs');
23
23
 
24
24
 
25
25
 
@@ -29,15 +29,17 @@ var _chunk4T25YCZ5cjs = require('./chunk-4T25YCZ5.cjs');
29
29
 
30
30
 
31
31
 
32
- var _chunkX2EL3BLHcjs = require('./chunk-X2EL3BLH.cjs');
33
32
 
34
33
 
34
+ var _chunk5N7QAGEAcjs = require('./chunk-5N7QAGEA.cjs');
35
35
 
36
36
 
37
- var _chunkEQMTJBB7cjs = require('./chunk-EQMTJBB7.cjs');
38
37
 
39
38
 
40
- var _chunkHYN3LLG7cjs = require('./chunk-HYN3LLG7.cjs');
39
+ var _chunkDZZHTMWMcjs = require('./chunk-DZZHTMWM.cjs');
40
+
41
+
42
+ var _chunkIFBINMI4cjs = require('./chunk-IFBINMI4.cjs');
41
43
 
42
44
 
43
45
  var _chunkBRWIVOV4cjs = require('./chunk-BRWIVOV4.cjs');
@@ -52,7 +54,7 @@ var _chunkV3UOEWCBcjs = require('./chunk-V3UOEWCB.cjs');
52
54
 
53
55
 
54
56
 
55
- var _chunkLYWAGXXWcjs = require('./chunk-LYWAGXXW.cjs');
57
+ var _chunkVITZRYW3cjs = require('./chunk-VITZRYW3.cjs');
56
58
 
57
59
 
58
60
 
@@ -84,10 +86,10 @@ var _chunkLYWAGXXWcjs = require('./chunk-LYWAGXXW.cjs');
84
86
 
85
87
 
86
88
 
87
- var _chunk474FO3UEcjs = require('./chunk-474FO3UE.cjs');
89
+ var _chunkX2M4XN4Vcjs = require('./chunk-X2M4XN4V.cjs');
88
90
 
89
91
 
90
- var _chunkIXSMFKZ2cjs = require('./chunk-IXSMFKZ2.cjs');
92
+ var _chunkLNM57D3Hcjs = require('./chunk-LNM57D3H.cjs');
91
93
 
92
94
 
93
95
  var _chunk3EEET2Q5cjs = require('./chunk-3EEET2Q5.cjs');
@@ -95,7 +97,7 @@ var _chunk3EEET2Q5cjs = require('./chunk-3EEET2Q5.cjs');
95
97
 
96
98
 
97
99
 
98
- var _chunkIUBDMDZZcjs = require('./chunk-IUBDMDZZ.cjs');
100
+ var _chunkUQHIWZZ6cjs = require('./chunk-UQHIWZZ6.cjs');
99
101
 
100
102
 
101
103
 
@@ -108,7 +110,7 @@ var _chunkIUBDMDZZcjs = require('./chunk-IUBDMDZZ.cjs');
108
110
 
109
111
 
110
112
 
111
- var _chunkVCKGOXFIcjs = require('./chunk-VCKGOXFI.cjs');
113
+ var _chunk76GHW3WIcjs = require('./chunk-76GHW3WI.cjs');
112
114
 
113
115
 
114
116
  var _chunk47JV57DAcjs = require('./chunk-47JV57DA.cjs');
@@ -122,7 +124,7 @@ var _chunkSGBNF56Scjs = require('./chunk-SGBNF56S.cjs');
122
124
 
123
125
 
124
126
 
125
- var _chunkGOOK2J2Wcjs = require('./chunk-GOOK2J2W.cjs');
127
+ var _chunkRMPNYUGTcjs = require('./chunk-RMPNYUGT.cjs');
126
128
 
127
129
 
128
130
 
@@ -130,7 +132,7 @@ var _chunkGOOK2J2Wcjs = require('./chunk-GOOK2J2W.cjs');
130
132
  var _chunkSBABQKPTcjs = require('./chunk-SBABQKPT.cjs');
131
133
 
132
134
 
133
- var _chunkJ37KTQIAcjs = require('./chunk-J37KTQIA.cjs');
135
+ var _chunkNK2VWS7Pcjs = require('./chunk-NK2VWS7P.cjs');
134
136
 
135
137
 
136
138
  var _chunkJATTVAHAcjs = require('./chunk-JATTVAHA.cjs');
@@ -174,16 +176,16 @@ var _chunk2HW5LWAHcjs = require('./chunk-2HW5LWAH.cjs');
174
176
 
175
177
 
176
178
 
177
- var _chunkIQXGHGZFcjs = require('./chunk-IQXGHGZF.cjs');
179
+ var _chunkXB24LZWIcjs = require('./chunk-XB24LZWI.cjs');
178
180
 
179
181
 
180
182
 
181
183
 
182
184
 
183
- var _chunkC7425KDGcjs = require('./chunk-C7425KDG.cjs');
185
+ var _chunkXYL4HSVCcjs = require('./chunk-XYL4HSVC.cjs');
184
186
 
185
187
 
186
- var _chunk6QA2SXVHcjs = require('./chunk-6QA2SXVH.cjs');
188
+ var _chunkFK25QSVCcjs = require('./chunk-FK25QSVC.cjs');
187
189
 
188
190
 
189
191
  var _chunkWJFFPXCVcjs = require('./chunk-WJFFPXCV.cjs');
@@ -193,7 +195,7 @@ var _chunkJMYXO572cjs = require('./chunk-JMYXO572.cjs');
193
195
 
194
196
 
195
197
 
196
- var _chunkWAPQWAE6cjs = require('./chunk-WAPQWAE6.cjs');
198
+ var _chunkCECUDGXQcjs = require('./chunk-CECUDGXQ.cjs');
197
199
 
198
200
 
199
201
  var _chunkPFV2KPDZcjs = require('./chunk-PFV2KPDZ.cjs');
@@ -201,10 +203,10 @@ var _chunkPFV2KPDZcjs = require('./chunk-PFV2KPDZ.cjs');
201
203
 
202
204
 
203
205
 
204
- var _chunkL6QDME5Zcjs = require('./chunk-L6QDME5Z.cjs');
206
+ var _chunkB3GZAQSCcjs = require('./chunk-B3GZAQSC.cjs');
205
207
 
206
208
 
207
- var _chunkYAXOEANDcjs = require('./chunk-YAXOEAND.cjs');
209
+ var _chunkKHXAJ2KAcjs = require('./chunk-KHXAJ2KA.cjs');
208
210
 
209
211
 
210
212
  var _chunkBBPDJGCUcjs = require('./chunk-BBPDJGCU.cjs');
@@ -224,14 +226,14 @@ var _chunkOYZXVBZPcjs = require('./chunk-OYZXVBZP.cjs');
224
226
 
225
227
 
226
228
 
227
- var _chunkXN2MB4QZcjs = require('./chunk-XN2MB4QZ.cjs');
229
+ var _chunkVQJYGZNXcjs = require('./chunk-VQJYGZNX.cjs');
228
230
 
229
231
 
230
232
 
231
233
  var _chunkB5BBTPJQcjs = require('./chunk-B5BBTPJQ.cjs');
232
234
 
233
235
 
234
- var _chunkRHOR2J6Vcjs = require('./chunk-RHOR2J6V.cjs');
236
+ var _chunkAGR7VJH2cjs = require('./chunk-AGR7VJH2.cjs');
235
237
 
236
238
 
237
239
  var _chunkE552H232cjs = require('./chunk-E552H232.cjs');
@@ -338,7 +340,7 @@ function getDocsTitle(docs) {
338
340
  return typeof docs.config.nav === "object" && docs.config.nav && "title" in docs.config.nav ? String(docs.config.nav.title || "Documentation") : "Documentation";
339
341
  }
340
342
  function loadPages(contentDir, docs) {
341
- return _chunkX2EL3BLHcjs.discoverFarmDocsPages.call(void 0, contentDir, docs).map((page) => _chunkX2EL3BLHcjs.loadFarmDocsPage.call(void 0, contentDir, docs, page.slug)).filter((page) => Boolean(page)).sort((a, b) => a.href.localeCompare(b.href));
343
+ return _chunk5N7QAGEAcjs.discoverFarmDocsPages.call(void 0, contentDir, docs).map((page) => _chunk5N7QAGEAcjs.loadFarmDocsPage.call(void 0, contentDir, docs, page.slug)).filter((page) => Boolean(page)).sort((a, b) => a.href.localeCompare(b.href));
342
344
  }
343
345
  function findSocialImagePath(html) {
344
346
  const match = /<meta\s+property=["']og:image["']\s+content=["']([^"']+)["']/i.exec(html) || /<meta\s+content=["']([^"']+)["']\s+property=["']og:image["']/i.exec(html);
@@ -356,14 +358,14 @@ async function addHandlerRoute(routes, pathname, handler, absolutePaths) {
356
358
  return response;
357
359
  }
358
360
  async function compileFarmDocsManifest(docs, options) {
359
- const contentDir = _chunkX2EL3BLHcjs.resolveFarmDocsContentDir.call(void 0, docs, options);
361
+ const contentDir = _chunk5N7QAGEAcjs.resolveFarmDocsContentDir.call(void 0, docs, options);
360
362
  const pages = loadPages(contentDir, docs);
361
363
  const absolutePaths = [
362
364
  _path2.default.resolve(options.root),
363
365
  _path2.default.resolve(contentDir),
364
366
  docs.configPath || ""
365
367
  ];
366
- const handler = _chunkX2EL3BLHcjs.createFarmDocsHandler.call(void 0, docs, {
368
+ const handler = _chunk5N7QAGEAcjs.createFarmDocsHandler.call(void 0, docs, {
367
369
  root: options.root,
368
370
  srcDir: options.srcDir,
369
371
  clientEntry: options.clientEntry,
@@ -372,7 +374,7 @@ async function compileFarmDocsManifest(docs, options) {
372
374
  globalStylesheetHref: options.globalStylesheetHref,
373
375
  isPathGuarded: options.isPathGuarded
374
376
  });
375
- const apiHandler = _chunk4T25YCZ5cjs.createFarmDocsAPIHandler.call(void 0, {
377
+ const apiHandler = _chunkJVBNKWLVcjs.createFarmDocsAPIHandler.call(void 0, {
376
378
  rootDir: options.root,
377
379
  srcDir: options.srcDir,
378
380
  docs,
@@ -383,7 +385,7 @@ async function compileFarmDocsManifest(docs, options) {
383
385
  const apiMarkdown = {};
384
386
  for (const page of pages) {
385
387
  const htmlResponse = await addHandlerRoute(routes, page.href, handler, absolutePaths);
386
- const markdownPath = _chunkX2EL3BLHcjs.getFarmDocsMarkdownPath.call(void 0, page.href);
388
+ const markdownPath = _chunk5N7QAGEAcjs.getFarmDocsMarkdownPath.call(void 0, page.href);
387
389
  await addHandlerRoute(routes, markdownPath, handler, absolutePaths);
388
390
  if (htmlResponse) {
389
391
  const socialImagePath = findSocialImagePath(await htmlResponse.text());
@@ -467,7 +469,7 @@ async function compileFarmDocsManifest(docs, options) {
467
469
  post: await compileResponse(postResponse, absolutePaths),
468
470
  search: {
469
471
  pages: publicPages.map((page) => ({
470
- ..._chunkX2EL3BLHcjs.toFarmDocsMarkdownPage.call(void 0, page),
472
+ ..._chunk5N7QAGEAcjs.toFarmDocsMarkdownPage.call(void 0, page),
471
473
  sourcePath: `farm-docs:${page.slug || "index"}`
472
474
  })),
473
475
  search: _nullishCoalesce(searchConfig, () => ( true)),
@@ -520,7 +522,7 @@ function collectFarmClientModulePreloads(bundle, options) {
520
522
  const moduleId = chunk.facadeModuleId.split("?")[0];
521
523
  if (!_path2.default.isAbsolute(moduleId)) continue;
522
524
  const loaded = /* @__PURE__ */ new Set([...entryLoaded, chunk.fileName]);
523
- modules[_chunkXN2MB4QZcjs.toViteModuleId.call(void 0, moduleId, options.root)] = [
525
+ modules[_chunkVQJYGZNXcjs.toViteModuleId.call(void 0, moduleId, options.root)] = [
524
526
  chunk.fileName,
525
527
  ...staticImports(chunk, loaded, [])
526
528
  ].map(index);
@@ -645,7 +647,7 @@ async function createFarmRouteRuntimeManifest(options) {
645
647
  const routes = [];
646
648
  for (const [pattern, entry] of options.routeManager.getRoutes()) {
647
649
  const routeModule = await options.routeManager.loadRouteModule(entry.modulePath);
648
- const rendering = await _chunkIUBDMDZZcjs.resolveRouteRenderingConfigFromFile.call(void 0, routeModule, entry.modulePath);
650
+ const rendering = await _chunkUQHIWZZ6cjs.resolveRouteRenderingConfigFromFile.call(void 0, routeModule, entry.modulePath);
649
651
  const runtimeConfig = await options.routeManager.resolveRouteRuntimeConfig(pattern);
650
652
  routes.push({
651
653
  kind: "page",
@@ -1083,6 +1085,75 @@ function createFarmPrivateClientSourcemapsPlugin(options) {
1083
1085
  };
1084
1086
  }
1085
1087
 
1088
+ // src/middleware/static-config.ts
1089
+ function literalMatcher(node) {
1090
+ if (!node) return void 0;
1091
+ if (node.type === "Literal" && typeof node.value === "string") return node.value;
1092
+ if (node.type === "Literal" && node.regex)
1093
+ return new RegExp(node.regex.pattern, node.regex.flags);
1094
+ if (node.type === "TemplateLiteral" && node.expressions.length === 0) {
1095
+ return _nullishCoalesce(_optionalChain([node, 'access', _20 => _20.quasis, 'access', _21 => _21[0], 'optionalAccess', _22 => _22.value, 'optionalAccess', _23 => _23.cooked]), () => ( void 0));
1096
+ }
1097
+ return void 0;
1098
+ }
1099
+ function literalMatchers(node) {
1100
+ const values = node.type === "ArrayExpression" ? node.elements : [node];
1101
+ const matchers = [];
1102
+ for (const value of values) {
1103
+ const matcher = literalMatcher(value);
1104
+ if (matcher === void 0) return void 0;
1105
+ matchers.push(matcher);
1106
+ }
1107
+ return matchers;
1108
+ }
1109
+ function unwrap(node) {
1110
+ while (node.type === "TSAsExpression" || node.type === "TSSatisfiesExpression" || node.type === "ParenthesizedExpression") {
1111
+ node = node.expression;
1112
+ }
1113
+ return node;
1114
+ }
1115
+ function readStaticMiddlewareConfig(program) {
1116
+ let found = null;
1117
+ for (const statement of program.body) {
1118
+ if (statement.type === "ExportNamedDeclaration" && !statement.declaration) {
1119
+ if (statement.specifiers.some((specifier) => _optionalChain([specifier, 'access', _24 => _24.exported, 'optionalAccess', _25 => _25.name]) === "config")) {
1120
+ return "unknown";
1121
+ }
1122
+ continue;
1123
+ }
1124
+ const declaration = statement.type === "ExportNamedDeclaration" ? statement.declaration : null;
1125
+ if (!declaration || declaration.type !== "VariableDeclaration") continue;
1126
+ for (const declarator of declaration.declarations) {
1127
+ if (_optionalChain([declarator, 'access', _26 => _26.id, 'optionalAccess', _27 => _27.type]) !== "Identifier" || declarator.id.name !== "config") continue;
1128
+ if (declaration.kind !== "const" || !declarator.init) return "unknown";
1129
+ const init = unwrap(declarator.init);
1130
+ if (init.type !== "ObjectExpression") return "unknown";
1131
+ const config = {};
1132
+ for (const property of init.properties) {
1133
+ if (property.type !== "Property" || property.computed) return "unknown";
1134
+ const key = _nullishCoalesce(_optionalChain([property, 'access', _28 => _28.key, 'optionalAccess', _29 => _29.name]), () => ( _optionalChain([property, 'access', _30 => _30.key, 'optionalAccess', _31 => _31.value])));
1135
+ if (key !== "matcher" && key !== "exclude") continue;
1136
+ const matchers = literalMatchers(unwrap(property.value));
1137
+ if (!matchers) return "unknown";
1138
+ if (key === "matcher") config.matcher = matchers;
1139
+ else config.exclude = matchers;
1140
+ }
1141
+ found = config;
1142
+ }
1143
+ }
1144
+ return found;
1145
+ }
1146
+ async function readMiddlewareFileConfig(filePath) {
1147
+ try {
1148
+ const [{ readFile }, vite] = await Promise.all([import("fs/promises"), import("vite")]);
1149
+ const parsed = vite.parseSync(filePath, await readFile(filePath, "utf8"));
1150
+ if (_optionalChain([parsed, 'access', _32 => _32.errors, 'optionalAccess', _33 => _33.length])) return "unknown";
1151
+ return readStaticMiddlewareConfig(parsed.program);
1152
+ } catch (e7) {
1153
+ return "unknown";
1154
+ }
1155
+ }
1156
+
1086
1157
  // src/nitro/universal-build.ts
1087
1158
  function preloadFarmNitroBuilder() {
1088
1159
  return import("nitro/builder").then(
@@ -1099,7 +1170,7 @@ function findFarmCoreRoot(from) {
1099
1170
  if (_fs.existsSync.call(void 0, manifest)) {
1100
1171
  try {
1101
1172
  if (JSON.parse(_fs.readFileSync.call(void 0, manifest, "utf8")).name === "@farm.js/core") return dir;
1102
- } catch (e7) {
1173
+ } catch (e8) {
1103
1174
  }
1104
1175
  }
1105
1176
  dir = _path2.default.dirname(dir);
@@ -1117,7 +1188,7 @@ function findInstalledPackageDir(name, from) {
1117
1188
  if (_fs.existsSync.call(void 0, _path2.default.join(candidate, "package.json"))) {
1118
1189
  try {
1119
1190
  return _fs.realpathSync.call(void 0, candidate);
1120
- } catch (e8) {
1191
+ } catch (e9) {
1121
1192
  return null;
1122
1193
  }
1123
1194
  }
@@ -1133,7 +1204,7 @@ function collectFarmDependencyDirs(root) {
1133
1204
  let manifest;
1134
1205
  try {
1135
1206
  manifest = JSON.parse(_fs.readFileSync.call(void 0, _path2.default.join(dir, "package.json"), "utf8"));
1136
- } catch (e9) {
1207
+ } catch (e10) {
1137
1208
  return;
1138
1209
  }
1139
1210
  for (const field of ["dependencies", "optionalDependencies", "peerDependencies"]) {
@@ -1149,7 +1220,7 @@ function collectFarmDependencyDirs(root) {
1149
1220
  if (name.startsWith("@farm.js/")) queue.push({ name, from: root });
1150
1221
  }
1151
1222
  }
1152
- } catch (e10) {
1223
+ } catch (e11) {
1153
1224
  }
1154
1225
  for (let next = queue.pop(); next; next = queue.pop()) {
1155
1226
  const dir = findInstalledPackageDir(next.name, next.from);
@@ -1239,14 +1310,14 @@ function createPrerenderRuntimeResolverPlugin(root, resolveNitroEntry = resolveN
1239
1310
  return {
1240
1311
  name: "farm-prerender-runtime-resolver",
1241
1312
  async resolveId(id, _importer, options) {
1242
- if (_optionalChain([options, 'access', _20 => _20.custom, 'optionalAccess', _21 => _21.farmPrerenderRuntimeResolve])) return null;
1313
+ if (_optionalChain([options, 'access', _34 => _34.custom, 'optionalAccess', _35 => _35.farmPrerenderRuntimeResolve])) return null;
1243
1314
  if (id.startsWith("\0") || id.startsWith(".") || id.startsWith("#") || id.startsWith("virtual:") || _path2.default.isAbsolute(id) || NODE_BUILTIN_MODULES.has(id)) {
1244
1315
  return null;
1245
1316
  }
1246
1317
  if (nitroEntry === void 0) {
1247
1318
  try {
1248
1319
  nitroEntry = resolveNitroEntry(root);
1249
- } catch (e11) {
1320
+ } catch (e12) {
1250
1321
  nitroEntry = null;
1251
1322
  }
1252
1323
  }
@@ -1267,7 +1338,7 @@ function createFarmStorageModuleRegistration(config) {
1267
1338
  let runtimeRequire = projectRequire;
1268
1339
  try {
1269
1340
  runtimeRequire = _module.createRequire.call(void 0, projectRequire.resolve("@farm.js/core"));
1270
- } catch (e12) {
1341
+ } catch (e13) {
1271
1342
  }
1272
1343
  const loaders = [];
1273
1344
  for (const specifier of modules) {
@@ -1276,7 +1347,7 @@ function createFarmStorageModuleRegistration(config) {
1276
1347
  try {
1277
1348
  resolved = require2.resolve(specifier);
1278
1349
  break;
1279
- } catch (e13) {
1350
+ } catch (e14) {
1280
1351
  }
1281
1352
  }
1282
1353
  if (resolved) {
@@ -1294,7 +1365,7 @@ function resolveNitroPackageEntry(root) {
1294
1365
  let runtimeRequire = projectRequire;
1295
1366
  try {
1296
1367
  runtimeRequire = _module.createRequire.call(void 0, projectRequire.resolve("@farm.js/core"));
1297
- } catch (e14) {
1368
+ } catch (e15) {
1298
1369
  }
1299
1370
  return runtimeRequire.resolve("nitro");
1300
1371
  }
@@ -1348,7 +1419,7 @@ async function canUseRolldownBuilder() {
1348
1419
  try {
1349
1420
  await import("rolldown");
1350
1421
  return true;
1351
- } catch (e15) {
1422
+ } catch (e16) {
1352
1423
  return false;
1353
1424
  }
1354
1425
  }
@@ -1362,7 +1433,7 @@ function hasReactDomEdgeServerBuild(root) {
1362
1433
  try {
1363
1434
  _module.createRequire.call(void 0, _path2.default.join(root, "package.json")).resolve("react-dom/server.edge");
1364
1435
  return true;
1365
- } catch (e16) {
1436
+ } catch (e17) {
1366
1437
  return false;
1367
1438
  }
1368
1439
  }
@@ -1400,7 +1471,7 @@ function isFarmCoreModule(file) {
1400
1471
  if (_fs.existsSync.call(void 0, manifest)) {
1401
1472
  try {
1402
1473
  return JSON.parse(_fs.readFileSync.call(void 0, manifest, "utf8")).name === "@farm.js/core";
1403
- } catch (e17) {
1474
+ } catch (e18) {
1404
1475
  return false;
1405
1476
  }
1406
1477
  }
@@ -1433,7 +1504,7 @@ function createMetadataImageWasmPlugin() {
1433
1504
  return {
1434
1505
  name: "farm-metadata-image-wasm",
1435
1506
  resolveId(source, importer) {
1436
- if (!source.endsWith(".wasm?module") || !_optionalChain([importer, 'optionalAccess', _22 => _22.replace, 'call', _23 => _23(/\\/g, "/"), 'access', _24 => _24.includes, 'call', _25 => _25("/@vercel/og/")])) {
1507
+ if (!source.endsWith(".wasm?module") || !_optionalChain([importer, 'optionalAccess', _36 => _36.replace, 'call', _37 => _37(/\\/g, "/"), 'access', _38 => _38.includes, 'call', _39 => _39("/@vercel/og/")])) {
1437
1508
  return null;
1438
1509
  }
1439
1510
  const requestPath = source.slice(0, -"?module".length);
@@ -1509,9 +1580,9 @@ function hasFarmRuntimeConfigModule(config, configModulePath) {
1509
1580
  return Boolean(configModulePath || (config.layers || []).some((layer) => layer.configFile));
1510
1581
  }
1511
1582
  function nameCodeSplittingGroups(bundlerConfig) {
1512
- const outputs = _optionalChain([bundlerConfig, 'optionalAccess', _26 => _26.output]);
1583
+ const outputs = _optionalChain([bundlerConfig, 'optionalAccess', _40 => _40.output]);
1513
1584
  for (const output of Array.isArray(outputs) ? outputs : [outputs]) {
1514
- const groups = _optionalChain([output, 'optionalAccess', _27 => _27.codeSplitting, 'optionalAccess', _28 => _28.groups]);
1585
+ const groups = _optionalChain([output, 'optionalAccess', _41 => _41.codeSplitting, 'optionalAccess', _42 => _42.groups]);
1515
1586
  if (!Array.isArray(groups)) continue;
1516
1587
  groups.forEach((group, index) => {
1517
1588
  if (group && typeof group.name === "function" && !group.debugName) {
@@ -1567,9 +1638,9 @@ function restoreLiteralModuleSpecifiers(code, fileName, { parseSync, Visitor })
1567
1638
  if (needsAst) {
1568
1639
  replacements.length = 0;
1569
1640
  const restore = (node) => {
1570
- if (_optionalChain([node, 'optionalAccess', _29 => _29.type]) !== "TemplateLiteral") return;
1641
+ if (_optionalChain([node, 'optionalAccess', _43 => _43.type]) !== "TemplateLiteral") return;
1571
1642
  const template = node;
1572
- const value = _optionalChain([template, 'access', _30 => _30.quasis, 'access', _31 => _31[0], 'optionalAccess', _32 => _32.value, 'access', _33 => _33.cooked]);
1643
+ const value = _optionalChain([template, 'access', _44 => _44.quasis, 'access', _45 => _45[0], 'optionalAccess', _46 => _46.value, 'access', _47 => _47.cooked]);
1573
1644
  if (template.expressions.length > 0 || typeof value !== "string") return;
1574
1645
  replacements.push({
1575
1646
  start: template.start,
@@ -1616,15 +1687,14 @@ function createServerChunkMinifyPlugin(options) {
1616
1687
  function trimSlashes(value) {
1617
1688
  return value.replace(/^\/+|\/+$/g, "");
1618
1689
  }
1619
- function resolveBuildDocsContentDir(config, root) {
1620
- if (!_optionalChain([config, 'access', _34 => _34.docs, 'optionalAccess', _35 => _35.enabled])) return null;
1621
- const configuredContentDir = config.docs.contentDir || config.docs.config.contentDir;
1690
+ function resolveBuildDocsContentDir(docs, root, srcDir) {
1691
+ const configuredContentDir = docs.contentDir || docs.config.contentDir;
1622
1692
  if (typeof configuredContentDir === "string" && configuredContentDir.trim()) {
1623
1693
  const contentDir = _path2.default.isAbsolute(configuredContentDir) ? configuredContentDir : _path2.default.join(root, configuredContentDir);
1624
1694
  return _fs.existsSync.call(void 0, contentDir) ? contentDir : null;
1625
1695
  }
1626
- const entryDir = config.docs.config.entry || trimSlashes(config.docs.entry) || "docs";
1627
- const appDocsDir = _path2.default.join(root, config.srcDir || "src", "app", entryDir);
1696
+ const entryDir = docs.config.entry || trimSlashes(docs.entry) || "docs";
1697
+ const appDocsDir = _path2.default.join(root, srcDir || "src", "app", entryDir);
1628
1698
  if (_fs.existsSync.call(void 0, appDocsDir)) return appDocsDir;
1629
1699
  const rootDocsDir = _path2.default.join(root, entryDir);
1630
1700
  return _fs.existsSync.call(void 0, rootDocsDir) ? rootDocsDir : null;
@@ -1648,7 +1718,7 @@ function hasProjectPostcssConfig(root) {
1648
1718
  try {
1649
1719
  projectRequire.resolve(`./${file}`);
1650
1720
  return true;
1651
- } catch (e18) {
1721
+ } catch (e19) {
1652
1722
  return false;
1653
1723
  }
1654
1724
  });
@@ -1670,14 +1740,14 @@ async function findFarmConfigPath(root) {
1670
1740
  try {
1671
1741
  await fs4.access(resolvedPath);
1672
1742
  return resolvedPath;
1673
- } catch (e19) {
1743
+ } catch (e20) {
1674
1744
  }
1675
1745
  }
1676
1746
  return null;
1677
1747
  }
1678
1748
  function hasFarmServerRuntimePlugins(config) {
1679
1749
  return (config.plugins || []).some((plugin) => {
1680
- if (_chunkWAPQWAE6cjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) === false) return false;
1750
+ if (_chunkCECUDGXQcjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) === false) return false;
1681
1751
  return Boolean(
1682
1752
  plugin.setup || plugin.init || plugin.ready || plugin.shutdown || plugin.runtime || plugin.router || plugin.render || plugin.beforeRouteMatch || plugin.afterRouteMatch || plugin.beforeRender || plugin.afterRender || plugin.onError || plugin.transformHTML
1683
1753
  );
@@ -1688,7 +1758,7 @@ function hasFarmPluginRoutes(config) {
1688
1758
  }
1689
1759
  function farmServerRuntimePluginsMayHandlePath(config, pathname) {
1690
1760
  return (config.plugins || []).some(
1691
- (plugin) => _chunkWAPQWAE6cjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) !== false && _chunk47JV57DAcjs.farmPluginMayAffectRuntimePath.call(void 0, plugin, pathname)
1761
+ (plugin) => _chunkCECUDGXQcjs.getFarmIntegrationPluginServerRuntime.call(void 0, plugin) !== false && _chunk47JV57DAcjs.farmPluginMayAffectRuntimePath.call(void 0, plugin, pathname)
1692
1762
  );
1693
1763
  }
1694
1764
  async function discoverMiddlewareRoutes(appDir) {
@@ -1699,7 +1769,7 @@ async function discoverMiddlewareRoutes(appDir) {
1699
1769
  let entries;
1700
1770
  try {
1701
1771
  entries = await fs4.readdir(dir, { withFileTypes: true });
1702
- } catch (e20) {
1772
+ } catch (e21) {
1703
1773
  return;
1704
1774
  }
1705
1775
  const middlewareFile = entries.find(
@@ -1718,8 +1788,8 @@ async function discoverMiddlewareRoutes(appDir) {
1718
1788
  }
1719
1789
  await walk(
1720
1790
  _path2.default.join(dir, entry.name),
1721
- _chunkL6QDME5Zcjs.appendMiddlewareRoutePath.call(void 0, routePath, entry.name),
1722
- _chunkL6QDME5Zcjs.appendMiddlewareDirectory.call(void 0, directory, entry.name),
1791
+ _chunkB3GZAQSCcjs.appendMiddlewareRoutePath.call(void 0, routePath, entry.name),
1792
+ _chunkB3GZAQSCcjs.appendMiddlewareDirectory.call(void 0, directory, entry.name),
1723
1793
  discovered
1724
1794
  );
1725
1795
  }
@@ -1731,10 +1801,10 @@ async function discoverMiddlewareRoutes(appDir) {
1731
1801
  routes.set(route.directory, route);
1732
1802
  }
1733
1803
  }
1734
- return Array.from(routes.values()).sort(_chunkL6QDME5Zcjs.compareMiddlewareRouteLocations).map(({ path: routePath, filePath }) => ({ path: routePath, filePath }));
1804
+ return Array.from(routes.values()).sort(_chunkB3GZAQSCcjs.compareMiddlewareRouteLocations).map(({ path: routePath, filePath }) => ({ path: routePath, filePath }));
1735
1805
  }
1736
1806
  function assertFarmDocsRuntimeSupported(config, preset) {
1737
- if (!_optionalChain([config, 'access', _36 => _36.docs, 'optionalAccess', _37 => _37.enabled]) || !_optionalChain([config, 'access', _38 => _38.docs, 'access', _39 => _39.adapter, 'optionalAccess', _40 => _40.server]) || _chunkE552H232cjs.getFarmPresetRuntime.call(void 0, preset) !== "edge" || Boolean(config.docs.adapter.edgeCompiler)) {
1807
+ if (!_optionalChain([config, 'access', _48 => _48.docs, 'optionalAccess', _49 => _49.enabled]) || !_optionalChain([config, 'access', _50 => _50.docs, 'access', _51 => _51.adapter, 'optionalAccess', _52 => _52.server]) || _chunkE552H232cjs.getFarmPresetRuntime.call(void 0, preset) !== "edge" || Boolean(config.docs.adapter.edgeCompiler)) {
1738
1808
  return;
1739
1809
  }
1740
1810
  throw new Error(
@@ -1747,13 +1817,13 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
1747
1817
  assertFarmDocsRuntimeSupported(config, preset);
1748
1818
  const srcDir = config.srcDir || "src";
1749
1819
  const distDir = config.distDir || ".farm";
1750
- const deployOutputDir = _chunkLYWAGXXWcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
1820
+ const deployOutputDir = _chunkVITZRYW3cjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
1751
1821
  const lifecyclePluginManager = options.pluginManager;
1752
1822
  const productionViteResultPromise = Promise.allSettled([
1753
1823
  Promise.resolve(_nullishCoalesce(options.productionVite, () => ( _chunkMF3IA2AWcjs.loadFarmProductionVite.call(void 0, ))))
1754
1824
  ]);
1755
1825
  const nitroBuilderResultPromise = preloadFarmNitroBuilder();
1756
- _chunkXN2MB4QZcjs.logger.info(`\u{1F69C} Building Farm.js application (universal) with preset: ${preset}...`);
1826
+ _chunkVQJYGZNXcjs.logger.info(`\u{1F69C} Building Farm.js application (universal) with preset: ${preset}...`);
1757
1827
  const rendererBuild = options.rendererBuildLifetime ? void 0 : new AbortController();
1758
1828
  const rendererBuildLifetime = _nullishCoalesce(options.rendererBuildLifetime, () => ( rendererBuild.signal));
1759
1829
  try {
@@ -1790,7 +1860,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
1790
1860
  fallback: entry.fallback
1791
1861
  })
1792
1862
  );
1793
- _chunkXN2MB4QZcjs.logger.info(`\u{1F4CB} Found ${pageRoutes.length} page routes`);
1863
+ _chunkVQJYGZNXcjs.logger.info(`\u{1F4CB} Found ${pageRoutes.length} page routes`);
1794
1864
  const fs4 = await import("fs/promises");
1795
1865
  const layoutRoutes = [];
1796
1866
  const appDir = _path2.default.join(root, srcDir, "app");
@@ -1808,7 +1878,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
1808
1878
  await findLayoutsForClient(_path2.default.join(dir, entry.name), childPrefix);
1809
1879
  }
1810
1880
  }
1811
- } catch (e21) {
1881
+ } catch (e22) {
1812
1882
  }
1813
1883
  }
1814
1884
  await findLayoutsForClient(appDir);
@@ -1818,7 +1888,7 @@ async function buildUniversal(config, routeManager, apiRouteManager, serverRende
1818
1888
  seenLayoutPatterns.add(pattern);
1819
1889
  layoutRoutes.push({ pattern, modulePath: entry.modulePath });
1820
1890
  }
1821
- _chunkXN2MB4QZcjs.logger.info(`\u{1F4CB} Found ${pageRoutes.length} page routes and ${layoutRoutes.length} layouts`);
1891
+ _chunkVQJYGZNXcjs.logger.info(`\u{1F4CB} Found ${pageRoutes.length} page routes and ${layoutRoutes.length} layouts`);
1822
1892
  const isolatedClientBoundaryModules = routeManager.getIsolatedClientBoundaryModules(root);
1823
1893
  const islandsErrors = routeManager.getIslandsErrors(root);
1824
1894
  if (islandsErrors.length > 0) {
@@ -1836,7 +1906,7 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
1836
1906
  throw productionViteResult.reason;
1837
1907
  }
1838
1908
  const productionVite = productionViteResult.value;
1839
- _chunkXN2MB4QZcjs.logger.info("\u26A1 Building application bundles with Vite Rolldown");
1909
+ _chunkVQJYGZNXcjs.logger.info("\u26A1 Building application bundles with Vite Rolldown");
1840
1910
  const buildClientBundle = () => buildClient(
1841
1911
  productionVite,
1842
1912
  config,
@@ -1869,11 +1939,11 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
1869
1939
  let clientBuildResult;
1870
1940
  let ssrBuildResult;
1871
1941
  if (config.renderer.buildConcurrency === "serial") {
1872
- _chunkXN2MB4QZcjs.logger.info(`\u{1F4E6} Building client and SSR bundles serially for ${config.renderer.name}...`);
1942
+ _chunkVQJYGZNXcjs.logger.info(`\u{1F4E6} Building client and SSR bundles serially for ${config.renderer.name}...`);
1873
1943
  [clientBuildResult] = await Promise.allSettled([buildClientBundle()]);
1874
1944
  [ssrBuildResult] = await Promise.allSettled([buildSSRBundle()]);
1875
1945
  } else {
1876
- _chunkXN2MB4QZcjs.logger.info("\u{1F4E6} Building client and SSR bundles in parallel...");
1946
+ _chunkVQJYGZNXcjs.logger.info("\u{1F4E6} Building client and SSR bundles in parallel...");
1877
1947
  [clientBuildResult, ssrBuildResult] = await Promise.allSettled([
1878
1948
  buildClientBundle(),
1879
1949
  buildSSRBundle()
@@ -1888,7 +1958,7 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
1888
1958
  if (productionVite.builder !== "rolldown" || !(clientBuildResult.reason instanceof IncompleteClientBuildOutputError)) {
1889
1959
  throw clientBuildResult.reason;
1890
1960
  }
1891
- _chunkXN2MB4QZcjs.logger.warn("Client bundle was incomplete; retrying after the SSR build...");
1961
+ _chunkVQJYGZNXcjs.logger.warn("Client bundle was incomplete; retrying after the SSR build...");
1892
1962
  try {
1893
1963
  await buildClient(
1894
1964
  productionVite,
@@ -1915,14 +1985,14 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
1915
1985
  const routeRuntimeManifest = routeRuntimeManifestResult.value;
1916
1986
  const runtimeValidation = validateFarmRouteRuntimeDeployment(routeRuntimeManifest, preset);
1917
1987
  for (const warning of runtimeValidation.warnings) {
1918
- _chunkXN2MB4QZcjs.logger.warn(warning);
1988
+ _chunkVQJYGZNXcjs.logger.warn(warning);
1919
1989
  }
1920
1990
  const { bundle: ssrBundle, entryFile: ssrEntryFile, configuredHeaderRoutes } = ssrResult;
1921
1991
  await writeSSRAssetsToClient(ssrBundle, clientOutputDir);
1922
1992
  if (config.docs.enabled) {
1923
1993
  await copyFarmDocsFontAssetsToClient(root, clientOutputDir);
1924
1994
  }
1925
- _chunkXN2MB4QZcjs.logger.info(`\u{1F680} Building server with Nitro (preset: ${preset})...`);
1995
+ _chunkVQJYGZNXcjs.logger.info(`\u{1F680} Building server with Nitro (preset: ${preset})...`);
1926
1996
  await buildNitroUniversal(
1927
1997
  config,
1928
1998
  routeManager,
@@ -1943,7 +2013,7 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
1943
2013
  _path2.default.join(root, distDir),
1944
2014
  routeRuntimeManifest
1945
2015
  );
1946
- _chunkXN2MB4QZcjs.logger.info(`\u{1F4CB} Route runtime manifest: ${_path2.default.relative(root, runtimeManifestPath)}`);
2016
+ _chunkVQJYGZNXcjs.logger.info(`\u{1F4CB} Route runtime manifest: ${_path2.default.relative(root, runtimeManifestPath)}`);
1947
2017
  } catch (error) {
1948
2018
  if (lifecyclePluginManager) {
1949
2019
  await lifecyclePluginManager.runHookParallel("onError", {
@@ -1955,10 +2025,10 @@ ${islandsErrors.map((error) => ` - ${error}`).join("\n")}`
1955
2025
  }
1956
2026
  });
1957
2027
  }
1958
- _chunkXN2MB4QZcjs.logger.error(`\u274C Build failed: ${error}`);
2028
+ _chunkVQJYGZNXcjs.logger.error(`\u274C Build failed: ${error}`);
1959
2029
  throw error;
1960
2030
  } finally {
1961
- _optionalChain([rendererBuild, 'optionalAccess', _41 => _41.abort, 'call', _42 => _42()]);
2031
+ _optionalChain([rendererBuild, 'optionalAccess', _53 => _53.abort, 'call', _54 => _54()]);
1962
2032
  }
1963
2033
  }
1964
2034
  async function writeSSRAssetsToClient(bundle, outputDir) {
@@ -1991,7 +2061,7 @@ async function mergeBuiltFontCss(outputDir, fontCssSource) {
1991
2061
  if (fontCss === void 0) {
1992
2062
  try {
1993
2063
  fontCss = await fs4.readFile(fontCssPath);
1994
- } catch (e22) {
2064
+ } catch (e23) {
1995
2065
  return;
1996
2066
  }
1997
2067
  }
@@ -1999,11 +2069,11 @@ async function mergeBuiltFontCss(outputDir, fontCssSource) {
1999
2069
  let clientCss = "";
2000
2070
  try {
2001
2071
  clientCss = await fs4.readFile(clientCssPath, "utf8");
2002
- } catch (e23) {
2072
+ } catch (e24) {
2003
2073
  }
2004
2074
  const normalizedFontCss = typeof fontCss === "string" ? fontCss : Buffer.from(fontCss).toString("utf8");
2005
2075
  await fs4.writeFile(fontCssPath, normalizedFontCss);
2006
- await fs4.writeFile(clientCssPath, _chunk474FO3UEcjs.mergeFarmFontCss.call(void 0, clientCss, normalizedFontCss));
2076
+ await fs4.writeFile(clientCssPath, _chunkX2M4XN4Vcjs.mergeFarmFontCss.call(void 0, clientCss, normalizedFontCss));
2007
2077
  }
2008
2078
  var IncompleteClientBuildOutputError = class extends Error {
2009
2079
  constructor(detail) {
@@ -2019,7 +2089,7 @@ async function validateClientBuildOutput(root, srcDir, outputDir) {
2019
2089
  try {
2020
2090
  const clientEntry = await fs4.stat(clientEntryPath);
2021
2091
  if (clientEntry.isFile()) clientEntrySize = clientEntry.size;
2022
- } catch (e24) {
2092
+ } catch (e25) {
2023
2093
  }
2024
2094
  if (clientEntrySize === 0) {
2025
2095
  throw new IncompleteClientBuildOutputError("farm-client.js is missing or empty");
@@ -2030,7 +2100,7 @@ async function validateClientBuildOutput(root, srcDir, outputDir) {
2030
2100
  try {
2031
2101
  const globalsCss = await fs4.readFile(globalsCssPath, "utf8");
2032
2102
  expectsCss = globalsCss.replace(/\/\*[\s\S]*?\*\//g, "").trim().length > 0;
2033
- } catch (e25) {
2103
+ } catch (e26) {
2034
2104
  }
2035
2105
  try {
2036
2106
  const clientCss = await fs4.stat(clientCssPath);
@@ -2049,7 +2119,7 @@ function getCachedClientModuleHydrationPlan(modulePath, root, mode, cache, optio
2049
2119
  const key = `${_path2.default.resolve(root)}\0${mode}\0${options.asyncOwnerIslands === true}\0${options.serverOwners === true}\0${options.serverTreeLayouts === true}\0${_path2.default.resolve(modulePath)}`;
2050
2120
  let plan = cache.get(key);
2051
2121
  if (!plan) {
2052
- plan = _chunk474FO3UEcjs.getClientModuleHydrationPlan.call(void 0, modulePath, root, mode, options);
2122
+ plan = _chunkX2M4XN4Vcjs.getClientModuleHydrationPlan.call(void 0, modulePath, root, mode, options);
2053
2123
  cache.set(key, plan);
2054
2124
  }
2055
2125
  return { ...plan, isolatedBoundaries: [...plan.isolatedBoundaries] };
@@ -2066,31 +2136,31 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2066
2136
  });
2067
2137
  pluginManager.addPlugins(config.plugins || []);
2068
2138
  const clientPages = [];
2069
- const integrationProviders = _chunkWAPQWAE6cjs.getIntegrationProviders.call(void 0, config.integrations).filter(
2139
+ const integrationProviders = _chunkCECUDGXQcjs.getIntegrationProviders.call(void 0, config.integrations).filter(
2070
2140
  (provider) => provider.component || provider.type === "clerk"
2071
2141
  );
2072
2142
  const unsupportedIntegrationProvider = integrationProviders.find(
2073
2143
  (provider) => provider.supportsIsolatedHydration !== true
2074
2144
  );
2075
- if (_optionalChain([config, 'access', _43 => _43.experimental, 'optionalAccess', _44 => _44.isolatedClientHydration]) === "enabled" && _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _45 => _45.experimental, 'optionalAccess', _46 => _46.serverComponents])) !== "rsc" && unsupportedIntegrationProvider) {
2076
- _chunkXN2MB4QZcjs.logger.warn(
2145
+ if (_optionalChain([config, 'access', _55 => _55.experimental, 'optionalAccess', _56 => _56.isolatedClientHydration]) === "enabled" && _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _57 => _57.experimental, 'optionalAccess', _58 => _58.serverComponents])) !== "rsc" && unsupportedIntegrationProvider) {
2146
+ _chunkVQJYGZNXcjs.logger.warn(
2077
2147
  `[Farm.js] isolated hydration kept route-wide because integration provider "${unsupportedIntegrationProvider.name}" does not declare supportsIsolatedHydration: true.`
2078
2148
  );
2079
2149
  }
2080
- const isolatedMode = _chunk474FO3UEcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
2081
- _optionalChain([config, 'access', _47 => _47.experimental, 'optionalAccess', _48 => _48.isolatedClientHydration]),
2150
+ const isolatedMode = _chunkX2M4XN4Vcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
2151
+ _optionalChain([config, 'access', _59 => _59.experimental, 'optionalAccess', _60 => _60.isolatedClientHydration]),
2082
2152
  {
2083
- serverComponents: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _49 => _49.experimental, 'optionalAccess', _50 => _50.serverComponents])) === "rsc",
2153
+ serverComponents: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _61 => _61.experimental, 'optionalAccess', _62 => _62.serverComponents])) === "rsc",
2084
2154
  hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
2085
2155
  }
2086
2156
  );
2087
- const planOptions = _chunk474FO3UEcjs.getFarmClientHydrationPlanOptions.call(void 0,
2157
+ const planOptions = _chunkX2M4XN4Vcjs.getFarmClientHydrationPlanOptions.call(void 0,
2088
2158
  config.renderer,
2089
2159
  Boolean(unsupportedIntegrationProvider)
2090
2160
  );
2091
2161
  const pagePlanOptions = {
2092
2162
  ...planOptions,
2093
- serverOwners: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _51 => _51.experimental, 'optionalAccess', _52 => _52.serverComponents])) === "islands"
2163
+ serverOwners: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _63 => _63.experimental, 'optionalAccess', _64 => _64.serverComponents])) === "islands"
2094
2164
  };
2095
2165
  const layoutPlanOptions = {
2096
2166
  ...planOptions,
@@ -2122,7 +2192,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2122
2192
  serverTreeLayout: metadata.serverTreeLayout
2123
2193
  };
2124
2194
  } catch (error) {
2125
- _chunkXN2MB4QZcjs.logger.warn(`\u26A0\uFE0F Could not inspect layout file ${layout.modulePath}: ${error}`);
2195
+ _chunkVQJYGZNXcjs.logger.warn(`\u26A0\uFE0F Could not inspect layout file ${layout.modulePath}: ${error}`);
2126
2196
  return {
2127
2197
  ...layout,
2128
2198
  shouldHydrate: false,
@@ -2141,18 +2211,21 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2141
2211
  };
2142
2212
  }
2143
2213
  });
2144
- const layoutAppliesToRoute = _chunkVCKGOXFIcjs.routeBoundaryCoversDirectory;
2214
+ const layoutAppliesToRoute = _chunk76GHW3WIcjs.routeBoundaryCoversDirectory;
2145
2215
  const routeDirectory = (route) => _nullishCoalesce(route.directory, () => ( route.pattern));
2146
2216
  const adapterOwnsDocsRuntime = Boolean(
2147
- _chunkRD623KW4cjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _53 => _53.docs, 'optionalAccess', _54 => _54.enabled]) && _optionalChain([config, 'access', _55 => _55.docs, 'access', _56 => _56.adapter, 'optionalAccess', _57 => _57.server]) && config.docs.adapter.react
2217
+ _chunkRD623KW4cjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _65 => _65.docs, 'optionalAccess', _66 => _66.enabled]) && _optionalChain([config, 'access', _67 => _67.docs, 'access', _68 => _68.adapter, 'optionalAccess', _69 => _69.server]) && config.docs.adapter.react
2148
2218
  );
2149
- const adapterDocsEntry = _optionalChain([config, 'access', _58 => _58.docs, 'optionalAccess', _59 => _59.enabled]) ? `/${config.docs.entry || "docs"}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/" : null;
2150
- const isAdapterDocsRoute = (routePattern) => Boolean(
2151
- adapterOwnsDocsRuntime && adapterDocsEntry && (adapterDocsEntry === "/" || routePattern === adapterDocsEntry || routePattern.startsWith(`${adapterDocsEntry}/`))
2219
+ const docsEntries = _optionalChain([config, 'access', _70 => _70.docs, 'optionalAccess', _71 => _71.enabled]) ? _chunk5N7QAGEAcjs.getFarmDocsRoots.call(void 0, config.docs).map(
2220
+ (docsRoot) => `/${docsRoot.entry || "docs"}`.replace(/\/+/g, "/").replace(/\/$/, "") || "/"
2221
+ ) : [];
2222
+ const adapterDocsEntry = _nullishCoalesce(docsEntries[0], () => ( null));
2223
+ const isAdapterDocsRoute = (routePattern) => adapterOwnsDocsRuntime && docsEntries.some(
2224
+ (docsEntry) => docsEntry === "/" || routePattern === docsEntry || routePattern.startsWith(`${docsEntry}/`)
2152
2225
  );
2153
- const syntheticDocsEntry = _optionalChain([config, 'access', _60 => _60.docs, 'optionalAccess', _61 => _61.enabled]) && !adapterOwnsDocsRuntime ? adapterDocsEntry : null;
2226
+ const syntheticDocsEntry = _optionalChain([config, 'access', _72 => _72.docs, 'optionalAccess', _73 => _73.enabled]) && !adapterOwnsDocsRuntime ? adapterDocsEntry : null;
2154
2227
  const syntheticDocsPatterns = syntheticDocsEntry ? syntheticDocsEntry === "/" ? ["/", "/[...slug]"] : [syntheticDocsEntry, `${syntheticDocsEntry}/[...slug]`] : [];
2155
- const markdownPagePlan = _chunk474FO3UEcjs.createMarkdownPageHydrationPlanner.call(void 0,
2228
+ const markdownPagePlan = _chunkX2M4XN4Vcjs.createMarkdownPageHydrationPlanner.call(void 0,
2156
2229
  _chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, config.mdx), root),
2157
2230
  root,
2158
2231
  isolatedMode,
@@ -2168,7 +2241,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2168
2241
  pagePlanOptions
2169
2242
  )
2170
2243
  }));
2171
- _chunk474FO3UEcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
2244
+ _chunkX2M4XN4Vcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
2172
2245
  clientLayouts.map((layout) => ({
2173
2246
  pattern: layout.pattern,
2174
2247
  depth: layout.pattern.split("/").filter(Boolean).length,
@@ -2177,7 +2250,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2177
2250
  [
2178
2251
  ...routePlans.map(({ route, metadata }) => ({
2179
2252
  pattern: routeDirectory(route),
2180
- depth: _chunkVCKGOXFIcjs.getRouteDirectoryDepth.call(void 0, routeDirectory(route)),
2253
+ depth: _chunk76GHW3WIcjs.getRouteDirectoryDepth.call(void 0, routeDirectory(route)),
2181
2254
  metadata
2182
2255
  })),
2183
2256
  ...syntheticDocsPatterns.map((pattern) => ({
@@ -2198,9 +2271,9 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2198
2271
  layoutAppliesToRoute
2199
2272
  );
2200
2273
  for (const layout of clientLayouts) {
2201
- const matchesBuiltRoute = pageRoutes.some((route) => layoutAppliesToRoute(layout.pattern, routeDirectory(route))) || Boolean(adapterDocsEntry && layoutAppliesToRoute(layout.pattern, adapterDocsEntry));
2274
+ const matchesBuiltRoute = pageRoutes.some((route) => layoutAppliesToRoute(layout.pattern, routeDirectory(route))) || docsEntries.some((docsEntry) => layoutAppliesToRoute(layout.pattern, docsEntry));
2202
2275
  if (matchesBuiltRoute && layout.suppressedAsyncHydration) {
2203
- _chunkXN2MB4QZcjs.logger.warn(`\u26A0\uFE0F ${_chunk474FO3UEcjs.describeSuppressedAsyncHydration.call(void 0, layout.pattern, layout.fallbackReason)}`);
2276
+ _chunkVQJYGZNXcjs.logger.warn(`\u26A0\uFE0F ${_chunkX2M4XN4Vcjs.describeSuppressedAsyncHydration.call(void 0, layout.pattern, layout.fallbackReason)}`);
2204
2277
  }
2205
2278
  }
2206
2279
  if (isolatedMode === "analyze") {
@@ -2211,7 +2284,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2211
2284
  if (!("isolatedHydrationEligible" in metadata) || !metadata.isolatedHydrationEligible) {
2212
2285
  continue;
2213
2286
  }
2214
- _chunkXN2MB4QZcjs.logger.info(
2287
+ _chunkVQJYGZNXcjs.logger.info(
2215
2288
  `\u{1F4CA} Isolated hydration analysis: ${entry.modulePath} can exclude its server owner and hydrate ${metadata.isolatedBoundaries.length} client ${metadata.isolatedBoundaries.length === 1 ? "boundary" : "boundaries"}.`
2216
2289
  );
2217
2290
  }
@@ -2223,8 +2296,8 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2223
2296
  (layout) => (layout.shouldHydrate || layout.hasIsolatedClientBoundaries) && layoutAppliesToRoute(layout.pattern, routeDirectory(route))
2224
2297
  );
2225
2298
  if (metadata.suppressedAsyncHydration) {
2226
- _chunkXN2MB4QZcjs.logger.warn(
2227
- `\u26A0\uFE0F ${_chunk474FO3UEcjs.describeSuppressedAsyncHydration.call(void 0, route.pattern, metadata.fallbackReason)}`
2299
+ _chunkVQJYGZNXcjs.logger.warn(
2300
+ `\u26A0\uFE0F ${_chunkX2M4XN4Vcjs.describeSuppressedAsyncHydration.call(void 0, route.pattern, metadata.fallbackReason)}`
2228
2301
  );
2229
2302
  }
2230
2303
  if (metadata.shouldHydrate || metadata.hasIsolatedClientBoundaries || applicableClientLayouts.length > 0) {
@@ -2249,12 +2322,12 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2249
2322
  ...applicableClientLayouts.filter((layout) => layout.hasIsolatedClientBoundaries || layout.serverTreeLayout).flatMap((layout) => layout.isolatedBoundaries)
2250
2323
  ],
2251
2324
  // The server renders a server tree only below a hydrating layout.
2252
- ..._chunk474FO3UEcjs.usesFarmServerTree.call(void 0, metadata) && applicableClientLayouts.some((layout) => layout.shouldHydrate) ? { serverTree: true } : {}
2325
+ ..._chunkX2M4XN4Vcjs.usesFarmServerTree.call(void 0, metadata) && applicableClientLayouts.some((layout) => layout.shouldHydrate) ? { serverTree: true } : {}
2253
2326
  });
2254
- _chunkXN2MB4QZcjs.logger.info(`\u{1F4F1} Found hydratable route: ${route.pattern} -> ${route.modulePath}`);
2327
+ _chunkVQJYGZNXcjs.logger.info(`\u{1F4F1} Found hydratable route: ${route.pattern} -> ${route.modulePath}`);
2255
2328
  }
2256
2329
  } catch (error) {
2257
- _chunkXN2MB4QZcjs.logger.warn(`\u26A0\uFE0F Could not inspect route file ${route.modulePath}: ${error}`);
2330
+ _chunkVQJYGZNXcjs.logger.warn(`\u26A0\uFE0F Could not inspect route file ${route.modulePath}: ${error}`);
2258
2331
  }
2259
2332
  }
2260
2333
  if (syntheticDocsEntry) {
@@ -2285,13 +2358,13 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2285
2358
  }
2286
2359
  const clientRouteSlots = routeSlots.filter((slot) => {
2287
2360
  try {
2288
- return _chunk474FO3UEcjs.getClientModuleMetadata.call(void 0, slot.modulePath, root).shouldHydrate;
2361
+ return _chunkX2M4XN4Vcjs.getClientModuleMetadata.call(void 0, slot.modulePath, root).shouldHydrate;
2289
2362
  } catch (error) {
2290
- _chunkXN2MB4QZcjs.logger.warn(`\u26A0\uFE0F Could not inspect route slot ${slot.modulePath}: ${error}`);
2363
+ _chunkVQJYGZNXcjs.logger.warn(`\u26A0\uFE0F Could not inspect route slot ${slot.modulePath}: ${error}`);
2291
2364
  return false;
2292
2365
  }
2293
2366
  });
2294
- _chunkXN2MB4QZcjs.logger.info(
2367
+ _chunkVQJYGZNXcjs.logger.info(
2295
2368
  `\u{1F4F1} Total hydratable routes detected: ${clientPages.length} pages, ${clientLayouts.filter((layout) => layout.shouldHydrate || layout.hasIsolatedClientBoundaries).length} layouts, and ${clientRouteSlots.length} slots`
2296
2369
  );
2297
2370
  const clientEntryRoot = _path2.default.join(root, ".farm", "tmp");
@@ -2304,20 +2377,20 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2304
2377
  clientRouteSlots,
2305
2378
  root,
2306
2379
  srcDir,
2307
- adapterOwnsDocsRuntime ? false : _chunkEQMTJBB7cjs.isFarmDocsSearchEnabled.call(void 0, config.docs),
2308
- adapterOwnsDocsRuntime ? void 0 : _chunkEQMTJBB7cjs.resolveFarmDocsSearchClientModule.call(void 0, root),
2309
- _optionalChain([config, 'access', _62 => _62.docs, 'optionalAccess', _63 => _63.enabled]) ? config.docs.entry : void 0,
2310
- adapterOwnsDocsRuntime ? _optionalChain([config, 'access', _64 => _64.docs, 'access', _65 => _65.adapter, 'optionalAccess', _66 => _66.react]) : void 0,
2380
+ adapterOwnsDocsRuntime ? false : _chunkDZZHTMWMcjs.isFarmDocsSearchEnabled.call(void 0, config.docs),
2381
+ adapterOwnsDocsRuntime ? void 0 : _chunkDZZHTMWMcjs.resolveFarmDocsSearchClientModule.call(void 0, root),
2382
+ _optionalChain([config, 'access', _74 => _74.docs, 'optionalAccess', _75 => _75.enabled]) ? _chunk5N7QAGEAcjs.getFarmDocsRoots.call(void 0, config.docs).map((docsRoot) => docsRoot.entry) : void 0,
2383
+ adapterOwnsDocsRuntime ? _optionalChain([config, 'access', _76 => _76.docs, 'access', _77 => _77.adapter, 'optionalAccess', _78 => _78.react]) : void 0,
2311
2384
  config.i18n,
2312
2385
  config.plugins,
2313
2386
  config.renderer,
2314
2387
  config.publicRuntimeConfig,
2315
2388
  config.trailingSlash,
2316
- _chunkWAPQWAE6cjs.getIntegrationProviders.call(void 0, config.integrations),
2389
+ _chunkCECUDGXQcjs.getIntegrationProviders.call(void 0, config.integrations),
2317
2390
  config.basePath,
2318
- _chunk474FO3UEcjs.generateClientCachePersistenceCode.call(void 0, _chunk474FO3UEcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, config.cache)),
2391
+ _chunkX2M4XN4Vcjs.generateClientCachePersistenceCode.call(void 0, _chunkX2M4XN4Vcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, config.cache)),
2319
2392
  adapterOwnsDocsRuntime ? _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0,
2320
- _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _67 => _67.experimental, 'optionalAccess', _68 => _68.serverComponents])) === "islands"
2393
+ _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _79 => _79.experimental, 'optionalAccess', _80 => _80.serverComponents])) === "islands"
2321
2394
  );
2322
2395
  await fs4.writeFile(clientEntryPath, clientHydrationCode);
2323
2396
  const hasScopedPostcssConfig = hasProjectPostcssConfig(root);
@@ -2328,12 +2401,12 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2328
2401
  buildLifetime: rendererBuildLifetime
2329
2402
  });
2330
2403
  if (hasScopedPostcssConfig) {
2331
- _chunkXN2MB4QZcjs.logger.info("\u{1F4E6} Using project PostCSS/Tailwind configuration");
2404
+ _chunkVQJYGZNXcjs.logger.info("\u{1F4E6} Using project PostCSS/Tailwind configuration");
2332
2405
  } else {
2333
2406
  const postcssConfigPath = _path2.default.join(clientEntryDir, "postcss.config.cjs");
2334
2407
  await fs4.writeFile(postcssConfigPath, "module.exports = { plugins: [] };\n");
2335
2408
  postcssSearchPath = clientEntryDir;
2336
- tailwindVitePlugin = await _chunkIXSMFKZ2cjs.loadTailwindVitePlugin.call(void 0, {
2409
+ tailwindVitePlugin = await _chunkLNM57D3Hcjs.loadTailwindVitePlugin.call(void 0, {
2337
2410
  builder: productionVite.builder,
2338
2411
  announce: true
2339
2412
  });
@@ -2354,7 +2427,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2354
2427
  outDir: outputDir,
2355
2428
  emptyOutDir: true,
2356
2429
  // Never public: see resolveFarmClientSourcemap.
2357
- sourcemap: resolveFarmClientSourcemap(_optionalChain([config, 'access', _69 => _69.vite, 'optionalAccess', _70 => _70.build, 'optionalAccess', _71 => _71.sourcemap])),
2430
+ sourcemap: resolveFarmClientSourcemap(_optionalChain([config, 'access', _81 => _81.vite, 'optionalAccess', _82 => _82.build, 'optionalAccess', _83 => _83.sourcemap])),
2358
2431
  assetsInlineLimit: 0,
2359
2432
  cssCodeSplit: false,
2360
2433
  // Bundle all CSS into one file
@@ -2368,34 +2441,15 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2368
2441
  hashCharacters: "hex",
2369
2442
  // Use predictable name for CSS so we can reference it in SSR HTML
2370
2443
  assetFileNames: (assetInfo) => {
2371
- if (_optionalChain([assetInfo, 'access', _72 => _72.name, 'optionalAccess', _73 => _73.endsWith, 'call', _74 => _74(".css")])) {
2444
+ if (_optionalChain([assetInfo, 'access', _84 => _84.name, 'optionalAccess', _85 => _85.endsWith, 'call', _86 => _86(".css")])) {
2372
2445
  return "farm-client.css";
2373
2446
  }
2374
2447
  return "assets/[name]-h[hash][extname]";
2375
2448
  }
2376
2449
  },
2377
- // Externalize Node.js built-ins and server-side modules for client build
2450
+ // A browser cannot load a Node builtin: farmServerOnlyEntriesPlugin
2451
+ // resolves one to Farm's browser module for it instead.
2378
2452
  external: (id) => {
2379
- if (id.startsWith("node:") || [
2380
- "path",
2381
- "url",
2382
- "fs",
2383
- "fs/promises",
2384
- "os",
2385
- "crypto",
2386
- "http",
2387
- "https",
2388
- "net",
2389
- "stream",
2390
- "util",
2391
- "events",
2392
- "child_process",
2393
- "module",
2394
- "tty",
2395
- "dns"
2396
- ].includes(id)) {
2397
- return true;
2398
- }
2399
2453
  if (id === "fsevents" || id.includes("fsevents") || id.endsWith(".node")) {
2400
2454
  return true;
2401
2455
  }
@@ -2404,7 +2458,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2404
2458
  }
2405
2459
  },
2406
2460
  plugins: [
2407
- _chunk474FO3UEcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
2461
+ _chunkX2M4XN4Vcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
2408
2462
  createFarmPrivateClientSourcemapsPlugin({
2409
2463
  outDir: _path2.default.join(_path2.default.dirname(outputDir), FARM_CLIENT_SOURCEMAPS_DIR)
2410
2464
  }),
@@ -2429,7 +2483,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2429
2483
  ...rendererVitePlugins,
2430
2484
  ...config.vite.plugins || [],
2431
2485
  farmServerOnlyEntriesPlugin(),
2432
- _chunk474FO3UEcjs.farmDocsClientConfigPlugin.call(void 0,
2486
+ _chunkX2M4XN4Vcjs.farmDocsClientConfigPlugin.call(void 0,
2433
2487
  adapterOwnsDocsRuntime ? _chunkSM2SYWARcjs.getFarmDocsAdapterConfigModule.call(void 0, config.docs) : void 0
2434
2488
  ),
2435
2489
  // Plugin to redirect @farm.js/core imports to client-only exports
@@ -2483,7 +2537,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2483
2537
  { ...config, isolatedClientBoundaryModules, programmaticClientRoutes },
2484
2538
  pluginManager
2485
2539
  ),
2486
- _chunkJ37KTQIAcjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
2540
+ _chunkNK2VWS7Pcjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
2487
2541
  ],
2488
2542
  mode: "production",
2489
2543
  css: postcssSearchPath ? {
@@ -2491,7 +2545,7 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2491
2545
  } : void 0,
2492
2546
  // Ensure React is bundled for client
2493
2547
  resolve: {
2494
- alias: _chunk474FO3UEcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
2548
+ alias: _chunkX2M4XN4Vcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
2495
2549
  dedupe: [...config.renderer.dedupe || []]
2496
2550
  },
2497
2551
  // Optimize dependencies - exclude server-side code from client bundle
@@ -2504,13 +2558,13 @@ async function buildClient(productionVite, config, root, srcDir, outputDir, page
2504
2558
  ]
2505
2559
  }
2506
2560
  };
2507
- await viteBuild(_chunk474FO3UEcjs.mergeFarmProductionViteConfig.call(void 0, clientViteConfig, config.vite));
2561
+ await viteBuild(_chunkX2M4XN4Vcjs.mergeFarmProductionViteConfig.call(void 0, clientViteConfig, config.vite));
2508
2562
  await mergeBuiltFontCss(outputDir);
2509
2563
  await validateClientBuildOutput(root, srcDir, outputDir);
2510
2564
  } finally {
2511
2565
  try {
2512
2566
  await fs4.rm(clientEntryDir, { recursive: true, force: true });
2513
- } catch (e26) {
2567
+ } catch (e27) {
2514
2568
  }
2515
2569
  }
2516
2570
  }
@@ -3358,6 +3412,14 @@ function countFarmKeptLayouts(request, layouts, params) {
3358
3412
  // browser's chain starts at the next layout.
3359
3413
  return keys.length > 1 ? 1 + getSharedLayoutPrefixLength(chain, keys.slice(1)) : 0;
3360
3414
  }
3415
+ `;
3416
+ var FARM_DOCUMENT_PARSED_RUNTIME = `function farmDocumentParsed() {
3417
+ if (document.readyState !== "loading") return Promise.resolve();
3418
+ return new Promise(function(resolve) {
3419
+ document.addEventListener("DOMContentLoaded", function() { resolve(); }, { once: true });
3420
+ });
3421
+ }
3422
+
3361
3423
  `;
3362
3424
  function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlots, root, srcDir, docsSearchEnabled, docsSearchModuleId, docsEntryPath, docsAdapterReact, i18nConfig = {
3363
3425
  enabled: false,
@@ -3379,7 +3441,7 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
3379
3441
  direction: {}
3380
3442
  }, plugins = [], renderer = _chunkRD623KW4cjs.REACT_RENDERER, publicRuntimeConfig = void 0, trailingSlash = false, integrationProviders = [], basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule, islandValues = false) {
3381
3443
  const toImportPath = (targetPath) => targetPath.replace(/\\/g, "/");
3382
- const clientPluginEntry = _chunk474FO3UEcjs.generateFarmClientPluginEntryCode.call(void 0,
3444
+ const clientPluginEntry = _chunkX2M4XN4Vcjs.generateFarmClientPluginEntryCode.call(void 0,
3383
3445
  plugins,
3384
3446
  root,
3385
3447
  srcDir,
@@ -3388,9 +3450,9 @@ function generateClientHydrationEntry(clientPages, layoutRoutes, clientRouteSlot
3388
3450
  const appSetupPath = _chunkRD623KW4cjs.resolveFarmRendererAppSetup.call(void 0, root, renderer);
3389
3451
  const rendererClientImports = _chunkRD623KW4cjs.isReactRenderer.call(void 0, renderer) ? `import React from "react";
3390
3452
  import { createRoot, hydrateRoot } from "react-dom/client";` : appSetupPath ? `import React, { createRoot, hydrateRoot, configureApp as __farmConfigureApp } from ${JSON.stringify(renderer.client)};
3391
- import __farmAppSetup from ${JSON.stringify(_chunkXN2MB4QZcjs.toPosixPath.call(void 0, appSetupPath))};
3453
+ import __farmAppSetup from ${JSON.stringify(_chunkVQJYGZNXcjs.toPosixPath.call(void 0, appSetupPath))};
3392
3454
  __farmConfigureApp(__farmAppSetup);` : `import React, { createRoot, hydrateRoot } from ${JSON.stringify(renderer.client)};`;
3393
- const providerClientCode = _chunk474FO3UEcjs.generateFarmIntegrationProviderClientCode.call(void 0,
3455
+ const providerClientCode = _chunkX2M4XN4Vcjs.generateFarmIntegrationProviderClientCode.call(void 0,
3394
3456
  integrationProviders,
3395
3457
  root,
3396
3458
  _nullishCoalesce(renderer.componentExtensions, () => ( []))
@@ -3400,18 +3462,18 @@ __farmConfigureApp(__farmAppSetup);` : `import React, { createRoot, hydrateRoot
3400
3462
  const layoutImportStatements = [];
3401
3463
  const layoutRegistrations = [];
3402
3464
  const hydratingLayoutPatterns = layoutRoutes.filter((layout) => layout.shouldHydrate).map((layout) => layout.pattern);
3403
- const treeLayoutPatterns = islandValues ? _chunkVCKGOXFIcjs.getFarmServerTreeLayoutPatterns.call(void 0, layoutRoutes) : /* @__PURE__ */ new Set();
3465
+ const treeLayoutPatterns = islandValues ? _chunk76GHW3WIcjs.getFarmServerTreeLayoutPatterns.call(void 0, layoutRoutes) : /* @__PURE__ */ new Set();
3404
3466
  layoutRoutes.forEach((layout, index) => {
3405
3467
  const relativePath = toImportPath(layout.modulePath);
3406
3468
  const treeLayout = treeLayoutPatterns.has(layout.pattern);
3407
3469
  const rendersOnClient = treeLayout || !layout.hasIsolatedClientBoundaries && hydratingLayoutPatterns.some(
3408
- (pattern) => _chunkVCKGOXFIcjs.layoutsCanCoverSamePage.call(void 0, layout.pattern, pattern)
3470
+ (pattern) => _chunk76GHW3WIcjs.layoutsCanCoverSamePage.call(void 0, layout.pattern, pattern)
3409
3471
  );
3410
3472
  if (rendersOnClient && !treeLayout) {
3411
3473
  layoutImportStatements.push(`import Layout${index} from "${relativePath}";`);
3412
3474
  }
3413
- const groupScope = _chunkVCKGOXFIcjs.getRouteGroupScope.call(void 0, layout.pattern);
3414
- const groupFields = groupScope ? `, urlPattern: ${JSON.stringify(_chunkVCKGOXFIcjs.stripRouteGroups.call(void 0, layout.pattern))}, groupScope: ${JSON.stringify(groupScope)}` : "";
3475
+ const groupScope = _chunk76GHW3WIcjs.getRouteGroupScope.call(void 0, layout.pattern);
3476
+ const groupFields = groupScope ? `, urlPattern: ${JSON.stringify(_chunk76GHW3WIcjs.stripRouteGroups.call(void 0, layout.pattern))}, groupScope: ${JSON.stringify(groupScope)}` : "";
3415
3477
  layoutRegistrations.push(
3416
3478
  ` { 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" : ""} }`
3417
3479
  );
@@ -3450,8 +3512,18 @@ function isFarmLocaleDocumentChange() {
3450
3512
  return false;
3451
3513
  }
3452
3514
  `;
3453
- const docsNavigationRuntime = docsEntryPath ? `
3454
- const farmDocsEntryPath = ${JSON.stringify(docsEntryPath)};
3515
+ const docsEntryPaths = typeof docsEntryPath === "string" ? [docsEntryPath] : _nullishCoalesce(docsEntryPath, () => ( []));
3516
+ const docsNavigationRuntime = docsEntryPaths.length > 1 ? `
3517
+ const farmDocsEntryPaths = ${JSON.stringify(docsEntryPaths)};
3518
+ function isFarmDocsPath(pathname) {
3519
+ const routePathname = getFarmRoutePathname(pathname);
3520
+ const normalizedPath = routePathname.length > 1 ? routePathname.replace(/\\/+$/, "") : routePathname;
3521
+ return farmDocsEntryPaths.some(
3522
+ (entryPath) => normalizedPath === entryPath || normalizedPath.startsWith(entryPath + "/"),
3523
+ );
3524
+ }
3525
+ ` : docsEntryPaths[0] ? `
3526
+ const farmDocsEntryPath = ${JSON.stringify(docsEntryPaths[0])};
3455
3527
  function isFarmDocsPath(pathname) {
3456
3528
  const routePathname = getFarmRoutePathname(pathname);
3457
3529
  const normalizedPath = routePathname.length > 1 ? routePathname.replace(/\\/+$/, "") : routePathname;
@@ -3478,7 +3550,7 @@ ${clientCachePersistence.imports}
3478
3550
  ${i18nClientRuntime}
3479
3551
  ${docsNavigationRuntime}
3480
3552
  ${docsAdapterRuntime}
3481
- ${_chunkEQMTJBB7cjs.generateFarmDocsSearchClientRuntime.call(void 0, docsSearchEnabled, docsSearchModuleId)}
3553
+ ${_chunkDZZHTMWMcjs.generateFarmDocsSearchClientRuntime.call(void 0, docsSearchEnabled, docsSearchModuleId)}
3482
3554
 
3483
3555
  setFarmBasePath(${JSON.stringify(basePath)});
3484
3556
  setFarmTrailingSlashPreference(${JSON.stringify(trailingSlash)});
@@ -3718,7 +3790,7 @@ void farmClientRuntime.start();
3718
3790
  spaRouter.initializeHistory();
3719
3791
  window.__FARM_SPA_ROUTER__ = spaRouter;
3720
3792
 
3721
- ${islandValues ? "void farmDocumentParsed().then(hydrateFarmDocsAdapterRuntime);" : "void hydrateFarmDocsAdapterRuntime();"}
3793
+ ${islandValues ? `${FARM_DOCUMENT_PARSED_RUNTIME}void farmDocumentParsed().then(hydrateFarmDocsAdapterRuntime);` : "void hydrateFarmDocsAdapterRuntime();"}
3722
3794
 
3723
3795
  window.addEventListener("beforeunload", function(event) {
3724
3796
  if (spaRouter.shouldBlockUnload()) {
@@ -3762,7 +3834,7 @@ document.addEventListener("click", function(e) {
3762
3834
  clientPages.forEach((page) => {
3763
3835
  for (const boundary of page.isolatedBoundaries) {
3764
3836
  isolatedBoundaryModules.set(
3765
- _chunkXN2MB4QZcjs.toViteModuleId.call(void 0, boundary.modulePath, root),
3837
+ _chunkVQJYGZNXcjs.toViteModuleId.call(void 0, boundary.modulePath, root),
3766
3838
  toImportPath(boundary.modulePath)
3767
3839
  );
3768
3840
  }
@@ -3845,7 +3917,7 @@ ${layoutImports}
3845
3917
  ${rendererClientImports}
3846
3918
  ${isolatedHydrationImport}
3847
3919
  ${providerClientCode.imports}
3848
- import { createClientCancellation, createClientPluginManager, getFarmIslandValueHeaders, getHashTargetElement, installChunkErrorRecovery, isFarmBlockedNavigationURL, isFarmExternalNavigationURL, reconcileFarmDocumentHead, runFarmNavigationDelegates, scheduleFarmIslandHydration, searchParamsToObject, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from "@farm.js/core/internal/client-runtime";
3920
+ import { createClientCancellation, createClientPluginManager, getFarmIslandValueHeaders, getHashTargetElement, installChunkErrorRecovery, isFarmBlockedNavigationURL, isFarmExternalNavigationURL, reconcileFarmDocumentHead, runFarmNavigationDelegates, scheduleFarmIslandHydration, createFarmSearchParams, searchParamsToObject, setFarmBasePath, setFarmTrailingSlashPreference, stripFarmBasePath } from "@farm.js/core/internal/client-runtime";
3849
3921
  import { createFarmDeploymentMismatchError, createFarmDeploymentRequestHeaders, isFarmDeploymentMismatchResponse } from "@farm.js/core/deployment";
3850
3922
  import { createFarmRouter, isFarmRouteActive, matchFarmRoute } from "@farm.js/core/router";
3851
3923
  ${clientPluginEntry.imports}
@@ -3855,7 +3927,7 @@ ${docsNavigationRuntime}
3855
3927
  ${docsAdapterRuntime}
3856
3928
 
3857
3929
  ${imports.join("\n")}
3858
- ${_chunkEQMTJBB7cjs.generateFarmDocsSearchClientRuntime.call(void 0, docsSearchEnabled, docsSearchModuleId)}
3930
+ ${_chunkDZZHTMWMcjs.generateFarmDocsSearchClientRuntime.call(void 0, docsSearchEnabled, docsSearchModuleId)}
3859
3931
 
3860
3932
  ${providerClientCode.runtime}
3861
3933
 
@@ -3924,7 +3996,7 @@ function hasHydratableLayout(pathname) {
3924
3996
  });
3925
3997
  }
3926
3998
 
3927
- ${_chunk474FO3UEcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
3999
+ ${_chunkX2M4XN4Vcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
3928
4000
  // Wrap a page element with applicable layouts
3929
4001
  function wrapWithLayouts(pageElement, pathname, params) {
3930
4002
  const layouts = getApplicableLayouts(pathname);
@@ -3959,7 +4031,7 @@ function createLayoutPageBoundary(route, pageElement, serverHtml) {
3959
4031
  return React.createElement("div", props, pageElement);
3960
4032
  }
3961
4033
  let farmLastRouteState = null;
3962
- ${hasServerTreeLayouts && islandValues && isolatedHydrationEnabled ? `${_chunk474FO3UEcjs.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE}
4034
+ ${hasServerTreeLayouts && islandValues && isolatedHydrationEnabled ? `${_chunkX2M4XN4Vcjs.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE}
3963
4035
  function farmTreeLayoutsOf(pathname) {
3964
4036
  return getApplicableLayouts(pathname).filter(function(layout) {
3965
4037
  return layout.serverTree === true;
@@ -4032,7 +4104,7 @@ async function createMatchedHydrationRoute(matched, pathname, searchParams, serv
4032
4104
  if (!serverProps || serverProps.__farmRoutePropsResolved !== true) return null;
4033
4105
  const props = {
4034
4106
  ...reviveServerPageProps(serverProps),
4035
- searchParams: Promise.resolve(serverProps.search ?? searchParams),
4107
+ searchParams: createFarmSearchParams(serverProps.search ?? searchParams),
4036
4108
  };
4037
4109
  pageElement = React.createElement(Component, props);
4038
4110
  } else if (typeof Component === "function" && Component.constructor && Component.constructor.name === "AsyncFunction") {
@@ -4047,7 +4119,7 @@ async function createMatchedHydrationRoute(matched, pathname, searchParams, serv
4047
4119
  const props = {
4048
4120
  ...reviveServerPageProps(serverProps),
4049
4121
  params: params,
4050
- searchParams: Promise.resolve(searchParams),
4122
+ searchParams: createFarmSearchParams(searchParams),
4051
4123
  };
4052
4124
  pageElement = React.createElement(Component, props);
4053
4125
  }
@@ -4293,16 +4365,7 @@ function resetReactRoot() {
4293
4365
  isHydrated = false;
4294
4366
  }
4295
4367
 
4296
- ${islandValues ? `// Islands mode starts the client while the body streams (an async entry): a page of islands
4297
- // hydrates them as they arrive; anything else waits for the whole document.
4298
- function farmDocumentParsed() {
4299
- if (document.readyState !== "loading") return Promise.resolve();
4300
- return new Promise(function(resolve) {
4301
- document.addEventListener("DOMContentLoaded", function() { resolve(); }, { once: true });
4302
- });
4303
- }
4304
-
4305
- ` : ""}// Hydrate client components
4368
+ ${islandValues ? FARM_DOCUMENT_PARSED_RUNTIME : ""}// Hydrate client components
4306
4369
  async function hydrate() {
4307
4370
  await window.__FARM_PPR_REFRESH_PROMISE__;
4308
4371
  // A PPR refresh that is still retrying must not replace DOM once hydration starts.
@@ -4706,7 +4769,7 @@ ${islandValues ? ` // Islands mode: navigations name the layouts on screen, and
4706
4769
  if (!this.isCurrentNavigation(navigation, clientNavigation)) return;
4707
4770
  const params = matched.params;
4708
4771
  const searchParams = searchParamsToObject(url.searchParams);
4709
- const props = { params: params, searchParams: Promise.resolve(searchParams) };
4772
+ const props = { params: params, searchParams: createFarmSearchParams(searchParams) };
4710
4773
  let pageElement = React.createElement(Component, props);
4711
4774
  if (hasHydratableLayout(pathname)) {
4712
4775
  pageElement = createLayoutPageBoundary(matched.route, pageElement);
@@ -5098,7 +5161,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
5098
5161
  _path2.default.join(postcssConfigDir, "postcss.config.cjs"),
5099
5162
  "module.exports = { plugins: [] };\n"
5100
5163
  );
5101
- tailwindVitePlugin = await _chunkIXSMFKZ2cjs.loadTailwindVitePlugin.call(void 0, {
5164
+ tailwindVitePlugin = await _chunkLNM57D3Hcjs.loadTailwindVitePlugin.call(void 0, {
5102
5165
  builder: productionVite.builder,
5103
5166
  label: "for SSR"
5104
5167
  });
@@ -5194,14 +5257,14 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
5194
5257
  }
5195
5258
  const middlewareRoutes = await discoverMiddlewareRoutes(appDirs);
5196
5259
  const instrumentationPath = _chunkBRWIVOV4cjs.resolveFarmInstrumentationFile.call(void 0, root, config.srcDir || "src");
5197
- const notFoundPath = _chunk474FO3UEcjs.resolveFarmNotFoundComponentPath.call(void 0, config, appDirs);
5198
- if (notFoundPath) _chunkXN2MB4QZcjs.logger.info(`\u{1F4CB} Found custom 404 page: ${notFoundPath}`);
5260
+ const notFoundPath = _chunkX2M4XN4Vcjs.resolveFarmNotFoundComponentPath.call(void 0, config, appDirs);
5261
+ if (notFoundPath) _chunkVQJYGZNXcjs.logger.info(`\u{1F4CB} Found custom 404 page: ${notFoundPath}`);
5199
5262
  layoutRoutes.sort((a, b) => {
5200
5263
  const depthA = a.pattern.split("/").filter(Boolean).length;
5201
5264
  const depthB = b.pattern.split("/").filter(Boolean).length;
5202
5265
  return depthA - depthB;
5203
5266
  });
5204
- _chunkXN2MB4QZcjs.logger.info(
5267
+ _chunkVQJYGZNXcjs.logger.info(
5205
5268
  `\u{1F4CB} Found ${pageRoutes.length} page routes, ${layoutRoutes.length} layouts, ${apiRoutes.length} API routes, ${applicationMetadataRoutes.length} metadata routes, and ${middlewareRoutes.length} middleware files`
5206
5269
  );
5207
5270
  const configuredIntegrationValues = Object.values(config.integrations || {});
@@ -5211,13 +5274,13 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
5211
5274
  const hasServerRuntimeIntegrations = configuredIntegrationValues.some(
5212
5275
  (integration) => typeof integration === "object" && integration !== null && (!("serverRuntime" in integration) || integration.serverRuntime !== false)
5213
5276
  );
5214
- const hasIntegrationProviders = _chunkWAPQWAE6cjs.getIntegrationProviders.call(void 0, config.integrations).some(
5277
+ const hasIntegrationProviders = _chunkCECUDGXQcjs.getIntegrationProviders.call(void 0, config.integrations).some(
5215
5278
  (provider) => provider.component || provider.type === "clerk"
5216
5279
  );
5217
5280
  const hasObservabilityHandler = !!config.observability && typeof config.observability === "object" && "onEvent" in config.observability;
5218
- const hasMdxComponentConfig = Boolean(_optionalChain([config, 'access', _75 => _75.mdx, 'optionalAccess', _76 => _76.components]));
5219
- const hasMiddlewareConfig = _chunkVCKGOXFIcjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
5220
- const hasRouteContextConfig = _chunkLYWAGXXWcjs.hasCustomFarmRouteContext.call(void 0, config);
5281
+ const hasMdxComponentConfig = Boolean(_optionalChain([config, 'access', _87 => _87.mdx, 'optionalAccess', _88 => _88.components]));
5282
+ const hasMiddlewareConfig = _chunk76GHW3WIcjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
5283
+ const hasRouteContextConfig = _chunkVITZRYW3cjs.hasCustomFarmRouteContext.call(void 0, config);
5221
5284
  const hasServerRuntimePlugins = hasFarmServerRuntimePlugins(config);
5222
5285
  const hasPluginRoutes = hasFarmPluginRoutes(config);
5223
5286
  const hasServerCacheConfig = hasFarmServerCacheConfig(config.cache);
@@ -5227,23 +5290,23 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
5227
5290
  const hasConfiguredRuntimePlugins = Boolean(
5228
5291
  hasRuntimeConfigModule && (config.plugins || []).length > 0
5229
5292
  );
5230
- if (_chunk4T25YCZ5cjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
5293
+ if (_chunkJVBNKWLVcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
5231
5294
  const adapterGuardedPaths = new Set(getFarmDocsGuardedPaths(config, middlewareRoutes));
5232
- _chunk4T25YCZ5cjs.assertFarmDocsAdapterServesNoGuardedPages.call(void 0,
5295
+ _chunkJVBNKWLVcjs.assertFarmDocsAdapterServesNoGuardedPages.call(void 0,
5233
5296
  config.docs,
5234
5297
  { root, srcDir: config.srcDir },
5235
5298
  (pathname) => adapterGuardedPaths.has(pathname)
5236
5299
  );
5237
5300
  }
5238
5301
  const farmDocsCspNonceMarker = _chunk6JHZPB52cjs.createFarmCspNonce.call(void 0, config.security);
5239
- const farmDocsPrecompiledManifest = _optionalChain([config, 'access', _77 => _77.docs, 'optionalAccess', _78 => _78.enabled]) && _chunkE552H232cjs.getFarmPresetRuntime.call(void 0, preset) === "edge" ? await _chunkHNAISJFDcjs._runWithFarmCspNonce.call(void 0,
5302
+ const farmDocsPrecompiledManifest = _optionalChain([config, 'access', _89 => _89.docs, 'optionalAccess', _90 => _90.enabled]) && _chunkE552H232cjs.getFarmPresetRuntime.call(void 0, preset) === "edge" ? await _chunkHNAISJFDcjs._runWithFarmCspNonce.call(void 0,
5240
5303
  farmDocsCspNonceMarker,
5241
- async () => _optionalChain([config, 'access', _79 => _79.docs, 'access', _80 => _80.adapter, 'optionalAccess', _81 => _81.server]) ? await _chunk4T25YCZ5cjs.compileFarmDocsAdapterEdgeManifest.call(void 0, config.docs, {
5304
+ async () => _optionalChain([config, 'access', _91 => _91.docs, 'access', _92 => _92.adapter, 'optionalAccess', _93 => _93.server]) ? await _chunkJVBNKWLVcjs.compileFarmDocsAdapterEdgeManifest.call(void 0, config.docs, {
5242
5305
  root,
5243
5306
  srcDir: config.srcDir,
5244
5307
  clientEntry: FARM_CLIENT_JS_SRC_PLACEHOLDER,
5245
5308
  fontStylesheetHref: "/farm-fonts.css",
5246
- globalStylesheetHref: "/assets/globals.css"
5309
+ globalStylesheetHref: FARM_CLIENT_CSS_HREF_PLACEHOLDER
5247
5310
  }) : await (async () => {
5248
5311
  const guardedPaths = new Set(getFarmDocsGuardedPaths(config, middlewareRoutes));
5249
5312
  return compileFarmDocsManifest(config.docs, {
@@ -5252,7 +5315,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
5252
5315
  clientEntry: FARM_CLIENT_JS_SRC_PLACEHOLDER,
5253
5316
  fontAssets: _chunkERMUL73Lcjs.toFarmDocsPublicFontAssets.call(void 0, _chunkERMUL73Lcjs.resolveFarmDocsFontAssets.call(void 0, root)),
5254
5317
  fontStylesheetHref: "/farm-fonts.css",
5255
- globalStylesheetHref: "/assets/globals.css",
5318
+ globalStylesheetHref: FARM_CLIENT_CSS_HREF_PLACEHOLDER,
5256
5319
  isPathGuarded: (pathname) => guardedPaths.has(pathname)
5257
5320
  });
5258
5321
  })()
@@ -5347,7 +5410,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
5347
5410
  // Adapters can render provider scripts by serializing function source.
5348
5411
  // keepNames injects helper calls into those functions; after Nitro
5349
5412
  // minifies the server chunk the helper is no longer in script scope.
5350
- keepNames: !(_optionalChain([config, 'access', _82 => _82.docs, 'optionalAccess', _83 => _83.enabled]) && _optionalChain([config, 'access', _84 => _84.docs, 'access', _85 => _85.adapter, 'optionalAccess', _86 => _86.server])),
5413
+ keepNames: !(_optionalChain([config, 'access', _94 => _94.docs, 'optionalAccess', _95 => _95.enabled]) && _optionalChain([config, 'access', _96 => _96.docs, 'access', _97 => _97.adapter, 'optionalAccess', _98 => _98.server])),
5351
5414
  jsxDev: false
5352
5415
  },
5353
5416
  // SSR configuration to externalize problematic modules
@@ -5397,10 +5460,10 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
5397
5460
  define: {
5398
5461
  __FARM_API_BASE_URL__: JSON.stringify(config.api.baseURL),
5399
5462
  __FARM_ENV__: JSON.stringify(_chunk3EIPOTZVcjs.createBundledEnv.call(void 0, config.env)),
5400
- __FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _87 => _87.env, 'optionalAccess', _88 => _88.public]) || {})
5463
+ __FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _99 => _99.env, 'optionalAccess', _100 => _100.public]) || {})
5401
5464
  },
5402
5465
  plugins: [
5403
- _chunk474FO3UEcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
5466
+ _chunkX2M4XN4Vcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
5404
5467
  ...tailwindVitePlugin ? [tailwindVitePlugin] : [],
5405
5468
  ...rendererVitePlugins,
5406
5469
  ...config.vite.plugins || [],
@@ -5414,7 +5477,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
5414
5477
  { ...createReactProductionModePlugin(), enforce: "pre" },
5415
5478
  farmServerOnlyEntriesPlugin(),
5416
5479
  farmPlugin({ ...config, isolatedClientBoundaryModules }, pluginManager),
5417
- _chunkJ37KTQIAcjs.farmEnvironmentFunctionsPlugin.call(void 0, config),
5480
+ _chunkNK2VWS7Pcjs.farmEnvironmentFunctionsPlugin.call(void 0, config),
5418
5481
  ...hasRuntimeConfigModule ? [
5419
5482
  farmStripPlatformConfigPlugin(
5420
5483
  [
@@ -5461,7 +5524,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
5461
5524
  resolve: {
5462
5525
  alias: [
5463
5526
  ...shouldAliasReactServerToWebBuild(config.renderer, preset) ? [createFarmReactWebServerAlias(hasReactDomEdgeServerBuild(root))] : [],
5464
- ...Object.entries(_chunk474FO3UEcjs.createFarmSourceAlias.call(void 0, root, config.srcDir)).map(
5527
+ ...Object.entries(_chunkX2M4XN4Vcjs.createFarmSourceAlias.call(void 0, root, config.srcDir)).map(
5465
5528
  ([find, replacement]) => ({ find, replacement })
5466
5529
  )
5467
5530
  ],
@@ -5469,12 +5532,12 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
5469
5532
  dedupe: [...config.renderer.dedupe || []]
5470
5533
  }
5471
5534
  };
5472
- await viteBuild(_chunk474FO3UEcjs.mergeFarmProductionViteConfig.call(void 0, serverViteConfig, config.vite));
5535
+ await viteBuild(_chunkX2M4XN4Vcjs.mergeFarmProductionViteConfig.call(void 0, serverViteConfig, config.vite));
5473
5536
  } finally {
5474
5537
  if (postcssConfigDir) {
5475
5538
  try {
5476
5539
  await fs4.rm(postcssConfigDir, { recursive: true, force: true });
5477
- } catch (e27) {
5540
+ } catch (e28) {
5478
5541
  }
5479
5542
  }
5480
5543
  }
@@ -5487,7 +5550,7 @@ async function buildSSRInMemory(productionVite, config, root, routeManager, apiR
5487
5550
  function readFarmAppPackageIdentity(root) {
5488
5551
  try {
5489
5552
  return JSON.parse(_fs.readFileSync.call(void 0, _path2.default.join(root, "package.json"), "utf8"));
5490
- } catch (e28) {
5553
+ } catch (e29) {
5491
5554
  return {};
5492
5555
  }
5493
5556
  }
@@ -5499,39 +5562,62 @@ function readFarmPageLastModified(pageRoutes) {
5499
5562
  lastModified[route.pattern] = _fs.statSync.call(void 0,
5500
5563
  _nullishCoalesce(route.markdownSourcePath, () => ( route.modulePath))
5501
5564
  ).mtime.toISOString();
5502
- } catch (e29) {
5565
+ } catch (e30) {
5503
5566
  }
5504
5567
  }
5505
5568
  return lastModified;
5506
5569
  }
5507
5570
  function getFarmDocsGuardedPaths(config, middlewareRoutes) {
5508
- if (!_optionalChain([config, 'access', _89 => _89.docs, 'optionalAccess', _90 => _90.enabled])) return [];
5509
- const contentDir = _chunkX2EL3BLHcjs.resolveFarmDocsContentDir.call(void 0, config.docs, {
5510
- root: config.root,
5511
- srcDir: config.srcDir
5512
- });
5571
+ if (!_optionalChain([config, 'access', _101 => _101.docs, 'optionalAccess', _102 => _102.enabled])) return [];
5572
+ const options = { root: config.root, srcDir: config.srcDir };
5513
5573
  const guards = {
5514
5574
  config: { middleware: config.middleware, integrations: config.integrations },
5515
5575
  middlewareRoutes
5516
5576
  };
5517
- return _chunkX2EL3BLHcjs.discoverFarmDocsPages.call(void 0, contentDir, config.docs).flatMap((page) => [page.href, _chunkX2EL3BLHcjs.getFarmDocsMarkdownPath.call(void 0, page.href)]).filter((pathname) => _chunkVCKGOXFIcjs.farmPathGuardCoversPage.call(void 0, guards, pathname));
5577
+ return _chunk5N7QAGEAcjs.getFarmDocsRoots.call(void 0, config.docs).flatMap(
5578
+ (docsRoot) => _chunk5N7QAGEAcjs.discoverFarmDocsPages.call(void 0, _chunk5N7QAGEAcjs.resolveFarmDocsContentDir.call(void 0, docsRoot, options), docsRoot)
5579
+ ).flatMap((page) => [page.href, _chunk5N7QAGEAcjs.getFarmDocsMarkdownPath.call(void 0, page.href)]).filter((pathname) => _chunk76GHW3WIcjs.farmPathGuardCoversPage.call(void 0, guards, pathname));
5518
5580
  }
5519
5581
  function getFarmAppOwnedDocsEnginePaths(agent, applicationMetadataRoutes) {
5520
- const llmsTxt = _optionalChain([agent, 'optionalAccess', _91 => _91.llmsTxt]);
5582
+ const llmsTxt = _optionalChain([agent, 'optionalAccess', _103 => _103.llmsTxt]);
5521
5583
  const ownedByFile = (kind) => applicationMetadataRoutes.some(
5522
5584
  (metadata) => metadata.kind === kind && metadata.pattern === "/"
5523
5585
  );
5524
5586
  return [
5525
- ..._optionalChain([llmsTxt, 'optionalAccess', _92 => _92.enabled]) || ownedByFile("llms") ? ["/llms.txt"] : [],
5526
- ..._optionalChain([llmsTxt, 'optionalAccess', _93 => _93.enabled]) && llmsTxt.full || ownedByFile("llms-full") ? ["/llms-full.txt"] : [],
5527
- ..._optionalChain([agent, 'optionalAccess', _94 => _94.sitemap, 'optionalAccess', _95 => _95.enabled]) || ownedByFile("sitemap") ? ["/sitemap.xml"] : [],
5528
- ..._optionalChain([agent, 'optionalAccess', _96 => _96.crawlers, 'optionalAccess', _97 => _97.enabled]) || ownedByFile("robots") ? ["/robots.txt"] : []
5587
+ ..._optionalChain([llmsTxt, 'optionalAccess', _104 => _104.enabled]) || ownedByFile("llms") ? ["/llms.txt"] : [],
5588
+ ..._optionalChain([llmsTxt, 'optionalAccess', _105 => _105.enabled]) && llmsTxt.full || ownedByFile("llms-full") ? ["/llms-full.txt"] : [],
5589
+ ..._optionalChain([agent, 'optionalAccess', _106 => _106.sitemap, 'optionalAccess', _107 => _107.enabled]) || ownedByFile("sitemap") ? ["/sitemap.xml"] : [],
5590
+ ..._optionalChain([agent, 'optionalAccess', _108 => _108.crawlers, 'optionalAccess', _109 => _109.enabled]) || ownedByFile("robots") ? ["/robots.txt"] : []
5529
5591
  ];
5530
5592
  }
5593
+ function generateFarmDocsAdapterHandlerArguments(docs, docsConfigModulePath) {
5594
+ const runtimeConfig = (root) => `{
5595
+ ${docsConfigModulePath ? `...getFarmDocsConfigModuleRoot(farmDocsConfigModule.default || farmDocsConfigModule, ${root}.entry),
5596
+ ...${root}.configOverrides,` : `...${root}.config,`}
5597
+ entry: ${root}.config?.entry || String(${root}.entry || "/docs").replace(/^\\/+|\\/+$/g, "") || "docs",
5598
+ docsPath: ${root}.entry,
5599
+ contentDir: ${root}.contentDir || ${root}.config?.contentDir,
5600
+ }`;
5601
+ if (_optionalChain([docs, 'optionalAccess', _110 => _110.roots, 'optionalAccess', _111 => _111.length])) {
5602
+ return {
5603
+ factory: "createFarmDocsAdapterMultiRuntimeHandler",
5604
+ config: `[farmDocsResolvedConfig, ...farmDocsResolvedConfig.roots].map((farmDocsRoot) => (${runtimeConfig("farmDocsRoot")}))`
5605
+ };
5606
+ }
5607
+ return {
5608
+ factory: "createFarmDocsAdapterRuntimeHandler",
5609
+ config: runtimeConfig("farmDocsResolvedConfig")
5610
+ };
5611
+ }
5531
5612
  function generateFarmDocsRuntimeConfigExpression(docs, precompiled = false) {
5532
5613
  if (!docs.enabled) return "null";
5533
- const baseConfig = {
5614
+ const serializableDocs = _optionalChain([docs, 'access', _112 => _112.roots, 'optionalAccess', _113 => _113.length]) ? {
5534
5615
  ...docs,
5616
+ // React elements and functions do not survive JSON; see runtimeConfig below.
5617
+ roots: docs.roots.map((docsRoot) => ({ ...docsRoot, runtimeConfig: void 0 }))
5618
+ } : docs;
5619
+ const baseConfig = {
5620
+ ...serializableDocs,
5535
5621
  contentDir: void 0,
5536
5622
  ...precompiled ? { configPath: void 0 } : {},
5537
5623
  config: void 0,
@@ -5549,7 +5635,7 @@ function generateFarmDocsRuntimeConfigExpression(docs, precompiled = false) {
5549
5635
  config: nestedConfig
5550
5636
  });
5551
5637
  }
5552
- return `farmDocsBundledContentDir
5638
+ const expression = `farmDocsBundledContentDir
5553
5639
  ? {
5554
5640
  ...${JSON.stringify(baseConfig)},
5555
5641
  contentDir: farmDocsBundledContentDir,
@@ -5558,13 +5644,25 @@ function generateFarmDocsRuntimeConfigExpression(docs, precompiled = false) {
5558
5644
  contentDir: farmDocsBundledContentDir,
5559
5645
  },
5560
5646
  }
5561
- : ${JSON.stringify({ ...docs, runtimeConfig: void 0 })}`;
5647
+ : ${JSON.stringify({ ...serializableDocs, runtimeConfig: void 0 })}`;
5648
+ if (!_optionalChain([docs, 'access', _114 => _114.roots, 'optionalAccess', _115 => _115.length])) return expression;
5649
+ return `((farmDocs) => ({
5650
+ ...farmDocs,
5651
+ roots: farmDocs.roots.map((farmDocsRoot, index) => {
5652
+ const contentDir = farmDocsBundledRootsDir
5653
+ ? farmDocsJoin(farmDocsBundledRootsDir, String(index))
5654
+ : null;
5655
+ return contentDir && farmDocsExistsSync(contentDir)
5656
+ ? { ...farmDocsRoot, contentDir, config: { ...farmDocsRoot.config, contentDir } }
5657
+ : farmDocsRoot;
5658
+ }),
5659
+ }))(${expression})`;
5562
5660
  }
5563
5661
  function toVirtualEntryImportSpecifier(modulePath) {
5564
5662
  return JSON.stringify(modulePath.replace(/\\/g, "/"));
5565
5663
  }
5566
5664
  function generateNativeAuthIntegrationSource(auth) {
5567
- if (_optionalChain([auth, 'optionalAccess', _98 => _98.enabled]) !== true) {
5665
+ if (_optionalChain([auth, 'optionalAccess', _116 => _116.enabled]) !== true) {
5568
5666
  return { importSource: "", registerSource: "" };
5569
5667
  }
5570
5668
  return {
@@ -5850,30 +5948,36 @@ function generateFarmRendererAppSetupServerCode(config) {
5850
5948
  const appSetupPath = _chunkRD623KW4cjs.resolveFarmRendererAppSetup.call(void 0, config.root || process.cwd(), config.renderer);
5851
5949
  if (!appSetupPath) return "";
5852
5950
  return `
5853
- import __farmAppSetup from ${JSON.stringify(_chunkXN2MB4QZcjs.toPosixPath.call(void 0, appSetupPath))};
5951
+ import __farmAppSetup from ${JSON.stringify(_chunkVQJYGZNXcjs.toPosixPath.call(void 0, appSetupPath))};
5854
5952
  if (typeof ReactDOMServer.configureApp !== "function") {
5855
5953
  throw new Error(${JSON.stringify(`Renderer \`${config.renderer.name}\` does not support \`appSetup\`: its server module must export configureApp().`)});
5856
5954
  }
5857
5955
  ReactDOMServer.configureApp(__farmAppSetup);`;
5858
5956
  }
5859
5957
  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) {
5860
- const farmIslandsMode = _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _99 => _99.experimental, 'optionalAccess', _100 => _100.serverComponents])) === "islands";
5958
+ const farmIslandsMode = _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _117 => _117.experimental, 'optionalAccess', _118 => _118.serverComponents])) === "islands";
5861
5959
  const hasCompressionRuntime = config.compress && _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) === "nodejs";
5862
- const servesAgentRobotsTxt = Boolean(_optionalChain([config, 'access', _101 => _101.agent, 'optionalAccess', _102 => _102.crawlers, 'optionalAccess', _103 => _103.enabled])) && !applicationMetadataRoutes.some(
5960
+ const servesAgentRobotsTxt = Boolean(_optionalChain([config, 'access', _119 => _119.agent, 'optionalAccess', _120 => _120.crawlers, 'optionalAccess', _121 => _121.enabled])) && !applicationMetadataRoutes.some(
5863
5961
  (metadata) => metadata.kind === "robots" && metadata.pattern === "/"
5864
5962
  );
5865
- const servesAgentSitemap = Boolean(_optionalChain([config, 'access', _104 => _104.agent, 'optionalAccess', _105 => _105.sitemap, 'optionalAccess', _106 => _106.enabled])) && !applicationMetadataRoutes.some(
5963
+ const servesAgentSitemap = Boolean(_optionalChain([config, 'access', _122 => _122.agent, 'optionalAccess', _123 => _123.sitemap, 'optionalAccess', _124 => _124.enabled])) && !applicationMetadataRoutes.some(
5866
5964
  (metadata) => metadata.kind === "sitemap" && metadata.pattern === "/"
5867
5965
  );
5868
- const servesDefaultMCP = _optionalChain([config, 'access', _107 => _107.agent, 'optionalAccess', _108 => _108.mcp]) === true && !_chunkSBABQKPTcjs.farmConfigMountsMCP.call(void 0, config) && !apiRoutes.some((route) => route.path === "/api/mcp");
5869
- const servesAiCatalog = _optionalChain([config, 'access', _109 => _109.agent, 'optionalAccess', _110 => _110.aiCatalog]) !== false;
5966
+ const servesDefaultMCP = _optionalChain([config, 'access', _125 => _125.agent, 'optionalAccess', _126 => _126.mcp]) === true && !_chunkSBABQKPTcjs.farmConfigMountsMCP.call(void 0, config) && !apiRoutes.some((route) => route.path === "/api/mcp");
5967
+ const servesAiCatalog = _optionalChain([config, 'access', _127 => _127.agent, 'optionalAccess', _128 => _128.aiCatalog]) !== false;
5870
5968
  const hasPluginRuntime = hasRuntimeIntegrationConfig || hasServerRuntimePlugins;
5871
5969
  const hasInfraAnalyticsRuntime = config.analytics !== false && _chunkOCS3PSYRcjs.resolveFarmInstrumentationRuntime.call(void 0, preset) === "nodejs";
5872
5970
  const hasPrecompiledDocs = Boolean(farmDocsPrecompiledManifest);
5873
5971
  const adapterOwnsDocsRuntime = Boolean(
5874
- _chunkRD623KW4cjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _111 => _111.docs, 'optionalAccess', _112 => _112.enabled]) && _optionalChain([config, 'access', _113 => _113.docs, 'access', _114 => _114.adapter, 'optionalAccess', _115 => _115.server]) && config.docs.adapter.react
5972
+ _chunkRD623KW4cjs.isReactRenderer.call(void 0, config.renderer) && _optionalChain([config, 'access', _129 => _129.docs, 'optionalAccess', _130 => _130.enabled]) && _optionalChain([config, 'access', _131 => _131.docs, 'access', _132 => _132.adapter, 'optionalAccess', _133 => _133.server]) && config.docs.adapter.react
5875
5973
  );
5974
+ if (_optionalChain([config, 'access', _134 => _134.docs, 'optionalAccess', _135 => _135.enabled]) && _optionalChain([config, 'access', _136 => _136.docs, 'access', _137 => _137.roots, 'optionalAccess', _138 => _138.length]) && !adapterOwnsDocsRuntime) {
5975
+ throw new Error(
5976
+ "Several docs roots need the docs adapter, which serves the React renderer only; Farm's built-in docs renderer serves a single docs root."
5977
+ );
5978
+ }
5876
5979
  const docsConfigModulePath = adapterOwnsDocsRuntime && !hasPrecompiledDocs && config.docs.configPath && !config.docs.configPath.endsWith(".json") ? config.docs.configPath : void 0;
5980
+ const adapterHandler = generateFarmDocsAdapterHandlerArguments(config.docs, docsConfigModulePath);
5877
5981
  const hasIsolatedClientGraphRuntime = _chunkRD623KW4cjs.isReactRenderer.call(void 0, config.renderer) && isolatedClientBoundaryModules.size > 0;
5878
5982
  const rendererStreamingCapabilities = _chunkRD623KW4cjs.getFarmRendererStreamingCapabilitiesForRuntime.call(void 0,
5879
5983
  config.renderer,
@@ -5916,9 +6020,9 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
5916
6020
  const hasGeneratedMetadataImages = metadataImageRoutes.some(
5917
6021
  (image) => image.sourceType === "module"
5918
6022
  );
5919
- const hasMiddlewareRuntime = middlewareRoutes.length > 0 || _chunkVCKGOXFIcjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
5920
- const farmDocsFontAssets = _optionalChain([config, 'access', _116 => _116.docs, 'optionalAccess', _117 => _117.enabled]) ? _chunkERMUL73Lcjs.toFarmDocsPublicFontAssets.call(void 0, _chunkERMUL73Lcjs.resolveFarmDocsFontAssets.call(void 0, config.root)) : [];
5921
- const integrationProviders = _chunkWAPQWAE6cjs.getIntegrationProviders.call(void 0, config.integrations);
6023
+ const hasMiddlewareRuntime = middlewareRoutes.length > 0 || _chunk76GHW3WIcjs.hasFarmMiddlewareConfig.call(void 0, config.middleware);
6024
+ const farmDocsFontAssets = _optionalChain([config, 'access', _139 => _139.docs, 'optionalAccess', _140 => _140.enabled]) ? _chunkERMUL73Lcjs.toFarmDocsPublicFontAssets.call(void 0, _chunkERMUL73Lcjs.resolveFarmDocsFontAssets.call(void 0, config.root)) : [];
6025
+ const integrationProviders = _chunkCECUDGXQcjs.getIntegrationProviders.call(void 0, config.integrations);
5922
6026
  const renderedIntegrationProviders = integrationProviders.filter(
5923
6027
  (provider) => provider.component || provider.type === "clerk"
5924
6028
  );
@@ -5927,16 +6031,16 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
5927
6031
  `Integration provider components are not supported by the "${config.renderer.name}" renderer.`
5928
6032
  );
5929
6033
  }
5930
- const providerServerModules = _chunk474FO3UEcjs.generateFarmIntegrationProviderServerModules.call(void 0,
6034
+ const providerServerModules = _chunkX2M4XN4Vcjs.generateFarmIntegrationProviderServerModules.call(void 0,
5931
6035
  renderedIntegrationProviders,
5932
6036
  config.root,
5933
6037
  _nullishCoalesce(config.renderer.componentExtensions, () => ( []))
5934
6038
  );
5935
6039
  const resolvedIntegrationProviderFallback = Object.fromEntries(
5936
6040
  Object.entries(config.integrations).flatMap(([name, integration]) => {
5937
- const configuredProviders = _optionalChain([integration, 'optionalAccess', _118 => _118.providers]);
6041
+ const configuredProviders = _optionalChain([integration, 'optionalAccess', _141 => _141.providers]);
5938
6042
  const providers = Array.isArray(configuredProviders) ? configuredProviders : [];
5939
- if (providers.some((provider) => typeof _optionalChain([provider, 'optionalAccess', _119 => _119.component]) === "function")) {
6043
+ if (providers.some((provider) => typeof _optionalChain([provider, 'optionalAccess', _142 => _142.component]) === "function")) {
5940
6044
  throw new Error(
5941
6045
  `Integration provider components in production must use an importable component reference, for example component: { module: "@/components/provider" }.`
5942
6046
  );
@@ -5947,20 +6051,20 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
5947
6051
  const unsupportedIntegrationProvider = renderedIntegrationProviders.find(
5948
6052
  (provider) => provider.supportsIsolatedHydration !== true
5949
6053
  );
5950
- const isolatedHydrationMode = _chunk474FO3UEcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
5951
- _optionalChain([config, 'access', _120 => _120.experimental, 'optionalAccess', _121 => _121.isolatedClientHydration]),
6054
+ const isolatedHydrationMode = _chunkX2M4XN4Vcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
6055
+ _optionalChain([config, 'access', _143 => _143.experimental, 'optionalAccess', _144 => _144.isolatedClientHydration]),
5952
6056
  {
5953
- serverComponents: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _122 => _122.experimental, 'optionalAccess', _123 => _123.serverComponents])) === "rsc",
6057
+ serverComponents: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _145 => _145.experimental, 'optionalAccess', _146 => _146.serverComponents])) === "rsc",
5954
6058
  hasUnsupportedIntegrationProvider: Boolean(unsupportedIntegrationProvider)
5955
6059
  }
5956
6060
  );
5957
- const hydrationPlanOptions = _chunk474FO3UEcjs.getFarmClientHydrationPlanOptions.call(void 0,
6061
+ const hydrationPlanOptions = _chunkX2M4XN4Vcjs.getFarmClientHydrationPlanOptions.call(void 0,
5958
6062
  config.renderer,
5959
6063
  Boolean(unsupportedIntegrationProvider)
5960
6064
  );
5961
6065
  const pageHydrationPlanOptions = {
5962
6066
  ...hydrationPlanOptions,
5963
- serverOwners: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _124 => _124.experimental, 'optionalAccess', _125 => _125.serverComponents])) === "islands"
6067
+ serverOwners: _chunkBPNOYILCcjs.resolveFarmServerComponentsMode.call(void 0, _optionalChain([config, 'access', _147 => _147.experimental, 'optionalAccess', _148 => _148.serverComponents])) === "islands"
5964
6068
  };
5965
6069
  const layoutHydrationPlans = layoutRoutes.map((layout) => ({
5966
6070
  ...layout,
@@ -5972,7 +6076,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
5972
6076
  { ...hydrationPlanOptions, serverTreeLayouts: pageHydrationPlanOptions.serverOwners }
5973
6077
  )
5974
6078
  }));
5975
- const markdownPagePlan = _chunk474FO3UEcjs.createMarkdownPageHydrationPlanner.call(void 0,
6079
+ const markdownPagePlan = _chunkX2M4XN4Vcjs.createMarkdownPageHydrationPlanner.call(void 0,
5976
6080
  _chunk2HW5LWAHcjs.resolveFarmMdxComponentsModulePath.call(void 0, _chunk2HW5LWAHcjs.resolveMdxConfig.call(void 0, config.mdx), config.root),
5977
6081
  config.root,
5978
6082
  isolatedHydrationMode,
@@ -5990,7 +6094,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
5990
6094
  )
5991
6095
  ])
5992
6096
  );
5993
- _chunk474FO3UEcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
6097
+ _chunkX2M4XN4Vcjs.enforceFarmIsolatedHydrationRouteBudget.call(void 0,
5994
6098
  layoutHydrationPlans.map((layout) => ({
5995
6099
  pattern: layout.pattern,
5996
6100
  depth: layout.pattern.split("/").filter(Boolean).length,
@@ -5999,10 +6103,10 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
5999
6103
  pageRoutes.map((route) => ({
6000
6104
  // Compared by directory so a grouped layout applies only inside its group.
6001
6105
  pattern: _nullishCoalesce(route.directory, () => ( route.pattern)),
6002
- depth: _chunkVCKGOXFIcjs.getRouteDirectoryDepth.call(void 0, _nullishCoalesce(route.directory, () => ( route.pattern))),
6106
+ depth: _chunk76GHW3WIcjs.getRouteDirectoryDepth.call(void 0, _nullishCoalesce(route.directory, () => ( route.pattern))),
6003
6107
  metadata: pageHydrationPlans.get(route.modulePath)
6004
6108
  })),
6005
- _chunkVCKGOXFIcjs.routeBoundaryCoversDirectory
6109
+ _chunk76GHW3WIcjs.routeBoundaryCoversDirectory
6006
6110
  );
6007
6111
  const providerServerImports = [
6008
6112
  providerServerModules.hasClerkProvider ? `import { ClerkProvider as FarmClerkProvider } from "@clerk/react";` : "",
@@ -6019,7 +6123,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
6019
6123
  apiRegistrations.push(`
6020
6124
  {
6021
6125
  path: ${JSON.stringify(route.path)},
6022
- methods: ${JSON.stringify(route.methods.filter((method) => !_optionalChain([route, 'access', _126 => _126.pluginMethods, 'optionalAccess', _127 => _127.includes, 'call', _128 => _128(method)])))},
6126
+ methods: ${JSON.stringify(route.methods.filter((method) => !_optionalChain([route, 'access', _149 => _149.pluginMethods, 'optionalAccess', _150 => _150.includes, 'call', _151 => _151(method)])))},
6023
6127
  endpoints: ${varName},
6024
6128
  }`);
6025
6129
  });
@@ -6056,15 +6160,15 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
6056
6160
  `import * as ${varName} from ${toVirtualEntryImportSpecifier(route.modulePath)};`
6057
6161
  );
6058
6162
  const clientMetadata = pageHydrationPlans.get(route.modulePath);
6059
- const renderingDirective = _chunkIUBDMDZZcjs.readRouteRenderingDirectiveFromFile.call(void 0, route.modulePath);
6163
+ const renderingDirective = _chunkUQHIWZZ6cjs.readRouteRenderingDirectiveFromFile.call(void 0, route.modulePath);
6060
6164
  pageRegistrations.push(`
6061
6165
  {
6062
6166
  pattern: ${JSON.stringify(route.pattern)},${route.directory ? `
6063
6167
  directory: ${JSON.stringify(route.directory)},` : ""}
6064
6168
  module: ${varName},
6065
6169
  shouldHydrate: ${JSON.stringify(clientMetadata.shouldHydrate)},${clientMetadata.shouldHydrate ? `
6066
- clientModule: ${JSON.stringify(_chunkXN2MB4QZcjs.toViteModuleId.call(void 0, route.modulePath, config.root))},` : ""}
6067
- islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${_chunk474FO3UEcjs.usesFarmServerTree.call(void 0, clientMetadata) ? "\n serverTree: true," : ""}${renderingDirective ? `
6170
+ clientModule: ${JSON.stringify(_chunkVQJYGZNXcjs.toViteModuleId.call(void 0, route.modulePath, config.root))},` : ""}
6171
+ islandStrategy: ${JSON.stringify(clientMetadata.islandStrategy)},${_chunkX2M4XN4Vcjs.usesFarmServerTree.call(void 0, clientMetadata) ? "\n serverTree: true," : ""}${renderingDirective ? `
6068
6172
  rendering: ${JSON.stringify(renderingDirective)},` : ""}
6069
6173
  ${route.source !== void 0 ? `markdownSource: {
6070
6174
  source: ${JSON.stringify(route.source)},
@@ -6074,7 +6178,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
6074
6178
  });
6075
6179
  const layoutImports = [];
6076
6180
  const layoutRegistrations = [];
6077
- const treeLayoutPatterns = farmIslandsMode ? _chunkVCKGOXFIcjs.getFarmServerTreeLayoutPatterns.call(void 0,
6181
+ const treeLayoutPatterns = farmIslandsMode ? _chunk76GHW3WIcjs.getFarmServerTreeLayoutPatterns.call(void 0,
6078
6182
  layoutHydrationPlans.map((layout) => ({
6079
6183
  pattern: layout.pattern,
6080
6184
  shouldHydrate: layout.hydration.shouldHydrate,
@@ -6128,12 +6232,12 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
6128
6232
  errorImports.push(
6129
6233
  `import * as ${varName} from ${toVirtualEntryImportSpecifier(errorRoute.modulePath)};`
6130
6234
  );
6131
- const groupScope = _chunkVCKGOXFIcjs.getRouteGroupScope.call(void 0, errorRoute.pattern);
6235
+ const groupScope = _chunk76GHW3WIcjs.getRouteGroupScope.call(void 0, errorRoute.pattern);
6132
6236
  errorRegistrations.push(`
6133
6237
  {
6134
- pattern: ${JSON.stringify(_chunkVCKGOXFIcjs.stripRouteGroups.call(void 0, errorRoute.pattern))},${groupScope ? `
6238
+ pattern: ${JSON.stringify(_chunk76GHW3WIcjs.stripRouteGroups.call(void 0, errorRoute.pattern))},${groupScope ? `
6135
6239
  groupScope: ${JSON.stringify(groupScope)},
6136
- directoryDepth: ${_chunkVCKGOXFIcjs.getRouteDirectoryDepth.call(void 0, errorRoute.pattern)},` : ""}
6240
+ directoryDepth: ${_chunk76GHW3WIcjs.getRouteDirectoryDepth.call(void 0, errorRoute.pattern)},` : ""}
6137
6241
  module: ${varName},
6138
6242
  }`);
6139
6243
  });
@@ -6270,7 +6374,9 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
6270
6374
  resolveFarmInstrumentationRuntime,
6271
6375
  resolveFarmPreviewDeployment,
6272
6376
  resolveFarmWebRequestOrigin,
6377
+ fetchFarmExternalRewrite,
6273
6378
  runWithFarmRequestSpan,
6379
+ createFarmSearchParams,
6274
6380
  searchParamsToObject,
6275
6381
  setFarmBasePath,
6276
6382
  setFarmTrailingSlashPreference,
@@ -6283,7 +6389,7 @@ function renderFarmServerTreeLayout(Layout, props, outlets) {
6283
6389
  import { getSharedLayoutPrefixLength, handleFarmFormActionRequest, ignoreFarmHeldValues, installFarmIslandValues, parseFarmLayoutChainHeader } from "@farm.js/core/internal/production-runtime";
6284
6390
  import { installFarmIslandsServer } from "@farm.js/core/internal/islands-server";
6285
6391
  installFarmIslandsServer();
6286
- const farmFormActionsConfig = ${JSON.stringify(_chunk6QA2SXVHcjs.resolveServerActionsConfig.call(void 0, config.serverActions))};
6392
+ const farmFormActionsConfig = ${JSON.stringify(_chunkFK25QSVCcjs.resolveServerActionsConfig.call(void 0, config.serverActions))};
6287
6393
  installFarmIslandValues();
6288
6394
  ${islandsActionKeyCode()}
6289
6395
  ${FARM_SEGMENT_NAVIGATION_SERVER_RUNTIME}` : ""}`;
@@ -6293,25 +6399,25 @@ ${FARM_SEGMENT_NAVIGATION_SERVER_RUNTIME}` : ""}`;
6293
6399
  const infraAnalyticsImport = hasInfraAnalyticsRuntime ? `import { ${hasPluginRuntime ? "createFarmInfraAnalyticsPlugin" : "createFarmInfraAnalyticsRecorder"} } from "@farm.js/core/internal/infra-analytics-runtime";` : "";
6294
6400
  const compressionRuntimeImport = hasCompressionRuntime ? `import { compressFarmResponse${hasPluginRuntime ? ", createCompressionPlugin" : ""} } from "@farm.js/core/internal/compression-runtime";` : "";
6295
6401
  const i18nServerImport = config.i18n.enabled ? `import { _runWithFarmI18nRequest, _setDefaultFarmI18nRuntime, createFarmI18nRuntime, getFarmI18nClientSnapshot } from "@farm.js/core/i18n/server";` : "";
6296
- const docsHandlerImport = _optionalChain([config, 'access', _129 => _129.docs, 'optionalAccess', _130 => _130.enabled]) ? hasPrecompiledDocs ? `import { createFarmDocsPrecompiledRuntime } from "@farm.js/core/internal/docs-precompiled-runtime";
6402
+ const docsHandlerImport = _optionalChain([config, 'access', _152 => _152.docs, 'optionalAccess', _153 => _153.enabled]) ? hasPrecompiledDocs ? `import { createFarmDocsPrecompiledRuntime } from "@farm.js/core/internal/docs-precompiled-runtime";
6297
6403
  const isFarmDocsAPIRequest = (requestOrPathname) => {
6298
6404
  const pathname = typeof requestOrPathname === "string"
6299
6405
  ? requestOrPathname
6300
6406
  : new URL(requestOrPathname.url).pathname;
6301
- const apiPath = ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _131 => _131.apiPath]) || "/api/docs")};
6407
+ const apiPath = ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _154 => _154.apiPath]) || "/api/docs")};
6302
6408
  return pathname === apiPath || pathname.startsWith(apiPath + "/");
6303
- };` : adapterOwnsDocsRuntime ? `import { isFarmDocsAPIRequest } from "@farm.js/core/docs";
6304
- import { createFarmDocsRuntimeHandler as createFarmDocsAdapterRuntimeHandler } from ${JSON.stringify(config.docs.adapter.server)};
6409
+ };` : adapterOwnsDocsRuntime ? `import { ${docsConfigModulePath ? "getFarmDocsConfigModuleRoot, " : ""}isFarmDocsAPIRequest } from "@farm.js/core/docs";
6410
+ import { ${_optionalChain([config, 'access', _155 => _155.docs, 'access', _156 => _156.roots, 'optionalAccess', _157 => _157.length]) ? "createFarmDocsMultiRuntimeHandler as createFarmDocsAdapterMultiRuntimeHandler" : "createFarmDocsRuntimeHandler as createFarmDocsAdapterRuntimeHandler"} } from ${JSON.stringify(config.docs.adapter.server)};
6305
6411
  import * as FarmDocsAdapterReact from ${JSON.stringify(config.docs.adapter.react)};${docsConfigModulePath ? `
6306
6412
  import * as farmDocsConfigModule from ${toVirtualEntryImportSpecifier(docsConfigModulePath)};` : ""}` : `import { createFarmDocsAPIHandler, createFarmDocsHandler, isFarmDocsAPIRequest } from "@farm.js/core/docs";` : "";
6307
- const docsFontImport = _optionalChain([config, 'access', _132 => _132.docs, 'optionalAccess', _133 => _133.enabled]) && !hasPrecompiledDocs ? `import { resolveFarmLayoutFonts } from "@farm.js/core/font";` : "";
6308
- const docsRuntimeImport = _optionalChain([config, 'access', _134 => _134.docs, 'optionalAccess', _135 => _135.enabled]) && !hasPrecompiledDocs ? `import { existsSync as farmDocsExistsSync } from "node:fs";
6413
+ const docsFontImport = _optionalChain([config, 'access', _158 => _158.docs, 'optionalAccess', _159 => _159.enabled]) && !hasPrecompiledDocs ? `import { resolveFarmLayoutFonts } from "@farm.js/core/font";` : "";
6414
+ const docsRuntimeImport = _optionalChain([config, 'access', _160 => _160.docs, 'optionalAccess', _161 => _161.enabled]) && !hasPrecompiledDocs ? `import { existsSync as farmDocsExistsSync } from "node:fs";
6309
6415
  import { dirname as farmDocsDirname, join as farmDocsJoin } from "node:path";
6310
6416
  import { fileURLToPath as farmDocsFileURLToPath } from "node:url";` : "";
6311
- const markdownHandlerImport = _optionalChain([config, 'access', _136 => _136.md, 'optionalAccess', _137 => _137.enabled]) ? `import { applyMarkdownNegotiationHeaders, createMarkdownMirrorResponse, getFarmMarkdownAlternatePath } from "@farm.js/core/markdown";` : "";
6417
+ const markdownHandlerImport = _optionalChain([config, 'access', _162 => _162.md, 'optionalAccess', _163 => _163.enabled]) ? `import { applyMarkdownNegotiationHeaders, createMarkdownMirrorResponse, getFarmMarkdownAlternatePath } from "@farm.js/core/markdown";` : "";
6312
6418
  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;";
6313
6419
  const markdownErrorImport = `import { FARM_MARKDOWN_CONTENT_TYPE, FARM_MARKDOWN_PAGE_CHECK_HEADER, _isFarmMarkdownPageCheck, createFarmMarkdownErrorBody, farmRequestWantsMarkdown } from "@farm.js/core/markdown";`;
6314
- const mdxComponentsPath = typeof _optionalChain([config, 'access', _138 => _138.mdx, 'optionalAccess', _139 => _139.components]) === "string" ? _path2.default.isAbsolute(config.mdx.components) ? config.mdx.components : _path2.default.join(config.root, config.mdx.components) : null;
6420
+ const mdxComponentsPath = typeof _optionalChain([config, 'access', _164 => _164.mdx, 'optionalAccess', _165 => _165.components]) === "string" ? _path2.default.isAbsolute(config.mdx.components) ? config.mdx.components : _path2.default.join(config.root, config.mdx.components) : null;
6315
6421
  const mdxComponentsImport = mdxComponentsPath ? `import * as FarmMdxComponentsModule from ${toVirtualEntryImportSpecifier(mdxComponentsPath)};` : "";
6316
6422
  const layerConfigPaths = (config.layers || []).map((layer) => layer.configFile).filter((configFile) => Boolean(configFile)).filter((configFile) => configFile !== configModulePath);
6317
6423
  const layerConfigImports = layerConfigPaths.map(
@@ -6337,7 +6443,7 @@ ${integrationRuntimeImport}
6337
6443
  ${nativeAuth.importSource}
6338
6444
  ${nativeMCP.importSource}
6339
6445
  `;
6340
- const imageRuntime = _chunk474FO3UEcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
6446
+ const imageRuntime = _chunkX2M4XN4Vcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
6341
6447
  const imageRuntimeImport = imageRuntime === "none" ? "" : `import { _withFarmImageSourceClientAddress, createCloudflareImageTransformer, createFarmImageHandler } from "@farm.js/core/image/server";`;
6342
6448
  const imageNodeRuntimeImport = imageRuntime === "node" ? `import { createNodeImageFetcher, createNodeImageUrlValidator, createSharpImageTransformer } from "@farm.js/core/image/sharp";` : "";
6343
6449
  const apiHandlerCode = apiRoutes.length > 0 ? `
@@ -6516,7 +6622,7 @@ const farmResolvedRuntimeConfig = Object.assign({}, ...farmRuntimeConfigs);
6516
6622
 
6517
6623
  function FarmDefault404Page() {
6518
6624
  return React.createElement(React.Fragment, null,
6519
- React.createElement("style", null, ${JSON.stringify(_chunk474FO3UEcjs.DEFAULT_NOT_FOUND_STYLES)}),
6625
+ React.createElement("style", null, ${JSON.stringify(_chunkX2M4XN4Vcjs.DEFAULT_NOT_FOUND_STYLES)}),
6520
6626
  React.createElement("main", {
6521
6627
  className: "farm-default-not-found",
6522
6628
  "aria-labelledby": "farm-default-not-found-title",
@@ -6649,14 +6755,14 @@ const farmImageHandler = ${imageRuntime === "none" ? "null" : imageRuntime === "
6649
6755
  onError(error) { console.error("[Farm Image]", error); },
6650
6756
  })`};
6651
6757
  const farmMarkdownConfig = ${JSON.stringify(config.md)};
6652
- const farmLlmsTxtConfig = ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _140 => _140.agent, 'optionalAccess', _141 => _141.llmsTxt]), () => ( { enabled: false, include: [], exclude: [] })))};
6653
- ${_optionalChain([config, 'access', _142 => _142.agent, 'optionalAccess', _143 => _143.llmsTxt, 'optionalAccess', _144 => _144.enabled]) ? "const farmLlmsFullRenderer = createFarmLlmsFullRenderer({ revalidate: farmLlmsTxtConfig.revalidate });\n" : ""}${servesAgentRobotsTxt ? `const farmAgentCrawlers = ${JSON.stringify(config.agent.crawlers)};` : ""}
6758
+ const farmLlmsTxtConfig = ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _166 => _166.agent, 'optionalAccess', _167 => _167.llmsTxt]), () => ( { enabled: false, include: [], exclude: [] })))};
6759
+ ${_optionalChain([config, 'access', _168 => _168.agent, 'optionalAccess', _169 => _169.llmsTxt, 'optionalAccess', _170 => _170.enabled]) ? "const farmLlmsFullRenderer = createFarmLlmsFullRenderer({ revalidate: farmLlmsTxtConfig.revalidate });\n" : ""}${servesAgentRobotsTxt ? `const farmAgentCrawlers = ${JSON.stringify(config.agent.crawlers)};` : ""}
6654
6760
  const farmMdxConfig = ${JSON.stringify({
6655
6761
  ...config.mdx,
6656
- components: typeof _optionalChain([config, 'access', _145 => _145.mdx, 'optionalAccess', _146 => _146.components]) === "string" ? config.mdx.components : void 0
6762
+ components: typeof _optionalChain([config, 'access', _171 => _171.mdx, 'optionalAccess', _172 => _172.components]) === "string" ? config.mdx.components : void 0
6657
6763
  })};
6658
6764
  const configuredFarmMdxComponents = farmUserConfig?.mdx?.components;
6659
- ${_optionalChain([config, 'access', _147 => _147.agent, 'optionalAccess', _148 => _148.noindexPreviews]) ? `// agent.noindexPreviews: the runtime environment decides, falling back to the
6765
+ ${_optionalChain([config, 'access', _173 => _173.agent, 'optionalAccess', _174 => _174.noindexPreviews]) ? `// agent.noindexPreviews: the runtime environment decides, falling back to the
6660
6766
  // environment this was built in, since Netlify exposes its deploy context only
6661
6767
  // to the build.
6662
6768
  const farmNoindexPreview = resolveFarmPreviewDeployment(
@@ -6707,7 +6813,7 @@ export const farmProductionLifecycle = createFarmProductionLifecycle({
6707
6813
  });
6708
6814
  const farmI18nRuntime = ${config.i18n.enabled ? `createFarmI18nRuntime(farmI18nConfig, ${JSON.stringify(i18nCatalogs)})` : "null"};
6709
6815
  ${config.i18n.enabled ? "_setDefaultFarmI18nRuntime(farmI18nRuntime);" : ""}
6710
- const farmDocsBundledContentDir = ${_optionalChain([config, 'access', _149 => _149.docs, 'optionalAccess', _150 => _150.enabled]) && !hasPrecompiledDocs ? `(() => {
6816
+ const farmDocsBundledContentDir = ${_optionalChain([config, 'access', _175 => _175.docs, 'optionalAccess', _176 => _176.enabled]) && !hasPrecompiledDocs ? `(() => {
6711
6817
  try {
6712
6818
  const currentDir = farmDocsDirname(farmDocsFileURLToPath(import.meta.url));
6713
6819
  const candidates = [
@@ -6719,7 +6825,20 @@ const farmDocsBundledContentDir = ${_optionalChain([config, 'access', _149 => _1
6719
6825
  } catch {
6720
6826
  return null;
6721
6827
  }
6722
- })()` : "null"};
6828
+ })()` : "null"};${_optionalChain([config, 'access', _177 => _177.docs, 'optionalAccess', _178 => _178.enabled]) && !hasPrecompiledDocs && _optionalChain([config, 'access', _179 => _179.docs, 'access', _180 => _180.roots, 'optionalAccess', _181 => _181.length]) ? `
6829
+ const farmDocsBundledRootsDir = (() => {
6830
+ try {
6831
+ const currentDir = farmDocsDirname(farmDocsFileURLToPath(import.meta.url));
6832
+ const candidates = [
6833
+ farmDocsJoin(currentDir, "farm-docs-roots"),
6834
+ farmDocsJoin(currentDir, "..", "farm-docs-roots"),
6835
+ farmDocsJoin(currentDir, "..", "..", "farm-docs-roots"),
6836
+ ];
6837
+ return candidates.find((candidate) => farmDocsExistsSync(candidate)) || null;
6838
+ } catch {
6839
+ return null;
6840
+ }
6841
+ })();` : ""}
6723
6842
  const farmDocsResolvedConfig = ${generateFarmDocsRuntimeConfigExpression(config.docs, hasPrecompiledDocs)};
6724
6843
  const farmDocsRuntimeRoot = ${hasPrecompiledDocs ? '"."' : `farmDocsBundledContentDir || ${JSON.stringify(config.root)}`};
6725
6844
  // Docs pages a path-specific guard covers, decided at build time. The docs API and the
@@ -6757,12 +6876,7 @@ const farmDocsModulePreloadPaths = farmDocsModulePreloads
6757
6876
  ),
6758
6877
  }
6759
6878
  : undefined;
6760
- const farmDocsHandler = ${_optionalChain([config, 'access', _151 => _151.docs, 'optionalAccess', _152 => _152.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleDocsRequest" : adapterOwnsDocsRuntime ? `createFarmDocsAdapterRuntimeHandler({
6761
- ${docsConfigModulePath ? "...(farmDocsConfigModule.default || farmDocsConfigModule),\n ...farmDocsResolvedConfig.configOverrides," : "...farmDocsResolvedConfig.config,"}
6762
- entry: farmDocsResolvedConfig.config?.entry || String(farmDocsResolvedConfig.entry || "/docs").replace(/^\\/+|\\/+$/g, "") || "docs",
6763
- docsPath: farmDocsResolvedConfig.entry,
6764
- contentDir: farmDocsResolvedConfig.contentDir || farmDocsResolvedConfig.config?.contentDir,
6765
- }, {
6879
+ const farmDocsHandler = ${_optionalChain([config, 'access', _182 => _182.docs, 'optionalAccess', _183 => _183.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleDocsRequest" : adapterOwnsDocsRuntime ? `${adapterHandler.factory}(${adapterHandler.config}, {
6766
6880
  rootDir: farmDocsRuntimeRoot,
6767
6881
  // A production build's content cannot change, so the adapter reads its
6768
6882
  // navigation once instead of scanning the content directory per request.
@@ -6791,10 +6905,11 @@ const farmDocsHandler = ${_optionalChain([config, 'access', _151 => _151.docs, '
6791
6905
  getApplicableLayouts(getFarmRoutePathname(pathname)).map((layout) => layout.module),
6792
6906
  ),
6793
6907
  fontStylesheetHref: "/farm-fonts.css",
6794
- globalStylesheetHref: "/assets/globals.css",
6908
+ // The client stylesheet carries globals.css under a content-hashed name.
6909
+ globalStylesheetHref: ${JSON.stringify(FARM_CLIENT_CSS_HREF_PLACEHOLDER)},
6795
6910
  isPathGuarded: isFarmDocsPathGuarded,
6796
6911
  })` : "null"};
6797
- const farmDocsAPIHandler = ${_optionalChain([config, 'access', _153 => _153.docs, 'optionalAccess', _154 => _154.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleAPIRequest" : adapterOwnsDocsRuntime ? "null" : `createFarmDocsAPIHandler({ rootDir: farmDocsRuntimeRoot, srcDir: ${JSON.stringify(config.srcDir)}, docs: farmDocsResolvedConfig, isPathGuarded: isFarmDocsPathGuarded })` : "null"};
6912
+ const farmDocsAPIHandler = ${_optionalChain([config, 'access', _184 => _184.docs, 'optionalAccess', _185 => _185.enabled]) ? hasPrecompiledDocs ? "farmDocsPrecompiledRuntime.handleAPIRequest" : adapterOwnsDocsRuntime ? "null" : `createFarmDocsAPIHandler({ rootDir: farmDocsRuntimeRoot, srcDir: ${JSON.stringify(config.srcDir)}, docs: farmDocsResolvedConfig, isPathGuarded: isFarmDocsPathGuarded })` : "null"};
6798
6913
 
6799
6914
  // API routes bundled at build time
6800
6915
  const apiRoutes = ${apiRoutes.length > 0 ? "mergePluginAPIRoutes(" : ""}[${apiRegistrations.join(",")}
@@ -6819,12 +6934,12 @@ function fetchFarmInnerRequest(request, context) {
6819
6934
  }
6820
6935
  const farmLocalAPIBasePath = ${JSON.stringify(_chunkB5BBTPJQcjs.resolveFarmAPIServerBasePath.call(void 0, config.api))};
6821
6936
  const farmOpenAPIReference = ${JSON.stringify(openAPIReference)};
6822
- ${_optionalChain([config, 'access', _155 => _155.agent, 'optionalAccess', _156 => _156.apiCatalog]) ? `const farmApiCatalogInput = ${JSON.stringify(_chunkGOOK2J2Wcjs.resolveFarmApiCatalogInput.call(void 0, config))};
6823
- ` : ""}${_optionalChain([config, 'access', _157 => _157.agent, 'optionalAccess', _158 => _158.manifest]) !== false ? `const farmAppManifestInput = ${JSON.stringify(
6824
- _chunkGOOK2J2Wcjs.resolveFarmAppManifestInput.call(void 0, config, {
6937
+ ${_optionalChain([config, 'access', _186 => _186.agent, 'optionalAccess', _187 => _187.apiCatalog]) ? `const farmApiCatalogInput = ${JSON.stringify(_chunkRMPNYUGTcjs.resolveFarmApiCatalogInput.call(void 0, config))};
6938
+ ` : ""}${_optionalChain([config, 'access', _188 => _188.agent, 'optionalAccess', _189 => _189.manifest]) !== false ? `const farmAppManifestInput = ${JSON.stringify(
6939
+ _chunkRMPNYUGTcjs.resolveFarmAppManifestInput.call(void 0, config, {
6825
6940
  build: config.deploymentId,
6826
- packages: _chunk474FO3UEcjs.resolveFarmAppPackages.call(void 0, config.root),
6827
- webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ? _chunk474FO3UEcjs.collectFarmWebMCPTools.call(void 0, config.root, config.srcDir) : []
6941
+ packages: _chunkX2M4XN4Vcjs.resolveFarmAppPackages.call(void 0, config.root),
6942
+ webmcpTools: config.plugins.some(({ name }) => name === "farm:webmcp") ? _chunkX2M4XN4Vcjs.collectFarmWebMCPTools.call(void 0, config.root, config.srcDir) : []
6828
6943
  })
6829
6944
  )};
6830
6945
  ${servesDefaultMCP ? "farmAppManifestInput.defaultMCP = getFarmDefaultMCPServer;\n" : ""}// A guard written for an MCP server's path keeps its tools out of the public view.
@@ -7412,7 +7527,7 @@ function peelFarmDocumentPrefix(markup) {
7412
7527
  let inner = markup.replace(/^\\s+/, "");
7413
7528
  let hoisted = "";
7414
7529
  const wrapper = /^<div\\b[^>]*style=["']display\\s*:\\s*contents;?\\s*["'][^>]*>/i;
7415
- const hoistable = /${_chunkVCKGOXFIcjs.HOISTED_HEAD_ELEMENT.source}/i;
7530
+ const hoistable = /${_chunk76GHW3WIcjs.HOISTED_HEAD_ELEMENT.source}/i;
7416
7531
  let match;
7417
7532
  while ((match = wrapper.exec(inner) || hoistable.exec(inner))) {
7418
7533
  if (!/^<div/i.test(match[0])) hoisted += match[0];
@@ -7856,7 +7971,7 @@ async function handleMetadataImageRequest(request, routePathname) {
7856
7971
  const searchParams = searchParamsToObject(url.searchParams);
7857
7972
  const props = {
7858
7973
  params: match.params,
7859
- searchParams: Promise.resolve(searchParams),
7974
+ searchParams: createFarmSearchParams(searchParams),
7860
7975
  path: match.pagePath,
7861
7976
  };
7862
7977
  const value = typeof imageModule.default === "function"
@@ -7943,7 +8058,7 @@ function createFarmAgentRobotsResponse(request) {
7943
8058
  // a route guard.
7944
8059
  const farmAgentGuardedPages = new Set(${JSON.stringify(
7945
8060
  pageRoutes.map((route) => route.pattern).filter(
7946
- (pattern) => !pattern.includes("[") && _chunkVCKGOXFIcjs.farmPathGuardCoversPage.call(void 0,
8061
+ (pattern) => !pattern.includes("[") && _chunk76GHW3WIcjs.farmPathGuardCoversPage.call(void 0,
7947
8062
  {
7948
8063
  config: { middleware: config.middleware, integrations: config.integrations },
7949
8064
  middlewareRoutes
@@ -7990,7 +8105,7 @@ ${servesDefaultMCP ? `// agent.mcp: the default read-only MCP server at /mcp, as
7990
8105
  // aside for a page route that answers /mcp and for any MCP server published or
7991
8106
  // registered at runtime, such as the docs engine's.
7992
8107
  const farmDefaultMCPServer = ${JSON.stringify(
7993
- _chunkSBABQKPTcjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root), _chunkRHOR2J6Vcjs.FARM_VERSION)
8108
+ _chunkSBABQKPTcjs.createFarmDefaultMCPServer.call(void 0, readFarmAppPackageIdentity(config.root), _chunkAGR7VJH2cjs.FARM_VERSION)
7994
8109
  )};
7995
8110
  let farmDefaultMCPRouteFree;
7996
8111
  function getFarmDefaultMCPServer() {
@@ -8290,7 +8405,7 @@ function hasLocalRequestRoute(request, routePathname) {
8290
8405
  if (${imageRuntime === "none" ? "false" : `pathname === ${JSON.stringify(config.images.path)}`}) {
8291
8406
  return true;
8292
8407
  }
8293
- ${_optionalChain([config, 'access', _159 => _159.docs, 'optionalAccess', _160 => _160.enabled]) ? `const docsPath = normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs");
8408
+ ${_optionalChain([config, 'access', _190 => _190.docs, 'optionalAccess', _191 => _191.enabled]) ? `const docsPath = normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs");
8294
8409
  if (
8295
8410
  isFarmDocsAPIRequest(pathname) ||
8296
8411
  docsPath === "/" ||
@@ -8316,7 +8431,7 @@ function getFarmPluginRequestOptions(request) {
8316
8431
  route: { ...route, pattern: normalizeRuntimePath(farmOpenAPIReference.route) },
8317
8432
  };
8318
8433
  }
8319
- const isDocsAPIRequest = ${_optionalChain([config, 'access', _161 => _161.docs, 'optionalAccess', _162 => _162.enabled]) ? "isFarmDocsAPIRequest(pathname)" : "false"};
8434
+ const isDocsAPIRequest = ${_optionalChain([config, 'access', _192 => _192.docs, 'optionalAccess', _193 => _193.enabled]) ? "isFarmDocsAPIRequest(pathname)" : "false"};
8320
8435
  const integrationMatch = ${hasServerRuntimeIntegrations ? `matchIntegrationRoute(serverRuntimeIntegrations, {
8321
8436
  pathname,
8322
8437
  method: request.method,
@@ -8400,7 +8515,7 @@ ${hasInfraAnalyticsRuntime ? `
8400
8515
  // endpoints, Markdown mirrors, and docs pages have no app route pattern, so they are
8401
8516
  // labeled here; route.pattern keeps meaning the matched app route for plugins.
8402
8517
  const farmBuiltInRoutePaths = new Set(${JSON.stringify(
8403
- _chunkGOOK2J2Wcjs.listFarmBuiltInRoutePaths.call(void 0, {
8518
+ _chunkRMPNYUGTcjs.listFarmBuiltInRoutePaths.call(void 0, {
8404
8519
  agent: {
8405
8520
  ...config.agent,
8406
8521
  aiCatalog: servesAiCatalog,
@@ -8411,9 +8526,9 @@ const farmBuiltInRoutePaths = new Set(${JSON.stringify(
8411
8526
  openapi: openAPIReference
8412
8527
  })
8413
8528
  )});
8414
- ${_optionalChain([config, 'access', _163 => _163.docs, 'optionalAccess', _164 => _164.enabled]) ? `const farmDocsRouteLabelInput = {
8529
+ ${_optionalChain([config, 'access', _194 => _194.docs, 'optionalAccess', _195 => _195.enabled]) ? `const farmDocsRouteLabelInput = {
8415
8530
  path: normalizeRuntimePath(farmDocsResolvedConfig?.entry || "/docs"),
8416
- apiPath: ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _165 => _165.apiPath]) || "/api/docs")},
8531
+ apiPath: ${JSON.stringify(_optionalChain([farmDocsPrecompiledManifest, 'optionalAccess', _196 => _196.apiPath]) || "/api/docs")},${_optionalChain([config, 'access', _197 => _197.docs, 'access', _198 => _198.roots, 'optionalAccess', _199 => _199.length]) ? "\n roots: farmDocsResolvedConfig.roots.map((farmDocsRoot) => farmDocsRoot.entry)," : ""}
8417
8532
  };
8418
8533
  ` : ""}// The request's route payload, for a handler that learns what answered while it handles.
8419
8534
  const farmRouteLabelSlot = Symbol("farm.route.label.slot");
@@ -8428,11 +8543,11 @@ function labelFarmRequestOptions(options) {
8428
8543
  setFarmRouteLabel(options.route, mcpLabel);
8429
8544
  return options;
8430
8545
  }
8431
- ${_optionalChain([config, 'access', _166 => _166.docs, 'optionalAccess', _167 => _167.enabled]) ? `if (options.kind === "docs") {
8546
+ ${_optionalChain([config, 'access', _200 => _200.docs, 'optionalAccess', _201 => _201.enabled]) ? `if (options.kind === "docs") {
8432
8547
  setFarmRouteLabel(options.route, resolveFarmDocsRouteLabel(routePathname, farmDocsRouteLabelInput));
8433
8548
  return options;
8434
8549
  }` : ""}
8435
- ${_optionalChain([config, 'access', _168 => _168.md, 'optionalAccess', _169 => _169.enabled]) || hasMarkdownPages ? `const markdownLabel = resolveFarmMarkdownRouteLabel(
8550
+ ${_optionalChain([config, 'access', _202 => _202.md, 'optionalAccess', _203 => _203.enabled]) || hasMarkdownPages ? `const markdownLabel = resolveFarmMarkdownRouteLabel(
8436
8551
  routePathname,
8437
8552
  (page) => matchPageRoute(page)?.route.pattern,
8438
8553
  );
@@ -8467,7 +8582,7 @@ function getApplicableLayouts(pathname, directory) {
8467
8582
  return applicable;
8468
8583
  }
8469
8584
 
8470
- ${_optionalChain([config, 'access', _170 => _170.docs, 'optionalAccess', _171 => _171.enabled]) ? `async function wrapFarmDocsResponseWithLayouts(request, response) {
8585
+ ${_optionalChain([config, 'access', _204 => _204.docs, 'optionalAccess', _205 => _205.enabled]) ? `async function wrapFarmDocsResponseWithLayouts(request, response) {
8471
8586
  if (request.method === "HEAD") return response;
8472
8587
  if (response.headers.get("x-farm-docs-adapter")) return response;
8473
8588
 
@@ -8575,7 +8690,7 @@ ${_optionalChain([config, 'access', _170 => _170.docs, 'optionalAccess', _171 =>
8575
8690
 
8576
8691
  // Shells keep their own LRU so query-string variants never evict app cache entries.
8577
8692
  const pprShellCache = getFarmDataCache().pprShellCache;
8578
- const experimentalPPREnabled = ${JSON.stringify(_optionalChain([config, 'access', _172 => _172.experimental, 'optionalAccess', _173 => _173.ppr]) === true)};
8693
+ const experimentalPPREnabled = ${JSON.stringify(_optionalChain([config, 'access', _206 => _206.experimental, 'optionalAccess', _207 => _207.ppr]) === true)};
8579
8694
 
8580
8695
  function resolveRouteRenderingView(route) {
8581
8696
  // The same merge development uses: baked directive config under the
@@ -8707,7 +8822,7 @@ async function handleFarmRequest(request, adapterContext) {
8707
8822
  },
8708
8823
  { redirect: !isFarmLocalAPIPathname(requestUrl.pathname) }
8709
8824
  )` : "handleFarmRequestInContext(request, null, false, Date.now(), adapterContext, requestUrl)"};
8710
- ${_optionalChain([config, 'access', _174 => _174.md, 'optionalAccess', _175 => _175.enabled]) ? `const pathname = getFarmRoutePathname(requestUrl.pathname);
8825
+ ${_optionalChain([config, 'access', _208 => _208.md, 'optionalAccess', _209 => _209.enabled]) ? `const pathname = getFarmRoutePathname(requestUrl.pathname);
8711
8826
  if (matchPageRoute(pathname)) {
8712
8827
  // The Link header advertises the public .md URL, like the head alternate.
8713
8828
  return applyMarkdownNegotiationHeaders(response, {
@@ -8788,7 +8903,7 @@ async function resolveFarmRequestInContext(
8788
8903
  if (rewriteDestination) {
8789
8904
  let rewrittenRequest = createRewrittenRequest(request, rewriteDestination);
8790
8905
  if (new URL(rewrittenRequest.url).origin !== url.origin) {
8791
- return globalThis.fetch(rewrittenRequest);
8906
+ return fetchFarmExternalRewrite(rewrittenRequest);
8792
8907
  }
8793
8908
  if (farmPluginRuntime) {
8794
8909
  // Plugin guards ran on the requested URL. Re-run only runtime.before
@@ -8917,7 +9032,7 @@ ${hasServerRuntimeIntegrations ? `
8917
9032
  }
8918
9033
  ` : ""}
8919
9034
 
8920
- ${_optionalChain([config, 'access', _176 => _176.docs, 'optionalAccess', _177 => _177.enabled]) ? `
9035
+ ${_optionalChain([config, 'access', _210 => _210.docs, 'optionalAccess', _211 => _211.enabled]) ? `
8921
9036
  // Docs responses are served after app middleware so route guards and
8922
9037
  // middleware headers apply to the docs engine like any other page content.
8923
9038
  // An app's own llms.txt, llms-full.txt, sitemap.xml, and robots.txt take
@@ -8985,7 +9100,7 @@ ${hasServerRuntimeIntegrations ? `
8985
9100
  }
8986
9101
  ` : ""}
8987
9102
 
8988
- ${_optionalChain([config, 'access', _178 => _178.md, 'optionalAccess', _179 => _179.enabled]) ? `
9103
+ ${_optionalChain([config, 'access', _212 => _212.md, 'optionalAccess', _213 => _213.enabled]) ? `
8989
9104
  if (farmMarkdownConfig?.enabled) {
8990
9105
  const markdownResponse = await createMarkdownMirrorResponse({
8991
9106
  // The mirror helper only reads metadata and creates its own GET request.
@@ -9084,11 +9199,11 @@ ${hasServerRuntimeIntegrations ? `
9084
9199
  return applyProductionMiddlewareHeaders(applicationMetadataResponse, middlewareHeaders);
9085
9200
  }
9086
9201
  ` : ""}
9087
- ${_optionalChain([config, 'access', _180 => _180.agent, 'optionalAccess', _181 => _181.manifest]) !== false ? `
9202
+ ${_optionalChain([config, 'access', _214 => _214.agent, 'optionalAccess', _215 => _215.manifest]) !== false ? `
9088
9203
  // agent.manifest: /.well-known/farmjs.json (and 0.1.34's /.well-known/farmjs), the app's
9089
9204
  // public manifest, the same document for every request.
9090
9205
  if (
9091
- [${JSON.stringify(_chunkGOOK2J2Wcjs.FARM_APP_MANIFEST_PATH)}, ${JSON.stringify(_chunkGOOK2J2Wcjs.FARM_APP_MANIFEST_LEGACY_PATH)}].includes(
9206
+ [${JSON.stringify(_chunkRMPNYUGTcjs.FARM_APP_MANIFEST_PATH)}, ${JSON.stringify(_chunkRMPNYUGTcjs.FARM_APP_MANIFEST_LEGACY_PATH)}].includes(
9092
9207
  normalizeRuntimePath(routePathname),
9093
9208
  )
9094
9209
  ) {
@@ -9098,9 +9213,9 @@ ${hasServerRuntimeIntegrations ? `
9098
9213
  );
9099
9214
  }
9100
9215
  ` : ""}
9101
- ${_optionalChain([config, 'access', _182 => _182.agent, 'optionalAccess', _183 => _183.apiCatalog]) ? `
9216
+ ${_optionalChain([config, 'access', _216 => _216.agent, 'optionalAccess', _217 => _217.apiCatalog]) ? `
9102
9217
  // agent.apiCatalog: list the OpenAPI and MCP surfaces at the RFC 9727 path.
9103
- if (normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkGOOK2J2Wcjs.FARM_API_CATALOG_PATH)}) {
9218
+ if (normalizeRuntimePath(routePathname) === ${JSON.stringify(_chunkRMPNYUGTcjs.FARM_API_CATALOG_PATH)}) {
9104
9219
  return applyProductionMiddlewareHeaders(
9105
9220
  createFarmApiCatalogResponse(request.method, farmApiCatalogInput, request),
9106
9221
  middlewareHeaders,
@@ -9125,11 +9240,11 @@ ${hasServerRuntimeIntegrations ? `
9125
9240
  );
9126
9241
  }
9127
9242
  ` : ""}
9128
- ${_optionalChain([config, 'access', _184 => _184.agent, 'optionalAccess', _185 => _185.llmsTxt, 'optionalAccess', _186 => _186.enabled]) ? `
9243
+ ${_optionalChain([config, 'access', _218 => _218.agent, 'optionalAccess', _219 => _219.llmsTxt, 'optionalAccess', _220 => _220.enabled]) ? `
9129
9244
  // agent.llmsTxt with no llms.ts or llms-full.ts: serve the generated files.
9130
9245
  const farmGeneratedLlmsKind = normalizeRuntimePath(routePathname) === "/llms.txt"
9131
9246
  ? "llms"
9132
- : ${_optionalChain([config, 'access', _187 => _187.agent, 'optionalAccess', _188 => _188.llmsTxt, 'optionalAccess', _189 => _189.full]) ? `normalizeRuntimePath(routePathname) === "/llms-full.txt" ? "llms-full" : ` : ""}null;
9247
+ : ${_optionalChain([config, 'access', _221 => _221.agent, 'optionalAccess', _222 => _222.llmsTxt, 'optionalAccess', _223 => _223.full]) ? `normalizeRuntimePath(routePathname) === "/llms-full.txt" ? "llms-full" : ` : ""}null;
9133
9248
  if (farmGeneratedLlmsKind) {
9134
9249
  const llmsContext = createFarmLlmsTxtContext(request, farmGeneratedLlmsKind === "llms-full");
9135
9250
  const llmsOrigin = new URL(request.url).origin;
@@ -9164,7 +9279,7 @@ ${hasServerRuntimeIntegrations ? `
9164
9279
  }
9165
9280
  ` : ""}
9166
9281
 
9167
- ${_optionalChain([config, 'access', _190 => _190.docs, 'optionalAccess', _191 => _191.enabled]) ? `if (farmDocsAPIHandler && isFarmDocsAPIRequest(pathname)) {
9282
+ ${_optionalChain([config, 'access', _224 => _224.docs, 'optionalAccess', _225 => _225.enabled]) ? `if (farmDocsAPIHandler && isFarmDocsAPIRequest(pathname)) {
9168
9283
  const docsAPIResponse = await farmDocsAPIHandler(cloneFarmRequestWithContext(request));
9169
9284
  if (docsAPIResponse) {
9170
9285
  return applyProductionMiddlewareHeaders(
@@ -9320,7 +9435,7 @@ ${hasServerRuntimeIntegrations ? `
9320
9435
  const rawPageProps = withFarmRouteContext(
9321
9436
  {
9322
9437
  params,
9323
- searchParams: Promise.resolve(searchParamsObj),
9438
+ searchParams: createFarmSearchParams(searchParamsObj),
9324
9439
  path: pathname,
9325
9440
  ...(middlewareData?.size ? { middleware: { data: middlewareData } } : {}),
9326
9441
  },
@@ -9361,7 +9476,7 @@ ${hasServerRuntimeIntegrations ? `
9361
9476
  ...rawPageProps,
9362
9477
  params: parsedParams,
9363
9478
  search: parsedSearch,
9364
- searchParams: Promise.resolve(parsedSearch),
9479
+ searchParams: createFarmSearchParams(parsedSearch),
9365
9480
  };
9366
9481
  })();
9367
9482
  if (
@@ -9380,7 +9495,7 @@ ${hasServerRuntimeIntegrations ? `
9380
9495
  const routeStateProps = {
9381
9496
  ...rawPageProps,
9382
9497
  search: searchParamsObj,
9383
- searchParams: Promise.resolve(searchParamsObj),
9498
+ searchParams: createFarmSearchParams(searchParamsObj),
9384
9499
  error: routeStateError,
9385
9500
  };
9386
9501
  if (isFarmNotFoundError(routeStateError) && routeComponents?.notFound) {
@@ -9409,7 +9524,7 @@ ${hasServerRuntimeIntegrations ? `
9409
9524
  const rawSlotProps = withFarmRouteContext(
9410
9525
  {
9411
9526
  params: slot.params,
9412
- searchParams: Promise.resolve(searchParamsObj),
9527
+ searchParams: createFarmSearchParams(searchParamsObj),
9413
9528
  path: pathname,
9414
9529
  ...(middlewareData?.size ? { middleware: { data: middlewareData } } : {}),
9415
9530
  },
@@ -9436,7 +9551,7 @@ ${hasServerRuntimeIntegrations ? `
9436
9551
  search: slotSchemas.search?.parse
9437
9552
  ? slotSchemas.search.parse(searchParamsObj)
9438
9553
  : searchParamsObj,
9439
- searchParams: Promise.resolve(
9554
+ searchParams: createFarmSearchParams(
9440
9555
  slotSchemas.search?.parse
9441
9556
  ? slotSchemas.search.parse(searchParamsObj)
9442
9557
  : searchParamsObj,
@@ -9700,7 +9815,7 @@ ${hasServerRuntimeIntegrations ? `
9700
9815
  );
9701
9816
  }
9702
9817
  }
9703
- ${_optionalChain([config, 'access', _192 => _192.md, 'optionalAccess', _193 => _193.enabled]) ? `
9818
+ ${_optionalChain([config, 'access', _226 => _226.md, 'optionalAccess', _227 => _227.enabled]) ? `
9704
9819
  // Advertise the Markdown mirror in the head as well as the Link header,
9705
9820
  // using the public path the .md request will be resolved against.
9706
9821
  mergedMetadata = addMetadataMarkdownAlternate(
@@ -9719,7 +9834,7 @@ ${hasServerRuntimeIntegrations ? `
9719
9834
  emitFarmEvent({ type: "cache.bypass", route: pathname, reason: "request-read" });
9720
9835
  }
9721
9836
 
9722
- const renderedMetadata = renderMetadataHead(mergedMetadata, { pathname, jsonLd: ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _194 => _194.agent, 'optionalAccess', _195 => _195.jsonLd]), () => ( false)))} });
9837
+ const renderedMetadata = renderMetadataHead(mergedMetadata, { pathname, jsonLd: ${JSON.stringify(_nullishCoalesce(_optionalChain([config, 'access', _228 => _228.agent, 'optionalAccess', _229 => _229.jsonLd]), () => ( false)))} });
9723
9838
  const title = renderedMetadata.title;
9724
9839
  const metaTags = renderedMetadata.tags;
9725
9840
  const hasFavicon = renderedMetadata.hasFavicon;
@@ -10100,7 +10215,7 @@ ${hasServerRuntimeIntegrations ? `
10100
10215
  reset: function() {},
10101
10216
  params,
10102
10217
  search: searchParamsObj,
10103
- searchParams: Promise.resolve(searchParamsObj),
10218
+ searchParams: createFarmSearchParams(searchParamsObj),
10104
10219
  path: pathname,
10105
10220
  ...(middlewareData?.size ? { middleware: { data: middlewareData } } : {}),
10106
10221
  });
@@ -10409,11 +10524,11 @@ ${generatePreloadResponseRuntimeSource()}
10409
10524
  export async function fetch(request, context) {${imageRuntime === "none" ? "" : `
10410
10525
  // The image optimizer's fetch of a local source is not a loopback visitor.
10411
10526
  context = _withFarmImageSourceClientAddress(request, context);`}
10412
- ${_optionalChain([config, 'access', _196 => _196.agent, 'optionalAccess', _197 => _197.noindexPreviews]) ? "const response = await" : "return"} _runWithAPIRequestRuntime({
10527
+ ${_optionalChain([config, 'access', _230 => _230.agent, 'optionalAccess', _231 => _231.noindexPreviews]) ? "const response = await" : "return"} _runWithAPIRequestRuntime({
10413
10528
  basePath: farmLocalAPIBasePath,
10414
10529
  dispatch: async (localRequest) =>
10415
10530
  (await handleAPIRequest(localRequest)) ?? Response.json({ error: "Not Found" }, { status: 404 }),
10416
- }, () => handleFarmFetch(request, context));${_optionalChain([config, 'access', _198 => _198.agent, 'optionalAccess', _199 => _199.noindexPreviews]) ? `
10531
+ }, () => handleFarmFetch(request, context));${_optionalChain([config, 'access', _232 => _232.agent, 'optionalAccess', _233 => _233.noindexPreviews]) ? `
10417
10532
  // Keep every response of a preview deployment out of search indexes.
10418
10533
  return farmNoindexPreview ? applyFarmPreviewRobotsTag(response) : response;` : ""}
10419
10534
  }
@@ -10604,13 +10719,13 @@ function getPhysicalPrerenderBypassReason(options) {
10604
10719
  if (rewriteSources.some((source) => middlewarePatternMatches(source, pathname))) {
10605
10720
  return "rewrite";
10606
10721
  }
10607
- if (_chunkVCKGOXFIcjs.appMiddlewareMayHandlePath.call(void 0, middlewareRoutes, pathname)) return "app middleware";
10608
- if (_chunkVCKGOXFIcjs.configMiddlewareMayHandlePath.call(void 0, config.middleware, pathname)) return "configured middleware";
10609
- if (_chunkLYWAGXXWcjs.hasCustomFarmRouteContext.call(void 0, config)) return "request context";
10722
+ if (_chunk76GHW3WIcjs.appMiddlewareMayHandlePath.call(void 0, middlewareRoutes, pathname)) return "app middleware";
10723
+ if (_chunk76GHW3WIcjs.configMiddlewareMayHandlePath.call(void 0, config.middleware, pathname)) return "configured middleware";
10724
+ if (_chunkVITZRYW3cjs.hasCustomFarmRouteContext.call(void 0, config)) return "request context";
10610
10725
  if (farmServerRuntimePluginsMayHandlePath(config, pathname)) return "server runtime plugin";
10611
10726
  const manifestEntry = getManifestPageEntry(routeRuntimeManifest, pathname);
10612
- if (_optionalChain([manifestEntry, 'optionalAccess', _200 => _200.rendering]) === "dynamic") return "dynamic runtime manifest";
10613
- if (manifestEntry && (manifestEntry.runtime !== "auto" || Boolean(_optionalChain([manifestEntry, 'access', _201 => _201.regions, 'optionalAccess', _202 => _202.length])) || manifestEntry.maxDuration !== void 0)) {
10727
+ if (_optionalChain([manifestEntry, 'optionalAccess', _234 => _234.rendering]) === "dynamic") return "dynamic runtime manifest";
10728
+ if (manifestEntry && (manifestEntry.runtime !== "auto" || Boolean(_optionalChain([manifestEntry, 'access', _235 => _235.regions, 'optionalAccess', _236 => _236.length])) || manifestEntry.maxDuration !== void 0)) {
10614
10729
  return "route runtime controls";
10615
10730
  }
10616
10731
  const routeRule = getEffectiveRouteRule(config, pathname);
@@ -10622,11 +10737,34 @@ function getPhysicalPrerenderBypassReason(options) {
10622
10737
  }
10623
10738
  return void 0;
10624
10739
  }
10740
+ async function getFarmDocsPrerenderPages(config, root, preset) {
10741
+ if (!_optionalChain([config, 'access', _237 => _237.docs, 'optionalAccess', _238 => _238.enabled]) || !config.docs.prerender) return [];
10742
+ if (!_chunkRD623KW4cjs.isReactRenderer.call(void 0, config.renderer) || !_chunkJVBNKWLVcjs.hasFarmDocsRuntimeAdapter.call(void 0, config.docs)) {
10743
+ _chunkVQJYGZNXcjs.logger.warn(
10744
+ "docs.prerender needs a docs adapter such as @farming-labs/farmjs; Farm's built-in docs renderer keeps rendering docs pages on request."
10745
+ );
10746
+ return [];
10747
+ }
10748
+ if (_chunkE552H232cjs.getFarmPresetRuntime.call(void 0, preset) === "edge") {
10749
+ _chunkVQJYGZNXcjs.logger.info(
10750
+ `\u21AA Keeping docs pages in the edge docs snapshot: docs.prerender writes static files on Node and serverless targets, not "${preset}".`
10751
+ );
10752
+ return [];
10753
+ }
10754
+ const pages = await _chunkJVBNKWLVcjs.listFarmDocsAdapterPages.call(void 0, config.docs, { root, srcDir: config.srcDir });
10755
+ if (!pages) {
10756
+ _chunkVQJYGZNXcjs.logger.warn(
10757
+ `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.`
10758
+ );
10759
+ return [];
10760
+ }
10761
+ return pages;
10762
+ }
10625
10763
  function hasFarmNitroCacheRouteRule(routeRules) {
10626
10764
  return Object.values(routeRules || {}).some((rule) => {
10627
- const swr = _optionalChain([rule, 'optionalAccess', _203 => _203.swr]);
10628
- const cache = _optionalChain([rule, 'optionalAccess', _204 => _204.cache]);
10629
- const headers = _optionalChain([rule, 'optionalAccess', _205 => _205.headers]);
10765
+ const swr = _optionalChain([rule, 'optionalAccess', _239 => _239.swr]);
10766
+ const cache = _optionalChain([rule, 'optionalAccess', _240 => _240.cache]);
10767
+ const headers = _optionalChain([rule, 'optionalAccess', _241 => _241.headers]);
10630
10768
  return swr !== void 0 && swr !== false || cache !== void 0 && cache !== false || !!headers && typeof headers === "object" && Object.keys(headers).length > 0;
10631
10769
  });
10632
10770
  }
@@ -10639,10 +10777,10 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
10639
10777
  const nitroBuilder = nitroBuilderResult.value;
10640
10778
  const isVercel = preset === "vercel" || preset === "vercel-edge";
10641
10779
  const isCloudflareWorker = preset === "cloudflare-module";
10642
- const outputDir = _chunkLYWAGXXWcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
10780
+ const outputDir = _chunkVITZRYW3cjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
10643
10781
  const runtimeServerOutputDir = isVercel ? _path2.default.join(outputDir, "functions", "__nitro.func") : _path2.default.join(outputDir, "server");
10644
10782
  const ssrOutputDir = _path2.default.join(root, distDir, "ssr");
10645
- const imageRuntime = _chunk474FO3UEcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
10783
+ const imageRuntime = _chunkX2M4XN4Vcjs.resolveFarmImageServerRuntime.call(void 0, config.images, preset);
10646
10784
  const hasGeneratedMetadataImages = Array.from(routeManager.getMetadataImages().values()).some(
10647
10785
  (image) => image.sourceType === "module"
10648
10786
  );
@@ -10657,18 +10795,25 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
10657
10795
  ...useExternalMetadataImageRuntime ? ["@vercel/og"] : []
10658
10796
  ]);
10659
10797
  const isPrebuiltSSRCandidate = preset === "node-server" && [...ssrExternalPackages].every((packageName) => copiedRuntimePackages.has(packageName));
10660
- _chunkXN2MB4QZcjs.logger.info(`\u{1F4E6} Nitro output directory: ${outputDir}`);
10661
- _chunkXN2MB4QZcjs.logger.info(`\u{1F4E6} SSR entry file: ${ssrEntryFile}`);
10662
- _chunkXN2MB4QZcjs.logger.info(`\u{1F4E6} Preset: ${preset}`);
10798
+ _chunkVQJYGZNXcjs.logger.info(`\u{1F4E6} Nitro output directory: ${outputDir}`);
10799
+ _chunkVQJYGZNXcjs.logger.info(`\u{1F4E6} SSR entry file: ${ssrEntryFile}`);
10800
+ _chunkVQJYGZNXcjs.logger.info(`\u{1F4E6} Preset: ${preset}`);
10663
10801
  const ssgCollectionPromise = routeManager.collectSSGPages();
10664
10802
  const middlewareRoutesPromise = discoverMiddlewareRoutes(_chunk5Y2P454Ocjs.getFarmAppDirectories.call(void 0, config));
10665
10803
  const configuredResponseRoutesPromise = Promise.all([config.redirects(), config.rewrites()]);
10666
- const farmWorkflows = await _chunkIQXGHGZFcjs.prepareFarmWorkflowsForNitro.call(void 0, config);
10667
- const farmCron = await _chunkC7425KDGcjs.prepareFarmCronForNitro.call(void 0, config);
10668
- const [{ ssg: ssgPages }, middlewareRoutes, [configuredRedirects, configuredRewrites]] = await Promise.all([
10804
+ const docsPrerenderPagesPromise = getFarmDocsPrerenderPages(config, root, preset);
10805
+ const farmWorkflows = await _chunkXB24LZWIcjs.prepareFarmWorkflowsForNitro.call(void 0, config);
10806
+ const farmCron = await _chunkXYL4HSVCcjs.prepareFarmCronForNitro.call(void 0, config);
10807
+ const [
10808
+ { ssg: ssgPages },
10809
+ middlewareRoutes,
10810
+ [configuredRedirects, configuredRewrites],
10811
+ docsPrerenderPages
10812
+ ] = await Promise.all([
10669
10813
  ssgCollectionPromise,
10670
10814
  middlewareRoutesPromise,
10671
- configuredResponseRoutesPromise
10815
+ configuredResponseRoutesPromise,
10816
+ docsPrerenderPagesPromise
10672
10817
  ]);
10673
10818
  const redirectSources = [
10674
10819
  ...routeManager.getRedirects().map((route) => route.source),
@@ -10677,12 +10822,18 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
10677
10822
  const rewriteSources = configuredRewrites.map((route) => route.source);
10678
10823
  const prerenderRoutes = [];
10679
10824
  const skippedPrerenderRoutes = [];
10825
+ const middlewareRoutesWithConfig = ssgPages.length > 0 || docsPrerenderPages.length > 0 ? await Promise.all(
10826
+ middlewareRoutes.map(async (route) => ({
10827
+ ...route,
10828
+ config: await readMiddlewareFileConfig(route.filePath)
10829
+ }))
10830
+ ) : middlewareRoutes;
10680
10831
  for (const page of ssgPages) {
10681
10832
  if (page.revalidate !== void 0) continue;
10682
10833
  if (prerenderRoutes.includes(page.urlPath)) continue;
10683
10834
  const reason = getPhysicalPrerenderBypassReason({
10684
10835
  config,
10685
- middlewareRoutes,
10836
+ middlewareRoutes: middlewareRoutesWithConfig,
10686
10837
  routeRuntimeManifest,
10687
10838
  redirectSources,
10688
10839
  rewriteSources,
@@ -10694,22 +10845,42 @@ async function buildNitroUniversal(config, routeManager, apiRouteManager, server
10694
10845
  }
10695
10846
  prerenderRoutes.push(page.urlPath);
10696
10847
  }
10848
+ const docsRouteRuntimeManifest = {
10849
+ ...routeRuntimeManifest,
10850
+ routes: routeRuntimeManifest.routes.filter((entry) => entry.kind !== "page")
10851
+ };
10852
+ for (const pathname of docsPrerenderPages) {
10853
+ if (prerenderRoutes.includes(pathname)) continue;
10854
+ const reason = getPhysicalPrerenderBypassReason({
10855
+ config,
10856
+ middlewareRoutes: middlewareRoutesWithConfig,
10857
+ routeRuntimeManifest: docsRouteRuntimeManifest,
10858
+ redirectSources,
10859
+ rewriteSources,
10860
+ pathname
10861
+ });
10862
+ if (reason) {
10863
+ skippedPrerenderRoutes.push({ pathname, reason });
10864
+ continue;
10865
+ }
10866
+ prerenderRoutes.push(pathname);
10867
+ }
10697
10868
  for (const skipped of skippedPrerenderRoutes) {
10698
- _chunkXN2MB4QZcjs.logger.info(`\u21AA Keeping SSG route ${skipped.pathname} server-handled (${skipped.reason})`);
10869
+ _chunkVQJYGZNXcjs.logger.info(`\u21AA Keeping SSG route ${skipped.pathname} server-handled (${skipped.reason})`);
10699
10870
  }
10700
10871
  if (farmWorkflows.workflows.length > 0) {
10701
- _chunkXN2MB4QZcjs.logger.info(`\u23F1\uFE0F Found ${farmWorkflows.workflows.length} Farm workflow task(s)`);
10872
+ _chunkVQJYGZNXcjs.logger.info(`\u23F1\uFE0F Found ${farmWorkflows.workflows.length} Farm workflow task(s)`);
10702
10873
  }
10703
10874
  if (farmCron.jobs.length > 0) {
10704
- _chunkXN2MB4QZcjs.logger.info(`\u23F1\uFE0F Configured ${farmCron.jobs.length} Farm cron route(s)`);
10875
+ _chunkVQJYGZNXcjs.logger.info(`\u23F1\uFE0F Configured ${farmCron.jobs.length} Farm cron route(s)`);
10705
10876
  }
10706
10877
  if (preset === "cloudflare-pages" && farmCron.jobs.length > 0) {
10707
- _chunkXN2MB4QZcjs.logger.warn(
10878
+ _chunkVQJYGZNXcjs.logger.warn(
10708
10879
  "Cloudflare Pages does not install Cron Triggers. Use the cloudflare-module preset or an external scheduler with .farm/cron-manifest.json."
10709
10880
  );
10710
10881
  }
10711
- const scheduledTasks = _chunkC7425KDGcjs.mergeScheduledTasks.call(void 0, farmWorkflows.scheduledTasks, farmCron.scheduledTasks);
10712
- const cloudflareCronConfig = _chunkC7425KDGcjs.createFarmCronCloudflareConfig.call(void 0, farmCron.jobs);
10882
+ const scheduledTasks = _chunkXYL4HSVCcjs.mergeScheduledTasks.call(void 0, farmWorkflows.scheduledTasks, farmCron.scheduledTasks);
10883
+ const cloudflareCronConfig = _chunkXYL4HSVCcjs.createFarmCronCloudflareConfig.call(void 0, farmCron.jobs);
10713
10884
  const [clientCssHref, clientJsSrc, docsModulePreloads, clientModulePreloads] = await Promise.all([
10714
10885
  resolveHashedClientCssHref(clientOutputDir),
10715
10886
  resolveHashedClientJsSrc(clientOutputDir),
@@ -11074,7 +11245,7 @@ function toFarmNodeResponse(request, response) {
11074
11245
  ] : [],
11075
11246
  {
11076
11247
  route: "/**",
11077
- handler: _chunkXN2MB4QZcjs.toPosixPath.call(void 0, nitroEntryPath)
11248
+ handler: _chunkVQJYGZNXcjs.toPosixPath.call(void 0, nitroEntryPath)
11078
11249
  }
11079
11250
  ],
11080
11251
  routeRules: {
@@ -11119,20 +11290,20 @@ function toFarmNodeResponse(request, response) {
11119
11290
  snapshotSSRRebundleOptions(nitroConfig)
11120
11291
  );
11121
11292
  const requestedBuilder = _nullishCoalesce(nitroConfig.builder, () => ( process.env.NITRO_BUILDER));
11122
- const canReusePrebuiltSSR = isPrebuiltSSRCandidate && nitroConfig.preset === "node-server" && (requestedBuilder === void 0 || requestedBuilder === "rollup" || requestedBuilder === "rolldown") && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig && !hasUnsupportedSSRRebundleOverrides && _optionalChain([nitroConfig, 'access', _206 => _206.rollupConfig, 'optionalAccess', _207 => _207.external]) === nitroRollupExternal && !hasRollupPlugins(_optionalChain([nitroConfig, 'access', _208 => _208.rollupConfig, 'optionalAccess', _209 => _209.plugins])) && customRollupKeys.length === 0 && _path2.default.resolve(_optionalChain([nitroConfig, 'access', _210 => _210.output, 'optionalAccess', _211 => _211.serverDir]) || "") === _path2.default.resolve(expectedServerDir) && Boolean(
11123
- _optionalChain([nitroConfig, 'access', _212 => _212.handlers, 'optionalAccess', _213 => _213.some, 'call', _214 => _214(
11124
- (handler) => _path2.default.resolve(_optionalChain([handler, 'optionalAccess', _215 => _215.handler]) || "") === nitroEntryPath
11293
+ const canReusePrebuiltSSR = isPrebuiltSSRCandidate && nitroConfig.preset === "node-server" && (requestedBuilder === void 0 || requestedBuilder === "rollup" || requestedBuilder === "rolldown") && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig && !hasUnsupportedSSRRebundleOverrides && _optionalChain([nitroConfig, 'access', _242 => _242.rollupConfig, 'optionalAccess', _243 => _243.external]) === nitroRollupExternal && !hasRollupPlugins(_optionalChain([nitroConfig, 'access', _244 => _244.rollupConfig, 'optionalAccess', _245 => _245.plugins])) && customRollupKeys.length === 0 && _path2.default.resolve(_optionalChain([nitroConfig, 'access', _246 => _246.output, 'optionalAccess', _247 => _247.serverDir]) || "") === _path2.default.resolve(expectedServerDir) && Boolean(
11294
+ _optionalChain([nitroConfig, 'access', _248 => _248.handlers, 'optionalAccess', _249 => _249.some, 'call', _250 => _250(
11295
+ (handler) => _path2.default.resolve(_optionalChain([handler, 'optionalAccess', _251 => _251.handler]) || "") === nitroEntryPath
11125
11296
  )])
11126
11297
  );
11127
11298
  const selectRolldownBuilder = canReusePrebuiltSSR && requestedBuilder === void 0 && await canUseRolldownBuilder();
11128
11299
  if (selectRolldownBuilder) nitroConfig.builder = "rolldown";
11129
11300
  const useRolldownBuilder = canReusePrebuiltSSR && (_nullishCoalesce(nitroConfig.builder, () => ( process.env.NITRO_BUILDER))) === "rolldown";
11130
11301
  const shouldMinify = nitroConfig.minify !== false;
11131
- const keepServerNames = !(_optionalChain([config, 'access', _216 => _216.docs, 'optionalAccess', _217 => _217.enabled]) && _optionalChain([config, 'access', _218 => _218.docs, 'access', _219 => _219.adapter, 'optionalAccess', _220 => _220.server]));
11302
+ const keepServerNames = !(_optionalChain([config, 'access', _252 => _252.docs, 'optionalAccess', _253 => _253.enabled]) && _optionalChain([config, 'access', _254 => _254.docs, 'access', _255 => _255.adapter, 'optionalAccess', _256 => _256.server]));
11132
11303
  const useFarmServerMinifier = shouldMinify && nitroConfig.sourcemap === false && !hasCustomOxcOptions && !hasLateBuildMutationConfig;
11133
11304
  const serverChunkMinifier = useFarmServerMinifier ? createServerChunkMinifyPlugin({ keepNames: keepServerNames, target: "esnext" }) : null;
11134
11305
  if (canReusePrebuiltSSR) {
11135
- const configuredRollupPlugins = _optionalChain([nitroConfig, 'access', _221 => _221.rollupConfig, 'optionalAccess', _222 => _222.plugins]);
11306
+ const configuredRollupPlugins = _optionalChain([nitroConfig, 'access', _257 => _257.rollupConfig, 'optionalAccess', _258 => _258.plugins]);
11136
11307
  nitroConfig.rollupConfig = {
11137
11308
  ...nitroConfig.rollupConfig,
11138
11309
  plugins: [
@@ -11143,9 +11314,9 @@ function toFarmNodeResponse(request, response) {
11143
11314
  }
11144
11315
  nitroConfig.minify = useFarmServerMinifier ? false : shouldMinify;
11145
11316
  const nitroInstance = await nitroBuilder.createNitro(nitroConfig);
11146
- if (_optionalChain([config, 'access', _223 => _223.md, 'optionalAccess', _224 => _224.enabled])) {
11317
+ if (_optionalChain([config, 'access', _259 => _259.md, 'optionalAccess', _260 => _260.enabled])) {
11147
11318
  nitroInstance.hooks.hook("prerender:generate", (route) => {
11148
- if (!route.contents || !_optionalChain([route, 'access', _225 => _225.contentType, 'optionalAccess', _226 => _226.toLowerCase, 'call', _227 => _227(), 'access', _228 => _228.includes, 'call', _229 => _229("html")])) return;
11319
+ if (!route.contents || !_optionalChain([route, 'access', _261 => _261.contentType, 'optionalAccess', _262 => _262.toLowerCase, 'call', _263 => _263(), 'access', _264 => _264.includes, 'call', _265 => _265("html")])) return;
11149
11320
  const alternatePath = _chunkWJFFPXCVcjs.getFarmMarkdownAlternatePath.call(void 0, config.md, route.route);
11150
11321
  if (!alternatePath) return;
11151
11322
  const routeRule = nitroInstance.options.routeRules[route.route] || {};
@@ -11166,7 +11337,7 @@ function toFarmNodeResponse(request, response) {
11166
11337
  }
11167
11338
  if (config.security.csp && config.security.csp.nonce) {
11168
11339
  nitroInstance.hooks.hook("prerender:generate", async (route) => {
11169
- if (!route.contents || !_optionalChain([route, 'access', _230 => _230.contentType, 'optionalAccess', _231 => _231.toLowerCase, 'call', _232 => _232(), 'access', _233 => _233.includes, 'call', _234 => _234("html")])) return;
11340
+ if (!route.contents || !_optionalChain([route, 'access', _266 => _266.contentType, 'optionalAccess', _267 => _267.toLowerCase, 'call', _268 => _268(), 'access', _269 => _269.includes, 'call', _270 => _270("html")])) return;
11170
11341
  const staticCsp = await _chunk6JHZPB52cjs.applyFarmCspHashesToHtml.call(void 0, route.contents, config.security);
11171
11342
  if (!staticCsp) return;
11172
11343
  route.contents = staticCsp.html;
@@ -11240,14 +11411,14 @@ function toFarmNodeResponse(request, response) {
11240
11411
  });
11241
11412
  }
11242
11413
  if (prerenderRoutes.length > 0) {
11243
- _chunkXN2MB4QZcjs.logger.info(`\u{1F4C4} Pre-rendering ${prerenderRoutes.length} SSG page(s)`);
11244
- const previousPrerender = process.env[_chunkHYN3LLG7cjs.FARM_PRERENDER_ENV];
11245
- process.env[_chunkHYN3LLG7cjs.FARM_PRERENDER_ENV] = "1";
11414
+ _chunkVQJYGZNXcjs.logger.info(`\u{1F4C4} Pre-rendering ${prerenderRoutes.length} SSG page(s)`);
11415
+ const previousPrerender = process.env[_chunkIFBINMI4cjs.FARM_PRERENDER_ENV];
11416
+ process.env[_chunkIFBINMI4cjs.FARM_PRERENDER_ENV] = "1";
11246
11417
  try {
11247
11418
  await nitroBuilder.prerender(nitroInstance);
11248
11419
  } finally {
11249
- if (previousPrerender === void 0) delete process.env[_chunkHYN3LLG7cjs.FARM_PRERENDER_ENV];
11250
- else process.env[_chunkHYN3LLG7cjs.FARM_PRERENDER_ENV] = previousPrerender;
11420
+ if (previousPrerender === void 0) delete process.env[_chunkIFBINMI4cjs.FARM_PRERENDER_ENV];
11421
+ else process.env[_chunkIFBINMI4cjs.FARM_PRERENDER_ENV] = previousPrerender;
11251
11422
  }
11252
11423
  }
11253
11424
  const sharpRuntimeStagePromise = imageRuntime === "node" ? stageSharpRuntime(config, root, distDir, fs4, preset) : Promise.resolve(null);
@@ -11299,10 +11470,10 @@ function toFarmNodeResponse(request, response) {
11299
11470
  if (failedCopy) throw failedCopy.reason;
11300
11471
  if (canReusePrebuiltSSR) {
11301
11472
  await registerPrebuiltSSRPackageImport(_path2.default.join(outputDir, "server"), ssrEntryFile, fs4);
11302
- _chunkXN2MB4QZcjs.logger.info("\u26A1 Reused Farm's prebuilt SSR bundle for the Node output");
11473
+ _chunkVQJYGZNXcjs.logger.info("\u26A1 Reused Farm's prebuilt SSR bundle for the Node output");
11303
11474
  }
11304
11475
  if (useRolldownBuilder) {
11305
- _chunkXN2MB4QZcjs.logger.info("\u26A1 Built the Node adapter with Rolldown");
11476
+ _chunkVQJYGZNXcjs.logger.info("\u26A1 Built the Node adapter with Rolldown");
11306
11477
  }
11307
11478
  if (pluginManager) {
11308
11479
  await pluginManager.runHookParallel("afterNitroBuild", {
@@ -11315,7 +11486,7 @@ function toFarmNodeResponse(request, response) {
11315
11486
  if (isVercel) {
11316
11487
  await postProcessVercelOutput(root, outputDir, fs4, config, farmWorkflows, routeRuntimeManifest);
11317
11488
  }
11318
- _chunkXN2MB4QZcjs.logger.success(`\u2705 Nitro build completed with preset: ${preset}`);
11489
+ _chunkVQJYGZNXcjs.logger.success(`\u2705 Nitro build completed with preset: ${preset}`);
11319
11490
  }
11320
11491
  function resolveFarmNitroOutputConfig(preset, outputDir) {
11321
11492
  const isVercel = preset === "vercel" || preset === "vercel-edge";
@@ -11372,7 +11543,7 @@ async function moveVercelOutputPath(src, dest, fs4) {
11372
11543
  await fs4.rename(src, dest);
11373
11544
  return;
11374
11545
  } catch (error) {
11375
- const code = _optionalChain([error, 'optionalAccess', _235 => _235.code]);
11546
+ const code = _optionalChain([error, 'optionalAccess', _271 => _271.code]);
11376
11547
  if (code !== "EPERM" && code !== "EACCES" && code !== "EXDEV" && code !== "ENOTEMPTY") {
11377
11548
  throw error;
11378
11549
  }
@@ -11398,7 +11569,7 @@ async function postProcessVercelOutput(root, outputDir, fs4, config, farmWorkflo
11398
11569
  try {
11399
11570
  await moveVercelOutputPath(publicDir, staticDir, fs4);
11400
11571
  } catch (error) {
11401
- if (_optionalChain([error, 'optionalAccess', _236 => _236.code]) !== "ENOENT") throw error;
11572
+ if (_optionalChain([error, 'optionalAccess', _272 => _272.code]) !== "ENOENT") throw error;
11402
11573
  }
11403
11574
  await copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs4);
11404
11575
  await copyPrismaClientForVercel(root, nitroFuncDir, fs4);
@@ -11415,22 +11586,41 @@ async function postProcessVercelOutput(root, outputDir, fs4, config, farmWorkflo
11415
11586
  presetRoutes: Array.isArray(vercelConfig.routes) ? vercelConfig.routes : [],
11416
11587
  runtimeRoutes
11417
11588
  });
11418
- const vercelConfigWithWorkflowCrons = _chunkIQXGHGZFcjs.applyFarmWorkflowVercelCrons.call(void 0,
11589
+ const vercelConfigWithWorkflowCrons = _chunkXB24LZWIcjs.applyFarmWorkflowVercelCrons.call(void 0,
11419
11590
  vercelConfig,
11420
11591
  farmWorkflows.workflows
11421
11592
  );
11422
- const vercelConfigWithCrons = _chunkC7425KDGcjs.applyFarmCronVercelCrons.call(void 0,
11593
+ const vercelConfigWithCrons = _chunkXYL4HSVCcjs.applyFarmCronVercelCrons.call(void 0,
11423
11594
  vercelConfigWithWorkflowCrons,
11424
11595
  config.cron.jobs
11425
11596
  );
11426
11597
  await fs4.writeFile(configPath, JSON.stringify(vercelConfigWithCrons, null, 2));
11427
- _chunkXN2MB4QZcjs.logger.info("\u2705 Post-processed Vercel output for Build Output API v3");
11598
+ _chunkVQJYGZNXcjs.logger.info("\u2705 Post-processed Vercel output for Build Output API v3");
11428
11599
  }
11429
11600
  async function copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs4) {
11430
- const docsContentDir = resolveBuildDocsContentDir(config, root);
11601
+ if (!_optionalChain([config, 'access', _273 => _273.docs, 'optionalAccess', _274 => _274.enabled])) return;
11602
+ const [mainRoot, ...extraRoots] = _chunk5N7QAGEAcjs.getFarmDocsRoots.call(void 0, config.docs);
11603
+ await copyFarmDocsRootContent(
11604
+ mainRoot,
11605
+ root,
11606
+ config.srcDir,
11607
+ _path2.default.join(nitroFuncDir, "farm-docs-content"),
11608
+ fs4
11609
+ );
11610
+ for (const [index, docsRoot] of extraRoots.entries()) {
11611
+ await copyFarmDocsRootContent(
11612
+ docsRoot,
11613
+ root,
11614
+ config.srcDir,
11615
+ _path2.default.join(nitroFuncDir, "farm-docs-roots", String(index)),
11616
+ fs4
11617
+ );
11618
+ }
11619
+ }
11620
+ async function copyFarmDocsRootContent(docs, root, srcDir, bundledContentDir, fs4) {
11621
+ const docsContentDir = resolveBuildDocsContentDir(docs, root, srcDir);
11431
11622
  if (!docsContentDir) return;
11432
- const bundledContentDir = _path2.default.join(nitroFuncDir, "farm-docs-content");
11433
- const lastModifiedManifest = _chunkX2EL3BLHcjs.createFarmDocsLastModifiedManifest.call(void 0, docsContentDir, {
11623
+ const lastModifiedManifest = _chunk5N7QAGEAcjs.createFarmDocsLastModifiedManifest.call(void 0, docsContentDir, {
11434
11624
  fallback: "now"
11435
11625
  });
11436
11626
  await fs4.rm(bundledContentDir, { recursive: true, force: true });
@@ -11440,11 +11630,11 @@ async function copyFarmDocsContentForVercel(config, root, nitroFuncDir, fs4) {
11440
11630
  force: true
11441
11631
  });
11442
11632
  await fs4.writeFile(
11443
- _path2.default.join(bundledContentDir, _chunkX2EL3BLHcjs.FARM_DOCS_LAST_MODIFIED_MANIFEST),
11633
+ _path2.default.join(bundledContentDir, _chunk5N7QAGEAcjs.FARM_DOCS_LAST_MODIFIED_MANIFEST),
11444
11634
  `${JSON.stringify(lastModifiedManifest, null, 2)}
11445
11635
  `
11446
11636
  );
11447
- _chunkXN2MB4QZcjs.logger.info(`\u{1F4DA} Bundled docs content for Vercel: ${_path2.default.relative(root, docsContentDir)}`);
11637
+ _chunkVQJYGZNXcjs.logger.info(`\u{1F4DA} Bundled docs content for Vercel: ${_path2.default.relative(root, docsContentDir)}`);
11448
11638
  }
11449
11639
  function resolveServerFunctionPlatform(preset) {
11450
11640
  return preset === "vercel" || preset === "netlify" ? { os: "linux", cpu: "x64", libc: "glibc" } : null;
@@ -11466,7 +11656,7 @@ async function stageSharpRuntime(config, root, distDir, fs4, preset) {
11466
11656
  if (!resolvePackageJson(projectRequire, "sharp")) {
11467
11657
  try {
11468
11658
  sharpRequire = _module.createRequire.call(void 0, projectRequire.resolve("@farm.js/core"));
11469
- } catch (e30) {
11659
+ } catch (e31) {
11470
11660
  }
11471
11661
  }
11472
11662
  const copiedPackages = /* @__PURE__ */ new Map();
@@ -11511,7 +11701,7 @@ async function stageSharpRuntime(config, root, distDir, fs4, preset) {
11511
11701
  try {
11512
11702
  await copyPackage("sharp", sharpRequire);
11513
11703
  if (!copiedPackages.has("sharp")) {
11514
- throw new Error(`Farm image optimization requires sharp. ${_chunk474FO3UEcjs.SHARP_INSTALL_HINT}`);
11704
+ throw new Error(`Farm image optimization requires sharp. ${_chunkX2M4XN4Vcjs.SHARP_INSTALL_HINT}`);
11515
11705
  }
11516
11706
  } catch (error) {
11517
11707
  await fs4.rm(stageDir, { recursive: true, force: true });
@@ -11538,7 +11728,7 @@ async function installStagedSharpRuntime(staged, nitroFuncDir, fs4) {
11538
11728
  } finally {
11539
11729
  await fs4.rm(staged.stageDir, { recursive: true, force: true });
11540
11730
  }
11541
- _chunkXN2MB4QZcjs.logger.info(
11731
+ _chunkVQJYGZNXcjs.logger.info(
11542
11732
  `\u{1F5BC}\uFE0F Bundled Sharp image runtime (${Object.keys(staged.dependencies).length} packages)`
11543
11733
  );
11544
11734
  }
@@ -11582,7 +11772,7 @@ async function mergeStagedDirectory(sourceDir, targetDir, fs4) {
11582
11772
  function assertMetadataImageRuntimeInstalled(root, metadataImageRoutes) {
11583
11773
  const generated = metadataImageRoutes.find((image) => image.sourceType === "module");
11584
11774
  if (!generated || resolveMetadataImageRuntimePackageJson(root)) return;
11585
- const file = generated.modulePath ? _chunkXN2MB4QZcjs.toPosixPath.call(void 0, _path2.default.relative(root, generated.modulePath)) : "";
11775
+ const file = generated.modulePath ? _chunkVQJYGZNXcjs.toPosixPath.call(void 0, _path2.default.relative(root, generated.modulePath)) : "";
11586
11776
  throw new Error(
11587
11777
  `${file || "A generated metadata image"} renders with @vercel/og, which is not installed. ${_chunkKORZ6PREcjs.VERCEL_OG_INSTALL_HINT}`
11588
11778
  );
@@ -11593,7 +11783,7 @@ function resolveMetadataImageRuntimePackageJson(root) {
11593
11783
  if (packageJsonPath) return packageJsonPath;
11594
11784
  try {
11595
11785
  return resolvePackageJson(_module.createRequire.call(void 0, projectRequire.resolve("@farm.js/core")), "@vercel/og");
11596
- } catch (e31) {
11786
+ } catch (e32) {
11597
11787
  return null;
11598
11788
  }
11599
11789
  }
@@ -11616,7 +11806,7 @@ async function copyMetadataImageRuntime(root, nitroFuncDir, fs4) {
11616
11806
  "@vercel/og": String(packageJson.version || "0.11.1")
11617
11807
  };
11618
11808
  await writeNitroOutputPackage(nitroFuncDir, functionPackage, fs4);
11619
- _chunkXN2MB4QZcjs.logger.info("\u{1F5BC}\uFE0F Bundled generated metadata image runtime");
11809
+ _chunkVQJYGZNXcjs.logger.info("\u{1F5BC}\uFE0F Bundled generated metadata image runtime");
11620
11810
  }
11621
11811
  async function readNitroOutputPackage(outputDir, fs4) {
11622
11812
  const packagePath = _path2.default.join(outputDir, "package.json");
@@ -11640,7 +11830,7 @@ function resolvePackageJson(parentRequire, packageName) {
11640
11830
  const resolved = parentRequire.resolve(request);
11641
11831
  if (resolved.endsWith(".json")) return resolved;
11642
11832
  _nullishCoalesce(metadataModule, () => ( (metadataModule = resolved)));
11643
- } catch (e32) {
11833
+ } catch (e33) {
11644
11834
  }
11645
11835
  }
11646
11836
  try {
@@ -11651,13 +11841,13 @@ function resolvePackageJson(parentRequire, packageName) {
11651
11841
  try {
11652
11842
  const manifest = JSON.parse(_fs.readFileSync.call(void 0, candidate, "utf8"));
11653
11843
  if (manifest.name === packageName) return candidate;
11654
- } catch (e33) {
11844
+ } catch (e34) {
11655
11845
  }
11656
11846
  }
11657
11847
  if (_path2.default.basename(directory) === "node_modules") break;
11658
11848
  directory = _path2.default.dirname(directory);
11659
11849
  }
11660
- } catch (e34) {
11850
+ } catch (e35) {
11661
11851
  }
11662
11852
  return null;
11663
11853
  }
@@ -11666,13 +11856,13 @@ async function copyPrismaClientForVercel(root, nitroFuncDir, fs4) {
11666
11856
  let prismaClientDir;
11667
11857
  try {
11668
11858
  prismaClientDir = _path2.default.dirname(projectRequire.resolve("@prisma/client/default.js"));
11669
- } catch (e35) {
11859
+ } catch (e36) {
11670
11860
  return;
11671
11861
  }
11672
11862
  const generatedClientDir = _path2.default.join(prismaClientDir, "..", "..", ".prisma", "client");
11673
11863
  try {
11674
11864
  await fs4.access(generatedClientDir);
11675
- } catch (e36) {
11865
+ } catch (e37) {
11676
11866
  return;
11677
11867
  }
11678
11868
  const targetNodeModules = _path2.default.join(nitroFuncDir, "node_modules");
@@ -11741,7 +11931,7 @@ function createBuildTargetBaseline(config) {
11741
11931
  preset,
11742
11932
  distDir,
11743
11933
  outputDir,
11744
- outputWasDerived: outputDir === _chunkLYWAGXXWcjs.getDefaultDeployOutputDir.call(void 0, config.deploy.target, preset, distDir)
11934
+ outputWasDerived: outputDir === _chunkVITZRYW3cjs.getDefaultDeployOutputDir.call(void 0, config.deploy.target, preset, distDir)
11745
11935
  };
11746
11936
  }
11747
11937
  function resolveBuildTargets(config, options, baseline) {
@@ -11750,8 +11940,8 @@ function resolveBuildTargets(config, options, baseline) {
11750
11940
  const distDir = config.distDir || ".farm";
11751
11941
  const outputWasReplaced = config.deploy.outputDir !== baseline.outputDir;
11752
11942
  const shouldRefreshDerivedOutput = baseline.outputWasDerived && !outputWasReplaced && (preset !== baseline.preset || distDir !== baseline.distDir);
11753
- const deployTarget = preset === config.deploy.preset ? config.deploy.target : _chunkLYWAGXXWcjs.getDeployTargetForPreset.call(void 0, preset);
11754
- const outputDir = shouldRefreshDerivedOutput ? _chunkLYWAGXXWcjs.getDefaultDeployOutputDir.call(void 0, deployTarget, preset, distDir) : config.deploy.outputDir;
11943
+ const deployTarget = preset === config.deploy.preset ? config.deploy.target : _chunkVITZRYW3cjs.getDeployTargetForPreset.call(void 0, preset);
11944
+ const outputDir = shouldRefreshDerivedOutput ? _chunkVITZRYW3cjs.getDefaultDeployOutputDir.call(void 0, deployTarget, preset, distDir) : config.deploy.outputDir;
11755
11945
  return {
11756
11946
  root,
11757
11947
  preset,
@@ -11759,7 +11949,7 @@ function resolveBuildTargets(config, options, baseline) {
11759
11949
  distDir,
11760
11950
  deployTarget,
11761
11951
  outputDir,
11762
- deployOutputDir: _chunkLYWAGXXWcjs.resolveDeployOutputPath.call(void 0, root, outputDir)
11952
+ deployOutputDir: _chunkVITZRYW3cjs.resolveDeployOutputPath.call(void 0, root, outputDir)
11763
11953
  };
11764
11954
  }
11765
11955
  async function buildWithProductionNodeEnv(inputConfig, options) {
@@ -11796,15 +11986,15 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
11796
11986
  };
11797
11987
  config = {
11798
11988
  ...config,
11799
- images: _chunk474FO3UEcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, {
11989
+ images: _chunkX2M4XN4Vcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, {
11800
11990
  root: targets.root,
11801
11991
  preset: targets.preset
11802
11992
  })
11803
11993
  };
11804
- if (_optionalChain([config, 'access', _237 => _237.docs, 'optionalAccess', _238 => _238.enabled])) await _chunkV3UOEWCBcjs.loadFarmDocsEngine.call(void 0, );
11994
+ if (_optionalChain([config, 'access', _275 => _275.docs, 'optionalAccess', _276 => _276.enabled])) await _chunkV3UOEWCBcjs.loadFarmDocsEngine.call(void 0, );
11805
11995
  pluginManager.updateContext({ config });
11806
11996
  const { root, preset, srcDir, distDir, deployOutputDir } = targets;
11807
- _chunkXN2MB4QZcjs.logger.info(`\u{1F69C} Building Farm.js application with preset: ${preset}...`);
11997
+ _chunkVQJYGZNXcjs.logger.info(`\u{1F69C} Building Farm.js application with preset: ${preset}...`);
11808
11998
  await pluginManager.setupPlugins();
11809
11999
  await pluginManager.runHookParallel("beforeBundle", {
11810
12000
  root,
@@ -11813,10 +12003,10 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
11813
12003
  distDir,
11814
12004
  outputDir: deployOutputDir
11815
12005
  });
11816
- _chunkXN2MB4QZcjs.logger.info("\u{1F50D} Discovering routes and API endpoints...");
12006
+ _chunkVQJYGZNXcjs.logger.info("\u{1F50D} Discovering routes and API endpoints...");
11817
12007
  const productionViteResult = productionViteResultPromise ? (await productionViteResultPromise)[0] : void 0;
11818
- if (_optionalChain([productionViteResult, 'optionalAccess', _239 => _239.status]) === "rejected") throw productionViteResult.reason;
11819
- const productionVite = _optionalChain([productionViteResult, 'optionalAccess', _240 => _240.value]);
12008
+ if (_optionalChain([productionViteResult, 'optionalAccess', _277 => _277.status]) === "rejected") throw productionViteResult.reason;
12009
+ const productionVite = _optionalChain([productionViteResult, 'optionalAccess', _278 => _278.value]);
11820
12010
  const createViteServer = productionVite ? productionVite.createServer : (await import("vite")).createServer;
11821
12011
  projectModuleServer = await createProjectModuleServer(
11822
12012
  createViteServer,
@@ -11824,27 +12014,27 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
11824
12014
  root,
11825
12015
  rendererBuild.signal
11826
12016
  );
11827
- const farmApp = _chunk474FO3UEcjs.createFarmApp.call(void 0, config, projectModuleServer);
12017
+ const farmApp = _chunkX2M4XN4Vcjs.createFarmApp.call(void 0, config, projectModuleServer);
11828
12018
  await farmApp.initialize();
11829
12019
  const routeManager = farmApp.getRouteManager();
11830
12020
  const serverRenderer = farmApp.getServerRenderer();
11831
- const typeArtifacts = _chunkIUBDMDZZcjs.generateFarmTypeArtifacts.call(void 0, {
12021
+ const typeArtifacts = _chunkUQHIWZZ6cjs.generateFarmTypeArtifacts.call(void 0, {
11832
12022
  root,
11833
12023
  srcDir,
11834
12024
  layers: config.layers,
11835
12025
  plugins: config.plugins,
11836
12026
  extraRoutes: [
11837
- ..._optionalChain([config, 'access', _241 => _241.openapi, 'optionalAccess', _242 => _242.enabled]) && config.openapi.route ? [config.openapi.route] : [],
11838
- ..._chunkX2EL3BLHcjs.getFarmDocsRouteTypeEntries.call(void 0, config.docs)
12027
+ ..._optionalChain([config, 'access', _279 => _279.openapi, 'optionalAccess', _280 => _280.enabled]) && config.openapi.route ? [config.openapi.route] : [],
12028
+ ..._chunk5N7QAGEAcjs.getFarmDocsRouteTypeEntries.call(void 0, config.docs)
11839
12029
  ],
11840
12030
  suppressLintOnLink: config.suppressLintOnLink,
11841
12031
  componentExtensions: config.renderer.componentExtensions,
11842
12032
  i18nConfig: config.i18n
11843
12033
  }).catch((error) => {
11844
12034
  const message = error instanceof Error ? error.message : String(error);
11845
- _chunkXN2MB4QZcjs.logger.warn(`Route type generation failed (farm.d.ts may be stale): ${message}`);
12035
+ _chunkVQJYGZNXcjs.logger.warn(`Route type generation failed (farm.d.ts may be stale): ${message}`);
11846
12036
  });
11847
- const apiRouteManager = new (0, _chunkYAXOEANDcjs.APIRouteManager)(
12037
+ const apiRouteManager = new (0, _chunkKHXAJ2KAcjs.APIRouteManager)(
11848
12038
  _chunk5Y2P454Ocjs.getFarmAppDirectories.call(void 0, config),
11849
12039
  projectModuleServer,
11850
12040
  {
@@ -11870,11 +12060,11 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
11870
12060
  });
11871
12061
  } else {
11872
12062
  const { build: legacyViteBuild } = await import("vite");
11873
- _chunkXN2MB4QZcjs.logger.info("\u{1F4E6} Building client bundle...");
12063
+ _chunkVQJYGZNXcjs.logger.info("\u{1F4E6} Building client bundle...");
11874
12064
  await buildClient2(legacyViteBuild, config, root, srcDir, _path2.default.join(root, distDir, "client"));
11875
- _chunkXN2MB4QZcjs.logger.info("\u{1F4E6} Building SSR bundle...");
12065
+ _chunkVQJYGZNXcjs.logger.info("\u{1F4E6} Building SSR bundle...");
11876
12066
  await buildSSR(legacyViteBuild, config, root, srcDir, _path2.default.join(root, distDir, "server"));
11877
- _chunkXN2MB4QZcjs.logger.info(`\u{1F680} Building server with Nitro (preset: ${preset})...`);
12067
+ _chunkVQJYGZNXcjs.logger.info(`\u{1F680} Building server with Nitro (preset: ${preset})...`);
11878
12068
  await buildNitro(
11879
12069
  config,
11880
12070
  routeManager,
@@ -11895,8 +12085,8 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
11895
12085
  outputDir: deployOutputDir,
11896
12086
  success: true
11897
12087
  });
11898
- _chunkXN2MB4QZcjs.logger.success(`\u2705 Build completed successfully! (preset: ${preset})`);
11899
- _chunkXN2MB4QZcjs.logger.info(`\u{1F4C1} Output directory: ${deployOutputDir}`);
12088
+ _chunkVQJYGZNXcjs.logger.success(`\u2705 Build completed successfully! (preset: ${preset})`);
12089
+ _chunkVQJYGZNXcjs.logger.info(`\u{1F4C1} Output directory: ${deployOutputDir}`);
11900
12090
  } catch (error) {
11901
12091
  const { root, preset, distDir, deployOutputDir } = _nullishCoalesce(targets, () => ( resolveBuildTargets(config, options, targetBaseline)));
11902
12092
  await pluginManager.runHookParallel("onError", {
@@ -11915,11 +12105,11 @@ async function buildWithProductionNodeEnv(inputConfig, options) {
11915
12105
  outputDir: deployOutputDir,
11916
12106
  success: false
11917
12107
  });
11918
- _chunkXN2MB4QZcjs.logger.error(`\u274C Build failed: ${error}`);
12108
+ _chunkVQJYGZNXcjs.logger.error(`\u274C Build failed: ${error}`);
11919
12109
  throw error;
11920
12110
  } finally {
11921
12111
  try {
11922
- await _optionalChain([projectModuleServer, 'optionalAccess', _243 => _243.close, 'call', _244 => _244()]);
12112
+ await _optionalChain([projectModuleServer, 'optionalAccess', _281 => _281.close, 'call', _282 => _282()]);
11923
12113
  } finally {
11924
12114
  rendererBuild.abort();
11925
12115
  }
@@ -11930,7 +12120,7 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
11930
12120
  ssr: true,
11931
12121
  buildLifetime
11932
12122
  });
11933
- const viteConfig = _chunk474FO3UEcjs.mergeFarmViteConfig.call(void 0,
12123
+ const viteConfig = _chunkX2M4XN4Vcjs.mergeFarmViteConfig.call(void 0,
11934
12124
  {
11935
12125
  root,
11936
12126
  appType: "custom",
@@ -11942,19 +12132,19 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
11942
12132
  },
11943
12133
  plugins: [
11944
12134
  ...rendererVitePlugins,
11945
- _chunk474FO3UEcjs.farmFontImportsPlugin.call(void 0, {
12135
+ _chunkX2M4XN4Vcjs.farmFontImportsPlugin.call(void 0, {
11946
12136
  root,
11947
12137
  basePath: config.basePath,
11948
12138
  publicDir: config.publicDir
11949
12139
  }),
11950
- _chunkJ37KTQIAcjs.farmEnvironmentFunctionsPlugin.call(void 0, )
12140
+ _chunkNK2VWS7Pcjs.farmEnvironmentFunctionsPlugin.call(void 0, )
11951
12141
  ],
11952
12142
  server: {
11953
12143
  middlewareMode: true,
11954
12144
  hmr: false
11955
12145
  },
11956
12146
  resolve: {
11957
- alias: _chunk474FO3UEcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
12147
+ alias: _chunkX2M4XN4Vcjs.createFarmSourceAlias.call(void 0, root, config.srcDir),
11958
12148
  dedupe: [...config.renderer.dedupe || []]
11959
12149
  },
11960
12150
  optimizeDeps: {
@@ -11987,10 +12177,10 @@ async function createProjectModuleServer(createViteServer, config, root, buildLi
11987
12177
  noDiscovery: true
11988
12178
  },
11989
12179
  // An app or plugin that brings its own SSR environment keeps it.
11990
- environments: _optionalChain([viteConfig, 'access', _245 => _245.environments, 'optionalAccess', _246 => _246.ssr, 'optionalAccess', _247 => _247.dev, 'optionalAccess', _248 => _248.createEnvironment]) ? viteConfig.environments : {
12180
+ environments: _optionalChain([viteConfig, 'access', _283 => _283.environments, 'optionalAccess', _284 => _284.ssr, 'optionalAccess', _285 => _285.dev, 'optionalAccess', _286 => _286.createEnvironment]) ? viteConfig.environments : {
11991
12181
  ...viteConfig.environments,
11992
12182
  ssr: {
11993
- ..._optionalChain([viteConfig, 'access', _249 => _249.environments, 'optionalAccess', _250 => _250.ssr]),
12183
+ ..._optionalChain([viteConfig, 'access', _287 => _287.environments, 'optionalAccess', _288 => _288.ssr]),
11994
12184
  ...await createFarmProjectModuleSsrEnvironment()
11995
12185
  }
11996
12186
  }
@@ -12018,7 +12208,7 @@ async function buildClient2(viteBuild, config, root, srcDir, outputDir) {
12018
12208
  farmI18nClientBridgePlugin(),
12019
12209
  farmServerOnlyEntriesPlugin(),
12020
12210
  farmPlugin(config, pluginManager),
12021
- _chunkJ37KTQIAcjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
12211
+ _chunkNK2VWS7Pcjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
12022
12212
  ],
12023
12213
  mode: "production"
12024
12214
  });
@@ -12046,12 +12236,12 @@ async function buildSSR(viteBuild, config, root, srcDir, outputDir) {
12046
12236
  define: {
12047
12237
  __FARM_API_BASE_URL__: JSON.stringify(config.api.baseURL),
12048
12238
  __FARM_ENV__: JSON.stringify(_chunk3EIPOTZVcjs.createBundledEnv.call(void 0, config.env)),
12049
- __FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _251 => _251.env, 'optionalAccess', _252 => _252.public]) || {})
12239
+ __FARM_PUBLIC_ENV__: JSON.stringify(_optionalChain([config, 'access', _289 => _289.env, 'optionalAccess', _290 => _290.public]) || {})
12050
12240
  },
12051
12241
  plugins: [
12052
12242
  farmI18nClientBridgePlugin(),
12053
12243
  farmPlugin(config, pluginManager),
12054
- _chunkJ37KTQIAcjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
12244
+ _chunkNK2VWS7Pcjs.farmEnvironmentFunctionsPlugin.call(void 0, config)
12055
12245
  ],
12056
12246
  mode: "production"
12057
12247
  });
@@ -12066,7 +12256,7 @@ function resolveLegacyPageEntry(config, root, srcDir) {
12066
12256
  }
12067
12257
  async function buildNitro(config, routeManager, apiRouteManager, serverRenderer, preset, root, distDir, pluginManager) {
12068
12258
  const [{ createNitroConfig }, { createNitro, build: nitroBuild }] = await Promise.all([
12069
- import("./nitro-YPSZBYDK.cjs"),
12259
+ import("./nitro-CK7M4RMY.cjs"),
12070
12260
  import("nitro/builder")
12071
12261
  ]);
12072
12262
  let nitroConfig = await createNitroConfig(
@@ -12079,7 +12269,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
12079
12269
  if (pluginManager) {
12080
12270
  nitroConfig = await pluginManager.runHookSerial("beforeNitroBuild", nitroConfig);
12081
12271
  }
12082
- const outputDir = _chunkLYWAGXXWcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
12272
+ const outputDir = _chunkVITZRYW3cjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir);
12083
12273
  const serverOutputDir = _path2.default.join(outputDir, "server");
12084
12274
  const publicOutputDir = _path2.default.join(outputDir, "public");
12085
12275
  const { mkdir, cp } = await import("fs/promises");
@@ -12089,7 +12279,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
12089
12279
  try {
12090
12280
  await mkdir(publicOutputDir, { recursive: true });
12091
12281
  await cp(clientDir, publicOutputDir, { recursive: true });
12092
- _chunkXN2MB4QZcjs.logger.info("\u{1F4E6} Copied client assets to public directory");
12282
+ _chunkVQJYGZNXcjs.logger.info("\u{1F4E6} Copied client assets to public directory");
12093
12283
  const manifestPath = _path2.default.join(publicOutputDir, "farm-client-manifest.json");
12094
12284
  const assetsDir = _path2.default.join(publicOutputDir, "assets");
12095
12285
  const manifestExists = await import("fs/promises").then(
@@ -12099,12 +12289,12 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
12099
12289
  (fs4) => fs4.access(assetsDir).then(() => true).catch(() => false)
12100
12290
  );
12101
12291
  if (manifestExists && assetsExist) {
12102
- _chunkXN2MB4QZcjs.logger.info("\u2705 Verified client assets are present");
12292
+ _chunkVQJYGZNXcjs.logger.info("\u2705 Verified client assets are present");
12103
12293
  } else {
12104
- _chunkXN2MB4QZcjs.logger.warn("\u26A0\uFE0F Some client assets may be missing");
12294
+ _chunkVQJYGZNXcjs.logger.warn("\u26A0\uFE0F Some client assets may be missing");
12105
12295
  }
12106
12296
  } catch (error) {
12107
- _chunkXN2MB4QZcjs.logger.error(`\u274C Failed to copy client assets: ${error}`);
12297
+ _chunkVQJYGZNXcjs.logger.error(`\u274C Failed to copy client assets: ${error}`);
12108
12298
  throw error;
12109
12299
  }
12110
12300
  const serverDir = _path2.default.join(root, distDir, "server");
@@ -12112,9 +12302,9 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
12112
12302
  try {
12113
12303
  await mkdir(nitroServerDir, { recursive: true });
12114
12304
  await cp(serverDir, nitroServerDir, { recursive: true });
12115
- _chunkXN2MB4QZcjs.logger.info("\u{1F4E6} Copied SSR bundles to Nitro server directory");
12305
+ _chunkVQJYGZNXcjs.logger.info("\u{1F4E6} Copied SSR bundles to Nitro server directory");
12116
12306
  } catch (error) {
12117
- _chunkXN2MB4QZcjs.logger.warn(`Could not copy SSR bundles: ${error}`);
12307
+ _chunkVQJYGZNXcjs.logger.warn(`Could not copy SSR bundles: ${error}`);
12118
12308
  }
12119
12309
  const nitro = await createNitro(nitroConfig);
12120
12310
  const registryPath = _path2.default.join(root, distDir, ".nitro", "server", "farm-registry.ts");
@@ -12138,11 +12328,11 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
12138
12328
  const { readFile } = await import("fs/promises");
12139
12329
  const manifestContent = await readFile(clientManifestPath, "utf-8");
12140
12330
  farmRegistry.clientManifest = JSON.parse(manifestContent);
12141
- } catch (e37) {
12331
+ } catch (e38) {
12142
12332
  farmRegistry.clientManifest = {};
12143
12333
  }
12144
12334
  } catch (error) {
12145
- _chunkXN2MB4QZcjs.logger.warn(`Could not populate registry: ${error}`);
12335
+ _chunkVQJYGZNXcjs.logger.warn(`Could not populate registry: ${error}`);
12146
12336
  }
12147
12337
  await nitroBuild(nitro);
12148
12338
  if (pluginManager) {
@@ -12150,7 +12340,7 @@ async function buildNitro(config, routeManager, apiRouteManager, serverRenderer,
12150
12340
  root,
12151
12341
  preset,
12152
12342
  distDir,
12153
- outputDir: _chunkLYWAGXXWcjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir)
12343
+ outputDir: _chunkVITZRYW3cjs.resolveDeployOutputPath.call(void 0, root, config.deploy.outputDir)
12154
12344
  });
12155
12345
  }
12156
12346
  }