@farm.js/core 0.1.37 → 0.1.38

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 (242) hide show
  1. package/dist/{agent-mcp-BC0bAGVF.d.mts → agent-mcp-BwKlpnc7.d.mts} +1 -1
  2. package/dist/{agent-mcp-jyDHbQKe.d.ts → agent-mcp-De1imoMS.d.ts} +1 -1
  3. package/dist/{agent-mcp-handler-SJAHFSPI.cjs → agent-mcp-handler-MRGP3WJ3.cjs} +5 -5
  4. package/dist/{agent-mcp-handler-LPJ2CADR.mjs → agent-mcp-handler-OLRMZONF.mjs} +4 -4
  5. package/dist/agent-runtime.cjs +2 -2
  6. package/dist/agent-runtime.d.mts +1 -1
  7. package/dist/agent-runtime.d.ts +1 -1
  8. package/dist/agent-runtime.mjs +1 -1
  9. package/dist/api/client.cjs +3 -3
  10. package/dist/api/client.mjs +2 -2
  11. package/dist/api/route-manager.cjs +5 -5
  12. package/dist/api/route-manager.d.mts +3 -3
  13. package/dist/api/route-manager.d.ts +3 -3
  14. package/dist/api/route-manager.mjs +4 -4
  15. package/dist/api/runtime.cjs +4 -4
  16. package/dist/api/runtime.d.mts +2 -2
  17. package/dist/api/runtime.d.ts +2 -2
  18. package/dist/api/runtime.mjs +3 -3
  19. package/dist/api.cjs +7 -7
  20. package/dist/api.d.mts +3 -3
  21. package/dist/api.d.ts +3 -3
  22. package/dist/api.mjs +6 -6
  23. package/dist/{app-Cbkj9ufe.d.mts → app-CFZt-srr.d.mts} +21 -3
  24. package/dist/{app-CKO3iN1c.d.ts → app-kT_QXTdx.d.ts} +21 -3
  25. package/dist/app-markdown.cjs +4 -4
  26. package/dist/app-markdown.d.mts +2 -2
  27. package/dist/app-markdown.d.ts +2 -2
  28. package/dist/app-markdown.mjs +3 -3
  29. package/dist/{chunk-LOFKRKO7.cjs → chunk-2DD4JMQC.cjs} +113 -22
  30. package/dist/chunk-2ZYGC6SS.cjs +576 -0
  31. package/dist/{chunk-75X755YZ.cjs → chunk-34UCJRQO.cjs} +2 -2
  32. package/dist/{chunk-CVH2BXPY.cjs → chunk-3LOLJTFV.cjs} +6 -6
  33. package/dist/{chunk-4GPOC4LN.cjs → chunk-472NCAZ7.cjs} +3 -3
  34. package/dist/{chunk-WT4TGLXT.cjs → chunk-4E5QXOCL.cjs} +6 -6
  35. package/dist/{chunk-7DWNJI73.cjs → chunk-4IE345DM.cjs} +37 -19
  36. package/dist/{chunk-O6WAEAX3.mjs → chunk-5BWWFHR2.mjs} +70 -15
  37. package/dist/{chunk-6LGFV2CQ.cjs → chunk-5OKBARDN.cjs} +2 -2
  38. package/dist/{chunk-3IP27TCG.cjs → chunk-5PWXMJOH.cjs} +19 -19
  39. package/dist/chunk-6BK3K2GB.mjs +318 -0
  40. package/dist/{chunk-HEVMCTSR.mjs → chunk-6HB6V3R7.mjs} +1 -1
  41. package/dist/{chunk-NICDYKBS.cjs → chunk-6XWDE2P2.cjs} +22 -4
  42. package/dist/{chunk-Z7LA7MHQ.mjs → chunk-7FPTZLKH.mjs} +1 -1
  43. package/dist/{chunk-JPNFPAZ4.mjs → chunk-7PEP3BUT.mjs} +1 -1
  44. package/dist/{chunk-XOPOIFTJ.mjs → chunk-A3EAIURZ.mjs} +25 -7
  45. package/dist/{chunk-LBDP3YT3.mjs → chunk-ARC7I3O2.mjs} +1 -1
  46. package/dist/{chunk-LBGILORX.mjs → chunk-B6G5CKMC.mjs} +101 -10
  47. package/dist/{chunk-MCIZVNOQ.mjs → chunk-BZHXGVMA.mjs} +1 -1
  48. package/dist/{chunk-KDTBF3UU.mjs → chunk-CNNOLE4O.mjs} +1 -1
  49. package/dist/{chunk-TDNWPAVR.mjs → chunk-CUM5NYL5.mjs} +1 -1
  50. package/dist/{chunk-HITLGIAO.cjs → chunk-CY2ZQ5C6.cjs} +7 -6
  51. package/dist/{chunk-KPFKMDM7.mjs → chunk-DRLKAXDM.mjs} +1 -1
  52. package/dist/{chunk-VR4GD5I3.cjs → chunk-EIPC3FDA.cjs} +12 -4
  53. package/dist/{chunk-K3SAEIM3.mjs → chunk-EKF7KDFD.mjs} +1 -1
  54. package/dist/{chunk-B5PFZLKV.cjs → chunk-EKN7NSZO.cjs} +25 -8
  55. package/dist/{chunk-ATWHHSY2.cjs → chunk-EMO6K4YY.cjs} +4 -4
  56. package/dist/{chunk-6SJ2KJTA.mjs → chunk-EPYU2EBL.mjs} +1 -1
  57. package/dist/{chunk-PTZ2TVNE.cjs → chunk-H5CLOUZS.cjs} +5 -5
  58. package/dist/{chunk-DTSROJ5J.mjs → chunk-HD5CF3OE.mjs} +1 -1
  59. package/dist/{chunk-IAIYV4RZ.mjs → chunk-HXRYZWTA.mjs} +1 -1
  60. package/dist/{chunk-Z5BEWYVO.mjs → chunk-IBUQWVYA.mjs} +16 -0
  61. package/dist/{chunk-HMRSWN47.mjs → chunk-INL3THCU.mjs} +1 -1
  62. package/dist/{chunk-FBOJ55OM.mjs → chunk-IVLZZZEI.mjs} +1 -1
  63. package/dist/{chunk-ENLZ4R3Y.mjs → chunk-J7K2NZD6.mjs} +7 -6
  64. package/dist/{chunk-NFMDCAOS.mjs → chunk-JCKYH4LG.mjs} +2 -2
  65. package/dist/{chunk-PMQHMWZU.cjs → chunk-JCYYXBAJ.cjs} +3 -3
  66. package/dist/{chunk-LPFV45AY.cjs → chunk-KCQBAKIY.cjs} +9 -9
  67. package/dist/{chunk-FGRYBX5X.mjs → chunk-KHKLMNI5.mjs} +1 -1
  68. package/dist/{chunk-NQ6QFZWD.cjs → chunk-KKSTAEMY.cjs} +1 -1
  69. package/dist/{chunk-7O5M4UKW.cjs → chunk-L4DD7ODZ.cjs} +2 -2
  70. package/dist/{chunk-YCKO6FRS.mjs → chunk-LI2F57NI.mjs} +1 -1
  71. package/dist/{chunk-TW4GYDBJ.mjs → chunk-MLY2RP5R.mjs} +10 -2
  72. package/dist/{chunk-5BXGGEC7.cjs → chunk-N32CC42M.cjs} +5 -5
  73. package/dist/{chunk-BHY547NB.cjs → chunk-NBBEQLOK.cjs} +9 -9
  74. package/dist/{chunk-WQ7T2263.mjs → chunk-OAHTRMIC.mjs} +3 -3
  75. package/dist/{chunk-K4I4O5TS.mjs → chunk-OCIEZME4.mjs} +790 -671
  76. package/dist/{chunk-UH6QN5NL.mjs → chunk-P664ZVTV.mjs} +2 -2
  77. package/dist/{chunk-TE2G5ION.cjs → chunk-PGZDEPTM.cjs} +88 -33
  78. package/dist/{chunk-3KGDJLJK.mjs → chunk-POSPE3IO.mjs} +19 -1
  79. package/dist/{chunk-3A4KGQYI.cjs → chunk-Q3NXS4MU.cjs} +16 -14
  80. package/dist/{chunk-TPLJVC7E.mjs → chunk-QFW2IH5E.mjs} +23 -6
  81. package/dist/{chunk-S3VWVTVA.mjs → chunk-QRKIMN7T.mjs} +13 -1
  82. package/dist/chunk-QTXBII4Z.cjs +632 -0
  83. package/dist/{chunk-CI6E3UOH.cjs → chunk-RG4A6LB2.cjs} +7 -7
  84. package/dist/{chunk-7SQ5SGYZ.cjs → chunk-RW63BOV7.cjs} +2 -2
  85. package/dist/{chunk-U6MPZ35Q.cjs → chunk-RWFLWR5J.cjs} +8 -8
  86. package/dist/{chunk-EUV4YR3V.cjs → chunk-SGBJ247Q.cjs} +18 -2
  87. package/dist/{chunk-J3ANCZKA.mjs → chunk-SKVTP5PR.mjs} +1 -1
  88. package/dist/{chunk-6TJITR2B.cjs → chunk-TGFQVLLF.cjs} +870 -751
  89. package/dist/{chunk-4P6ULFMD.mjs → chunk-TUBTR2OP.mjs} +221 -102
  90. package/dist/{chunk-EMMQ64QW.cjs → chunk-TYJALEHQ.cjs} +2 -2
  91. package/dist/{chunk-WRPHYQVY.mjs → chunk-TYMMBFN2.mjs} +1 -1
  92. package/dist/chunk-U6QLDL3G.mjs +576 -0
  93. package/dist/{chunk-OW67PDDS.cjs → chunk-ULASELLA.cjs} +13 -1
  94. package/dist/{chunk-WWIKMBRN.mjs → chunk-VNGH5MLF.mjs} +17 -1
  95. package/dist/{chunk-NNSAQX3U.mjs → chunk-VT4WFRHA.mjs} +1 -1
  96. package/dist/{chunk-UJZLSXUB.cjs → chunk-VU6AAZVY.cjs} +17 -1
  97. package/dist/{chunk-ADOAUDQ6.cjs → chunk-VXEEATVD.cjs} +2 -2
  98. package/dist/{chunk-RRMVL6CJ.mjs → chunk-W36M2BQ4.mjs} +1 -1
  99. package/dist/{chunk-4WQ6PGSJ.cjs → chunk-WEW2JVA4.cjs} +4 -4
  100. package/dist/{chunk-4E5WBPEG.mjs → chunk-WFRT7JPX.mjs} +8 -533
  101. package/dist/{chunk-VXAWRDK7.mjs → chunk-WLL43JMO.mjs} +1 -1
  102. package/dist/chunk-WW46B6HA.cjs +318 -0
  103. package/dist/{chunk-D3C5LBQY.cjs → chunk-WXJLNP33.cjs} +2 -2
  104. package/dist/{chunk-NDILNQ4L.cjs → chunk-XKG2BLFN.cjs} +2 -2
  105. package/dist/{chunk-W2YDNK66.cjs → chunk-XKVVMZP5.cjs} +2 -2
  106. package/dist/{chunk-Q5FYSK45.cjs → chunk-YR2VBEMO.cjs} +619 -500
  107. package/dist/{chunk-EXG5LD6B.mjs → chunk-ZJD2PN6Z.mjs} +10 -8
  108. package/dist/{chunk-G2TEB74S.cjs → chunk-ZXH4TS3F.cjs} +2 -2
  109. package/dist/{client-plugins-C8DjftDF.d.ts → client-plugins-BvlNhGEB.d.ts} +40 -7
  110. package/dist/{client-plugins-CV4eJ9De.d.mts → client-plugins-DUrIYX9B.d.mts} +40 -7
  111. package/dist/client-plugins.d.mts +1 -1
  112. package/dist/client-plugins.d.ts +1 -1
  113. package/dist/client.cjs +5 -5
  114. package/dist/client.d.mts +5 -5
  115. package/dist/client.d.ts +5 -5
  116. package/dist/client.mjs +4 -4
  117. package/dist/config.d.mts +1 -1
  118. package/dist/config.d.ts +1 -1
  119. package/dist/{devtools-KVOY2TCZ.mjs → devtools-JYJNOLPQ.mjs} +7 -5
  120. package/dist/{devtools-JXFQNWSH.cjs → devtools-VQWJANJV.cjs} +8 -6
  121. package/dist/docs.cjs +11 -9
  122. package/dist/docs.d.mts +20 -2
  123. package/dist/docs.d.ts +20 -2
  124. package/dist/docs.mjs +10 -8
  125. package/dist/headers.cjs +6 -4
  126. package/dist/headers.d.mts +11 -1
  127. package/dist/headers.d.ts +11 -1
  128. package/dist/headers.mjs +5 -3
  129. package/dist/index.cjs +52 -39
  130. package/dist/index.d.mts +15 -15
  131. package/dist/index.d.ts +15 -15
  132. package/dist/index.mjs +52 -39
  133. package/dist/integrations.cjs +4 -2
  134. package/dist/integrations.d.mts +1 -1
  135. package/dist/integrations.d.ts +1 -1
  136. package/dist/integrations.mjs +3 -1
  137. package/dist/internal/app-markdown-runtime.cjs +3 -3
  138. package/dist/internal/app-markdown-runtime.d.mts +2 -2
  139. package/dist/internal/app-markdown-runtime.d.ts +2 -2
  140. package/dist/internal/app-markdown-runtime.mjs +2 -2
  141. package/dist/internal/build-runtime.cjs +28 -27
  142. package/dist/internal/build-runtime.d.mts +3 -3
  143. package/dist/internal/build-runtime.d.ts +3 -3
  144. package/dist/internal/build-runtime.mjs +27 -26
  145. package/dist/internal/cli-runtime.cjs +10 -8
  146. package/dist/internal/cli-runtime.mjs +9 -7
  147. package/dist/internal/client-error-overlay.cjs +4 -4
  148. package/dist/internal/client-error-overlay.mjs +1 -1
  149. package/dist/internal/compression-runtime.d.mts +1 -1
  150. package/dist/internal/compression-runtime.d.ts +1 -1
  151. package/dist/internal/config-runtime.cjs +8 -6
  152. package/dist/internal/config-runtime.d.mts +2 -2
  153. package/dist/internal/config-runtime.d.ts +2 -2
  154. package/dist/internal/config-runtime.mjs +7 -5
  155. package/dist/internal/docs-precompiled-runtime.cjs +19 -13
  156. package/dist/internal/docs-precompiled-runtime.d.mts +5 -0
  157. package/dist/internal/docs-precompiled-runtime.d.ts +5 -0
  158. package/dist/internal/docs-precompiled-runtime.mjs +14 -8
  159. package/dist/internal/infra-analytics-runtime.cjs +5 -5
  160. package/dist/internal/infra-analytics-runtime.mjs +3 -3
  161. package/dist/internal/product-telemetry-runtime.cjs +2 -2
  162. package/dist/internal/product-telemetry-runtime.mjs +1 -1
  163. package/dist/internal/production-node-env.cjs +6 -2
  164. package/dist/internal/production-node-env.d.mts +10 -1
  165. package/dist/internal/production-node-env.d.ts +10 -1
  166. package/dist/internal/production-node-env.mjs +5 -1
  167. package/dist/internal/production-runtime.cjs +34 -14
  168. package/dist/internal/production-runtime.d.mts +51 -11
  169. package/dist/internal/production-runtime.d.ts +51 -11
  170. package/dist/internal/production-runtime.mjs +36 -16
  171. package/dist/markdown.cjs +8 -2
  172. package/dist/markdown.d.mts +1 -1
  173. package/dist/markdown.d.ts +1 -1
  174. package/dist/markdown.mjs +7 -1
  175. package/dist/middleware.cjs +9 -7
  176. package/dist/middleware.d.mts +24 -4
  177. package/dist/middleware.d.ts +24 -4
  178. package/dist/middleware.mjs +9 -7
  179. package/dist/navigation.cjs +4 -4
  180. package/dist/navigation.d.mts +4 -4
  181. package/dist/navigation.d.ts +4 -4
  182. package/dist/navigation.mjs +3 -3
  183. package/dist/plugin.cjs +21 -20
  184. package/dist/plugin.d.mts +1 -1
  185. package/dist/plugin.d.ts +1 -1
  186. package/dist/plugin.mjs +20 -19
  187. package/dist/{production-runtime-Du_FHb2-.d.mts → production-runtime-BQ4_WLwQ.d.mts} +1 -1
  188. package/dist/{production-runtime-C2kkrPVZ.d.ts → production-runtime-D2aMyzjr.d.ts} +1 -1
  189. package/dist/query/client.cjs +2 -2
  190. package/dist/query/client.mjs +1 -1
  191. package/dist/{render-plan-BnnPTpus.d.ts → render-plan-25p4hrj4.d.ts} +1 -1
  192. package/dist/{render-plan-Cgx7v8tJ.d.mts → render-plan-DtkXMN8D.d.mts} +1 -1
  193. package/dist/renderer-client.d.mts +3 -3
  194. package/dist/renderer-client.d.ts +3 -3
  195. package/dist/renderer.d.mts +13 -4
  196. package/dist/renderer.d.ts +13 -4
  197. package/dist/{request-sKayKcop.d.mts → request-DgCkIdcn.d.mts} +4 -2
  198. package/dist/{request-BNWr7r5e.d.ts → request-jF4jwx8f.d.ts} +4 -2
  199. package/dist/request.cjs +3 -3
  200. package/dist/request.d.mts +2 -2
  201. package/dist/request.d.ts +2 -2
  202. package/dist/request.mjs +2 -2
  203. package/dist/{route-rendering-Bx4Auw6Q.d.ts → route-rendering-Bji6S6a_.d.ts} +1 -1
  204. package/dist/{route-rendering-DWFp3Yq4.d.mts → route-rendering-CSBF78Ya.d.mts} +1 -1
  205. package/dist/{router-BK6K42Ij.d.mts → router-B09Ui3Qm.d.mts} +1 -1
  206. package/dist/{router-DnW_2tQi.d.ts → router-CPB9cXtG.d.ts} +1 -1
  207. package/dist/routes.d.mts +1 -1
  208. package/dist/routes.d.ts +1 -1
  209. package/dist/{runtime-DJDaCMd_.d.mts → runtime-CM6E6yuI.d.mts} +1 -1
  210. package/dist/{runtime-CA3Ei5k_.d.ts → runtime-EDMwLdjv.d.ts} +1 -1
  211. package/dist/server-fn.cjs +3 -3
  212. package/dist/server-fn.mjs +2 -2
  213. package/dist/server-plugins.cjs +5 -5
  214. package/dist/server-plugins.d.mts +2 -2
  215. package/dist/server-plugins.d.ts +2 -2
  216. package/dist/server-plugins.mjs +4 -4
  217. package/dist/server-query.cjs +4 -4
  218. package/dist/server-query.mjs +3 -3
  219. package/dist/server.cjs +47 -46
  220. package/dist/server.d.mts +7 -7
  221. package/dist/server.d.ts +7 -7
  222. package/dist/server.mjs +25 -24
  223. package/dist/{spa-router-Mwbd7g2L.d.ts → spa-router-B_N8XgVu.d.ts} +2 -2
  224. package/dist/{spa-router-D6fUA4Rn.d.mts → spa-router-Cgimzfbi.d.mts} +2 -2
  225. package/dist/testing.cjs +5 -5
  226. package/dist/testing.d.mts +1 -1
  227. package/dist/testing.d.ts +1 -1
  228. package/dist/testing.mjs +4 -4
  229. package/dist/theme/server.cjs +4 -4
  230. package/dist/theme/server.mjs +3 -3
  231. package/dist/{utils-BwVcAfUR.d.ts → utils-BNxAKAuT.d.ts} +1 -1
  232. package/dist/{utils-p9Hs-jCc.d.mts → utils-DZciYXYl.d.mts} +1 -1
  233. package/dist/version.cjs +2 -2
  234. package/dist/version.mjs +1 -1
  235. package/dist/vite.cjs +21 -20
  236. package/dist/vite.d.mts +1 -1
  237. package/dist/vite.d.ts +1 -1
  238. package/dist/vite.mjs +20 -19
  239. package/package.json +1 -1
  240. package/dist/chunk-655RLQQL.mjs +0 -43
  241. package/dist/chunk-MRMI32SN.cjs +0 -1157
  242. package/dist/chunk-MT763TDW.cjs +0 -43
@@ -42,15 +42,17 @@ var _chunkJSROZYYOcjs = require('./chunk-JSROZYYO.cjs');
42
42
 
43
43
 
44
44
 
45
- var _chunkLOFKRKO7cjs = require('./chunk-LOFKRKO7.cjs');
46
45
 
47
46
 
47
+ var _chunk2DD4JMQCcjs = require('./chunk-2DD4JMQC.cjs');
48
48
 
49
49
 
50
50
 
51
51
 
52
52
 
53
- var _chunkPTZ2TVNEcjs = require('./chunk-PTZ2TVNE.cjs');
53
+
54
+
55
+ var _chunkH5CLOUZScjs = require('./chunk-H5CLOUZS.cjs');
54
56
 
55
57
 
56
58
  var _chunkCXP5U3RWcjs = require('./chunk-CXP5U3RW.cjs');
@@ -73,12 +75,12 @@ var _chunk3SDFA7UFcjs = require('./chunk-3SDFA7UF.cjs');
73
75
 
74
76
 
75
77
 
76
- var _chunk4GPOC4LNcjs = require('./chunk-4GPOC4LN.cjs');
78
+ var _chunk472NCAZ7cjs = require('./chunk-472NCAZ7.cjs');
77
79
 
78
80
 
79
81
 
80
82
 
81
- var _chunkHITLGIAOcjs = require('./chunk-HITLGIAO.cjs');
83
+ var _chunkCY2ZQ5C6cjs = require('./chunk-CY2ZQ5C6.cjs');
82
84
 
83
85
 
84
86
 
@@ -124,19 +126,22 @@ var _chunkPSV6XKPOcjs = require('./chunk-PSV6XKPO.cjs');
124
126
 
125
127
 
126
128
 
129
+ var _chunkQTXBII4Zcjs = require('./chunk-QTXBII4Z.cjs');
130
+
127
131
 
128
132
 
129
133
 
130
134
 
131
135
 
132
- var _chunkMRMI32SNcjs = require('./chunk-MRMI32SN.cjs');
136
+ var _chunkWEW2JVA4cjs = require('./chunk-WEW2JVA4.cjs');
133
137
 
134
138
 
135
139
 
136
140
 
137
141
 
138
142
 
139
- var _chunk4WQ6PGSJcjs = require('./chunk-4WQ6PGSJ.cjs');
143
+
144
+ var _chunk2ZYGC6SScjs = require('./chunk-2ZYGC6SS.cjs');
140
145
 
141
146
 
142
147
 
@@ -154,12 +159,12 @@ var _chunkVEKFLAQMcjs = require('./chunk-VEKFLAQM.cjs');
154
159
 
155
160
 
156
161
 
157
- var _chunk75X755YZcjs = require('./chunk-75X755YZ.cjs');
162
+ var _chunk34UCJRQOcjs = require('./chunk-34UCJRQO.cjs');
158
163
 
159
164
 
160
165
 
161
166
 
162
- var _chunkB5PFZLKVcjs = require('./chunk-B5PFZLKV.cjs');
167
+ var _chunkEKN7NSZOcjs = require('./chunk-EKN7NSZO.cjs');
163
168
 
164
169
 
165
170
 
@@ -173,7 +178,9 @@ var _chunkOHY2ZWUGcjs = require('./chunk-OHY2ZWUG.cjs');
173
178
 
174
179
 
175
180
 
176
- var _chunkEUV4YR3Vcjs = require('./chunk-EUV4YR3V.cjs');
181
+
182
+
183
+ var _chunkSGBJ247Qcjs = require('./chunk-SGBJ247Q.cjs');
177
184
 
178
185
 
179
186
  var _chunkSDOTRX3Vcjs = require('./chunk-SDOTRX3V.cjs');
@@ -196,10 +203,10 @@ var _chunk6QQDAAAZcjs = require('./chunk-6QQDAAAZ.cjs');
196
203
 
197
204
 
198
205
 
199
- var _chunkUJZLSXUBcjs = require('./chunk-UJZLSXUB.cjs');
206
+ var _chunkVU6AAZVYcjs = require('./chunk-VU6AAZVY.cjs');
200
207
 
201
208
 
202
- var _chunkLPFV45AYcjs = require('./chunk-LPFV45AY.cjs');
209
+ var _chunkKCQBAKIYcjs = require('./chunk-KCQBAKIY.cjs');
203
210
 
204
211
 
205
212
 
@@ -209,7 +216,7 @@ var _chunkM7MKQXAFcjs = require('./chunk-M7MKQXAF.cjs');
209
216
 
210
217
 
211
218
 
212
- var _chunkG2TEB74Scjs = require('./chunk-G2TEB74S.cjs');
219
+ var _chunkZXH4TS3Fcjs = require('./chunk-ZXH4TS3F.cjs');
213
220
 
214
221
 
215
222
  var _chunkUXHS27O6cjs = require('./chunk-UXHS27O6.cjs');
@@ -221,7 +228,7 @@ var _chunk4PPEPOZZcjs = require('./chunk-4PPEPOZZ.cjs');
221
228
  var _chunkMQ3H6LT5cjs = require('./chunk-MQ3H6LT5.cjs');
222
229
 
223
230
 
224
- var _chunkU6MPZ35Qcjs = require('./chunk-U6MPZ35Q.cjs');
231
+ var _chunkRWFLWR5Jcjs = require('./chunk-RWFLWR5J.cjs');
225
232
 
226
233
 
227
234
 
@@ -240,7 +247,7 @@ var _chunkXJXBIP67cjs = require('./chunk-XJXBIP67.cjs');
240
247
  var _chunkLYLEZIG3cjs = require('./chunk-LYLEZIG3.cjs');
241
248
 
242
249
 
243
- var _chunkNDILNQ4Lcjs = require('./chunk-NDILNQ4L.cjs');
250
+ var _chunkXKG2BLFNcjs = require('./chunk-XKG2BLFN.cjs');
244
251
 
245
252
 
246
253
  var _chunk75RZHGLScjs = require('./chunk-75RZHGLS.cjs');
@@ -325,7 +332,7 @@ var _chunkUQZ4AYTHcjs = require('./chunk-UQZ4AYTH.cjs');
325
332
  var _chunkKNBBQHO2cjs = require('./chunk-KNBBQHO2.cjs');
326
333
 
327
334
 
328
- var _chunkNQ6QFZWDcjs = require('./chunk-NQ6QFZWD.cjs');
335
+ var _chunkKKSTAEMYcjs = require('./chunk-KKSTAEMY.cjs');
329
336
 
330
337
 
331
338
 
@@ -363,7 +370,7 @@ var _chunkQBK2AA4Ucjs = require('./chunk-QBK2AA4U.cjs');
363
370
  var _chunkNYJMY3JAcjs = require('./chunk-NYJMY3JA.cjs');
364
371
 
365
372
 
366
- var _chunkADOAUDQ6cjs = require('./chunk-ADOAUDQ6.cjs');
373
+ var _chunkVXEEATVDcjs = require('./chunk-VXEEATVD.cjs');
367
374
 
368
375
 
369
376
  var _chunkYX3DBN4Mcjs = require('./chunk-YX3DBN4M.cjs');
@@ -378,10 +385,12 @@ var _chunkOX6O6WVAcjs = require('./chunk-OX6O6WVA.cjs');
378
385
 
379
386
 
380
387
 
381
- var _chunkNICDYKBScjs = require('./chunk-NICDYKBS.cjs');
388
+
389
+ var _chunk6XWDE2P2cjs = require('./chunk-6XWDE2P2.cjs');
382
390
 
383
391
 
384
- var _chunkOW67PDDScjs = require('./chunk-OW67PDDS.cjs');
392
+
393
+ var _chunkULASELLAcjs = require('./chunk-ULASELLA.cjs');
385
394
 
386
395
 
387
396
 
@@ -2046,8 +2055,8 @@ var _RouteManager = class _RouteManager {
2046
2055
  )
2047
2056
  );
2048
2057
  this.orderedLayouts = Array.from(this.layouts.values()).sort(
2049
- (left, right) => _chunkLOFKRKO7cjs.getRouteDirectoryDepth.call(void 0, left.pattern) - _chunkLOFKRKO7cjs.getRouteDirectoryDepth.call(void 0, right.pattern)
2050
- ).map((entry) => ({ entry, groupScope: _chunkLOFKRKO7cjs.getRouteGroupScope.call(void 0, entry.pattern) }));
2058
+ (left, right) => _chunk2DD4JMQCcjs.getRouteDirectoryDepth.call(void 0, left.pattern) - _chunk2DD4JMQCcjs.getRouteDirectoryDepth.call(void 0, right.pattern)
2059
+ ).map((entry) => ({ entry, groupScope: _chunk2DD4JMQCcjs.getRouteGroupScope.call(void 0, entry.pattern) }));
2051
2060
  for (const slot of this.routeSlots.values()) {
2052
2061
  if (!this.routeSlotOwnerSegments.has(slot.ownerPattern)) {
2053
2062
  this.routeSlotOwnerSegments.set(
@@ -2289,7 +2298,7 @@ var _RouteManager = class _RouteManager {
2289
2298
  }
2290
2299
  return absolutePath;
2291
2300
  }, "toUrlPath");
2292
- const integrationProviders = _chunkUJZLSXUBcjs.getIntegrationProviders.call(void 0, this.config.integrations).filter(
2301
+ const integrationProviders = _chunkVU6AAZVYcjs.getIntegrationProviders.call(void 0, this.config.integrations).filter(
2293
2302
  (provider) => provider.component || provider.type === "clerk"
2294
2303
  );
2295
2304
  const unsupportedIntegrationProvider = integrationProviders.find(
@@ -2328,7 +2337,7 @@ var _RouteManager = class _RouteManager {
2328
2337
  );
2329
2338
  const routeEntries = Array.from(this.routes.values()).map((entry) => ({
2330
2339
  entry,
2331
- metadata: _chunkB5PFZLKVcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? markdownPagePlan() : getClientModuleHydrationPlan(
2340
+ metadata: _chunkEKN7NSZOcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? markdownPagePlan() : getClientModuleHydrationPlan(
2332
2341
  entry.modulePath,
2333
2342
  normalizedProjectRoot,
2334
2343
  isolatedMode,
@@ -2336,7 +2345,7 @@ var _RouteManager = class _RouteManager {
2336
2345
  )
2337
2346
  }));
2338
2347
  const markdownFallback = routeEntries.find(
2339
- ({ entry, metadata }) => _chunkB5PFZLKVcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) && metadata.fallbackReason
2348
+ ({ entry, metadata }) => _chunkEKN7NSZOcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) && metadata.fallbackReason
2340
2349
  );
2341
2350
  if (markdownFallback) {
2342
2351
  _chunk5QIKR7RRcjs.logger.warn(
@@ -2344,7 +2353,7 @@ var _RouteManager = class _RouteManager {
2344
2353
  );
2345
2354
  }
2346
2355
  const markdownStaticPackages = _optionalChain([routeEntries, 'access', _121 => _121.find, 'call', _122 => _122(
2347
- ({ entry, metadata }) => _chunkB5PFZLKVcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) && metadata.staticPackageBoundaries
2356
+ ({ entry, metadata }) => _chunkEKN7NSZOcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) && metadata.staticPackageBoundaries
2348
2357
  ), 'optionalAccess', _123 => _123.metadata, 'access', _124 => _124.staticPackageBoundaries]);
2349
2358
  if (markdownStaticPackages) {
2350
2359
  _chunk5QIKR7RRcjs.logger.info(
@@ -2352,7 +2361,7 @@ var _RouteManager = class _RouteManager {
2352
2361
  );
2353
2362
  }
2354
2363
  for (const { entry, metadata } of [...layoutEntries, ...routeEntries]) {
2355
- if (_chunkB5PFZLKVcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) || !metadata.staticPackageBoundaries) continue;
2364
+ if (_chunkEKN7NSZOcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) || !metadata.staticPackageBoundaries) continue;
2356
2365
  _chunk5QIKR7RRcjs.logger.info(
2357
2366
  `[Farm.js] ${entry.pattern} is async, so it renders client components from ${metadata.staticPackageBoundaries.join(", ")} as static HTML: package client components cannot be isolated yet.`
2358
2367
  );
@@ -2360,15 +2369,15 @@ var _RouteManager = class _RouteManager {
2360
2369
  enforceFarmIsolatedHydrationRouteBudget(
2361
2370
  layoutEntries.map(({ entry, metadata }) => ({
2362
2371
  pattern: entry.pattern,
2363
- depth: _chunkLOFKRKO7cjs.getRouteDirectoryDepth.call(void 0, entry.pattern),
2372
+ depth: _chunk2DD4JMQCcjs.getRouteDirectoryDepth.call(void 0, entry.pattern),
2364
2373
  metadata
2365
2374
  })),
2366
2375
  routeEntries.map(({ entry, metadata }) => ({
2367
2376
  pattern: getRouteEntryDirectory(entry),
2368
- depth: _chunkLOFKRKO7cjs.getRouteDirectoryDepth.call(void 0, getRouteEntryDirectory(entry)),
2377
+ depth: _chunk2DD4JMQCcjs.getRouteDirectoryDepth.call(void 0, getRouteEntryDirectory(entry)),
2369
2378
  metadata
2370
2379
  })),
2371
- _chunkLOFKRKO7cjs.routeBoundaryCoversDirectory
2380
+ _chunk2DD4JMQCcjs.routeBoundaryCoversDirectory
2372
2381
  );
2373
2382
  for (const { entry, metadata } of [...layoutEntries, ...routeEntries]) {
2374
2383
  if (!metadata.costGuardExceeded) continue;
@@ -2387,7 +2396,7 @@ var _RouteManager = class _RouteManager {
2387
2396
  const routes = routeEntries.map(({ entry, metadata }) => {
2388
2397
  const programmaticPage = this.programmaticPages.get(entry.modulePath);
2389
2398
  const layoutShouldHydrate = layoutEntries.some(
2390
- ({ entry: layout, metadata: layoutMetadata }) => layoutMetadata.shouldHydrate && _chunkLOFKRKO7cjs.routeBoundaryCoversDirectory.call(void 0, layout.pattern, getRouteEntryDirectory(entry))
2399
+ ({ entry: layout, metadata: layoutMetadata }) => layoutMetadata.shouldHydrate && _chunk2DD4JMQCcjs.routeBoundaryCoversDirectory.call(void 0, layout.pattern, getRouteEntryDirectory(entry))
2391
2400
  );
2392
2401
  return {
2393
2402
  pattern: entry.pattern,
@@ -2506,13 +2515,13 @@ var _RouteManager = class _RouteManager {
2506
2515
  const { createRouteModuleFromProgrammaticPage } = await import("./routes.cjs");
2507
2516
  return createRouteModuleFromProgrammaticPage(programmaticPage, this.rendererRuntime);
2508
2517
  }
2509
- if (_chunkB5PFZLKVcjs.isFarmMarkdownPageFile.call(void 0, modulePath)) {
2518
+ if (_chunkEKN7NSZOcjs.isFarmMarkdownPageFile.call(void 0, modulePath)) {
2510
2519
  const mdxConfig = _chunkOHY2ZWUGcjs.resolveMdxConfig.call(void 0, this.config.mdx);
2511
- const components = await _chunk75X755YZcjs.loadFarmMdxComponents.call(void 0, mdxConfig, {
2520
+ const components = await _chunk34UCJRQOcjs.loadFarmMdxComponents.call(void 0, mdxConfig, {
2512
2521
  root: this.config.root,
2513
2522
  loadModule: this.viteServer ? (componentModulePath) => _chunkSHLXACIOcjs.loadFarmDevModule.call(void 0, this.viteServer, componentModulePath) : void 0
2514
2523
  });
2515
- return await _chunk75X755YZcjs.createFarmMarkdownRouteModuleFromFile.call(void 0, modulePath, {
2524
+ return await _chunk34UCJRQOcjs.createFarmMarkdownRouteModuleFromFile.call(void 0, modulePath, {
2516
2525
  components,
2517
2526
  config: mdxConfig
2518
2527
  });
@@ -2562,7 +2571,7 @@ var _RouteManager = class _RouteManager {
2562
2571
  */
2563
2572
  createRoutePattern(route) {
2564
2573
  if (route.segments.length === 0) return "/";
2565
- return "/" + route.segments.map(_chunkLOFKRKO7cjs.formatRouteSegment).join("/");
2574
+ return "/" + route.segments.map(_chunk2DD4JMQCcjs.formatRouteSegment).join("/");
2566
2575
  }
2567
2576
  registerPageRoute(entry) {
2568
2577
  _chunkNO3WWW3Ncjs.assertUniqueRouteParameters.call(void 0, entry.pattern);
@@ -2613,8 +2622,8 @@ var _RouteManager = class _RouteManager {
2613
2622
  }
2614
2623
  }
2615
2624
  for (const [pattern, group] of canonicalPageGroups) {
2616
- const componentFiles = group.files.filter((file) => !_chunkB5PFZLKVcjs.isFarmMarkdownPageFile.call(void 0, file));
2617
- const markdownFiles = group.files.filter(_chunkB5PFZLKVcjs.isFarmMarkdownPageFile);
2625
+ const componentFiles = group.files.filter((file) => !_chunkEKN7NSZOcjs.isFarmMarkdownPageFile.call(void 0, file));
2626
+ const markdownFiles = group.files.filter(_chunkEKN7NSZOcjs.isFarmMarkdownPageFile);
2618
2627
  if (componentFiles.length > 1) {
2619
2628
  throw new Error(
2620
2629
  `Duplicate page route "${pattern}". Found ${componentFiles.map((file) => path9.default.join(appDir, file)).join(" and ")}.`
@@ -2656,7 +2665,7 @@ var _RouteManager = class _RouteManager {
2656
2665
  for (const file of files) {
2657
2666
  const route = _chunk5QIKR7RRcjs.parseRoutePath.call(void 0, file);
2658
2667
  const modulePath = path9.default.join(appDir, file);
2659
- const pattern = _chunkLOFKRKO7cjs.createRouteDirectoryPattern.call(void 0, route);
2668
+ const pattern = _chunk2DD4JMQCcjs.createRouteDirectoryPattern.call(void 0, route);
2660
2669
  const existing = target.get(pattern);
2661
2670
  if (_optionalChain([existing, 'optionalAccess', _129 => _129.sourceRoot]) === source.root) {
2662
2671
  throw new Error(
@@ -2678,7 +2687,7 @@ var _RouteManager = class _RouteManager {
2678
2687
  const modulePath = path9.default.join(appDir, file);
2679
2688
  const pattern = this.createRoutePattern(slot.route);
2680
2689
  const ownerPattern = this.createRoutePattern(slot.ownerRoute);
2681
- const ownerDirectory = _chunkLOFKRKO7cjs.createRouteDirectoryPattern.call(void 0, slot.ownerRoute);
2690
+ const ownerDirectory = _chunk2DD4JMQCcjs.createRouteDirectoryPattern.call(void 0, slot.ownerRoute);
2682
2691
  const key = `${ownerPattern}:${slot.name}:${slot.interception ? "intercept" : "slot"}:${slot.fallback ? "default" : pattern}`;
2683
2692
  const existing = this.routeSlots.get(key);
2684
2693
  if (_optionalChain([existing, 'optionalAccess', _130 => _130.sourceRoot]) === source.root) {
@@ -2783,7 +2792,7 @@ var _RouteManager = class _RouteManager {
2783
2792
  }
2784
2793
  if (definition.kind === "layout") {
2785
2794
  const route = _chunk6V4TDWECcjs.parseProgrammaticRoutePath.call(void 0, definition.path, "layout");
2786
- const pattern = _chunkLOFKRKO7cjs.createRouteDirectoryPattern.call(void 0, route);
2795
+ const pattern = _chunk2DD4JMQCcjs.createRouteDirectoryPattern.call(void 0, route);
2787
2796
  const existing = this.layouts.get(pattern);
2788
2797
  if (_optionalChain([existing, 'optionalAccess', _134 => _134.sourceRoot]) === source.root) {
2789
2798
  throw new Error(
@@ -2830,7 +2839,7 @@ var _RouteManager = class _RouteManager {
2830
2839
  const matchingLayouts = [];
2831
2840
  for (const { entry, groupScope } of this.orderedLayouts) {
2832
2841
  if (!_chunk5QIKR7RRcjs.matchRoutePrefixParts.call(void 0, pathnameParts, entry.route.segments)) continue;
2833
- if (groupScope !== null && !_chunkLOFKRKO7cjs.isInRouteGroupScope.call(void 0, route && getRouteEntryDirectory(route), groupScope)) {
2842
+ if (groupScope !== null && !_chunk2DD4JMQCcjs.isInRouteGroupScope.call(void 0, route && getRouteEntryDirectory(route), groupScope)) {
2834
2843
  continue;
2835
2844
  }
2836
2845
  matchingLayouts.push(entry);
@@ -2911,14 +2920,14 @@ var _RouteManager = class _RouteManager {
2911
2920
  let page = route;
2912
2921
  for (const boundaryEntry of boundaries.values()) {
2913
2922
  if (!_chunk5QIKR7RRcjs.matchRoutePrefix.call(void 0, normalizedPath, boundaryEntry.route.segments)) continue;
2914
- const groupScope = _chunkLOFKRKO7cjs.getRouteGroupScope.call(void 0, boundaryEntry.pattern);
2923
+ const groupScope = _chunk2DD4JMQCcjs.getRouteGroupScope.call(void 0, boundaryEntry.pattern);
2915
2924
  if (groupScope !== null) {
2916
2925
  if (page === void 0) page = this.matchPageRoute(_chunk5QIKR7RRcjs.splitRoutePath.call(void 0, normalizedPath));
2917
- if (!_chunkLOFKRKO7cjs.isInRouteGroupScope.call(void 0, page && getRouteEntryDirectory(page), groupScope)) continue;
2926
+ if (!_chunk2DD4JMQCcjs.isInRouteGroupScope.call(void 0, page && getRouteEntryDirectory(page), groupScope)) continue;
2918
2927
  }
2919
2928
  const depth = boundaryEntry.route.segments.length;
2920
2929
  const bestDepth = _nullishCoalesce(_optionalChain([bestMatch, 'optionalAccess', _138 => _138.route, 'access', _139 => _139.segments, 'access', _140 => _140.length]), () => ( -1));
2921
- if (!bestMatch || depth > bestDepth || depth === bestDepth && _chunkLOFKRKO7cjs.getRouteDirectoryDepth.call(void 0, boundaryEntry.pattern) > _chunkLOFKRKO7cjs.getRouteDirectoryDepth.call(void 0, bestMatch.pattern)) {
2930
+ if (!bestMatch || depth > bestDepth || depth === bestDepth && _chunk2DD4JMQCcjs.getRouteDirectoryDepth.call(void 0, boundaryEntry.pattern) > _chunk2DD4JMQCcjs.getRouteDirectoryDepth.call(void 0, bestMatch.pattern)) {
2922
2931
  bestMatch = boundaryEntry;
2923
2932
  }
2924
2933
  }
@@ -3034,7 +3043,7 @@ var _RouteManager = class _RouteManager {
3034
3043
  _chunkS3JO3N4Hcjs.__name.call(void 0, _RouteManager, "RouteManager");
3035
3044
  var RouteManager = _RouteManager;
3036
3045
  function getPageDirectoryField(route, pattern) {
3037
- const directory = _chunkLOFKRKO7cjs.createRouteDirectoryPattern.call(void 0, route);
3046
+ const directory = _chunk2DD4JMQCcjs.createRouteDirectoryPattern.call(void 0, route);
3038
3047
  return directory === pattern ? {} : { directory };
3039
3048
  }
3040
3049
  _chunkS3JO3N4Hcjs.__name.call(void 0, getPageDirectoryField, "getPageDirectoryField");
@@ -4414,7 +4423,7 @@ function generateFarmIntegrationProviderClientCode(providers, root, rendererComp
4414
4423
  let hasClerkProvider = false;
4415
4424
  renderedProviders.forEach((provider, index) => {
4416
4425
  let componentExpression = "null";
4417
- if (_chunkUJZLSXUBcjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) {
4426
+ if (_chunkVU6AAZVYcjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) {
4418
4427
  const namespace = `FarmIntegrationProviderModule${index}`;
4419
4428
  imports.push(
4420
4429
  `import * as ${namespace} from ${JSON.stringify(resolveProviderModule(provider.component.module, root))};`
@@ -4473,7 +4482,7 @@ function generateFarmIntegrationProviderServerModules(providers, root, rendererC
4473
4482
  const entries = [];
4474
4483
  let needsMarkHelper = false;
4475
4484
  providers.forEach((provider, index) => {
4476
- if (!_chunkUJZLSXUBcjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) return;
4485
+ if (!_chunkVU6AAZVYcjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) return;
4477
4486
  const namespace = `FarmServerIntegrationProviderModule${index}`;
4478
4487
  imports.push(
4479
4488
  `import * as ${namespace} from ${JSON.stringify(resolveProviderModule(provider.component.module, root))};`
@@ -4695,7 +4704,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, appendResponseVary, "appendResponseVary");
4695
4704
  function renderI18nAlternateLinks(requestPath, snapshot, options) {
4696
4705
  if (snapshot.routing === "none") return "";
4697
4706
  const url = new URL(requestPath, "http://farm.local");
4698
- return _chunkLOFKRKO7cjs.renderFarmLocaleAlternateLinks.call(void 0, url.pathname, snapshot, options);
4707
+ return _chunk2DD4JMQCcjs.renderFarmLocaleAlternateLinks.call(void 0, url.pathname, snapshot, options);
4699
4708
  }
4700
4709
  _chunkS3JO3N4Hcjs.__name.call(void 0, renderI18nAlternateLinks, "renderI18nAlternateLinks");
4701
4710
  var PPR_REFRESH_MAX_ATTEMPTS = 3;
@@ -4708,6 +4717,11 @@ function createPreHydrationClickQueueScript() {
4708
4717
  return `<script>(function(){if(window.__FARM_PREHYDRATION_CLICK_QUEUE__)return;var queue=[];window.__FARM_PREHYDRATION_CLICK_QUEUE__=queue;window.__FARM_HYDRATED__=false;document.documentElement.dataset.farmHydrated="false";function isModified(event){return !!(event.metaKey||event.altKey||event.ctrlKey||event.shiftKey)}function inHydrated(node){return !!(node&&node.closest&&node.closest('[data-farm-island-hydrated="true"]'))}function closestQueuedTarget(target){while(target&&target!==document.documentElement){if(target.matches&&target.matches(${selector}))return target;target=target.parentElement}return null}function announce(target,kind){document.dispatchEvent(new CustomEvent("farm:island-interaction",{detail:{target:target,kind:kind||null}}))}function hold(event,target,kind){if(!queue.some(function(item){return item.target===target})){queue.push({target:target,kind:kind,createdAt:Date.now()});announce(target,kind)}event.preventDefault();event.stopImmediatePropagation()}document.addEventListener("click",function(event){if(window.__FARM_HYDRATED__)return;if(event.defaultPrevented||event.button!==0||isModified(event))return;var target=closestQueuedTarget(event.target);if(!target||target.closest&&target.closest("a[href]")||inHydrated(target))return;hold(event,target,"click")},true);document.addEventListener("submit",function(event){if(window.__FARM_HYDRATED__)return;if(event.defaultPrevented)return;var form=event.target;if(!form||form.nodeName!=="FORM"||inHydrated(form))return;hold(event,form,"submit")},true);function observe(event){if(window.__FARM_HYDRATED__)return;var target=event.target;if(!(target&&target.closest)||inHydrated(target))return;announce(target,null)}document.addEventListener("pointerdown",observe,true);document.addEventListener("focusin",observe,true);})();</script>`;
4709
4718
  }
4710
4719
  _chunkS3JO3N4Hcjs.__name.call(void 0, createPreHydrationClickQueueScript, "createPreHydrationClickQueueScript");
4720
+ function rendererRenderOptions() {
4721
+ const nonce = _chunkULASELLAcjs._resolveCurrentCspNonce.call(void 0, );
4722
+ return nonce ? { nonce } : void 0;
4723
+ }
4724
+ _chunkS3JO3N4Hcjs.__name.call(void 0, rendererRenderOptions, "rendererRenderOptions");
4711
4725
  function createDocumentFooter(options) {
4712
4726
  return `</div>
4713
4727
  ${options.suspenseRevealFallback}
@@ -4844,7 +4858,7 @@ var _ServerRenderer = class _ServerRenderer {
4844
4858
  this.routeManager = routeManager;
4845
4859
  this.i18nRuntime = i18nRuntime;
4846
4860
  this.viteServer = viteServer;
4847
- this.security = _chunkMRMI32SNcjs.resolveFarmSecurityConfig.call(void 0, config.security);
4861
+ this.security = _chunk2ZYGC6SScjs.resolveFarmSecurityConfig.call(void 0, config.security);
4848
4862
  this.loadSSGManifest();
4849
4863
  }
4850
4864
  async initialize() {
@@ -4961,22 +4975,27 @@ var _ServerRenderer = class _ServerRenderer {
4961
4975
  }
4962
4976
  return this.rendererRuntime.wrapClientGraph(element);
4963
4977
  }
4964
- async renderElementToCompleteHTML(element) {
4978
+ async renderElementToCompleteHTML(element, options = {}) {
4965
4979
  const streaming = _chunkPSV6XKPOcjs.getFarmRendererStreamingCapabilitiesForRuntime.call(void 0, this.config.renderer, "node");
4966
4980
  const renderToPipeableStream = streaming.node ? this.rendererRuntime.renderToPipeableStream : void 0;
4967
4981
  if (renderToPipeableStream) {
4968
4982
  return await new Promise((resolve6, reject) => {
4969
4983
  const chunks = [];
4970
4984
  let started = false;
4985
+ let lateNavigation;
4971
4986
  const writable = new (0, _stream.Writable)({
4972
4987
  write(chunk, _encoding, callback) {
4973
4988
  chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
4974
4989
  callback();
4975
4990
  }
4976
4991
  });
4977
- writable.once("finish", () => resolve6(Buffer.concat(chunks).toString("utf8")));
4992
+ writable.once(
4993
+ "finish",
4994
+ () => lateNavigation === void 0 ? resolve6(Buffer.concat(chunks).toString("utf8")) : reject(lateNavigation)
4995
+ );
4978
4996
  writable.once("error", reject);
4979
4997
  const stream = renderToPipeableStream(element, {
4998
+ nonce: _chunkULASELLAcjs._resolveCurrentCspNonce.call(void 0, ),
4980
4999
  onShellReady() {
4981
5000
  started = true;
4982
5001
  stream.pipe(writable);
@@ -4986,26 +5005,35 @@ var _ServerRenderer = class _ServerRenderer {
4986
5005
  },
4987
5006
  onError(error) {
4988
5007
  if (!started) reject(error);
5008
+ else if (options.rejectLateNavigation && lateNavigation === void 0 && (_chunkOX6O6WVAcjs.isFarmRedirectError.call(void 0, error) || _chunkOX6O6WVAcjs.isFarmNotFoundError.call(void 0, error))) {
5009
+ lateNavigation = error;
5010
+ }
4989
5011
  }
4990
5012
  });
4991
5013
  });
4992
5014
  }
4993
5015
  if (streaming.web && this.rendererRuntime.renderToReadableStream) {
4994
- const stream = await this.rendererRuntime.renderToReadableStream(element);
5016
+ const stream = await this.rendererRuntime.renderToReadableStream(
5017
+ element,
5018
+ rendererRenderOptions()
5019
+ );
4995
5020
  return await _chunkPSV6XKPOcjs.readFarmRendererWebStream.call(void 0, stream);
4996
5021
  }
4997
- return await this.rendererRuntime.renderToString(element);
5022
+ return await this.rendererRuntime.renderToString(element, rendererRenderOptions());
4998
5023
  }
4999
5024
  /**
5000
5025
  * Buffered render carrying document-head markup for renderers that emit it
5001
5026
  * during render (e.g. <svelte:head>). Other renderers return an empty head.
5002
5027
  */
5003
- async renderElementToDocumentParts(element) {
5028
+ async renderElementToDocumentParts(element, options = {}) {
5004
5029
  if (this.rendererRuntime.renderToStringWithHead) {
5005
- const rendered = await this.rendererRuntime.renderToStringWithHead(element);
5030
+ const rendered = await this.rendererRuntime.renderToStringWithHead(
5031
+ element,
5032
+ rendererRenderOptions()
5033
+ );
5006
5034
  return { html: rendered.html, head: rendered.head || "" };
5007
5035
  }
5008
- return { html: await this.renderElementToCompleteHTML(element), head: "" };
5036
+ return { html: await this.renderElementToCompleteHTML(element, options), head: "" };
5009
5037
  }
5010
5038
  /**
5011
5039
  * Render the route tree used by client navigation without producing a second
@@ -5078,7 +5106,7 @@ var _ServerRenderer = class _ServerRenderer {
5078
5106
  return this.renderElementToCompleteHTML(await this.wrapWithIntegrationProviders(element));
5079
5107
  }
5080
5108
  async runWithRequestContext(request2, fn) {
5081
- return _chunkNICDYKBScjs._runWithCurrentRequest.call(void 0,
5109
+ return _chunk6XWDE2P2cjs._runWithCurrentRequest.call(void 0,
5082
5110
  request2,
5083
5111
  () => _optionalChain([this, 'access', _162 => _162.i18nRuntime, 'optionalAccess', _163 => _163.config, 'access', _164 => _164.enabled]) ? _chunkXJXBIP67cjs._runWithFarmI18nRequest.call(void 0, this.i18nRuntime, request2, fn, {
5084
5112
  redirect: false
@@ -5345,13 +5373,13 @@ var _ServerRenderer = class _ServerRenderer {
5345
5373
  if (this.viteServer) await this.applyRendererAppSetup();
5346
5374
  _chunkI57LW5VZcjs.setFarmBasePath.call(void 0, this.config.basePath);
5347
5375
  _chunkOYEUREB6cjs.setFarmTrailingSlashPreference.call(void 0, this.config.trailingSlash);
5348
- const cspNonce = _chunkMRMI32SNcjs.createFarmCspNonce.call(void 0, this.security);
5376
+ const cspNonce = _chunk2ZYGC6SScjs.createFarmCspNonce.call(void 0, this.security);
5349
5377
  if (cspNonce) {
5350
5378
  req.__FARM_CSP_NONCE__ = cspNonce;
5351
- const header = _chunkMRMI32SNcjs.getFarmSecurityHeader.call(void 0, this.security, cspNonce);
5379
+ const header = _chunk2ZYGC6SScjs.getFarmSecurityHeader.call(void 0, this.security, cspNonce);
5352
5380
  res.setHeader(header.key, header.value);
5353
5381
  }
5354
- const request2 = _chunkNICDYKBScjs.createWebRequestFromFarmRequest.call(void 0, req, {
5382
+ const request2 = _chunk6XWDE2P2cjs.createWebRequestFromFarmRequest.call(void 0, req, {
5355
5383
  trustProxy: _optionalChain([this, 'access', _167 => _167.config, 'access', _168 => _168.server, 'optionalAccess', _169 => _169.trustProxy])
5356
5384
  });
5357
5385
  const runtime = this.i18nRuntime;
@@ -5374,7 +5402,10 @@ var _ServerRenderer = class _ServerRenderer {
5374
5402
  return;
5375
5403
  }
5376
5404
  }
5377
- return this.runWithRequestContext(request2, () => this.renderPageInContext(req, res));
5405
+ return _chunk6XWDE2P2cjs._runWithFarmCspNonce.call(void 0,
5406
+ cspNonce,
5407
+ () => this.runWithRequestContext(request2, () => this.renderPageInContext(req, res))
5408
+ );
5378
5409
  }
5379
5410
  async renderPageInContext(req, res) {
5380
5411
  const renderStartTime = Date.now();
@@ -5398,7 +5429,7 @@ var _ServerRenderer = class _ServerRenderer {
5398
5429
  });
5399
5430
  }, "completeRender");
5400
5431
  try {
5401
- const url = _chunkNICDYKBScjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _172 => _172.config, 'access', _173 => _173.server, 'optionalAccess', _174 => _174.trustProxy]) });
5432
+ const url = _chunk6XWDE2P2cjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _172 => _172.config, 'access', _173 => _173.server, 'optionalAccess', _174 => _174.trustProxy]) });
5402
5433
  pathname = url.pathname;
5403
5434
  _chunkE3UK5IIBcjs.emitFarmEvent.call(void 0, { type: "render.start", route: pathname, pathname });
5404
5435
  searchParamsObject = _chunkQNPEUFHQcjs.searchParamsToObject.call(void 0, url.searchParams);
@@ -5461,7 +5492,7 @@ var _ServerRenderer = class _ServerRenderer {
5461
5492
  layouts = match.layouts;
5462
5493
  routeSlots = _nullishCoalesce(match.slots, () => ( []));
5463
5494
  if (!route) {
5464
- if (_chunkPTZ2TVNEcjs.isFarmDefaultMCPPathname.call(void 0, pathname) && this.getDefaultMCPServer()) {
5495
+ if (_chunkH5CLOUZScjs.isFarmDefaultMCPPathname.call(void 0, pathname) && this.getDefaultMCPServer()) {
5465
5496
  await this.renderDefaultMCP(req, res);
5466
5497
  completeRender(res.statusCode || 200, pathname);
5467
5498
  return;
@@ -5484,7 +5515,7 @@ var _ServerRenderer = class _ServerRenderer {
5484
5515
  pluginExposedContext = _chunkKIIMAWOJcjs.getRequestContextSnapshot.call(void 0, req, {
5485
5516
  exposedOnly: true
5486
5517
  });
5487
- const currentRequest = _chunkNICDYKBScjs.createWebRequestFromFarmRequest.call(void 0, req, {
5518
+ const currentRequest = _chunk6XWDE2P2cjs.createWebRequestFromFarmRequest.call(void 0, req, {
5488
5519
  trustProxy: _optionalChain([this, 'access', _175 => _175.config, 'access', _176 => _176.server, 'optionalAccess', _177 => _177.trustProxy])
5489
5520
  });
5490
5521
  const routeContext = await this.resolveRouteContext({
@@ -5599,8 +5630,8 @@ var _ServerRenderer = class _ServerRenderer {
5599
5630
  key: pprCacheKey
5600
5631
  });
5601
5632
  }
5602
- const outerRequest = _chunkOW67PDDScjs._resolveCurrentRequest.call(void 0, );
5603
- const countRequestReads = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => (outerRequest ? _chunkNICDYKBScjs._getRequestReadCount.call(void 0, outerRequest) : 0) + _chunkNICDYKBScjs._getRequestReadCount.call(void 0, currentRequest), "countRequestReads");
5633
+ const outerRequest = _chunkULASELLAcjs._resolveCurrentRequest.call(void 0, );
5634
+ const countRequestReads = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => (outerRequest ? _chunk6XWDE2P2cjs._getRequestReadCount.call(void 0, outerRequest) : 0) + _chunk6XWDE2P2cjs._getRequestReadCount.call(void 0, currentRequest), "countRequestReads");
5604
5635
  const requestReadsBeforeRender = countRequestReads();
5605
5636
  let LoadingFallbackComponent = null;
5606
5637
  if (loadingBoundaryEntry) {
@@ -5782,9 +5813,9 @@ var _ServerRenderer = class _ServerRenderer {
5782
5813
  });
5783
5814
  req.__FARM_METADATA__ = mergedMetadata;
5784
5815
  const middlewareDataForContext = middlewareMap;
5785
- await _chunkG2TEB74Scjs._runWithMiddlewareData.call(void 0, middlewareDataForContext, async () => {
5786
- await _chunkG2TEB74Scjs._runWithMiddlewareContext.call(void 0, middlewareContext, async () => {
5787
- await _chunkNICDYKBScjs._runWithCurrentRequest.call(void 0, currentRequest, async () => {
5816
+ await _chunkZXH4TS3Fcjs._runWithMiddlewareData.call(void 0, middlewareDataForContext, async () => {
5817
+ await _chunkZXH4TS3Fcjs._runWithMiddlewareContext.call(void 0, middlewareContext, async () => {
5818
+ await _chunk6XWDE2P2cjs._runWithCurrentRequest.call(void 0, currentRequest, async () => {
5788
5819
  let pageElement = this.rendererRuntime.createElement(PageComponent, pageProps);
5789
5820
  if (LoadingFallbackComponent) {
5790
5821
  const loadingFallback = this.rendererRuntime.createElement(LoadingFallbackComponent, {
@@ -5871,8 +5902,8 @@ var _ServerRenderer = class _ServerRenderer {
5871
5902
  req,
5872
5903
  res,
5873
5904
  () => {
5874
- _chunkG2TEB74Scjs._clearCurrentMiddlewareData.call(void 0, );
5875
- _chunkG2TEB74Scjs._clearCurrentMiddlewareContext.call(void 0, );
5905
+ _chunkZXH4TS3Fcjs._clearCurrentMiddlewareData.call(void 0, );
5906
+ _chunkZXH4TS3Fcjs._clearCurrentMiddlewareContext.call(void 0, );
5876
5907
  },
5877
5908
  {
5878
5909
  responseHeaders: pprHeaders,
@@ -5962,7 +5993,7 @@ var _ServerRenderer = class _ServerRenderer {
5962
5993
  }
5963
5994
  }
5964
5995
  _chunkE3UK5IIBcjs.emitFarmEvent.call(void 0, { type: "render.error", route: pathname, error });
5965
- const errorStatus = _chunkLOFKRKO7cjs.resolveDefaultErrorStatus.call(void 0, error);
5996
+ const errorStatus = _chunk2DD4JMQCcjs.resolveDefaultErrorStatus.call(void 0, error);
5966
5997
  if (pprRefreshRoute) {
5967
5998
  _chunkE3UK5IIBcjs.emitFarmEvent.call(void 0, {
5968
5999
  type: "ppr.refresh.error",
@@ -5998,7 +6029,7 @@ var _ServerRenderer = class _ServerRenderer {
5998
6029
  }
5999
6030
  }
6000
6031
  async wrapWithIntegrationProviders(element) {
6001
- const providers = _chunkUJZLSXUBcjs.getIntegrationProviders.call(void 0, this.config.integrations);
6032
+ const providers = _chunkVU6AAZVYcjs.getIntegrationProviders.call(void 0, this.config.integrations);
6002
6033
  let wrapped = element;
6003
6034
  for (let i = providers.length - 1; i >= 0; i--) {
6004
6035
  const provider = providers[i];
@@ -6016,7 +6047,7 @@ var _ServerRenderer = class _ServerRenderer {
6016
6047
  }
6017
6048
  let ProviderComponent;
6018
6049
  let providerSourceModule;
6019
- if (_chunkUJZLSXUBcjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) {
6050
+ if (_chunkVU6AAZVYcjs.isFarmIntegrationProviderComponentReference.call(void 0, provider.component)) {
6020
6051
  providerSourceModule = provider.component.module;
6021
6052
  const providerModuleId = provider.component.module.startsWith(".") ? _chunk5QIKR7RRcjs.toViteModuleId.call(void 0,
6022
6053
  path9.resolve(this.config.root, provider.component.module),
@@ -6114,7 +6145,7 @@ var _ServerRenderer = class _ServerRenderer {
6114
6145
  );
6115
6146
  metadata = _chunkEK4QAEFZcjs.addMetadataMarkdownAlternate.call(void 0,
6116
6147
  metadata,
6117
- _chunkEUV4YR3Vcjs.getFarmMarkdownAlternatePath.call(void 0, _chunkEUV4YR3Vcjs.resolveMarkdownConfig.call(void 0, this.config.md), publicPathname)
6148
+ _chunkSGBJ247Qcjs.getFarmMarkdownAlternatePath.call(void 0, _chunkSGBJ247Qcjs.resolveMarkdownConfig.call(void 0, this.config.md), publicPathname)
6118
6149
  );
6119
6150
  return metadata;
6120
6151
  }
@@ -6171,7 +6202,7 @@ var _ServerRenderer = class _ServerRenderer {
6171
6202
  `Metadata route module ${match.metadata.modulePath} does not export a default value or handler`
6172
6203
  );
6173
6204
  }
6174
- const request2 = _chunkNICDYKBScjs.createWebRequestFromFarmRequest.call(void 0, req, {
6205
+ const request2 = _chunk6XWDE2P2cjs.createWebRequestFromFarmRequest.call(void 0, req, {
6175
6206
  trustProxy: _optionalChain([this, 'access', _202 => _202.config, 'access', _203 => _203.server, 'optionalAccess', _204 => _204.trustProxy])
6176
6207
  });
6177
6208
  const url = new URL(request2.url);
@@ -6186,11 +6217,11 @@ var _ServerRenderer = class _ServerRenderer {
6186
6217
  path: match.routePath,
6187
6218
  ...llmsContext
6188
6219
  }) : routeModule.default;
6189
- const body = match.metadata.kind === "llms-full" && !(value instanceof Response) ? await _chunk4WQ6PGSJcjs.renderFarmLlmsFullTxt.call(void 0, value, {
6220
+ const body = match.metadata.kind === "llms-full" && !(value instanceof Response) ? await _chunkWEW2JVA4cjs.renderFarmLlmsFullTxt.call(void 0, value, {
6190
6221
  origin: url.origin,
6191
6222
  readMarkdown: llmsContext.markdown
6192
6223
  }) : value;
6193
- const response = _chunkLOFKRKO7cjs.createFarmMetadataRouteResponse.call(void 0, match.metadata.kind, body, routeModule, {
6224
+ const response = _chunk2DD4JMQCcjs.createFarmMetadataRouteResponse.call(void 0, match.metadata.kind, body, routeModule, {
6194
6225
  method,
6195
6226
  request: request2
6196
6227
  });
@@ -6208,25 +6239,25 @@ var _ServerRenderer = class _ServerRenderer {
6208
6239
  }
6209
6240
  /** `/llms.txt` and `/llms-full.txt` from `agent.llmsTxt` when no file route owns them. */
6210
6241
  getGeneratedLlmsKind(pathname) {
6211
- const config = _chunk4WQ6PGSJcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _205 => _205.config, 'access', _206 => _206.agent, 'optionalAccess', _207 => _207.llmsTxt]));
6242
+ const config = _chunkWEW2JVA4cjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _205 => _205.config, 'access', _206 => _206.agent, 'optionalAccess', _207 => _207.llmsTxt]));
6212
6243
  if (!config.enabled) return null;
6213
6244
  if (pathname === "/llms.txt") return "llms";
6214
6245
  return pathname === "/llms-full.txt" && config.full ? "llms-full" : null;
6215
6246
  }
6216
6247
  async renderGeneratedLlmsTxt(req, res, kind) {
6217
6248
  try {
6218
- const request2 = _chunkNICDYKBScjs.createWebRequestFromFarmRequest.call(void 0, req, {
6249
+ const request2 = _chunk6XWDE2P2cjs.createWebRequestFromFarmRequest.call(void 0, req, {
6219
6250
  trustProxy: _optionalChain([this, 'access', _208 => _208.config, 'access', _209 => _209.server, 'optionalAccess', _210 => _210.trustProxy])
6220
6251
  });
6221
- const config = _chunk4WQ6PGSJcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _211 => _211.config, 'access', _212 => _212.agent, 'optionalAccess', _213 => _213.llmsTxt]));
6252
+ const config = _chunkWEW2JVA4cjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _211 => _211.config, 'access', _212 => _212.agent, 'optionalAccess', _213 => _213.llmsTxt]));
6222
6253
  const context = await this.createLlmsTxtContext(request2, { full: kind === "llms-full", req });
6223
- const body = kind === "llms-full" ? await _chunk4WQ6PGSJcjs.renderFarmLlmsFullTxt.call(void 0, context.defaults, {
6254
+ const body = kind === "llms-full" ? await _chunkWEW2JVA4cjs.renderFarmLlmsFullTxt.call(void 0, context.defaults, {
6224
6255
  origin: new URL(request2.url).origin,
6225
6256
  readMarkdown: context.markdown
6226
6257
  }) : context.defaults;
6227
6258
  await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0,
6228
6259
  res,
6229
- _chunkLOFKRKO7cjs.createFarmMetadataRouteResponse.call(void 0,
6260
+ _chunk2DD4JMQCcjs.createFarmMetadataRouteResponse.call(void 0,
6230
6261
  kind,
6231
6262
  body,
6232
6263
  { revalidate: config.revalidate },
@@ -6245,7 +6276,7 @@ var _ServerRenderer = class _ServerRenderer {
6245
6276
  }
6246
6277
  }
6247
6278
  getAgentCrawlers() {
6248
- return _chunkMRMI32SNcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([this, 'access', _214 => _214.config, 'access', _215 => _215.agent, 'optionalAccess', _216 => _216.crawlers]));
6279
+ return _chunkQTXBII4Zcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([this, 'access', _214 => _214.config, 'access', _215 => _215.agent, 'optionalAccess', _216 => _216.crawlers]));
6249
6280
  }
6250
6281
  /** `/robots.txt` from `agent.crawlers` when no robots.ts owns it. */
6251
6282
  async renderGeneratedRobotsTxt(req, res) {
@@ -6253,7 +6284,7 @@ var _ServerRenderer = class _ServerRenderer {
6253
6284
  const sitemapPath = _optionalChain([this, 'access', _217 => _217.routeManager, 'access', _218 => _218.matchMetadataRoute, 'call', _219 => _219("/sitemap.xml"), 'optionalAccess', _220 => _220.metadata, 'access', _221 => _221.kind]) === "sitemap" || this.getAgentSitemap().enabled ? "/sitemap.xml" : void 0;
6254
6285
  const rootLayout = this.routeManager.getLayouts().get("/");
6255
6286
  const rootMetadata = sitemapPath && rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
6256
- const robots = _chunkMRMI32SNcjs.createFarmAgentRobots.call(void 0, {
6287
+ const robots = _chunkQTXBII4Zcjs.createFarmAgentRobots.call(void 0, {
6257
6288
  crawlers: this.getAgentCrawlers(),
6258
6289
  sitemapPath,
6259
6290
  metadataBase: _optionalChain([rootMetadata, 'optionalAccess', _222 => _222.metadataBase]),
@@ -6261,7 +6292,7 @@ var _ServerRenderer = class _ServerRenderer {
6261
6292
  });
6262
6293
  await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0,
6263
6294
  res,
6264
- _chunkLOFKRKO7cjs.createFarmMetadataRouteResponse.call(void 0, "robots", robots, {}, { method: req.method })
6295
+ _chunk2DD4JMQCcjs.createFarmMetadataRouteResponse.call(void 0, "robots", robots, {}, { method: req.method })
6265
6296
  );
6266
6297
  } catch (error) {
6267
6298
  _chunk5QIKR7RRcjs.logger.error(`Generated robots.txt failed: ${error}`);
@@ -6275,16 +6306,16 @@ var _ServerRenderer = class _ServerRenderer {
6275
6306
  }
6276
6307
  }
6277
6308
  getAgentSitemap() {
6278
- return _chunkMRMI32SNcjs.resolveFarmAgentSitemap.call(void 0, _optionalChain([this, 'access', _223 => _223.config, 'access', _224 => _224.agent, 'optionalAccess', _225 => _225.sitemap]));
6309
+ return _chunkQTXBII4Zcjs.resolveFarmAgentSitemap.call(void 0, _optionalChain([this, 'access', _223 => _223.config, 'access', _224 => _224.agent, 'optionalAccess', _225 => _225.sitemap]));
6279
6310
  }
6280
6311
  /** `/sitemap.xml` from `agent.sitemap` when no sitemap.ts owns it. */
6281
6312
  async renderGeneratedSitemap(req, res) {
6282
6313
  try {
6283
- const request2 = _chunkNICDYKBScjs.createWebRequestFromFarmRequest.call(void 0, req, {
6314
+ const request2 = _chunk6XWDE2P2cjs.createWebRequestFromFarmRequest.call(void 0, req, {
6284
6315
  trustProxy: _optionalChain([this, 'access', _226 => _226.config, 'access', _227 => _227.server, 'optionalAccess', _228 => _228.trustProxy])
6285
6316
  });
6286
6317
  const sources = await Promise.all(
6287
- [...this.routeManager.getRoutes()].filter(([pattern]) => !pattern.includes("[")).map(async ([pattern, route]) => {
6318
+ this.getAgentListedRoutes().map(async ([pattern, route]) => {
6288
6319
  const [module, stat] = await Promise.all([
6289
6320
  this.routeManager.loadRouteModule(route.modulePath).catch((error) => {
6290
6321
  _chunk5QIKR7RRcjs.logger.warn(`Could not read metadata for ${pattern} in sitemap.xml: ${error}`);
@@ -6297,7 +6328,7 @@ var _ServerRenderer = class _ServerRenderer {
6297
6328
  );
6298
6329
  const rootLayout = this.routeManager.getLayouts().get("/");
6299
6330
  const rootMetadata = rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
6300
- const sitemap = _chunkMRMI32SNcjs.createFarmDefaultSitemap.call(void 0, sources, {
6331
+ const sitemap = _chunkQTXBII4Zcjs.createFarmDefaultSitemap.call(void 0, sources, {
6301
6332
  origin: new URL(request2.url).origin,
6302
6333
  config: this.getAgentSitemap(),
6303
6334
  metadataBase: _optionalChain([rootMetadata, 'optionalAccess', _232 => _232.metadataBase]),
@@ -6305,7 +6336,7 @@ var _ServerRenderer = class _ServerRenderer {
6305
6336
  });
6306
6337
  await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0,
6307
6338
  res,
6308
- _chunkLOFKRKO7cjs.createFarmMetadataRouteResponse.call(void 0, "sitemap", sitemap, {}, { method: req.method })
6339
+ _chunk2DD4JMQCcjs.createFarmMetadataRouteResponse.call(void 0, "sitemap", sitemap, {}, { method: req.method })
6309
6340
  );
6310
6341
  } catch (error) {
6311
6342
  _chunk5QIKR7RRcjs.logger.error(`Generated sitemap.xml failed: ${error}`);
@@ -6322,43 +6353,58 @@ var _ServerRenderer = class _ServerRenderer {
6322
6353
  setAPIRouteLookup(exists) {
6323
6354
  this.apiRouteExists = exists;
6324
6355
  }
6356
+ /** The dev server's file middleware, so public page listings can leave guarded pages out. */
6357
+ setMiddlewareRouteLookup(routes) {
6358
+ this.middlewareRoutes = routes;
6359
+ }
6360
+ /**
6361
+ * The static pages sitemap.xml, llms.txt and the default MCP server may list: not one a
6362
+ * path-specific guard (non-root middleware.ts, a config or integration middleware
6363
+ * matcher) covers, as the production build decides.
6364
+ */
6365
+ getAgentListedRoutes() {
6366
+ const guards = { config: this.config, middlewareRoutes: _nullishCoalesce(_optionalChain([this, 'access', _233 => _233.middlewareRoutes, 'optionalCall', _234 => _234()]), () => ( [])) };
6367
+ return [...this.routeManager.getRoutes()].filter(
6368
+ ([pattern]) => !pattern.includes("[") && !_chunk2DD4JMQCcjs.farmPathGuardCoversPage.call(void 0, guards, pattern)
6369
+ );
6370
+ }
6325
6371
  /**
6326
6372
  * The default read-only MCP server (`agent.mcp`), or undefined when the app has an MCP
6327
6373
  * server of its own: a route that answers /mcp, an API route at /api/mcp, `@farm.js/mcp`,
6328
6374
  * or a registered server such as the docs engine's. Production applies the same rules.
6329
6375
  */
6330
6376
  getDefaultMCPServer() {
6331
- if (_optionalChain([this, 'access', _233 => _233.config, 'access', _234 => _234.agent, 'optionalAccess', _235 => _235.mcp]) !== true || _chunkPTZ2TVNEcjs.farmConfigMountsMCP.call(void 0, this.config)) return void 0;
6332
- if (_optionalChain([this, 'access', _236 => _236.apiRouteExists, 'optionalCall', _237 => _237("/api/mcp")])) return void 0;
6333
- if (this.routeManager.matchRoute(_chunkPTZ2TVNEcjs.FARM_DEFAULT_MCP_PATH).route) return void 0;
6334
- _nullishCoalesce(this.defaultMCPServer, () => ( (this.defaultMCPServer = _chunkPTZ2TVNEcjs.createFarmDefaultMCPServer.call(void 0,
6377
+ if (_optionalChain([this, 'access', _235 => _235.config, 'access', _236 => _236.agent, 'optionalAccess', _237 => _237.mcp]) !== true || _chunkH5CLOUZScjs.farmConfigMountsMCP.call(void 0, this.config)) return void 0;
6378
+ if (_optionalChain([this, 'access', _238 => _238.apiRouteExists, 'optionalCall', _239 => _239("/api/mcp")])) return void 0;
6379
+ if (this.routeManager.matchRoute(_chunkH5CLOUZScjs.FARM_DEFAULT_MCP_PATH).route) return void 0;
6380
+ _nullishCoalesce(this.defaultMCPServer, () => ( (this.defaultMCPServer = _chunkH5CLOUZScjs.createFarmDefaultMCPServer.call(void 0,
6335
6381
  readAppPackageIdentity(this.config.root),
6336
- _chunkNQ6QFZWDcjs.FARM_VERSION
6382
+ _chunkKKSTAEMYcjs.FARM_VERSION
6337
6383
  ))));
6338
- return _chunkPTZ2TVNEcjs.resolveFarmDefaultMCPServer.call(void 0, this.defaultMCPServer);
6384
+ return _chunkH5CLOUZScjs.resolveFarmDefaultMCPServer.call(void 0, this.defaultMCPServer);
6339
6385
  }
6340
6386
  async renderDefaultMCP(req, res) {
6341
6387
  const server = this.getDefaultMCPServer();
6342
- const request2 = _nullishCoalesce(_chunkNICDYKBScjs.getCurrentRequestOrNull.call(void 0, ), () => ( _chunkNICDYKBScjs.createWebRequestFromFarmRequest.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _238 => _238.config, 'access', _239 => _239.server, 'optionalAccess', _240 => _240.trustProxy]) })));
6388
+ const request2 = _nullishCoalesce(_chunk6XWDE2P2cjs.getCurrentRequestOrNull.call(void 0, ), () => ( _chunk6XWDE2P2cjs.createWebRequestFromFarmRequest.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _240 => _240.config, 'access', _241 => _241.server, 'optionalAccess', _242 => _242.trustProxy]) })));
6343
6389
  try {
6344
- const { handleFarmDefaultMCPRequest } = await import("./agent-mcp-handler-SJAHFSPI.cjs");
6390
+ const { handleFarmDefaultMCPRequest } = await import("./agent-mcp-handler-MRGP3WJ3.cjs");
6345
6391
  const origin = new URL(request2.url).origin;
6346
6392
  const response = await handleFarmDefaultMCPRequest(request2, {
6347
6393
  server,
6348
6394
  basePath: this.config.basePath,
6349
6395
  listPages: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async () => {
6350
6396
  const sources = await Promise.all(
6351
- [...this.routeManager.getRoutes()].filter(([pattern]) => !pattern.includes("[")).map(async ([pattern, route]) => ({
6397
+ this.getAgentListedRoutes().map(async ([pattern, route]) => ({
6352
6398
  pattern,
6353
6399
  // The page itself surfaces a load error. Without its module a guard cannot
6354
6400
  // be ruled out, so the page is left out.
6355
6401
  module: await this.routeManager.loadRouteModule(route.modulePath).catch(() => ({ __farmRouteGuard: true }))
6356
6402
  }))
6357
6403
  );
6358
- return _chunkPTZ2TVNEcjs.collectFarmDefaultMCPPages.call(void 0, sources, {
6404
+ return _chunkH5CLOUZScjs.collectFarmDefaultMCPPages.call(void 0, sources, {
6359
6405
  origin,
6360
6406
  basePath: this.config.basePath,
6361
- markdown: _chunkEUV4YR3Vcjs.resolveMarkdownConfig.call(void 0, this.config.md)
6407
+ markdown: _chunkSGBJ247Qcjs.resolveMarkdownConfig.call(void 0, this.config.md)
6362
6408
  });
6363
6409
  }, "listPages"),
6364
6410
  // Pages are read through this server's own socket, with no cookies, as llms-full.txt does.
@@ -6382,16 +6428,14 @@ var _ServerRenderer = class _ServerRenderer {
6382
6428
  }
6383
6429
  /** Same inputs the production server gives llms.txt: static pages and root metadata. */
6384
6430
  async createLlmsTxtContext(request2, options = {}) {
6385
- const config = _chunk4WQ6PGSJcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _241 => _241.config, 'access', _242 => _242.agent, 'optionalAccess', _243 => _243.llmsTxt]));
6431
+ const config = _chunkWEW2JVA4cjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _243 => _243.config, 'access', _244 => _244.agent, 'optionalAccess', _245 => _245.llmsTxt]));
6386
6432
  const origin = new URL(request2.url).origin;
6387
- const staticRoutes = [...this.routeManager.getRoutes()].filter(
6388
- ([pattern]) => !pattern.includes("[")
6389
- );
6390
6433
  const sources = await Promise.all(
6391
- staticRoutes.map(async ([pattern, route]) => {
6434
+ this.getAgentListedRoutes().map(async ([pattern, route]) => {
6392
6435
  try {
6393
- const metadata = (await this.routeManager.loadRouteModule(route.modulePath)).metadata;
6394
- return { pattern, metadata };
6436
+ const module = await this.routeManager.loadRouteModule(route.modulePath);
6437
+ if (module.__farmRouteGuard) return null;
6438
+ return { pattern, metadata: module.metadata };
6395
6439
  } catch (error) {
6396
6440
  _chunk5QIKR7RRcjs.logger.warn(`Could not read metadata for ${pattern} in llms.txt: ${error}`);
6397
6441
  return { pattern };
@@ -6400,21 +6444,24 @@ var _ServerRenderer = class _ServerRenderer {
6400
6444
  );
6401
6445
  const rootLayout = this.routeManager.getLayouts().get("/");
6402
6446
  const rootMetadata = rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
6403
- const pages = _chunk4WQ6PGSJcjs.collectFarmLlmsTxtPages.call(void 0, sources, {
6404
- origin,
6405
- basePath: this.config.basePath,
6406
- markdown: _chunkEUV4YR3Vcjs.resolveMarkdownConfig.call(void 0, this.config.md),
6407
- include: config.include,
6408
- exclude: config.exclude
6409
- });
6447
+ const pages = _chunkWEW2JVA4cjs.collectFarmLlmsTxtPages.call(void 0,
6448
+ sources.filter((source) => source !== null),
6449
+ {
6450
+ origin,
6451
+ basePath: this.config.basePath,
6452
+ markdown: _chunkSGBJ247Qcjs.resolveMarkdownConfig.call(void 0, this.config.md),
6453
+ include: config.include,
6454
+ exclude: config.exclude
6455
+ }
6456
+ );
6410
6457
  return {
6411
6458
  pages,
6412
- defaults: _chunk4WQ6PGSJcjs.createFarmDefaultLlmsTxt.call(void 0, {
6459
+ defaults: _chunkWEW2JVA4cjs.createFarmDefaultLlmsTxt.call(void 0, {
6413
6460
  origin,
6414
6461
  pages,
6415
6462
  config,
6416
6463
  rootMetadata,
6417
- mcp: _optionalChain([this, 'access', _244 => _244.config, 'access', _245 => _245.agent, 'optionalAccess', _246 => _246.aiCatalog]) === false ? [] : _chunkLOFKRKO7cjs.listFarmMCPLlmsTxtLinks.call(void 0, origin, {
6464
+ mcp: _optionalChain([this, 'access', _246 => _246.config, 'access', _247 => _247.agent, 'optionalAccess', _248 => _248.aiCatalog]) === false ? [] : _chunk2DD4JMQCcjs.listFarmMCPLlmsTxtLinks.call(void 0, origin, {
6418
6465
  basePath: this.config.basePath,
6419
6466
  apiServerBasePath: _chunkKNBBQHO2cjs.resolveFarmAPIServerBasePath.call(void 0,
6420
6467
  _chunkS3A45T7Fcjs.normalizeFarmAPIConfig.call(void 0,
@@ -6437,17 +6484,17 @@ var _ServerRenderer = class _ServerRenderer {
6437
6484
  * body is discarded.
6438
6485
  */
6439
6486
  createDevMarkdownReader(req) {
6440
- const socket = _optionalChain([req, 'optionalAccess', _247 => _247.socket]);
6441
- if (_optionalChain([req, 'optionalAccess', _248 => _248.method, 'optionalAccess', _249 => _249.toUpperCase, 'call', _250 => _250()]) === "HEAD" || !_optionalChain([socket, 'optionalAccess', _251 => _251.localAddress]) || !socket.localPort) {
6487
+ const socket = _optionalChain([req, 'optionalAccess', _249 => _249.socket]);
6488
+ if (_optionalChain([req, 'optionalAccess', _250 => _250.method, 'optionalAccess', _251 => _251.toUpperCase, 'call', _252 => _252()]) === "HEAD" || !_optionalChain([socket, 'optionalAccess', _253 => _253.localAddress]) || !socket.localPort) {
6442
6489
  return async () => null;
6443
6490
  }
6444
6491
  if (socket.encrypted) {
6445
6492
  const address = { host: socket.localAddress, port: socket.localPort };
6446
- return _chunk4WQ6PGSJcjs.createFarmLlmsMarkdownReader.call(void 0, (page) => requestOwnHttpsServer(page, address));
6493
+ return _chunkWEW2JVA4cjs.createFarmLlmsMarkdownReader.call(void 0, (page) => requestOwnHttpsServer(page, address));
6447
6494
  }
6448
6495
  const host = socket.localAddress.includes(":") ? `[${socket.localAddress}]` : socket.localAddress;
6449
6496
  const localOrigin = `http://${host}:${socket.localPort}`;
6450
- const read = _chunk4WQ6PGSJcjs.createFarmLlmsMarkdownReader.call(void 0, (page) => fetch(page));
6497
+ const read = _chunkWEW2JVA4cjs.createFarmLlmsMarkdownReader.call(void 0, (page) => fetch(page));
6451
6498
  return (url) => {
6452
6499
  const target = new URL(url);
6453
6500
  return read(`${localOrigin}${target.pathname}${target.search}`);
@@ -6502,8 +6549,8 @@ var _ServerRenderer = class _ServerRenderer {
6502
6549
  return;
6503
6550
  }
6504
6551
  const etag = `"${image.staticInfo.hash}"`;
6505
- const requestUrl = _chunkNICDYKBScjs.resolveFarmRequestURL.call(void 0, req, {
6506
- trustProxy: _optionalChain([this, 'access', _252 => _252.config, 'access', _253 => _253.server, 'optionalAccess', _254 => _254.trustProxy])
6552
+ const requestUrl = _chunk6XWDE2P2cjs.resolveFarmRequestURL.call(void 0, req, {
6553
+ trustProxy: _optionalChain([this, 'access', _254 => _254.config, 'access', _255 => _255.server, 'optionalAccess', _256 => _256.trustProxy])
6507
6554
  });
6508
6555
  const isVersioned = requestUrl.searchParams.get("v") === image.staticInfo.hash;
6509
6556
  res.setHeader("Content-Type", image.staticInfo.contentType);
@@ -6564,11 +6611,11 @@ var _ServerRenderer = class _ServerRenderer {
6564
6611
  });
6565
6612
  }
6566
6613
  wrapped = await this.wrapWithIntegrationProviders(wrapped);
6567
- const html = await _chunkG2TEB74Scjs._runWithMiddlewareData.call(void 0,
6614
+ const html = await _chunkZXH4TS3Fcjs._runWithMiddlewareData.call(void 0,
6568
6615
  options.middlewareMap,
6569
- () => _chunkG2TEB74Scjs._runWithMiddlewareContext.call(void 0,
6616
+ () => _chunkZXH4TS3Fcjs._runWithMiddlewareContext.call(void 0,
6570
6617
  options.middlewareContext,
6571
- () => this.rendererRuntime.renderToString(wrapped)
6618
+ () => this.rendererRuntime.renderToString(wrapped, rendererRenderOptions())
6572
6619
  )
6573
6620
  );
6574
6621
  res.statusCode = options.statusCode;
@@ -6658,7 +6705,8 @@ var _ServerRenderer = class _ServerRenderer {
6658
6705
  const pagePath = req.__FARM_PAGE_PATH__;
6659
6706
  const relativePath = pagePath ? _chunk5QIKR7RRcjs.toViteModuleId.call(void 0, pagePath, this.config.root) : "/src/app/page.tsx";
6660
6707
  const deploymentId = this.getDeploymentId();
6661
- const bootstrapScript = `<script data-farm-refresh-state>
6708
+ const farmScripts = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (markup) => this.stampFarmScripts(req, markup), "farmScripts");
6709
+ const bootstrapScript = farmScripts(`<script data-farm-refresh-state>
6662
6710
  window.__FARM_PROPS__ = ${serializeInlineValue(deferredProps.data.page)};
6663
6711
  window.__FARM_ROUTE_SLOTS__ = ${serializeInlineValue(deferredProps.data.slots)};
6664
6712
  window.__FARM_DEPLOYMENT_ID__ = ${serializeInlineValue(deploymentId)};
@@ -6675,12 +6723,25 @@ window.__FARM_ISLAND_STRATEGY__ = ${JSON.stringify(req.__FARM_ISLAND_STRATEGY__
6675
6723
  window.__FARM_PAGE_MODULE__ = ${JSON.stringify(relativePath)};
6676
6724
  window.__FARM_LOADING_MODULE__ = ${JSON.stringify(req.__FARM_LOADING_MODULE_PATH__ || null)};
6677
6725
  window.__FARM_MANIFEST__ = ${JSON.stringify(clientManifest)};
6678
- window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkUJZLSXUBcjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
6726
+ window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkVU6AAZVYcjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
6679
6727
  window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0, ) ? serializeInlineValue(_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0, )) : "null"};
6680
- </script>`;
6681
- const deferredScript = createDeferredHydrationScript(deferredProps.records);
6682
- const rendererHydrationScript = _optionalChain([this, 'access', _255 => _255.rendererRuntime, 'access', _256 => _256.generateHydrationScript, 'optionalCall', _257 => _257()]) || "";
6683
- const { html: content, head: rendererHead } = await this.renderElementToDocumentParts(element);
6728
+ </script>`);
6729
+ const deferredScript = farmScripts(createDeferredHydrationScript(deferredProps.records));
6730
+ const rendererHydrationScript = farmScripts(
6731
+ _optionalChain([this, 'access', _257 => _257.rendererRuntime, 'access', _258 => _258.generateHydrationScript, 'optionalCall', _259 => _259()]) || ""
6732
+ );
6733
+ const viteClientScript = farmScripts(`<script type="module" src="/@vite/client"></script>`);
6734
+ const farmClientScript = farmScripts(
6735
+ `<script type="module" src="/@farm/client.js"></script>`
6736
+ );
6737
+ const { html: content, head: rendererHead } = await this.renderElementToDocumentParts(
6738
+ element,
6739
+ {
6740
+ rejectLateNavigation: _chunkSGBJ247Qcjs._isFarmMarkdownPageCheck.call(void 0,
6741
+ _optionalChain([req, 'access', _260 => _260.headers, 'optionalAccess', _261 => _261[_chunkSGBJ247Qcjs.FARM_MARKDOWN_PAGE_CHECK_HEADER]])
6742
+ )
6743
+ }
6744
+ );
6684
6745
  const {
6685
6746
  title,
6686
6747
  tags: metaTags,
@@ -6689,7 +6750,7 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
6689
6750
  viewport: viewportTags
6690
6751
  } = _chunkEK4QAEFZcjs.renderMetadataHead.call(void 0, req.__FARM_METADATA__, {
6691
6752
  pathname: getFarmMetadataPathname(req),
6692
- jsonLd: _optionalChain([this, 'access', _258 => _258.config, 'access', _259 => _259.agent, 'optionalAccess', _260 => _260.jsonLd])
6753
+ jsonLd: _optionalChain([this, 'access', _262 => _262.config, 'access', _263 => _263.agent, 'optionalAccess', _264 => _264.jsonLd])
6693
6754
  });
6694
6755
  const documentTitleTag = !hasExplicitTitle && /<title[\s>]/i.test(rendererHead) ? "" : `<title>${title}</title>`;
6695
6756
  const rendererHasTitle = /<title[\s>]/i.test(rendererHead);
@@ -6699,18 +6760,19 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
6699
6760
  i18nSnapshot,
6700
6761
  this.getI18nAlternateOptions(req, req.__FARM_METADATA__)
6701
6762
  ) : "";
6702
- const themeDocument = _chunkLOFKRKO7cjs.createFarmThemeDocumentParts.call(void 0,
6763
+ const themeDocument = _chunk2DD4JMQCcjs.createFarmThemeDocumentParts.call(void 0,
6703
6764
  this.config.theme,
6704
6765
  this.config.basePath,
6705
- _chunk4GPOC4LNcjs.getTheme.call(void 0, )
6766
+ _chunk472NCAZ7cjs.getTheme.call(void 0, )
6706
6767
  );
6707
- const fullDocument = _chunkLOFKRKO7cjs.extractFarmFullDocument.call(void 0, content);
6768
+ themeDocument.head = farmScripts(themeDocument.head);
6769
+ const fullDocument = _chunk2DD4JMQCcjs.extractFarmFullDocument.call(void 0, content);
6708
6770
  let html;
6709
6771
  if (fullDocument) {
6710
6772
  const shouldReplaceLayoutTitle = hasExplicitTitle || rendererHasTitle;
6711
- const documentHtml = shouldReplaceLayoutTitle ? _chunkLOFKRKO7cjs.removeFarmDocumentTitles.call(void 0, fullDocument) : fullDocument;
6712
- const effectiveRendererHead = hasExplicitTitle ? _chunkLOFKRKO7cjs.removeFarmDocumentTitles.call(void 0, rendererHead) : rendererHead;
6713
- html = _chunkLOFKRKO7cjs.composeFarmFullDocument.call(void 0, documentHtml, {
6773
+ const documentHtml = shouldReplaceLayoutTitle ? _chunk2DD4JMQCcjs.removeFarmDocumentTitles.call(void 0, fullDocument) : fullDocument;
6774
+ const effectiveRendererHead = hasExplicitTitle ? _chunk2DD4JMQCcjs.removeFarmDocumentTitles.call(void 0, rendererHead) : rendererHead;
6775
+ html = _chunk2DD4JMQCcjs.composeFarmFullDocument.call(void 0, documentHtml, {
6714
6776
  fallbackIcon: !hasFavicon,
6715
6777
  viewport: viewportTags,
6716
6778
  htmlAttributes: `${i18nSnapshot ? ` lang="${escapeHtmlAttribute2(i18nSnapshot.locale)}" dir="${escapeHtmlAttribute2(i18nSnapshot.direction)}"` : ""}${themeDocument.attributes}`,
@@ -6728,15 +6790,15 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
6728
6790
  renderFarmFontDevHead(this.config.root || process.cwd()),
6729
6791
  this.devGlobalStylesheetLink(),
6730
6792
  ...this.collectDevStyleLinks(),
6731
- `<script type="module" src="/@vite/client"></script>`,
6793
+ viteClientScript,
6732
6794
  rendererHydrationScript,
6733
6795
  bootstrapScript
6734
6796
  ].filter(Boolean).join("\n "),
6735
- bodyFooter: [deferredScript, `<script type="module" src="/@farm/client.js"></script>`].filter(Boolean).join("\n ")
6797
+ bodyFooter: [deferredScript, farmClientScript].filter(Boolean).join("\n ")
6736
6798
  });
6737
6799
  } else {
6738
6800
  html = `<!DOCTYPE html>
6739
- <html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _261 => _261.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
6801
+ <html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _265 => _265.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
6740
6802
  <head>
6741
6803
  ${themeDocument.head}
6742
6804
  <meta charset="utf-8">
@@ -6748,14 +6810,14 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
6748
6810
  ${renderFarmFontDevHead(this.config.root || process.cwd())}
6749
6811
  ${this.devGlobalStylesheetLink()}${this.collectDevStyleLinks().map((l) => `
6750
6812
  ${l}`).join("")}
6751
- <script type="module" src="/@vite/client"></script>
6813
+ ${viteClientScript}
6752
6814
  ${rendererHydrationScript}
6753
6815
  ${bootstrapScript}
6754
6816
  </head>
6755
6817
  <body class="">
6756
6818
  <div id="root">${content}</div>
6757
6819
  ${deferredScript}
6758
- <script type="module" src="/@farm/client.js"></script>
6820
+ ${farmClientScript}
6759
6821
  </body>
6760
6822
  </html>`;
6761
6823
  }
@@ -6767,7 +6829,7 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
6767
6829
  const securedHtml = this.secureDocumentHTML(req, html);
6768
6830
  if ((req.method || "GET").toUpperCase() !== "HEAD") res.write(securedHtml);
6769
6831
  res.end();
6770
- if (!options.captureStaticShell) await _optionalChain([options, 'access', _262 => _262.onComplete, 'optionalCall', _263 => _263(securedHtml)]);
6832
+ if (!options.captureStaticShell) await _optionalChain([options, 'access', _266 => _266.onComplete, 'optionalCall', _267 => _267(securedHtml)]);
6771
6833
  _chunkE3UK5IIBcjs.emitFarmEvent.call(void 0, {
6772
6834
  type: "render.stream.complete",
6773
6835
  route,
@@ -6777,7 +6839,7 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
6777
6839
  _chunkE3UK5IIBcjs.emitFarmEvent.call(void 0, { type: "render.error", route, error });
6778
6840
  throw error;
6779
6841
  } finally {
6780
- _optionalChain([clearMiddlewareData, 'optionalCall', _264 => _264()]);
6842
+ _optionalChain([clearMiddlewareData, 'optionalCall', _268 => _268()]);
6781
6843
  }
6782
6844
  }
6783
6845
  /**
@@ -6792,7 +6854,7 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
6792
6854
  if (!rootLayout) return false;
6793
6855
  try {
6794
6856
  const Layout = (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).default;
6795
- if (typeof Layout !== "function" || _optionalChain([Layout, 'access', _265 => _265.prototype, 'optionalAccess', _266 => _266.isReactComponent]) || _optionalChain([Layout, 'access', _267 => _267.constructor, 'optionalAccess', _268 => _268.name]) === "AsyncFunction") {
6857
+ if (typeof Layout !== "function" || _optionalChain([Layout, 'access', _269 => _269.prototype, 'optionalAccess', _270 => _270.isReactComponent]) || _optionalChain([Layout, 'access', _271 => _271.constructor, 'optionalAccess', _272 => _272.name]) === "AsyncFunction") {
6796
6858
  return false;
6797
6859
  }
6798
6860
  const cached = documentLayouts.get(Layout);
@@ -6816,7 +6878,7 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
6816
6878
  async renderWithSSR(element, req, res, clearMiddlewareData, options = {}) {
6817
6879
  const renderToPipeableStream = this.rendererRuntime.renderToPipeableStream;
6818
6880
  const fullDocumentRouteKey = options.observabilityRoute || req.__FARM_ROUTE__ || req.url || "/";
6819
- if (!renderToPipeableStream || fullDocumentRoutes.has(fullDocumentRouteKey) || await this.rootLayoutRendersDocument()) {
6881
+ if (!renderToPipeableStream || _chunkSGBJ247Qcjs._isFarmMarkdownPageCheck.call(void 0, _optionalChain([req, 'access', _273 => _273.headers, 'optionalAccess', _274 => _274[_chunkSGBJ247Qcjs.FARM_MARKDOWN_PAGE_CHECK_HEADER]])) || fullDocumentRoutes.has(fullDocumentRouteKey) || await this.rootLayoutRendersDocument()) {
6820
6882
  return this.renderBufferedSSR(element, req, res, clearMiddlewareData, options);
6821
6883
  }
6822
6884
  return new Promise((resolve6, reject) => {
@@ -6918,7 +6980,7 @@ window.__FARM_LOADING_MODULE__ = ${JSON.stringify(
6918
6980
  req.__FARM_LOADING_MODULE_PATH__ || null
6919
6981
  )};
6920
6982
  window.__FARM_MANIFEST__ = ${JSON.stringify(clientManifest)};
6921
- window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkUJZLSXUBcjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
6983
+ window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkVU6AAZVYcjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
6922
6984
  window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0, ) ? serializeInlineValue(_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0, )) : "null"};
6923
6985
  </script>`;
6924
6986
  const hydrationClickQueueScript = isClientComponent || req.__FARM_SHOULD_HYDRATE__ === true || req.__FARM_HAS_HYDRATABLE_ROUTE_SLOTS__ === true ? createPreHydrationClickQueueScript() : "";
@@ -6929,7 +6991,7 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
6929
6991
  viewport: viewportTags
6930
6992
  } = _chunkEK4QAEFZcjs.renderMetadataHead.call(void 0, req.__FARM_METADATA__, {
6931
6993
  pathname: getFarmMetadataPathname(req),
6932
- jsonLd: _optionalChain([this, 'access', _269 => _269.config, 'access', _270 => _270.agent, 'optionalAccess', _271 => _271.jsonLd])
6994
+ jsonLd: _optionalChain([this, 'access', _275 => _275.config, 'access', _276 => _276.agent, 'optionalAccess', _277 => _277.jsonLd])
6933
6995
  });
6934
6996
  const i18nSnapshot = _chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0, );
6935
6997
  const i18nAlternateTags = i18nSnapshot ? renderI18nAlternateLinks(
@@ -6938,22 +7000,23 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
6938
7000
  this.getI18nAlternateOptions(req, req.__FARM_METADATA__)
6939
7001
  ) : "";
6940
7002
  const fontHead = renderFarmFontDevHead(this.config.root || process.cwd());
6941
- const themeDocument = _chunkLOFKRKO7cjs.createFarmThemeDocumentParts.call(void 0,
7003
+ const themeDocument = _chunk2DD4JMQCcjs.createFarmThemeDocumentParts.call(void 0,
6942
7004
  this.config.theme,
6943
7005
  this.config.basePath,
6944
- _chunk4GPOC4LNcjs.getTheme.call(void 0, )
7006
+ _chunk472NCAZ7cjs.getTheme.call(void 0, )
6945
7007
  );
6946
7008
  const streamRoot = req.__FARM_LAYOUT_SHOULD_HYDRATE__ === true ? element : this.rendererRuntime.createElement("div", { style: { display: "contents" } }, element);
6947
7009
  const devStyleLinks = this.collectDevStyleLinks();
6948
7010
  const globalStylesheetLink = this.devGlobalStylesheetLink(true);
6949
7011
  const cspNonce = this.getCspNonce(req);
6950
- const secureDocumentHTML = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (html) => cspNonce ? _chunkMRMI32SNcjs.addFarmCspNonceToScriptTags.call(void 0, html, cspNonce) : html, "secureDocumentHTML");
7012
+ const stampDocumentHTML = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (html) => _chunk2ZYGC6SScjs.stampFarmCspNonce.call(void 0, html, cspNonce || ""), "stampDocumentHTML");
7013
+ const filterDocumentHTML = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (html) => cspNonce ? _chunk2ZYGC6SScjs.filterFarmCspNonces.call(void 0, html, cspNonce) : html, "filterDocumentHTML");
6951
7014
  const createLateNavigationRecovery = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (navigationError) => this.createLateNavigationRecoveryHTML(req, navigationError), "createLateNavigationRecovery");
6952
7015
  const { pipe, abort } = renderToPipeableStream(streamRoot, {
6953
7016
  nonce: cspNonce,
6954
7017
  onShellReady() {
6955
7018
  if (pendingNavigationError) {
6956
- _optionalChain([abort, 'optionalCall', _272 => _272(pendingNavigationError)]);
7019
+ _optionalChain([abort, 'optionalCall', _278 => _278(pendingNavigationError)]);
6957
7020
  if (clearMiddlewareData) {
6958
7021
  clearMiddlewareData();
6959
7022
  }
@@ -6971,7 +7034,7 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
6971
7034
  console.log(`[FARM STREAM] onShellReady at ${shellReadyMs}ms`);
6972
7035
  }
6973
7036
  const shell = `<!DOCTYPE html>
6974
- <html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _273 => _273.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
7037
+ <html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _279 => _279.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
6975
7038
  <head>
6976
7039
  ${themeDocument.head}
6977
7040
  <meta charset="utf-8">
@@ -6988,19 +7051,19 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
6988
7051
  </head>
6989
7052
  <body class="">
6990
7053
  <div id="root">`;
6991
- const securedShell = secureDocumentHTML(shell);
7054
+ const securedShell = stampDocumentHTML(shell);
6992
7055
  htmlParts.push(securedShell);
6993
- _optionalChain([staticShellParts, 'optionalAccess', _274 => _274.push, 'call', _275 => _275(securedShell)]);
7056
+ _optionalChain([staticShellParts, 'optionalAccess', _280 => _280.push, 'call', _281 => _281(securedShell)]);
6994
7057
  let firstChunk = true;
6995
7058
  let checkedFullDocument = false;
6996
7059
  let documentPrefix = "";
6997
- const cspNonceRewriter = cspNonce ? _chunkMRMI32SNcjs.createFarmCspNonceRewriter.call(void 0, cspNonce) : void 0;
7060
+ const cspNonceRewriter = cspNonce ? _chunk2ZYGC6SScjs.createFarmCspNonceRewriter.call(void 0, cspNonce) : void 0;
6998
7061
  const cspStreamDecoder = cspNonceRewriter ? new TextDecoder() : void 0;
6999
7062
  const recordRenderedChunk = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (chunkText) => {
7000
7063
  if (!chunkText) return;
7001
7064
  if (!checkedFullDocument) {
7002
7065
  documentPrefix += chunkText;
7003
- const prefix = _chunkLOFKRKO7cjs.classifyFarmDocumentPrefix.call(void 0, documentPrefix);
7066
+ const prefix = _chunk2DD4JMQCcjs.classifyFarmDocumentPrefix.call(void 0, documentPrefix);
7004
7067
  if (prefix !== "pending") {
7005
7068
  checkedFullDocument = true;
7006
7069
  documentPrefix = "";
@@ -7017,7 +7080,7 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
7017
7080
  staticShellClosed = true;
7018
7081
  if (!suspenseHoleEmitted) {
7019
7082
  suspenseHoleEmitted = true;
7020
- _optionalChain([options, 'access', _276 => _276.onSuspenseHoleDetected, 'optionalCall', _277 => _277()]);
7083
+ _optionalChain([options, 'access', _282 => _282.onSuspenseHoleDetected, 'optionalCall', _283 => _283()]);
7021
7084
  }
7022
7085
  } else {
7023
7086
  staticShellParts.push(chunkText);
@@ -7046,7 +7109,7 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
7046
7109
  lateNavigationError = null;
7047
7110
  createLateNavigationRecovery(navigationError).then(
7048
7111
  (recovery) => {
7049
- const secured = secureDocumentHTML(recovery);
7112
+ const secured = filterDocumentHTML(recovery);
7050
7113
  htmlParts.push(secured);
7051
7114
  res.write(secured);
7052
7115
  finishStream(callback);
@@ -7068,7 +7131,7 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
7068
7131
  if (tail) res.write(tail);
7069
7132
  }
7070
7133
  const suspenseRevealFallback = `<script>(function(){function moveFragment(srcId,placeholderId){var src=document.getElementById(srcId),ph=document.getElementById(placeholderId);if(!src||!ph||!ph.parentNode)return false;while(src.firstChild)ph.parentNode.insertBefore(src.firstChild,ph);ph.parentNode.removeChild(ph);if(src.parentNode)src.parentNode.removeChild(src);return true}function revealBoundary(boundaryId,sectionId){var boundary=document.getElementById(boundaryId),section=document.getElementById(sectionId);if(!boundary||!section||!boundary.parentNode)return false;var start=boundary.previousSibling;if(!start||start.nodeType!==8)return false;var parent=boundary.parentNode;var node=boundary;var depth=0;while(node){if(node.nodeType===8){var data=node.data;if(data==="/$"||data==="/&"){if(depth===0)break;depth--;}else if(data==="$"||data==="$?"||data==="$~"||data==="$!"||data==="&"){depth++;}}var next=node.nextSibling;parent.removeChild(node);node=next;}while(section.firstChild)parent.insertBefore(section.firstChild,node);if(section.parentNode)section.parentNode.removeChild(section);start.data="$";return true}var tries=0;var timer=setInterval(function(){var changed=false;document.querySelectorAll('div[id^="S:"]').forEach(function(section){var suffix=section.id.slice(2);changed=moveFragment('S:'+suffix,'P:'+suffix)||changed;});document.querySelectorAll('template[id^="B:"]').forEach(function(boundary){var suffix=boundary.id.slice(2);changed=revealBoundary('B:'+suffix,'S:'+suffix)||changed;});tries++;if(tries>80||(!document.querySelector('template[id^="B:"]')&&!document.querySelector('template[id^="P:"]'))){clearInterval(timer);}},50);})();</script>`;
7071
- const footer = secureDocumentHTML(
7134
+ const footer = stampDocumentHTML(
7072
7135
  createDocumentFooter({
7073
7136
  suspenseRevealFallback,
7074
7137
  deferredHydrationScript: createDeferredHydrationScript(deferredProps.records)
@@ -7174,7 +7237,7 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
7174
7237
  return await this.routeManager.loadRouteModule(notFoundPath);
7175
7238
  }
7176
7239
  async loadNotFoundComponent() {
7177
- return await _asyncNullishCoalesce(await _asyncOptionalChain([(await this.loadNotFoundModule()), 'optionalAccess', async _278 => _278.default]), async () => ( null));
7240
+ return await _asyncNullishCoalesce(await _asyncOptionalChain([(await this.loadNotFoundModule()), 'optionalAccess', async _284 => _284.default]), async () => ( null));
7178
7241
  }
7179
7242
  /** The not-found document's head: layout and not-found metadata, as production renders it. */
7180
7243
  async notFoundMetadataHead(layoutModule, notFoundModule) {
@@ -7197,10 +7260,13 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
7197
7260
  */
7198
7261
  async createLateNavigationRecoveryHTML(req, error) {
7199
7262
  if (_chunkOX6O6WVAcjs.isFarmRedirectError.call(void 0, error)) {
7200
- return _chunkLOFKRKO7cjs.createLateRedirectRecovery.call(void 0, this.localizeRedirectUrl(_chunkOX6O6WVAcjs.getFarmRedirectError.call(void 0, error).url));
7263
+ return _chunk2DD4JMQCcjs.createLateRedirectRecovery.call(void 0,
7264
+ this.localizeRedirectUrl(_chunkOX6O6WVAcjs.getFarmRedirectError.call(void 0, error).url),
7265
+ this.getCspNonce(req) || ""
7266
+ );
7201
7267
  }
7202
- const pathname = _chunkNICDYKBScjs.resolveFarmRequestURL.call(void 0, req, {
7203
- trustProxy: _optionalChain([this, 'access', _279 => _279.config, 'access', _280 => _280.server, 'optionalAccess', _281 => _281.trustProxy])
7268
+ const pathname = _chunk6XWDE2P2cjs.resolveFarmRequestURL.call(void 0, req, {
7269
+ trustProxy: _optionalChain([this, 'access', _285 => _285.config, 'access', _286 => _286.server, 'optionalAccess', _287 => _287.trustProxy])
7204
7270
  }).pathname;
7205
7271
  let content = this.defaultNotFoundContent();
7206
7272
  const NotFoundComponent = await this.loadNotFoundComponent();
@@ -7209,26 +7275,27 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
7209
7275
  content = await this.rendererRuntime.renderToString(
7210
7276
  await this.wrapWithIntegrationProviders(
7211
7277
  this.rendererRuntime.createElement(NotFoundComponent, { pathname })
7212
- )
7278
+ ),
7279
+ rendererRenderOptions()
7213
7280
  );
7214
7281
  } catch (error2) {
7215
7282
  _chunk5QIKR7RRcjs.logger.warn(`not-found page could not render outside its layout, using Farm's: ${error2}`);
7216
7283
  }
7217
7284
  }
7218
- return _chunkLOFKRKO7cjs.createLateNotFoundRecovery.call(void 0, content);
7285
+ return _chunk2DD4JMQCcjs.createLateNotFoundRecovery.call(void 0, content, this.getCspNonce(req) || "");
7219
7286
  }
7220
7287
  async render404(req, res) {
7221
7288
  res.statusCode = 404;
7222
- const pathname = _chunkNICDYKBScjs.resolveFarmRequestURL.call(void 0, req, {
7223
- trustProxy: _optionalChain([this, 'access', _282 => _282.config, 'access', _283 => _283.server, 'optionalAccess', _284 => _284.trustProxy])
7289
+ const pathname = _chunk6XWDE2P2cjs.resolveFarmRequestURL.call(void 0, req, {
7290
+ trustProxy: _optionalChain([this, 'access', _288 => _288.config, 'access', _289 => _289.server, 'optionalAccess', _290 => _290.trustProxy])
7224
7291
  }).pathname;
7225
7292
  const acceptHeader = req.headers.accept;
7226
7293
  const accept = Array.isArray(acceptHeader) ? acceptHeader.join(",") : acceptHeader;
7227
- if (_chunkEUV4YR3Vcjs.farmRequestWantsMarkdown.call(void 0, pathname, accept)) {
7228
- res.setHeader("Content-Type", _chunkEUV4YR3Vcjs.FARM_MARKDOWN_CONTENT_TYPE);
7294
+ if (_chunkSGBJ247Qcjs.farmRequestWantsMarkdown.call(void 0, pathname, accept)) {
7295
+ res.setHeader("Content-Type", _chunkSGBJ247Qcjs.FARM_MARKDOWN_CONTENT_TYPE);
7229
7296
  res.setHeader("X-Farm-Markdown-Error", "404");
7230
7297
  res.setHeader("Cache-Control", "no-store");
7231
- res.end(_chunkEUV4YR3Vcjs.createFarmMarkdownErrorBody.call(void 0, 404, pathname, this.config.basePath || "/"));
7298
+ res.end(_chunkSGBJ247Qcjs.createFarmMarkdownErrorBody.call(void 0, 404, pathname, this.config.basePath || "/"));
7232
7299
  return;
7233
7300
  }
7234
7301
  const appDir = path9.join(this.config.root, this.config.srcDir, "app");
@@ -7248,9 +7315,9 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
7248
7315
  );
7249
7316
  if (notFoundPath) {
7250
7317
  const notFoundModule = await this.loadNotFoundModule();
7251
- const NotFoundComponent = _nullishCoalesce(_optionalChain([notFoundModule, 'optionalAccess', _285 => _285.default]), () => ( null));
7318
+ const NotFoundComponent = _nullishCoalesce(_optionalChain([notFoundModule, 'optionalAccess', _291 => _291.default]), () => ( null));
7252
7319
  if (NotFoundComponent) {
7253
- const LayoutComponent = _nullishCoalesce(_optionalChain([layoutModule, 'optionalAccess', _286 => _286.default]), () => ( null));
7320
+ const LayoutComponent = _nullishCoalesce(_optionalChain([layoutModule, 'optionalAccess', _292 => _292.default]), () => ( null));
7254
7321
  let element = this.rendererRuntime.createElement(NotFoundComponent, { pathname });
7255
7322
  if (LayoutComponent) {
7256
7323
  element = this.rendererRuntime.createElement(LayoutComponent, {
@@ -7258,7 +7325,10 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
7258
7325
  });
7259
7326
  }
7260
7327
  element = await this.wrapWithIntegrationProviders(element);
7261
- const content = await this.rendererRuntime.renderToString(element);
7328
+ const content = await this.rendererRuntime.renderToString(
7329
+ element,
7330
+ rendererRenderOptions()
7331
+ );
7262
7332
  const { head: head2, metadata: metadata2 } = await this.notFoundMetadataHead(layoutModule, notFoundModule);
7263
7333
  const html2 = this.createFullHTML(content, false, pathname, head2, { req, metadata: metadata2 });
7264
7334
  res.setHeader("Content-Type", "text/html; charset=utf-8");
@@ -7286,25 +7356,28 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
7286
7356
  }
7287
7357
  res.statusCode = statusCode;
7288
7358
  const isDev = process.env.NODE_ENV === "development";
7289
- const requestUrl = _chunkNICDYKBScjs.resolveFarmRequestURL.call(void 0, req, {
7290
- trustProxy: _optionalChain([this, 'access', _287 => _287.config, 'access', _288 => _288.server, 'optionalAccess', _289 => _289.trustProxy])
7359
+ const requestUrl = _chunk6XWDE2P2cjs.resolveFarmRequestURL.call(void 0, req, {
7360
+ trustProxy: _optionalChain([this, 'access', _293 => _293.config, 'access', _294 => _294.server, 'optionalAccess', _295 => _295.trustProxy])
7291
7361
  });
7292
7362
  const diagnostics = isDev ? createDefaultErrorDiagnostics(error, this.config.root || process.cwd()) : void 0;
7293
- const statusText = _chunkLOFKRKO7cjs.getDefaultErrorStatusText.call(void 0, statusCode);
7294
- const content = _chunkLOFKRKO7cjs.createDefaultErrorMarkup.call(void 0, {
7295
- statusCode,
7296
- statusText,
7297
- requestPath: requestUrl.pathname,
7298
- method: req.method || "GET",
7299
- message: _optionalChain([diagnostics, 'optionalAccess', _290 => _290.message]),
7300
- errorName: _optionalChain([diagnostics, 'optionalAccess', _291 => _291.name]),
7301
- stack: _optionalChain([diagnostics, 'optionalAccess', _292 => _292.stack]),
7302
- sourceFrame: _optionalChain([diagnostics, 'optionalAccess', _293 => _293.sourceFrame]),
7303
- development: isDev,
7304
- farmVersion: _chunkNQ6QFZWDcjs.FARM_VERSION,
7305
- nodeVersion: process.version,
7306
- mode: isDev ? "development" : "production"
7307
- });
7363
+ const statusText = _chunk2DD4JMQCcjs.getDefaultErrorStatusText.call(void 0, statusCode);
7364
+ const content = this.stampFarmScripts(
7365
+ req,
7366
+ _chunk2DD4JMQCcjs.createDefaultErrorMarkup.call(void 0, {
7367
+ statusCode,
7368
+ statusText,
7369
+ requestPath: requestUrl.pathname,
7370
+ method: req.method || "GET",
7371
+ message: _optionalChain([diagnostics, 'optionalAccess', _296 => _296.message]),
7372
+ errorName: _optionalChain([diagnostics, 'optionalAccess', _297 => _297.name]),
7373
+ stack: _optionalChain([diagnostics, 'optionalAccess', _298 => _298.stack]),
7374
+ sourceFrame: _optionalChain([diagnostics, 'optionalAccess', _299 => _299.sourceFrame]),
7375
+ development: isDev,
7376
+ farmVersion: _chunkKKSTAEMYcjs.FARM_VERSION,
7377
+ nodeVersion: process.version,
7378
+ mode: isDev ? "development" : "production"
7379
+ })
7380
+ );
7308
7381
  const html = this.createFullHTML(
7309
7382
  content,
7310
7383
  false,
@@ -7326,35 +7399,40 @@ window.__FARM_I18N__ = ${_chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0
7326
7399
  */
7327
7400
  getI18nAlternateOptions(req, metadata) {
7328
7401
  return {
7329
- metadataBase: _optionalChain([metadata, 'optionalAccess', _294 => _294.metadataBase]),
7330
- origin: req ? _chunkNICDYKBScjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _295 => _295.config, 'access', _296 => _296.server, 'optionalAccess', _297 => _297.trustProxy]) }).origin : void 0
7402
+ metadataBase: _optionalChain([metadata, 'optionalAccess', _300 => _300.metadataBase]),
7403
+ origin: req ? _chunk6XWDE2P2cjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _301 => _301.config, 'access', _302 => _302.server, 'optionalAccess', _303 => _303.trustProxy]) }).origin : void 0
7331
7404
  };
7332
7405
  }
7333
7406
  createFullHTML(content, isClientComponent = false, requestPath = "/", metadataHead, alternates = {}) {
7334
7407
  const i18nSnapshot = _chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0, );
7335
- const clientScript = isClientComponent ? ` <script type="module" src="/@farm/client.js"></script>` : "";
7336
- const integrationManifestScript = `<script>
7408
+ const farmScripts = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (html) => this.stampFarmScripts(alternates.req, html), "farmScripts");
7409
+ const clientScript = isClientComponent ? ` ${farmScripts(`<script type="module" src="/@farm/client.js"></script>`)}` : "";
7410
+ const viteClientScript = farmScripts(`<script type="module" src="/@vite/client"></script>`);
7411
+ const integrationManifestScript = farmScripts(`<script>
7337
7412
  window.__FARM_DEPLOYMENT_ID__ = ${serializeInlineValue(this.getDeploymentId())};
7338
- window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkUJZLSXUBcjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
7413
+ window.__FARM_INTEGRATION_API_MANIFEST__ = ${JSON.stringify(_chunkVU6AAZVYcjs.getRegisteredIntegrationAPIManifest.call(void 0, ))};
7339
7414
  ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};` : ""}
7340
- </script>`;
7415
+ </script>`);
7341
7416
  const alternateLinks = i18nSnapshot ? renderI18nAlternateLinks(
7342
7417
  requestPath,
7343
7418
  i18nSnapshot,
7344
7419
  this.getI18nAlternateOptions(alternates.req, alternates.metadata)
7345
7420
  ) : "";
7346
7421
  const fontHead = renderFarmFontDevHead(this.config.root || process.cwd());
7347
- const themeDocument = _chunkLOFKRKO7cjs.createFarmThemeDocumentParts.call(void 0,
7422
+ const themeDocument = _chunk2DD4JMQCcjs.createFarmThemeDocumentParts.call(void 0,
7348
7423
  this.config.theme,
7349
7424
  this.config.basePath,
7350
- _chunk4GPOC4LNcjs.getTheme.call(void 0, )
7425
+ _chunk472NCAZ7cjs.getTheme.call(void 0, )
7351
7426
  );
7352
- const rendererHydrationScript = _optionalChain([this, 'access', _298 => _298.rendererRuntime, 'access', _299 => _299.generateHydrationScript, 'optionalCall', _300 => _300()]) || "";
7353
- const viewportTags = _chunkEK4QAEFZcjs.renderViewportHead.call(void 0, _optionalChain([alternates, 'access', _301 => _301.metadata, 'optionalAccess', _302 => _302.viewport]));
7354
- const fullDocument = _chunkLOFKRKO7cjs.extractFarmFullDocument.call(void 0, content);
7427
+ themeDocument.head = farmScripts(themeDocument.head);
7428
+ const rendererHydrationScript = farmScripts(
7429
+ _optionalChain([this, 'access', _304 => _304.rendererRuntime, 'access', _305 => _305.generateHydrationScript, 'optionalCall', _306 => _306()]) || ""
7430
+ );
7431
+ const viewportTags = _chunkEK4QAEFZcjs.renderViewportHead.call(void 0, _optionalChain([alternates, 'access', _307 => _307.metadata, 'optionalAccess', _308 => _308.viewport]));
7432
+ const fullDocument = _chunk2DD4JMQCcjs.extractFarmFullDocument.call(void 0, content);
7355
7433
  if (fullDocument) {
7356
- return _chunkLOFKRKO7cjs.composeFarmFullDocument.call(void 0,
7357
- metadataHead ? _chunkLOFKRKO7cjs.removeFarmDocumentTitles.call(void 0, fullDocument) : fullDocument,
7434
+ return _chunk2DD4JMQCcjs.composeFarmFullDocument.call(void 0,
7435
+ metadataHead ? _chunk2DD4JMQCcjs.removeFarmDocumentTitles.call(void 0, fullDocument) : fullDocument,
7358
7436
  {
7359
7437
  fallbackIcon: !metadataHead,
7360
7438
  viewport: viewportTags,
@@ -7371,7 +7449,7 @@ ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};`
7371
7449
  fontHead,
7372
7450
  this.devGlobalStylesheetLink(true),
7373
7451
  ...this.collectDevStyleLinks(),
7374
- `<script type="module" src="/@vite/client"></script>`,
7452
+ viteClientScript,
7375
7453
  rendererHydrationScript,
7376
7454
  integrationManifestScript
7377
7455
  ].filter(Boolean).join("\n "),
@@ -7380,7 +7458,7 @@ ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};`
7380
7458
  );
7381
7459
  }
7382
7460
  return `<!DOCTYPE html>
7383
- <html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _303 => _303.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
7461
+ <html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _309 => _309.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
7384
7462
  <head>
7385
7463
  ${themeDocument.head}
7386
7464
  <meta charset="utf-8">
@@ -7390,7 +7468,7 @@ ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};`
7390
7468
  ${fontHead}
7391
7469
  ${this.devGlobalStylesheetLink(true)}${this.collectDevStyleLinks().map((l) => `
7392
7470
  ${l}`).join("")}
7393
- <script type="module" src="/@vite/client"></script>
7471
+ ${viteClientScript}
7394
7472
  ${rendererHydrationScript}
7395
7473
  ${integrationManifestScript}
7396
7474
  </head>
@@ -7404,16 +7482,25 @@ ${clientScript}
7404
7482
  const value = req.__FARM_CSP_NONCE__;
7405
7483
  return typeof value === "string" ? value : void 0;
7406
7484
  }
7485
+ /** Stamp the response nonce on markup Farm generates (never on rendered app output). */
7486
+ stampFarmScripts(req, html) {
7487
+ return _chunk2ZYGC6SScjs.stampFarmCspNonce.call(void 0, html, req && this.getCspNonce(req) || "");
7488
+ }
7489
+ /**
7490
+ * The last pass over a document that holds rendered app output: scripts
7491
+ * keep the response nonce only when Farm or the app (through getCspNonce())
7492
+ * gave it to them.
7493
+ */
7407
7494
  secureDocumentHTML(req, html) {
7408
7495
  const nonce = this.getCspNonce(req);
7409
- return nonce ? _chunkMRMI32SNcjs.addFarmCspNonceToScriptTags.call(void 0, html, nonce) : html;
7496
+ return nonce ? _chunk2ZYGC6SScjs.filterFarmCspNonces.call(void 0, html, nonce) : html;
7410
7497
  }
7411
7498
  applyDeploymentHeaders(req, res) {
7412
7499
  const deploymentId = this.getDeploymentId();
7413
7500
  res.setHeader(_chunkC5GUTBZKcjs.FARM_DEPLOYMENT_ID_HEADER, deploymentId);
7414
7501
  if ((req.method || "GET").toUpperCase() !== "GET") return;
7415
7502
  const forwardedProto = req.headers["x-forwarded-proto"];
7416
- const isSecure = _optionalChain([(Array.isArray(forwardedProto) ? forwardedProto[0] : forwardedProto), 'optionalAccess', _304 => _304.split, 'call', _305 => _305(","), 'access', _306 => _306[0], 'optionalAccess', _307 => _307.trim, 'call', _308 => _308()]) === "https" || Boolean(_optionalChain([req, 'access', _309 => _309.socket, 'optionalAccess', _310 => _310.encrypted]));
7503
+ const isSecure = _optionalChain([(Array.isArray(forwardedProto) ? forwardedProto[0] : forwardedProto), 'optionalAccess', _310 => _310.split, 'call', _311 => _311(","), 'access', _312 => _312[0], 'optionalAccess', _313 => _313.trim, 'call', _314 => _314()]) === "https" || Boolean(_optionalChain([req, 'access', _315 => _315.socket, 'optionalAccess', _316 => _316.encrypted]));
7417
7504
  const cookie = _chunkC5GUTBZKcjs.createFarmDeploymentCookie.call(void 0, deploymentId, this.config.basePath || "/", isSecure);
7418
7505
  const existing = res.getHeader("Set-Cookie");
7419
7506
  if (Array.isArray(existing)) {
@@ -7446,7 +7533,7 @@ var _FarmApp = class _FarmApp {
7446
7533
  constructor(config = {}, viteServer) {
7447
7534
  this.config = this.normalizeConfig(config);
7448
7535
  _chunkE3UK5IIBcjs.configureFarmObservability.call(void 0, this.config.observability);
7449
- _chunk4GPOC4LNcjs._setDefaultFarmThemeConfig.call(void 0, this.config.theme);
7536
+ _chunk472NCAZ7cjs._setDefaultFarmThemeConfig.call(void 0, this.config.theme);
7450
7537
  this.i18nRuntime = _chunkXJXBIP67cjs.createFarmI18nRuntime.call(void 0, this.config.i18n);
7451
7538
  _chunkXJXBIP67cjs._setDefaultFarmI18nRuntime.call(void 0, this.i18nRuntime);
7452
7539
  this.viteServer = viteServer;
@@ -7514,9 +7601,9 @@ var _FarmApp = class _FarmApp {
7514
7601
  context: config.context || (() => void 0),
7515
7602
  server: _chunkKIIMAWOJcjs.resolveFarmServerConfig.call(void 0, config.server),
7516
7603
  serverActions: _chunkT5OJPTVNcjs.resolveServerActionsConfig.call(void 0, config.serverActions),
7517
- security: _chunkMRMI32SNcjs.resolveFarmSecurityConfig.call(void 0, config.security),
7604
+ security: _chunk2ZYGC6SScjs.resolveFarmSecurityConfig.call(void 0, config.security),
7518
7605
  images: _chunkYFPGHF5Fcjs.resolveFarmImageConfig.call(void 0, config.images),
7519
- performance: _chunkMRMI32SNcjs.resolveFarmPerformanceConfig.call(void 0, config.performance),
7606
+ performance: _chunkQTXBII4Zcjs.resolveFarmPerformanceConfig.call(void 0, config.performance),
7520
7607
  theme: _chunkOI6CMLWXcjs.resolveFarmThemeConfig.call(void 0, config.theme, basePath),
7521
7608
  i18n: isResolvedI18nConfig(config.i18n) ? config.i18n : _chunkHLJ6MBUZcjs.resolveFarmI18nConfig.call(void 0, config.i18n, {
7522
7609
  root,
@@ -7528,7 +7615,7 @@ var _FarmApp = class _FarmApp {
7528
7615
  serverRuntimeConfig: config.serverRuntimeConfig || {},
7529
7616
  publicRuntimeConfig: config.publicRuntimeConfig || {},
7530
7617
  docs: isResolvedDocsConfig(config.docs) ? config.docs : defaultDocsConfig,
7531
- md: _chunkEUV4YR3Vcjs.resolveMarkdownConfig.call(void 0, config.md),
7618
+ md: _chunkSGBJ247Qcjs.resolveMarkdownConfig.call(void 0, config.md),
7532
7619
  mdx: _chunkOHY2ZWUGcjs.resolveMdxConfig.call(void 0, config.mdx),
7533
7620
  observability: _nullishCoalesce(config.observability, () => ( false)),
7534
7621
  telemetry: config.telemetry !== false,
@@ -7544,10 +7631,10 @@ var _FarmApp = class _FarmApp {
7544
7631
  env: config.env || { server: {}, public: {} },
7545
7632
  suppressLintOnLink: _nullishCoalesce(config.suppressLintOnLink, () => ( false)),
7546
7633
  experimental: {
7547
- serverComponents: _nullishCoalesce(_optionalChain([config, 'access', _311 => _311.experimental, 'optionalAccess', _312 => _312.serverComponents]), () => ( false)),
7548
- serverActions: _nullishCoalesce(_optionalChain([config, 'access', _313 => _313.experimental, 'optionalAccess', _314 => _314.serverActions]), () => ( false)),
7549
- isolatedClientHydration: _nullishCoalesce(_optionalChain([config, 'access', _315 => _315.experimental, 'optionalAccess', _316 => _316.isolatedClientHydration]), () => ( "off")),
7550
- ppr: _nullishCoalesce(_optionalChain([config, 'access', _317 => _317.experimental, 'optionalAccess', _318 => _318.ppr]), () => ( false)),
7634
+ serverComponents: _nullishCoalesce(_optionalChain([config, 'access', _317 => _317.experimental, 'optionalAccess', _318 => _318.serverComponents]), () => ( false)),
7635
+ serverActions: _nullishCoalesce(_optionalChain([config, 'access', _319 => _319.experimental, 'optionalAccess', _320 => _320.serverActions]), () => ( false)),
7636
+ isolatedClientHydration: _nullishCoalesce(_optionalChain([config, 'access', _321 => _321.experimental, 'optionalAccess', _322 => _322.isolatedClientHydration]), () => ( "off")),
7637
+ ppr: _nullishCoalesce(_optionalChain([config, 'access', _323 => _323.experimental, 'optionalAccess', _324 => _324.ppr]), () => ( false)),
7551
7638
  ...config.experimental
7552
7639
  },
7553
7640
  agent: _nullishCoalesce(config.agent, () => ( {})),
@@ -7598,7 +7685,7 @@ function isResolvedAuthConfig(value) {
7598
7685
  }
7599
7686
  _chunkS3JO3N4Hcjs.__name.call(void 0, isResolvedAuthConfig, "isResolvedAuthConfig");
7600
7687
  function normalizeFarmAppAPIConfig(config) {
7601
- if (typeof _optionalChain([config, 'optionalAccess', _319 => _319.baseURL]) === "function" || typeof _optionalChain([config, 'optionalAccess', _320 => _320.basePath]) === "function") {
7688
+ if (typeof _optionalChain([config, 'optionalAccess', _325 => _325.baseURL]) === "function" || typeof _optionalChain([config, 'optionalAccess', _326 => _326.basePath]) === "function") {
7602
7689
  throw new Error(
7603
7690
  "Farm API config resolver functions must be processed with resolveConfig() before creating a FarmApp."
7604
7691
  );
@@ -7624,7 +7711,7 @@ function adaptPluginOption(pluginOption) {
7624
7711
  if (Array.isArray(pluginOption)) return pluginOption.map(adaptPluginOption);
7625
7712
  if (!pluginOption || typeof pluginOption !== "object") return pluginOption;
7626
7713
  const plugin = pluginOption;
7627
- if (!_optionalChain([plugin, 'access', _321 => _321.name, 'optionalAccess', _322 => _322.startsWith, 'call', _323 => _323("@tailwindcss/vite:generate:")])) return pluginOption;
7714
+ if (!_optionalChain([plugin, 'access', _327 => _327.name, 'optionalAccess', _328 => _328.startsWith, 'call', _329 => _329("@tailwindcss/vite:generate:")])) return pluginOption;
7628
7715
  if (isVitePluginHook(plugin.transform)) {
7629
7716
  return {
7630
7717
  ...plugin,
@@ -7710,7 +7797,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, createMissingTailwindPlugin, "createMissin
7710
7797
  var SHARP_INSTALL_HINT = _chunkLYLEZIG3cjs.formatOptionalPeerInstallHint.call(void 0, "sharp", "optimize images");
7711
7798
  var CLOUDFLARE_IMAGE_PRESETS = /* @__PURE__ */ new Set(["cloudflare", "cloudflare-pages", "cloudflare-module"]);
7712
7799
  function resolveFarmImageProviderForRuntime(images, options) {
7713
- const provider = _nullishCoalesce(_optionalChain([images, 'optionalAccess', _324 => _324.provider]), () => ( "auto"));
7800
+ const provider = _nullishCoalesce(_optionalChain([images, 'optionalAccess', _330 => _330.provider]), () => ( "auto"));
7714
7801
  if (provider === "none") return images;
7715
7802
  const usesSharp = options.dev ? true : provider === "node" || provider === "auto" && !CLOUDFLARE_IMAGE_PRESETS.has(options.preset || "");
7716
7803
  if (!usesSharp || _chunkLYLEZIG3cjs.isOptionalPeerInstalled.call(void 0, options.root, "sharp")) return images;
@@ -7735,7 +7822,7 @@ function validateSchemaSteps(owner, schema, steps) {
7735
7822
  const models = _chunkJSROZYYOcjs.resolveSchemaModels.call(void 0, owner, schema);
7736
7823
  const ids = /* @__PURE__ */ new Set();
7737
7824
  for (const step of steps) {
7738
- const where = `${owner} migration "${_optionalChain([step, 'optionalAccess', _325 => _325.id])}"`;
7825
+ const where = `${owner} migration "${_optionalChain([step, 'optionalAccess', _331 => _331.id])}"`;
7739
7826
  if (!step || typeof step.id !== "string" || step.id.trim() === "") {
7740
7827
  throw new TypeError(`${owner}: every migration step needs a non-empty \`id\`.`);
7741
7828
  }
@@ -7824,7 +7911,7 @@ ${lines.join("\n")}`);
7824
7911
  _chunkS3JO3N4Hcjs.__name.call(void 0, _FarmPluginOptionsError, "FarmPluginOptionsError");
7825
7912
  var FarmPluginOptionsError = _FarmPluginOptionsError;
7826
7913
  function formatIssuePath(path22) {
7827
- if (!_optionalChain([path22, 'optionalAccess', _326 => _326.length])) return "";
7914
+ if (!_optionalChain([path22, 'optionalAccess', _332 => _332.length])) return "";
7828
7915
  return path22.map((segment) => {
7829
7916
  const key = typeof segment === "object" && segment !== null ? segment.key : segment;
7830
7917
  return typeof key === "symbol" ? key.toString() : String(key);
@@ -7838,11 +7925,11 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, isPromiseLike, "isPromiseLike");
7838
7925
  function isPluginOptionsSchema(value) {
7839
7926
  if (typeof value !== "object" && typeof value !== "function" || value === null) return false;
7840
7927
  const standard = value["~standard"];
7841
- return typeof _optionalChain([standard, 'optionalAccess', _327 => _327.validate]) === "function";
7928
+ return typeof _optionalChain([standard, 'optionalAccess', _333 => _333.validate]) === "function";
7842
7929
  }
7843
7930
  _chunkS3JO3N4Hcjs.__name.call(void 0, isPluginOptionsSchema, "isPluginOptionsSchema");
7844
7931
  function parsePluginOptions(schema, options) {
7845
- const standard = _optionalChain([schema, 'optionalAccess', _328 => _328["~standard"]]);
7932
+ const standard = _optionalChain([schema, 'optionalAccess', _334 => _334["~standard"]]);
7846
7933
  if (!standard || typeof standard.validate !== "function") {
7847
7934
  throw new TypeError(
7848
7935
  "A plugin's `options` needs a Standard Schema, such as a Zod, Valibot, or ArkType schema."
@@ -7902,9 +7989,9 @@ function normalizeRuntimeEndpointRequestPath(pathname) {
7902
7989
  _chunkS3JO3N4Hcjs.__name.call(void 0, normalizeRuntimeEndpointRequestPath, "normalizeRuntimeEndpointRequestPath");
7903
7990
  function farmPluginMayAffectRuntimePath(plugin, pathname) {
7904
7991
  const runtime = plugin.runtime;
7905
- const endpoints = _optionalChain([runtime, 'optionalAccess', _329 => _329.endpoints]);
7992
+ const endpoints = _optionalChain([runtime, 'optionalAccess', _335 => _335.endpoints]);
7906
7993
  const hasUnscopedRequestHooks = Boolean(
7907
- plugin.init || plugin.ready || plugin.shutdown || _optionalChain([runtime, 'optionalAccess', _330 => _330.context]) || _optionalChain([runtime, 'optionalAccess', _331 => _331.before]) || _optionalChain([runtime, 'optionalAccess', _332 => _332.after]) || _optionalChain([runtime, 'optionalAccess', _333 => _333.error]) || plugin.router || plugin.render || plugin.beforeRouteMatch || plugin.afterRouteMatch || plugin.beforeRender || plugin.afterRender || plugin.onError || plugin.transformHTML || plugin.beforeRequest || plugin.afterResponse
7994
+ plugin.init || plugin.ready || plugin.shutdown || _optionalChain([runtime, 'optionalAccess', _336 => _336.context]) || _optionalChain([runtime, 'optionalAccess', _337 => _337.before]) || _optionalChain([runtime, 'optionalAccess', _338 => _338.after]) || _optionalChain([runtime, 'optionalAccess', _339 => _339.error]) || plugin.router || plugin.render || plugin.beforeRouteMatch || plugin.afterRouteMatch || plugin.beforeRender || plugin.afterRender || plugin.onError || plugin.transformHTML || plugin.beforeRequest || plugin.afterResponse
7908
7995
  );
7909
7996
  if (hasUnscopedRequestHooks) return true;
7910
7997
  if (Array.isArray(endpoints) && endpoints.length > 0) {
@@ -7916,7 +8003,7 @@ function farmPluginMayAffectRuntimePath(plugin, pathname) {
7916
8003
  ) === normalizedPathname
7917
8004
  );
7918
8005
  }
7919
- return Boolean(plugin.setup || _optionalChain([runtime, 'optionalAccess', _334 => _334.start]) || _optionalChain([runtime, 'optionalAccess', _335 => _335.close]));
8006
+ return Boolean(plugin.setup || _optionalChain([runtime, 'optionalAccess', _340 => _340.start]) || _optionalChain([runtime, 'optionalAccess', _341 => _341.close]));
7920
8007
  }
7921
8008
  _chunkS3JO3N4Hcjs.__name.call(void 0, farmPluginMayAffectRuntimePath, "farmPluginMayAffectRuntimePath");
7922
8009
 
@@ -7996,7 +8083,7 @@ var _PluginManager = class _PluginManager {
7996
8083
  };
7997
8084
  }
7998
8085
  createPluginHookContext(plugin, context = this.context) {
7999
- const integration = _chunkUJZLSXUBcjs.getFarmPluginIntegrationContext.call(void 0, plugin);
8086
+ const integration = _chunkVU6AAZVYcjs.getFarmPluginIntegrationContext.call(void 0, plugin);
8000
8087
  return integration ? { ...context, integration } : context;
8001
8088
  }
8002
8089
  createRequestHookContext(target, plugin) {
@@ -8050,7 +8137,7 @@ var _PluginManager = class _PluginManager {
8050
8137
  const endpoints = [];
8051
8138
  const owners = /* @__PURE__ */ new Map();
8052
8139
  for (const plugin of this.getSortedPlugins()) {
8053
- const configured = _optionalChain([plugin, 'access', _336 => _336.runtime, 'optionalAccess', _337 => _337.endpoints]);
8140
+ const configured = _optionalChain([plugin, 'access', _342 => _342.runtime, 'optionalAccess', _343 => _343.endpoints]);
8054
8141
  if (configured === void 0) continue;
8055
8142
  if (!Array.isArray(configured)) {
8056
8143
  throw new TypeError(`Farm plugin "${plugin.name}" runtime.endpoints must be an array`);
@@ -8121,7 +8208,7 @@ var _PluginManager = class _PluginManager {
8121
8208
  const values = {};
8122
8209
  const owners = /* @__PURE__ */ new Map();
8123
8210
  for (const plugin of this.getSortedPlugins()) {
8124
- const createContext = _optionalChain([plugin, 'access', _338 => _338.runtime, 'optionalAccess', _339 => _339.context]);
8211
+ const createContext = _optionalChain([plugin, 'access', _344 => _344.runtime, 'optionalAccess', _345 => _345.context]);
8125
8212
  if (!createContext) continue;
8126
8213
  const result = await createContext(
8127
8214
  this.createRuntimeBaseEvent(plugin, request2, options, waitUntil)
@@ -8147,7 +8234,7 @@ var _PluginManager = class _PluginManager {
8147
8234
  }
8148
8235
  async runRuntimeErrorHooks(request2, error, ctx, durationMs, options, waitUntil) {
8149
8236
  for (const plugin of this.getSortedPlugins()) {
8150
- const onError = _optionalChain([plugin, 'access', _340 => _340.runtime, 'optionalAccess', _341 => _341.error]);
8237
+ const onError = _optionalChain([plugin, 'access', _346 => _346.runtime, 'optionalAccess', _347 => _347.error]);
8151
8238
  if (!onError) continue;
8152
8239
  try {
8153
8240
  await onError({
@@ -8191,19 +8278,19 @@ var _PluginManager = class _PluginManager {
8191
8278
  case "config":
8192
8279
  if (plugin.configure) {
8193
8280
  hooks.push(
8194
- (config, context) => _optionalChain([plugin, 'access', _342 => _342.configure, 'optionalCall', _343 => _343(config, context)])
8281
+ (config, context) => _optionalChain([plugin, 'access', _348 => _348.configure, 'optionalCall', _349 => _349(config, context)])
8195
8282
  );
8196
8283
  }
8197
8284
  break;
8198
8285
  case "ready":
8199
- if (_optionalChain([plugin, 'access', _344 => _344.runtime, 'optionalAccess', _345 => _345.start])) {
8200
- hooks.push((context) => _optionalChain([plugin, 'access', _346 => _346.runtime, 'optionalAccess', _347 => _347.start, 'optionalCall', _348 => _348(withState(context))]));
8286
+ if (_optionalChain([plugin, 'access', _350 => _350.runtime, 'optionalAccess', _351 => _351.start])) {
8287
+ hooks.push((context) => _optionalChain([plugin, 'access', _352 => _352.runtime, 'optionalAccess', _353 => _353.start, 'optionalCall', _354 => _354(withState(context))]));
8201
8288
  }
8202
8289
  break;
8203
8290
  case "shutdown":
8204
- if (_optionalChain([plugin, 'access', _349 => _349.runtime, 'optionalAccess', _350 => _350.close])) {
8291
+ if (_optionalChain([plugin, 'access', _355 => _355.runtime, 'optionalAccess', _356 => _356.close])) {
8205
8292
  hooks.push(
8206
- (payload, context) => _optionalChain([plugin, 'access', _351 => _351.runtime, 'optionalAccess', _352 => _352.close, 'optionalCall', _353 => _353({
8293
+ (payload, context) => _optionalChain([plugin, 'access', _357 => _357.runtime, 'optionalAccess', _358 => _358.close, 'optionalCall', _359 => _359({
8207
8294
  ...withState(context),
8208
8295
  reason: payload.reason
8209
8296
  })])
@@ -8211,93 +8298,93 @@ var _PluginManager = class _PluginManager {
8211
8298
  }
8212
8299
  break;
8213
8300
  case "routeDiscovered":
8214
- if (_optionalChain([plugin, 'access', _354 => _354.router, 'optionalAccess', _355 => _355.discovered])) {
8301
+ if (_optionalChain([plugin, 'access', _360 => _360.router, 'optionalAccess', _361 => _361.discovered])) {
8215
8302
  hooks.push(
8216
- (route, context) => _optionalChain([plugin, 'access', _356 => _356.router, 'optionalAccess', _357 => _357.discovered, 'optionalCall', _358 => _358(route, withState(context))])
8303
+ (route, context) => _optionalChain([plugin, 'access', _362 => _362.router, 'optionalAccess', _363 => _363.discovered, 'optionalCall', _364 => _364(route, withState(context))])
8217
8304
  );
8218
8305
  }
8219
8306
  break;
8220
8307
  case "middlewareDiscovered":
8221
- if (_optionalChain([plugin, 'access', _359 => _359.router, 'optionalAccess', _360 => _360.discovered])) {
8308
+ if (_optionalChain([plugin, 'access', _365 => _365.router, 'optionalAccess', _366 => _366.discovered])) {
8222
8309
  hooks.push(
8223
- (route, context) => _optionalChain([plugin, 'access', _361 => _361.router, 'optionalAccess', _362 => _362.discovered, 'optionalCall', _363 => _363({ kind: "middleware", ...route }, withState(context))])
8310
+ (route, context) => _optionalChain([plugin, 'access', _367 => _367.router, 'optionalAccess', _368 => _368.discovered, 'optionalCall', _369 => _369({ kind: "middleware", ...route }, withState(context))])
8224
8311
  );
8225
8312
  }
8226
8313
  break;
8227
8314
  case "apiRouteDiscovered":
8228
- if (_optionalChain([plugin, 'access', _364 => _364.router, 'optionalAccess', _365 => _365.discovered])) {
8315
+ if (_optionalChain([plugin, 'access', _370 => _370.router, 'optionalAccess', _371 => _371.discovered])) {
8229
8316
  hooks.push(
8230
- (route, context) => _optionalChain([plugin, 'access', _366 => _366.router, 'optionalAccess', _367 => _367.discovered, 'optionalCall', _368 => _368({ kind: "api", ...route }, withState(context))])
8317
+ (route, context) => _optionalChain([plugin, 'access', _372 => _372.router, 'optionalAccess', _373 => _373.discovered, 'optionalCall', _374 => _374({ kind: "api", ...route }, withState(context))])
8231
8318
  );
8232
8319
  }
8233
8320
  break;
8234
8321
  case "routesGenerated":
8235
- if (_optionalChain([plugin, 'access', _369 => _369.router, 'optionalAccess', _370 => _370.generated])) {
8322
+ if (_optionalChain([plugin, 'access', _375 => _375.router, 'optionalAccess', _376 => _376.generated])) {
8236
8323
  hooks.push(
8237
- (routes, context) => _optionalChain([plugin, 'access', _371 => _371.router, 'optionalAccess', _372 => _372.generated, 'optionalCall', _373 => _373(routes, withState(context))])
8324
+ (routes, context) => _optionalChain([plugin, 'access', _377 => _377.router, 'optionalAccess', _378 => _378.generated, 'optionalCall', _379 => _379(routes, withState(context))])
8238
8325
  );
8239
8326
  }
8240
8327
  break;
8241
8328
  case "beforeRouteMatch":
8242
- if (_optionalChain([plugin, 'access', _374 => _374.router, 'optionalAccess', _375 => _375.before])) {
8329
+ if (_optionalChain([plugin, 'access', _380 => _380.router, 'optionalAccess', _381 => _381.before])) {
8243
8330
  hooks.push(
8244
- (route, context) => _optionalChain([plugin, 'access', _376 => _376.router, 'optionalAccess', _377 => _377.before, 'optionalCall', _378 => _378(route, withState(context))])
8331
+ (route, context) => _optionalChain([plugin, 'access', _382 => _382.router, 'optionalAccess', _383 => _383.before, 'optionalCall', _384 => _384(route, withState(context))])
8245
8332
  );
8246
8333
  }
8247
8334
  break;
8248
8335
  case "afterRouteMatch":
8249
- if (_optionalChain([plugin, 'access', _379 => _379.router, 'optionalAccess', _380 => _380.after])) {
8336
+ if (_optionalChain([plugin, 'access', _385 => _385.router, 'optionalAccess', _386 => _386.after])) {
8250
8337
  hooks.push(
8251
- (result, context) => _optionalChain([plugin, 'access', _381 => _381.router, 'optionalAccess', _382 => _382.after, 'optionalCall', _383 => _383(result, withState(context))])
8338
+ (result, context) => _optionalChain([plugin, 'access', _387 => _387.router, 'optionalAccess', _388 => _388.after, 'optionalCall', _389 => _389(result, withState(context))])
8252
8339
  );
8253
8340
  }
8254
8341
  break;
8255
8342
  case "beforeRender":
8256
- if (_optionalChain([plugin, 'access', _384 => _384.render, 'optionalAccess', _385 => _385.before])) {
8343
+ if (_optionalChain([plugin, 'access', _390 => _390.render, 'optionalAccess', _391 => _391.before])) {
8257
8344
  hooks.push(
8258
- (render, context) => _optionalChain([plugin, 'access', _386 => _386.render, 'optionalAccess', _387 => _387.before, 'optionalCall', _388 => _388(render, withState(context))])
8345
+ (render, context) => _optionalChain([plugin, 'access', _392 => _392.render, 'optionalAccess', _393 => _393.before, 'optionalCall', _394 => _394(render, withState(context))])
8259
8346
  );
8260
8347
  }
8261
8348
  break;
8262
8349
  case "afterRender":
8263
- if (_optionalChain([plugin, 'access', _389 => _389.render, 'optionalAccess', _390 => _390.html])) {
8350
+ if (_optionalChain([plugin, 'access', _395 => _395.render, 'optionalAccess', _396 => _396.html])) {
8264
8351
  hooks.push(
8265
- (html, render, context) => _optionalChain([plugin, 'access', _391 => _391.render, 'optionalAccess', _392 => _392.html, 'optionalCall', _393 => _393(html, render, withState(context))])
8352
+ (html, render, context) => _optionalChain([plugin, 'access', _397 => _397.render, 'optionalAccess', _398 => _398.html, 'optionalCall', _399 => _399(html, render, withState(context))])
8266
8353
  );
8267
8354
  }
8268
8355
  break;
8269
8356
  case "beforeBundle":
8270
- if (_optionalChain([plugin, 'access', _394 => _394.build, 'optionalAccess', _395 => _395.before])) {
8357
+ if (_optionalChain([plugin, 'access', _400 => _400.build, 'optionalAccess', _401 => _401.before])) {
8271
8358
  hooks.push(
8272
- (bundle, context) => _optionalChain([plugin, 'access', _396 => _396.build, 'optionalAccess', _397 => _397.before, 'optionalCall', _398 => _398(bundle, withState(context))])
8359
+ (bundle, context) => _optionalChain([plugin, 'access', _402 => _402.build, 'optionalAccess', _403 => _403.before, 'optionalCall', _404 => _404(bundle, withState(context))])
8273
8360
  );
8274
8361
  }
8275
8362
  break;
8276
8363
  case "beforeNitroBuild":
8277
- if (_optionalChain([plugin, 'access', _399 => _399.build, 'optionalAccess', _400 => _400.configure])) {
8364
+ if (_optionalChain([plugin, 'access', _405 => _405.build, 'optionalAccess', _406 => _406.configure])) {
8278
8365
  hooks.push(
8279
- (buildConfig, context) => _optionalChain([plugin, 'access', _401 => _401.build, 'optionalAccess', _402 => _402.configure, 'optionalCall', _403 => _403(buildConfig, withState(context))])
8366
+ (buildConfig, context) => _optionalChain([plugin, 'access', _407 => _407.build, 'optionalAccess', _408 => _408.configure, 'optionalCall', _409 => _409(buildConfig, withState(context))])
8280
8367
  );
8281
8368
  }
8282
8369
  break;
8283
8370
  case "afterBundle":
8284
- if (_optionalChain([plugin, 'access', _404 => _404.build, 'optionalAccess', _405 => _405.after])) {
8371
+ if (_optionalChain([plugin, 'access', _410 => _410.build, 'optionalAccess', _411 => _411.after])) {
8285
8372
  hooks.push(
8286
- (result, context) => _optionalChain([plugin, 'access', _406 => _406.build, 'optionalAccess', _407 => _407.after, 'optionalCall', _408 => _408(result, withState(context))])
8373
+ (result, context) => _optionalChain([plugin, 'access', _412 => _412.build, 'optionalAccess', _413 => _413.after, 'optionalCall', _414 => _414(result, withState(context))])
8287
8374
  );
8288
8375
  }
8289
8376
  break;
8290
8377
  case "devServerCreated":
8291
- if (_optionalChain([plugin, 'access', _409 => _409.dev, 'optionalAccess', _410 => _410.server])) {
8378
+ if (_optionalChain([plugin, 'access', _415 => _415.dev, 'optionalAccess', _416 => _416.server])) {
8292
8379
  hooks.push(
8293
- (server, context) => _optionalChain([plugin, 'access', _411 => _411.dev, 'optionalAccess', _412 => _412.server, 'optionalCall', _413 => _413(server, withState(context))])
8380
+ (server, context) => _optionalChain([plugin, 'access', _417 => _417.dev, 'optionalAccess', _418 => _418.server, 'optionalCall', _419 => _419(server, withState(context))])
8294
8381
  );
8295
8382
  }
8296
8383
  break;
8297
8384
  case "hmrUpdate":
8298
- if (_optionalChain([plugin, 'access', _414 => _414.dev, 'optionalAccess', _415 => _415.update])) {
8385
+ if (_optionalChain([plugin, 'access', _420 => _420.dev, 'optionalAccess', _421 => _421.update])) {
8299
8386
  hooks.push(
8300
- (update, context) => _optionalChain([plugin, 'access', _416 => _416.dev, 'optionalAccess', _417 => _417.update, 'optionalCall', _418 => _418(update, withState(context))])
8387
+ (update, context) => _optionalChain([plugin, 'access', _422 => _422.dev, 'optionalAccess', _423 => _423.update, 'optionalCall', _424 => _424(update, withState(context))])
8301
8388
  );
8302
8389
  }
8303
8390
  break;
@@ -8343,7 +8430,7 @@ var _PluginManager = class _PluginManager {
8343
8430
  hasRuntimeHook(hookName) {
8344
8431
  const cached = this.runtimeHookPresence.get(hookName);
8345
8432
  if (cached !== void 0) return cached;
8346
- const present = this.plugins.some((plugin) => typeof _optionalChain([plugin, 'access', _419 => _419.runtime, 'optionalAccess', _420 => _420[hookName]]) === "function");
8433
+ const present = this.plugins.some((plugin) => typeof _optionalChain([plugin, 'access', _425 => _425.runtime, 'optionalAccess', _426 => _426[hookName]]) === "function");
8347
8434
  this.runtimeHookPresence.set(hookName, present);
8348
8435
  return present;
8349
8436
  }
@@ -8422,7 +8509,7 @@ var _PluginManager = class _PluginManager {
8422
8509
  async beginRuntimeRequest(request2, options = {}) {
8423
8510
  await this.startRuntime();
8424
8511
  const startedAt = Date.now();
8425
- const waitUntil = options.waitUntil ? (promise) => _optionalChain([options, 'access', _421 => _421.waitUntil, 'optionalCall', _422 => _422(Promise.resolve(promise))]) : (promise) => {
8512
+ const waitUntil = options.waitUntil ? (promise) => _optionalChain([options, 'access', _427 => _427.waitUntil, 'optionalCall', _428 => _428(Promise.resolve(promise))]) : (promise) => {
8426
8513
  void Promise.resolve(promise).catch(() => {
8427
8514
  });
8428
8515
  };
@@ -8455,7 +8542,7 @@ var _PluginManager = class _PluginManager {
8455
8542
  );
8456
8543
  let response;
8457
8544
  for (const plugin of this.getSortedPlugins()) {
8458
- const before = _optionalChain([plugin, 'access', _423 => _423.runtime, 'optionalAccess', _424 => _424.before]);
8545
+ const before = _optionalChain([plugin, 'access', _429 => _429.runtime, 'optionalAccess', _430 => _430.before]);
8459
8546
  if (!before) continue;
8460
8547
  const result = await before({
8461
8548
  ...this.createRuntimeBaseEvent(plugin, activeRequest, activeOptions, waitUntil),
@@ -8501,7 +8588,7 @@ var _PluginManager = class _PluginManager {
8501
8588
  let response = initialResponse;
8502
8589
  try {
8503
8590
  for (const plugin of this.getSortedPlugins()) {
8504
- const after = _optionalChain([plugin, 'access', _425 => _425.runtime, 'optionalAccess', _426 => _426.after]);
8591
+ const after = _optionalChain([plugin, 'access', _431 => _431.runtime, 'optionalAccess', _432 => _432.after]);
8505
8592
  if (!after) continue;
8506
8593
  const result = await after({
8507
8594
  ...this.createRuntimeBaseEvent(
@@ -8590,7 +8677,7 @@ var _PluginManager = class _PluginManager {
8590
8677
  /** @internal Runs hooks for only the plugins selected by the runtime adapter. */
8591
8678
  async runHookParallelFiltered(hookName, include, ...args) {
8592
8679
  if (hookName === "shutdown" && !this.runtimeShutdownHooksRunning) {
8593
- await this.closeRuntime(_optionalChain([args, 'access', _427 => _427[0], 'optionalAccess', _428 => _428.reason]));
8680
+ await this.closeRuntime(_optionalChain([args, 'access', _433 => _433[0], 'optionalAccess', _434 => _434.reason]));
8594
8681
  return false;
8595
8682
  }
8596
8683
  const plugins = this.getSortedPlugins().filter(include);
@@ -8703,7 +8790,7 @@ function createPluginFactory(definition) {
8703
8790
  configure: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (config, context) => configure(config, { ...context, options }), "configure")
8704
8791
  } : {},
8705
8792
  setup(context) {
8706
- const state = _optionalChain([setup, 'optionalCall', _429 => _429({ ...context, options })]);
8793
+ const state = _optionalChain([setup, 'optionalCall', _435 => _435({ ...context, options })]);
8707
8794
  return state instanceof Promise ? state.then(resolveState) : resolveState(state);
8708
8795
  }
8709
8796
  });
@@ -8744,10 +8831,10 @@ function declarePluginSchema(plugin) {
8744
8831
  models: Object.keys(models).filter((key) => !models[key].external),
8745
8832
  ...plugin.dependsOn ? { dependsOn: plugin.dependsOn.map(_chunk6MVFL3R5cjs.pluginShortName) } : {},
8746
8833
  ...plugin.version ? { version: plugin.version } : {},
8747
- ..._optionalChain([plugin, 'access', _430 => _430.migrations, 'optionalAccess', _431 => _431.length]) ? { migrations: plugin.migrations } : {},
8748
- dialect: _optionalChain([database, 'optionalAccess', _432 => _432.dialect]),
8834
+ ..._optionalChain([plugin, 'access', _436 => _436.migrations, 'optionalAccess', _437 => _437.length]) ? { migrations: plugin.migrations } : {},
8835
+ dialect: _optionalChain([database, 'optionalAccess', _438 => _438.dialect]),
8749
8836
  resolveClient: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (config) => {
8750
- if (_optionalChain([database, 'optionalAccess', _433 => _433.client]) !== void 0 && database.client !== null) {
8837
+ if (_optionalChain([database, 'optionalAccess', _439 => _439.client]) !== void 0 && database.client !== null) {
8751
8838
  const client2 = typeof database.client === "function" ? await database.client() : database.client;
8752
8839
  if (client2 === void 0 || client2 === null) {
8753
8840
  throw new Error(`The ${name} plugin's \`database.client\` returned no connection.`);
@@ -8801,7 +8888,7 @@ function resolveFarmAppClientEntry(root = process.cwd(), srcDir = "src") {
8801
8888
  }
8802
8889
  _chunkS3JO3N4Hcjs.__name.call(void 0, resolveFarmAppClientEntry, "resolveFarmAppClientEntry");
8803
8890
  function resolveFarmClientPlugins(plugins, _root) {
8804
- if (!_optionalChain([plugins, 'optionalAccess', _434 => _434.length])) return [];
8891
+ if (!_optionalChain([plugins, 'optionalAccess', _440 => _440.length])) return [];
8805
8892
  return plugins.flatMap((plugin) => {
8806
8893
  if (!plugin.client) return [];
8807
8894
  assertClientLifecycle(plugin.client, plugin.name);
@@ -8881,7 +8968,7 @@ function assertLifecycleObject(value, pluginName, location, allowedKeys) {
8881
8968
  throw new TypeError(`Client plugin "${pluginName}" has an unknown ${location}.${key} option`);
8882
8969
  }
8883
8970
  const descriptor = Object.getOwnPropertyDescriptor(value, key);
8884
- if (!_optionalChain([descriptor, 'optionalAccess', _435 => _435.enumerable])) {
8971
+ if (!_optionalChain([descriptor, 'optionalAccess', _441 => _441.enumerable])) {
8885
8972
  throw new TypeError(`Client plugin "${pluginName}" ${location}.${key} must be enumerable`);
8886
8973
  }
8887
8974
  if (!("value" in descriptor)) {
@@ -9005,7 +9092,7 @@ function assertPublicData(value, pluginName) {
9005
9092
  throwPublicDataError(pluginName, pathSegments, "cannot contain symbol keys");
9006
9093
  }
9007
9094
  const descriptor = Object.getOwnPropertyDescriptor(current, key);
9008
- if (!_optionalChain([descriptor, 'optionalAccess', _436 => _436.enumerable])) {
9095
+ if (!_optionalChain([descriptor, 'optionalAccess', _442 => _442.enumerable])) {
9009
9096
  throwPublicDataError(
9010
9097
  pluginName,
9011
9098
  [...pathSegments, key],
@@ -9051,8 +9138,8 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, isArrayIndex, "isArrayIndex");
9051
9138
 
9052
9139
  var ADAPTER_EXTENSIONS = ["ts", "tsx", "js", "jsx", "mts", "mjs"];
9053
9140
  function resolveFarmClientCacheAdapterEntry(root, cache2) {
9054
- const client = _optionalChain([cache2, 'optionalAccess', _437 => _437.client]);
9055
- const adapter = _optionalChain([client, 'optionalAccess', _438 => _438.adapter]);
9141
+ const client = _optionalChain([cache2, 'optionalAccess', _443 => _443.client]);
9142
+ const adapter = _optionalChain([client, 'optionalAccess', _444 => _444.adapter]);
9056
9143
  if (adapter === void 0) return void 0;
9057
9144
  if (typeof adapter !== "string" || adapter.trim().length === 0) {
9058
9145
  throw new Error(
@@ -9067,8 +9154,8 @@ function resolveFarmClientCacheAdapterEntry(root, cache2) {
9067
9154
  );
9068
9155
  }
9069
9156
  const options = {};
9070
- if (_optionalChain([client, 'optionalAccess', _439 => _439.version]) !== void 0) options.version = client.version;
9071
- if (_optionalChain([client, 'optionalAccess', _440 => _440.flushDelayMs]) !== void 0) options.flushDelayMs = client.flushDelayMs;
9157
+ if (_optionalChain([client, 'optionalAccess', _445 => _445.version]) !== void 0) options.version = client.version;
9158
+ if (_optionalChain([client, 'optionalAccess', _446 => _446.flushDelayMs]) !== void 0) options.flushDelayMs = client.flushDelayMs;
9072
9159
  return { importPath: found.replace(/\\/g, "/"), options };
9073
9160
  }
9074
9161
  _chunkS3JO3N4Hcjs.__name.call(void 0, resolveFarmClientCacheAdapterEntry, "resolveFarmClientCacheAdapterEntry");
@@ -9197,9 +9284,9 @@ function staticValue(node) {
9197
9284
  }
9198
9285
  _chunkS3JO3N4Hcjs.__name.call(void 0, staticValue, "staticValue");
9199
9286
  function property(object, name) {
9200
- return _optionalChain([object, 'access', _441 => _441.properties, 'access', _442 => _442.find, 'call', _443 => _443(
9287
+ return _optionalChain([object, 'access', _447 => _447.properties, 'access', _448 => _448.find, 'call', _449 => _449(
9201
9288
  (entry) => entry.type === "Property" && !entry.computed && (entry.key.name === name || entry.key.value === name)
9202
- ), 'optionalAccess', _444 => _444.value]);
9289
+ ), 'optionalAccess', _450 => _450.value]);
9203
9290
  }
9204
9291
  _chunkS3JO3N4Hcjs.__name.call(void 0, property, "property");
9205
9292
  function toolFromObject(object) {
@@ -9247,7 +9334,7 @@ function findFarmWebMCPTools(code, filename = "module.tsx") {
9247
9334
  if (statement.type !== "ImportDeclaration" || statement.source.value !== WEBMCP_CLIENT)
9248
9335
  continue;
9249
9336
  for (const specifier of statement.specifiers) {
9250
- const imported = _nullishCoalesce(_optionalChain([specifier, 'access', _445 => _445.imported, 'optionalAccess', _446 => _446.name]), () => ( _optionalChain([specifier, 'access', _447 => _447.imported, 'optionalAccess', _448 => _448.value])));
9337
+ const imported = _nullishCoalesce(_optionalChain([specifier, 'access', _451 => _451.imported, 'optionalAccess', _452 => _452.name]), () => ( _optionalChain([specifier, 'access', _453 => _453.imported, 'optionalAccess', _454 => _454.value])));
9251
9338
  if (specifier.type === "ImportSpecifier" && DEFINERS.has(imported))
9252
9339
  locals.set(specifier.local.name, imported);
9253
9340
  }
@@ -9263,7 +9350,7 @@ function findFarmWebMCPTools(code, filename = "module.tsx") {
9263
9350
  const [argument] = current.arguments;
9264
9351
  if (definer && argument) {
9265
9352
  const objects = definer === "registerWebMCPTools" ? argument.type === "ArrayExpression" ? argument.elements.filter(
9266
- (element) => _optionalChain([element, 'optionalAccess', _449 => _449.type]) === "ObjectExpression"
9353
+ (element) => _optionalChain([element, 'optionalAccess', _455 => _455.type]) === "ObjectExpression"
9267
9354
  ) : [] : argument.type === "ObjectExpression" ? [argument] : [];
9268
9355
  for (const object of objects) {
9269
9356
  const tool = toolFromObject(object);
@@ -9350,19 +9437,23 @@ function unwrapFarmDocumentElement(node) {
9350
9437
  });
9351
9438
  }
9352
9439
 
9440
+ function farmLayoutBoundaryElement(pattern, content) {
9441
+ return React.createElement(
9442
+ "div",
9443
+ {
9444
+ "data-farm-layout-boundary": "true",
9445
+ "data-farm-layout-pattern": pattern,
9446
+ style: { display: "contents" },
9447
+ },
9448
+ content,
9449
+ );
9450
+ }
9451
+
9353
9452
  function FarmLayoutBoundary(props) {
9354
9453
  const Component = props.component;
9355
9454
  const layoutProps = { children: props.children, params: props.params };
9356
9455
  const boundary = function (content) {
9357
- return React.createElement(
9358
- "div",
9359
- {
9360
- "data-farm-layout-boundary": "true",
9361
- "data-farm-layout-pattern": props.pattern,
9362
- style: { display: "contents" },
9363
- },
9364
- content,
9365
- );
9456
+ return farmLayoutBoundaryElement(props.pattern, content);
9366
9457
  };
9367
9458
  const isPlainFunction =
9368
9459
  typeof Component === "function" &&
@@ -9378,6 +9469,12 @@ function FarmLayoutBoundary(props) {
9378
9469
  }
9379
9470
 
9380
9471
  function createFarmLayoutElement(Component, pattern, children, params) {
9472
+ if (typeof React.markFunctionComponent === "function") {
9473
+ return farmLayoutBoundaryElement(
9474
+ pattern,
9475
+ React.createElement(Component, { children: children, params: params }),
9476
+ );
9477
+ }
9381
9478
  return React.createElement(
9382
9479
  FarmLayoutBoundary,
9383
9480
  { key: farmLayoutComponentKey(Component), component: Component, pattern: pattern, params: params },
@@ -9449,8 +9546,8 @@ async function isAllowedPreviewRequest(server, options, req) {
9449
9546
  if (method !== "GET" && method !== "HEAD") return true;
9450
9547
  const file = await resolveRequestedFile(server, pathname);
9451
9548
  if (!file) return true;
9452
- const client = _optionalChain([server, 'access', _450 => _450.environments, 'optionalAccess', _451 => _451.client]);
9453
- const inClientGraph = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async () => Boolean(await _optionalChain([client, 'optionalAccess', _452 => _452.moduleGraph, 'access', _453 => _453.getModuleByUrl, 'call', _454 => _454(url)])), "inClientGraph");
9549
+ const client = _optionalChain([server, 'access', _456 => _456.environments, 'optionalAccess', _457 => _457.client]);
9550
+ const inClientGraph = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async () => Boolean(await _optionalChain([client, 'optionalAccess', _458 => _458.moduleGraph, 'access', _459 => _459.getModuleByUrl, 'call', _460 => _460(url)])), "inClientGraph");
9454
9551
  if (SOURCE_QUERY_FLAGS.some((flag) => query.has(flag))) return inClientGraph();
9455
9552
  if (await inClientGraph()) return true;
9456
9553
  if (file.split(path16.sep).includes("node_modules")) return true;
@@ -9479,10 +9576,10 @@ async function resolveRequestedFile(server, pathname) {
9479
9576
  id = id.slice("/@id/".length).replace(/^__x00__/, "\0");
9480
9577
  if (id.startsWith("\0")) return void 0;
9481
9578
  }
9482
- const resolved = await _optionalChain([server, 'access', _455 => _455.environments, 'optionalAccess', _456 => _456.client, 'optionalAccess', _457 => _457.pluginContainer, 'access', _458 => _458.resolveId, 'call', _459 => _459(id, void 0)]);
9483
- const resolvedId = _optionalChain([resolved, 'optionalAccess', _460 => _460.id, 'access', _461 => _461.replace, 'call', _462 => _462(/[?#].*$/, "")]);
9579
+ const resolved = await _optionalChain([server, 'access', _461 => _461.environments, 'optionalAccess', _462 => _462.client, 'optionalAccess', _463 => _463.pluginContainer, 'access', _464 => _464.resolveId, 'call', _465 => _465(id, void 0)]);
9580
+ const resolvedId = _optionalChain([resolved, 'optionalAccess', _466 => _466.id, 'access', _467 => _467.replace, 'call', _468 => _468(/[?#].*$/, "")]);
9484
9581
  if (resolvedId && path16.isAbsolute(resolvedId)) candidate = resolvedId;
9485
- else if (_optionalChain([resolvedId, 'optionalAccess', _463 => _463.startsWith, 'call', _464 => _464("\0")])) return void 0;
9582
+ else if (_optionalChain([resolvedId, 'optionalAccess', _469 => _469.startsWith, 'call', _470 => _470("\0")])) return void 0;
9486
9583
  else if (id.startsWith("/")) candidate = path16.join(server.config.root, id);
9487
9584
  }
9488
9585
  if (!candidate) return void 0;
@@ -9519,7 +9616,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, isInside, "isInside");
9519
9616
  function shouldBypassFarmRouterForDottedPath(pathname, routeManager, baseDirs, generatedPaths = []) {
9520
9617
  if (!pathname.includes(".") || pathname.endsWith(".html")) return false;
9521
9618
  const matchesAppRoute = Boolean(
9522
- _optionalChain([routeManager, 'optionalAccess', _465 => _465.matchRoute, 'call', _466 => _466(pathname), 'optionalAccess', _467 => _467.route]) || _optionalChain([routeManager, 'optionalAccess', _468 => _468.matchMetadataRoute, 'call', _469 => _469(pathname)]) || _optionalChain([routeManager, 'optionalAccess', _470 => _470.matchMetadataImage, 'call', _471 => _471(pathname)]) || generatedPaths.includes(pathname)
9619
+ _optionalChain([routeManager, 'optionalAccess', _471 => _471.matchRoute, 'call', _472 => _472(pathname), 'optionalAccess', _473 => _473.route]) || _optionalChain([routeManager, 'optionalAccess', _474 => _474.matchMetadataRoute, 'call', _475 => _475(pathname)]) || _optionalChain([routeManager, 'optionalAccess', _476 => _476.matchMetadataImage, 'call', _477 => _477(pathname)]) || generatedPaths.includes(pathname)
9523
9620
  );
9524
9621
  return !matchesAppRoute || devServableFileExists(pathname, baseDirs);
9525
9622
  }
@@ -9548,7 +9645,7 @@ var DOCS_ENGINE_APP_OWNABLE_PATHS = /* @__PURE__ */ new Set([
9548
9645
  ]);
9549
9646
  function farmAppOwnsDocsEnginePath(pathname, options) {
9550
9647
  if (!DOCS_ENGINE_APP_OWNABLE_PATHS.has(pathname)) return false;
9551
- return options.generatedPaths.includes(pathname) || Boolean(_optionalChain([options, 'access', _472 => _472.routeManager, 'optionalAccess', _473 => _473.matchMetadataRoute, 'call', _474 => _474(pathname)])) || devServableFileExists(pathname, [options.publicDir]);
9648
+ return options.generatedPaths.includes(pathname) || Boolean(_optionalChain([options, 'access', _478 => _478.routeManager, 'optionalAccess', _479 => _479.matchMetadataRoute, 'call', _480 => _480(pathname)])) || devServableFileExists(pathname, [options.publicDir]);
9552
9649
  }
9553
9650
  _chunkS3JO3N4Hcjs.__name.call(void 0, farmAppOwnsDocsEnginePath, "farmAppOwnsDocsEnginePath");
9554
9651
  function devServableFileExists(pathname, baseDirs) {
@@ -9655,14 +9752,14 @@ function analyzeClientBoundary(program, publicKeys) {
9655
9752
  _chunkS3JO3N4Hcjs.__name.call(void 0, analyzeClientBoundary, "analyzeClientBoundary");
9656
9753
  function readNodeBuiltinSource(node) {
9657
9754
  if (node.type === "ImportDeclaration" || node.type === "ExportNamedDeclaration" || node.type === "ExportAllDeclaration" || node.type === "ImportExpression") {
9658
- const value = _optionalChain([node, 'access', _475 => _475.source, 'optionalAccess', _476 => _476.value]);
9755
+ const value = _optionalChain([node, 'access', _481 => _481.source, 'optionalAccess', _482 => _482.value]);
9659
9756
  return typeof value === "string" && value.startsWith("node:") ? value : void 0;
9660
9757
  }
9661
9758
  if (node.type === "CallExpression") {
9662
9759
  const callee = node.callee;
9663
- if (_optionalChain([callee, 'optionalAccess', _477 => _477.type]) === "Identifier" && callee.name === "require") {
9664
- const arg = _optionalChain([node, 'access', _478 => _478.arguments, 'optionalAccess', _479 => _479[0]]);
9665
- const value = _optionalChain([arg, 'optionalAccess', _480 => _480.type]) === "Literal" ? arg.value : void 0;
9760
+ if (_optionalChain([callee, 'optionalAccess', _483 => _483.type]) === "Identifier" && callee.name === "require") {
9761
+ const arg = _optionalChain([node, 'access', _484 => _484.arguments, 'optionalAccess', _485 => _485[0]]);
9762
+ const value = _optionalChain([arg, 'optionalAccess', _486 => _486.type]) === "Literal" ? arg.value : void 0;
9666
9763
  return typeof value === "string" && value.startsWith("node:") ? value : void 0;
9667
9764
  }
9668
9765
  }
@@ -9672,7 +9769,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, readNodeBuiltinSource, "readNodeBuiltinSou
9672
9769
  function readProcessEnvKey(node) {
9673
9770
  if (node.type !== "MemberExpression") return void 0;
9674
9771
  const object = node.object;
9675
- if (!object || object.type !== "MemberExpression" || _optionalChain([object, 'access', _481 => _481.object, 'optionalAccess', _482 => _482.type]) !== "Identifier" || object.object.name !== "process" || _optionalChain([object, 'access', _483 => _483.property, 'optionalAccess', _484 => _484.name]) !== "env") {
9772
+ if (!object || object.type !== "MemberExpression" || _optionalChain([object, 'access', _487 => _487.object, 'optionalAccess', _488 => _488.type]) !== "Identifier" || object.object.name !== "process" || _optionalChain([object, 'access', _489 => _489.property, 'optionalAccess', _490 => _490.name]) !== "env") {
9676
9773
  return void 0;
9677
9774
  }
9678
9775
  const property2 = node.property;
@@ -9737,7 +9834,7 @@ function farmImageImportsPlugin() {
9737
9834
  async transform(code, id) {
9738
9835
  const filePath = id.split("?", 1)[0];
9739
9836
  if (id.includes("?") || !STATIC_IMAGE_RE.test(filePath)) return null;
9740
- const defaultExport = _optionalChain([code, 'access', _485 => _485.match, 'call', _486 => _486(/^\s*export\s+default\s+(.+?);?\s*$/s), 'optionalAccess', _487 => _487[1]]);
9837
+ const defaultExport = _optionalChain([code, 'access', _491 => _491.match, 'call', _492 => _492(/^\s*export\s+default\s+(.+?);?\s*$/s), 'optionalAccess', _493 => _493[1]]);
9741
9838
  if (!defaultExport) return null;
9742
9839
  return createStaticImageModule(filePath, `const src = ${defaultExport};`);
9743
9840
  }
@@ -9798,7 +9895,7 @@ var FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE = [
9798
9895
  ];
9799
9896
  function getFarmClientOptimizeDepsInclude(renderer) {
9800
9897
  return Array.from(
9801
- /* @__PURE__ */ new Set([...FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE, ..._optionalChain([renderer, 'optionalAccess', _488 => _488.optimizeDeps]) || []])
9898
+ /* @__PURE__ */ new Set([...FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE, ..._optionalChain([renderer, 'optionalAccess', _494 => _494.optimizeDeps]) || []])
9802
9899
  );
9803
9900
  }
9804
9901
  _chunkS3JO3N4Hcjs.__name.call(void 0, getFarmClientOptimizeDepsInclude, "getFarmClientOptimizeDepsInclude");
@@ -9823,7 +9920,7 @@ function createFarmClientOptimizeDepsConfig(entries, renderer) {
9823
9920
  // Farm's HTML boots through a virtual module and imports route UI lazily.
9824
9921
  // Explicit entries let Vite finish that crawl before a navigation can
9825
9922
  // rotate the optimizer hash underneath a hydrated React runtime.
9826
- ..._optionalChain([entries, 'optionalAccess', _489 => _489.length]) ? { entries: [...entries] } : {}
9923
+ ..._optionalChain([entries, 'optionalAccess', _495 => _495.length]) ? { entries: [...entries] } : {}
9827
9924
  };
9828
9925
  }
9829
9926
  _chunkS3JO3N4Hcjs.__name.call(void 0, createFarmClientOptimizeDepsConfig, "createFarmClientOptimizeDepsConfig");
@@ -9853,8 +9950,8 @@ function mergeAlias(farmValue, userValue) {
9853
9950
  }
9854
9951
  _chunkS3JO3N4Hcjs.__name.call(void 0, mergeAlias, "mergeAlias");
9855
9952
  function mergeFarmViteConfig(farmConfig, userConfig = {}) {
9856
- const noDiscovery = _nullishCoalesce(_optionalChain([userConfig, 'access', _490 => _490.optimizeDeps, 'optionalAccess', _491 => _491.noDiscovery]), () => ( _optionalChain([farmConfig, 'access', _492 => _492.optimizeDeps, 'optionalAccess', _493 => _493.noDiscovery])));
9857
- const holdUntilCrawlEnd = _nullishCoalesce(_optionalChain([userConfig, 'access', _494 => _494.optimizeDeps, 'optionalAccess', _495 => _495.holdUntilCrawlEnd]), () => ( (_optionalChain([userConfig, 'access', _496 => _496.optimizeDeps, 'optionalAccess', _497 => _497.noDiscovery]) === true ? false : _optionalChain([farmConfig, 'access', _498 => _498.optimizeDeps, 'optionalAccess', _499 => _499.holdUntilCrawlEnd]))));
9953
+ const noDiscovery = _nullishCoalesce(_optionalChain([userConfig, 'access', _496 => _496.optimizeDeps, 'optionalAccess', _497 => _497.noDiscovery]), () => ( _optionalChain([farmConfig, 'access', _498 => _498.optimizeDeps, 'optionalAccess', _499 => _499.noDiscovery])));
9954
+ const holdUntilCrawlEnd = _nullishCoalesce(_optionalChain([userConfig, 'access', _500 => _500.optimizeDeps, 'optionalAccess', _501 => _501.holdUntilCrawlEnd]), () => ( (_optionalChain([userConfig, 'access', _502 => _502.optimizeDeps, 'optionalAccess', _503 => _503.noDiscovery]) === true ? false : _optionalChain([farmConfig, 'access', _504 => _504.optimizeDeps, 'optionalAccess', _505 => _505.holdUntilCrawlEnd]))));
9858
9955
  return {
9859
9956
  ...farmConfig,
9860
9957
  ...userConfig,
@@ -9866,9 +9963,9 @@ function mergeFarmViteConfig(farmConfig, userConfig = {}) {
9866
9963
  resolve: {
9867
9964
  ...farmConfig.resolve,
9868
9965
  ...userConfig.resolve,
9869
- alias: mergeAlias(_optionalChain([farmConfig, 'access', _500 => _500.resolve, 'optionalAccess', _501 => _501.alias]), _optionalChain([userConfig, 'access', _502 => _502.resolve, 'optionalAccess', _503 => _503.alias])),
9966
+ alias: mergeAlias(_optionalChain([farmConfig, 'access', _506 => _506.resolve, 'optionalAccess', _507 => _507.alias]), _optionalChain([userConfig, 'access', _508 => _508.resolve, 'optionalAccess', _509 => _509.alias])),
9870
9967
  dedupe: Array.from(
9871
- /* @__PURE__ */ new Set([..._optionalChain([farmConfig, 'access', _504 => _504.resolve, 'optionalAccess', _505 => _505.dedupe]) || [], ..._optionalChain([userConfig, 'access', _506 => _506.resolve, 'optionalAccess', _507 => _507.dedupe]) || []])
9968
+ /* @__PURE__ */ new Set([..._optionalChain([farmConfig, 'access', _510 => _510.resolve, 'optionalAccess', _511 => _511.dedupe]) || [], ..._optionalChain([userConfig, 'access', _512 => _512.resolve, 'optionalAccess', _513 => _513.dedupe]) || []])
9872
9969
  )
9873
9970
  },
9874
9971
  optimizeDeps: {
@@ -9878,21 +9975,21 @@ function mergeFarmViteConfig(farmConfig, userConfig = {}) {
9878
9975
  holdUntilCrawlEnd,
9879
9976
  include: Array.from(
9880
9977
  /* @__PURE__ */ new Set([
9881
- ..._optionalChain([farmConfig, 'access', _508 => _508.optimizeDeps, 'optionalAccess', _509 => _509.include]) || [],
9882
- ..._optionalChain([userConfig, 'access', _510 => _510.optimizeDeps, 'optionalAccess', _511 => _511.include]) || []
9978
+ ..._optionalChain([farmConfig, 'access', _514 => _514.optimizeDeps, 'optionalAccess', _515 => _515.include]) || [],
9979
+ ..._optionalChain([userConfig, 'access', _516 => _516.optimizeDeps, 'optionalAccess', _517 => _517.include]) || []
9883
9980
  ])
9884
9981
  ),
9885
9982
  exclude: Array.from(
9886
9983
  /* @__PURE__ */ new Set([
9887
- ..._optionalChain([farmConfig, 'access', _512 => _512.optimizeDeps, 'optionalAccess', _513 => _513.exclude]) || [],
9888
- ..._optionalChain([userConfig, 'access', _514 => _514.optimizeDeps, 'optionalAccess', _515 => _515.exclude]) || []
9984
+ ..._optionalChain([farmConfig, 'access', _518 => _518.optimizeDeps, 'optionalAccess', _519 => _519.exclude]) || [],
9985
+ ..._optionalChain([userConfig, 'access', _520 => _520.optimizeDeps, 'optionalAccess', _521 => _521.exclude]) || []
9889
9986
  ])
9890
9987
  )
9891
9988
  },
9892
9989
  ssr: {
9893
9990
  ...farmConfig.ssr,
9894
9991
  ...userConfig.ssr,
9895
- noExternal: mergeNoExternal(_optionalChain([farmConfig, 'access', _516 => _516.ssr, 'optionalAccess', _517 => _517.noExternal]), _optionalChain([userConfig, 'access', _518 => _518.ssr, 'optionalAccess', _519 => _519.noExternal]))
9992
+ noExternal: mergeNoExternal(_optionalChain([farmConfig, 'access', _522 => _522.ssr, 'optionalAccess', _523 => _523.noExternal]), _optionalChain([userConfig, 'access', _524 => _524.ssr, 'optionalAccess', _525 => _525.noExternal]))
9896
9993
  }
9897
9994
  };
9898
9995
  }
@@ -9946,7 +10043,7 @@ function mergeFarmProductionViteConfig(farmConfig, userConfig = {}) {
9946
10043
  ...farmConfig.build,
9947
10044
  rollupOptions: {
9948
10045
  ...userBundlerOptions,
9949
- ..._optionalChain([farmConfig, 'access', _520 => _520.build, 'optionalAccess', _521 => _521.rollupOptions])
10046
+ ..._optionalChain([farmConfig, 'access', _526 => _526.build, 'optionalAccess', _527 => _527.rollupOptions])
9950
10047
  }
9951
10048
  },
9952
10049
  css: farmConfig.css || userCss ? { ...farmConfig.css, ...userCss } : void 0,
@@ -9954,7 +10051,7 @@ function mergeFarmProductionViteConfig(farmConfig, userConfig = {}) {
9954
10051
  esbuild: typeof userEsbuild === "object" && farmConfig.esbuild !== false ? { ...userEsbuild, ...farmConfig.esbuild } : _nullishCoalesce(farmConfig.esbuild, () => ( userEsbuild)),
9955
10052
  ssr: {
9956
10053
  ...merged.ssr,
9957
- external: mergeExternal(_optionalChain([farmConfig, 'access', _522 => _522.ssr, 'optionalAccess', _523 => _523.external]), _optionalChain([userConfig, 'access', _524 => _524.ssr, 'optionalAccess', _525 => _525.external]))
10054
+ external: mergeExternal(_optionalChain([farmConfig, 'access', _528 => _528.ssr, 'optionalAccess', _529 => _529.external]), _optionalChain([userConfig, 'access', _530 => _530.ssr, 'optionalAccess', _531 => _531.external]))
9958
10055
  }
9959
10056
  };
9960
10057
  }
@@ -9991,8 +10088,8 @@ function redactFarmDocsClientConfig(code, filename) {
9991
10088
  const current = node;
9992
10089
  if (current.type === "Property") {
9993
10090
  const name = propertyKeyName(current);
9994
- const valueType = _optionalChain([current, 'access', _526 => _526.value, 'optionalAccess', _527 => _527.type]);
9995
- const credential = name !== void 0 && (name.toLowerCase() === "headers" || _chunkHITLGIAOcjs.isSecretDocsConfigKey.call(void 0, name) && valueType !== "ObjectExpression" && valueType !== "ArrayExpression");
10091
+ const valueType = _optionalChain([current, 'access', _532 => _532.value, 'optionalAccess', _533 => _533.type]);
10092
+ const credential = name !== void 0 && (name.toLowerCase() === "headers" || _chunkCY2ZQ5C6cjs.isSecretDocsConfigKey.call(void 0, name) && valueType !== "ObjectExpression" && valueType !== "ArrayExpression");
9996
10093
  if (name && credential) {
9997
10094
  edits.push(
9998
10095
  current.shorthand || current.method || current.kind !== "init" ? { start: current.start, end: current.end, text: `${JSON.stringify(name)}: undefined` } : {
@@ -10033,7 +10130,7 @@ function farmDocsClientConfigPlugin(configModule) {
10033
10130
  name: "farm:docs-client-config",
10034
10131
  enforce: "pre",
10035
10132
  transform(code, id, options) {
10036
- if (_optionalChain([options, 'optionalAccess', _528 => _528.ssr]) || !isFarmDocsClientConfigModule(id, configModule)) return null;
10133
+ if (_optionalChain([options, 'optionalAccess', _534 => _534.ssr]) || !isFarmDocsClientConfigModule(id, configModule)) return null;
10037
10134
  const redacted = redactFarmDocsClientConfig(code, id.split("?")[0]);
10038
10135
  return redacted === null ? null : { code: redacted, map: null };
10039
10136
  }
@@ -10108,14 +10205,14 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, reportOpenAPIDevGenerationResult, "reportO
10108
10205
  // src/vite.ts
10109
10206
  var SERVER_FN_TRANSFORM_PLUGIN = "@farm.js/plugin/rsc:server-fn-actions";
10110
10207
  function farmLlmsTxtGeneratedPaths(config) {
10111
- const llms = _chunk4WQ6PGSJcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([config, 'access', _529 => _529.agent, 'optionalAccess', _530 => _530.llmsTxt]));
10208
+ const llms = _chunkWEW2JVA4cjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([config, 'access', _535 => _535.agent, 'optionalAccess', _536 => _536.llmsTxt]));
10112
10209
  if (!llms.enabled) return [];
10113
10210
  return llms.full ? ["/llms.txt", "/llms-full.txt"] : ["/llms.txt"];
10114
10211
  }
10115
10212
  _chunkS3JO3N4Hcjs.__name.call(void 0, farmLlmsTxtGeneratedPaths, "farmLlmsTxtGeneratedPaths");
10116
10213
  function farmAgentGeneratedPaths(config) {
10117
- const crawlers = _chunkMRMI32SNcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([config, 'access', _531 => _531.agent, 'optionalAccess', _532 => _532.crawlers]));
10118
- const sitemap = _chunkMRMI32SNcjs.resolveFarmAgentSitemap.call(void 0, _optionalChain([config, 'access', _533 => _533.agent, 'optionalAccess', _534 => _534.sitemap]));
10214
+ const crawlers = _chunkQTXBII4Zcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([config, 'access', _537 => _537.agent, 'optionalAccess', _538 => _538.crawlers]));
10215
+ const sitemap = _chunkQTXBII4Zcjs.resolveFarmAgentSitemap.call(void 0, _optionalChain([config, 'access', _539 => _539.agent, 'optionalAccess', _540 => _540.sitemap]));
10119
10216
  return [
10120
10217
  ...farmLlmsTxtGeneratedPaths(config),
10121
10218
  ...sitemap.enabled ? ["/sitemap.xml"] : [],
@@ -10165,7 +10262,7 @@ function loadFarmWorkflowsDevRuntime() {
10165
10262
  }
10166
10263
  _chunkS3JO3N4Hcjs.__name.call(void 0, loadFarmWorkflowsDevRuntime, "loadFarmWorkflowsDevRuntime");
10167
10264
  function loadFarmDevtoolsSnapshotRuntime() {
10168
- return import("./devtools-JXFQNWSH.cjs");
10265
+ return import("./devtools-VQWJANJV.cjs");
10169
10266
  }
10170
10267
  _chunkS3JO3N4Hcjs.__name.call(void 0, loadFarmDevtoolsSnapshotRuntime, "loadFarmDevtoolsSnapshotRuntime");
10171
10268
  function loadFarmDevtoolsUIRuntime() {
@@ -10181,7 +10278,7 @@ function farmI18nClientBridgePlugin() {
10181
10278
  name: "farm:i18n-client-bridge",
10182
10279
  enforce: "pre",
10183
10280
  resolveId(id, _importer, options) {
10184
- if (id === "@farm.js/core/i18n/server" && !_optionalChain([options, 'optionalAccess', _535 => _535.ssr])) {
10281
+ if (id === "@farm.js/core/i18n/server" && !_optionalChain([options, 'optionalAccess', _541 => _541.ssr])) {
10185
10282
  return FARM_I18N_CLIENT_BRIDGE_ID;
10186
10283
  }
10187
10284
  return null;
@@ -10206,7 +10303,7 @@ function farmServerOnlyEntriesPlugin() {
10206
10303
  resolveId(id, importer, options) {
10207
10304
  if (!FARM_SERVER_ONLY_ENTRIES.has(id)) return null;
10208
10305
  const importedBy = importer ? ` (imported by ${importer})` : "";
10209
- if (!_optionalChain([options, 'optionalAccess', _536 => _536.ssr])) {
10306
+ if (!_optionalChain([options, 'optionalAccess', _542 => _542.ssr])) {
10210
10307
  this.error(
10211
10308
  `${id} is server-only and cannot be imported into client code${importedBy}. Use it from an API route or another server module.`
10212
10309
  );
@@ -10252,11 +10349,11 @@ function renderFarmI18nStaticHead(requestPath, snapshot) {
10252
10349
  if (!snapshot) return "";
10253
10350
  const runtime = `<script>window.__FARM_I18N__ = ${serializeFarmInlineValue(snapshot)};</script>`;
10254
10351
  if (snapshot.routing === "none") return runtime;
10255
- return `${_chunkLOFKRKO7cjs.renderFarmLocaleAlternateLinks.call(void 0, requestPath, snapshot)}${runtime}`;
10352
+ return `${_chunk2DD4JMQCcjs.renderFarmLocaleAlternateLinks.call(void 0, requestPath, snapshot)}${runtime}`;
10256
10353
  }
10257
10354
  _chunkS3JO3N4Hcjs.__name.call(void 0, renderFarmI18nStaticHead, "renderFarmI18nStaticHead");
10258
10355
  function getPublicEnvDefine(config) {
10259
- const publicEnv = _optionalChain([config, 'access', _537 => _537.env, 'optionalAccess', _538 => _538.public]);
10356
+ const publicEnv = _optionalChain([config, 'access', _543 => _543.env, 'optionalAccess', _544 => _544.public]);
10260
10357
  if (!isResolvedEnvScope(publicEnv)) {
10261
10358
  return {};
10262
10359
  }
@@ -10279,7 +10376,7 @@ function createRequestFromNodeRequest(req, url, signal) {
10279
10376
  });
10280
10377
  }
10281
10378
  _chunkS3JO3N4Hcjs.__name.call(void 0, createRequestFromNodeRequest, "createRequestFromNodeRequest");
10282
- function withFarmRequestTracing(handler, apiRuntime, resolveTraceUrl = (request2) => _chunkNICDYKBScjs.resolveFarmRequestURL.call(void 0, request2)) {
10379
+ function withFarmRequestTracing(handler, apiRuntime, resolveTraceUrl = (request2) => _chunk6XWDE2P2cjs.resolveFarmRequestURL.call(void 0, request2)) {
10283
10380
  const middleware = _chunkMQ3H6LT5cjs._withAfterNodeMiddleware.call(void 0, handler);
10284
10381
  return (req, res, next) => {
10285
10382
  const traceUrl = resolveTraceUrl(req);
@@ -10297,7 +10394,7 @@ function withFarmRequestTracing(handler, apiRuntime, resolveTraceUrl = (request2
10297
10394
  return;
10298
10395
  }
10299
10396
  if (res.headersSent) {
10300
- _optionalChain([res, 'access', _539 => _539.destroy, 'optionalCall', _540 => _540(error instanceof Error ? error : new Error(String(error)))]);
10397
+ _optionalChain([res, 'access', _545 => _545.destroy, 'optionalCall', _546 => _546(error instanceof Error ? error : new Error(String(error)))]);
10301
10398
  return;
10302
10399
  }
10303
10400
  res.statusCode = 500;
@@ -10396,7 +10493,7 @@ function interceptFarmDevPageResponse(options) {
10396
10493
  const originalWrite = res.write.bind(res);
10397
10494
  const originalEnd = res.end.bind(res);
10398
10495
  const originalWriteHead = res.writeHead.bind(res);
10399
- const originalFlushHeaders = _optionalChain([res, 'access', _541 => _541.flushHeaders, 'optionalAccess', _542 => _542.bind, 'call', _543 => _543(res)]);
10496
+ const originalFlushHeaders = _optionalChain([res, 'access', _547 => _547.flushHeaders, 'optionalAccess', _548 => _548.bind, 'call', _549 => _549(res)]);
10400
10497
  let afterResponseCalled = false;
10401
10498
  let interceptedEnd = false;
10402
10499
  const htmlChunks = [];
@@ -10436,7 +10533,7 @@ function interceptFarmDevPageResponse(options) {
10436
10533
  const shouldBufferResponse = isHtmlResponse ? bufferPluginResponse : Boolean(runtimeSession && hasRuntimeAfterHook);
10437
10534
  if (shouldBufferResponse) {
10438
10535
  const callback = args.find((arg) => typeof arg === "function");
10439
- _optionalChain([callback, 'optionalCall', _544 => _544()]);
10536
+ _optionalChain([callback, 'optionalCall', _550 => _550()]);
10440
10537
  return true;
10441
10538
  }
10442
10539
  const writeResult = originalWrite(chunk, ...args);
@@ -10551,14 +10648,14 @@ function getEnvDefines(config, configEnv) {
10551
10648
  _chunkYFPGHF5Fcjs.getPublicFarmImageConfig.call(void 0, _chunkYFPGHF5Fcjs.resolveFarmImageConfig.call(void 0, config.images))
10552
10649
  )
10553
10650
  };
10554
- if (_optionalChain([configEnv, 'optionalAccess', _545 => _545.isSsrBuild])) {
10651
+ if (_optionalChain([configEnv, 'optionalAccess', _551 => _551.isSsrBuild])) {
10555
10652
  defines.__FARM_ENV__ = JSON.stringify(_chunkVEKFLAQMcjs.createBundledEnv.call(void 0, getFullEnvDefine(config)));
10556
10653
  }
10557
10654
  return defines;
10558
10655
  }
10559
10656
  _chunkS3JO3N4Hcjs.__name.call(void 0, getEnvDefines, "getEnvDefines");
10560
10657
  function getFarmAPIBaseURLDefine(config) {
10561
- const baseURL = _optionalChain([config, 'access', _546 => _546.api, 'optionalAccess', _547 => _547.baseURL]);
10658
+ const baseURL = _optionalChain([config, 'access', _552 => _552.api, 'optionalAccess', _553 => _553.baseURL]);
10562
10659
  return typeof baseURL === "string" && baseURL ? baseURL : _chunkS3A45T7Fcjs.DEFAULT_FARM_API_BASE_PATH;
10563
10660
  }
10564
10661
  _chunkS3JO3N4Hcjs.__name.call(void 0, getFarmAPIBaseURLDefine, "getFarmAPIBaseURLDefine");
@@ -10648,9 +10745,9 @@ function transformIsolatedClientBoundaryModule(options) {
10648
10745
  transformedExports++;
10649
10746
  }, "addWrapper");
10650
10747
  for (const node of body) {
10651
- if (_optionalChain([node, 'optionalAccess', _548 => _548.type]) === "ExportDefaultDeclaration" && node.declaration) {
10748
+ if (_optionalChain([node, 'optionalAccess', _554 => _554.type]) === "ExportDefaultDeclaration" && node.declaration) {
10652
10749
  const declaration2 = node.declaration;
10653
- if ((declaration2.type === "FunctionDeclaration" || declaration2.type === "ClassDeclaration") && _optionalChain([declaration2, 'access', _549 => _549.id, 'optionalAccess', _550 => _550.name])) {
10750
+ if ((declaration2.type === "FunctionDeclaration" || declaration2.type === "ClassDeclaration") && _optionalChain([declaration2, 'access', _555 => _555.id, 'optionalAccess', _556 => _556.name])) {
10654
10751
  replacements.push({
10655
10752
  start: node.start,
10656
10753
  end: node.end,
@@ -10668,14 +10765,14 @@ function transformIsolatedClientBoundaryModule(options) {
10668
10765
  }
10669
10766
  continue;
10670
10767
  }
10671
- if (_optionalChain([node, 'optionalAccess', _551 => _551.type]) !== "ExportNamedDeclaration" || !node.declaration) continue;
10768
+ if (_optionalChain([node, 'optionalAccess', _557 => _557.type]) !== "ExportNamedDeclaration" || !node.declaration) continue;
10672
10769
  const declaration = node.declaration;
10673
10770
  const declaredNames = [];
10674
- if ((declaration.type === "FunctionDeclaration" || declaration.type === "ClassDeclaration") && _optionalChain([declaration, 'access', _552 => _552.id, 'optionalAccess', _553 => _553.name])) {
10771
+ if ((declaration.type === "FunctionDeclaration" || declaration.type === "ClassDeclaration") && _optionalChain([declaration, 'access', _558 => _558.id, 'optionalAccess', _559 => _559.name])) {
10675
10772
  declaredNames.push(declaration.id.name);
10676
10773
  } else if (declaration.type === "VariableDeclaration") {
10677
10774
  for (const declarator of declaration.declarations || []) {
10678
- if (_optionalChain([declarator, 'access', _554 => _554.id, 'optionalAccess', _555 => _555.type]) === "Identifier") declaredNames.push(declarator.id.name);
10775
+ if (_optionalChain([declarator, 'access', _560 => _560.id, 'optionalAccess', _561 => _561.type]) === "Identifier") declaredNames.push(declarator.id.name);
10679
10776
  }
10680
10777
  }
10681
10778
  const componentNames = declaredNames.filter((name) => /^[A-Z]/.test(name));
@@ -10739,7 +10836,7 @@ function warnClientBoundaryOnce(context, id, code, config) {
10739
10836
  } catch (e38) {
10740
10837
  return;
10741
10838
  }
10742
- const publicKeys = new Set(Object.keys(_nullishCoalesce(_optionalChain([config, 'access', _556 => _556.env, 'optionalAccess', _557 => _557.public]), () => ( {}))));
10839
+ const publicKeys = new Set(Object.keys(_nullishCoalesce(_optionalChain([config, 'access', _562 => _562.env, 'optionalAccess', _563 => _563.public]), () => ( {}))));
10743
10840
  const findings = analyzeClientBoundary(program, publicKeys);
10744
10841
  if (findings.envKeys.length === 0 && findings.publicEnvKeys.length === 0 && findings.builtinImports.length === 0) {
10745
10842
  return;
@@ -10796,7 +10893,7 @@ function farmPlugin(options = {}, initialPluginManager) {
10796
10893
  config(userConfig, configEnv) {
10797
10894
  isBuild = configEnv.command === "build";
10798
10895
  const layerAliases = _chunkWBKEZXWEcjs.getFarmLayerAliases.call(void 0, options.layers);
10799
- const sourceAlias = hasViteAlias(_optionalChain([userConfig, 'access', _558 => _558.resolve, 'optionalAccess', _559 => _559.alias]), "@") ? {} : createFarmSourceAlias(options.root || process.cwd(), options.srcDir);
10896
+ const sourceAlias = hasViteAlias(_optionalChain([userConfig, 'access', _564 => _564.resolve, 'optionalAccess', _565 => _565.alias]), "@") ? {} : createFarmSourceAlias(options.root || process.cwd(), options.srcDir);
10800
10897
  const layerRoots = (_nullishCoalesce(options.layers, () => ( []))).map((layer) => layer.root);
10801
10898
  return {
10802
10899
  // Honor Farm's publicDir so the dev server serves the same static
@@ -10812,7 +10909,7 @@ function farmPlugin(options = {}, initialPluginManager) {
10812
10909
  server: {
10813
10910
  fs: {
10814
10911
  ...layerRoots.length ? { allow: [path21.resolve(options.root || process.cwd()), ...layerRoots] } : {},
10815
- deny: getFarmDevFsDeny(_optionalChain([userConfig, 'access', _560 => _560.server, 'optionalAccess', _561 => _561.fs, 'optionalAccess', _562 => _562.deny]), options)
10912
+ deny: getFarmDevFsDeny(_optionalChain([userConfig, 'access', _566 => _566.server, 'optionalAccess', _567 => _567.fs, 'optionalAccess', _568 => _568.deny]), options)
10816
10913
  }
10817
10914
  }
10818
10915
  };
@@ -10824,7 +10921,7 @@ function farmPlugin(options = {}, initialPluginManager) {
10824
10921
  serverFnTransformActive = config.plugins.some(
10825
10922
  (plugin) => plugin.name === SERVER_FN_TRANSFORM_PLUGIN
10826
10923
  );
10827
- if (_optionalChain([options, 'access', _563 => _563.experimental, 'optionalAccess', _564 => _564.serverActions]) === true && !serverFnTransformActive) {
10924
+ if (_optionalChain([options, 'access', _569 => _569.experimental, 'optionalAccess', _570 => _570.serverActions]) === true && !serverFnTransformActive) {
10828
10925
  _chunk5QIKR7RRcjs.logger.warn(
10829
10926
  "experimental.serverActions has no effect without @farm.js/plugin/rsc in the Vite plugins. Server functions stay server-only, and importing one from client code is a build error."
10830
10927
  );
@@ -10833,7 +10930,7 @@ function farmPlugin(options = {}, initialPluginManager) {
10833
10930
  async configureServer(viteServer) {
10834
10931
  viteServer.middlewares.use(
10835
10932
  createFarmDevPreviewGuard(viteServer, {
10836
- getSourceRoots: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => _chunkWBKEZXWEcjs.getFarmSourceRoots.call(void 0, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _565 => _565.getConfig, 'call', _566 => _566()]), () => ( options))), "getSourceRoots")
10933
+ getSourceRoots: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => _chunkWBKEZXWEcjs.getFarmSourceRoots.call(void 0, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _571 => _571.getConfig, 'call', _572 => _572()]), () => ( options))), "getSourceRoots")
10837
10934
  })
10838
10935
  );
10839
10936
  if (typeof fontImports.configureServer === "function") {
@@ -10858,10 +10955,10 @@ function farmPlugin(options = {}, initialPluginManager) {
10858
10955
  await farmApp.initialize();
10859
10956
  const farmConfig = farmApp.getConfig();
10860
10957
  let farmAppPackages;
10861
- if (_optionalChain([farmConfig, 'access', _567 => _567.agent, 'optionalAccess', _568 => _568.noindexPreviews])) {
10958
+ if (_optionalChain([farmConfig, 'access', _573 => _573.agent, 'optionalAccess', _574 => _574.noindexPreviews])) {
10862
10959
  server.middlewares.use((_req, res, next) => {
10863
10960
  if (_chunkCXP5U3RWcjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env)) {
10864
- res.setHeader("X-Robots-Tag", _chunkMRMI32SNcjs.FARM_PREVIEW_ROBOTS_TAG);
10961
+ res.setHeader("X-Robots-Tag", _chunkQTXBII4Zcjs.FARM_PREVIEW_ROBOTS_TAG);
10865
10962
  }
10866
10963
  next();
10867
10964
  });
@@ -10878,7 +10975,7 @@ function farmPlugin(options = {}, initialPluginManager) {
10878
10975
  validateRemoteUrl: createNodeImageUrlValidator(farmConfig.images),
10879
10976
  // Vite owns this address. Unlike request.url, it cannot be replaced by
10880
10977
  // a caller-controlled Host header.
10881
- trustedLocalOrigin: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => _optionalChain([server, 'access', _569 => _569.resolvedUrls, 'optionalAccess', _570 => _570.local, 'access', _571 => _571[0]]), "trustedLocalOrigin"),
10978
+ trustedLocalOrigin: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => _optionalChain([server, 'access', _575 => _575.resolvedUrls, 'optionalAccess', _576 => _576.local, 'access', _577 => _577[0]]), "trustedLocalOrigin"),
10882
10979
  onError(error) {
10883
10980
  _chunk5QIKR7RRcjs.logger.error(
10884
10981
  `Image optimization failed: ${error instanceof Error ? error.message : String(error)}`
@@ -10898,8 +10995,8 @@ function farmPlugin(options = {}, initialPluginManager) {
10898
10995
  const workflowConfig = farmConfig.workflows;
10899
10996
  const farmDocsDevRuntime = farmConfig.docs.enabled ? await loadFarmDocsDevRuntime() : null;
10900
10997
  const getExtraRouteTypes = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => [
10901
- ..._optionalChain([options, 'access', _572 => _572.openapi, 'optionalAccess', _573 => _573.enabled]) && options.openapi.route ? [options.openapi.route] : [],
10902
- ..._nullishCoalesce(_optionalChain([farmDocsDevRuntime, 'optionalAccess', _574 => _574.getFarmDocsRouteTypeEntries, 'call', _575 => _575(farmConfig.docs)]), () => ( []))
10998
+ ..._optionalChain([options, 'access', _578 => _578.openapi, 'optionalAccess', _579 => _579.enabled]) && options.openapi.route ? [options.openapi.route] : [],
10999
+ ..._nullishCoalesce(_optionalChain([farmDocsDevRuntime, 'optionalAccess', _580 => _580.getFarmDocsRouteTypeEntries, 'call', _581 => _581(farmConfig.docs)]), () => ( []))
10903
11000
  ], "getExtraRouteTypes");
10904
11001
  const appDirSlugs = sourceRoots.map(
10905
11002
  (source) => path21.join(source.root, source.srcDir, "app").replace(/\\/g, "/")
@@ -10946,7 +11043,7 @@ function farmPlugin(options = {}, initialPluginManager) {
10946
11043
  (source) => path21.join(source.root, source.srcDir).replace(/\\/g, "/")
10947
11044
  );
10948
11045
  const layerConfigFiles = new Set(
10949
- farmConfig.layers.map((layer) => _optionalChain([layer, 'access', _576 => _576.configFile, 'optionalAccess', _577 => _577.replace, 'call', _578 => _578(/\\/g, "/")])).filter((file) => Boolean(file))
11046
+ farmConfig.layers.map((layer) => _optionalChain([layer, 'access', _582 => _582.configFile, 'optionalAccess', _583 => _583.replace, 'call', _584 => _584(/\\/g, "/")])).filter((file) => Boolean(file))
10950
11047
  );
10951
11048
  const routeModuleExtensions = /* @__PURE__ */ new Set([
10952
11049
  ..._chunkPSV6XKPOcjs.resolveFarmComponentExtensions.call(void 0, farmConfig.renderer.componentExtensions),
@@ -11025,7 +11122,7 @@ function farmPlugin(options = {}, initialPluginManager) {
11025
11122
  scheduleTypeArtifactGen(file, ev, typeArtifacts);
11026
11123
  }
11027
11124
  if (isI18nCatalogFile(file)) {
11028
- _optionalChain([farmApp, 'optionalAccess', _579 => _579.getI18nRuntime, 'call', _580 => _580(), 'access', _581 => _581.reload, 'call', _582 => _582(), 'access', _583 => _583.then, 'call', _584 => _584(() => server.ws.send({ type: "full-reload", path: "*" })), 'access', _585 => _585.catch, 'call', _586 => _586((error) => _chunk5QIKR7RRcjs.logger.warn(`i18n catalog reload failed: ${error.message}`))]);
11125
+ _optionalChain([farmApp, 'optionalAccess', _585 => _585.getI18nRuntime, 'call', _586 => _586(), 'access', _587 => _587.reload, 'call', _588 => _588(), 'access', _589 => _589.then, 'call', _590 => _590(() => server.ws.send({ type: "full-reload", path: "*" })), 'access', _591 => _591.catch, 'call', _592 => _592((error) => _chunk5QIKR7RRcjs.logger.warn(`i18n catalog reload failed: ${error.message}`))]);
11029
11126
  }
11030
11127
  const isRouteRefreshEvent = (ev !== "change" || isStaticMetadataImageFile2(file)) && (isAppRuntimeFile(file) || isProgrammaticRouteFile(file) || isProgrammaticRouteSourceFile(file) && (ev === "unlink" || fileContainsProgrammaticPageRoute(file)));
11031
11128
  if (isRouteRefreshEvent) {
@@ -11038,8 +11135,8 @@ function farmPlugin(options = {}, initialPluginManager) {
11038
11135
  const reloadsMiddleware = pendingRouteRefreshIncludesMiddleware;
11039
11136
  pendingRouteRefreshIncludesMiddleware = false;
11040
11137
  Promise.all([
11041
- _optionalChain([refreshRouteDiscovery, 'optionalCall', _587 => _587(`${ev} ${file}`)]),
11042
- reloadsMiddleware ? _optionalChain([middlewareManager, 'optionalAccess', _588 => _588.reload, 'call', _589 => _589()]) : void 0
11138
+ _optionalChain([refreshRouteDiscovery, 'optionalCall', _593 => _593(`${ev} ${file}`)]),
11139
+ reloadsMiddleware ? _optionalChain([middlewareManager, 'optionalAccess', _594 => _594.reload, 'call', _595 => _595()]) : void 0
11043
11140
  ]).then(() => server.ws.send({ type: "full-reload", path: "*" })).catch((error) => _chunk5QIKR7RRcjs.logger.warn(`Route refresh failed: ${error.message}`));
11044
11141
  }, 50);
11045
11142
  }
@@ -11074,7 +11171,7 @@ function farmPlugin(options = {}, initialPluginManager) {
11074
11171
  });
11075
11172
  }
11076
11173
  const dispatchToDevServer = _chunkUXHS27O6cjs.createFarmDevServerDispatch.call(void 0, server);
11077
- apiRouteManager = new (0, _chunkU6MPZ35Qcjs.APIRouteManager)(appDirs, server, {
11174
+ apiRouteManager = new (0, _chunkRWFLWR5Jcjs.APIRouteManager)(appDirs, server, {
11078
11175
  plugins: farmConfig.plugins,
11079
11176
  i18n: farmApp.getI18nRuntime(),
11080
11177
  bodySizeLimit: serverConfig.bodySizeLimit,
@@ -11120,7 +11217,7 @@ function farmPlugin(options = {}, initialPluginManager) {
11120
11217
  });
11121
11218
  }
11122
11219
  }
11123
- middlewareManager = new (0, _chunkLPFV45AYcjs.MiddlewareManager)(
11220
+ middlewareManager = new (0, _chunkKCQBAKIYcjs.MiddlewareManager)(
11124
11221
  appDirs,
11125
11222
  server,
11126
11223
  farmConfig.middleware,
@@ -11129,6 +11226,9 @@ function farmPlugin(options = {}, initialPluginManager) {
11129
11226
  apiServerBasePath
11130
11227
  );
11131
11228
  await middlewareManager.discover();
11229
+ farmApp.getServerRenderer().setMiddlewareRouteLookup(
11230
+ () => middlewareManager.getMiddlewares().filter((entry) => entry.source !== "config")
11231
+ );
11132
11232
  if (pm) {
11133
11233
  for (const middleware of middlewareManager.getMiddlewares()) {
11134
11234
  await pm.runHookParallel("middlewareDiscovered", {
@@ -11138,11 +11238,11 @@ function farmPlugin(options = {}, initialPluginManager) {
11138
11238
  });
11139
11239
  }
11140
11240
  }
11141
- if (_optionalChain([options, 'access', _590 => _590.openapi, 'optionalAccess', _591 => _591.enabled])) {
11241
+ if (_optionalChain([options, 'access', _596 => _596.openapi, 'optionalAccess', _597 => _597.enabled])) {
11142
11242
  const { OpenAPIManager } = await loadFarmOpenAPIDevRuntime();
11143
11243
  openAPIManager = new OpenAPIManager(appDirs, options.openapi, {
11144
11244
  mode: "development",
11145
- apiBaseURL: typeof _optionalChain([options, 'access', _592 => _592.api, 'optionalAccess', _593 => _593.baseURL]) === "string" ? options.api.baseURL : void 0
11245
+ apiBaseURL: typeof _optionalChain([options, 'access', _598 => _598.api, 'optionalAccess', _599 => _599.baseURL]) === "string" ? options.api.baseURL : void 0
11146
11246
  });
11147
11247
  const spec = await openAPIManager.generateSpec();
11148
11248
  reportOpenAPIDevGenerationResult(spec);
@@ -11170,6 +11270,13 @@ function farmPlugin(options = {}, initialPluginManager) {
11170
11270
  return _chunkAMDMVWMIcjs.resolveFarmLayoutFonts.call(void 0, layoutModules);
11171
11271
  }, "resolveDocsLayoutFonts");
11172
11272
  releaseDocsMCPServers();
11273
+ const isFarmDocsPathGuarded = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (href) => _chunk2DD4JMQCcjs.farmPathGuardCoversPage.call(void 0,
11274
+ {
11275
+ config: farmConfig,
11276
+ middlewareRoutes: middlewareManager.getMiddlewares().filter((entry) => entry.source !== "config")
11277
+ },
11278
+ href
11279
+ ), "isFarmDocsPathGuarded");
11173
11280
  const farmDocsHandler = farmDocsDevRuntime ? farmDocsDevRuntime.hasFarmDocsRuntimeAdapter(farmConfig.docs) ? await farmDocsDevRuntime.createFarmDocsAdapterHandler(farmConfig.docs, {
11174
11281
  root: farmConfig.root,
11175
11282
  srcDir: farmConfig.srcDir,
@@ -11182,13 +11289,13 @@ function farmPlugin(options = {}, initialPluginManager) {
11182
11289
  ),
11183
11290
  loadModule: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (specifier) => {
11184
11291
  const resolved = await server.environments.ssr.pluginContainer.resolveId(specifier);
11185
- if (specifier === _optionalChain([farmConfig, 'access', _594 => _594.docs, 'access', _595 => _595.adapter, 'optionalAccess', _596 => _596.server]) && _optionalChain([resolved, 'optionalAccess', _597 => _597.id])) {
11292
+ if (specifier === _optionalChain([farmConfig, 'access', _600 => _600.docs, 'access', _601 => _601.adapter, 'optionalAccess', _602 => _602.server]) && _optionalChain([resolved, 'optionalAccess', _603 => _603.id])) {
11186
11293
  return import(
11187
11294
  /* @vite-ignore */
11188
11295
  _url.pathToFileURL.call(void 0, resolved.id).href
11189
11296
  );
11190
11297
  }
11191
- return _chunkSHLXACIOcjs.loadFarmDevModule.call(void 0, server, _nullishCoalesce(_optionalChain([resolved, 'optionalAccess', _598 => _598.id]), () => ( specifier)));
11298
+ return _chunkSHLXACIOcjs.loadFarmDevModule.call(void 0, server, _nullishCoalesce(_optionalChain([resolved, 'optionalAccess', _604 => _604.id]), () => ( specifier)));
11192
11299
  }, "loadModule"),
11193
11300
  registerMCPServer: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (mcpServer) => {
11194
11301
  const dispose = _chunk75RZHGLScjs.registerFarmMCPServer.call(void 0, mcpServer);
@@ -11197,7 +11304,8 @@ function farmPlugin(options = {}, initialPluginManager) {
11197
11304
  docsMCPServerDisposers.delete(dispose);
11198
11305
  dispose();
11199
11306
  };
11200
- }, "registerMCPServer")
11307
+ }, "registerMCPServer"),
11308
+ isPathGuarded: isFarmDocsPathGuarded
11201
11309
  }) : farmDocsDevRuntime.createFarmDocsHandler(farmConfig.docs, {
11202
11310
  root: farmConfig.root,
11203
11311
  srcDir: farmConfig.srcDir,
@@ -11208,10 +11316,11 @@ function farmPlugin(options = {}, initialPluginManager) {
11208
11316
  globalStylesheetHref: resolveDevGlobalStylesheetHref(
11209
11317
  farmConfig.root,
11210
11318
  farmConfig.srcDir
11211
- )
11319
+ ),
11320
+ isPathGuarded: isFarmDocsPathGuarded
11212
11321
  }) : null;
11213
11322
  const wrapFarmDocsResponseWithLayouts = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (request2, response) => {
11214
- if (request2.method === "HEAD" || response.headers.has("x-farm-docs-adapter") || !_optionalChain([response, 'access', _599 => _599.headers, 'access', _600 => _600.get, 'call', _601 => _601("content-type"), 'optionalAccess', _602 => _602.toLowerCase, 'call', _603 => _603(), 'access', _604 => _604.includes, 'call', _605 => _605("text/html")])) {
11323
+ if (request2.method === "HEAD" || response.headers.has("x-farm-docs-adapter") || !_optionalChain([response, 'access', _605 => _605.headers, 'access', _606 => _606.get, 'call', _607 => _607("content-type"), 'optionalAccess', _608 => _608.toLowerCase, 'call', _609 => _609(), 'access', _610 => _610.includes, 'call', _611 => _611("text/html")])) {
11215
11324
  return response;
11216
11325
  }
11217
11326
  const pathname = new URL(request2.url).pathname;
@@ -11232,7 +11341,7 @@ function farmPlugin(options = {}, initialPluginManager) {
11232
11341
  headers: response.headers
11233
11342
  });
11234
11343
  }
11235
- const docsRenderer = _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, (_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _606 => _606.getConfig, 'call', _607 => _607()]), () => ( options))).renderer);
11344
+ const docsRenderer = _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, (_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _612 => _612.getConfig, 'call', _613 => _613()]), () => ( options))).renderer);
11236
11345
  const [rendererRuntime, layoutModules] = await Promise.all([
11237
11346
  _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, docsRenderer) ? import("./renderer/react/server.cjs") : _chunkSHLXACIOcjs.loadFarmDevModule.call(void 0, server, docsRenderer.server),
11238
11347
  Promise.all(
@@ -11261,7 +11370,7 @@ function farmPlugin(options = {}, initialPluginManager) {
11261
11370
  ])
11262
11371
  );
11263
11372
  const inlineValue = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (value) => JSON.stringify(value).replace(/</g, "\\u003c").replace(/>/g, "\\u003e"), "inlineValue");
11264
- const pageModulePath = _optionalChain([matchedRoute, 'access', _608 => _608.route, 'optionalAccess', _609 => _609.modulePath]) ? toUrlPath(matchedRoute.route.modulePath) : "";
11373
+ const pageModulePath = _optionalChain([matchedRoute, 'access', _614 => _614.route, 'optionalAccess', _615 => _615.modulePath]) ? toUrlPath(matchedRoute.route.modulePath) : "";
11265
11374
  const bootstrapScript = `<script>
11266
11375
  window.__FARM_PROPS__ = ${inlineValue({ params })};
11267
11376
  window.__FARM_ROUTE_SLOTS__ = [];
@@ -11316,7 +11425,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11316
11425
  rootDir: farmConfig.root,
11317
11426
  srcDir: farmConfig.srcDir,
11318
11427
  docs: farmConfig.docs,
11319
- diagnostics: true
11428
+ diagnostics: true,
11429
+ isPathGuarded: isFarmDocsPathGuarded
11320
11430
  }) : null;
11321
11431
  const farmDocsFontAssets = new Map(
11322
11432
  farmDocsFontAssetList.map(({ url, sourcePath }) => [url, sourcePath])
@@ -11356,9 +11466,9 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11356
11466
  }, "dispatch")
11357
11467
  },
11358
11468
  (request2) => {
11359
- const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _610 => _610.getConfig, 'call', _611 => _611()]), () => ( options));
11469
+ const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _616 => _616.getConfig, 'call', _617 => _617()]), () => ( options));
11360
11470
  const currentServerConfig = _chunkKIIMAWOJcjs.resolveFarmServerConfig.call(void 0, currentConfig.server);
11361
- return _chunkNICDYKBScjs.resolveFarmRequestURL.call(void 0, request2, {
11471
+ return _chunk6XWDE2P2cjs.resolveFarmRequestURL.call(void 0, request2, {
11362
11472
  trustProxy: currentServerConfig.trustProxy
11363
11473
  });
11364
11474
  }
@@ -11367,9 +11477,9 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11367
11477
  withAPIRequestTracing(async (req, res, next) => {
11368
11478
  const requestUrl = req.url || "/";
11369
11479
  const requestMethod = req.method || "GET";
11370
- const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _612 => _612.getConfig, 'call', _613 => _613()]), () => ( options));
11480
+ const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _618 => _618.getConfig, 'call', _619 => _619()]), () => ( options));
11371
11481
  const currentServerConfig = _chunkKIIMAWOJcjs.resolveFarmServerConfig.call(void 0, currentConfig.server);
11372
- const parsedRequestUrl = _chunkNICDYKBScjs.resolveFarmRequestURL.call(void 0, req, {
11482
+ const parsedRequestUrl = _chunk6XWDE2P2cjs.resolveFarmRequestURL.call(void 0, req, {
11373
11483
  trustProxy: currentServerConfig.trustProxy
11374
11484
  });
11375
11485
  const fullUrl = parsedRequestUrl.toString();
@@ -11435,7 +11545,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11435
11545
  openapi: options.openapi
11436
11546
  },
11437
11547
  workflows: discoveredWorkflows,
11438
- plugins: _optionalChain([pm, 'optionalAccess', _614 => _614.getSortedPlugins, 'call', _615 => _615()])
11548
+ plugins: _optionalChain([pm, 'optionalAccess', _620 => _620.getSortedPlugins, 'call', _621 => _621()])
11439
11549
  });
11440
11550
  res.statusCode = 200;
11441
11551
  res.setHeader(
@@ -11458,7 +11568,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11458
11568
  return;
11459
11569
  }
11460
11570
  const runAppMiddlewareForContentRoute = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async () => {
11461
- if (!_optionalChain([middlewareManager, 'optionalAccess', _616 => _616.hasMiddleware, 'call', _617 => _617()])) return false;
11571
+ if (!_optionalChain([middlewareManager, 'optionalAccess', _622 => _622.hasMiddleware, 'call', _623 => _623()])) return false;
11462
11572
  const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
11463
11573
  return runFarmMiddlewareWithNavigation(
11464
11574
  farmApp.getServerRenderer(),
@@ -11469,7 +11579,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11469
11579
  );
11470
11580
  }, "runAppMiddlewareForContentRoute");
11471
11581
  const openAPIRequestPathname = openAPIManager ? _chunkI57LW5VZcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) : requestPathname;
11472
- if (openAPIManager && _optionalChain([options, 'access', _618 => _618.openapi, 'optionalAccess', _619 => _619.specRoute]) && openAPIRequestPathname === options.openapi.specRoute) {
11582
+ if (openAPIManager && _optionalChain([options, 'access', _624 => _624.openapi, 'optionalAccess', _625 => _625.specRoute]) && openAPIRequestPathname === options.openapi.specRoute) {
11473
11583
  if (await runAppMiddlewareForContentRoute()) return;
11474
11584
  if (requestMethod !== "GET" && requestMethod !== "HEAD") {
11475
11585
  res.statusCode = 405;
@@ -11486,43 +11596,52 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11486
11596
  res.end(requestMethod === "HEAD" ? void 0 : body);
11487
11597
  return;
11488
11598
  }
11489
- if (openAPIManager && openAPIRequestPathname === _optionalChain([options, 'access', _620 => _620.openapi, 'optionalAccess', _621 => _621.route])) {
11599
+ if (openAPIManager && openAPIRequestPathname === _optionalChain([options, 'access', _626 => _626.openapi, 'optionalAccess', _627 => _627.route])) {
11490
11600
  if (await runAppMiddlewareForContentRoute()) return;
11491
11601
  const docsHandler = openAPIManager.getDocsRouteHandler(parsedRequestUrl.origin);
11492
11602
  return docsHandler(req, res);
11493
11603
  }
11494
- if (_optionalChain([options, 'access', _622 => _622.agent, 'optionalAccess', _623 => _623.manifest]) !== false && _chunkLOFKRKO7cjs.isFarmAppManifestPath.call(void 0, _chunkI57LW5VZcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath))) {
11604
+ if (_optionalChain([options, 'access', _628 => _628.agent, 'optionalAccess', _629 => _629.manifest]) !== false && _chunk2DD4JMQCcjs.isFarmAppManifestPath.call(void 0, _chunkI57LW5VZcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath))) {
11495
11605
  if (await runAppMiddlewareForContentRoute()) return;
11496
11606
  _nullishCoalesce(farmAppPackages, () => ( (farmAppPackages = resolveFarmAppPackages(_nullishCoalesce(farmConfig.root, () => ( process.cwd()))))));
11497
11607
  const header = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (name) => String(_nullishCoalesce(req.headers[name], () => ( ""))), "header");
11498
- const manifest = await _chunkLOFKRKO7cjs.createFarmAppManifestResponse.call(void 0,
11608
+ const manifest = await _chunk2DD4JMQCcjs.createFarmAppManifestResponse.call(void 0,
11499
11609
  new Request(parsedRequestUrl, {
11500
11610
  method: requestMethod,
11501
11611
  headers: {
11502
11612
  "if-none-match": header("if-none-match"),
11503
- [_chunkLOFKRKO7cjs.FARM_INFRA_SIGNATURE_HEADER]: header(_chunkLOFKRKO7cjs.FARM_INFRA_SIGNATURE_HEADER)
11613
+ [_chunk2DD4JMQCcjs.FARM_INFRA_SIGNATURE_HEADER]: header(_chunk2DD4JMQCcjs.FARM_INFRA_SIGNATURE_HEADER)
11504
11614
  }
11505
11615
  }),
11506
11616
  {
11507
- ..._chunkLOFKRKO7cjs.resolveFarmAppManifestInput.call(void 0, farmConfig, {
11617
+ ..._chunk2DD4JMQCcjs.resolveFarmAppManifestInput.call(void 0, farmConfig, {
11508
11618
  build: "development",
11509
11619
  packages: farmAppPackages,
11510
11620
  // Read again on each request; unchanged files come from a cache.
11511
- webmcpTools: _optionalChain([farmConfig, 'access', _624 => _624.plugins, 'optionalAccess', _625 => _625.some, 'call', _626 => _626(({ name }) => name === "farm:webmcp")]) ? collectFarmWebMCPTools(_nullishCoalesce(farmConfig.root, () => ( process.cwd())), farmConfig.srcDir) : []
11621
+ webmcpTools: _optionalChain([farmConfig, 'access', _630 => _630.plugins, 'optionalAccess', _631 => _631.some, 'call', _632 => _632(({ name }) => name === "farm:webmcp")]) ? collectFarmWebMCPTools(_nullishCoalesce(farmConfig.root, () => ( process.cwd())), farmConfig.srcDir) : []
11512
11622
  }),
11513
- defaultMCP: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => farmApp.getServerRenderer().getDefaultMCPServer(), "defaultMCP")
11623
+ defaultMCP: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => farmApp.getServerRenderer().getDefaultMCPServer(), "defaultMCP"),
11624
+ // A guard written for an MCP server's path keeps its tools out of the public view.
11625
+ guardCoversPath: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (path22) => _chunk2DD4JMQCcjs.farmPathGuardCoversEndpoint.call(void 0,
11626
+ {
11627
+ config: farmConfig,
11628
+ middlewareRoutes: middlewareManager.getMiddlewares().filter((entry) => entry.source !== "config")
11629
+ },
11630
+ path22,
11631
+ apiServerBasePath
11632
+ ), "guardCoversPath")
11514
11633
  }
11515
11634
  );
11516
11635
  await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0, res, manifest);
11517
11636
  return;
11518
11637
  }
11519
- if (_optionalChain([options, 'access', _627 => _627.agent, 'optionalAccess', _628 => _628.apiCatalog]) && _chunkI57LW5VZcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) === _chunkLOFKRKO7cjs.FARM_API_CATALOG_PATH) {
11638
+ if (_optionalChain([options, 'access', _633 => _633.agent, 'optionalAccess', _634 => _634.apiCatalog]) && _chunkI57LW5VZcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) === _chunk2DD4JMQCcjs.FARM_API_CATALOG_PATH) {
11520
11639
  if (await runAppMiddlewareForContentRoute()) return;
11521
11640
  await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0,
11522
11641
  res,
11523
- _chunkLOFKRKO7cjs.createFarmApiCatalogResponse.call(void 0,
11642
+ _chunk2DD4JMQCcjs.createFarmApiCatalogResponse.call(void 0,
11524
11643
  requestMethod,
11525
- _chunkLOFKRKO7cjs.resolveFarmApiCatalogInput.call(void 0, { ...options, api: farmConfig.api }),
11644
+ _chunk2DD4JMQCcjs.resolveFarmApiCatalogInput.call(void 0, { ...options, api: farmConfig.api }),
11526
11645
  new Request(parsedRequestUrl, {
11527
11646
  headers: { "user-agent": String(_nullishCoalesce(req.headers["user-agent"], () => ( ""))) }
11528
11647
  })
@@ -11530,8 +11649,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11530
11649
  );
11531
11650
  return;
11532
11651
  }
11533
- if (_optionalChain([options, 'access', _629 => _629.agent, 'optionalAccess', _630 => _630.aiCatalog]) !== false) {
11534
- const aiCatalog = _chunkLOFKRKO7cjs.createFarmAiCatalogResponse.call(void 0,
11652
+ if (_optionalChain([options, 'access', _635 => _635.agent, 'optionalAccess', _636 => _636.aiCatalog]) !== false) {
11653
+ const aiCatalog = _chunk2DD4JMQCcjs.createFarmAiCatalogResponse.call(void 0,
11535
11654
  new Request(parsedRequestUrl, {
11536
11655
  method: requestMethod,
11537
11656
  headers: {
@@ -11579,7 +11698,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11579
11698
  return;
11580
11699
  }
11581
11700
  }
11582
- const markdownSourceResponse = viteModuleRequest ? null : await _chunkB5PFZLKVcjs.createFarmMarkdownSourceResponse.call(void 0, {
11701
+ const markdownSourceResponse = viteModuleRequest ? null : await _chunkEKN7NSZOcjs.createFarmMarkdownSourceResponse.call(void 0, {
11583
11702
  request: new Request(fullUrl, {
11584
11703
  method: requestMethod,
11585
11704
  headers: docsHeaders
@@ -11587,7 +11706,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11587
11706
  config: farmApp.getConfig().mdx,
11588
11707
  resolveSource: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (pathname2) => {
11589
11708
  const match = farmApp.getRouteManager().matchRoute(pathname2);
11590
- const sourcePath = _optionalChain([match, 'access', _631 => _631.route, 'optionalAccess', _632 => _632.markdownSourcePath]) || (match.route && _chunkB5PFZLKVcjs.isFarmMarkdownPageFile.call(void 0, match.route.modulePath) ? match.route.modulePath : null);
11709
+ const sourcePath = _optionalChain([match, 'access', _637 => _637.route, 'optionalAccess', _638 => _638.markdownSourcePath]) || (match.route && _chunkEKN7NSZOcjs.isFarmMarkdownPageFile.call(void 0, match.route.modulePath) ? match.route.modulePath : null);
11591
11710
  if (!sourcePath) {
11592
11711
  return null;
11593
11712
  }
@@ -11610,7 +11729,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11610
11729
  await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0, res, markdownSourceResponse);
11611
11730
  return;
11612
11731
  }
11613
- const markdownResponse = viteModuleRequest ? null : await _chunkEUV4YR3Vcjs.createMarkdownMirrorResponse.call(void 0, {
11732
+ const markdownResponse = viteModuleRequest ? null : await _chunkSGBJ247Qcjs.createMarkdownMirrorResponse.call(void 0, {
11614
11733
  request: new Request(fullUrl, {
11615
11734
  method: requestMethod,
11616
11735
  headers: docsHeaders
@@ -11639,21 +11758,21 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11639
11758
  await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0, res, markdownResponse);
11640
11759
  return;
11641
11760
  }
11642
- if (!viteModuleRequest && _chunkEUV4YR3Vcjs.farmRequestWantsMarkdown.call(void 0, requestPathname, req.headers.accept)) {
11643
- const markdownRoute = farmApp.getRouteManager().matchRoute(_chunkB5PFZLKVcjs.normalizeFarmMarkdownRoutePath.call(void 0, requestPathname));
11761
+ if (!viteModuleRequest && _chunkSGBJ247Qcjs.farmRequestWantsMarkdown.call(void 0, requestPathname, req.headers.accept)) {
11762
+ const markdownRoute = farmApp.getRouteManager().matchRoute(_chunkEKN7NSZOcjs.normalizeFarmMarkdownRoutePath.call(void 0, requestPathname));
11644
11763
  if (!markdownRoute.route) {
11645
11764
  if (await runAppMiddlewareForContentRoute()) return;
11646
11765
  res.statusCode = 404;
11647
- res.setHeader("Content-Type", _chunkEUV4YR3Vcjs.FARM_MARKDOWN_CONTENT_TYPE);
11766
+ res.setHeader("Content-Type", _chunkSGBJ247Qcjs.FARM_MARKDOWN_CONTENT_TYPE);
11648
11767
  res.setHeader("X-Farm-Markdown-Error", "404");
11649
11768
  res.setHeader("Cache-Control", "no-store");
11650
11769
  res.end(
11651
- _chunkEUV4YR3Vcjs.createFarmMarkdownErrorBody.call(void 0, 404, requestPathname, farmConfig.basePath || "/")
11770
+ _chunkSGBJ247Qcjs.createFarmMarkdownErrorBody.call(void 0, 404, requestPathname, farmConfig.basePath || "/")
11652
11771
  );
11653
11772
  return;
11654
11773
  }
11655
11774
  }
11656
- const markdownPageTarget = _chunkEUV4YR3Vcjs.resolveMarkdownMirrorTarget.call(void 0,
11775
+ const markdownPageTarget = _chunkSGBJ247Qcjs.resolveMarkdownMirrorTarget.call(void 0,
11657
11776
  farmApp.getConfig().md,
11658
11777
  requestPathname,
11659
11778
  {
@@ -11666,7 +11785,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11666
11785
  if (!varyValues.some((value) => value.toLowerCase() === "accept")) {
11667
11786
  res.setHeader("Vary", [...varyValues, "Accept"].join(", "));
11668
11787
  }
11669
- const alternatePath = _chunkEUV4YR3Vcjs.getFarmMarkdownMirrorPath.call(void 0, markdownPageTarget.pathname);
11788
+ const alternatePath = _chunkSGBJ247Qcjs.getFarmMarkdownMirrorPath.call(void 0, markdownPageTarget.pathname);
11670
11789
  const alternateLink = `<${alternatePath}>; rel="alternate"; type="text/markdown"`;
11671
11790
  const currentLink = res.getHeader("Link");
11672
11791
  res.setHeader(
@@ -11704,7 +11823,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11704
11823
  }
11705
11824
  const configuredIntegrations = currentConfig.integrations;
11706
11825
  const tryConfiguredIntegrationRoute = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async () => {
11707
- const matchedRoute = _chunkUJZLSXUBcjs.matchIntegrationRoute.call(void 0, configuredIntegrations, {
11826
+ const matchedRoute = _chunkVU6AAZVYcjs.matchIntegrationRoute.call(void 0, configuredIntegrations, {
11708
11827
  pathname: requestPathname,
11709
11828
  method: requestMethod
11710
11829
  });
@@ -11717,8 +11836,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11717
11836
  await pm.runHookParallelFiltered(
11718
11837
  "beforeRequest",
11719
11838
  (plugin) => {
11720
- const owner = _chunkUJZLSXUBcjs.getFarmIntegrationPluginOwner.call(void 0, plugin);
11721
- return plugin.name !== _chunkADOAUDQ6cjs.FARM_CONFIG_REWRITES_PLUGIN_NAME && (_optionalChain([owner, 'optionalAccess', _633 => _633.source]) !== "lifecycle" || owner.key !== matchedRoute.key);
11839
+ const owner = _chunkVU6AAZVYcjs.getFarmIntegrationPluginOwner.call(void 0, plugin);
11840
+ return plugin.name !== _chunkVXEEATVDcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME && (_optionalChain([owner, 'optionalAccess', _639 => _639.source]) !== "lifecycle" || owner.key !== matchedRoute.key);
11722
11841
  },
11723
11842
  req,
11724
11843
  res
@@ -11746,7 +11865,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11746
11865
  signal: _chunkKIIMAWOJcjs.createFarmNodeRequestAbortSignal.call(void 0, req, res)
11747
11866
  });
11748
11867
  const dispatchIntegration = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (request2) => {
11749
- const result = await _chunkUJZLSXUBcjs.dispatchIntegrationRequest.call(void 0,
11868
+ const result = await _chunkVU6AAZVYcjs.dispatchIntegrationRequest.call(void 0,
11750
11869
  {
11751
11870
  integration: matchedRoute.integration,
11752
11871
  config: currentConfig,
@@ -11809,11 +11928,11 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11809
11928
  }
11810
11929
  const matchedApiRoute = apiRouteManager.matchRoute(requestPathname);
11811
11930
  const hasMatchedApiRoute = Boolean(matchedApiRoute);
11812
- if (hasMatchedApiRoute || _chunkNDILNQ4Lcjs.isFarmAPIPathname.call(void 0, requestPathname, apiServerBasePath)) {
11931
+ if (hasMatchedApiRoute || _chunkXKG2BLFNcjs.isFarmAPIPathname.call(void 0, requestPathname, apiServerBasePath)) {
11813
11932
  const startTime2 = Date.now();
11814
11933
  const method2 = req.method || "GET";
11815
11934
  const urlPath2 = req.url || "/";
11816
- const pathname2 = _chunkNICDYKBScjs.resolveFarmRequestURL.call(void 0, req, {
11935
+ const pathname2 = _chunk6XWDE2P2cjs.resolveFarmRequestURL.call(void 0, req, {
11817
11936
  trustProxy: currentServerConfig.trustProxy
11818
11937
  }).pathname;
11819
11938
  try {
@@ -11821,7 +11940,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11821
11940
  if (hasMatchedApiRoute) {
11822
11941
  await pm.runHookParallelFiltered(
11823
11942
  "beforeRequest",
11824
- (plugin) => plugin.name !== _chunkADOAUDQ6cjs.FARM_CONFIG_REWRITES_PLUGIN_NAME,
11943
+ (plugin) => plugin.name !== _chunkVXEEATVDcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME,
11825
11944
  req,
11826
11945
  res
11827
11946
  );
@@ -11848,7 +11967,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11848
11967
  const apiHandler = apiRouteManager.getHandler({ throwOnError: true });
11849
11968
  const hasExplicitAPIRoute = hasMatchedApiRoute || Boolean(apiRouteManager.matchRoute(pathname2));
11850
11969
  if (apiHandler && hasExplicitAPIRoute) {
11851
- const apiRoutePattern = _optionalChain([matchedApiRoute, 'optionalAccess', _634 => _634.route, 'access', _635 => _635.path]) || _optionalChain([apiRouteManager, 'access', _636 => _636.matchRoute, 'call', _637 => _637(pathname2), 'optionalAccess', _638 => _638.route, 'access', _639 => _639.path]) || urlPath2;
11970
+ const apiRoutePattern = _optionalChain([matchedApiRoute, 'optionalAccess', _640 => _640.route, 'access', _641 => _641.path]) || _optionalChain([apiRouteManager, 'access', _642 => _642.matchRoute, 'call', _643 => _643(pathname2), 'optionalAccess', _644 => _644.route, 'access', _645 => _645.path]) || urlPath2;
11852
11971
  _chunkE3UK5IIBcjs.emitFarmEvent.call(void 0, {
11853
11972
  type: "route.matched",
11854
11973
  pathname: pathname2,
@@ -11938,7 +12057,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11938
12057
  return;
11939
12058
  }
11940
12059
  }
11941
- if (farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _640 => _640.isFarmDocsAPIRequest, 'call', _641 => _641(pathname2)])) {
12060
+ if (farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _646 => _646.isFarmDocsAPIRequest, 'call', _647 => _647(pathname2)])) {
11942
12061
  try {
11943
12062
  const url = `http://${req.headers.host || "localhost:3000"}${req.url}`;
11944
12063
  const headers = new Headers();
@@ -12011,18 +12130,18 @@ window.__FARM_MANIFEST__ = ${inlineValue({
12011
12130
  res.end(JSON.stringify({ error: "API route not found", pathname: pathname2 }));
12012
12131
  return;
12013
12132
  }
12014
- if (_optionalChain([req, 'access', _642 => _642.url, 'optionalAccess', _643 => _643.startsWith, 'call', _644 => _644("/@")]) || _optionalChain([req, 'access', _645 => _645.url, 'optionalAccess', _646 => _646.startsWith, 'call', _647 => _647("/node_modules")])) {
12133
+ if (_optionalChain([req, 'access', _648 => _648.url, 'optionalAccess', _649 => _649.startsWith, 'call', _650 => _650("/@")]) || _optionalChain([req, 'access', _651 => _651.url, 'optionalAccess', _652 => _652.startsWith, 'call', _653 => _653("/node_modules")])) {
12015
12134
  return next();
12016
12135
  }
12017
12136
  if (shouldBypassFarmRouterForDottedPath(
12018
12137
  requestPathname,
12019
- _optionalChain([farmApp, 'optionalAccess', _648 => _648.getRouteManager, 'call', _649 => _649()]),
12138
+ _optionalChain([farmApp, 'optionalAccess', _654 => _654.getRouteManager, 'call', _655 => _655()]),
12020
12139
  [server.config.publicDir, server.config.root],
12021
12140
  farmAgentGeneratedPaths(farmConfig)
12022
12141
  )) {
12023
12142
  return next();
12024
12143
  }
12025
- if (_optionalChain([req, 'access', _650 => _650.url, 'optionalAccess', _651 => _651.startsWith, 'call', _652 => _652("/__farm/page-data")])) {
12144
+ if (_optionalChain([req, 'access', _656 => _656.url, 'optionalAccess', _657 => _657.startsWith, 'call', _658 => _658("/__farm/page-data")])) {
12026
12145
  const urlObj = parsedRequestUrl;
12027
12146
  const targetPath = urlObj.searchParams.get("path") || "/";
12028
12147
  try {
@@ -12050,7 +12169,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
12050
12169
  });
12051
12170
  let middlewareMap = /* @__PURE__ */ new Map();
12052
12171
  let middlewareContext = /* @__PURE__ */ new Map();
12053
- if (_optionalChain([middlewareManager, 'optionalAccess', _653 => _653.hasMiddleware, 'call', _654 => _654()])) {
12172
+ if (_optionalChain([middlewareManager, 'optionalAccess', _659 => _659.hasMiddleware, 'call', _660 => _660()])) {
12054
12173
  const targetNodeRequest = createPageDataMiddlewareRequest(req, targetRequestUrl);
12055
12174
  const handled = await runFarmMiddlewareWithNavigation(
12056
12175
  farmApp.getServerRenderer(),
@@ -12078,10 +12197,10 @@ window.__FARM_MANIFEST__ = ${inlineValue({
12078
12197
  if (pm) {
12079
12198
  await pm.runHookParallel("afterRouteMatch", {
12080
12199
  pathname: targetPath,
12081
- matched: !!_optionalChain([match, 'optionalAccess', _655 => _655.route]),
12082
- routePattern: _optionalChain([match, 'optionalAccess', _656 => _656.route, 'optionalAccess', _657 => _657.pattern]) || null,
12083
- params: _optionalChain([match, 'optionalAccess', _658 => _658.params]) || {},
12084
- layoutPatterns: (_optionalChain([match, 'optionalAccess', _659 => _659.layouts]) || []).map((l) => l.pattern)
12200
+ matched: !!_optionalChain([match, 'optionalAccess', _661 => _661.route]),
12201
+ routePattern: _optionalChain([match, 'optionalAccess', _662 => _662.route, 'optionalAccess', _663 => _663.pattern]) || null,
12202
+ params: _optionalChain([match, 'optionalAccess', _664 => _664.params]) || {},
12203
+ layoutPatterns: (_optionalChain([match, 'optionalAccess', _665 => _665.layouts]) || []).map((l) => l.pattern)
12085
12204
  });
12086
12205
  }
12087
12206
  if (!match) {
@@ -12169,7 +12288,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
12169
12288
  mergedMetadata = await _chunkEK4QAEFZcjs.mergeModuleViewport.call(void 0, mergedMetadata, routeModule, routeProps);
12170
12289
  mergedMetadata = _chunkEK4QAEFZcjs.addMetadataMarkdownAlternate.call(void 0,
12171
12290
  mergedMetadata,
12172
- _chunkEUV4YR3Vcjs.getFarmMarkdownAlternatePath.call(void 0, farmApp.getConfig().md, targetRequestUrl.pathname)
12291
+ _chunkSGBJ247Qcjs.getFarmMarkdownAlternatePath.call(void 0, farmApp.getConfig().md, targetRequestUrl.pathname)
12173
12292
  );
12174
12293
  const routeSlots = await Promise.all(
12175
12294
  slots.map(async (slot) => {
@@ -12234,13 +12353,13 @@ window.__FARM_MANIFEST__ = ${inlineValue({
12234
12353
  destinationLayoutPatterns
12235
12354
  );
12236
12355
  const renderer = farmApp.getServerRenderer();
12237
- const fragmentHtml = await _chunkG2TEB74Scjs._runWithMiddlewareData.call(void 0,
12356
+ const fragmentHtml = await _chunkZXH4TS3Fcjs._runWithMiddlewareData.call(void 0,
12238
12357
  middlewareMap,
12239
- () => _chunkG2TEB74Scjs._runWithMiddlewareContext.call(void 0,
12358
+ () => _chunkZXH4TS3Fcjs._runWithMiddlewareContext.call(void 0,
12240
12359
  middlewareContext,
12241
12360
  () => renderer.renderNavigationFragment({
12242
12361
  PageComponent: routeModule.default,
12243
- LoadingComponent: _optionalChain([loadingModule, 'optionalAccess', _660 => _660.default]),
12362
+ LoadingComponent: _optionalChain([loadingModule, 'optionalAccess', _666 => _666.default]),
12244
12363
  pageProps: routeProps,
12245
12364
  params,
12246
12365
  layouts: layouts.map((layout, index) => ({
@@ -12344,18 +12463,18 @@ window.__FARM_MANIFEST__ = ${inlineValue({
12344
12463
  const startTime = Date.now();
12345
12464
  const method = req.method || "GET";
12346
12465
  const urlPath = req.url || "/";
12347
- const requestedPathname = _chunkNICDYKBScjs.resolveFarmRequestURL.call(void 0, req, {
12466
+ const requestedPathname = _chunk6XWDE2P2cjs.resolveFarmRequestURL.call(void 0, req, {
12348
12467
  trustProxy: currentServerConfig.trustProxy
12349
12468
  }).pathname;
12350
12469
  const routeManager2 = farmApp.getRouteManager();
12351
- const hasBeforeRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _661 => _661.hasHook, 'call', _662 => _662("beforeRouteMatch")]), () => ( false));
12352
- const hasAfterRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _663 => _663.hasHook, 'call', _664 => _664("afterRouteMatch")]), () => ( false));
12353
- const hasBeforeRequestHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _665 => _665.hasHook, 'call', _666 => _666("beforeRequest")]), () => ( false));
12354
- const hasBeforeRenderHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _667 => _667.hasHook, 'call', _668 => _668("beforeRender")]), () => ( false));
12355
- const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _669 => _669.hasHook, 'call', _670 => _670("afterResponse")]), () => ( false));
12356
- const hasHTMLTransformHook = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _671 => _671.hasHook, 'call', _672 => _672("transformHTML")]), () => ( false))) || (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _673 => _673.hasHook, 'call', _674 => _674("afterRender")]), () => ( false)));
12357
- const hasRuntimeRequestHooks = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _675 => _675.hasRuntimeRequestHooks, 'call', _676 => _676()]), () => ( false));
12358
- const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _677 => _677.hasRuntimeHook, 'call', _678 => _678("after")]), () => ( false));
12470
+ const hasBeforeRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _667 => _667.hasHook, 'call', _668 => _668("beforeRouteMatch")]), () => ( false));
12471
+ const hasAfterRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _669 => _669.hasHook, 'call', _670 => _670("afterRouteMatch")]), () => ( false));
12472
+ const hasBeforeRequestHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _671 => _671.hasHook, 'call', _672 => _672("beforeRequest")]), () => ( false));
12473
+ const hasBeforeRenderHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _673 => _673.hasHook, 'call', _674 => _674("beforeRender")]), () => ( false));
12474
+ const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _675 => _675.hasHook, 'call', _676 => _676("afterResponse")]), () => ( false));
12475
+ const hasHTMLTransformHook = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _677 => _677.hasHook, 'call', _678 => _678("transformHTML")]), () => ( false))) || (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _679 => _679.hasHook, 'call', _680 => _680("afterRender")]), () => ( false)));
12476
+ const hasRuntimeRequestHooks = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _681 => _681.hasRuntimeRequestHooks, 'call', _682 => _682()]), () => ( false));
12477
+ const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _683 => _683.hasRuntimeHook, 'call', _684 => _684("after")]), () => ( false));
12359
12478
  const requestedMatch = routeManager2.matchRoute(requestedPathname);
12360
12479
  let runtimeSession;
12361
12480
  if (pm && hasRuntimeRequestHooks) {
@@ -12366,8 +12485,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
12366
12485
  kind: "page",
12367
12486
  route: {
12368
12487
  pathname: requestedPathname,
12369
- pattern: _optionalChain([requestedMatch, 'optionalAccess', _679 => _679.route, 'optionalAccess', _680 => _680.pattern]) || null,
12370
- params: _optionalChain([requestedMatch, 'optionalAccess', _681 => _681.params]) || {}
12488
+ pattern: _optionalChain([requestedMatch, 'optionalAccess', _685 => _685.route, 'optionalAccess', _686 => _686.pattern]) || null,
12489
+ params: _optionalChain([requestedMatch, 'optionalAccess', _687 => _687.params]) || {}
12371
12490
  }
12372
12491
  }
12373
12492
  );
@@ -12400,17 +12519,17 @@ window.__FARM_MANIFEST__ = ${inlineValue({
12400
12519
  if (pm && hasAfterRouteMatchHook) {
12401
12520
  await pm.runHookParallel("afterRouteMatch", {
12402
12521
  pathname,
12403
- matched: !!_optionalChain([routeMatch, 'optionalAccess', _682 => _682.route]),
12404
- routePattern: _optionalChain([routeMatch, 'optionalAccess', _683 => _683.route, 'optionalAccess', _684 => _684.pattern]) || null,
12405
- params: _optionalChain([routeMatch, 'optionalAccess', _685 => _685.params]) || {},
12406
- layoutPatterns: (_optionalChain([routeMatch, 'optionalAccess', _686 => _686.layouts]) || []).map((l) => l.pattern)
12522
+ matched: !!_optionalChain([routeMatch, 'optionalAccess', _688 => _688.route]),
12523
+ routePattern: _optionalChain([routeMatch, 'optionalAccess', _689 => _689.route, 'optionalAccess', _690 => _690.pattern]) || null,
12524
+ params: _optionalChain([routeMatch, 'optionalAccess', _691 => _691.params]) || {},
12525
+ layoutPatterns: (_optionalChain([routeMatch, 'optionalAccess', _692 => _692.layouts]) || []).map((l) => l.pattern)
12407
12526
  });
12408
12527
  }
12409
12528
  const renderPayload = {
12410
12529
  pathname,
12411
12530
  method,
12412
- routePattern: _optionalChain([routeMatch, 'optionalAccess', _687 => _687.route, 'optionalAccess', _688 => _688.pattern]) || null,
12413
- params: _optionalChain([routeMatch, 'optionalAccess', _689 => _689.params]) || {}
12531
+ routePattern: _optionalChain([routeMatch, 'optionalAccess', _693 => _693.route, 'optionalAccess', _694 => _694.pattern]) || null,
12532
+ params: _optionalChain([routeMatch, 'optionalAccess', _695 => _695.params]) || {}
12414
12533
  };
12415
12534
  const shouldInterceptResponse = Boolean(
12416
12535
  pm && (hasAfterResponseHook || hasHTMLTransformHook || runtimeSession && hasRuntimeAfterHook)
@@ -12432,7 +12551,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
12432
12551
  emitError: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (error) => emitPluginError("response-end", error, { pathname }), "emitError")
12433
12552
  }) : void 0;
12434
12553
  try {
12435
- if (_optionalChain([middlewareManager, 'optionalAccess', _690 => _690.hasMiddleware, 'call', _691 => _691()])) {
12554
+ if (_optionalChain([middlewareManager, 'optionalAccess', _696 => _696.hasMiddleware, 'call', _697 => _697()])) {
12436
12555
  const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
12437
12556
  const handled = await runFarmMiddlewareWithNavigation(
12438
12557
  farmApp.getServerRenderer(),
@@ -12442,7 +12561,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
12442
12561
  () => middlewareManager.execute(req, res)
12443
12562
  );
12444
12563
  if (handled) {
12445
- if (!_optionalChain([responseInterceptor, 'optionalAccess', _692 => _692.isEnded, 'call', _693 => _693()])) {
12564
+ if (!_optionalChain([responseInterceptor, 'optionalAccess', _698 => _698.isEnded, 'call', _699 => _699()])) {
12446
12565
  const duration = Date.now() - startTime;
12447
12566
  logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
12448
12567
  }
@@ -12454,16 +12573,16 @@ window.__FARM_MANIFEST__ = ${inlineValue({
12454
12573
  req.url || "/",
12455
12574
  `http://${req.headers.host || "localhost:3000"}`
12456
12575
  ).pathname;
12457
- const hasLocalPageRoute = Boolean(_optionalChain([routeManager2, 'access', _694 => _694.matchRoute, 'call', _695 => _695(currentPathname), 'optionalAccess', _696 => _696.route]));
12576
+ const hasLocalPageRoute = Boolean(_optionalChain([routeManager2, 'access', _700 => _700.matchRoute, 'call', _701 => _701(currentPathname), 'optionalAccess', _702 => _702.route]));
12458
12577
  await pm.runHookParallelFiltered(
12459
12578
  "beforeRequest",
12460
- (plugin) => !hasLocalPageRoute || plugin.name !== _chunkADOAUDQ6cjs.FARM_CONFIG_REWRITES_PLUGIN_NAME,
12579
+ (plugin) => !hasLocalPageRoute || plugin.name !== _chunkVXEEATVDcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME,
12461
12580
  req,
12462
12581
  res
12463
12582
  );
12464
12583
  }
12465
- if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess', _697 => _697.isEnded, 'call', _698 => _698()])) {
12466
- if (!_optionalChain([responseInterceptor, 'optionalAccess', _699 => _699.isEnded, 'call', _700 => _700()])) {
12584
+ if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess', _703 => _703.isEnded, 'call', _704 => _704()])) {
12585
+ if (!_optionalChain([responseInterceptor, 'optionalAccess', _705 => _705.isEnded, 'call', _706 => _706()])) {
12467
12586
  const duration = Date.now() - startTime;
12468
12587
  logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
12469
12588
  }
@@ -12521,68 +12640,68 @@ window.__FARM_MANIFEST__ = ${inlineValue({
12521
12640
  if (imageModule) return imageModule;
12522
12641
  }
12523
12642
  if (_chunk6V4TDWECcjs.parseProgrammaticRouteModuleId.call(void 0, id)) {
12524
- const renderer = _optionalChain([farmApp, 'optionalAccess', _701 => _701.getConfig, 'call', _702 => _702(), 'access', _703 => _703.renderer]) || _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, options.renderer);
12525
- return generateProgrammaticRouteModule(id, _optionalChain([server, 'optionalAccess', _704 => _704.config, 'access', _705 => _705.root]) || options.root, renderer);
12643
+ const renderer = _optionalChain([farmApp, 'optionalAccess', _707 => _707.getConfig, 'call', _708 => _708(), 'access', _709 => _709.renderer]) || _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, options.renderer);
12644
+ return generateProgrammaticRouteModule(id, _optionalChain([server, 'optionalAccess', _710 => _710.config, 'access', _711 => _711.root]) || options.root, renderer);
12526
12645
  }
12527
12646
  if (isFarmClientVirtualId(id)) {
12528
- const resolvedConfig = _optionalChain([farmApp, 'optionalAccess', _706 => _706.getConfig, 'call', _707 => _707()]);
12529
- const renderer = _optionalChain([resolvedConfig, 'optionalAccess', _708 => _708.renderer]) || _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, options.renderer);
12530
- const integrations = _optionalChain([resolvedConfig, 'optionalAccess', _709 => _709.integrations]) || options.integrations;
12531
- const root = _optionalChain([resolvedConfig, 'optionalAccess', _710 => _710.root]) || _optionalChain([server, 'optionalAccess', _711 => _711.config, 'access', _712 => _712.root]) || process.cwd();
12532
- const docs = _optionalChain([resolvedConfig, 'optionalAccess', _713 => _713.docs]);
12647
+ const resolvedConfig = _optionalChain([farmApp, 'optionalAccess', _712 => _712.getConfig, 'call', _713 => _713()]);
12648
+ const renderer = _optionalChain([resolvedConfig, 'optionalAccess', _714 => _714.renderer]) || _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, options.renderer);
12649
+ const integrations = _optionalChain([resolvedConfig, 'optionalAccess', _715 => _715.integrations]) || options.integrations;
12650
+ const root = _optionalChain([resolvedConfig, 'optionalAccess', _716 => _716.root]) || _optionalChain([server, 'optionalAccess', _717 => _717.config, 'access', _718 => _718.root]) || process.cwd();
12651
+ const docs = _optionalChain([resolvedConfig, 'optionalAccess', _719 => _719.docs]);
12533
12652
  const adapterOwnsDocsRuntime = Boolean(
12534
- _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([docs, 'optionalAccess', _714 => _714.adapter, 'optionalAccess', _715 => _715.server]) && docs.adapter.react
12653
+ _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([docs, 'optionalAccess', _720 => _720.adapter, 'optionalAccess', _721 => _721.server]) && docs.adapter.react
12535
12654
  );
12536
- const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _716 => _716.devtools]), () => ( _chunkYJRZR7VUcjs.resolveFarmDevtoolsConfig.call(void 0, false, "production")));
12655
+ const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _722 => _722.devtools]), () => ( _chunkYJRZR7VUcjs.resolveFarmDevtoolsConfig.call(void 0, false, "production")));
12537
12656
  const [docsRuntime, docsSearchRuntime, devtoolsClientRuntime] = await Promise.all([
12538
- _optionalChain([docs, 'optionalAccess', _717 => _717.enabled]) ? loadFarmDocsDevRuntime() : null,
12539
- _optionalChain([docs, 'optionalAccess', _718 => _718.enabled]) && !adapterOwnsDocsRuntime ? loadFarmDocsSearchDevRuntime() : null,
12657
+ _optionalChain([docs, 'optionalAccess', _723 => _723.enabled]) ? loadFarmDocsDevRuntime() : null,
12658
+ _optionalChain([docs, 'optionalAccess', _724 => _724.enabled]) && !adapterOwnsDocsRuntime ? loadFarmDocsSearchDevRuntime() : null,
12540
12659
  devtools.enabled ? loadFarmDevtoolsClientRuntime() : null
12541
12660
  ]);
12542
- const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess', _719 => _719.isFarmDocsSearchEnabled, 'call', _720 => _720(docs)]), () => ( false));
12661
+ const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess', _725 => _725.isFarmDocsSearchEnabled, 'call', _726 => _726(docs)]), () => ( false));
12543
12662
  const generatedDocsSearchRuntime = docsSearchRuntime ? docsSearchRuntime.generateFarmDocsSearchClientRuntime(
12544
12663
  docsSearchEnabled,
12545
12664
  docsSearchEnabled ? docsSearchRuntime.resolveFarmDocsSearchClientModule(root) : void 0
12546
12665
  ) : EMPTY_FARM_DOCS_SEARCH_CLIENT_RUNTIME;
12547
12666
  const generatedDevtoolsClientRuntime = devtoolsClientRuntime ? devtoolsClientRuntime.generateFarmDevtoolsClientRuntime(devtools) : "";
12548
12667
  const generatedDevIndicatorsClientRuntime = farmApp ? _chunk6MVFL3R5cjs.generateFarmDevIndicatorsClientRuntime.call(void 0, farmApp.getConfig().devIndicators) : "";
12549
- const integrationProviders = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? _chunkUJZLSXUBcjs.getIntegrationProviders.call(void 0, integrations) : [];
12668
+ const integrationProviders = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? _chunkVU6AAZVYcjs.getIntegrationProviders.call(void 0, integrations) : [];
12550
12669
  const isolatedHydrationMode = resolveFarmIsolatedClientHydrationMode(
12551
- _optionalChain([resolvedConfig, 'optionalAccess', _721 => _721.experimental, 'optionalAccess', _722 => _722.isolatedClientHydration]),
12670
+ _optionalChain([resolvedConfig, 'optionalAccess', _727 => _727.experimental, 'optionalAccess', _728 => _728.isolatedClientHydration]),
12552
12671
  {
12553
- serverComponents: _optionalChain([resolvedConfig, 'optionalAccess', _723 => _723.experimental, 'optionalAccess', _724 => _724.serverComponents]) === true,
12672
+ serverComponents: _optionalChain([resolvedConfig, 'optionalAccess', _729 => _729.experimental, 'optionalAccess', _730 => _730.serverComponents]) === true,
12554
12673
  hasUnsupportedIntegrationProvider: integrationProviders.filter((provider) => provider.component || provider.type === "clerk").some((provider) => provider.supportsIsolatedHydration !== true)
12555
12674
  }
12556
12675
  );
12557
12676
  return generateClientCode(
12558
12677
  integrationProviders,
12559
12678
  [
12560
- ..._chunkUJZLSXUBcjs.getIntegrationDocumentNavigationMatchers.call(void 0, integrations),
12561
- ..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess', _725 => _725.getFarmDocsDocumentNavigationMatchers, 'call', _726 => _726(docs)]), () => ( []))
12679
+ ..._chunkVU6AAZVYcjs.getIntegrationDocumentNavigationMatchers.call(void 0, integrations),
12680
+ ..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess', _731 => _731.getFarmDocsDocumentNavigationMatchers, 'call', _732 => _732(docs)]), () => ( []))
12562
12681
  ],
12563
12682
  generatedDocsSearchRuntime,
12564
12683
  `${generatedDevtoolsClientRuntime}
12565
12684
  ${generatedDevIndicatorsClientRuntime}`,
12566
- _optionalChain([resolvedConfig, 'optionalAccess', _727 => _727.plugins]) || [],
12685
+ _optionalChain([resolvedConfig, 'optionalAccess', _733 => _733.plugins]) || [],
12567
12686
  root,
12568
- _optionalChain([resolvedConfig, 'optionalAccess', _728 => _728.srcDir]) || options.srcDir || "src",
12569
- _optionalChain([resolvedConfig, 'optionalAccess', _729 => _729.publicRuntimeConfig]) || options.publicRuntimeConfig,
12570
- _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? _optionalChain([docs, 'optionalAccess', _730 => _730.adapter, 'optionalAccess', _731 => _731.react]) : void 0,
12687
+ _optionalChain([resolvedConfig, 'optionalAccess', _734 => _734.srcDir]) || options.srcDir || "src",
12688
+ _optionalChain([resolvedConfig, 'optionalAccess', _735 => _735.publicRuntimeConfig]) || options.publicRuntimeConfig,
12689
+ _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? _optionalChain([docs, 'optionalAccess', _736 => _736.adapter, 'optionalAccess', _737 => _737.react]) : void 0,
12571
12690
  renderer,
12572
- isolatedHydrationMode === "enabled" || _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([(_nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _732 => _732.getRouteManager, 'call', _733 => _733(), 'access', _734 => _734.getIsolatedClientBoundaryModules, 'call', _735 => _735(root)])))), 'optionalAccess', _736 => _736.size]) > 0,
12573
- _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _737 => _737.trailingSlash]), () => ( false)),
12574
- _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _738 => _738.basePath]), () => ( "/")),
12691
+ isolatedHydrationMode === "enabled" || _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([(_nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _738 => _738.getRouteManager, 'call', _739 => _739(), 'access', _740 => _740.getIsolatedClientBoundaryModules, 'call', _741 => _741(root)])))), 'optionalAccess', _742 => _742.size]) > 0,
12692
+ _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _743 => _743.trailingSlash]), () => ( false)),
12693
+ _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _744 => _744.basePath]), () => ( "/")),
12575
12694
  generateClientCachePersistenceCode(
12576
- resolveFarmClientCacheAdapterEntry(root, _optionalChain([resolvedConfig, 'optionalAccess', _739 => _739.cache]))
12695
+ resolveFarmClientCacheAdapterEntry(root, _optionalChain([resolvedConfig, 'optionalAccess', _745 => _745.cache]))
12577
12696
  ),
12578
- _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? _chunkHITLGIAOcjs.getFarmDocsAdapterConfigModule.call(void 0, docs) : void 0
12697
+ _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, renderer) ? _chunkCY2ZQ5C6cjs.getFarmDocsAdapterConfigModule.call(void 0, docs) : void 0
12579
12698
  );
12580
12699
  }
12581
12700
  if (id === "/@farm/server") {
12582
12701
  return generateServerCode();
12583
12702
  }
12584
12703
  if (id === "/@farm/manifest") {
12585
- const routeManager = _optionalChain([farmApp, 'optionalAccess', _740 => _740.getRouteManager, 'call', _741 => _741()]);
12704
+ const routeManager = _optionalChain([farmApp, 'optionalAccess', _746 => _746.getRouteManager, 'call', _747 => _747()]);
12586
12705
  if (!routeManager) {
12587
12706
  return `
12588
12707
  export const getManifest = () => ({
@@ -12597,7 +12716,7 @@ export const getManifest = () => ({
12597
12716
  const manifest = routeManager.generateClientManifest(server.config.root);
12598
12717
  const globalStylesheetHref = resolveDevGlobalStylesheetHref(
12599
12718
  server.config.root,
12600
- _optionalChain([farmApp, 'optionalAccess', _742 => _742.getConfig, 'call', _743 => _743(), 'access', _744 => _744.srcDir])
12719
+ _optionalChain([farmApp, 'optionalAccess', _748 => _748.getConfig, 'call', _749 => _749(), 'access', _750 => _750.srcDir])
12601
12720
  );
12602
12721
  const fullManifest = {
12603
12722
  clientEntry: "/@farm/client.js",
@@ -12623,11 +12742,11 @@ export const getManifest = () => ({
12623
12742
  };
12624
12743
  }
12625
12744
  for (const layout of manifest.layouts) {
12626
- const groupScope = _chunkLOFKRKO7cjs.getRouteGroupScope.call(void 0, layout.pattern);
12745
+ const groupScope = _chunk2DD4JMQCcjs.getRouteGroupScope.call(void 0, layout.pattern);
12627
12746
  fullManifest.layouts[layout.pattern] = {
12628
12747
  modulePath: layout.modulePath,
12629
12748
  pattern: layout.pattern,
12630
- ...groupScope ? { urlPattern: _chunkLOFKRKO7cjs.stripRouteGroups.call(void 0, layout.pattern), groupScope } : {},
12749
+ ...groupScope ? { urlPattern: _chunk2DD4JMQCcjs.stripRouteGroups.call(void 0, layout.pattern), groupScope } : {},
12631
12750
  shouldHydrate: layout.shouldHydrate,
12632
12751
  islandStrategy: layout.islandStrategy,
12633
12752
  preloads: [layout.modulePath],
@@ -12651,24 +12770,24 @@ export const manifest = getManifest();
12651
12770
  }
12652
12771
  },
12653
12772
  async transform(code, id, transformOptions) {
12654
- if (!_optionalChain([transformOptions, 'optionalAccess', _745 => _745.ssr])) {
12655
- const docsConfigModule = _chunkHITLGIAOcjs.getFarmDocsAdapterConfigModule.call(void 0, _optionalChain([farmApp, 'optionalAccess', _746 => _746.getConfig, 'call', _747 => _747(), 'optionalAccess', _748 => _748.docs]));
12773
+ if (!_optionalChain([transformOptions, 'optionalAccess', _751 => _751.ssr])) {
12774
+ const docsConfigModule = _chunkCY2ZQ5C6cjs.getFarmDocsAdapterConfigModule.call(void 0, _optionalChain([farmApp, 'optionalAccess', _752 => _752.getConfig, 'call', _753 => _753(), 'optionalAccess', _754 => _754.docs]));
12656
12775
  if (isFarmDocsClientConfigModule(id, docsConfigModule)) {
12657
12776
  const redacted = redactFarmDocsClientConfig(code, id.split("?")[0]);
12658
12777
  if (redacted !== null) return { code: redacted, map: null };
12659
12778
  }
12660
12779
  }
12661
- if (!_optionalChain([transformOptions, 'optionalAccess', _749 => _749.ssr])) {
12662
- const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _750 => _750.getConfig, 'call', _751 => _751()]), () => ( options));
12663
- if (_optionalChain([currentConfig, 'access', _752 => _752.experimental, 'optionalAccess', _753 => _753.serverActions]) !== true || !serverFnTransformActive) {
12780
+ if (!_optionalChain([transformOptions, 'optionalAccess', _755 => _755.ssr])) {
12781
+ const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _756 => _756.getConfig, 'call', _757 => _757()]), () => ( options));
12782
+ if (_optionalChain([currentConfig, 'access', _758 => _758.experimental, 'optionalAccess', _759 => _759.serverActions]) !== true || !serverFnTransformActive) {
12664
12783
  const violation = findClientServerFnViolation(code, id);
12665
12784
  if (violation) {
12666
12785
  this.error(formatServerFnBoundaryError(violation, id));
12667
12786
  }
12668
12787
  }
12669
12788
  }
12670
- if (!_optionalChain([transformOptions, 'optionalAccess', _754 => _754.ssr]) && shouldInspectClientBoundary(id, code)) {
12671
- warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _755 => _755.getConfig, 'call', _756 => _756()]), () => ( options)));
12789
+ if (!_optionalChain([transformOptions, 'optionalAccess', _760 => _760.ssr]) && shouldInspectClientBoundary(id, code)) {
12790
+ warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _761 => _761.getConfig, 'call', _762 => _762()]), () => ( options)));
12672
12791
  }
12673
12792
  if (typeof imageImports.transform === "function") {
12674
12793
  const imageModule = await imageImports.transform.call(this, code, id, transformOptions);
@@ -12683,13 +12802,13 @@ export const manifest = getManifest();
12683
12802
  id,
12684
12803
  transformOptions
12685
12804
  );
12686
- const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess', _757 => _757.code, 'optionalAccess', _758 => _758.toString, 'call', _759 => _759()]);
12805
+ const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess', _763 => _763.code, 'optionalAccess', _764 => _764.toString, 'call', _765 => _765()]);
12687
12806
  if (fontCode) {
12688
12807
  transformedCode = fontCode;
12689
12808
  transformed = true;
12690
12809
  }
12691
12810
  }
12692
- if (_optionalChain([transformOptions, 'optionalAccess', _760 => _760.ssr]) && server) {
12811
+ if (_optionalChain([transformOptions, 'optionalAccess', _766 => _766.ssr]) && server) {
12693
12812
  const rewrittenImports = rewriteEarlySsrRelativeImports({
12694
12813
  code: transformedCode,
12695
12814
  id,
@@ -12709,12 +12828,12 @@ export const manifest = getManifest();
12709
12828
  }
12710
12829
  transformedCode = stripUseClientDirective(transformedCode);
12711
12830
  transformed = true;
12712
- const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _761 => _761.getConfig, 'call', _762 => _762()]), () => ( options));
12831
+ const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _767 => _767.getConfig, 'call', _768 => _768()]), () => ( options));
12713
12832
  let isolatedModuleReference = null;
12714
- const root = currentConfig.root || _optionalChain([server, 'optionalAccess', _763 => _763.config, 'access', _764 => _764.root]) || process.cwd();
12833
+ const root = currentConfig.root || _optionalChain([server, 'optionalAccess', _769 => _769.config, 'access', _770 => _770.root]) || process.cwd();
12715
12834
  const cleanId = id.split("?", 1)[0];
12716
- const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _765 => _765.getRouteManager, 'call', _766 => _766(), 'access', _767 => _767.getIsolatedClientBoundaryModules, 'call', _768 => _768(root)])));
12717
- const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess', _769 => _769.has, 'call', _770 => _770(path21.resolve(cleanId))]) === true;
12835
+ const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _771 => _771.getRouteManager, 'call', _772 => _772(), 'access', _773 => _773.getIsolatedClientBoundaryModules, 'call', _774 => _774(root)])));
12836
+ const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess', _775 => _775.has, 'call', _776 => _776(path21.resolve(cleanId))]) === true;
12718
12837
  if (_chunkPSV6XKPOcjs.isReactRenderer.call(void 0, _chunkPSV6XKPOcjs.resolveFarmRenderer.call(void 0, currentConfig.renderer)) && selectedForIsolatedHydration && isIsolatableClientBoundarySource(clientBoundarySource)) {
12719
12838
  isolatedModuleReference = _chunk5QIKR7RRcjs.toViteModuleId.call(void 0, cleanId, root);
12720
12839
  const transformedBoundary = transformIsolatedClientBoundaryModule({
@@ -12751,7 +12870,7 @@ export const manifest = getManifest();
12751
12870
  );
12752
12871
  return;
12753
12872
  }` : "";
12754
- const hmrCode = _optionalChain([transformOptions, 'optionalAccess', _771 => _771.ssr]) || !shouldEmitFarmClientRootHmr(currentConfig.renderer) ? "" : `
12873
+ const hmrCode = _optionalChain([transformOptions, 'optionalAccess', _777 => _777.ssr]) || !shouldEmitFarmClientRootHmr(currentConfig.renderer) ? "" : `
12755
12874
  if (import.meta.hot) {
12756
12875
  import.meta.hot.accept((newModule) => {
12757
12876
  ${isolatedHmrUpdate}
@@ -12806,14 +12925,14 @@ if (import.meta.hot) {
12806
12925
  }
12807
12926
  _chunk5QIKR7RRcjs.logger.info(`Found ${ssgPages.length} SSG pages, ${ssrRoutes.length} SSR routes`);
12808
12927
  _chunk5QIKR7RRcjs.logger.info("Pre-rendering SSG pages...");
12809
- const outDir = path21.join(_optionalChain([server, 'optionalAccess', _772 => _772.config, 'access', _773 => _773.root]) || process.cwd(), options.outDir || "dist");
12928
+ const outDir = path21.join(_optionalChain([server, 'optionalAccess', _778 => _778.config, 'access', _779 => _779.root]) || process.cwd(), options.outDir || "dist");
12810
12929
  const clientDir = path21.join(outDir, "client");
12811
12930
  for (const page of ssgPages) {
12812
12931
  try {
12813
12932
  const staticRequest = new Request(new URL(page.urlPath, "http://farm.static"));
12814
12933
  await farmApp.getServerRenderer().runWithRequestContext(staticRequest, async () => {
12815
12934
  const mod = await routeManager.loadRouteModule(page.filePath);
12816
- if (!_optionalChain([mod, 'optionalAccess', _774 => _774.default])) return;
12935
+ if (!_optionalChain([mod, 'optionalAccess', _780 => _780.default])) return;
12817
12936
  const { layouts } = routeManager.matchRoute(page.urlPath);
12818
12937
  const layoutModules = await Promise.all(
12819
12938
  layouts.map((l) => routeManager.loadLayoutModule(l.modulePath))
@@ -12845,7 +12964,7 @@ if (import.meta.hot) {
12845
12964
  const i18nSnapshot = _chunkXJXBIP67cjs.getFarmI18nClientSnapshot.call(void 0, );
12846
12965
  const i18nHead = renderFarmI18nStaticHead(page.urlPath, i18nSnapshot);
12847
12966
  const fullHtml = `<!DOCTYPE html>
12848
- <html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess', _775 => _775.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}>
12967
+ <html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess', _781 => _781.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}>
12849
12968
  <head>
12850
12969
  <meta charset="utf-8">
12851
12970
  <meta name="viewport" content="width=device-width, initial-scale=1">
@@ -12903,13 +13022,13 @@ if (import.meta.hot) {
12903
13022
  });
12904
13023
  }
12905
13024
  }
12906
- const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess', _776 => _776.getConfig, 'call', _777 => _777()]);
13025
+ const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess', _782 => _782.getConfig, 'call', _783 => _783()]);
12907
13026
  const normalizedFile = file.replace(/\\/g, "/");
12908
13027
  if (currentFarmConfig && /\/route\.(?:ts|tsx|js|jsx)$/.test(normalizedFile) && _chunkWBKEZXWEcjs.getFarmAppDirectories.call(void 0, currentFarmConfig).some(
12909
13028
  (appDir) => normalizedFile.startsWith(`${_chunk5QIKR7RRcjs.toPosixPath.call(void 0, appDir)}/api/`)
12910
13029
  )) {
12911
13030
  for (const mod of modules) server2.moduleGraph.invalidateModule(mod);
12912
- await _optionalChain([refreshRouteDiscovery, 'optionalCall', _778 => _778(`updated ${file}`)]);
13031
+ await _optionalChain([refreshRouteDiscovery, 'optionalCall', _784 => _784(`updated ${file}`)]);
12913
13032
  server2.ws.send({ type: "full-reload", path: "*" });
12914
13033
  return [];
12915
13034
  }
@@ -12919,7 +13038,7 @@ if (import.meta.hot) {
12919
13038
  for (const mod of modules) {
12920
13039
  server2.moduleGraph.invalidateModule(mod);
12921
13040
  }
12922
- await _optionalChain([refreshRouteDiscovery, 'optionalCall', _779 => _779(`updated ${file}`)]);
13041
+ await _optionalChain([refreshRouteDiscovery, 'optionalCall', _785 => _785(`updated ${file}`)]);
12923
13042
  server2.ws.send({
12924
13043
  type: "full-reload",
12925
13044
  path: "*"
@@ -12932,7 +13051,7 @@ if (import.meta.hot) {
12932
13051
  for (const mod of modules) {
12933
13052
  server2.moduleGraph.invalidateModule(mod);
12934
13053
  }
12935
- await _optionalChain([refreshRouteDiscovery, 'optionalCall', _780 => _780(`updated ${file}`)]);
13054
+ await _optionalChain([refreshRouteDiscovery, 'optionalCall', _786 => _786(`updated ${file}`)]);
12936
13055
  server2.ws.send({
12937
13056
  type: "full-reload",
12938
13057
  path: "*"
@@ -12940,12 +13059,12 @@ if (import.meta.hot) {
12940
13059
  return [];
12941
13060
  }
12942
13061
  if (apiRouteManager && _chunkSHLXACIOcjs.invalidateFarmDevDependents.call(void 0, server2, file, apiRouteManager.getSourceFiles()).length > 0) {
12943
- await _optionalChain([refreshRouteDiscovery, 'optionalCall', _781 => _781(`updated ${file}`)]);
13062
+ await _optionalChain([refreshRouteDiscovery, 'optionalCall', _787 => _787(`updated ${file}`)]);
12944
13063
  }
12945
- const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess', _782 => _782.experimental, 'optionalAccess', _783 => _783.isolatedClientHydration]);
12946
- const planRouteManager = _optionalChain([farmApp, 'optionalAccess', _784 => _784.getRouteManager, 'call', _785 => _785()]);
13064
+ const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess', _788 => _788.experimental, 'optionalAccess', _789 => _789.isolatedClientHydration]);
13065
+ const planRouteManager = _optionalChain([farmApp, 'optionalAccess', _790 => _790.getRouteManager, 'call', _791 => _791()]);
12947
13066
  const isHydrationPlanSource = currentSrcRoot !== null && normalizedFile.startsWith(`${currentSrcRoot}/`) && /\.[cm]?[jt]sx?$/.test(normalizedFile);
12948
- const tracksAsyncOwnerIslands = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess', _786 => _786.renderer])) && planRouteManager !== void 0;
13067
+ const tracksAsyncOwnerIslands = _chunkPSV6XKPOcjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess', _792 => _792.renderer])) && planRouteManager !== void 0;
12949
13068
  if (isHydrationPlanSource && (isolatedHydrationMode === "enabled" || isolatedHydrationMode === "analyze" || tracksAsyncOwnerIslands)) {
12950
13069
  const routeManager = planRouteManager;
12951
13070
  if (routeManager) {
@@ -13005,7 +13124,7 @@ if (import.meta.hot) {
13005
13124
  }
13006
13125
  return [];
13007
13126
  }
13008
- _optionalChain([farmApp, 'optionalAccess', _787 => _787.getRouteManager, 'call', _788 => _788(), 'access', _789 => _789.invalidateClientManifest, 'call', _790 => _790()]);
13127
+ _optionalChain([farmApp, 'optionalAccess', _793 => _793.getRouteManager, 'call', _794 => _794(), 'access', _795 => _795.invalidateClientManifest, 'call', _796 => _796()]);
13009
13128
  const manifestModule = server2.moduleGraph.getModuleById("/@farm/manifest");
13010
13129
  if (manifestModule) {
13011
13130
  server2.moduleGraph.invalidateModule(manifestModule);
@@ -13374,12 +13493,12 @@ async function parseRouteModuleProps2(routeModule, input) {
13374
13493
  }
13375
13494
  const schemas = routeModule.__farmRouteSchemas;
13376
13495
  const params = parseRouteModuleSchema2(
13377
- _optionalChain([schemas, 'optionalAccess', _791 => _791.params]),
13496
+ _optionalChain([schemas, 'optionalAccess', _797 => _797.params]),
13378
13497
  input.props.params,
13379
13498
  "params",
13380
13499
  input.routePath
13381
13500
  );
13382
- const search = parseRouteModuleSchema2(_optionalChain([schemas, 'optionalAccess', _792 => _792.search]), input.search, "search", input.routePath);
13501
+ const search = parseRouteModuleSchema2(_optionalChain([schemas, 'optionalAccess', _798 => _798.search]), input.search, "search", input.routePath);
13383
13502
  return {
13384
13503
  ...input.props,
13385
13504
  params,
@@ -13419,7 +13538,7 @@ import __farmAppSetup from ${JSON.stringify(_chunk5QIKR7RRcjs.toViteModuleId.cal
13419
13538
  __farmConfigureApp(__farmAppSetup)` : `import React, { hydrateRoot, createRoot } from ${JSON.stringify(renderer.client)}`;
13420
13539
  const isolatedHydrationImport = isolatedHydrationEnabled ? `import { createFarmIsolatedHydrationRuntime, createFarmServerPageBoundary, wrapFarmIsolatedClientGraph } from '@farm.js/core/internal/isolated-boundary'
13421
13540
  import { createFarmServerTreeElement } from '@farm.js/core/internal/server-tree'` : "";
13422
- const docsAdapterImportBlock = _chunkHITLGIAOcjs.generateFarmDocsAdapterClientRuntime.call(void 0,
13541
+ const docsAdapterImportBlock = _chunkCY2ZQ5C6cjs.generateFarmDocsAdapterClientRuntime.call(void 0,
13423
13542
  docsAdapterReact,
13424
13543
  docsConfigModule
13425
13544
  );
@@ -15040,7 +15159,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, generateClientManifest, "generateClientMan
15040
15159
  async function defineConfig(config = {}) {
15041
15160
  const tailwindVitePlugin = await loadTailwindVitePlugin();
15042
15161
  const appRoot = path21.resolve(config.root || process.cwd());
15043
- if (_optionalChain([config, 'access', _793 => _793.extends, 'optionalAccess', _794 => _794.length])) {
15162
+ if (_optionalChain([config, 'access', _799 => _799.extends, 'optionalAccess', _800 => _800.length])) {
15044
15163
  const { config: layeredConfig } = await import("./layers-VUWIOFEO.cjs").then(
15045
15164
  ({ resolveFarmLayers }) => resolveFarmLayers(config, {
15046
15165
  root: appRoot,
@@ -15141,13 +15260,13 @@ async function defineConfig(config = {}) {
15141
15260
  if (!serverStarted) {
15142
15261
  serverStarted = true;
15143
15262
  const elapsed = Date.now() - startTime;
15144
- const address = _optionalChain([server, 'access', _795 => _795.httpServer, 'optionalAccess', _796 => _796.address, 'call', _797 => _797()]);
15263
+ const address = _optionalChain([server, 'access', _801 => _801.httpServer, 'optionalAccess', _802 => _802.address, 'call', _803 => _803()]);
15145
15264
  const resolvedPort = typeof address === "object" && address ? address.port : server.config.server.port || port || 3e3;
15146
15265
  const hostConfig = server.config.server.host;
15147
15266
  const isExposed = hostConfig === true || hostConfig === "0.0.0.0";
15148
15267
  console.log("");
15149
15268
  console.log(
15150
- ` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${_chunkNQ6QFZWDcjs.FARM_VERSION}`)} ${pc.dim(`ready in ${elapsed}ms`)}`
15269
+ ` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${_chunkKKSTAEMYcjs.FARM_VERSION}`)} ${pc.dim(`ready in ${elapsed}ms`)}`
15151
15270
  );
15152
15271
  console.log("");
15153
15272
  console.log(