@farm.js/core 0.1.18 → 0.1.20

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 (189) hide show
  1. package/dist/agent-runtime.d.mts +2 -3
  2. package/dist/agent-runtime.d.ts +2 -3
  3. package/dist/api/route-manager.cjs +5 -5
  4. package/dist/api/route-manager.d.mts +2 -3
  5. package/dist/api/route-manager.d.ts +2 -3
  6. package/dist/api/route-manager.mjs +4 -4
  7. package/dist/api.cjs +6 -6
  8. package/dist/api.d.mts +3 -4
  9. package/dist/api.d.ts +3 -4
  10. package/dist/api.mjs +5 -5
  11. package/dist/{app-BHY_10Lm.d.ts → app-DAyPE-gr.d.ts} +11 -4
  12. package/dist/{app-BMk0do23.d.mts → app-D_6nTit-.d.mts} +11 -4
  13. package/dist/app-markdown.cjs +4 -4
  14. package/dist/app-markdown.d.mts +3 -4
  15. package/dist/app-markdown.d.ts +3 -4
  16. package/dist/app-markdown.mjs +3 -3
  17. package/dist/{chunk-FS7FLPOG.mjs → chunk-2J7W2WND.mjs} +3 -2
  18. package/dist/{chunk-YS3TRKCG.mjs → chunk-2M435BUE.mjs} +6 -1
  19. package/dist/{chunk-WJ3HK3LJ.cjs → chunk-2QLBIPFT.cjs} +4 -4
  20. package/dist/{chunk-FJSWYIR7.cjs → chunk-3IL5UC5I.cjs} +2 -2
  21. package/dist/chunk-43FMW62B.mjs +67 -0
  22. package/dist/{chunk-A7T6345N.mjs → chunk-5UX4C5QI.mjs} +10 -7
  23. package/dist/{chunk-KPNVGRBL.mjs → chunk-5V37LKBG.mjs} +105 -41
  24. package/dist/chunk-75WGQVQA.cjs +46 -0
  25. package/dist/{chunk-ZCNJKLA2.mjs → chunk-7BC6GAL7.mjs} +1 -1
  26. package/dist/{chunk-J2OP5GG3.cjs → chunk-A777V5WU.cjs} +28 -28
  27. package/dist/{chunk-NWOD6NIT.cjs → chunk-A7T6JZNI.cjs} +1 -1
  28. package/dist/{chunk-E2BMSZ2W.cjs → chunk-AH7HOAQ3.cjs} +2 -2
  29. package/dist/{chunk-AFOD3LYZ.cjs → chunk-B3WK4DTX.cjs} +10 -9
  30. package/dist/{chunk-TWGMSEHX.cjs → chunk-BBVSJVBZ.cjs} +88 -13
  31. package/dist/{chunk-AORPIPNB.cjs → chunk-BHJUZ64B.cjs} +18 -14
  32. package/dist/chunk-BMWDEBXO.cjs +67 -0
  33. package/dist/{chunk-ATERBVHQ.mjs → chunk-CQHFU55R.mjs} +5 -4
  34. package/dist/{chunk-XSKZORAS.cjs → chunk-DX4VKYAJ.cjs} +5 -5
  35. package/dist/{chunk-AWRISO2H.cjs → chunk-E2ROOWQC.cjs} +30 -4
  36. package/dist/{chunk-3XG26Z3J.mjs → chunk-F7E2AZKQ.mjs} +1 -1
  37. package/dist/{chunk-7WPA7GBZ.mjs → chunk-GHFS7RUB.mjs} +1 -1
  38. package/dist/{chunk-UN5GHC5V.cjs → chunk-GQFSCBKJ.cjs} +249 -185
  39. package/dist/{chunk-NZ2JVBT2.mjs → chunk-GZ3ZPTQV.mjs} +2 -2
  40. package/dist/{chunk-DHDVMXYK.mjs → chunk-HALDNTIV.mjs} +30 -4
  41. package/dist/{chunk-5QOEPUYE.mjs → chunk-HSDL2AUR.mjs} +1 -1
  42. package/dist/{chunk-BSTRERPP.cjs → chunk-I5YBCWQ6.cjs} +2 -2
  43. package/dist/{chunk-TYQUSXUG.cjs → chunk-ISTFC3MZ.cjs} +4 -4
  44. package/dist/{chunk-RKQVJN2O.mjs → chunk-JIKGGIOL.mjs} +1 -1
  45. package/dist/{chunk-GYKJCFTS.mjs → chunk-K6MG3SEG.mjs} +124 -82
  46. package/dist/{chunk-OXSIH4D6.cjs → chunk-KNPRCKXK.cjs} +6 -1
  47. package/dist/{chunk-TNBAYAWO.mjs → chunk-L4DVIHOC.mjs} +1 -1
  48. package/dist/{chunk-XWAYMDLB.mjs → chunk-MVUREHPN.mjs} +1 -1
  49. package/dist/{chunk-6VQIKZZO.mjs → chunk-N255VYFP.mjs} +1 -1
  50. package/dist/{chunk-GNEO2XOF.cjs → chunk-NBAHDVOJ.cjs} +4 -4
  51. package/dist/{chunk-EN7WTEAY.mjs → chunk-NRS46D4L.mjs} +2 -2
  52. package/dist/{chunk-A72YEUZ3.mjs → chunk-OCE65DDM.mjs} +1 -1
  53. package/dist/{chunk-SXHV42UQ.mjs → chunk-OFEY6KHO.mjs} +88 -13
  54. package/dist/{chunk-OIEOCXKG.cjs → chunk-OYDRPBBV.cjs} +2 -2
  55. package/dist/{chunk-76DG3LF3.mjs → chunk-PGQBL5DN.mjs} +1 -1
  56. package/dist/{chunk-UDBJCUPA.mjs → chunk-PUCUVI7K.mjs} +11 -7
  57. package/dist/{chunk-IKNRN4VS.cjs → chunk-PZX6I4JW.cjs} +462 -420
  58. package/dist/{chunk-GDSHDTJ4.cjs → chunk-Q5B3KJBP.cjs} +2 -2
  59. package/dist/{chunk-TSWW5BVH.mjs → chunk-QMV4QELL.mjs} +1 -1
  60. package/dist/{chunk-QGVJVSNX.mjs → chunk-RMIJFZU3.mjs} +28 -4
  61. package/dist/{chunk-MKB2EGIR.cjs → chunk-SOR334EB.cjs} +3 -2
  62. package/dist/{chunk-57J3Y7Y3.mjs → chunk-TIKNUAU7.mjs} +3 -2
  63. package/dist/chunk-VVBO3QH7.mjs +46 -0
  64. package/dist/{chunk-UTBVHYS3.mjs → chunk-W7MZXRXM.mjs} +20 -5
  65. package/dist/{chunk-Y53ZSFN6.cjs → chunk-WM6HL7E7.cjs} +4 -3
  66. package/dist/{chunk-WZMNW2IW.cjs → chunk-XFFQSD2F.cjs} +4 -4
  67. package/dist/{chunk-62YJ2IEB.cjs → chunk-XI3GWPUS.cjs} +23 -20
  68. package/dist/{chunk-KVFPGF2M.cjs → chunk-YJJLXIIS.cjs} +7 -7
  69. package/dist/{chunk-NV3A5DXM.cjs → chunk-YP5JZ4LF.cjs} +42 -18
  70. package/dist/{chunk-B4CH33IG.cjs → chunk-ZE6ONQ5R.cjs} +39 -24
  71. package/dist/{client-plugins-JXXmZliS.d.mts → client-plugins-CWrhb1ir.d.mts} +26 -3
  72. package/dist/{client-plugins-C089bQhN.d.ts → client-plugins-DPf0qZey.d.ts} +26 -3
  73. package/dist/client-plugins.d.mts +2 -3
  74. package/dist/client-plugins.d.ts +2 -3
  75. package/dist/client.cjs +4 -4
  76. package/dist/client.d.mts +9 -38
  77. package/dist/client.d.ts +9 -38
  78. package/dist/client.mjs +3 -3
  79. package/dist/config.d.mts +2 -3
  80. package/dist/config.d.ts +2 -3
  81. package/dist/{devtools-UFVTMQX5.mjs → devtools-MTB5SA2B.mjs} +5 -5
  82. package/dist/{devtools-OUIPHVV6.cjs → devtools-R6MDDAZK.cjs} +9 -9
  83. package/dist/docs.cjs +9 -8
  84. package/dist/docs.d.mts +2 -2
  85. package/dist/docs.d.ts +2 -2
  86. package/dist/docs.mjs +8 -7
  87. package/dist/index.cjs +29 -28
  88. package/dist/index.d.mts +14 -14
  89. package/dist/index.d.ts +14 -14
  90. package/dist/index.mjs +28 -27
  91. package/dist/integrations.d.mts +2 -3
  92. package/dist/integrations.d.ts +2 -3
  93. package/dist/internal/app-markdown-runtime.cjs +3 -3
  94. package/dist/internal/app-markdown-runtime.d.mts +2 -3
  95. package/dist/internal/app-markdown-runtime.d.ts +2 -3
  96. package/dist/internal/app-markdown-runtime.mjs +2 -2
  97. package/dist/internal/build-runtime.cjs +22 -21
  98. package/dist/internal/build-runtime.d.mts +4 -5
  99. package/dist/internal/build-runtime.d.ts +4 -5
  100. package/dist/internal/build-runtime.mjs +21 -20
  101. package/dist/internal/cli-runtime.cjs +12 -12
  102. package/dist/internal/cli-runtime.mjs +11 -11
  103. package/dist/internal/client-error-overlay.cjs +4 -4
  104. package/dist/internal/client-error-overlay.mjs +1 -1
  105. package/dist/internal/compression-runtime.d.mts +2 -3
  106. package/dist/internal/compression-runtime.d.ts +2 -3
  107. package/dist/internal/config-runtime.cjs +6 -6
  108. package/dist/internal/config-runtime.d.mts +3 -4
  109. package/dist/internal/config-runtime.d.ts +3 -4
  110. package/dist/internal/config-runtime.mjs +5 -5
  111. package/dist/internal/product-telemetry-runtime.cjs +2 -2
  112. package/dist/internal/product-telemetry-runtime.mjs +1 -1
  113. package/dist/internal/production-runtime.cjs +5 -5
  114. package/dist/internal/production-runtime.d.mts +8 -9
  115. package/dist/internal/production-runtime.d.ts +8 -9
  116. package/dist/internal/production-runtime.mjs +4 -4
  117. package/dist/markdown.cjs +2 -2
  118. package/dist/markdown.mjs +1 -1
  119. package/dist/{metadata-C1Z9vLbb.d.mts → metadata-CO9fRyyJ.d.mts} +1 -1
  120. package/dist/{metadata-BcNJP4fq.d.ts → metadata-zY9wltwH.d.ts} +1 -1
  121. package/dist/middleware.cjs +4 -4
  122. package/dist/middleware.d.mts +4 -11
  123. package/dist/middleware.d.ts +4 -11
  124. package/dist/middleware.mjs +3 -3
  125. package/dist/navigation.cjs +5 -5
  126. package/dist/navigation.d.mts +42 -3
  127. package/dist/navigation.d.ts +42 -3
  128. package/dist/navigation.mjs +4 -4
  129. package/dist/{nitro-CVZ36JM5.mjs → nitro-4LFVTT24.mjs} +2 -2
  130. package/dist/{nitro-4I2MYLY2.cjs → nitro-TSGDUJMN.cjs} +3 -3
  131. package/dist/plugin.cjs +23 -17
  132. package/dist/plugin.d.mts +3 -4
  133. package/dist/plugin.d.ts +3 -4
  134. package/dist/plugin.mjs +23 -17
  135. package/dist/{production-runtime-jcrTlRTb.d.mts → production-runtime-CywsHwnG.d.mts} +1 -1
  136. package/dist/{production-runtime-oKmC0WU-.d.ts → production-runtime-lkfwujwK.d.ts} +1 -1
  137. package/dist/query/client.cjs +6 -6
  138. package/dist/query/client.mjs +2 -2
  139. package/dist/{render-plan-DOB9cV-h.d.ts → render-plan-DHF0GeWo.d.ts} +1 -1
  140. package/dist/{render-plan-BLIfc4jt.d.mts → render-plan-LVy6sGQe.d.mts} +1 -1
  141. package/dist/renderer-client.cjs +5 -5
  142. package/dist/renderer-client.d.mts +4 -5
  143. package/dist/renderer-client.d.ts +4 -5
  144. package/dist/renderer-client.mjs +2 -2
  145. package/dist/renderer.d.mts +3 -0
  146. package/dist/renderer.d.ts +3 -0
  147. package/dist/{request-Cr53NRHr.d.mts → request-6AkmhEYE.d.mts} +1 -1
  148. package/dist/{request-Dt2gNuQD.d.ts → request-BYxlRqA9.d.ts} +1 -1
  149. package/dist/request.d.mts +3 -4
  150. package/dist/request.d.ts +3 -4
  151. package/dist/{route-rendering-CWYd8Mv1.d.ts → route-rendering-CWaKiUbS.d.ts} +1 -1
  152. package/dist/{route-rendering-CeFBEAoZ.d.mts → route-rendering-Dd8Jmml7.d.mts} +1 -1
  153. package/dist/router-B2m4fvve.d.ts +50 -0
  154. package/dist/router-xwEE112q.d.mts +50 -0
  155. package/dist/routes.cjs +3 -3
  156. package/dist/routes.d.mts +2 -3
  157. package/dist/routes.d.ts +2 -3
  158. package/dist/routes.mjs +2 -2
  159. package/dist/{schema-dev-notice-2IE2F2XI.mjs → schema-dev-notice-O67CPXJ6.mjs} +1 -1
  160. package/dist/{schema-dev-notice-MXSZMVDG.cjs → schema-dev-notice-Y7MQEFGN.cjs} +3 -3
  161. package/dist/server-plugins.d.mts +3 -4
  162. package/dist/server-plugins.d.ts +3 -4
  163. package/dist/server.cjs +33 -32
  164. package/dist/server.d.mts +8 -9
  165. package/dist/server.d.ts +8 -9
  166. package/dist/server.mjs +19 -18
  167. package/dist/{spa-router-CQWiYGxS.d.mts → spa-router-DVEHQnWo.d.mts} +3 -3
  168. package/dist/{spa-router-Wjiw-8hB.d.ts → spa-router-Y8rrXTVK.d.ts} +3 -3
  169. package/dist/testing.cjs +6 -6
  170. package/dist/testing.d.mts +2 -3
  171. package/dist/testing.d.ts +2 -3
  172. package/dist/testing.mjs +5 -5
  173. package/dist/{types-D-1WTE72.d.mts → types-DFbjpjXX.d.mts} +8 -0
  174. package/dist/{types-D-1WTE72.d.ts → types-DFbjpjXX.d.ts} +8 -0
  175. package/dist/{utils-uUxF0K0P.d.mts → utils-DSPx34-A.d.mts} +1 -1
  176. package/dist/{utils-B0XJmG_b.d.ts → utils-Dvuny_08.d.ts} +1 -1
  177. package/dist/version.cjs +2 -2
  178. package/dist/version.mjs +1 -1
  179. package/dist/vite.cjs +18 -17
  180. package/dist/vite.d.mts +2 -3
  181. package/dist/vite.d.ts +2 -3
  182. package/dist/vite.mjs +17 -16
  183. package/package.json +3 -3
  184. package/dist/chunk-7GNWGLWB.mjs +0 -14
  185. package/dist/chunk-VQDBNVOO.cjs +0 -14
  186. package/dist/navigation-errors-Dvwpzaer.d.mts +0 -13
  187. package/dist/navigation-errors-Dvwpzaer.d.ts +0 -13
  188. /package/dist/{chunk-IAMRBF3Z.cjs → chunk-N4RLRSWW.cjs} +0 -0
  189. /package/dist/{chunk-BNGS6KJ6.mjs → chunk-YOYF2E4U.mjs} +0 -0
@@ -6,12 +6,12 @@
6
6
 
7
7
 
8
8
 
9
- var _chunkWZMNW2IWcjs = require('./chunk-WZMNW2IW.cjs');
9
+ var _chunkXFFQSD2Fcjs = require('./chunk-XFFQSD2F.cjs');
10
10
 
11
11
 
12
12
 
13
13
 
14
- var _chunkAWRISO2Hcjs = require('./chunk-AWRISO2H.cjs');
14
+ var _chunkE2ROOWQCcjs = require('./chunk-E2ROOWQC.cjs');
15
15
 
16
16
 
17
17
  var _chunkJSROZYYOcjs = require('./chunk-JSROZYYO.cjs');
@@ -24,7 +24,7 @@ var _chunkJSROZYYOcjs = require('./chunk-JSROZYYO.cjs');
24
24
 
25
25
 
26
26
 
27
- var _chunkOIEOCXKGcjs = require('./chunk-OIEOCXKG.cjs');
27
+ var _chunkOYDRPBBVcjs = require('./chunk-OYDRPBBV.cjs');
28
28
 
29
29
 
30
30
  var _chunkCXP5U3RWcjs = require('./chunk-CXP5U3RW.cjs');
@@ -51,6 +51,10 @@ var _chunkXWAWFQFScjs = require('./chunk-XWAWFQFS.cjs');
51
51
 
52
52
 
53
53
 
54
+ var _chunk75WGQVQAcjs = require('./chunk-75WGQVQA.cjs');
55
+
56
+
57
+
54
58
  var _chunkHREOKQWTcjs = require('./chunk-HREOKQWT.cjs');
55
59
 
56
60
 
@@ -65,7 +69,7 @@ var _chunkQBPXNZGVcjs = require('./chunk-QBPXNZGV.cjs');
65
69
  var _chunkYJRZR7VUcjs = require('./chunk-YJRZR7VU.cjs');
66
70
 
67
71
 
68
- var _chunkGDSHDTJ4cjs = require('./chunk-GDSHDTJ4.cjs');
72
+ var _chunkQ5B3KJBPcjs = require('./chunk-Q5B3KJBP.cjs');
69
73
 
70
74
 
71
75
 
@@ -99,7 +103,7 @@ var _chunkTFAXUHWXcjs = require('./chunk-TFAXUHWX.cjs');
99
103
 
100
104
 
101
105
 
102
- var _chunkTYQUSXUGcjs = require('./chunk-TYQUSXUG.cjs');
106
+ var _chunkISTFC3MZcjs = require('./chunk-ISTFC3MZ.cjs');
103
107
 
104
108
 
105
109
 
@@ -117,12 +121,12 @@ var _chunkVEKFLAQMcjs = require('./chunk-VEKFLAQM.cjs');
117
121
 
118
122
 
119
123
 
120
- var _chunkBSTRERPPcjs = require('./chunk-BSTRERPP.cjs');
124
+ var _chunkI5YBCWQ6cjs = require('./chunk-I5YBCWQ6.cjs');
121
125
 
122
126
 
123
127
 
124
128
 
125
- var _chunkE2BMSZ2Wcjs = require('./chunk-E2BMSZ2W.cjs');
129
+ var _chunkAH7HOAQ3cjs = require('./chunk-AH7HOAQ3.cjs');
126
130
 
127
131
 
128
132
 
@@ -136,7 +140,7 @@ var _chunkOHY2ZWUGcjs = require('./chunk-OHY2ZWUG.cjs');
136
140
 
137
141
 
138
142
 
139
- var _chunkTWGMSEHXcjs = require('./chunk-TWGMSEHX.cjs');
143
+ var _chunkBBVSJVBZcjs = require('./chunk-BBVSJVBZ.cjs');
140
144
 
141
145
 
142
146
  var _chunkK6FNHVDRcjs = require('./chunk-K6FNHVDR.cjs');
@@ -162,7 +166,7 @@ var _chunk6QQDAAAZcjs = require('./chunk-6QQDAAAZ.cjs');
162
166
  var _chunkZ5HIWVDPcjs = require('./chunk-Z5HIWVDP.cjs');
163
167
 
164
168
 
165
- var _chunkY53ZSFN6cjs = require('./chunk-Y53ZSFN6.cjs');
169
+ var _chunkWM6HL7E7cjs = require('./chunk-WM6HL7E7.cjs');
166
170
 
167
171
 
168
172
 
@@ -177,11 +181,11 @@ var _chunk4PPEPOZZcjs = require('./chunk-4PPEPOZZ.cjs');
177
181
  var _chunkMQ3H6LT5cjs = require('./chunk-MQ3H6LT5.cjs');
178
182
 
179
183
 
180
- var _chunkAFOD3LYZcjs = require('./chunk-AFOD3LYZ.cjs');
184
+ var _chunkB3WK4DTXcjs = require('./chunk-B3WK4DTX.cjs');
181
185
 
182
186
 
183
187
 
184
- var _chunkIAMRBF3Zcjs = require('./chunk-IAMRBF3Z.cjs');
188
+ var _chunkN4RLRSWWcjs = require('./chunk-N4RLRSWW.cjs');
185
189
 
186
190
 
187
191
 
@@ -208,7 +212,7 @@ var _chunk6V4TDWECcjs = require('./chunk-6V4TDWEC.cjs');
208
212
 
209
213
 
210
214
 
211
- var _chunkMKB2EGIRcjs = require('./chunk-MKB2EGIR.cjs');
215
+ var _chunkSOR334EBcjs = require('./chunk-SOR334EB.cjs');
212
216
 
213
217
 
214
218
 
@@ -228,7 +232,9 @@ var _chunkEM6SBQKMcjs = require('./chunk-EM6SBQKM.cjs');
228
232
  var _chunkM2L4MYDQcjs = require('./chunk-M2L4MYDQ.cjs');
229
233
 
230
234
 
231
- var _chunkVQDBNVOOcjs = require('./chunk-VQDBNVOO.cjs');
235
+
236
+
237
+ var _chunkBMWDEBXOcjs = require('./chunk-BMWDEBXO.cjs');
232
238
 
233
239
 
234
240
 
@@ -258,7 +264,7 @@ var _chunkQNPEUFHQcjs = require('./chunk-QNPEUFHQ.cjs');
258
264
  var _chunkUQZ4AYTHcjs = require('./chunk-UQZ4AYTH.cjs');
259
265
 
260
266
 
261
- var _chunkNWOD6NITcjs = require('./chunk-NWOD6NIT.cjs');
267
+ var _chunkA7T6JZNIcjs = require('./chunk-A7T6JZNI.cjs');
262
268
 
263
269
 
264
270
 
@@ -277,7 +283,7 @@ var _chunk75BRBIFPcjs = require('./chunk-75BRBIFP.cjs');
277
283
 
278
284
 
279
285
 
280
- var _chunkOXSIH4D6cjs = require('./chunk-OXSIH4D6.cjs');
286
+ var _chunkKNPRCKXKcjs = require('./chunk-KNPRCKXK.cjs');
281
287
 
282
288
 
283
289
 
@@ -1995,25 +2001,25 @@ var _RouteManager = class _RouteManager {
1995
2001
  if (!routeEntry) {
1996
2002
  throw new Error(`Cannot resolve runtime configuration for unknown route "${pattern}"`);
1997
2003
  }
1998
- const inherited = _chunkMKB2EGIRcjs.resolveFarmRouteRuleRuntimeConfig.call(void 0, pattern, this.config.routeRules);
2004
+ const inherited = _chunkSOR334EBcjs.resolveFarmRouteRuleRuntimeConfig.call(void 0, pattern, this.config.routeRules);
1999
2005
  const layouts = this.findMatchingLayouts(pattern);
2000
2006
  const layoutConfigs = [];
2001
2007
  for (const layout of layouts) {
2002
2008
  const layoutModule = await this.loadLayoutModule(layout.modulePath);
2003
2009
  layoutConfigs.push(
2004
- _chunkMKB2EGIRcjs.normalizeFarmRouteRuntimeConfig.call(void 0,
2005
- _chunkMKB2EGIRcjs.getFarmRouteRuntimeConfig.call(void 0, layoutModule),
2010
+ _chunkSOR334EBcjs.normalizeFarmRouteRuntimeConfig.call(void 0,
2011
+ _chunkSOR334EBcjs.getFarmRouteRuntimeConfig.call(void 0, layoutModule),
2006
2012
  `Layout "${layout.pattern}"`
2007
2013
  )
2008
2014
  );
2009
2015
  }
2010
2016
  const routeModule = await this.loadRouteModule(routeEntry.modulePath);
2011
- const routeConfig = _chunkMKB2EGIRcjs.normalizeFarmRouteRuntimeConfig.call(void 0,
2012
- _chunkMKB2EGIRcjs.getFarmRouteRuntimeConfig.call(void 0, routeModule),
2017
+ const routeConfig = _chunkSOR334EBcjs.normalizeFarmRouteRuntimeConfig.call(void 0,
2018
+ _chunkSOR334EBcjs.getFarmRouteRuntimeConfig.call(void 0, routeModule),
2013
2019
  `Route "${pattern}"`
2014
2020
  );
2015
- return _chunkMKB2EGIRcjs.resolveFarmRouteRuntimeConfig.call(void 0,
2016
- _chunkMKB2EGIRcjs.mergeFarmRouteRuntimeConfigs.call(void 0, inherited, ...layoutConfigs, routeConfig),
2021
+ return _chunkSOR334EBcjs.resolveFarmRouteRuntimeConfig.call(void 0,
2022
+ _chunkSOR334EBcjs.mergeFarmRouteRuntimeConfigs.call(void 0, inherited, ...layoutConfigs, routeConfig),
2017
2023
  `Route "${pattern}"`
2018
2024
  );
2019
2025
  }
@@ -2208,7 +2214,7 @@ var _RouteManager = class _RouteManager {
2208
2214
  );
2209
2215
  const routeEntries = Array.from(this.routes.values()).map((entry) => ({
2210
2216
  entry,
2211
- metadata: _chunkE2BMSZ2Wcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? markdownPagePlan() : getClientModuleHydrationPlan(
2217
+ metadata: _chunkAH7HOAQ3cjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) ? markdownPagePlan() : getClientModuleHydrationPlan(
2212
2218
  entry.modulePath,
2213
2219
  normalizedProjectRoot,
2214
2220
  isolatedMode,
@@ -2216,7 +2222,7 @@ var _RouteManager = class _RouteManager {
2216
2222
  )
2217
2223
  }));
2218
2224
  const markdownFallback = routeEntries.find(
2219
- ({ entry, metadata }) => _chunkE2BMSZ2Wcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) && metadata.fallbackReason
2225
+ ({ entry, metadata }) => _chunkAH7HOAQ3cjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) && metadata.fallbackReason
2220
2226
  );
2221
2227
  if (markdownFallback) {
2222
2228
  _chunk5QIKR7RRcjs.logger.warn(
@@ -2224,7 +2230,7 @@ var _RouteManager = class _RouteManager {
2224
2230
  );
2225
2231
  }
2226
2232
  const markdownStaticPackages = _optionalChain([routeEntries, 'access', _120 => _120.find, 'call', _121 => _121(
2227
- ({ entry, metadata }) => _chunkE2BMSZ2Wcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) && metadata.staticPackageBoundaries
2233
+ ({ entry, metadata }) => _chunkAH7HOAQ3cjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) && metadata.staticPackageBoundaries
2228
2234
  ), 'optionalAccess', _122 => _122.metadata, 'access', _123 => _123.staticPackageBoundaries]);
2229
2235
  if (markdownStaticPackages) {
2230
2236
  _chunk5QIKR7RRcjs.logger.info(
@@ -2232,7 +2238,7 @@ var _RouteManager = class _RouteManager {
2232
2238
  );
2233
2239
  }
2234
2240
  for (const { entry, metadata } of [...layoutEntries, ...routeEntries]) {
2235
- if (_chunkE2BMSZ2Wcjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) || !metadata.staticPackageBoundaries) continue;
2241
+ if (_chunkAH7HOAQ3cjs.isFarmMarkdownPageFile.call(void 0, entry.modulePath) || !metadata.staticPackageBoundaries) continue;
2236
2242
  _chunk5QIKR7RRcjs.logger.info(
2237
2243
  `[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.`
2238
2244
  );
@@ -2384,19 +2390,19 @@ var _RouteManager = class _RouteManager {
2384
2390
  const { createRouteModuleFromProgrammaticPage } = await import("./routes.cjs");
2385
2391
  return createRouteModuleFromProgrammaticPage(programmaticPage, this.rendererRuntime);
2386
2392
  }
2387
- if (_chunkE2BMSZ2Wcjs.isFarmMarkdownPageFile.call(void 0, modulePath)) {
2393
+ if (_chunkAH7HOAQ3cjs.isFarmMarkdownPageFile.call(void 0, modulePath)) {
2388
2394
  const mdxConfig = _chunkOHY2ZWUGcjs.resolveMdxConfig.call(void 0, this.config.mdx);
2389
- const components = await _chunkBSTRERPPcjs.loadFarmMdxComponents.call(void 0, mdxConfig, {
2395
+ const components = await _chunkI5YBCWQ6cjs.loadFarmMdxComponents.call(void 0, mdxConfig, {
2390
2396
  root: this.config.root,
2391
- loadModule: this.viteServer ? (componentModulePath) => this.viteServer.ssrLoadModule(componentModulePath) : void 0
2397
+ loadModule: this.viteServer ? (componentModulePath) => _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, this.viteServer, componentModulePath) : void 0
2392
2398
  });
2393
- return await _chunkBSTRERPPcjs.createFarmMarkdownRouteModuleFromFile.call(void 0, modulePath, {
2399
+ return await _chunkI5YBCWQ6cjs.createFarmMarkdownRouteModuleFromFile.call(void 0, modulePath, {
2394
2400
  components,
2395
2401
  config: mdxConfig
2396
2402
  });
2397
2403
  }
2398
2404
  if (this.viteServer) {
2399
- const module = await this.viteServer.ssrLoadModule(modulePath);
2405
+ const module = await _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, this.viteServer, modulePath);
2400
2406
  return module;
2401
2407
  } else {
2402
2408
  const module = await import(
@@ -2421,7 +2427,7 @@ var _RouteManager = class _RouteManager {
2421
2427
  return createLayoutModuleFromProgrammaticLayout(programmaticLayout);
2422
2428
  }
2423
2429
  if (this.viteServer) {
2424
- const module = await this.viteServer.ssrLoadModule(modulePath);
2430
+ const module = await _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, this.viteServer, modulePath);
2425
2431
  return module;
2426
2432
  } else {
2427
2433
  const module = await import(
@@ -2483,7 +2489,7 @@ var _RouteManager = class _RouteManager {
2483
2489
  appDir
2484
2490
  );
2485
2491
  const canonicalPageGroups = /* @__PURE__ */ new Map();
2486
- for (const file of pageFiles.filter((candidate) => _chunkWZMNW2IWcjs.parseRouteSlotFile.call(void 0, candidate) === null)) {
2492
+ for (const file of pageFiles.filter((candidate) => _chunkXFFQSD2Fcjs.parseRouteSlotFile.call(void 0, candidate) === null)) {
2487
2493
  const route = _chunk5QIKR7RRcjs.parseRoutePath.call(void 0, file);
2488
2494
  const pattern = this.createRoutePattern(route);
2489
2495
  const group = canonicalPageGroups.get(pattern);
@@ -2497,8 +2503,8 @@ var _RouteManager = class _RouteManager {
2497
2503
  }
2498
2504
  }
2499
2505
  for (const [pattern, group] of canonicalPageGroups) {
2500
- const componentFiles = group.files.filter((file) => !_chunkE2BMSZ2Wcjs.isFarmMarkdownPageFile.call(void 0, file));
2501
- const markdownFiles = group.files.filter(_chunkE2BMSZ2Wcjs.isFarmMarkdownPageFile);
2506
+ const componentFiles = group.files.filter((file) => !_chunkAH7HOAQ3cjs.isFarmMarkdownPageFile.call(void 0, file));
2507
+ const markdownFiles = group.files.filter(_chunkAH7HOAQ3cjs.isFarmMarkdownPageFile);
2502
2508
  if (componentFiles.length > 1) {
2503
2509
  throw new Error(
2504
2510
  `Duplicate page route "${pattern}". Found ${componentFiles.map((file) => path9.default.join(appDir, file)).join(" and ")}.`
@@ -2556,7 +2562,7 @@ var _RouteManager = class _RouteManager {
2556
2562
  }
2557
2563
  }
2558
2564
  for (const file of [...pageFiles, ...slotDefaultFiles]) {
2559
- const slot = _chunkWZMNW2IWcjs.parseRouteSlotFile.call(void 0, file);
2565
+ const slot = _chunkXFFQSD2Fcjs.parseRouteSlotFile.call(void 0, file);
2560
2566
  if (!slot) continue;
2561
2567
  const modulePath = path9.default.join(appDir, file);
2562
2568
  const pattern = this.createRoutePattern(slot.route);
@@ -2578,7 +2584,7 @@ var _RouteManager = class _RouteManager {
2578
2584
  ownerPattern,
2579
2585
  interception: slot.interception,
2580
2586
  fallback: slot.fallback,
2581
- containerId: _chunkWZMNW2IWcjs.createRouteSlotContainerId.call(void 0, slot.name, ownerPattern)
2587
+ containerId: _chunkXFFQSD2Fcjs.createRouteSlotContainerId.call(void 0, slot.name, ownerPattern)
2582
2588
  });
2583
2589
  }
2584
2590
  for (const file of metadataImageFiles) {
@@ -2635,7 +2641,7 @@ var _RouteManager = class _RouteManager {
2635
2641
  }
2636
2642
  }
2637
2643
  async discoverProgrammaticRoutes(source) {
2638
- const manifests = await _chunkIAMRBF3Zcjs.loadProgrammaticRouteManifests.call(void 0, {
2644
+ const manifests = await _chunkN4RLRSWWcjs.loadProgrammaticRouteManifests.call(void 0, {
2639
2645
  root: source.root,
2640
2646
  srcDir: source.srcDir,
2641
2647
  loadModule: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (filePath) => this.loadProgrammaticRoutesModule(filePath), "loadModule")
@@ -2695,11 +2701,11 @@ var _RouteManager = class _RouteManager {
2695
2701
  async loadProgrammaticRoutesModule(filePath) {
2696
2702
  if (this.viteServer) {
2697
2703
  const viteRoot = _optionalChain([this, 'access', _134 => _134.viteServer, 'access', _135 => _135.config, 'optionalAccess', _136 => _136.root]) || this.config.root || process.cwd();
2698
- return await this.viteServer.ssrLoadModule(_chunk5QIKR7RRcjs.toViteModuleId.call(void 0, filePath, viteRoot));
2704
+ return await _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, this.viteServer, _chunk5QIKR7RRcjs.toViteModuleId.call(void 0, filePath, viteRoot));
2699
2705
  }
2700
2706
  return await import(
2701
2707
  /* @vite-ignore */
2702
- _chunkVQDBNVOOcjs.toFileModuleUrl.call(void 0, filePath)
2708
+ _chunkBMWDEBXOcjs.toFileModuleUrl.call(void 0, filePath)
2703
2709
  );
2704
2710
  }
2705
2711
  /**
@@ -2816,7 +2822,7 @@ var _RouteManager = class _RouteManager {
2816
2822
  pattern: entry.pattern
2817
2823
  }));
2818
2824
  const i18n = this.getI18nConfig();
2819
- const result = await _chunkWZMNW2IWcjs.collectSSGPages.call(void 0, routes, (filePath) => this.loadRouteModule(filePath), {
2825
+ const result = await _chunkXFFQSD2Fcjs.collectSSGPages.call(void 0, routes, (filePath) => this.loadRouteModule(filePath), {
2820
2826
  suggestStaticRendering: shouldSuggestStaticRenderingForI18n(i18n)
2821
2827
  });
2822
2828
  if (!i18n) {
@@ -2861,7 +2867,7 @@ var _RouteManager = class _RouteManager {
2861
2867
  async isRouteSSG(modulePath) {
2862
2868
  try {
2863
2869
  const mod = await this.loadRouteModule(modulePath);
2864
- const rendering = await _chunkWZMNW2IWcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
2870
+ const rendering = await _chunkXFFQSD2Fcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
2865
2871
  return rendering.ssg;
2866
2872
  } catch (e10) {
2867
2873
  return false;
@@ -2873,7 +2879,7 @@ var _RouteManager = class _RouteManager {
2873
2879
  async hasRouteISR(modulePath) {
2874
2880
  try {
2875
2881
  const mod = await this.loadRouteModule(modulePath);
2876
- const rendering = await _chunkWZMNW2IWcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
2882
+ const rendering = await _chunkXFFQSD2Fcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
2877
2883
  return rendering.ssg && typeof rendering.revalidate === "number" && rendering.revalidate > 0;
2878
2884
  } catch (e11) {
2879
2885
  return false;
@@ -2885,7 +2891,7 @@ var _RouteManager = class _RouteManager {
2885
2891
  async getRouteRevalidateInterval(modulePath) {
2886
2892
  try {
2887
2893
  const mod = await this.loadRouteModule(modulePath);
2888
- const rendering = await _chunkWZMNW2IWcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
2894
+ const rendering = await _chunkXFFQSD2Fcjs.resolveRouteRenderingConfigFromFile.call(void 0, mod, modulePath);
2889
2895
  return rendering.revalidate;
2890
2896
  } catch (e12) {
2891
2897
  return void 0;
@@ -3012,18 +3018,29 @@ function collectDevStylesheetUrls(modules, alreadyLinked = ALREADY_LINKED) {
3012
3018
  _chunkS3JO3N4Hcjs.__name.call(void 0, collectDevStylesheetUrls, "collectDevStylesheetUrls");
3013
3019
 
3014
3020
  // src/server/full-document.ts
3015
- function stripContentsWrappers(markup) {
3016
- let out = markup.replace(/^\s+/, "");
3017
- const opener = /^<div\b[^>]*style="display\s*:\s*contents"[^>]*>/i;
3021
+ var CONTENTS_WRAPPER = /^<div\b[^>]*style="display\s*:\s*contents"[^>]*>/i;
3022
+ var HOISTED_HEAD_ELEMENT = /^(?:<(?:meta|link|base)\b[^>]*>|<title\b[^>]*>[\s\S]*?<\/title>)/i;
3023
+ function peelDocumentPrefix(markup) {
3024
+ let inner = markup.replace(/^\s+/, "");
3025
+ let hoisted = "";
3018
3026
  let match;
3019
- while (match = opener.exec(out)) {
3020
- out = out.slice(match[0].length).replace(/^\s+/, "");
3027
+ while (match = _nullishCoalesce(CONTENTS_WRAPPER.exec(inner), () => ( HOISTED_HEAD_ELEMENT.exec(inner)))) {
3028
+ if (!/^<div/i.test(match[0])) hoisted += match[0];
3029
+ inner = inner.slice(match[0].length).replace(/^\s+/, "");
3030
+ }
3031
+ return { inner, hoisted };
3032
+ }
3033
+ _chunkS3JO3N4Hcjs.__name.call(void 0, peelDocumentPrefix, "peelDocumentPrefix");
3034
+ function restoreHoistedHead(document, hoisted) {
3035
+ if (!hoisted) return document;
3036
+ if (/<head[\s>]/i.test(document)) {
3037
+ return document.replace(/<head\b[^>]*>/i, (open) => open + hoisted);
3021
3038
  }
3022
- return out;
3039
+ return document.replace(/<html\b[^>]*>/i, (open) => `${open}<head>${hoisted}</head>`);
3023
3040
  }
3024
- _chunkS3JO3N4Hcjs.__name.call(void 0, stripContentsWrappers, "stripContentsWrappers");
3041
+ _chunkS3JO3N4Hcjs.__name.call(void 0, restoreHoistedHead, "restoreHoistedHead");
3025
3042
  function extractFarmFullDocument(markup) {
3026
- const inner = stripContentsWrappers(markup);
3043
+ const { inner, hoisted } = peelDocumentPrefix(markup);
3027
3044
  if (!/^<!doctype/i.test(inner) && !/^<html[\s>]/i.test(inner)) return null;
3028
3045
  const start = markup.search(/<!doctype|<html[\s>]/i);
3029
3046
  const lower = markup.toLowerCase();
@@ -3041,14 +3058,15 @@ function extractFarmFullDocument(markup) {
3041
3058
  if (streamedTail) {
3042
3059
  document = document.replace(/<\/body>/i, () => `${streamedTail}</body>`);
3043
3060
  }
3044
- return document;
3061
+ return restoreHoistedHead(document, hoisted);
3045
3062
  }
3046
3063
  _chunkS3JO3N4Hcjs.__name.call(void 0, extractFarmFullDocument, "extractFarmFullDocument");
3047
- function opensFarmFullDocument(markup) {
3048
- const inner = stripContentsWrappers(markup);
3049
- return /^<!doctype/i.test(inner) || /^<html[\s>]/i.test(inner);
3064
+ function classifyFarmDocumentPrefix(markup) {
3065
+ const { inner } = peelDocumentPrefix(markup);
3066
+ if (/^<!doctype/i.test(inner) || /^<html[\s>]/i.test(inner)) return "document";
3067
+ return inner === "" ? "pending" : "fragment";
3050
3068
  }
3051
- _chunkS3JO3N4Hcjs.__name.call(void 0, opensFarmFullDocument, "opensFarmFullDocument");
3069
+ _chunkS3JO3N4Hcjs.__name.call(void 0, classifyFarmDocumentPrefix, "classifyFarmDocumentPrefix");
3052
3070
  function ensureFarmDocumentHead(markup) {
3053
3071
  if (/<head[\s>]/i.test(markup)) return markup;
3054
3072
  return markup.replace(/<html([^>]*)>/i, (_match, attributes) => {
@@ -4601,6 +4619,7 @@ function warnSuppressedAsyncHydrationOnce(modulePath, reason) {
4601
4619
  }
4602
4620
  _chunkS3JO3N4Hcjs.__name.call(void 0, warnSuppressedAsyncHydrationOnce, "warnSuppressedAsyncHydrationOnce");
4603
4621
  var fullDocumentRoutes = /* @__PURE__ */ new Set();
4622
+ var documentLayouts = /* @__PURE__ */ new WeakMap();
4604
4623
  function hasRequestHeader(req, name) {
4605
4624
  const value = req.headers[name.toLowerCase()];
4606
4625
  return Array.isArray(value) ? value.length > 0 : Boolean(value);
@@ -4644,7 +4663,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, appendResponseVary, "appendResponseVary");
4644
4663
  function renderI18nAlternateLinks(requestPath, snapshot, options) {
4645
4664
  if (snapshot.routing === "none") return "";
4646
4665
  const url = new URL(requestPath, "http://farm.local");
4647
- return _chunkOIEOCXKGcjs.renderFarmLocaleAlternateLinks.call(void 0, url.pathname, snapshot, options);
4666
+ return _chunkOYDRPBBVcjs.renderFarmLocaleAlternateLinks.call(void 0, url.pathname, snapshot, options);
4648
4667
  }
4649
4668
  _chunkS3JO3N4Hcjs.__name.call(void 0, renderI18nAlternateLinks, "renderI18nAlternateLinks");
4650
4669
  var PPR_REFRESH_MAX_ATTEMPTS = 3;
@@ -4783,7 +4802,7 @@ var _ServerRenderer = class _ServerRenderer {
4783
4802
  this.routeManager = routeManager;
4784
4803
  this.i18nRuntime = i18nRuntime;
4785
4804
  this.viteServer = viteServer;
4786
- this.security = _chunkTYQUSXUGcjs.resolveFarmSecurityConfig.call(void 0, config.security);
4805
+ this.security = _chunkISTFC3MZcjs.resolveFarmSecurityConfig.call(void 0, config.security);
4787
4806
  this.loadSSGManifest();
4788
4807
  }
4789
4808
  async initialize() {
@@ -4791,7 +4810,7 @@ var _ServerRenderer = class _ServerRenderer {
4791
4810
  if (_optionalChain([this, 'access', _148 => _148.config, 'access', _149 => _149.notFound, 'optionalAccess', _150 => _150.component, 'optionalAccess', _151 => _151.trim, 'call', _152 => _152()])) {
4792
4811
  resolveFarmNotFoundComponentPath(this.config, _chunkY4YMF2NQcjs.getFarmAppDirectories.call(void 0, this.config));
4793
4812
  }
4794
- const loaded = _chunkTFAXUHWXcjs.isReactRenderer.call(void 0, this.config.renderer) ? await import("./renderer/react/server.cjs") : this.viteServer ? await this.viteServer.ssrLoadModule(this.config.renderer.server) : await import(_url.pathToFileURL.call(void 0,
4813
+ const loaded = _chunkTFAXUHWXcjs.isReactRenderer.call(void 0, this.config.renderer) ? await import("./renderer/react/server.cjs") : this.viteServer ? await _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, this.viteServer, this.config.renderer.server) : await import(_url.pathToFileURL.call(void 0,
4795
4814
  _chunkTFAXUHWXcjs.resolveFarmRendererModule.call(void 0,
4796
4815
  this.config.root || process.cwd(),
4797
4816
  this.config.renderer.server
@@ -5024,7 +5043,7 @@ var _ServerRenderer = class _ServerRenderer {
5024
5043
  * Check if a path should be served from SSG cache
5025
5044
  */
5026
5045
  async shouldServeSSG(pathname) {
5027
- const ssgPage = _chunkWZMNW2IWcjs.matchSSGPage.call(void 0, pathname, this.ssgManifest);
5046
+ const ssgPage = _chunkXFFQSD2Fcjs.matchSSGPage.call(void 0, pathname, this.ssgManifest);
5028
5047
  if (!ssgPage) return null;
5029
5048
  const cached = await this.getCachedSSGPage(pathname);
5030
5049
  if (cached && await this.dataCache.isStaleAsync(cached)) {
@@ -5190,7 +5209,7 @@ var _ServerRenderer = class _ServerRenderer {
5190
5209
  pageProps,
5191
5210
  pathname: page.urlPath
5192
5211
  });
5193
- const { title, tags, hasFavicon } = _chunkOXSIH4D6cjs.renderMetadataHead.call(void 0, mergedMetadata);
5212
+ const { title, tags, hasFavicon } = _chunkKNPRCKXKcjs.renderMetadataHead.call(void 0, mergedMetadata);
5194
5213
  const metadataHead = `${hasFavicon ? "" : '<link rel="icon" href="data:,">\n '}<title>${title}</title>${tags}`;
5195
5214
  const fullDocument = this.createFullHTML(
5196
5215
  html,
@@ -5257,10 +5276,10 @@ var _ServerRenderer = class _ServerRenderer {
5257
5276
  await this.initialize();
5258
5277
  _chunkI57LW5VZcjs.setFarmBasePath.call(void 0, this.config.basePath);
5259
5278
  _chunkOYEUREB6cjs.setFarmTrailingSlashPreference.call(void 0, this.config.trailingSlash);
5260
- const cspNonce = _chunkTYQUSXUGcjs.createFarmCspNonce.call(void 0, this.security);
5279
+ const cspNonce = _chunkISTFC3MZcjs.createFarmCspNonce.call(void 0, this.security);
5261
5280
  if (cspNonce) {
5262
5281
  req.__FARM_CSP_NONCE__ = cspNonce;
5263
- const header = _chunkTYQUSXUGcjs.getFarmSecurityHeader.call(void 0, this.security, cspNonce);
5282
+ const header = _chunkISTFC3MZcjs.getFarmSecurityHeader.call(void 0, this.security, cspNonce);
5264
5283
  res.setHeader(header.key, header.value);
5265
5284
  }
5266
5285
  const request2 = _chunk5ZSWG4UXcjs.createWebRequestFromFarmRequest.call(void 0, req, {
@@ -5439,7 +5458,7 @@ var _ServerRenderer = class _ServerRenderer {
5439
5458
  throw error;
5440
5459
  }
5441
5460
  }
5442
- const renderingConfig = await _chunkWZMNW2IWcjs.resolveRouteRenderingConfigFromFile.call(void 0,
5461
+ const renderingConfig = await _chunkXFFQSD2Fcjs.resolveRouteRenderingConfigFromFile.call(void 0,
5443
5462
  routeModule,
5444
5463
  route.modulePath,
5445
5464
  { experimentalPPR: _optionalChain([this, 'access', _176 => _176.config, 'access', _177 => _177.experimental, 'optionalAccess', _178 => _178.ppr]) === true }
@@ -5843,7 +5862,7 @@ var _ServerRenderer = class _ServerRenderer {
5843
5862
  }
5844
5863
  }
5845
5864
  _chunkE3UK5IIBcjs.emitFarmEvent.call(void 0, { type: "render.error", route: pathname, error });
5846
- const errorStatus = _chunkOIEOCXKGcjs.resolveDefaultErrorStatus.call(void 0, error);
5865
+ const errorStatus = _chunkOYDRPBBVcjs.resolveDefaultErrorStatus.call(void 0, error);
5847
5866
  if (pprRefreshRoute) {
5848
5867
  _chunkE3UK5IIBcjs.emitFarmEvent.call(void 0, {
5849
5868
  type: "ppr.refresh.error",
@@ -5903,7 +5922,7 @@ var _ServerRenderer = class _ServerRenderer {
5903
5922
  path9.resolve(this.config.root, provider.component.module),
5904
5923
  this.config.root
5905
5924
  ) : provider.component.module;
5906
- const providerModule = this.viteServer ? await this.viteServer.ssrLoadModule(providerModuleId) : await importRuntimeModule(
5925
+ const providerModule = this.viteServer ? await _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, this.viteServer, providerModuleId) : await importRuntimeModule(
5907
5926
  provider.component.module.startsWith(".") ? _url.pathToFileURL.call(void 0, path9.resolve(this.config.root, provider.component.module)).href : provider.component.module
5908
5927
  );
5909
5928
  ProviderComponent = providerModule[provider.component.export || "default"];
@@ -5942,9 +5961,9 @@ var _ServerRenderer = class _ServerRenderer {
5942
5961
  async resolveRouteMetadata(options) {
5943
5962
  let metadata = {};
5944
5963
  for (const layoutModule of options.layoutModules) {
5945
- metadata = _chunkOXSIH4D6cjs.mergeMetadata.call(void 0, metadata, layoutModule.metadata);
5964
+ metadata = _chunkKNPRCKXKcjs.mergeMetadata.call(void 0, metadata, layoutModule.metadata);
5946
5965
  if (typeof layoutModule.generateMetadata === "function") {
5947
- metadata = _chunkOXSIH4D6cjs.mergeMetadata.call(void 0,
5966
+ metadata = _chunkKNPRCKXKcjs.mergeMetadata.call(void 0,
5948
5967
  metadata,
5949
5968
  await layoutModule.generateMetadata({
5950
5969
  params: options.pageProps.params
@@ -5952,9 +5971,9 @@ var _ServerRenderer = class _ServerRenderer {
5952
5971
  );
5953
5972
  }
5954
5973
  }
5955
- metadata = _chunkOXSIH4D6cjs.mergeMetadata.call(void 0, metadata, options.routeModule.metadata);
5974
+ metadata = _chunkKNPRCKXKcjs.mergeMetadata.call(void 0, metadata, options.routeModule.metadata);
5956
5975
  if (typeof options.routeModule.generateMetadata === "function") {
5957
- metadata = _chunkOXSIH4D6cjs.mergeMetadata.call(void 0,
5976
+ metadata = _chunkKNPRCKXKcjs.mergeMetadata.call(void 0,
5958
5977
  metadata,
5959
5978
  await options.routeModule.generateMetadata(options.pageProps)
5960
5979
  );
@@ -5977,7 +5996,7 @@ var _ServerRenderer = class _ServerRenderer {
5977
5996
  for (const kind of ["opengraph", "twitter"]) {
5978
5997
  const reference = await this.resolveMetadataImageReference(kind, options.pathname);
5979
5998
  if (reference) {
5980
- metadata = _chunkOXSIH4D6cjs.addMetadataImageReference.call(void 0, metadata, reference);
5999
+ metadata = _chunkKNPRCKXKcjs.addMetadataImageReference.call(void 0, metadata, reference);
5981
6000
  }
5982
6001
  }
5983
6002
  const snapshot = _chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0, );
@@ -5985,9 +6004,9 @@ var _ServerRenderer = class _ServerRenderer {
5985
6004
  snapshot ? _chunkBIDYX3SLcjs.localizeFarmHref.call(void 0, options.pathname, snapshot.locale, snapshot) : options.pathname,
5986
6005
  this.config.basePath
5987
6006
  );
5988
- metadata = _chunkOXSIH4D6cjs.addMetadataMarkdownAlternate.call(void 0,
6007
+ metadata = _chunkKNPRCKXKcjs.addMetadataMarkdownAlternate.call(void 0,
5989
6008
  metadata,
5990
- _chunkTWGMSEHXcjs.getFarmMarkdownAlternatePath.call(void 0, _chunkTWGMSEHXcjs.resolveMarkdownConfig.call(void 0, this.config.md), publicPathname)
6009
+ _chunkBBVSJVBZcjs.getFarmMarkdownAlternatePath.call(void 0, _chunkBBVSJVBZcjs.resolveMarkdownConfig.call(void 0, this.config.md), publicPathname)
5991
6010
  );
5992
6011
  return metadata;
5993
6012
  }
@@ -6059,11 +6078,11 @@ var _ServerRenderer = class _ServerRenderer {
6059
6078
  path: match.routePath,
6060
6079
  ...llmsContext
6061
6080
  }) : routeModule.default;
6062
- const body = match.metadata.kind === "llms-full" && !(value instanceof Response) ? await _chunkTYQUSXUGcjs.renderFarmLlmsFullTxt.call(void 0, value, {
6081
+ const body = match.metadata.kind === "llms-full" && !(value instanceof Response) ? await _chunkISTFC3MZcjs.renderFarmLlmsFullTxt.call(void 0, value, {
6063
6082
  origin: url.origin,
6064
6083
  readMarkdown: llmsContext.markdown
6065
6084
  }) : value;
6066
- const response = _chunkOIEOCXKGcjs.createFarmMetadataRouteResponse.call(void 0, match.metadata.kind, body, routeModule, {
6085
+ const response = _chunkOYDRPBBVcjs.createFarmMetadataRouteResponse.call(void 0, match.metadata.kind, body, routeModule, {
6067
6086
  method
6068
6087
  });
6069
6088
  await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0, res, response);
@@ -6080,7 +6099,7 @@ var _ServerRenderer = class _ServerRenderer {
6080
6099
  }
6081
6100
  /** `/llms.txt` and `/llms-full.txt` from `agent.llmsTxt` when no file route owns them. */
6082
6101
  getGeneratedLlmsKind(pathname) {
6083
- const config = _chunkTYQUSXUGcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _200 => _200.config, 'access', _201 => _201.agent, 'optionalAccess', _202 => _202.llmsTxt]));
6102
+ const config = _chunkISTFC3MZcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _200 => _200.config, 'access', _201 => _201.agent, 'optionalAccess', _202 => _202.llmsTxt]));
6084
6103
  if (!config.enabled) return null;
6085
6104
  if (pathname === "/llms.txt") return "llms";
6086
6105
  return pathname === "/llms-full.txt" && config.full ? "llms-full" : null;
@@ -6090,15 +6109,15 @@ var _ServerRenderer = class _ServerRenderer {
6090
6109
  const request2 = _chunk5ZSWG4UXcjs.createWebRequestFromFarmRequest.call(void 0, req, {
6091
6110
  trustProxy: _optionalChain([this, 'access', _203 => _203.config, 'access', _204 => _204.server, 'optionalAccess', _205 => _205.trustProxy])
6092
6111
  });
6093
- const config = _chunkTYQUSXUGcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _206 => _206.config, 'access', _207 => _207.agent, 'optionalAccess', _208 => _208.llmsTxt]));
6112
+ const config = _chunkISTFC3MZcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _206 => _206.config, 'access', _207 => _207.agent, 'optionalAccess', _208 => _208.llmsTxt]));
6094
6113
  const context = await this.createLlmsTxtContext(request2, { full: kind === "llms-full", req });
6095
- const body = kind === "llms-full" ? await _chunkTYQUSXUGcjs.renderFarmLlmsFullTxt.call(void 0, context.defaults, {
6114
+ const body = kind === "llms-full" ? await _chunkISTFC3MZcjs.renderFarmLlmsFullTxt.call(void 0, context.defaults, {
6096
6115
  origin: new URL(request2.url).origin,
6097
6116
  readMarkdown: context.markdown
6098
6117
  }) : context.defaults;
6099
6118
  await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0,
6100
6119
  res,
6101
- _chunkOIEOCXKGcjs.createFarmMetadataRouteResponse.call(void 0,
6120
+ _chunkOYDRPBBVcjs.createFarmMetadataRouteResponse.call(void 0,
6102
6121
  kind,
6103
6122
  body,
6104
6123
  { revalidate: config.revalidate },
@@ -6117,7 +6136,7 @@ var _ServerRenderer = class _ServerRenderer {
6117
6136
  }
6118
6137
  }
6119
6138
  getAgentCrawlers() {
6120
- return _chunkTYQUSXUGcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([this, 'access', _209 => _209.config, 'access', _210 => _210.agent, 'optionalAccess', _211 => _211.crawlers]));
6139
+ return _chunkISTFC3MZcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([this, 'access', _209 => _209.config, 'access', _210 => _210.agent, 'optionalAccess', _211 => _211.crawlers]));
6121
6140
  }
6122
6141
  /** `/robots.txt` from `agent.crawlers` when no robots.ts owns it. */
6123
6142
  async renderGeneratedRobotsTxt(req, res) {
@@ -6125,7 +6144,7 @@ var _ServerRenderer = class _ServerRenderer {
6125
6144
  const sitemapPath = _optionalChain([this, 'access', _212 => _212.routeManager, 'access', _213 => _213.matchMetadataRoute, 'call', _214 => _214("/sitemap.xml"), 'optionalAccess', _215 => _215.metadata, 'access', _216 => _216.kind]) === "sitemap" ? "/sitemap.xml" : void 0;
6126
6145
  const rootLayout = this.routeManager.getLayouts().get("/");
6127
6146
  const rootMetadata = sitemapPath && rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
6128
- const robots = _chunkTYQUSXUGcjs.createFarmAgentRobots.call(void 0, {
6147
+ const robots = _chunkISTFC3MZcjs.createFarmAgentRobots.call(void 0, {
6129
6148
  crawlers: this.getAgentCrawlers(),
6130
6149
  sitemapPath,
6131
6150
  metadataBase: _optionalChain([rootMetadata, 'optionalAccess', _217 => _217.metadataBase]),
@@ -6133,7 +6152,7 @@ var _ServerRenderer = class _ServerRenderer {
6133
6152
  });
6134
6153
  await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0,
6135
6154
  res,
6136
- _chunkOIEOCXKGcjs.createFarmMetadataRouteResponse.call(void 0, "robots", robots, {}, { method: req.method })
6155
+ _chunkOYDRPBBVcjs.createFarmMetadataRouteResponse.call(void 0, "robots", robots, {}, { method: req.method })
6137
6156
  );
6138
6157
  } catch (error) {
6139
6158
  _chunk5QIKR7RRcjs.logger.error(`Generated robots.txt failed: ${error}`);
@@ -6148,7 +6167,7 @@ var _ServerRenderer = class _ServerRenderer {
6148
6167
  }
6149
6168
  /** Same inputs the production server gives llms.txt: static pages and root metadata. */
6150
6169
  async createLlmsTxtContext(request2, options = {}) {
6151
- const config = _chunkTYQUSXUGcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _218 => _218.config, 'access', _219 => _219.agent, 'optionalAccess', _220 => _220.llmsTxt]));
6170
+ const config = _chunkISTFC3MZcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([this, 'access', _218 => _218.config, 'access', _219 => _219.agent, 'optionalAccess', _220 => _220.llmsTxt]));
6152
6171
  const origin = new URL(request2.url).origin;
6153
6172
  const staticRoutes = [...this.routeManager.getRoutes()].filter(
6154
6173
  ([pattern]) => !pattern.includes("[")
@@ -6166,16 +6185,16 @@ var _ServerRenderer = class _ServerRenderer {
6166
6185
  );
6167
6186
  const rootLayout = this.routeManager.getLayouts().get("/");
6168
6187
  const rootMetadata = rootLayout ? (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).metadata : void 0;
6169
- const pages = _chunkTYQUSXUGcjs.collectFarmLlmsTxtPages.call(void 0, sources, {
6188
+ const pages = _chunkISTFC3MZcjs.collectFarmLlmsTxtPages.call(void 0, sources, {
6170
6189
  origin,
6171
6190
  basePath: this.config.basePath,
6172
- markdown: _chunkTWGMSEHXcjs.resolveMarkdownConfig.call(void 0, this.config.md),
6191
+ markdown: _chunkBBVSJVBZcjs.resolveMarkdownConfig.call(void 0, this.config.md),
6173
6192
  include: config.include,
6174
6193
  exclude: config.exclude
6175
6194
  });
6176
6195
  return {
6177
6196
  pages,
6178
- defaults: _chunkTYQUSXUGcjs.createFarmDefaultLlmsTxt.call(void 0, { origin, pages, config, rootMetadata }),
6197
+ defaults: _chunkISTFC3MZcjs.createFarmDefaultLlmsTxt.call(void 0, { origin, pages, config, rootMetadata }),
6179
6198
  ...options.full ? { markdown: this.createDevMarkdownReader(options.req) } : {}
6180
6199
  };
6181
6200
  }
@@ -6195,11 +6214,11 @@ var _ServerRenderer = class _ServerRenderer {
6195
6214
  }
6196
6215
  if (socket.encrypted) {
6197
6216
  const address = { host: socket.localAddress, port: socket.localPort };
6198
- return _chunkTYQUSXUGcjs.createFarmLlmsMarkdownReader.call(void 0, (page) => requestOwnHttpsServer(page, address));
6217
+ return _chunkISTFC3MZcjs.createFarmLlmsMarkdownReader.call(void 0, (page) => requestOwnHttpsServer(page, address));
6199
6218
  }
6200
6219
  const host = socket.localAddress.includes(":") ? `[${socket.localAddress}]` : socket.localAddress;
6201
6220
  const localOrigin = `http://${host}:${socket.localPort}`;
6202
- const read = _chunkTYQUSXUGcjs.createFarmLlmsMarkdownReader.call(void 0, (page) => fetch(page));
6221
+ const read = _chunkISTFC3MZcjs.createFarmLlmsMarkdownReader.call(void 0, (page) => fetch(page));
6203
6222
  return (url) => {
6204
6223
  const target = new URL(url);
6205
6224
  return read(`${localOrigin}${target.pathname}${target.search}`);
@@ -6438,7 +6457,7 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
6438
6457
  tags: metaTags,
6439
6458
  hasFavicon,
6440
6459
  hasExplicitTitle
6441
- } = _chunkOXSIH4D6cjs.renderMetadataHead.call(void 0, req.__FARM_METADATA__, {
6460
+ } = _chunkKNPRCKXKcjs.renderMetadataHead.call(void 0, req.__FARM_METADATA__, {
6442
6461
  pathname: getFarmMetadataPathname(req),
6443
6462
  jsonLd: _optionalChain([this, 'access', _232 => _232.config, 'access', _233 => _233.agent, 'optionalAccess', _234 => _234.jsonLd])
6444
6463
  });
@@ -6450,7 +6469,7 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
6450
6469
  i18nSnapshot,
6451
6470
  this.getI18nAlternateOptions(req, req.__FARM_METADATA__)
6452
6471
  ) : "";
6453
- const themeDocument = _chunkOIEOCXKGcjs.createFarmThemeDocumentParts.call(void 0,
6472
+ const themeDocument = _chunkOYDRPBBVcjs.createFarmThemeDocumentParts.call(void 0,
6454
6473
  this.config.theme,
6455
6474
  this.config.basePath,
6456
6475
  _chunkXWAWFQFScjs.getTheme.call(void 0, )
@@ -6530,10 +6549,43 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
6530
6549
  _optionalChain([clearMiddlewareData, 'optionalCall', _238 => _238()]);
6531
6550
  }
6532
6551
  }
6552
+ /**
6553
+ * Whether the root layout returns its own `<html>` document, checked as the client's layout
6554
+ * boundary checks it: call a plain synchronous layout and look at what it returns. Knowing
6555
+ * this up front keeps a route's first request on the buffered path too; a layout this cannot
6556
+ * call (async, a class, or one using hooks) falls back to detection from the stream.
6557
+ */
6558
+ async rootLayoutRendersDocument() {
6559
+ if (typeof this.routeManager.getLayouts !== "function") return false;
6560
+ const rootLayout = this.routeManager.getLayouts().get("/");
6561
+ if (!rootLayout) return false;
6562
+ try {
6563
+ const Layout = (await this.routeManager.loadLayoutModule(rootLayout.modulePath)).default;
6564
+ if (typeof Layout !== "function" || _optionalChain([Layout, 'access', _239 => _239.prototype, 'optionalAccess', _240 => _240.isReactComponent]) || _optionalChain([Layout, 'access', _241 => _241.constructor, 'optionalAccess', _242 => _242.name]) === "AsyncFunction") {
6565
+ return false;
6566
+ }
6567
+ const cached = documentLayouts.get(Layout);
6568
+ if (cached !== void 0) return cached;
6569
+ let rendersDocument = false;
6570
+ try {
6571
+ const rendered = Layout({
6572
+ children: null,
6573
+ params: {}
6574
+ });
6575
+ rendersDocument = this.rendererRuntime.isValidElement(rendered) && rendered.type === "html";
6576
+ } catch (e18) {
6577
+ rendersDocument = false;
6578
+ }
6579
+ documentLayouts.set(Layout, rendersDocument);
6580
+ return rendersDocument;
6581
+ } catch (e19) {
6582
+ return false;
6583
+ }
6584
+ }
6533
6585
  async renderWithSSR(element, req, res, clearMiddlewareData, options = {}) {
6534
6586
  const renderToPipeableStream = this.rendererRuntime.renderToPipeableStream;
6535
6587
  const fullDocumentRouteKey = options.observabilityRoute || req.__FARM_ROUTE__ || req.url || "/";
6536
- if (!renderToPipeableStream || fullDocumentRoutes.has(fullDocumentRouteKey)) {
6588
+ if (!renderToPipeableStream || fullDocumentRoutes.has(fullDocumentRouteKey) || await this.rootLayoutRendersDocument()) {
6537
6589
  return this.renderBufferedSSR(element, req, res, clearMiddlewareData, options);
6538
6590
  }
6539
6591
  return new Promise((resolve5, reject) => {
@@ -6643,9 +6695,9 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
6643
6695
  title,
6644
6696
  tags: metaTags,
6645
6697
  hasFavicon
6646
- } = _chunkOXSIH4D6cjs.renderMetadataHead.call(void 0, req.__FARM_METADATA__, {
6698
+ } = _chunkKNPRCKXKcjs.renderMetadataHead.call(void 0, req.__FARM_METADATA__, {
6647
6699
  pathname: getFarmMetadataPathname(req),
6648
- jsonLd: _optionalChain([this, 'access', _239 => _239.config, 'access', _240 => _240.agent, 'optionalAccess', _241 => _241.jsonLd])
6700
+ jsonLd: _optionalChain([this, 'access', _243 => _243.config, 'access', _244 => _244.agent, 'optionalAccess', _245 => _245.jsonLd])
6649
6701
  });
6650
6702
  const i18nSnapshot = _chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0, );
6651
6703
  const i18nAlternateTags = i18nSnapshot ? renderI18nAlternateLinks(
@@ -6654,7 +6706,7 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
6654
6706
  this.getI18nAlternateOptions(req, req.__FARM_METADATA__)
6655
6707
  ) : "";
6656
6708
  const fontHead = renderFarmFontDevHead(this.config.root || process.cwd());
6657
- const themeDocument = _chunkOIEOCXKGcjs.createFarmThemeDocumentParts.call(void 0,
6709
+ const themeDocument = _chunkOYDRPBBVcjs.createFarmThemeDocumentParts.call(void 0,
6658
6710
  this.config.theme,
6659
6711
  this.config.basePath,
6660
6712
  _chunkXWAWFQFScjs.getTheme.call(void 0, )
@@ -6663,13 +6715,13 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
6663
6715
  const devStyleLinks = this.collectDevStyleLinks();
6664
6716
  const globalStylesheetLink = this.devGlobalStylesheetLink(true);
6665
6717
  const cspNonce = this.getCspNonce(req);
6666
- const secureDocumentHTML = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (html) => cspNonce ? _chunkTYQUSXUGcjs.addFarmCspNonceToScriptTags.call(void 0, html, cspNonce) : html, "secureDocumentHTML");
6718
+ const secureDocumentHTML = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (html) => cspNonce ? _chunkISTFC3MZcjs.addFarmCspNonceToScriptTags.call(void 0, html, cspNonce) : html, "secureDocumentHTML");
6667
6719
  const createLateNavigationRecovery = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (navigationError) => this.createLateNavigationRecoveryHTML(req, navigationError), "createLateNavigationRecovery");
6668
6720
  const { pipe, abort } = renderToPipeableStream(streamRoot, {
6669
6721
  nonce: cspNonce,
6670
6722
  onShellReady() {
6671
6723
  if (pendingNavigationError) {
6672
- _optionalChain([abort, 'optionalCall', _242 => _242(pendingNavigationError)]);
6724
+ _optionalChain([abort, 'optionalCall', _246 => _246(pendingNavigationError)]);
6673
6725
  if (clearMiddlewareData) {
6674
6726
  clearMiddlewareData();
6675
6727
  }
@@ -6687,7 +6739,7 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
6687
6739
  console.log(`[FARM STREAM] onShellReady at ${shellReadyMs}ms`);
6688
6740
  }
6689
6741
  const shell = `<!DOCTYPE html>
6690
- <html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _243 => _243.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
6742
+ <html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _247 => _247.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
6691
6743
  <head>
6692
6744
  ${themeDocument.head}
6693
6745
  <meta charset="utf-8">
@@ -6706,17 +6758,21 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
6706
6758
  <div id="root">`;
6707
6759
  const securedShell = secureDocumentHTML(shell);
6708
6760
  htmlParts.push(securedShell);
6709
- _optionalChain([staticShellParts, 'optionalAccess', _244 => _244.push, 'call', _245 => _245(securedShell)]);
6761
+ _optionalChain([staticShellParts, 'optionalAccess', _248 => _248.push, 'call', _249 => _249(securedShell)]);
6710
6762
  let firstChunk = true;
6711
6763
  let checkedFullDocument = false;
6712
- const cspNonceRewriter = cspNonce ? _chunkTYQUSXUGcjs.createFarmCspNonceRewriter.call(void 0, cspNonce) : void 0;
6764
+ let documentPrefix = "";
6765
+ const cspNonceRewriter = cspNonce ? _chunkISTFC3MZcjs.createFarmCspNonceRewriter.call(void 0, cspNonce) : void 0;
6713
6766
  const cspStreamDecoder = cspNonceRewriter ? new TextDecoder() : void 0;
6714
6767
  const recordRenderedChunk = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (chunkText) => {
6715
6768
  if (!chunkText) return;
6716
6769
  if (!checkedFullDocument) {
6717
- checkedFullDocument = true;
6718
- if (opensFarmFullDocument(chunkText)) {
6719
- fullDocumentRoutes.add(fullDocumentRouteKey);
6770
+ documentPrefix += chunkText;
6771
+ const prefix = classifyFarmDocumentPrefix(documentPrefix);
6772
+ if (prefix !== "pending") {
6773
+ checkedFullDocument = true;
6774
+ documentPrefix = "";
6775
+ if (prefix === "document") fullDocumentRoutes.add(fullDocumentRouteKey);
6720
6776
  }
6721
6777
  }
6722
6778
  htmlParts.push(chunkText);
@@ -6729,7 +6785,7 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
6729
6785
  staticShellClosed = true;
6730
6786
  if (!suspenseHoleEmitted) {
6731
6787
  suspenseHoleEmitted = true;
6732
- _optionalChain([options, 'access', _246 => _246.onSuspenseHoleDetected, 'optionalCall', _247 => _247()]);
6788
+ _optionalChain([options, 'access', _250 => _250.onSuspenseHoleDetected, 'optionalCall', _251 => _251()]);
6733
6789
  }
6734
6790
  } else {
6735
6791
  staticShellParts.push(chunkText);
@@ -6886,12 +6942,12 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
6886
6942
  return await this.routeManager.loadRouteModule(notFoundPath);
6887
6943
  }
6888
6944
  async loadNotFoundComponent() {
6889
- return await _asyncNullishCoalesce(await _asyncOptionalChain([(await this.loadNotFoundModule()), 'optionalAccess', async _248 => _248.default]), async () => ( null));
6945
+ return await _asyncNullishCoalesce(await _asyncOptionalChain([(await this.loadNotFoundModule()), 'optionalAccess', async _252 => _252.default]), async () => ( null));
6890
6946
  }
6891
6947
  /** The not-found document's head: layout and not-found metadata, as production renders it. */
6892
6948
  async notFoundMetadataHead(layoutModule, notFoundModule) {
6893
- const metadata = await _chunkOXSIH4D6cjs.resolveFarmNotFoundMetadata.call(void 0, [layoutModule], notFoundModule);
6894
- const { title, tags, hasFavicon } = _chunkOXSIH4D6cjs.renderMetadataHead.call(void 0, metadata);
6949
+ const metadata = await _chunkKNPRCKXKcjs.resolveFarmNotFoundMetadata.call(void 0, [layoutModule], notFoundModule);
6950
+ const { title, tags, hasFavicon } = _chunkKNPRCKXKcjs.renderMetadataHead.call(void 0, metadata);
6895
6951
  return {
6896
6952
  head: `${hasFavicon ? "" : '<link rel="icon" href="data:,">\n '}<title>${title}</title>${tags}`,
6897
6953
  metadata
@@ -6909,10 +6965,10 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
6909
6965
  */
6910
6966
  async createLateNavigationRecoveryHTML(req, error) {
6911
6967
  if (_chunkOX6O6WVAcjs.isFarmRedirectError.call(void 0, error)) {
6912
- return _chunkOIEOCXKGcjs.createLateRedirectRecovery.call(void 0, this.localizeRedirectUrl(_chunkOX6O6WVAcjs.getFarmRedirectError.call(void 0, error).url));
6968
+ return _chunkOYDRPBBVcjs.createLateRedirectRecovery.call(void 0, this.localizeRedirectUrl(_chunkOX6O6WVAcjs.getFarmRedirectError.call(void 0, error).url));
6913
6969
  }
6914
6970
  const pathname = _chunk5ZSWG4UXcjs.resolveFarmRequestURL.call(void 0, req, {
6915
- trustProxy: _optionalChain([this, 'access', _249 => _249.config, 'access', _250 => _250.server, 'optionalAccess', _251 => _251.trustProxy])
6971
+ trustProxy: _optionalChain([this, 'access', _253 => _253.config, 'access', _254 => _254.server, 'optionalAccess', _255 => _255.trustProxy])
6916
6972
  }).pathname;
6917
6973
  let content = this.defaultNotFoundContent();
6918
6974
  const NotFoundComponent = await this.loadNotFoundComponent();
@@ -6927,20 +6983,20 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
6927
6983
  _chunk5QIKR7RRcjs.logger.warn(`not-found page could not render outside its layout, using Farm's: ${error2}`);
6928
6984
  }
6929
6985
  }
6930
- return _chunkOIEOCXKGcjs.createLateNotFoundRecovery.call(void 0, content);
6986
+ return _chunkOYDRPBBVcjs.createLateNotFoundRecovery.call(void 0, content);
6931
6987
  }
6932
6988
  async render404(req, res) {
6933
6989
  res.statusCode = 404;
6934
6990
  const pathname = _chunk5ZSWG4UXcjs.resolveFarmRequestURL.call(void 0, req, {
6935
- trustProxy: _optionalChain([this, 'access', _252 => _252.config, 'access', _253 => _253.server, 'optionalAccess', _254 => _254.trustProxy])
6991
+ trustProxy: _optionalChain([this, 'access', _256 => _256.config, 'access', _257 => _257.server, 'optionalAccess', _258 => _258.trustProxy])
6936
6992
  }).pathname;
6937
6993
  const acceptHeader = req.headers.accept;
6938
6994
  const accept = Array.isArray(acceptHeader) ? acceptHeader.join(",") : acceptHeader;
6939
- if (_chunkTWGMSEHXcjs.farmRequestWantsMarkdown.call(void 0, pathname, accept)) {
6940
- res.setHeader("Content-Type", _chunkTWGMSEHXcjs.FARM_MARKDOWN_CONTENT_TYPE);
6995
+ if (_chunkBBVSJVBZcjs.farmRequestWantsMarkdown.call(void 0, pathname, accept)) {
6996
+ res.setHeader("Content-Type", _chunkBBVSJVBZcjs.FARM_MARKDOWN_CONTENT_TYPE);
6941
6997
  res.setHeader("X-Farm-Markdown-Error", "404");
6942
6998
  res.setHeader("Cache-Control", "no-store");
6943
- res.end(_chunkTWGMSEHXcjs.createFarmMarkdownErrorBody.call(void 0, 404, pathname, this.config.basePath || "/"));
6999
+ res.end(_chunkBBVSJVBZcjs.createFarmMarkdownErrorBody.call(void 0, 404, pathname, this.config.basePath || "/"));
6944
7000
  return;
6945
7001
  }
6946
7002
  const appDir = path9.join(this.config.root, this.config.srcDir, "app");
@@ -6960,9 +7016,9 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
6960
7016
  );
6961
7017
  if (notFoundPath) {
6962
7018
  const notFoundModule = await this.loadNotFoundModule();
6963
- const NotFoundComponent = _nullishCoalesce(_optionalChain([notFoundModule, 'optionalAccess', _255 => _255.default]), () => ( null));
7019
+ const NotFoundComponent = _nullishCoalesce(_optionalChain([notFoundModule, 'optionalAccess', _259 => _259.default]), () => ( null));
6964
7020
  if (NotFoundComponent) {
6965
- const LayoutComponent = _nullishCoalesce(_optionalChain([layoutModule, 'optionalAccess', _256 => _256.default]), () => ( null));
7021
+ const LayoutComponent = _nullishCoalesce(_optionalChain([layoutModule, 'optionalAccess', _260 => _260.default]), () => ( null));
6966
7022
  let element = this.rendererRuntime.createElement(NotFoundComponent, { pathname });
6967
7023
  if (LayoutComponent) {
6968
7024
  element = this.rendererRuntime.createElement(LayoutComponent, {
@@ -6999,21 +7055,21 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
6999
7055
  res.statusCode = statusCode;
7000
7056
  const isDev = process.env.NODE_ENV === "development";
7001
7057
  const requestUrl = _chunk5ZSWG4UXcjs.resolveFarmRequestURL.call(void 0, req, {
7002
- trustProxy: _optionalChain([this, 'access', _257 => _257.config, 'access', _258 => _258.server, 'optionalAccess', _259 => _259.trustProxy])
7058
+ trustProxy: _optionalChain([this, 'access', _261 => _261.config, 'access', _262 => _262.server, 'optionalAccess', _263 => _263.trustProxy])
7003
7059
  });
7004
7060
  const diagnostics = isDev ? createDefaultErrorDiagnostics(error, this.config.root || process.cwd()) : void 0;
7005
- const statusText = _chunkOIEOCXKGcjs.getDefaultErrorStatusText.call(void 0, statusCode);
7006
- const content = _chunkOIEOCXKGcjs.createDefaultErrorMarkup.call(void 0, {
7061
+ const statusText = _chunkOYDRPBBVcjs.getDefaultErrorStatusText.call(void 0, statusCode);
7062
+ const content = _chunkOYDRPBBVcjs.createDefaultErrorMarkup.call(void 0, {
7007
7063
  statusCode,
7008
7064
  statusText,
7009
7065
  requestPath: requestUrl.pathname,
7010
7066
  method: req.method || "GET",
7011
- message: _optionalChain([diagnostics, 'optionalAccess', _260 => _260.message]),
7012
- errorName: _optionalChain([diagnostics, 'optionalAccess', _261 => _261.name]),
7013
- stack: _optionalChain([diagnostics, 'optionalAccess', _262 => _262.stack]),
7014
- sourceFrame: _optionalChain([diagnostics, 'optionalAccess', _263 => _263.sourceFrame]),
7067
+ message: _optionalChain([diagnostics, 'optionalAccess', _264 => _264.message]),
7068
+ errorName: _optionalChain([diagnostics, 'optionalAccess', _265 => _265.name]),
7069
+ stack: _optionalChain([diagnostics, 'optionalAccess', _266 => _266.stack]),
7070
+ sourceFrame: _optionalChain([diagnostics, 'optionalAccess', _267 => _267.sourceFrame]),
7015
7071
  development: isDev,
7016
- farmVersion: _chunkNWOD6NITcjs.FARM_VERSION,
7072
+ farmVersion: _chunkA7T6JZNIcjs.FARM_VERSION,
7017
7073
  nodeVersion: process.version,
7018
7074
  mode: isDev ? "development" : "production"
7019
7075
  });
@@ -7038,8 +7094,8 @@ window.__FARM_I18N__ = ${_chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0
7038
7094
  */
7039
7095
  getI18nAlternateOptions(req, metadata) {
7040
7096
  return {
7041
- metadataBase: _optionalChain([metadata, 'optionalAccess', _264 => _264.metadataBase]),
7042
- origin: req ? _chunk5ZSWG4UXcjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _265 => _265.config, 'access', _266 => _266.server, 'optionalAccess', _267 => _267.trustProxy]) }).origin : void 0
7097
+ metadataBase: _optionalChain([metadata, 'optionalAccess', _268 => _268.metadataBase]),
7098
+ origin: req ? _chunk5ZSWG4UXcjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _269 => _269.config, 'access', _270 => _270.server, 'optionalAccess', _271 => _271.trustProxy]) }).origin : void 0
7043
7099
  };
7044
7100
  }
7045
7101
  createFullHTML(content, isClientComponent = false, requestPath = "/", metadataHead, alternates = {}) {
@@ -7056,12 +7112,12 @@ ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};`
7056
7112
  this.getI18nAlternateOptions(alternates.req, alternates.metadata)
7057
7113
  ) : "";
7058
7114
  const fontHead = renderFarmFontDevHead(this.config.root || process.cwd());
7059
- const themeDocument = _chunkOIEOCXKGcjs.createFarmThemeDocumentParts.call(void 0,
7115
+ const themeDocument = _chunkOYDRPBBVcjs.createFarmThemeDocumentParts.call(void 0,
7060
7116
  this.config.theme,
7061
7117
  this.config.basePath,
7062
7118
  _chunkXWAWFQFScjs.getTheme.call(void 0, )
7063
7119
  );
7064
- const rendererHydrationScript = _optionalChain([this, 'access', _268 => _268.rendererRuntime, 'access', _269 => _269.generateHydrationScript, 'optionalCall', _270 => _270()]) || "";
7120
+ const rendererHydrationScript = _optionalChain([this, 'access', _272 => _272.rendererRuntime, 'access', _273 => _273.generateHydrationScript, 'optionalCall', _274 => _274()]) || "";
7065
7121
  const fullDocument = extractFarmFullDocument(content);
7066
7122
  if (fullDocument) {
7067
7123
  return composeFarmFullDocument(
@@ -7090,7 +7146,7 @@ ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};`
7090
7146
  );
7091
7147
  }
7092
7148
  return `<!DOCTYPE html>
7093
- <html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _271 => _271.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
7149
+ <html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _275 => _275.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
7094
7150
  <head>
7095
7151
  ${themeDocument.head}
7096
7152
  <meta charset="utf-8">
@@ -7116,14 +7172,14 @@ ${clientScript}
7116
7172
  }
7117
7173
  secureDocumentHTML(req, html) {
7118
7174
  const nonce = this.getCspNonce(req);
7119
- return nonce ? _chunkTYQUSXUGcjs.addFarmCspNonceToScriptTags.call(void 0, html, nonce) : html;
7175
+ return nonce ? _chunkISTFC3MZcjs.addFarmCspNonceToScriptTags.call(void 0, html, nonce) : html;
7120
7176
  }
7121
7177
  applyDeploymentHeaders(req, res) {
7122
7178
  const deploymentId = this.getDeploymentId();
7123
7179
  res.setHeader(_chunkC5GUTBZKcjs.FARM_DEPLOYMENT_ID_HEADER, deploymentId);
7124
7180
  if ((req.method || "GET").toUpperCase() !== "GET") return;
7125
7181
  const forwardedProto = req.headers["x-forwarded-proto"];
7126
- const isSecure = _optionalChain([(Array.isArray(forwardedProto) ? forwardedProto[0] : forwardedProto), 'optionalAccess', _272 => _272.split, 'call', _273 => _273(","), 'access', _274 => _274[0], 'optionalAccess', _275 => _275.trim, 'call', _276 => _276()]) === "https" || Boolean(_optionalChain([req, 'access', _277 => _277.socket, 'optionalAccess', _278 => _278.encrypted]));
7182
+ const isSecure = _optionalChain([(Array.isArray(forwardedProto) ? forwardedProto[0] : forwardedProto), 'optionalAccess', _276 => _276.split, 'call', _277 => _277(","), 'access', _278 => _278[0], 'optionalAccess', _279 => _279.trim, 'call', _280 => _280()]) === "https" || Boolean(_optionalChain([req, 'access', _281 => _281.socket, 'optionalAccess', _282 => _282.encrypted]));
7127
7183
  const cookie = _chunkC5GUTBZKcjs.createFarmDeploymentCookie.call(void 0, deploymentId, this.config.basePath || "/", isSecure);
7128
7184
  const existing = res.getHeader("Set-Cookie");
7129
7185
  if (Array.isArray(existing)) {
@@ -7220,13 +7276,13 @@ var _FarmApp = class _FarmApp {
7220
7276
  workflows: _chunkK6FNHVDRcjs.resolveWorkflowsConfig.call(void 0, config.workflows),
7221
7277
  api: normalizeFarmAppAPIConfig(config.api),
7222
7278
  middleware: config.middleware || {},
7223
- routeRules: _chunkGDSHDTJ4cjs.normalizeRouteRules.call(void 0, config.routeRules),
7279
+ routeRules: _chunkQ5B3KJBPcjs.normalizeRouteRules.call(void 0, config.routeRules),
7224
7280
  context: config.context || (() => void 0),
7225
7281
  server: _chunkEM6SBQKMcjs.resolveFarmServerConfig.call(void 0, config.server),
7226
7282
  serverActions: _chunkT5CERMEHcjs.resolveServerActionsConfig.call(void 0, config.serverActions),
7227
- security: _chunkTYQUSXUGcjs.resolveFarmSecurityConfig.call(void 0, config.security),
7283
+ security: _chunkISTFC3MZcjs.resolveFarmSecurityConfig.call(void 0, config.security),
7228
7284
  images: _chunkYFPGHF5Fcjs.resolveFarmImageConfig.call(void 0, config.images),
7229
- performance: _chunkTYQUSXUGcjs.resolveFarmPerformanceConfig.call(void 0, config.performance),
7285
+ performance: _chunkISTFC3MZcjs.resolveFarmPerformanceConfig.call(void 0, config.performance),
7230
7286
  theme: _chunkOI6CMLWXcjs.resolveFarmThemeConfig.call(void 0, config.theme, basePath),
7231
7287
  i18n: isResolvedI18nConfig(config.i18n) ? config.i18n : _chunkHBTUGXHScjs.resolveFarmI18nConfig.call(void 0, config.i18n, {
7232
7288
  root,
@@ -7238,7 +7294,7 @@ var _FarmApp = class _FarmApp {
7238
7294
  serverRuntimeConfig: config.serverRuntimeConfig || {},
7239
7295
  publicRuntimeConfig: config.publicRuntimeConfig || {},
7240
7296
  docs: isResolvedDocsConfig(config.docs) ? config.docs : defaultDocsConfig,
7241
- md: _chunkTWGMSEHXcjs.resolveMarkdownConfig.call(void 0, config.md),
7297
+ md: _chunkBBVSJVBZcjs.resolveMarkdownConfig.call(void 0, config.md),
7242
7298
  mdx: _chunkOHY2ZWUGcjs.resolveMdxConfig.call(void 0, config.mdx),
7243
7299
  observability: _nullishCoalesce(config.observability, () => ( false)),
7244
7300
  telemetry: config.telemetry !== false,
@@ -7254,10 +7310,10 @@ var _FarmApp = class _FarmApp {
7254
7310
  env: config.env || { server: {}, public: {} },
7255
7311
  suppressLintOnLink: _nullishCoalesce(config.suppressLintOnLink, () => ( false)),
7256
7312
  experimental: {
7257
- serverComponents: _nullishCoalesce(_optionalChain([config, 'access', _279 => _279.experimental, 'optionalAccess', _280 => _280.serverComponents]), () => ( false)),
7258
- serverActions: _nullishCoalesce(_optionalChain([config, 'access', _281 => _281.experimental, 'optionalAccess', _282 => _282.serverActions]), () => ( false)),
7259
- isolatedClientHydration: _nullishCoalesce(_optionalChain([config, 'access', _283 => _283.experimental, 'optionalAccess', _284 => _284.isolatedClientHydration]), () => ( "off")),
7260
- ppr: _nullishCoalesce(_optionalChain([config, 'access', _285 => _285.experimental, 'optionalAccess', _286 => _286.ppr]), () => ( false)),
7313
+ serverComponents: _nullishCoalesce(_optionalChain([config, 'access', _283 => _283.experimental, 'optionalAccess', _284 => _284.serverComponents]), () => ( false)),
7314
+ serverActions: _nullishCoalesce(_optionalChain([config, 'access', _285 => _285.experimental, 'optionalAccess', _286 => _286.serverActions]), () => ( false)),
7315
+ isolatedClientHydration: _nullishCoalesce(_optionalChain([config, 'access', _287 => _287.experimental, 'optionalAccess', _288 => _288.isolatedClientHydration]), () => ( "off")),
7316
+ ppr: _nullishCoalesce(_optionalChain([config, 'access', _289 => _289.experimental, 'optionalAccess', _290 => _290.ppr]), () => ( false)),
7261
7317
  ...config.experimental
7262
7318
  },
7263
7319
  agent: _nullishCoalesce(config.agent, () => ( {})),
@@ -7271,7 +7327,7 @@ var _FarmApp = class _FarmApp {
7271
7327
  );
7272
7328
  if (!hasAppDirectory) {
7273
7329
  const routeFiles = _chunkY4YMF2NQcjs.getFarmSourceRoots.call(void 0, this.config).flatMap(
7274
- (source) => _chunkIAMRBF3Zcjs.findProgrammaticRouteFiles.call(void 0, source.root, source.srcDir)
7330
+ (source) => _chunkN4RLRSWWcjs.findProgrammaticRouteFiles.call(void 0, source.root, source.srcDir)
7275
7331
  );
7276
7332
  if (routeFiles.length > 0) {
7277
7333
  return;
@@ -7308,7 +7364,7 @@ function isResolvedAuthConfig(value) {
7308
7364
  }
7309
7365
  _chunkS3JO3N4Hcjs.__name.call(void 0, isResolvedAuthConfig, "isResolvedAuthConfig");
7310
7366
  function normalizeFarmAppAPIConfig(config) {
7311
- if (typeof _optionalChain([config, 'optionalAccess', _287 => _287.baseURL]) === "function" || typeof _optionalChain([config, 'optionalAccess', _288 => _288.basePath]) === "function") {
7367
+ if (typeof _optionalChain([config, 'optionalAccess', _291 => _291.baseURL]) === "function" || typeof _optionalChain([config, 'optionalAccess', _292 => _292.basePath]) === "function") {
7312
7368
  throw new Error(
7313
7369
  "Farm API config resolver functions must be processed with resolveConfig() before creating a FarmApp."
7314
7370
  );
@@ -7330,7 +7386,7 @@ function validateSchemaSteps(owner, schema, steps) {
7330
7386
  const models = _chunkJSROZYYOcjs.resolveSchemaModels.call(void 0, owner, schema);
7331
7387
  const ids = /* @__PURE__ */ new Set();
7332
7388
  for (const step of steps) {
7333
- const where = `${owner} migration "${_optionalChain([step, 'optionalAccess', _289 => _289.id])}"`;
7389
+ const where = `${owner} migration "${_optionalChain([step, 'optionalAccess', _293 => _293.id])}"`;
7334
7390
  if (!step || typeof step.id !== "string" || step.id.trim() === "") {
7335
7391
  throw new TypeError(`${owner}: every migration step needs a non-empty \`id\`.`);
7336
7392
  }
@@ -7419,7 +7475,7 @@ ${lines.join("\n")}`);
7419
7475
  _chunkS3JO3N4Hcjs.__name.call(void 0, _FarmPluginOptionsError, "FarmPluginOptionsError");
7420
7476
  var FarmPluginOptionsError = _FarmPluginOptionsError;
7421
7477
  function formatIssuePath(path17) {
7422
- if (!_optionalChain([path17, 'optionalAccess', _290 => _290.length])) return "";
7478
+ if (!_optionalChain([path17, 'optionalAccess', _294 => _294.length])) return "";
7423
7479
  return path17.map((segment) => {
7424
7480
  const key = typeof segment === "object" && segment !== null ? segment.key : segment;
7425
7481
  return typeof key === "symbol" ? key.toString() : String(key);
@@ -7433,11 +7489,11 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, isPromiseLike, "isPromiseLike");
7433
7489
  function isPluginOptionsSchema(value) {
7434
7490
  if (typeof value !== "object" && typeof value !== "function" || value === null) return false;
7435
7491
  const standard = value["~standard"];
7436
- return typeof _optionalChain([standard, 'optionalAccess', _291 => _291.validate]) === "function";
7492
+ return typeof _optionalChain([standard, 'optionalAccess', _295 => _295.validate]) === "function";
7437
7493
  }
7438
7494
  _chunkS3JO3N4Hcjs.__name.call(void 0, isPluginOptionsSchema, "isPluginOptionsSchema");
7439
7495
  function parsePluginOptions(schema, options) {
7440
- const standard = _optionalChain([schema, 'optionalAccess', _292 => _292["~standard"]]);
7496
+ const standard = _optionalChain([schema, 'optionalAccess', _296 => _296["~standard"]]);
7441
7497
  if (!standard || typeof standard.validate !== "function") {
7442
7498
  throw new TypeError(
7443
7499
  "A plugin's `options` needs a Standard Schema, such as a Zod, Valibot, or ArkType schema."
@@ -7472,7 +7528,7 @@ function normalizeFarmPluginRuntimeEndpointPath(pathname, label = "Farm plugin r
7472
7528
  let decoded = segment;
7473
7529
  try {
7474
7530
  decoded = decodeURIComponent(segment);
7475
- } catch (e18) {
7531
+ } catch (e20) {
7476
7532
  throw new TypeError(`${label} path contains a malformed percent escape`);
7477
7533
  }
7478
7534
  if (decoded.includes("/") || decoded.includes("\\")) {
@@ -7497,9 +7553,9 @@ function normalizeRuntimeEndpointRequestPath(pathname) {
7497
7553
  _chunkS3JO3N4Hcjs.__name.call(void 0, normalizeRuntimeEndpointRequestPath, "normalizeRuntimeEndpointRequestPath");
7498
7554
  function farmPluginMayAffectRuntimePath(plugin, pathname) {
7499
7555
  const runtime = plugin.runtime;
7500
- const endpoints = _optionalChain([runtime, 'optionalAccess', _293 => _293.endpoints]);
7556
+ const endpoints = _optionalChain([runtime, 'optionalAccess', _297 => _297.endpoints]);
7501
7557
  const hasUnscopedRequestHooks = Boolean(
7502
- plugin.init || plugin.ready || plugin.shutdown || _optionalChain([runtime, 'optionalAccess', _294 => _294.context]) || _optionalChain([runtime, 'optionalAccess', _295 => _295.before]) || _optionalChain([runtime, 'optionalAccess', _296 => _296.after]) || _optionalChain([runtime, 'optionalAccess', _297 => _297.error]) || plugin.router || plugin.render || plugin.beforeRouteMatch || plugin.afterRouteMatch || plugin.beforeRender || plugin.afterRender || plugin.onError || plugin.transformHTML || plugin.beforeRequest || plugin.afterResponse
7558
+ plugin.init || plugin.ready || plugin.shutdown || _optionalChain([runtime, 'optionalAccess', _298 => _298.context]) || _optionalChain([runtime, 'optionalAccess', _299 => _299.before]) || _optionalChain([runtime, 'optionalAccess', _300 => _300.after]) || _optionalChain([runtime, 'optionalAccess', _301 => _301.error]) || plugin.router || plugin.render || plugin.beforeRouteMatch || plugin.afterRouteMatch || plugin.beforeRender || plugin.afterRender || plugin.onError || plugin.transformHTML || plugin.beforeRequest || plugin.afterResponse
7503
7559
  );
7504
7560
  if (hasUnscopedRequestHooks) return true;
7505
7561
  if (Array.isArray(endpoints) && endpoints.length > 0) {
@@ -7511,7 +7567,7 @@ function farmPluginMayAffectRuntimePath(plugin, pathname) {
7511
7567
  ) === normalizedPathname
7512
7568
  );
7513
7569
  }
7514
- return Boolean(plugin.setup || _optionalChain([runtime, 'optionalAccess', _298 => _298.start]) || _optionalChain([runtime, 'optionalAccess', _299 => _299.close]));
7570
+ return Boolean(plugin.setup || _optionalChain([runtime, 'optionalAccess', _302 => _302.start]) || _optionalChain([runtime, 'optionalAccess', _303 => _303.close]));
7515
7571
  }
7516
7572
  _chunkS3JO3N4Hcjs.__name.call(void 0, farmPluginMayAffectRuntimePath, "farmPluginMayAffectRuntimePath");
7517
7573
 
@@ -7645,7 +7701,7 @@ var _PluginManager = class _PluginManager {
7645
7701
  const endpoints = [];
7646
7702
  const owners = /* @__PURE__ */ new Map();
7647
7703
  for (const plugin of this.getSortedPlugins()) {
7648
- const configured = _optionalChain([plugin, 'access', _300 => _300.runtime, 'optionalAccess', _301 => _301.endpoints]);
7704
+ const configured = _optionalChain([plugin, 'access', _304 => _304.runtime, 'optionalAccess', _305 => _305.endpoints]);
7649
7705
  if (configured === void 0) continue;
7650
7706
  if (!Array.isArray(configured)) {
7651
7707
  throw new TypeError(`Farm plugin "${plugin.name}" runtime.endpoints must be an array`);
@@ -7716,7 +7772,7 @@ var _PluginManager = class _PluginManager {
7716
7772
  const values = {};
7717
7773
  const owners = /* @__PURE__ */ new Map();
7718
7774
  for (const plugin of this.getSortedPlugins()) {
7719
- const createContext = _optionalChain([plugin, 'access', _302 => _302.runtime, 'optionalAccess', _303 => _303.context]);
7775
+ const createContext = _optionalChain([plugin, 'access', _306 => _306.runtime, 'optionalAccess', _307 => _307.context]);
7720
7776
  if (!createContext) continue;
7721
7777
  const result = await createContext(
7722
7778
  this.createRuntimeBaseEvent(plugin, request2, options, waitUntil)
@@ -7742,7 +7798,7 @@ var _PluginManager = class _PluginManager {
7742
7798
  }
7743
7799
  async runRuntimeErrorHooks(request2, error, ctx, durationMs, options, waitUntil) {
7744
7800
  for (const plugin of this.getSortedPlugins()) {
7745
- const onError = _optionalChain([plugin, 'access', _304 => _304.runtime, 'optionalAccess', _305 => _305.error]);
7801
+ const onError = _optionalChain([plugin, 'access', _308 => _308.runtime, 'optionalAccess', _309 => _309.error]);
7746
7802
  if (!onError) continue;
7747
7803
  try {
7748
7804
  await onError({
@@ -7786,19 +7842,19 @@ var _PluginManager = class _PluginManager {
7786
7842
  case "config":
7787
7843
  if (plugin.configure) {
7788
7844
  hooks.push(
7789
- (config, context) => _optionalChain([plugin, 'access', _306 => _306.configure, 'optionalCall', _307 => _307(config, context)])
7845
+ (config, context) => _optionalChain([plugin, 'access', _310 => _310.configure, 'optionalCall', _311 => _311(config, context)])
7790
7846
  );
7791
7847
  }
7792
7848
  break;
7793
7849
  case "ready":
7794
- if (_optionalChain([plugin, 'access', _308 => _308.runtime, 'optionalAccess', _309 => _309.start])) {
7795
- hooks.push((context) => _optionalChain([plugin, 'access', _310 => _310.runtime, 'optionalAccess', _311 => _311.start, 'optionalCall', _312 => _312(withState(context))]));
7850
+ if (_optionalChain([plugin, 'access', _312 => _312.runtime, 'optionalAccess', _313 => _313.start])) {
7851
+ hooks.push((context) => _optionalChain([plugin, 'access', _314 => _314.runtime, 'optionalAccess', _315 => _315.start, 'optionalCall', _316 => _316(withState(context))]));
7796
7852
  }
7797
7853
  break;
7798
7854
  case "shutdown":
7799
- if (_optionalChain([plugin, 'access', _313 => _313.runtime, 'optionalAccess', _314 => _314.close])) {
7855
+ if (_optionalChain([plugin, 'access', _317 => _317.runtime, 'optionalAccess', _318 => _318.close])) {
7800
7856
  hooks.push(
7801
- (payload, context) => _optionalChain([plugin, 'access', _315 => _315.runtime, 'optionalAccess', _316 => _316.close, 'optionalCall', _317 => _317({
7857
+ (payload, context) => _optionalChain([plugin, 'access', _319 => _319.runtime, 'optionalAccess', _320 => _320.close, 'optionalCall', _321 => _321({
7802
7858
  ...withState(context),
7803
7859
  reason: payload.reason
7804
7860
  })])
@@ -7806,93 +7862,93 @@ var _PluginManager = class _PluginManager {
7806
7862
  }
7807
7863
  break;
7808
7864
  case "routeDiscovered":
7809
- if (_optionalChain([plugin, 'access', _318 => _318.router, 'optionalAccess', _319 => _319.discovered])) {
7865
+ if (_optionalChain([plugin, 'access', _322 => _322.router, 'optionalAccess', _323 => _323.discovered])) {
7810
7866
  hooks.push(
7811
- (route, context) => _optionalChain([plugin, 'access', _320 => _320.router, 'optionalAccess', _321 => _321.discovered, 'optionalCall', _322 => _322(route, withState(context))])
7867
+ (route, context) => _optionalChain([plugin, 'access', _324 => _324.router, 'optionalAccess', _325 => _325.discovered, 'optionalCall', _326 => _326(route, withState(context))])
7812
7868
  );
7813
7869
  }
7814
7870
  break;
7815
7871
  case "middlewareDiscovered":
7816
- if (_optionalChain([plugin, 'access', _323 => _323.router, 'optionalAccess', _324 => _324.discovered])) {
7872
+ if (_optionalChain([plugin, 'access', _327 => _327.router, 'optionalAccess', _328 => _328.discovered])) {
7817
7873
  hooks.push(
7818
- (route, context) => _optionalChain([plugin, 'access', _325 => _325.router, 'optionalAccess', _326 => _326.discovered, 'optionalCall', _327 => _327({ kind: "middleware", ...route }, withState(context))])
7874
+ (route, context) => _optionalChain([plugin, 'access', _329 => _329.router, 'optionalAccess', _330 => _330.discovered, 'optionalCall', _331 => _331({ kind: "middleware", ...route }, withState(context))])
7819
7875
  );
7820
7876
  }
7821
7877
  break;
7822
7878
  case "apiRouteDiscovered":
7823
- if (_optionalChain([plugin, 'access', _328 => _328.router, 'optionalAccess', _329 => _329.discovered])) {
7879
+ if (_optionalChain([plugin, 'access', _332 => _332.router, 'optionalAccess', _333 => _333.discovered])) {
7824
7880
  hooks.push(
7825
- (route, context) => _optionalChain([plugin, 'access', _330 => _330.router, 'optionalAccess', _331 => _331.discovered, 'optionalCall', _332 => _332({ kind: "api", ...route }, withState(context))])
7881
+ (route, context) => _optionalChain([plugin, 'access', _334 => _334.router, 'optionalAccess', _335 => _335.discovered, 'optionalCall', _336 => _336({ kind: "api", ...route }, withState(context))])
7826
7882
  );
7827
7883
  }
7828
7884
  break;
7829
7885
  case "routesGenerated":
7830
- if (_optionalChain([plugin, 'access', _333 => _333.router, 'optionalAccess', _334 => _334.generated])) {
7886
+ if (_optionalChain([plugin, 'access', _337 => _337.router, 'optionalAccess', _338 => _338.generated])) {
7831
7887
  hooks.push(
7832
- (routes, context) => _optionalChain([plugin, 'access', _335 => _335.router, 'optionalAccess', _336 => _336.generated, 'optionalCall', _337 => _337(routes, withState(context))])
7888
+ (routes, context) => _optionalChain([plugin, 'access', _339 => _339.router, 'optionalAccess', _340 => _340.generated, 'optionalCall', _341 => _341(routes, withState(context))])
7833
7889
  );
7834
7890
  }
7835
7891
  break;
7836
7892
  case "beforeRouteMatch":
7837
- if (_optionalChain([plugin, 'access', _338 => _338.router, 'optionalAccess', _339 => _339.before])) {
7893
+ if (_optionalChain([plugin, 'access', _342 => _342.router, 'optionalAccess', _343 => _343.before])) {
7838
7894
  hooks.push(
7839
- (route, context) => _optionalChain([plugin, 'access', _340 => _340.router, 'optionalAccess', _341 => _341.before, 'optionalCall', _342 => _342(route, withState(context))])
7895
+ (route, context) => _optionalChain([plugin, 'access', _344 => _344.router, 'optionalAccess', _345 => _345.before, 'optionalCall', _346 => _346(route, withState(context))])
7840
7896
  );
7841
7897
  }
7842
7898
  break;
7843
7899
  case "afterRouteMatch":
7844
- if (_optionalChain([plugin, 'access', _343 => _343.router, 'optionalAccess', _344 => _344.after])) {
7900
+ if (_optionalChain([plugin, 'access', _347 => _347.router, 'optionalAccess', _348 => _348.after])) {
7845
7901
  hooks.push(
7846
- (result, context) => _optionalChain([plugin, 'access', _345 => _345.router, 'optionalAccess', _346 => _346.after, 'optionalCall', _347 => _347(result, withState(context))])
7902
+ (result, context) => _optionalChain([plugin, 'access', _349 => _349.router, 'optionalAccess', _350 => _350.after, 'optionalCall', _351 => _351(result, withState(context))])
7847
7903
  );
7848
7904
  }
7849
7905
  break;
7850
7906
  case "beforeRender":
7851
- if (_optionalChain([plugin, 'access', _348 => _348.render, 'optionalAccess', _349 => _349.before])) {
7907
+ if (_optionalChain([plugin, 'access', _352 => _352.render, 'optionalAccess', _353 => _353.before])) {
7852
7908
  hooks.push(
7853
- (render, context) => _optionalChain([plugin, 'access', _350 => _350.render, 'optionalAccess', _351 => _351.before, 'optionalCall', _352 => _352(render, withState(context))])
7909
+ (render, context) => _optionalChain([plugin, 'access', _354 => _354.render, 'optionalAccess', _355 => _355.before, 'optionalCall', _356 => _356(render, withState(context))])
7854
7910
  );
7855
7911
  }
7856
7912
  break;
7857
7913
  case "afterRender":
7858
- if (_optionalChain([plugin, 'access', _353 => _353.render, 'optionalAccess', _354 => _354.html])) {
7914
+ if (_optionalChain([plugin, 'access', _357 => _357.render, 'optionalAccess', _358 => _358.html])) {
7859
7915
  hooks.push(
7860
- (html, render, context) => _optionalChain([plugin, 'access', _355 => _355.render, 'optionalAccess', _356 => _356.html, 'optionalCall', _357 => _357(html, render, withState(context))])
7916
+ (html, render, context) => _optionalChain([plugin, 'access', _359 => _359.render, 'optionalAccess', _360 => _360.html, 'optionalCall', _361 => _361(html, render, withState(context))])
7861
7917
  );
7862
7918
  }
7863
7919
  break;
7864
7920
  case "beforeBundle":
7865
- if (_optionalChain([plugin, 'access', _358 => _358.build, 'optionalAccess', _359 => _359.before])) {
7921
+ if (_optionalChain([plugin, 'access', _362 => _362.build, 'optionalAccess', _363 => _363.before])) {
7866
7922
  hooks.push(
7867
- (bundle, context) => _optionalChain([plugin, 'access', _360 => _360.build, 'optionalAccess', _361 => _361.before, 'optionalCall', _362 => _362(bundle, withState(context))])
7923
+ (bundle, context) => _optionalChain([plugin, 'access', _364 => _364.build, 'optionalAccess', _365 => _365.before, 'optionalCall', _366 => _366(bundle, withState(context))])
7868
7924
  );
7869
7925
  }
7870
7926
  break;
7871
7927
  case "beforeNitroBuild":
7872
- if (_optionalChain([plugin, 'access', _363 => _363.build, 'optionalAccess', _364 => _364.configure])) {
7928
+ if (_optionalChain([plugin, 'access', _367 => _367.build, 'optionalAccess', _368 => _368.configure])) {
7873
7929
  hooks.push(
7874
- (buildConfig, context) => _optionalChain([plugin, 'access', _365 => _365.build, 'optionalAccess', _366 => _366.configure, 'optionalCall', _367 => _367(buildConfig, withState(context))])
7930
+ (buildConfig, context) => _optionalChain([plugin, 'access', _369 => _369.build, 'optionalAccess', _370 => _370.configure, 'optionalCall', _371 => _371(buildConfig, withState(context))])
7875
7931
  );
7876
7932
  }
7877
7933
  break;
7878
7934
  case "afterBundle":
7879
- if (_optionalChain([plugin, 'access', _368 => _368.build, 'optionalAccess', _369 => _369.after])) {
7935
+ if (_optionalChain([plugin, 'access', _372 => _372.build, 'optionalAccess', _373 => _373.after])) {
7880
7936
  hooks.push(
7881
- (result, context) => _optionalChain([plugin, 'access', _370 => _370.build, 'optionalAccess', _371 => _371.after, 'optionalCall', _372 => _372(result, withState(context))])
7937
+ (result, context) => _optionalChain([plugin, 'access', _374 => _374.build, 'optionalAccess', _375 => _375.after, 'optionalCall', _376 => _376(result, withState(context))])
7882
7938
  );
7883
7939
  }
7884
7940
  break;
7885
7941
  case "devServerCreated":
7886
- if (_optionalChain([plugin, 'access', _373 => _373.dev, 'optionalAccess', _374 => _374.server])) {
7942
+ if (_optionalChain([plugin, 'access', _377 => _377.dev, 'optionalAccess', _378 => _378.server])) {
7887
7943
  hooks.push(
7888
- (server, context) => _optionalChain([plugin, 'access', _375 => _375.dev, 'optionalAccess', _376 => _376.server, 'optionalCall', _377 => _377(server, withState(context))])
7944
+ (server, context) => _optionalChain([plugin, 'access', _379 => _379.dev, 'optionalAccess', _380 => _380.server, 'optionalCall', _381 => _381(server, withState(context))])
7889
7945
  );
7890
7946
  }
7891
7947
  break;
7892
7948
  case "hmrUpdate":
7893
- if (_optionalChain([plugin, 'access', _378 => _378.dev, 'optionalAccess', _379 => _379.update])) {
7949
+ if (_optionalChain([plugin, 'access', _382 => _382.dev, 'optionalAccess', _383 => _383.update])) {
7894
7950
  hooks.push(
7895
- (update, context) => _optionalChain([plugin, 'access', _380 => _380.dev, 'optionalAccess', _381 => _381.update, 'optionalCall', _382 => _382(update, withState(context))])
7951
+ (update, context) => _optionalChain([plugin, 'access', _384 => _384.dev, 'optionalAccess', _385 => _385.update, 'optionalCall', _386 => _386(update, withState(context))])
7896
7952
  );
7897
7953
  }
7898
7954
  break;
@@ -7938,7 +7994,7 @@ var _PluginManager = class _PluginManager {
7938
7994
  hasRuntimeHook(hookName) {
7939
7995
  const cached = this.runtimeHookPresence.get(hookName);
7940
7996
  if (cached !== void 0) return cached;
7941
- const present = this.plugins.some((plugin) => typeof _optionalChain([plugin, 'access', _383 => _383.runtime, 'optionalAccess', _384 => _384[hookName]]) === "function");
7997
+ const present = this.plugins.some((plugin) => typeof _optionalChain([plugin, 'access', _387 => _387.runtime, 'optionalAccess', _388 => _388[hookName]]) === "function");
7942
7998
  this.runtimeHookPresence.set(hookName, present);
7943
7999
  return present;
7944
8000
  }
@@ -8017,7 +8073,7 @@ var _PluginManager = class _PluginManager {
8017
8073
  async beginRuntimeRequest(request2, options = {}) {
8018
8074
  await this.startRuntime();
8019
8075
  const startedAt = Date.now();
8020
- const waitUntil = options.waitUntil ? (promise) => _optionalChain([options, 'access', _385 => _385.waitUntil, 'optionalCall', _386 => _386(Promise.resolve(promise))]) : (promise) => {
8076
+ const waitUntil = options.waitUntil ? (promise) => _optionalChain([options, 'access', _389 => _389.waitUntil, 'optionalCall', _390 => _390(Promise.resolve(promise))]) : (promise) => {
8021
8077
  void Promise.resolve(promise).catch(() => {
8022
8078
  });
8023
8079
  };
@@ -8050,7 +8106,7 @@ var _PluginManager = class _PluginManager {
8050
8106
  );
8051
8107
  let response;
8052
8108
  for (const plugin of this.getSortedPlugins()) {
8053
- const before = _optionalChain([plugin, 'access', _387 => _387.runtime, 'optionalAccess', _388 => _388.before]);
8109
+ const before = _optionalChain([plugin, 'access', _391 => _391.runtime, 'optionalAccess', _392 => _392.before]);
8054
8110
  if (!before) continue;
8055
8111
  const result = await before({
8056
8112
  ...this.createRuntimeBaseEvent(plugin, activeRequest, activeOptions, waitUntil),
@@ -8096,7 +8152,7 @@ var _PluginManager = class _PluginManager {
8096
8152
  let response = initialResponse;
8097
8153
  try {
8098
8154
  for (const plugin of this.getSortedPlugins()) {
8099
- const after = _optionalChain([plugin, 'access', _389 => _389.runtime, 'optionalAccess', _390 => _390.after]);
8155
+ const after = _optionalChain([plugin, 'access', _393 => _393.runtime, 'optionalAccess', _394 => _394.after]);
8100
8156
  if (!after) continue;
8101
8157
  const result = await after({
8102
8158
  ...this.createRuntimeBaseEvent(
@@ -8185,7 +8241,7 @@ var _PluginManager = class _PluginManager {
8185
8241
  /** @internal Runs hooks for only the plugins selected by the runtime adapter. */
8186
8242
  async runHookParallelFiltered(hookName, include, ...args) {
8187
8243
  if (hookName === "shutdown" && !this.runtimeShutdownHooksRunning) {
8188
- await this.closeRuntime(_optionalChain([args, 'access', _391 => _391[0], 'optionalAccess', _392 => _392.reason]));
8244
+ await this.closeRuntime(_optionalChain([args, 'access', _395 => _395[0], 'optionalAccess', _396 => _396.reason]));
8189
8245
  return false;
8190
8246
  }
8191
8247
  const plugins = this.getSortedPlugins().filter(include);
@@ -8271,7 +8327,7 @@ function createPluginFactory(definition) {
8271
8327
  configure: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (config, context) => configure(config, { ...context, options }), "configure")
8272
8328
  } : {},
8273
8329
  setup(context) {
8274
- const state = _optionalChain([setup, 'optionalCall', _393 => _393({ ...context, options })]);
8330
+ const state = _optionalChain([setup, 'optionalCall', _397 => _397({ ...context, options })]);
8275
8331
  return state instanceof Promise ? state.then(resolveState) : resolveState(state);
8276
8332
  }
8277
8333
  });
@@ -8299,23 +8355,23 @@ function declarePluginSchema(plugin) {
8299
8355
  `Plugin "${plugin.name}" sets \`database\` without a \`schema\`: it only says where the schema's tables live.`
8300
8356
  );
8301
8357
  }
8302
- if (!plugin.schema || _chunkAWRISO2Hcjs.readSchemaTables.call(void 0, plugin)) return plugin;
8358
+ if (!plugin.schema || _chunkE2ROOWQCcjs.readSchemaTables.call(void 0, plugin)) return plugin;
8303
8359
  const name = pluginSchemaName(plugin.name);
8304
8360
  const models = _chunkJSROZYYOcjs.resolveSchemaModels.call(void 0, name, plugin.schema);
8305
- _chunkAWRISO2Hcjs.collectSchemaExtensions.call(void 0, name, plugin.schema);
8361
+ _chunkE2ROOWQCcjs.collectSchemaExtensions.call(void 0, name, plugin.schema);
8306
8362
  validateSchemaSteps(name, plugin.schema, plugin.migrations);
8307
8363
  const database = plugin.database;
8308
- return _chunkAWRISO2Hcjs.declareSchemaTables.call(void 0, plugin, {
8364
+ return _chunkE2ROOWQCcjs.declareSchemaTables.call(void 0, plugin, {
8309
8365
  name,
8310
8366
  schema: plugin.schema,
8311
8367
  // Also listed by key, which tooling from before `external` existed reads.
8312
8368
  models: Object.keys(models).filter((key) => !models[key].external),
8313
8369
  ...plugin.dependsOn ? { dependsOn: plugin.dependsOn.map(_chunkQBPXNZGVcjs.pluginShortName) } : {},
8314
8370
  ...plugin.version ? { version: plugin.version } : {},
8315
- ..._optionalChain([plugin, 'access', _394 => _394.migrations, 'optionalAccess', _395 => _395.length]) ? { migrations: plugin.migrations } : {},
8316
- dialect: _optionalChain([database, 'optionalAccess', _396 => _396.dialect]),
8371
+ ..._optionalChain([plugin, 'access', _398 => _398.migrations, 'optionalAccess', _399 => _399.length]) ? { migrations: plugin.migrations } : {},
8372
+ dialect: _optionalChain([database, 'optionalAccess', _400 => _400.dialect]),
8317
8373
  resolveClient: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (config) => {
8318
- if (_optionalChain([database, 'optionalAccess', _397 => _397.client]) !== void 0 && database.client !== null) {
8374
+ if (_optionalChain([database, 'optionalAccess', _401 => _401.client]) !== void 0 && database.client !== null) {
8319
8375
  const client2 = typeof database.client === "function" ? await database.client() : database.client;
8320
8376
  if (client2 === void 0 || client2 === null) {
8321
8377
  throw new Error(`The ${name} plugin's \`database.client\` returned no connection.`);
@@ -8369,7 +8425,7 @@ function resolveFarmAppClientEntry(root = process.cwd(), srcDir = "src") {
8369
8425
  }
8370
8426
  _chunkS3JO3N4Hcjs.__name.call(void 0, resolveFarmAppClientEntry, "resolveFarmAppClientEntry");
8371
8427
  function resolveFarmClientPlugins(plugins, _root) {
8372
- if (!_optionalChain([plugins, 'optionalAccess', _398 => _398.length])) return [];
8428
+ if (!_optionalChain([plugins, 'optionalAccess', _402 => _402.length])) return [];
8373
8429
  return plugins.flatMap((plugin) => {
8374
8430
  if (!plugin.client) return [];
8375
8431
  assertClientLifecycle(plugin.client, plugin.name);
@@ -8449,7 +8505,7 @@ function assertLifecycleObject(value, pluginName, location, allowedKeys) {
8449
8505
  throw new TypeError(`Client plugin "${pluginName}" has an unknown ${location}.${key} option`);
8450
8506
  }
8451
8507
  const descriptor = Object.getOwnPropertyDescriptor(value, key);
8452
- if (!_optionalChain([descriptor, 'optionalAccess', _399 => _399.enumerable])) {
8508
+ if (!_optionalChain([descriptor, 'optionalAccess', _403 => _403.enumerable])) {
8453
8509
  throw new TypeError(`Client plugin "${pluginName}" ${location}.${key} must be enumerable`);
8454
8510
  }
8455
8511
  if (!("value" in descriptor)) {
@@ -8573,7 +8629,7 @@ function assertPublicData(value, pluginName) {
8573
8629
  throwPublicDataError(pluginName, pathSegments, "cannot contain symbol keys");
8574
8630
  }
8575
8631
  const descriptor = Object.getOwnPropertyDescriptor(current, key);
8576
- if (!_optionalChain([descriptor, 'optionalAccess', _400 => _400.enumerable])) {
8632
+ if (!_optionalChain([descriptor, 'optionalAccess', _404 => _404.enumerable])) {
8577
8633
  throwPublicDataError(
8578
8634
  pluginName,
8579
8635
  [...pathSegments, key],
@@ -8619,8 +8675,8 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, isArrayIndex, "isArrayIndex");
8619
8675
 
8620
8676
  var ADAPTER_EXTENSIONS = ["ts", "tsx", "js", "jsx", "mts", "mjs"];
8621
8677
  function resolveFarmClientCacheAdapterEntry(root, cache) {
8622
- const client = _optionalChain([cache, 'optionalAccess', _401 => _401.client]);
8623
- const adapter = _optionalChain([client, 'optionalAccess', _402 => _402.adapter]);
8678
+ const client = _optionalChain([cache, 'optionalAccess', _405 => _405.client]);
8679
+ const adapter = _optionalChain([client, 'optionalAccess', _406 => _406.adapter]);
8624
8680
  if (adapter === void 0) return void 0;
8625
8681
  if (typeof adapter !== "string" || adapter.trim().length === 0) {
8626
8682
  throw new Error(
@@ -8635,8 +8691,8 @@ function resolveFarmClientCacheAdapterEntry(root, cache) {
8635
8691
  );
8636
8692
  }
8637
8693
  const options = {};
8638
- if (_optionalChain([client, 'optionalAccess', _403 => _403.version]) !== void 0) options.version = client.version;
8639
- if (_optionalChain([client, 'optionalAccess', _404 => _404.flushDelayMs]) !== void 0) options.flushDelayMs = client.flushDelayMs;
8694
+ if (_optionalChain([client, 'optionalAccess', _407 => _407.version]) !== void 0) options.version = client.version;
8695
+ if (_optionalChain([client, 'optionalAccess', _408 => _408.flushDelayMs]) !== void 0) options.flushDelayMs = client.flushDelayMs;
8640
8696
  return { importPath: found.replace(/\\/g, "/"), options };
8641
8697
  }
8642
8698
  _chunkS3JO3N4Hcjs.__name.call(void 0, resolveFarmClientCacheAdapterEntry, "resolveFarmClientCacheAdapterEntry");
@@ -8738,7 +8794,7 @@ function createFarmLayoutElement(Component, pattern, children, params) {
8738
8794
  function shouldBypassFarmRouterForDottedPath(pathname, routeManager, baseDirs, generatedPaths = []) {
8739
8795
  if (!pathname.includes(".") || pathname.endsWith(".html")) return false;
8740
8796
  const matchesAppRoute = Boolean(
8741
- _optionalChain([routeManager, 'optionalAccess', _405 => _405.matchRoute, 'call', _406 => _406(pathname), 'optionalAccess', _407 => _407.route]) || _optionalChain([routeManager, 'optionalAccess', _408 => _408.matchMetadataRoute, 'call', _409 => _409(pathname)]) || _optionalChain([routeManager, 'optionalAccess', _410 => _410.matchMetadataImage, 'call', _411 => _411(pathname)]) || generatedPaths.includes(pathname)
8797
+ _optionalChain([routeManager, 'optionalAccess', _409 => _409.matchRoute, 'call', _410 => _410(pathname), 'optionalAccess', _411 => _411.route]) || _optionalChain([routeManager, 'optionalAccess', _412 => _412.matchMetadataRoute, 'call', _413 => _413(pathname)]) || _optionalChain([routeManager, 'optionalAccess', _414 => _414.matchMetadataImage, 'call', _415 => _415(pathname)]) || generatedPaths.includes(pathname)
8742
8798
  );
8743
8799
  return !matchesAppRoute || devServableFileExists(pathname, baseDirs);
8744
8800
  }
@@ -8767,14 +8823,14 @@ var DOCS_ENGINE_APP_OWNABLE_PATHS = /* @__PURE__ */ new Set([
8767
8823
  ]);
8768
8824
  function farmAppOwnsDocsEnginePath(pathname, options) {
8769
8825
  if (!DOCS_ENGINE_APP_OWNABLE_PATHS.has(pathname)) return false;
8770
- return options.generatedPaths.includes(pathname) || Boolean(_optionalChain([options, 'access', _412 => _412.routeManager, 'optionalAccess', _413 => _413.matchMetadataRoute, 'call', _414 => _414(pathname)])) || devServableFileExists(pathname, [options.publicDir]);
8826
+ return options.generatedPaths.includes(pathname) || Boolean(_optionalChain([options, 'access', _416 => _416.routeManager, 'optionalAccess', _417 => _417.matchMetadataRoute, 'call', _418 => _418(pathname)])) || devServableFileExists(pathname, [options.publicDir]);
8771
8827
  }
8772
8828
  _chunkS3JO3N4Hcjs.__name.call(void 0, farmAppOwnsDocsEnginePath, "farmAppOwnsDocsEnginePath");
8773
8829
  function devServableFileExists(pathname, baseDirs) {
8774
8830
  let decodedPathname;
8775
8831
  try {
8776
8832
  decodedPathname = decodeURIComponent(pathname);
8777
- } catch (e19) {
8833
+ } catch (e21) {
8778
8834
  return false;
8779
8835
  }
8780
8836
  const relativePathname = decodedPathname.replace(/^\/+/, "");
@@ -8788,7 +8844,7 @@ function devServableFileExists(pathname, baseDirs) {
8788
8844
  if (fs8.existsSync(candidate) && fs8.statSync(candidate).isFile()) {
8789
8845
  return true;
8790
8846
  }
8791
- } catch (e20) {
8847
+ } catch (e22) {
8792
8848
  }
8793
8849
  }
8794
8850
  return false;
@@ -8874,14 +8930,14 @@ function analyzeClientBoundary(program, publicKeys) {
8874
8930
  _chunkS3JO3N4Hcjs.__name.call(void 0, analyzeClientBoundary, "analyzeClientBoundary");
8875
8931
  function readNodeBuiltinSource(node) {
8876
8932
  if (node.type === "ImportDeclaration" || node.type === "ExportNamedDeclaration" || node.type === "ExportAllDeclaration" || node.type === "ImportExpression") {
8877
- const value = _optionalChain([node, 'access', _415 => _415.source, 'optionalAccess', _416 => _416.value]);
8933
+ const value = _optionalChain([node, 'access', _419 => _419.source, 'optionalAccess', _420 => _420.value]);
8878
8934
  return typeof value === "string" && value.startsWith("node:") ? value : void 0;
8879
8935
  }
8880
8936
  if (node.type === "CallExpression") {
8881
8937
  const callee = node.callee;
8882
- if (_optionalChain([callee, 'optionalAccess', _417 => _417.type]) === "Identifier" && callee.name === "require") {
8883
- const arg = _optionalChain([node, 'access', _418 => _418.arguments, 'optionalAccess', _419 => _419[0]]);
8884
- const value = _optionalChain([arg, 'optionalAccess', _420 => _420.type]) === "Literal" ? arg.value : void 0;
8938
+ if (_optionalChain([callee, 'optionalAccess', _421 => _421.type]) === "Identifier" && callee.name === "require") {
8939
+ const arg = _optionalChain([node, 'access', _422 => _422.arguments, 'optionalAccess', _423 => _423[0]]);
8940
+ const value = _optionalChain([arg, 'optionalAccess', _424 => _424.type]) === "Literal" ? arg.value : void 0;
8885
8941
  return typeof value === "string" && value.startsWith("node:") ? value : void 0;
8886
8942
  }
8887
8943
  }
@@ -8891,7 +8947,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, readNodeBuiltinSource, "readNodeBuiltinSou
8891
8947
  function readProcessEnvKey(node) {
8892
8948
  if (node.type !== "MemberExpression") return void 0;
8893
8949
  const object = node.object;
8894
- if (!object || object.type !== "MemberExpression" || _optionalChain([object, 'access', _421 => _421.object, 'optionalAccess', _422 => _422.type]) !== "Identifier" || object.object.name !== "process" || _optionalChain([object, 'access', _423 => _423.property, 'optionalAccess', _424 => _424.name]) !== "env") {
8950
+ if (!object || object.type !== "MemberExpression" || _optionalChain([object, 'access', _425 => _425.object, 'optionalAccess', _426 => _426.type]) !== "Identifier" || object.object.name !== "process" || _optionalChain([object, 'access', _427 => _427.property, 'optionalAccess', _428 => _428.name]) !== "env") {
8895
8951
  return void 0;
8896
8952
  }
8897
8953
  const property = node.property;
@@ -8956,7 +9012,7 @@ function farmImageImportsPlugin() {
8956
9012
  async transform(code, id) {
8957
9013
  const filePath = id.split("?", 1)[0];
8958
9014
  if (id.includes("?") || !STATIC_IMAGE_RE.test(filePath)) return null;
8959
- const defaultExport = _optionalChain([code, 'access', _425 => _425.match, 'call', _426 => _426(/^\s*export\s+default\s+(.+?);?\s*$/s), 'optionalAccess', _427 => _427[1]]);
9015
+ const defaultExport = _optionalChain([code, 'access', _429 => _429.match, 'call', _430 => _430(/^\s*export\s+default\s+(.+?);?\s*$/s), 'optionalAccess', _431 => _431[1]]);
8960
9016
  if (!defaultExport) return null;
8961
9017
  return createStaticImageModule(filePath, `const src = ${defaultExport};`);
8962
9018
  }
@@ -8991,7 +9047,7 @@ async function createBlurDataURL(bytes) {
8991
9047
  const { default: sharp } = await import("sharp");
8992
9048
  const placeholder = await sharp(bytes).rotate().resize({ width: 8, height: 8, fit: "inside", withoutEnlargement: true }).webp({ quality: 35 }).toBuffer();
8993
9049
  return `data:image/webp;base64,${placeholder.toString("base64")}`;
8994
- } catch (e21) {
9050
+ } catch (e23) {
8995
9051
  return void 0;
8996
9052
  }
8997
9053
  }
@@ -9017,7 +9073,7 @@ var FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE = [
9017
9073
  ];
9018
9074
  function getFarmClientOptimizeDepsInclude(renderer) {
9019
9075
  return Array.from(
9020
- /* @__PURE__ */ new Set([...FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE, ..._optionalChain([renderer, 'optionalAccess', _428 => _428.optimizeDeps]) || []])
9076
+ /* @__PURE__ */ new Set([...FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE, ..._optionalChain([renderer, 'optionalAccess', _432 => _432.optimizeDeps]) || []])
9021
9077
  );
9022
9078
  }
9023
9079
  _chunkS3JO3N4Hcjs.__name.call(void 0, getFarmClientOptimizeDepsInclude, "getFarmClientOptimizeDepsInclude");
@@ -9042,7 +9098,7 @@ function createFarmClientOptimizeDepsConfig(entries, renderer) {
9042
9098
  // Farm's HTML boots through a virtual module and imports route UI lazily.
9043
9099
  // Explicit entries let Vite finish that crawl before a navigation can
9044
9100
  // rotate the optimizer hash underneath a hydrated React runtime.
9045
- ..._optionalChain([entries, 'optionalAccess', _429 => _429.length]) ? { entries: [...entries] } : {}
9101
+ ..._optionalChain([entries, 'optionalAccess', _433 => _433.length]) ? { entries: [...entries] } : {}
9046
9102
  };
9047
9103
  }
9048
9104
  _chunkS3JO3N4Hcjs.__name.call(void 0, createFarmClientOptimizeDepsConfig, "createFarmClientOptimizeDepsConfig");
@@ -9072,8 +9128,8 @@ function mergeAlias(farmValue, userValue) {
9072
9128
  }
9073
9129
  _chunkS3JO3N4Hcjs.__name.call(void 0, mergeAlias, "mergeAlias");
9074
9130
  function mergeFarmViteConfig(farmConfig, userConfig = {}) {
9075
- const noDiscovery = _nullishCoalesce(_optionalChain([userConfig, 'access', _430 => _430.optimizeDeps, 'optionalAccess', _431 => _431.noDiscovery]), () => ( _optionalChain([farmConfig, 'access', _432 => _432.optimizeDeps, 'optionalAccess', _433 => _433.noDiscovery])));
9076
- const holdUntilCrawlEnd = _nullishCoalesce(_optionalChain([userConfig, 'access', _434 => _434.optimizeDeps, 'optionalAccess', _435 => _435.holdUntilCrawlEnd]), () => ( (_optionalChain([userConfig, 'access', _436 => _436.optimizeDeps, 'optionalAccess', _437 => _437.noDiscovery]) === true ? false : _optionalChain([farmConfig, 'access', _438 => _438.optimizeDeps, 'optionalAccess', _439 => _439.holdUntilCrawlEnd]))));
9131
+ const noDiscovery = _nullishCoalesce(_optionalChain([userConfig, 'access', _434 => _434.optimizeDeps, 'optionalAccess', _435 => _435.noDiscovery]), () => ( _optionalChain([farmConfig, 'access', _436 => _436.optimizeDeps, 'optionalAccess', _437 => _437.noDiscovery])));
9132
+ const holdUntilCrawlEnd = _nullishCoalesce(_optionalChain([userConfig, 'access', _438 => _438.optimizeDeps, 'optionalAccess', _439 => _439.holdUntilCrawlEnd]), () => ( (_optionalChain([userConfig, 'access', _440 => _440.optimizeDeps, 'optionalAccess', _441 => _441.noDiscovery]) === true ? false : _optionalChain([farmConfig, 'access', _442 => _442.optimizeDeps, 'optionalAccess', _443 => _443.holdUntilCrawlEnd]))));
9077
9133
  return {
9078
9134
  ...farmConfig,
9079
9135
  ...userConfig,
@@ -9085,9 +9141,9 @@ function mergeFarmViteConfig(farmConfig, userConfig = {}) {
9085
9141
  resolve: {
9086
9142
  ...farmConfig.resolve,
9087
9143
  ...userConfig.resolve,
9088
- alias: mergeAlias(_optionalChain([farmConfig, 'access', _440 => _440.resolve, 'optionalAccess', _441 => _441.alias]), _optionalChain([userConfig, 'access', _442 => _442.resolve, 'optionalAccess', _443 => _443.alias])),
9144
+ alias: mergeAlias(_optionalChain([farmConfig, 'access', _444 => _444.resolve, 'optionalAccess', _445 => _445.alias]), _optionalChain([userConfig, 'access', _446 => _446.resolve, 'optionalAccess', _447 => _447.alias])),
9089
9145
  dedupe: Array.from(
9090
- /* @__PURE__ */ new Set([..._optionalChain([farmConfig, 'access', _444 => _444.resolve, 'optionalAccess', _445 => _445.dedupe]) || [], ..._optionalChain([userConfig, 'access', _446 => _446.resolve, 'optionalAccess', _447 => _447.dedupe]) || []])
9146
+ /* @__PURE__ */ new Set([..._optionalChain([farmConfig, 'access', _448 => _448.resolve, 'optionalAccess', _449 => _449.dedupe]) || [], ..._optionalChain([userConfig, 'access', _450 => _450.resolve, 'optionalAccess', _451 => _451.dedupe]) || []])
9091
9147
  )
9092
9148
  },
9093
9149
  optimizeDeps: {
@@ -9097,21 +9153,21 @@ function mergeFarmViteConfig(farmConfig, userConfig = {}) {
9097
9153
  holdUntilCrawlEnd,
9098
9154
  include: Array.from(
9099
9155
  /* @__PURE__ */ new Set([
9100
- ..._optionalChain([farmConfig, 'access', _448 => _448.optimizeDeps, 'optionalAccess', _449 => _449.include]) || [],
9101
- ..._optionalChain([userConfig, 'access', _450 => _450.optimizeDeps, 'optionalAccess', _451 => _451.include]) || []
9156
+ ..._optionalChain([farmConfig, 'access', _452 => _452.optimizeDeps, 'optionalAccess', _453 => _453.include]) || [],
9157
+ ..._optionalChain([userConfig, 'access', _454 => _454.optimizeDeps, 'optionalAccess', _455 => _455.include]) || []
9102
9158
  ])
9103
9159
  ),
9104
9160
  exclude: Array.from(
9105
9161
  /* @__PURE__ */ new Set([
9106
- ..._optionalChain([farmConfig, 'access', _452 => _452.optimizeDeps, 'optionalAccess', _453 => _453.exclude]) || [],
9107
- ..._optionalChain([userConfig, 'access', _454 => _454.optimizeDeps, 'optionalAccess', _455 => _455.exclude]) || []
9162
+ ..._optionalChain([farmConfig, 'access', _456 => _456.optimizeDeps, 'optionalAccess', _457 => _457.exclude]) || [],
9163
+ ..._optionalChain([userConfig, 'access', _458 => _458.optimizeDeps, 'optionalAccess', _459 => _459.exclude]) || []
9108
9164
  ])
9109
9165
  )
9110
9166
  },
9111
9167
  ssr: {
9112
9168
  ...farmConfig.ssr,
9113
9169
  ...userConfig.ssr,
9114
- noExternal: mergeNoExternal(_optionalChain([farmConfig, 'access', _456 => _456.ssr, 'optionalAccess', _457 => _457.noExternal]), _optionalChain([userConfig, 'access', _458 => _458.ssr, 'optionalAccess', _459 => _459.noExternal]))
9170
+ noExternal: mergeNoExternal(_optionalChain([farmConfig, 'access', _460 => _460.ssr, 'optionalAccess', _461 => _461.noExternal]), _optionalChain([userConfig, 'access', _462 => _462.ssr, 'optionalAccess', _463 => _463.noExternal]))
9115
9171
  }
9116
9172
  };
9117
9173
  }
@@ -9165,7 +9221,7 @@ function mergeFarmProductionViteConfig(farmConfig, userConfig = {}) {
9165
9221
  ...farmConfig.build,
9166
9222
  rollupOptions: {
9167
9223
  ...userBundlerOptions,
9168
- ..._optionalChain([farmConfig, 'access', _460 => _460.build, 'optionalAccess', _461 => _461.rollupOptions])
9224
+ ..._optionalChain([farmConfig, 'access', _464 => _464.build, 'optionalAccess', _465 => _465.rollupOptions])
9169
9225
  }
9170
9226
  },
9171
9227
  css: farmConfig.css || userCss ? { ...farmConfig.css, ...userCss } : void 0,
@@ -9173,39 +9229,12 @@ function mergeFarmProductionViteConfig(farmConfig, userConfig = {}) {
9173
9229
  esbuild: typeof userEsbuild === "object" && farmConfig.esbuild !== false ? { ...userEsbuild, ...farmConfig.esbuild } : _nullishCoalesce(farmConfig.esbuild, () => ( userEsbuild)),
9174
9230
  ssr: {
9175
9231
  ...merged.ssr,
9176
- external: mergeExternal(_optionalChain([farmConfig, 'access', _462 => _462.ssr, 'optionalAccess', _463 => _463.external]), _optionalChain([userConfig, 'access', _464 => _464.ssr, 'optionalAccess', _465 => _465.external]))
9232
+ external: mergeExternal(_optionalChain([farmConfig, 'access', _466 => _466.ssr, 'optionalAccess', _467 => _467.external]), _optionalChain([userConfig, 'access', _468 => _468.ssr, 'optionalAccess', _469 => _469.external]))
9177
9233
  }
9178
9234
  };
9179
9235
  }
9180
9236
  _chunkS3JO3N4Hcjs.__name.call(void 0, mergeFarmProductionViteConfig, "mergeFarmProductionViteConfig");
9181
9237
 
9182
- // src/docs/adapter-client.ts
9183
- function generateFarmDocsAdapterClientRuntime(reactModule) {
9184
- if (!reactModule) {
9185
- return `
9186
- async function hydrateFarmDocsAdapterRuntime() {
9187
- return false;
9188
- }
9189
- `;
9190
- }
9191
- return `
9192
- async function hydrateFarmDocsAdapterRuntime() {
9193
- const runtime = window.__FARM_DOCS_ADAPTER__;
9194
- if (!runtime) return false;
9195
- const FarmDocsAdapterReact = await import(${JSON.stringify(reactModule)});
9196
- if (typeof FarmDocsAdapterReact.hydrateFarmDocs !== "function") {
9197
- throw new Error("The configured Farm docs adapter does not export hydrateFarmDocs().");
9198
- }
9199
- FarmDocsAdapterReact.hydrateFarmDocs({
9200
- config: runtime.config || {},
9201
- data: runtime.data,
9202
- });
9203
- return true;
9204
- }
9205
- `;
9206
- }
9207
- _chunkS3JO3N4Hcjs.__name.call(void 0, generateFarmDocsAdapterClientRuntime, "generateFarmDocsAdapterClientRuntime");
9208
-
9209
9238
  // src/theme/vite.ts
9210
9239
  var FARM_DARK_VARIANT = '@custom-variant dark (&:where([data-theme="dark"], [data-theme="dark"] *));';
9211
9240
  function createFarmThemeCssPlugin(input, basePath = "/") {
@@ -9272,13 +9301,13 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, reportOpenAPIDevGenerationResult, "reportO
9272
9301
 
9273
9302
  // src/vite.ts
9274
9303
  function farmLlmsTxtGeneratedPaths(config) {
9275
- const llms = _chunkTYQUSXUGcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([config, 'access', _466 => _466.agent, 'optionalAccess', _467 => _467.llmsTxt]));
9304
+ const llms = _chunkISTFC3MZcjs.resolveFarmLlmsTxtConfig.call(void 0, _optionalChain([config, 'access', _470 => _470.agent, 'optionalAccess', _471 => _471.llmsTxt]));
9276
9305
  if (!llms.enabled) return [];
9277
9306
  return llms.full ? ["/llms.txt", "/llms-full.txt"] : ["/llms.txt"];
9278
9307
  }
9279
9308
  _chunkS3JO3N4Hcjs.__name.call(void 0, farmLlmsTxtGeneratedPaths, "farmLlmsTxtGeneratedPaths");
9280
9309
  function farmAgentGeneratedPaths(config) {
9281
- const crawlers = _chunkTYQUSXUGcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([config, 'access', _468 => _468.agent, 'optionalAccess', _469 => _469.crawlers]));
9310
+ const crawlers = _chunkISTFC3MZcjs.resolveFarmAgentCrawlers.call(void 0, _optionalChain([config, 'access', _472 => _472.agent, 'optionalAccess', _473 => _473.crawlers]));
9282
9311
  return [...farmLlmsTxtGeneratedPaths(config), ...crawlers.enabled ? ["/robots.txt"] : []];
9283
9312
  }
9284
9313
  _chunkS3JO3N4Hcjs.__name.call(void 0, farmAgentGeneratedPaths, "farmAgentGeneratedPaths");
@@ -9324,7 +9353,7 @@ function loadFarmWorkflowsDevRuntime() {
9324
9353
  }
9325
9354
  _chunkS3JO3N4Hcjs.__name.call(void 0, loadFarmWorkflowsDevRuntime, "loadFarmWorkflowsDevRuntime");
9326
9355
  function loadFarmDevtoolsSnapshotRuntime() {
9327
- return import("./devtools-OUIPHVV6.cjs");
9356
+ return import("./devtools-R6MDDAZK.cjs");
9328
9357
  }
9329
9358
  _chunkS3JO3N4Hcjs.__name.call(void 0, loadFarmDevtoolsSnapshotRuntime, "loadFarmDevtoolsSnapshotRuntime");
9330
9359
  function loadFarmDevtoolsUIRuntime() {
@@ -9340,7 +9369,7 @@ function farmI18nClientBridgePlugin() {
9340
9369
  name: "farm:i18n-client-bridge",
9341
9370
  enforce: "pre",
9342
9371
  resolveId(id, _importer, options) {
9343
- if (id === "@farm.js/core/i18n/server" && !_optionalChain([options, 'optionalAccess', _470 => _470.ssr])) {
9372
+ if (id === "@farm.js/core/i18n/server" && !_optionalChain([options, 'optionalAccess', _474 => _474.ssr])) {
9344
9373
  return FARM_I18N_CLIENT_BRIDGE_ID;
9345
9374
  }
9346
9375
  return null;
@@ -9358,7 +9387,7 @@ function farmServerOnlyEntriesPlugin() {
9358
9387
  name: "farm:server-only-entries",
9359
9388
  enforce: "pre",
9360
9389
  resolveId(id, importer, options) {
9361
- if (_optionalChain([options, 'optionalAccess', _471 => _471.ssr]) || !FARM_SERVER_ONLY_ENTRIES.has(id)) return null;
9390
+ if (_optionalChain([options, 'optionalAccess', _475 => _475.ssr]) || !FARM_SERVER_ONLY_ENTRIES.has(id)) return null;
9362
9391
  this.error(
9363
9392
  `${id} is server-only and cannot be imported into client code${importer ? ` (imported by ${importer})` : ""}. Use it from an API route or another server module.`
9364
9393
  );
@@ -9396,11 +9425,11 @@ function renderFarmI18nStaticHead(requestPath, snapshot) {
9396
9425
  if (!snapshot) return "";
9397
9426
  const runtime = `<script>window.__FARM_I18N__ = ${serializeFarmInlineValue(snapshot)};</script>`;
9398
9427
  if (snapshot.routing === "none") return runtime;
9399
- return `${_chunkOIEOCXKGcjs.renderFarmLocaleAlternateLinks.call(void 0, requestPath, snapshot)}${runtime}`;
9428
+ return `${_chunkOYDRPBBVcjs.renderFarmLocaleAlternateLinks.call(void 0, requestPath, snapshot)}${runtime}`;
9400
9429
  }
9401
9430
  _chunkS3JO3N4Hcjs.__name.call(void 0, renderFarmI18nStaticHead, "renderFarmI18nStaticHead");
9402
9431
  function getPublicEnvDefine(config) {
9403
- const publicEnv = _optionalChain([config, 'access', _472 => _472.env, 'optionalAccess', _473 => _473.public]);
9432
+ const publicEnv = _optionalChain([config, 'access', _476 => _476.env, 'optionalAccess', _477 => _477.public]);
9404
9433
  if (!isResolvedEnvScope(publicEnv)) {
9405
9434
  return {};
9406
9435
  }
@@ -9441,7 +9470,7 @@ function withFarmRequestTracing(handler, apiRuntime, resolveTraceUrl = (request2
9441
9470
  return;
9442
9471
  }
9443
9472
  if (res.headersSent) {
9444
- _optionalChain([res, 'access', _474 => _474.destroy, 'optionalCall', _475 => _475(error instanceof Error ? error : new Error(String(error)))]);
9473
+ _optionalChain([res, 'access', _478 => _478.destroy, 'optionalCall', _479 => _479(error instanceof Error ? error : new Error(String(error)))]);
9445
9474
  return;
9446
9475
  }
9447
9476
  res.statusCode = 500;
@@ -9540,7 +9569,7 @@ function interceptFarmDevPageResponse(options) {
9540
9569
  const originalWrite = res.write.bind(res);
9541
9570
  const originalEnd = res.end.bind(res);
9542
9571
  const originalWriteHead = res.writeHead.bind(res);
9543
- const originalFlushHeaders = _optionalChain([res, 'access', _476 => _476.flushHeaders, 'optionalAccess', _477 => _477.bind, 'call', _478 => _478(res)]);
9572
+ const originalFlushHeaders = _optionalChain([res, 'access', _480 => _480.flushHeaders, 'optionalAccess', _481 => _481.bind, 'call', _482 => _482(res)]);
9544
9573
  let afterResponseCalled = false;
9545
9574
  let interceptedEnd = false;
9546
9575
  const htmlChunks = [];
@@ -9580,7 +9609,7 @@ function interceptFarmDevPageResponse(options) {
9580
9609
  const shouldBufferResponse = isHtmlResponse ? bufferPluginResponse : Boolean(runtimeSession && hasRuntimeAfterHook);
9581
9610
  if (shouldBufferResponse) {
9582
9611
  const callback = args.find((arg) => typeof arg === "function");
9583
- _optionalChain([callback, 'optionalCall', _479 => _479()]);
9612
+ _optionalChain([callback, 'optionalCall', _483 => _483()]);
9584
9613
  return true;
9585
9614
  }
9586
9615
  const writeResult = originalWrite(chunk, ...args);
@@ -9695,14 +9724,14 @@ function getEnvDefines(config, configEnv) {
9695
9724
  _chunkYFPGHF5Fcjs.getPublicFarmImageConfig.call(void 0, _chunkYFPGHF5Fcjs.resolveFarmImageConfig.call(void 0, config.images))
9696
9725
  )
9697
9726
  };
9698
- if (_optionalChain([configEnv, 'optionalAccess', _480 => _480.isSsrBuild])) {
9727
+ if (_optionalChain([configEnv, 'optionalAccess', _484 => _484.isSsrBuild])) {
9699
9728
  defines.__FARM_ENV__ = JSON.stringify(_chunkVEKFLAQMcjs.createBundledEnv.call(void 0, getFullEnvDefine(config)));
9700
9729
  }
9701
9730
  return defines;
9702
9731
  }
9703
9732
  _chunkS3JO3N4Hcjs.__name.call(void 0, getEnvDefines, "getEnvDefines");
9704
9733
  function getFarmAPIBaseURLDefine(config) {
9705
- const baseURL = _optionalChain([config, 'access', _481 => _481.api, 'optionalAccess', _482 => _482.baseURL]);
9734
+ const baseURL = _optionalChain([config, 'access', _485 => _485.api, 'optionalAccess', _486 => _486.baseURL]);
9706
9735
  return typeof baseURL === "string" && baseURL ? baseURL : _chunkS3A45T7Fcjs.DEFAULT_FARM_API_BASE_PATH;
9707
9736
  }
9708
9737
  _chunkS3JO3N4Hcjs.__name.call(void 0, getFarmAPIBaseURLDefine, "getFarmAPIBaseURLDefine");
@@ -9725,7 +9754,7 @@ function fileContainsProgrammaticPageRoute(file) {
9725
9754
  }
9726
9755
  try {
9727
9756
  return _chunk6V4TDWECcjs.scanProgrammaticPagePaths.call(void 0, fs9.readFileSync(file, "utf8")).length > 0;
9728
- } catch (e22) {
9757
+ } catch (e24) {
9729
9758
  return false;
9730
9759
  }
9731
9760
  }
@@ -9739,7 +9768,7 @@ function rewriteEarlySsrRelativeImports(options) {
9739
9768
  let ast;
9740
9769
  try {
9741
9770
  ast = options.parse(options.code);
9742
- } catch (e23) {
9771
+ } catch (e25) {
9743
9772
  return null;
9744
9773
  }
9745
9774
  walkModuleAst(ast, (node) => {
@@ -9771,7 +9800,7 @@ function transformIsolatedClientBoundaryModule(options) {
9771
9800
  let ast;
9772
9801
  try {
9773
9802
  ast = options.parse(options.code);
9774
- } catch (e24) {
9803
+ } catch (e26) {
9775
9804
  return null;
9776
9805
  }
9777
9806
  const body = Array.isArray(ast.body) ? ast.body : [];
@@ -9792,9 +9821,9 @@ function transformIsolatedClientBoundaryModule(options) {
9792
9821
  transformedExports++;
9793
9822
  }, "addWrapper");
9794
9823
  for (const node of body) {
9795
- if (_optionalChain([node, 'optionalAccess', _483 => _483.type]) === "ExportDefaultDeclaration" && node.declaration) {
9824
+ if (_optionalChain([node, 'optionalAccess', _487 => _487.type]) === "ExportDefaultDeclaration" && node.declaration) {
9796
9825
  const declaration2 = node.declaration;
9797
- if ((declaration2.type === "FunctionDeclaration" || declaration2.type === "ClassDeclaration") && _optionalChain([declaration2, 'access', _484 => _484.id, 'optionalAccess', _485 => _485.name])) {
9826
+ if ((declaration2.type === "FunctionDeclaration" || declaration2.type === "ClassDeclaration") && _optionalChain([declaration2, 'access', _488 => _488.id, 'optionalAccess', _489 => _489.name])) {
9798
9827
  replacements.push({
9799
9828
  start: node.start,
9800
9829
  end: node.end,
@@ -9812,14 +9841,14 @@ function transformIsolatedClientBoundaryModule(options) {
9812
9841
  }
9813
9842
  continue;
9814
9843
  }
9815
- if (_optionalChain([node, 'optionalAccess', _486 => _486.type]) !== "ExportNamedDeclaration" || !node.declaration) continue;
9844
+ if (_optionalChain([node, 'optionalAccess', _490 => _490.type]) !== "ExportNamedDeclaration" || !node.declaration) continue;
9816
9845
  const declaration = node.declaration;
9817
9846
  const declaredNames = [];
9818
- if ((declaration.type === "FunctionDeclaration" || declaration.type === "ClassDeclaration") && _optionalChain([declaration, 'access', _487 => _487.id, 'optionalAccess', _488 => _488.name])) {
9847
+ if ((declaration.type === "FunctionDeclaration" || declaration.type === "ClassDeclaration") && _optionalChain([declaration, 'access', _491 => _491.id, 'optionalAccess', _492 => _492.name])) {
9819
9848
  declaredNames.push(declaration.id.name);
9820
9849
  } else if (declaration.type === "VariableDeclaration") {
9821
9850
  for (const declarator of declaration.declarations || []) {
9822
- if (_optionalChain([declarator, 'access', _489 => _489.id, 'optionalAccess', _490 => _490.type]) === "Identifier") declaredNames.push(declarator.id.name);
9851
+ if (_optionalChain([declarator, 'access', _493 => _493.id, 'optionalAccess', _494 => _494.type]) === "Identifier") declaredNames.push(declarator.id.name);
9823
9852
  }
9824
9853
  }
9825
9854
  const componentNames = declaredNames.filter((name) => /^[A-Z]/.test(name));
@@ -9880,10 +9909,10 @@ function warnClientBoundaryOnce(context, id, code, config) {
9880
9909
  let program;
9881
9910
  try {
9882
9911
  program = context.parse(code);
9883
- } catch (e25) {
9912
+ } catch (e27) {
9884
9913
  return;
9885
9914
  }
9886
- const publicKeys = new Set(Object.keys(_nullishCoalesce(_optionalChain([config, 'access', _491 => _491.env, 'optionalAccess', _492 => _492.public]), () => ( {}))));
9915
+ const publicKeys = new Set(Object.keys(_nullishCoalesce(_optionalChain([config, 'access', _495 => _495.env, 'optionalAccess', _496 => _496.public]), () => ( {}))));
9887
9916
  const findings = analyzeClientBoundary(program, publicKeys);
9888
9917
  if (findings.envKeys.length === 0 && findings.publicEnvKeys.length === 0 && findings.builtinImports.length === 0) {
9889
9918
  return;
@@ -9934,13 +9963,16 @@ function farmPlugin(options = {}, initialPluginManager) {
9934
9963
  config(userConfig, configEnv) {
9935
9964
  isBuild = configEnv.command === "build";
9936
9965
  const layerAliases = _chunkY4YMF2NQcjs.getFarmLayerAliases.call(void 0, options.layers);
9937
- const sourceAlias = hasViteAlias(_optionalChain([userConfig, 'access', _493 => _493.resolve, 'optionalAccess', _494 => _494.alias]), "@") ? {} : createFarmSourceAlias(options.root || process.cwd(), options.srcDir);
9966
+ const sourceAlias = hasViteAlias(_optionalChain([userConfig, 'access', _497 => _497.resolve, 'optionalAccess', _498 => _498.alias]), "@") ? {} : createFarmSourceAlias(options.root || process.cwd(), options.srcDir);
9938
9967
  const layerRoots = (_nullishCoalesce(options.layers, () => ( []))).map((layer) => layer.root);
9939
9968
  return {
9940
9969
  // Honor Farm's publicDir so the dev server serves the same static
9941
9970
  // directory the production client build emits.
9942
9971
  ...options.publicDir ? { publicDir: options.publicDir } : {},
9943
9972
  define: getEnvDefines(options, configEnv),
9973
+ // Keep development module ownership explicit; the RSC plugin adds its
9974
+ // environment only when enabled. Production environment setup is unchanged.
9975
+ ...!isBuild ? { environments: { client: {}, ssr: {} } } : {},
9944
9976
  resolve: {
9945
9977
  alias: { ...layerAliases, ...sourceAlias }
9946
9978
  },
@@ -9968,7 +10000,7 @@ function farmPlugin(options = {}, initialPluginManager) {
9968
10000
  if (!pm) return;
9969
10001
  try {
9970
10002
  await pm.runHookParallel("onError", { phase, error, meta });
9971
- } catch (e26) {
10003
+ } catch (e28) {
9972
10004
  }
9973
10005
  }, "emitPluginError");
9974
10006
  farmApp = new FarmApp(
@@ -9980,10 +10012,10 @@ function farmPlugin(options = {}, initialPluginManager) {
9980
10012
  );
9981
10013
  await farmApp.initialize();
9982
10014
  const farmConfig = farmApp.getConfig();
9983
- if (_optionalChain([farmConfig, 'access', _495 => _495.agent, 'optionalAccess', _496 => _496.noindexPreviews])) {
10015
+ if (_optionalChain([farmConfig, 'access', _499 => _499.agent, 'optionalAccess', _500 => _500.noindexPreviews])) {
9984
10016
  server.middlewares.use((_req, res, next) => {
9985
10017
  if (_chunkCXP5U3RWcjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env)) {
9986
- res.setHeader("X-Robots-Tag", _chunkTYQUSXUGcjs.FARM_PREVIEW_ROBOTS_TAG);
10018
+ res.setHeader("X-Robots-Tag", _chunkISTFC3MZcjs.FARM_PREVIEW_ROBOTS_TAG);
9987
10019
  }
9988
10020
  next();
9989
10021
  });
@@ -9999,7 +10031,7 @@ function farmPlugin(options = {}, initialPluginManager) {
9999
10031
  validateRemoteUrl: createNodeImageUrlValidator(farmConfig.images),
10000
10032
  // Vite owns this address. Unlike request.url, it cannot be replaced by
10001
10033
  // a caller-controlled Host header.
10002
- trustedLocalOrigin: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => _optionalChain([server, 'access', _497 => _497.resolvedUrls, 'optionalAccess', _498 => _498.local, 'access', _499 => _499[0]]), "trustedLocalOrigin"),
10034
+ trustedLocalOrigin: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => _optionalChain([server, 'access', _501 => _501.resolvedUrls, 'optionalAccess', _502 => _502.local, 'access', _503 => _503[0]]), "trustedLocalOrigin"),
10003
10035
  onError(error) {
10004
10036
  _chunk5QIKR7RRcjs.logger.error(
10005
10037
  `Image optimization failed: ${error instanceof Error ? error.message : String(error)}`
@@ -10019,15 +10051,15 @@ function farmPlugin(options = {}, initialPluginManager) {
10019
10051
  const workflowConfig = farmConfig.workflows;
10020
10052
  const farmDocsDevRuntime = farmConfig.docs.enabled ? await loadFarmDocsDevRuntime() : null;
10021
10053
  const getExtraRouteTypes = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, () => [
10022
- ..._optionalChain([options, 'access', _500 => _500.openapi, 'optionalAccess', _501 => _501.enabled]) && options.openapi.route ? [options.openapi.route] : [],
10023
- ..._nullishCoalesce(_optionalChain([farmDocsDevRuntime, 'optionalAccess', _502 => _502.getFarmDocsRouteTypeEntries, 'call', _503 => _503(farmConfig.docs)]), () => ( []))
10054
+ ..._optionalChain([options, 'access', _504 => _504.openapi, 'optionalAccess', _505 => _505.enabled]) && options.openapi.route ? [options.openapi.route] : [],
10055
+ ..._nullishCoalesce(_optionalChain([farmDocsDevRuntime, 'optionalAccess', _506 => _506.getFarmDocsRouteTypeEntries, 'call', _507 => _507(farmConfig.docs)]), () => ( []))
10024
10056
  ], "getExtraRouteTypes");
10025
10057
  const appDirSlugs = sourceRoots.map(
10026
10058
  (source) => path16.join(source.root, source.srcDir, "app").replace(/\\/g, "/")
10027
10059
  );
10028
10060
  const generateTypeArtifacts = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (reason, selection = ALL_TYPE_ARTIFACTS, log = false) => {
10029
10061
  try {
10030
- const result = await _chunkWZMNW2IWcjs.generateFarmTypeArtifacts.call(void 0, {
10062
+ const result = await _chunkXFFQSD2Fcjs.generateFarmTypeArtifacts.call(void 0, {
10031
10063
  root: farmConfig.root,
10032
10064
  srcDir: farmConfig.srcDir,
10033
10065
  layers: farmConfig.layers,
@@ -10067,12 +10099,18 @@ function farmPlugin(options = {}, initialPluginManager) {
10067
10099
  (source) => path16.join(source.root, source.srcDir).replace(/\\/g, "/")
10068
10100
  );
10069
10101
  const layerConfigFiles = new Set(
10070
- farmConfig.layers.map((layer) => _optionalChain([layer, 'access', _504 => _504.configFile, 'optionalAccess', _505 => _505.replace, 'call', _506 => _506(/\\/g, "/")])).filter((file) => Boolean(file))
10102
+ farmConfig.layers.map((layer) => _optionalChain([layer, 'access', _508 => _508.configFile, 'optionalAccess', _509 => _509.replace, 'call', _510 => _510(/\\/g, "/")])).filter((file) => Boolean(file))
10071
10103
  );
10072
- const isPageFile = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (file) => {
10104
+ const routeModuleExtensions = /* @__PURE__ */ new Set([
10105
+ ..._chunkTFAXUHWXcjs.resolveFarmComponentExtensions.call(void 0, farmConfig.renderer.componentExtensions),
10106
+ ".md",
10107
+ ".mdx"
10108
+ ]);
10109
+ const isRouteModuleFile = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (file) => {
10073
10110
  const normalized = file.replace(/\\/g, "/");
10074
- return appDirSlugs.some((appDir) => normalized.startsWith(`${appDir}/`)) && /page\.(ts|tsx|js|jsx|md|mdx)$/.test(normalized);
10075
- }, "isPageFile");
10111
+ const match = /\/(?:page|layout|loading|error)(\.[^./]+)$/.exec(normalized);
10112
+ return appDirSlugs.some((appDir) => normalized.startsWith(`${appDir}/`)) && !!match && routeModuleExtensions.has(match[1].toLowerCase());
10113
+ }, "isRouteModuleFile");
10076
10114
  const isApiRouteFile = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (file) => {
10077
10115
  const normalized = file.replace(/\\/g, "/");
10078
10116
  return appDirSlugs.some((appDir) => normalized.startsWith(`${appDir}/api/`)) && /route\.(ts|tsx|js|jsx)$/.test(normalized);
@@ -10123,11 +10161,14 @@ function farmPlugin(options = {}, initialPluginManager) {
10123
10161
  }, "scheduleTypeArtifactGen");
10124
10162
  ["add", "change", "unlink"].forEach((ev) => {
10125
10163
  server.watcher.on(ev, (file) => {
10164
+ if (ev === "add") {
10165
+ _chunkBMWDEBXOcjs.invalidateFailedFarmDevModules.call(void 0, server);
10166
+ }
10126
10167
  const normalizedFile = file.replace(/\\/g, "/");
10127
10168
  const configChanged = isFarmConfigFile(file, farmConfig.root) || layerConfigFiles.has(normalizedFile);
10128
10169
  const programmaticRouteChanged = isProgrammaticRouteFile(file) || isProgrammaticRouteSourceFile(file) && (ev === "unlink" || fileContainsProgrammaticPageRoute(file));
10129
10170
  const typeArtifacts = configChanged ? ALL_TYPE_ARTIFACTS : {
10130
- routes: ev !== "change" && isPageFile(file) || programmaticRouteChanged,
10171
+ routes: ev !== "change" && isRouteModuleFile(file) || programmaticRouteChanged,
10131
10172
  api: isApiRouteFile(file) || programmaticRouteChanged,
10132
10173
  env: false,
10133
10174
  images: false,
@@ -10137,7 +10178,7 @@ function farmPlugin(options = {}, initialPluginManager) {
10137
10178
  scheduleTypeArtifactGen(file, ev, typeArtifacts);
10138
10179
  }
10139
10180
  if (isI18nCatalogFile(file)) {
10140
- _optionalChain([farmApp, 'optionalAccess', _507 => _507.getI18nRuntime, 'call', _508 => _508(), 'access', _509 => _509.reload, 'call', _510 => _510(), 'access', _511 => _511.then, 'call', _512 => _512(() => server.ws.send({ type: "full-reload", path: "*" })), 'access', _513 => _513.catch, 'call', _514 => _514((error) => _chunk5QIKR7RRcjs.logger.warn(`i18n catalog reload failed: ${error.message}`))]);
10181
+ _optionalChain([farmApp, 'optionalAccess', _511 => _511.getI18nRuntime, 'call', _512 => _512(), 'access', _513 => _513.reload, 'call', _514 => _514(), 'access', _515 => _515.then, 'call', _516 => _516(() => server.ws.send({ type: "full-reload", path: "*" })), 'access', _517 => _517.catch, 'call', _518 => _518((error) => _chunk5QIKR7RRcjs.logger.warn(`i18n catalog reload failed: ${error.message}`))]);
10141
10182
  }
10142
10183
  const isRouteRefreshEvent = (ev !== "change" || isStaticMetadataImageFile2(file)) && (isAppRuntimeFile(file) || isProgrammaticRouteFile(file) || isProgrammaticRouteSourceFile(file) && (ev === "unlink" || fileContainsProgrammaticPageRoute(file)));
10143
10184
  if (isRouteRefreshEvent) {
@@ -10150,8 +10191,8 @@ function farmPlugin(options = {}, initialPluginManager) {
10150
10191
  const reloadsMiddleware = pendingRouteRefreshIncludesMiddleware;
10151
10192
  pendingRouteRefreshIncludesMiddleware = false;
10152
10193
  Promise.all([
10153
- _optionalChain([refreshRouteDiscovery, 'optionalCall', _515 => _515(`${ev} ${file}`)]),
10154
- reloadsMiddleware ? _optionalChain([middlewareManager, 'optionalAccess', _516 => _516.reload, 'call', _517 => _517()]) : void 0
10194
+ _optionalChain([refreshRouteDiscovery, 'optionalCall', _519 => _519(`${ev} ${file}`)]),
10195
+ reloadsMiddleware ? _optionalChain([middlewareManager, 'optionalAccess', _520 => _520.reload, 'call', _521 => _521()]) : void 0
10155
10196
  ]).then(() => server.ws.send({ type: "full-reload", path: "*" })).catch((error) => _chunk5QIKR7RRcjs.logger.warn(`Route refresh failed: ${error.message}`));
10156
10197
  }, 50);
10157
10198
  }
@@ -10185,7 +10226,7 @@ function farmPlugin(options = {}, initialPluginManager) {
10185
10226
  layoutCount: discoveredRoutes.filter((r) => r.kind === "layout").length
10186
10227
  });
10187
10228
  }
10188
- apiRouteManager = new (0, _chunkAFOD3LYZcjs.APIRouteManager)(appDirs, server, {
10229
+ apiRouteManager = new (0, _chunkB3WK4DTXcjs.APIRouteManager)(appDirs, server, {
10189
10230
  plugins: farmConfig.plugins,
10190
10231
  i18n: farmApp.getI18nRuntime(),
10191
10232
  bodySizeLimit: serverConfig.bodySizeLimit,
@@ -10201,14 +10242,14 @@ function farmPlugin(options = {}, initialPluginManager) {
10201
10242
  discoveredWorkflows = await discoverFarmWorkflows(
10202
10243
  { ...farmConfig, workflows: workflowConfig },
10203
10244
  {
10204
- loadModule: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (filePath) => server.ssrLoadModule(filePath), "loadModule")
10245
+ loadModule: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (filePath) => _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, server, filePath), "loadModule")
10205
10246
  }
10206
10247
  );
10207
10248
  if (discoveredWorkflows.length > 0) {
10208
10249
  workflowHandler = createFarmWorkflowRequestHandler({
10209
10250
  workflows: discoveredWorkflows,
10210
10251
  config: workflowConfig,
10211
- loadModule: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (workflow) => server.ssrLoadModule(workflow.filePath), "loadModule"),
10252
+ loadModule: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (workflow) => _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, server, workflow.filePath), "loadModule"),
10212
10253
  server: farmConfig.server
10213
10254
  });
10214
10255
  _chunk5QIKR7RRcjs.logger.success(`\u2705 Discovered ${discoveredWorkflows.length} Farm workflow task(s)`);
@@ -10223,7 +10264,7 @@ function farmPlugin(options = {}, initialPluginManager) {
10223
10264
  });
10224
10265
  }
10225
10266
  }
10226
- middlewareManager = new (0, _chunkY53ZSFN6cjs.MiddlewareManager)(
10267
+ middlewareManager = new (0, _chunkWM6HL7E7cjs.MiddlewareManager)(
10227
10268
  appDirs,
10228
10269
  server,
10229
10270
  farmConfig.middleware,
@@ -10240,11 +10281,11 @@ function farmPlugin(options = {}, initialPluginManager) {
10240
10281
  });
10241
10282
  }
10242
10283
  }
10243
- if (_optionalChain([options, 'access', _518 => _518.openapi, 'optionalAccess', _519 => _519.enabled])) {
10284
+ if (_optionalChain([options, 'access', _522 => _522.openapi, 'optionalAccess', _523 => _523.enabled])) {
10244
10285
  const { OpenAPIManager } = await loadFarmOpenAPIDevRuntime();
10245
10286
  openAPIManager = new OpenAPIManager(appDirs, options.openapi, {
10246
10287
  mode: "development",
10247
- apiBaseURL: typeof _optionalChain([options, 'access', _520 => _520.api, 'optionalAccess', _521 => _521.baseURL]) === "string" ? options.api.baseURL : void 0
10288
+ apiBaseURL: typeof _optionalChain([options, 'access', _524 => _524.api, 'optionalAccess', _525 => _525.baseURL]) === "string" ? options.api.baseURL : void 0
10248
10289
  });
10249
10290
  const spec = await openAPIManager.generateSpec();
10250
10291
  reportOpenAPIDevGenerationResult(spec);
@@ -10282,16 +10323,14 @@ function farmPlugin(options = {}, initialPluginManager) {
10282
10323
  farmConfig.srcDir
10283
10324
  ),
10284
10325
  loadModule: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (specifier) => {
10285
- const resolved = await server.pluginContainer.resolveId(specifier, void 0, {
10286
- ssr: true
10287
- });
10288
- if (specifier === _optionalChain([farmConfig, 'access', _522 => _522.docs, 'access', _523 => _523.adapter, 'optionalAccess', _524 => _524.server]) && _optionalChain([resolved, 'optionalAccess', _525 => _525.id])) {
10326
+ const resolved = await server.environments.ssr.pluginContainer.resolveId(specifier);
10327
+ if (specifier === _optionalChain([farmConfig, 'access', _526 => _526.docs, 'access', _527 => _527.adapter, 'optionalAccess', _528 => _528.server]) && _optionalChain([resolved, 'optionalAccess', _529 => _529.id])) {
10289
10328
  return import(
10290
10329
  /* @vite-ignore */
10291
10330
  _url.pathToFileURL.call(void 0, resolved.id).href
10292
10331
  );
10293
10332
  }
10294
- return server.ssrLoadModule(_nullishCoalesce(_optionalChain([resolved, 'optionalAccess', _526 => _526.id]), () => ( specifier)));
10333
+ return _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, server, _nullishCoalesce(_optionalChain([resolved, 'optionalAccess', _530 => _530.id]), () => ( specifier)));
10295
10334
  }, "loadModule")
10296
10335
  }) : farmDocsDevRuntime.createFarmDocsHandler(farmConfig.docs, {
10297
10336
  root: farmConfig.root,
@@ -10306,7 +10345,7 @@ function farmPlugin(options = {}, initialPluginManager) {
10306
10345
  )
10307
10346
  }) : null;
10308
10347
  const wrapFarmDocsResponseWithLayouts = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (request2, response) => {
10309
- if (request2.method === "HEAD" || response.headers.has("x-farm-docs-adapter") || !_optionalChain([response, 'access', _527 => _527.headers, 'access', _528 => _528.get, 'call', _529 => _529("content-type"), 'optionalAccess', _530 => _530.toLowerCase, 'call', _531 => _531(), 'access', _532 => _532.includes, 'call', _533 => _533("text/html")])) {
10348
+ if (request2.method === "HEAD" || response.headers.has("x-farm-docs-adapter") || !_optionalChain([response, 'access', _531 => _531.headers, 'access', _532 => _532.get, 'call', _533 => _533("content-type"), 'optionalAccess', _534 => _534.toLowerCase, 'call', _535 => _535(), 'access', _536 => _536.includes, 'call', _537 => _537("text/html")])) {
10310
10349
  return response;
10311
10350
  }
10312
10351
  const pathname = new URL(request2.url).pathname;
@@ -10327,9 +10366,9 @@ function farmPlugin(options = {}, initialPluginManager) {
10327
10366
  headers: response.headers
10328
10367
  });
10329
10368
  }
10330
- const docsRenderer = _chunkTFAXUHWXcjs.resolveFarmRenderer.call(void 0, (_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _534 => _534.getConfig, 'call', _535 => _535()]), () => ( options))).renderer);
10369
+ const docsRenderer = _chunkTFAXUHWXcjs.resolveFarmRenderer.call(void 0, (_nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _538 => _538.getConfig, 'call', _539 => _539()]), () => ( options))).renderer);
10331
10370
  const [rendererRuntime, layoutModules] = await Promise.all([
10332
- _chunkTFAXUHWXcjs.isReactRenderer.call(void 0, docsRenderer) ? import("./renderer/react/server.cjs") : server.ssrLoadModule(docsRenderer.server),
10371
+ _chunkTFAXUHWXcjs.isReactRenderer.call(void 0, docsRenderer) ? import("./renderer/react/server.cjs") : _chunkBMWDEBXOcjs.loadFarmDevModule.call(void 0, server, docsRenderer.server),
10333
10372
  Promise.all(
10334
10373
  layoutEntries.map((layout) => routeManager.loadLayoutModule(layout.modulePath))
10335
10374
  )
@@ -10356,7 +10395,7 @@ function farmPlugin(options = {}, initialPluginManager) {
10356
10395
  ])
10357
10396
  );
10358
10397
  const inlineValue = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (value) => JSON.stringify(value).replace(/</g, "\\u003c").replace(/>/g, "\\u003e"), "inlineValue");
10359
- const pageModulePath = _optionalChain([matchedRoute, 'access', _536 => _536.route, 'optionalAccess', _537 => _537.modulePath]) ? toUrlPath(matchedRoute.route.modulePath) : "";
10398
+ const pageModulePath = _optionalChain([matchedRoute, 'access', _540 => _540.route, 'optionalAccess', _541 => _541.modulePath]) ? toUrlPath(matchedRoute.route.modulePath) : "";
10360
10399
  const bootstrapScript = `<script>
10361
10400
  window.__FARM_PROPS__ = ${inlineValue({ params })};
10362
10401
  window.__FARM_ROUTE_SLOTS__ = [];
@@ -10450,7 +10489,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
10450
10489
  }, "dispatch")
10451
10490
  },
10452
10491
  (request2) => {
10453
- const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _538 => _538.getConfig, 'call', _539 => _539()]), () => ( options));
10492
+ const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _542 => _542.getConfig, 'call', _543 => _543()]), () => ( options));
10454
10493
  const currentServerConfig = _chunkEM6SBQKMcjs.resolveFarmServerConfig.call(void 0, currentConfig.server);
10455
10494
  return _chunk5ZSWG4UXcjs.resolveFarmRequestURL.call(void 0, request2, {
10456
10495
  trustProxy: currentServerConfig.trustProxy
@@ -10461,7 +10500,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
10461
10500
  withAPIRequestTracing(async (req, res, next) => {
10462
10501
  const requestUrl = req.url || "/";
10463
10502
  const requestMethod = req.method || "GET";
10464
- const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _540 => _540.getConfig, 'call', _541 => _541()]), () => ( options));
10503
+ const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _544 => _544.getConfig, 'call', _545 => _545()]), () => ( options));
10465
10504
  const currentServerConfig = _chunkEM6SBQKMcjs.resolveFarmServerConfig.call(void 0, currentConfig.server);
10466
10505
  const parsedRequestUrl = _chunk5ZSWG4UXcjs.resolveFarmRequestURL.call(void 0, req, {
10467
10506
  trustProxy: currentServerConfig.trustProxy
@@ -10503,7 +10542,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
10503
10542
  if (referrerUrl.origin === parsedRequestUrl.origin && !referrerUrl.pathname.startsWith(_chunkYJRZR7VUcjs.FARM_DEVTOOLS_PATH)) {
10504
10543
  launchUrl = referrerUrl;
10505
10544
  }
10506
- } catch (e27) {
10545
+ } catch (e29) {
10507
10546
  }
10508
10547
  }
10509
10548
  launchUrl.searchParams.set(_chunkYJRZR7VUcjs.FARM_DEVTOOLS_LAUNCH_PARAM, "1");
@@ -10551,7 +10590,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
10551
10590
  return;
10552
10591
  }
10553
10592
  const runAppMiddlewareForContentRoute = /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async () => {
10554
- if (!_optionalChain([middlewareManager, 'optionalAccess', _542 => _542.hasMiddleware, 'call', _543 => _543()])) return false;
10593
+ if (!_optionalChain([middlewareManager, 'optionalAccess', _546 => _546.hasMiddleware, 'call', _547 => _547()])) return false;
10555
10594
  const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
10556
10595
  return runFarmMiddlewareWithNavigation(
10557
10596
  farmApp.getServerRenderer(),
@@ -10562,7 +10601,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
10562
10601
  );
10563
10602
  }, "runAppMiddlewareForContentRoute");
10564
10603
  const openAPIRequestPathname = openAPIManager ? _chunkI57LW5VZcjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) : requestPathname;
10565
- if (openAPIManager && _optionalChain([options, 'access', _544 => _544.openapi, 'optionalAccess', _545 => _545.specRoute]) && openAPIRequestPathname === options.openapi.specRoute) {
10604
+ if (openAPIManager && _optionalChain([options, 'access', _548 => _548.openapi, 'optionalAccess', _549 => _549.specRoute]) && openAPIRequestPathname === options.openapi.specRoute) {
10566
10605
  if (await runAppMiddlewareForContentRoute()) return;
10567
10606
  if (requestMethod !== "GET" && requestMethod !== "HEAD") {
10568
10607
  res.statusCode = 405;
@@ -10579,7 +10618,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
10579
10618
  res.end(requestMethod === "HEAD" ? void 0 : body);
10580
10619
  return;
10581
10620
  }
10582
- if (openAPIManager && openAPIRequestPathname === _optionalChain([options, 'access', _546 => _546.openapi, 'optionalAccess', _547 => _547.route])) {
10621
+ if (openAPIManager && openAPIRequestPathname === _optionalChain([options, 'access', _550 => _550.openapi, 'optionalAccess', _551 => _551.route])) {
10583
10622
  if (await runAppMiddlewareForContentRoute()) return;
10584
10623
  const docsHandler = openAPIManager.getDocsRouteHandler(parsedRequestUrl.origin);
10585
10624
  return docsHandler(req, res);
@@ -10611,7 +10650,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
10611
10650
  return;
10612
10651
  }
10613
10652
  }
10614
- const markdownSourceResponse = viteModuleRequest ? null : await _chunkE2BMSZ2Wcjs.createFarmMarkdownSourceResponse.call(void 0, {
10653
+ const markdownSourceResponse = viteModuleRequest ? null : await _chunkAH7HOAQ3cjs.createFarmMarkdownSourceResponse.call(void 0, {
10615
10654
  request: new Request(fullUrl, {
10616
10655
  method: requestMethod,
10617
10656
  headers: docsHeaders
@@ -10619,7 +10658,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
10619
10658
  config: farmApp.getConfig().mdx,
10620
10659
  resolveSource: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, async (pathname2) => {
10621
10660
  const match = farmApp.getRouteManager().matchRoute(pathname2);
10622
- const sourcePath = _optionalChain([match, 'access', _548 => _548.route, 'optionalAccess', _549 => _549.markdownSourcePath]) || (match.route && _chunkE2BMSZ2Wcjs.isFarmMarkdownPageFile.call(void 0, match.route.modulePath) ? match.route.modulePath : null);
10661
+ const sourcePath = _optionalChain([match, 'access', _552 => _552.route, 'optionalAccess', _553 => _553.markdownSourcePath]) || (match.route && _chunkAH7HOAQ3cjs.isFarmMarkdownPageFile.call(void 0, match.route.modulePath) ? match.route.modulePath : null);
10623
10662
  if (!sourcePath) {
10624
10663
  return null;
10625
10664
  }
@@ -10634,7 +10673,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
10634
10673
  await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0, res, markdownSourceResponse);
10635
10674
  return;
10636
10675
  }
10637
- const markdownResponse = viteModuleRequest ? null : await _chunkTWGMSEHXcjs.createMarkdownMirrorResponse.call(void 0, {
10676
+ const markdownResponse = viteModuleRequest ? null : await _chunkBBVSJVBZcjs.createMarkdownMirrorResponse.call(void 0, {
10638
10677
  request: new Request(fullUrl, {
10639
10678
  method: requestMethod,
10640
10679
  headers: docsHeaders
@@ -10648,21 +10687,21 @@ window.__FARM_MANIFEST__ = ${inlineValue({
10648
10687
  await _chunkUQZ4AYTHcjs.sendWebResponse.call(void 0, res, markdownResponse);
10649
10688
  return;
10650
10689
  }
10651
- if (!viteModuleRequest && _chunkTWGMSEHXcjs.farmRequestWantsMarkdown.call(void 0, requestPathname, req.headers.accept)) {
10652
- const markdownRoute = farmApp.getRouteManager().matchRoute(_chunkE2BMSZ2Wcjs.normalizeFarmMarkdownRoutePath.call(void 0, requestPathname));
10690
+ if (!viteModuleRequest && _chunkBBVSJVBZcjs.farmRequestWantsMarkdown.call(void 0, requestPathname, req.headers.accept)) {
10691
+ const markdownRoute = farmApp.getRouteManager().matchRoute(_chunkAH7HOAQ3cjs.normalizeFarmMarkdownRoutePath.call(void 0, requestPathname));
10653
10692
  if (!markdownRoute.route) {
10654
10693
  if (await runAppMiddlewareForContentRoute()) return;
10655
10694
  res.statusCode = 404;
10656
- res.setHeader("Content-Type", _chunkTWGMSEHXcjs.FARM_MARKDOWN_CONTENT_TYPE);
10695
+ res.setHeader("Content-Type", _chunkBBVSJVBZcjs.FARM_MARKDOWN_CONTENT_TYPE);
10657
10696
  res.setHeader("X-Farm-Markdown-Error", "404");
10658
10697
  res.setHeader("Cache-Control", "no-store");
10659
10698
  res.end(
10660
- _chunkTWGMSEHXcjs.createFarmMarkdownErrorBody.call(void 0, 404, requestPathname, farmConfig.basePath || "/")
10699
+ _chunkBBVSJVBZcjs.createFarmMarkdownErrorBody.call(void 0, 404, requestPathname, farmConfig.basePath || "/")
10661
10700
  );
10662
10701
  return;
10663
10702
  }
10664
10703
  }
10665
- const markdownPageTarget = _chunkTWGMSEHXcjs.resolveMarkdownMirrorTarget.call(void 0,
10704
+ const markdownPageTarget = _chunkBBVSJVBZcjs.resolveMarkdownMirrorTarget.call(void 0,
10666
10705
  farmApp.getConfig().md,
10667
10706
  requestPathname,
10668
10707
  {
@@ -10675,7 +10714,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
10675
10714
  if (!varyValues.some((value) => value.toLowerCase() === "accept")) {
10676
10715
  res.setHeader("Vary", [...varyValues, "Accept"].join(", "));
10677
10716
  }
10678
- const alternatePath = _chunkTWGMSEHXcjs.getFarmMarkdownMirrorPath.call(void 0, markdownPageTarget.pathname);
10717
+ const alternatePath = _chunkBBVSJVBZcjs.getFarmMarkdownMirrorPath.call(void 0, markdownPageTarget.pathname);
10679
10718
  const alternateLink = `<${alternatePath}>; rel="alternate"; type="text/markdown"`;
10680
10719
  const currentLink = res.getHeader("Link");
10681
10720
  res.setHeader(
@@ -10727,7 +10766,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
10727
10766
  "beforeRequest",
10728
10767
  (plugin) => {
10729
10768
  const owner = _chunkZ5HIWVDPcjs.getFarmIntegrationPluginOwner.call(void 0, plugin);
10730
- return plugin.name !== _chunkYZTASLPQcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME && (_optionalChain([owner, 'optionalAccess', _550 => _550.source]) !== "lifecycle" || owner.key !== matchedRoute.key);
10769
+ return plugin.name !== _chunkYZTASLPQcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME && (_optionalChain([owner, 'optionalAccess', _554 => _554.source]) !== "lifecycle" || owner.key !== matchedRoute.key);
10731
10770
  },
10732
10771
  req,
10733
10772
  res
@@ -10857,7 +10896,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
10857
10896
  const apiHandler = apiRouteManager.getHandler({ throwOnError: true });
10858
10897
  const hasExplicitAPIRoute = hasMatchedApiRoute || Boolean(apiRouteManager.matchRoute(pathname2));
10859
10898
  if (apiHandler && hasExplicitAPIRoute) {
10860
- const apiRoutePattern = _optionalChain([matchedApiRoute, 'optionalAccess', _551 => _551.route, 'access', _552 => _552.path]) || _optionalChain([apiRouteManager, 'access', _553 => _553.matchRoute, 'call', _554 => _554(pathname2), 'optionalAccess', _555 => _555.route, 'access', _556 => _556.path]) || urlPath2;
10899
+ const apiRoutePattern = _optionalChain([matchedApiRoute, 'optionalAccess', _555 => _555.route, 'access', _556 => _556.path]) || _optionalChain([apiRouteManager, 'access', _557 => _557.matchRoute, 'call', _558 => _558(pathname2), 'optionalAccess', _559 => _559.route, 'access', _560 => _560.path]) || urlPath2;
10861
10900
  _chunkE3UK5IIBcjs.emitFarmEvent.call(void 0, {
10862
10901
  type: "route.matched",
10863
10902
  pathname: pathname2,
@@ -10947,7 +10986,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
10947
10986
  return;
10948
10987
  }
10949
10988
  }
10950
- if (farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _557 => _557.isFarmDocsAPIRequest, 'call', _558 => _558(pathname2)])) {
10989
+ if (farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _561 => _561.isFarmDocsAPIRequest, 'call', _562 => _562(pathname2)])) {
10951
10990
  try {
10952
10991
  const url = `http://${req.headers.host || "localhost:3000"}${req.url}`;
10953
10992
  const headers = new Headers();
@@ -11020,18 +11059,18 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11020
11059
  res.end(JSON.stringify({ error: "API route not found", pathname: pathname2 }));
11021
11060
  return;
11022
11061
  }
11023
- if (_optionalChain([req, 'access', _559 => _559.url, 'optionalAccess', _560 => _560.startsWith, 'call', _561 => _561("/@")]) || _optionalChain([req, 'access', _562 => _562.url, 'optionalAccess', _563 => _563.startsWith, 'call', _564 => _564("/node_modules")])) {
11062
+ if (_optionalChain([req, 'access', _563 => _563.url, 'optionalAccess', _564 => _564.startsWith, 'call', _565 => _565("/@")]) || _optionalChain([req, 'access', _566 => _566.url, 'optionalAccess', _567 => _567.startsWith, 'call', _568 => _568("/node_modules")])) {
11024
11063
  return next();
11025
11064
  }
11026
11065
  if (shouldBypassFarmRouterForDottedPath(
11027
11066
  requestPathname,
11028
- _optionalChain([farmApp, 'optionalAccess', _565 => _565.getRouteManager, 'call', _566 => _566()]),
11067
+ _optionalChain([farmApp, 'optionalAccess', _569 => _569.getRouteManager, 'call', _570 => _570()]),
11029
11068
  [server.config.publicDir, server.config.root],
11030
11069
  farmAgentGeneratedPaths(farmConfig)
11031
11070
  )) {
11032
11071
  return next();
11033
11072
  }
11034
- if (_optionalChain([req, 'access', _567 => _567.url, 'optionalAccess', _568 => _568.startsWith, 'call', _569 => _569("/__farm/page-data")])) {
11073
+ if (_optionalChain([req, 'access', _571 => _571.url, 'optionalAccess', _572 => _572.startsWith, 'call', _573 => _573("/__farm/page-data")])) {
11035
11074
  const urlObj = parsedRequestUrl;
11036
11075
  const targetPath = urlObj.searchParams.get("path") || "/";
11037
11076
  try {
@@ -11059,7 +11098,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11059
11098
  });
11060
11099
  let middlewareMap = /* @__PURE__ */ new Map();
11061
11100
  let middlewareContext = /* @__PURE__ */ new Map();
11062
- if (_optionalChain([middlewareManager, 'optionalAccess', _570 => _570.hasMiddleware, 'call', _571 => _571()])) {
11101
+ if (_optionalChain([middlewareManager, 'optionalAccess', _574 => _574.hasMiddleware, 'call', _575 => _575()])) {
11063
11102
  const targetNodeRequest = createPageDataMiddlewareRequest(req, targetRequestUrl);
11064
11103
  const handled = await runFarmMiddlewareWithNavigation(
11065
11104
  farmApp.getServerRenderer(),
@@ -11087,10 +11126,10 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11087
11126
  if (pm) {
11088
11127
  await pm.runHookParallel("afterRouteMatch", {
11089
11128
  pathname: targetPath,
11090
- matched: !!_optionalChain([match, 'optionalAccess', _572 => _572.route]),
11091
- routePattern: _optionalChain([match, 'optionalAccess', _573 => _573.route, 'optionalAccess', _574 => _574.pattern]) || null,
11092
- params: _optionalChain([match, 'optionalAccess', _575 => _575.params]) || {},
11093
- layoutPatterns: (_optionalChain([match, 'optionalAccess', _576 => _576.layouts]) || []).map((l) => l.pattern)
11129
+ matched: !!_optionalChain([match, 'optionalAccess', _576 => _576.route]),
11130
+ routePattern: _optionalChain([match, 'optionalAccess', _577 => _577.route, 'optionalAccess', _578 => _578.pattern]) || null,
11131
+ params: _optionalChain([match, 'optionalAccess', _579 => _579.params]) || {},
11132
+ layoutPatterns: (_optionalChain([match, 'optionalAccess', _580 => _580.layouts]) || []).map((l) => l.pattern)
11094
11133
  });
11095
11134
  }
11096
11135
  if (!match) {
@@ -11154,24 +11193,24 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11154
11193
  routePath: route.pattern
11155
11194
  });
11156
11195
  for (const layoutModule of layoutModules) {
11157
- mergedMetadata = _chunkOXSIH4D6cjs.mergeMetadata.call(void 0, mergedMetadata, layoutModule.metadata);
11196
+ mergedMetadata = _chunkKNPRCKXKcjs.mergeMetadata.call(void 0, mergedMetadata, layoutModule.metadata);
11158
11197
  if (typeof layoutModule.generateMetadata === "function") {
11159
- mergedMetadata = _chunkOXSIH4D6cjs.mergeMetadata.call(void 0,
11198
+ mergedMetadata = _chunkKNPRCKXKcjs.mergeMetadata.call(void 0,
11160
11199
  mergedMetadata,
11161
11200
  await layoutModule.generateMetadata({ params: routeProps.params })
11162
11201
  );
11163
11202
  }
11164
11203
  }
11165
- mergedMetadata = _chunkOXSIH4D6cjs.mergeMetadata.call(void 0, mergedMetadata, routeModule.metadata);
11204
+ mergedMetadata = _chunkKNPRCKXKcjs.mergeMetadata.call(void 0, mergedMetadata, routeModule.metadata);
11166
11205
  if (typeof routeModule.generateMetadata === "function") {
11167
- mergedMetadata = _chunkOXSIH4D6cjs.mergeMetadata.call(void 0,
11206
+ mergedMetadata = _chunkKNPRCKXKcjs.mergeMetadata.call(void 0,
11168
11207
  mergedMetadata,
11169
11208
  await routeModule.generateMetadata(routeProps)
11170
11209
  );
11171
11210
  }
11172
- mergedMetadata = _chunkOXSIH4D6cjs.addMetadataMarkdownAlternate.call(void 0,
11211
+ mergedMetadata = _chunkKNPRCKXKcjs.addMetadataMarkdownAlternate.call(void 0,
11173
11212
  mergedMetadata,
11174
- _chunkTWGMSEHXcjs.getFarmMarkdownAlternatePath.call(void 0, farmApp.getConfig().md, targetRequestUrl.pathname)
11213
+ _chunkBBVSJVBZcjs.getFarmMarkdownAlternatePath.call(void 0, farmApp.getConfig().md, targetRequestUrl.pathname)
11175
11214
  );
11176
11215
  const routeSlots = await Promise.all(
11177
11216
  slots.map(async (slot) => {
@@ -11227,7 +11266,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11227
11266
  pageShouldHydrate: shouldHydrate,
11228
11267
  layoutShouldHydrate: shouldHydrateLayout,
11229
11268
  islandStrategy: hydrationIslandStrategy,
11230
- rendering: _chunkWZMNW2IWcjs.resolveRouteRenderingConfig.call(void 0, routeModule)
11269
+ rendering: _chunkXFFQSD2Fcjs.resolveRouteRenderingConfig.call(void 0, routeModule)
11231
11270
  });
11232
11271
  const destinationLayoutPatterns = layouts.map((layout) => layout.pattern);
11233
11272
  const layoutStartIndex = getSharedLayoutPrefixLength(
@@ -11241,7 +11280,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11241
11280
  middlewareContext,
11242
11281
  () => renderer.renderNavigationFragment({
11243
11282
  PageComponent: routeModule.default,
11244
- LoadingComponent: _optionalChain([loadingModule, 'optionalAccess', _577 => _577.default]),
11283
+ LoadingComponent: _optionalChain([loadingModule, 'optionalAccess', _581 => _581.default]),
11245
11284
  pageProps: routeProps,
11246
11285
  params,
11247
11286
  layouts: layouts.map((layout, index) => ({
@@ -11347,14 +11386,14 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11347
11386
  trustProxy: currentServerConfig.trustProxy
11348
11387
  }).pathname;
11349
11388
  const routeManager2 = farmApp.getRouteManager();
11350
- const hasBeforeRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _578 => _578.hasHook, 'call', _579 => _579("beforeRouteMatch")]), () => ( false));
11351
- const hasAfterRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _580 => _580.hasHook, 'call', _581 => _581("afterRouteMatch")]), () => ( false));
11352
- const hasBeforeRequestHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _582 => _582.hasHook, 'call', _583 => _583("beforeRequest")]), () => ( false));
11353
- const hasBeforeRenderHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _584 => _584.hasHook, 'call', _585 => _585("beforeRender")]), () => ( false));
11354
- const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _586 => _586.hasHook, 'call', _587 => _587("afterResponse")]), () => ( false));
11355
- const hasHTMLTransformHook = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _588 => _588.hasHook, 'call', _589 => _589("transformHTML")]), () => ( false))) || (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _590 => _590.hasHook, 'call', _591 => _591("afterRender")]), () => ( false)));
11356
- const hasRuntimeRequestHooks = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _592 => _592.hasRuntimeRequestHooks, 'call', _593 => _593()]), () => ( false));
11357
- const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _594 => _594.hasRuntimeHook, 'call', _595 => _595("after")]), () => ( false));
11389
+ const hasBeforeRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _582 => _582.hasHook, 'call', _583 => _583("beforeRouteMatch")]), () => ( false));
11390
+ const hasAfterRouteMatchHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _584 => _584.hasHook, 'call', _585 => _585("afterRouteMatch")]), () => ( false));
11391
+ const hasBeforeRequestHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _586 => _586.hasHook, 'call', _587 => _587("beforeRequest")]), () => ( false));
11392
+ const hasBeforeRenderHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _588 => _588.hasHook, 'call', _589 => _589("beforeRender")]), () => ( false));
11393
+ const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _590 => _590.hasHook, 'call', _591 => _591("afterResponse")]), () => ( false));
11394
+ const hasHTMLTransformHook = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _592 => _592.hasHook, 'call', _593 => _593("transformHTML")]), () => ( false))) || (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _594 => _594.hasHook, 'call', _595 => _595("afterRender")]), () => ( false)));
11395
+ const hasRuntimeRequestHooks = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _596 => _596.hasRuntimeRequestHooks, 'call', _597 => _597()]), () => ( false));
11396
+ const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _598 => _598.hasRuntimeHook, 'call', _599 => _599("after")]), () => ( false));
11358
11397
  const requestedMatch = routeManager2.matchRoute(requestedPathname);
11359
11398
  let runtimeSession;
11360
11399
  if (pm && hasRuntimeRequestHooks) {
@@ -11365,8 +11404,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11365
11404
  kind: "page",
11366
11405
  route: {
11367
11406
  pathname: requestedPathname,
11368
- pattern: _optionalChain([requestedMatch, 'optionalAccess', _596 => _596.route, 'optionalAccess', _597 => _597.pattern]) || null,
11369
- params: _optionalChain([requestedMatch, 'optionalAccess', _598 => _598.params]) || {}
11407
+ pattern: _optionalChain([requestedMatch, 'optionalAccess', _600 => _600.route, 'optionalAccess', _601 => _601.pattern]) || null,
11408
+ params: _optionalChain([requestedMatch, 'optionalAccess', _602 => _602.params]) || {}
11370
11409
  }
11371
11410
  }
11372
11411
  );
@@ -11399,17 +11438,17 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11399
11438
  if (pm && hasAfterRouteMatchHook) {
11400
11439
  await pm.runHookParallel("afterRouteMatch", {
11401
11440
  pathname,
11402
- matched: !!_optionalChain([routeMatch, 'optionalAccess', _599 => _599.route]),
11403
- routePattern: _optionalChain([routeMatch, 'optionalAccess', _600 => _600.route, 'optionalAccess', _601 => _601.pattern]) || null,
11404
- params: _optionalChain([routeMatch, 'optionalAccess', _602 => _602.params]) || {},
11405
- layoutPatterns: (_optionalChain([routeMatch, 'optionalAccess', _603 => _603.layouts]) || []).map((l) => l.pattern)
11441
+ matched: !!_optionalChain([routeMatch, 'optionalAccess', _603 => _603.route]),
11442
+ routePattern: _optionalChain([routeMatch, 'optionalAccess', _604 => _604.route, 'optionalAccess', _605 => _605.pattern]) || null,
11443
+ params: _optionalChain([routeMatch, 'optionalAccess', _606 => _606.params]) || {},
11444
+ layoutPatterns: (_optionalChain([routeMatch, 'optionalAccess', _607 => _607.layouts]) || []).map((l) => l.pattern)
11406
11445
  });
11407
11446
  }
11408
11447
  const renderPayload = {
11409
11448
  pathname,
11410
11449
  method,
11411
- routePattern: _optionalChain([routeMatch, 'optionalAccess', _604 => _604.route, 'optionalAccess', _605 => _605.pattern]) || null,
11412
- params: _optionalChain([routeMatch, 'optionalAccess', _606 => _606.params]) || {}
11450
+ routePattern: _optionalChain([routeMatch, 'optionalAccess', _608 => _608.route, 'optionalAccess', _609 => _609.pattern]) || null,
11451
+ params: _optionalChain([routeMatch, 'optionalAccess', _610 => _610.params]) || {}
11413
11452
  };
11414
11453
  const shouldInterceptResponse = Boolean(
11415
11454
  pm && (hasAfterResponseHook || hasHTMLTransformHook || runtimeSession && hasRuntimeAfterHook)
@@ -11431,7 +11470,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11431
11470
  emitError: /* @__PURE__ */ _chunkS3JO3N4Hcjs.__name.call(void 0, (error) => emitPluginError("response-end", error, { pathname }), "emitError")
11432
11471
  }) : void 0;
11433
11472
  try {
11434
- if (_optionalChain([middlewareManager, 'optionalAccess', _607 => _607.hasMiddleware, 'call', _608 => _608()])) {
11473
+ if (_optionalChain([middlewareManager, 'optionalAccess', _611 => _611.hasMiddleware, 'call', _612 => _612()])) {
11435
11474
  const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
11436
11475
  const handled = await runFarmMiddlewareWithNavigation(
11437
11476
  farmApp.getServerRenderer(),
@@ -11441,7 +11480,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11441
11480
  () => middlewareManager.execute(req, res)
11442
11481
  );
11443
11482
  if (handled) {
11444
- if (!_optionalChain([responseInterceptor, 'optionalAccess', _609 => _609.isEnded, 'call', _610 => _610()])) {
11483
+ if (!_optionalChain([responseInterceptor, 'optionalAccess', _613 => _613.isEnded, 'call', _614 => _614()])) {
11445
11484
  const duration = Date.now() - startTime;
11446
11485
  logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
11447
11486
  }
@@ -11453,7 +11492,7 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11453
11492
  req.url || "/",
11454
11493
  `http://${req.headers.host || "localhost:3000"}`
11455
11494
  ).pathname;
11456
- const hasLocalPageRoute = Boolean(_optionalChain([routeManager2, 'access', _611 => _611.matchRoute, 'call', _612 => _612(currentPathname), 'optionalAccess', _613 => _613.route]));
11495
+ const hasLocalPageRoute = Boolean(_optionalChain([routeManager2, 'access', _615 => _615.matchRoute, 'call', _616 => _616(currentPathname), 'optionalAccess', _617 => _617.route]));
11457
11496
  await pm.runHookParallelFiltered(
11458
11497
  "beforeRequest",
11459
11498
  (plugin) => !hasLocalPageRoute || plugin.name !== _chunkYZTASLPQcjs.FARM_CONFIG_REWRITES_PLUGIN_NAME,
@@ -11461,8 +11500,8 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11461
11500
  res
11462
11501
  );
11463
11502
  }
11464
- if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess', _614 => _614.isEnded, 'call', _615 => _615()])) {
11465
- if (!_optionalChain([responseInterceptor, 'optionalAccess', _616 => _616.isEnded, 'call', _617 => _617()])) {
11503
+ if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess', _618 => _618.isEnded, 'call', _619 => _619()])) {
11504
+ if (!_optionalChain([responseInterceptor, 'optionalAccess', _620 => _620.isEnded, 'call', _621 => _621()])) {
11466
11505
  const duration = Date.now() - startTime;
11467
11506
  logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
11468
11507
  }
@@ -11520,25 +11559,25 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11520
11559
  if (imageModule) return imageModule;
11521
11560
  }
11522
11561
  if (_chunk6V4TDWECcjs.parseProgrammaticRouteModuleId.call(void 0, id)) {
11523
- const renderer = _optionalChain([farmApp, 'optionalAccess', _618 => _618.getConfig, 'call', _619 => _619(), 'access', _620 => _620.renderer]) || _chunkTFAXUHWXcjs.resolveFarmRenderer.call(void 0, options.renderer);
11524
- return generateProgrammaticRouteModule(id, _optionalChain([server, 'optionalAccess', _621 => _621.config, 'access', _622 => _622.root]) || options.root, renderer);
11562
+ const renderer = _optionalChain([farmApp, 'optionalAccess', _622 => _622.getConfig, 'call', _623 => _623(), 'access', _624 => _624.renderer]) || _chunkTFAXUHWXcjs.resolveFarmRenderer.call(void 0, options.renderer);
11563
+ return generateProgrammaticRouteModule(id, _optionalChain([server, 'optionalAccess', _625 => _625.config, 'access', _626 => _626.root]) || options.root, renderer);
11525
11564
  }
11526
11565
  if (isFarmClientVirtualId(id)) {
11527
- const resolvedConfig = _optionalChain([farmApp, 'optionalAccess', _623 => _623.getConfig, 'call', _624 => _624()]);
11528
- const renderer = _optionalChain([resolvedConfig, 'optionalAccess', _625 => _625.renderer]) || _chunkTFAXUHWXcjs.resolveFarmRenderer.call(void 0, options.renderer);
11529
- const integrations = _optionalChain([resolvedConfig, 'optionalAccess', _626 => _626.integrations]) || options.integrations;
11530
- const root = _optionalChain([resolvedConfig, 'optionalAccess', _627 => _627.root]) || _optionalChain([server, 'optionalAccess', _628 => _628.config, 'access', _629 => _629.root]) || process.cwd();
11531
- const docs = _optionalChain([resolvedConfig, 'optionalAccess', _630 => _630.docs]);
11566
+ const resolvedConfig = _optionalChain([farmApp, 'optionalAccess', _627 => _627.getConfig, 'call', _628 => _628()]);
11567
+ const renderer = _optionalChain([resolvedConfig, 'optionalAccess', _629 => _629.renderer]) || _chunkTFAXUHWXcjs.resolveFarmRenderer.call(void 0, options.renderer);
11568
+ const integrations = _optionalChain([resolvedConfig, 'optionalAccess', _630 => _630.integrations]) || options.integrations;
11569
+ const root = _optionalChain([resolvedConfig, 'optionalAccess', _631 => _631.root]) || _optionalChain([server, 'optionalAccess', _632 => _632.config, 'access', _633 => _633.root]) || process.cwd();
11570
+ const docs = _optionalChain([resolvedConfig, 'optionalAccess', _634 => _634.docs]);
11532
11571
  const adapterOwnsDocsRuntime = Boolean(
11533
- _chunkTFAXUHWXcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([docs, 'optionalAccess', _631 => _631.adapter, 'optionalAccess', _632 => _632.server]) && docs.adapter.react
11572
+ _chunkTFAXUHWXcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([docs, 'optionalAccess', _635 => _635.adapter, 'optionalAccess', _636 => _636.server]) && docs.adapter.react
11534
11573
  );
11535
- const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _633 => _633.devtools]), () => ( _chunkYJRZR7VUcjs.resolveFarmDevtoolsConfig.call(void 0, false, "production")));
11574
+ const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _637 => _637.devtools]), () => ( _chunkYJRZR7VUcjs.resolveFarmDevtoolsConfig.call(void 0, false, "production")));
11536
11575
  const [docsRuntime, docsSearchRuntime, devtoolsClientRuntime] = await Promise.all([
11537
- _optionalChain([docs, 'optionalAccess', _634 => _634.enabled]) ? loadFarmDocsDevRuntime() : null,
11538
- _optionalChain([docs, 'optionalAccess', _635 => _635.enabled]) && !adapterOwnsDocsRuntime ? loadFarmDocsSearchDevRuntime() : null,
11576
+ _optionalChain([docs, 'optionalAccess', _638 => _638.enabled]) ? loadFarmDocsDevRuntime() : null,
11577
+ _optionalChain([docs, 'optionalAccess', _639 => _639.enabled]) && !adapterOwnsDocsRuntime ? loadFarmDocsSearchDevRuntime() : null,
11539
11578
  devtools.enabled ? loadFarmDevtoolsClientRuntime() : null
11540
11579
  ]);
11541
- const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess', _636 => _636.isFarmDocsSearchEnabled, 'call', _637 => _637(docs)]), () => ( false));
11580
+ const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess', _640 => _640.isFarmDocsSearchEnabled, 'call', _641 => _641(docs)]), () => ( false));
11542
11581
  const generatedDocsSearchRuntime = docsSearchRuntime ? docsSearchRuntime.generateFarmDocsSearchClientRuntime(
11543
11582
  docsSearchEnabled,
11544
11583
  docsSearchEnabled ? docsSearchRuntime.resolveFarmDocsSearchClientModule(root) : void 0
@@ -11547,9 +11586,9 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11547
11586
  const generatedDevIndicatorsClientRuntime = farmApp ? _chunkQBPXNZGVcjs.generateFarmDevIndicatorsClientRuntime.call(void 0, farmApp.getConfig().devIndicators) : "";
11548
11587
  const integrationProviders = _chunkTFAXUHWXcjs.isReactRenderer.call(void 0, renderer) ? _chunkZ5HIWVDPcjs.getIntegrationProviders.call(void 0, integrations) : [];
11549
11588
  const isolatedHydrationMode = resolveFarmIsolatedClientHydrationMode(
11550
- _optionalChain([resolvedConfig, 'optionalAccess', _638 => _638.experimental, 'optionalAccess', _639 => _639.isolatedClientHydration]),
11589
+ _optionalChain([resolvedConfig, 'optionalAccess', _642 => _642.experimental, 'optionalAccess', _643 => _643.isolatedClientHydration]),
11551
11590
  {
11552
- serverComponents: _optionalChain([resolvedConfig, 'optionalAccess', _640 => _640.experimental, 'optionalAccess', _641 => _641.serverComponents]) === true,
11591
+ serverComponents: _optionalChain([resolvedConfig, 'optionalAccess', _644 => _644.experimental, 'optionalAccess', _645 => _645.serverComponents]) === true,
11553
11592
  hasUnsupportedIntegrationProvider: integrationProviders.filter((provider) => provider.component || provider.type === "clerk").some((provider) => provider.supportsIsolatedHydration !== true)
11554
11593
  }
11555
11594
  );
@@ -11557,30 +11596,31 @@ window.__FARM_MANIFEST__ = ${inlineValue({
11557
11596
  integrationProviders,
11558
11597
  [
11559
11598
  ..._chunkZ5HIWVDPcjs.getIntegrationDocumentNavigationMatchers.call(void 0, integrations),
11560
- ..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess', _642 => _642.getFarmDocsDocumentNavigationMatchers, 'call', _643 => _643(docs)]), () => ( []))
11599
+ ..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess', _646 => _646.getFarmDocsDocumentNavigationMatchers, 'call', _647 => _647(docs)]), () => ( []))
11561
11600
  ],
11562
11601
  generatedDocsSearchRuntime,
11563
11602
  `${generatedDevtoolsClientRuntime}
11564
11603
  ${generatedDevIndicatorsClientRuntime}`,
11565
- _optionalChain([resolvedConfig, 'optionalAccess', _644 => _644.plugins]) || [],
11604
+ _optionalChain([resolvedConfig, 'optionalAccess', _648 => _648.plugins]) || [],
11566
11605
  root,
11567
- _optionalChain([resolvedConfig, 'optionalAccess', _645 => _645.srcDir]) || options.srcDir || "src",
11568
- _optionalChain([resolvedConfig, 'optionalAccess', _646 => _646.publicRuntimeConfig]) || options.publicRuntimeConfig,
11569
- _chunkTFAXUHWXcjs.isReactRenderer.call(void 0, renderer) ? _optionalChain([docs, 'optionalAccess', _647 => _647.adapter, 'optionalAccess', _648 => _648.react]) : void 0,
11606
+ _optionalChain([resolvedConfig, 'optionalAccess', _649 => _649.srcDir]) || options.srcDir || "src",
11607
+ _optionalChain([resolvedConfig, 'optionalAccess', _650 => _650.publicRuntimeConfig]) || options.publicRuntimeConfig,
11608
+ _chunkTFAXUHWXcjs.isReactRenderer.call(void 0, renderer) ? _optionalChain([docs, 'optionalAccess', _651 => _651.adapter, 'optionalAccess', _652 => _652.react]) : void 0,
11570
11609
  renderer,
11571
- isolatedHydrationMode === "enabled" || _chunkTFAXUHWXcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([(_nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _649 => _649.getRouteManager, 'call', _650 => _650(), 'access', _651 => _651.getIsolatedClientBoundaryModules, 'call', _652 => _652(root)])))), 'optionalAccess', _653 => _653.size]) > 0,
11572
- _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _654 => _654.trailingSlash]), () => ( false)),
11573
- _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _655 => _655.basePath]), () => ( "/")),
11610
+ isolatedHydrationMode === "enabled" || _chunkTFAXUHWXcjs.isReactRenderer.call(void 0, renderer) && _optionalChain([(_nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _653 => _653.getRouteManager, 'call', _654 => _654(), 'access', _655 => _655.getIsolatedClientBoundaryModules, 'call', _656 => _656(root)])))), 'optionalAccess', _657 => _657.size]) > 0,
11611
+ _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _658 => _658.trailingSlash]), () => ( false)),
11612
+ _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _659 => _659.basePath]), () => ( "/")),
11574
11613
  generateClientCachePersistenceCode(
11575
- resolveFarmClientCacheAdapterEntry(root, _optionalChain([resolvedConfig, 'optionalAccess', _656 => _656.cache]))
11576
- )
11614
+ resolveFarmClientCacheAdapterEntry(root, _optionalChain([resolvedConfig, 'optionalAccess', _660 => _660.cache]))
11615
+ ),
11616
+ _chunkTFAXUHWXcjs.isReactRenderer.call(void 0, renderer) ? _chunk75WGQVQAcjs.getFarmDocsAdapterConfigModule.call(void 0, docs) : void 0
11577
11617
  );
11578
11618
  }
11579
11619
  if (id === "/@farm/server") {
11580
11620
  return generateServerCode();
11581
11621
  }
11582
11622
  if (id === "/@farm/manifest") {
11583
- const routeManager = _optionalChain([farmApp, 'optionalAccess', _657 => _657.getRouteManager, 'call', _658 => _658()]);
11623
+ const routeManager = _optionalChain([farmApp, 'optionalAccess', _661 => _661.getRouteManager, 'call', _662 => _662()]);
11584
11624
  if (!routeManager) {
11585
11625
  return `
11586
11626
  export const getManifest = () => ({
@@ -11595,7 +11635,7 @@ export const getManifest = () => ({
11595
11635
  const manifest = routeManager.generateClientManifest(server.config.root);
11596
11636
  const globalStylesheetHref = resolveDevGlobalStylesheetHref(
11597
11637
  server.config.root,
11598
- _optionalChain([farmApp, 'optionalAccess', _659 => _659.getConfig, 'call', _660 => _660(), 'access', _661 => _661.srcDir])
11638
+ _optionalChain([farmApp, 'optionalAccess', _663 => _663.getConfig, 'call', _664 => _664(), 'access', _665 => _665.srcDir])
11599
11639
  );
11600
11640
  const fullManifest = {
11601
11641
  clientEntry: "/@farm/client.js",
@@ -11646,17 +11686,17 @@ export const manifest = getManifest();
11646
11686
  }
11647
11687
  },
11648
11688
  async transform(code, id, transformOptions) {
11649
- if (!_optionalChain([transformOptions, 'optionalAccess', _662 => _662.ssr])) {
11650
- const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _663 => _663.getConfig, 'call', _664 => _664()]), () => ( options));
11651
- if (_optionalChain([currentConfig, 'access', _665 => _665.experimental, 'optionalAccess', _666 => _666.serverActions]) !== true) {
11689
+ if (!_optionalChain([transformOptions, 'optionalAccess', _666 => _666.ssr])) {
11690
+ const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _667 => _667.getConfig, 'call', _668 => _668()]), () => ( options));
11691
+ if (_optionalChain([currentConfig, 'access', _669 => _669.experimental, 'optionalAccess', _670 => _670.serverActions]) !== true) {
11652
11692
  const violation = findClientServerFnViolation(code, id);
11653
11693
  if (violation) {
11654
11694
  this.error(formatServerFnBoundaryError(violation, id));
11655
11695
  }
11656
11696
  }
11657
11697
  }
11658
- if (!_optionalChain([transformOptions, 'optionalAccess', _667 => _667.ssr]) && shouldInspectClientBoundary(id, code)) {
11659
- warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _668 => _668.getConfig, 'call', _669 => _669()]), () => ( options)));
11698
+ if (!_optionalChain([transformOptions, 'optionalAccess', _671 => _671.ssr]) && shouldInspectClientBoundary(id, code)) {
11699
+ warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _672 => _672.getConfig, 'call', _673 => _673()]), () => ( options)));
11660
11700
  }
11661
11701
  if (typeof imageImports.transform === "function") {
11662
11702
  const imageModule = await imageImports.transform.call(this, code, id, transformOptions);
@@ -11671,13 +11711,13 @@ export const manifest = getManifest();
11671
11711
  id,
11672
11712
  transformOptions
11673
11713
  );
11674
- const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess', _670 => _670.code, 'optionalAccess', _671 => _671.toString, 'call', _672 => _672()]);
11714
+ const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess', _674 => _674.code, 'optionalAccess', _675 => _675.toString, 'call', _676 => _676()]);
11675
11715
  if (fontCode) {
11676
11716
  transformedCode = fontCode;
11677
11717
  transformed = true;
11678
11718
  }
11679
11719
  }
11680
- if (_optionalChain([transformOptions, 'optionalAccess', _673 => _673.ssr]) && server) {
11720
+ if (_optionalChain([transformOptions, 'optionalAccess', _677 => _677.ssr]) && server) {
11681
11721
  const rewrittenImports = rewriteEarlySsrRelativeImports({
11682
11722
  code: transformedCode,
11683
11723
  id,
@@ -11697,12 +11737,12 @@ export const manifest = getManifest();
11697
11737
  }
11698
11738
  transformedCode = stripUseClientDirective(transformedCode);
11699
11739
  transformed = true;
11700
- const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _674 => _674.getConfig, 'call', _675 => _675()]), () => ( options));
11740
+ const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _678 => _678.getConfig, 'call', _679 => _679()]), () => ( options));
11701
11741
  let isolatedModuleReference = null;
11702
- const root = currentConfig.root || _optionalChain([server, 'optionalAccess', _676 => _676.config, 'access', _677 => _677.root]) || process.cwd();
11742
+ const root = currentConfig.root || _optionalChain([server, 'optionalAccess', _680 => _680.config, 'access', _681 => _681.root]) || process.cwd();
11703
11743
  const cleanId = id.split("?", 1)[0];
11704
- const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _678 => _678.getRouteManager, 'call', _679 => _679(), 'access', _680 => _680.getIsolatedClientBoundaryModules, 'call', _681 => _681(root)])));
11705
- const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess', _682 => _682.has, 'call', _683 => _683(path16.resolve(cleanId))]) === true;
11744
+ const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _682 => _682.getRouteManager, 'call', _683 => _683(), 'access', _684 => _684.getIsolatedClientBoundaryModules, 'call', _685 => _685(root)])));
11745
+ const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess', _686 => _686.has, 'call', _687 => _687(path16.resolve(cleanId))]) === true;
11706
11746
  if (_chunkTFAXUHWXcjs.isReactRenderer.call(void 0, _chunkTFAXUHWXcjs.resolveFarmRenderer.call(void 0, currentConfig.renderer)) && selectedForIsolatedHydration && isIsolatableClientBoundarySource(clientBoundarySource)) {
11707
11747
  isolatedModuleReference = _chunk5QIKR7RRcjs.toViteModuleId.call(void 0, cleanId, root);
11708
11748
  const transformedBoundary = transformIsolatedClientBoundaryModule({
@@ -11739,7 +11779,7 @@ export const manifest = getManifest();
11739
11779
  );
11740
11780
  return;
11741
11781
  }` : "";
11742
- const hmrCode = !shouldEmitFarmClientRootHmr(currentConfig.renderer) ? "" : `
11782
+ const hmrCode = _optionalChain([transformOptions, 'optionalAccess', _688 => _688.ssr]) || !shouldEmitFarmClientRootHmr(currentConfig.renderer) ? "" : `
11743
11783
  if (import.meta.hot) {
11744
11784
  import.meta.hot.accept((newModule) => {
11745
11785
  ${isolatedHmrUpdate}
@@ -11793,14 +11833,14 @@ if (import.meta.hot) {
11793
11833
  }
11794
11834
  _chunk5QIKR7RRcjs.logger.info(`Found ${ssgPages.length} SSG pages, ${ssrRoutes.length} SSR routes`);
11795
11835
  _chunk5QIKR7RRcjs.logger.info("Pre-rendering SSG pages...");
11796
- const outDir = path16.join(_optionalChain([server, 'optionalAccess', _684 => _684.config, 'access', _685 => _685.root]) || process.cwd(), options.outDir || "dist");
11836
+ const outDir = path16.join(_optionalChain([server, 'optionalAccess', _689 => _689.config, 'access', _690 => _690.root]) || process.cwd(), options.outDir || "dist");
11797
11837
  const clientDir = path16.join(outDir, "client");
11798
11838
  for (const page of ssgPages) {
11799
11839
  try {
11800
11840
  const staticRequest = new Request(new URL(page.urlPath, "http://farm.static"));
11801
11841
  await farmApp.getServerRenderer().runWithRequestContext(staticRequest, async () => {
11802
11842
  const mod = await routeManager.loadRouteModule(page.filePath);
11803
- if (!_optionalChain([mod, 'optionalAccess', _686 => _686.default])) return;
11843
+ if (!_optionalChain([mod, 'optionalAccess', _691 => _691.default])) return;
11804
11844
  const { layouts } = routeManager.matchRoute(page.urlPath);
11805
11845
  const layoutModules = await Promise.all(
11806
11846
  layouts.map((l) => routeManager.loadLayoutModule(l.modulePath))
@@ -11832,7 +11872,7 @@ if (import.meta.hot) {
11832
11872
  const i18nSnapshot = _chunkUJ2C4ICScjs.getFarmI18nClientSnapshot.call(void 0, );
11833
11873
  const i18nHead = renderFarmI18nStaticHead(page.urlPath, i18nSnapshot);
11834
11874
  const fullHtml = `<!DOCTYPE html>
11835
- <html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess', _687 => _687.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}>
11875
+ <html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess', _692 => _692.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}>
11836
11876
  <head>
11837
11877
  <meta charset="utf-8">
11838
11878
  <meta name="viewport" content="width=device-width, initial-scale=1">
@@ -11890,13 +11930,13 @@ if (import.meta.hot) {
11890
11930
  });
11891
11931
  }
11892
11932
  }
11893
- const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess', _688 => _688.getConfig, 'call', _689 => _689()]);
11933
+ const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess', _693 => _693.getConfig, 'call', _694 => _694()]);
11894
11934
  const normalizedFile = file.replace(/\\/g, "/");
11895
11935
  if (currentFarmConfig && /\/route\.(?:ts|tsx|js|jsx)$/.test(normalizedFile) && _chunkY4YMF2NQcjs.getFarmAppDirectories.call(void 0, currentFarmConfig).some(
11896
11936
  (appDir) => normalizedFile.startsWith(`${_chunk5QIKR7RRcjs.toPosixPath.call(void 0, appDir)}/api/`)
11897
11937
  )) {
11898
11938
  for (const mod of modules) server2.moduleGraph.invalidateModule(mod);
11899
- await _optionalChain([refreshRouteDiscovery, 'optionalCall', _690 => _690(`updated ${file}`)]);
11939
+ await _optionalChain([refreshRouteDiscovery, 'optionalCall', _695 => _695(`updated ${file}`)]);
11900
11940
  server2.ws.send({ type: "full-reload", path: "*" });
11901
11941
  return [];
11902
11942
  }
@@ -11906,7 +11946,7 @@ if (import.meta.hot) {
11906
11946
  for (const mod of modules) {
11907
11947
  server2.moduleGraph.invalidateModule(mod);
11908
11948
  }
11909
- await _optionalChain([refreshRouteDiscovery, 'optionalCall', _691 => _691(`updated ${file}`)]);
11949
+ await _optionalChain([refreshRouteDiscovery, 'optionalCall', _696 => _696(`updated ${file}`)]);
11910
11950
  server2.ws.send({
11911
11951
  type: "full-reload",
11912
11952
  path: "*"
@@ -11919,17 +11959,17 @@ if (import.meta.hot) {
11919
11959
  for (const mod of modules) {
11920
11960
  server2.moduleGraph.invalidateModule(mod);
11921
11961
  }
11922
- await _optionalChain([refreshRouteDiscovery, 'optionalCall', _692 => _692(`updated ${file}`)]);
11962
+ await _optionalChain([refreshRouteDiscovery, 'optionalCall', _697 => _697(`updated ${file}`)]);
11923
11963
  server2.ws.send({
11924
11964
  type: "full-reload",
11925
11965
  path: "*"
11926
11966
  });
11927
11967
  return [];
11928
11968
  }
11929
- const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess', _693 => _693.experimental, 'optionalAccess', _694 => _694.isolatedClientHydration]);
11930
- const planRouteManager = _optionalChain([farmApp, 'optionalAccess', _695 => _695.getRouteManager, 'call', _696 => _696()]);
11969
+ const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess', _698 => _698.experimental, 'optionalAccess', _699 => _699.isolatedClientHydration]);
11970
+ const planRouteManager = _optionalChain([farmApp, 'optionalAccess', _700 => _700.getRouteManager, 'call', _701 => _701()]);
11931
11971
  const isHydrationPlanSource = currentSrcRoot !== null && normalizedFile.startsWith(`${currentSrcRoot}/`) && /\.[cm]?[jt]sx?$/.test(normalizedFile);
11932
- const tracksAsyncOwnerIslands = _chunkTFAXUHWXcjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess', _697 => _697.renderer])) && planRouteManager !== void 0;
11972
+ const tracksAsyncOwnerIslands = _chunkTFAXUHWXcjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess', _702 => _702.renderer])) && planRouteManager !== void 0;
11933
11973
  if (isHydrationPlanSource && (isolatedHydrationMode === "enabled" || isolatedHydrationMode === "analyze" || tracksAsyncOwnerIslands)) {
11934
11974
  const routeManager = planRouteManager;
11935
11975
  if (routeManager) {
@@ -11989,7 +12029,7 @@ if (import.meta.hot) {
11989
12029
  }
11990
12030
  return [];
11991
12031
  }
11992
- _optionalChain([farmApp, 'optionalAccess', _698 => _698.getRouteManager, 'call', _699 => _699(), 'access', _700 => _700.invalidateClientManifest, 'call', _701 => _701()]);
12032
+ _optionalChain([farmApp, 'optionalAccess', _703 => _703.getRouteManager, 'call', _704 => _704(), 'access', _705 => _705.invalidateClientManifest, 'call', _706 => _706()]);
11993
12033
  const manifestModule = server2.moduleGraph.getModuleById("/@farm/manifest");
11994
12034
  if (manifestModule) {
11995
12035
  server2.moduleGraph.invalidateModule(manifestModule);
@@ -12038,7 +12078,7 @@ function resolveDevelopmentRoot(farmRoot, viteRoot) {
12038
12078
  if (fs9.realpathSync(farmRoot) === fs9.realpathSync(viteRoot)) {
12039
12079
  return path16.resolve(viteRoot);
12040
12080
  }
12041
- } catch (e28) {
12081
+ } catch (e30) {
12042
12082
  }
12043
12083
  return farmRoot;
12044
12084
  }
@@ -12358,12 +12398,12 @@ async function parseRouteModuleProps2(routeModule, input) {
12358
12398
  }
12359
12399
  const schemas = routeModule.__farmRouteSchemas;
12360
12400
  const params = parseRouteModuleSchema2(
12361
- _optionalChain([schemas, 'optionalAccess', _702 => _702.params]),
12401
+ _optionalChain([schemas, 'optionalAccess', _707 => _707.params]),
12362
12402
  input.props.params,
12363
12403
  "params",
12364
12404
  input.routePath
12365
12405
  );
12366
- const search = parseRouteModuleSchema2(_optionalChain([schemas, 'optionalAccess', _703 => _703.search]), input.search, "search", input.routePath);
12406
+ const search = parseRouteModuleSchema2(_optionalChain([schemas, 'optionalAccess', _708 => _708.search]), input.search, "search", input.routePath);
12367
12407
  return {
12368
12408
  ...input.props,
12369
12409
  params,
@@ -12384,7 +12424,7 @@ function parseRouteModuleSchema2(schema, value, label, routePath) {
12384
12424
  }
12385
12425
  }
12386
12426
  _chunkS3JO3N4Hcjs.__name.call(void 0, parseRouteModuleSchema2, "parseRouteModuleSchema");
12387
- function generateClientCode(integrationProviders = [], documentNavigationMatchers = [], docsSearchClientRuntime = EMPTY_FARM_DOCS_SEARCH_CLIENT_RUNTIME, devtoolsClientRuntime = "", plugins = [], root = process.cwd(), srcDir = "src", publicRuntimeConfig = void 0, docsAdapterReact, renderer = _chunkTFAXUHWXcjs.REACT_RENDERER, isolatedHydrationEnabled = false, trailingSlash = false, basePath = "/", clientCachePersistence = { imports: "", init: "" }) {
12427
+ function generateClientCode(integrationProviders = [], documentNavigationMatchers = [], docsSearchClientRuntime = EMPTY_FARM_DOCS_SEARCH_CLIENT_RUNTIME, devtoolsClientRuntime = "", plugins = [], root = process.cwd(), srcDir = "src", publicRuntimeConfig = void 0, docsAdapterReact, renderer = _chunkTFAXUHWXcjs.REACT_RENDERER, isolatedHydrationEnabled = false, trailingSlash = false, basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule) {
12388
12428
  const providerClientCode = generateFarmIntegrationProviderClientCode(
12389
12429
  integrationProviders,
12390
12430
  root,
@@ -12399,7 +12439,10 @@ function generateClientCode(integrationProviders = [], documentNavigationMatcher
12399
12439
  const rendererClientImports = _chunkTFAXUHWXcjs.isReactRenderer.call(void 0, renderer) ? `import React from 'react'
12400
12440
  import { hydrateRoot, createRoot } from 'react-dom/client'` : `import React, { hydrateRoot, createRoot } from ${JSON.stringify(renderer.client)}`;
12401
12441
  const isolatedHydrationImport = isolatedHydrationEnabled ? `import { createFarmIsolatedHydrationRuntime, createFarmServerPageBoundary, wrapFarmIsolatedClientGraph } from '@farm.js/core/internal/isolated-boundary'` : "";
12402
- const docsAdapterImportBlock = generateFarmDocsAdapterClientRuntime(docsAdapterReact);
12442
+ const docsAdapterImportBlock = _chunk75WGQVQAcjs.generateFarmDocsAdapterClientRuntime.call(void 0,
12443
+ docsAdapterReact,
12444
+ docsConfigModule
12445
+ );
12403
12446
  const isolatedHydrationRuntime = isolatedHydrationEnabled ? `const farmIsolatedHydrationRuntime = createFarmIsolatedHydrationRuntime({
12404
12447
  ReactRuntime: React,
12405
12448
  hydrateRoot,
@@ -13953,7 +13996,7 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, generateClientManifest, "generateClientMan
13953
13996
  async function defineConfig(config = {}) {
13954
13997
  const tailwindcss = (await import("@tailwindcss/vite")).default;
13955
13998
  const appRoot = path16.resolve(config.root || process.cwd());
13956
- if (_optionalChain([config, 'access', _704 => _704.extends, 'optionalAccess', _705 => _705.length])) {
13999
+ if (_optionalChain([config, 'access', _709 => _709.extends, 'optionalAccess', _710 => _710.length])) {
13957
14000
  const { config: layeredConfig } = await import("./layers-E4WPJNY5.cjs").then(
13958
14001
  ({ resolveFarmLayers }) => resolveFarmLayers(config, {
13959
14002
  root: appRoot,
@@ -14053,13 +14096,13 @@ async function defineConfig(config = {}) {
14053
14096
  if (!serverStarted) {
14054
14097
  serverStarted = true;
14055
14098
  const elapsed = Date.now() - startTime;
14056
- const address = _optionalChain([server, 'access', _706 => _706.httpServer, 'optionalAccess', _707 => _707.address, 'call', _708 => _708()]);
14099
+ const address = _optionalChain([server, 'access', _711 => _711.httpServer, 'optionalAccess', _712 => _712.address, 'call', _713 => _713()]);
14057
14100
  const resolvedPort = typeof address === "object" && address ? address.port : server.config.server.port || port || 3e3;
14058
14101
  const hostConfig = server.config.server.host;
14059
14102
  const isExposed = hostConfig === true || hostConfig === "0.0.0.0";
14060
14103
  console.log("");
14061
14104
  console.log(
14062
- ` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${_chunkNWOD6NITcjs.FARM_VERSION}`)} ${pc.dim(`ready in ${elapsed}ms`)}`
14105
+ ` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${_chunkA7T6JZNIcjs.FARM_VERSION}`)} ${pc.dim(`ready in ${elapsed}ms`)}`
14063
14106
  );
14064
14107
  console.log("");
14065
14108
  console.log(
@@ -14210,5 +14253,4 @@ _chunkS3JO3N4Hcjs.__name.call(void 0, defineConfig, "defineConfig");
14210
14253
 
14211
14254
 
14212
14255
 
14213
-
14214
- exports.getFarmClientHydrationPlanOptions = getFarmClientHydrationPlanOptions; exports.describeSuppressedAsyncHydration = describeSuppressedAsyncHydration; exports.resolveFarmIsolatedClientHydrationMode = resolveFarmIsolatedClientHydrationMode; exports.getClientModuleMetadata = getClientModuleMetadata; exports.getClientModuleHydrationPlan = getClientModuleHydrationPlan; exports.createMarkdownPageHydrationPlanner = createMarkdownPageHydrationPlanner; exports.enforceFarmIsolatedHydrationRouteBudget = enforceFarmIsolatedHydrationRouteBudget; exports.RouteManager = RouteManager; exports.resolveFarmNotFoundComponentPath = resolveFarmNotFoundComponentPath; exports.farmFontImportsPlugin = farmFontImportsPlugin; exports.mergeFarmFontCss = mergeFarmFontCss; exports.DEFAULT_NOT_FOUND_STYLES = DEFAULT_NOT_FOUND_STYLES; exports.generateFarmIntegrationProviderClientCode = generateFarmIntegrationProviderClientCode; exports.generateFarmIntegrationProviderServerModules = generateFarmIntegrationProviderServerModules; exports.ServerRenderer = ServerRenderer; exports.FarmApp = FarmApp; exports.createFarmApp = createFarmApp; exports.FarmPluginOptionsError = FarmPluginOptionsError; exports.farmPluginMayAffectRuntimePath = farmPluginMayAffectRuntimePath; exports.generateFarmClientPluginEntryCode = generateFarmClientPluginEntryCode; exports.resolveFarmClientCacheAdapterEntry = resolveFarmClientCacheAdapterEntry; exports.generateClientCachePersistenceCode = generateClientCachePersistenceCode; exports.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE = FARM_LAYOUT_ELEMENT_CLIENT_SOURCE; exports.createFarmClientOptimizeDepsEntries = createFarmClientOptimizeDepsEntries; exports.createFarmClientOptimizeDepsConfig = createFarmClientOptimizeDepsConfig; exports.createFarmSourceAlias = createFarmSourceAlias; exports.mergeFarmViteConfig = mergeFarmViteConfig; exports.mergeFarmProductionViteConfig = mergeFarmProductionViteConfig; exports.generateFarmDocsAdapterClientRuntime = generateFarmDocsAdapterClientRuntime; exports.createFarmThemeCssPlugin = createFarmThemeCssPlugin; exports.farmI18nClientBridgePlugin = farmI18nClientBridgePlugin; exports.farmServerOnlyEntriesPlugin = farmServerOnlyEntriesPlugin; exports.withFarmRequestTracing = withFarmRequestTracing; exports.rewriteEarlySsrRelativeImports = rewriteEarlySsrRelativeImports; exports.transformIsolatedClientBoundaryModule = transformIsolatedClientBoundaryModule; exports.shouldEmitFarmClientRootHmr = shouldEmitFarmClientRootHmr; exports.farmPlugin = farmPlugin; exports.defineConfig = defineConfig; exports.FARM_NODE_RESPONSE_END_PENDING = FARM_NODE_RESPONSE_END_PENDING; exports.FarmRuntimeShutdownError = FarmRuntimeShutdownError; exports.PluginManager = PluginManager; exports.definePlugin = definePlugin;
14256
+ exports.getFarmClientHydrationPlanOptions = getFarmClientHydrationPlanOptions; exports.describeSuppressedAsyncHydration = describeSuppressedAsyncHydration; exports.resolveFarmIsolatedClientHydrationMode = resolveFarmIsolatedClientHydrationMode; exports.getClientModuleMetadata = getClientModuleMetadata; exports.getClientModuleHydrationPlan = getClientModuleHydrationPlan; exports.createMarkdownPageHydrationPlanner = createMarkdownPageHydrationPlanner; exports.enforceFarmIsolatedHydrationRouteBudget = enforceFarmIsolatedHydrationRouteBudget; exports.RouteManager = RouteManager; exports.resolveFarmNotFoundComponentPath = resolveFarmNotFoundComponentPath; exports.farmFontImportsPlugin = farmFontImportsPlugin; exports.mergeFarmFontCss = mergeFarmFontCss; exports.DEFAULT_NOT_FOUND_STYLES = DEFAULT_NOT_FOUND_STYLES; exports.generateFarmIntegrationProviderClientCode = generateFarmIntegrationProviderClientCode; exports.generateFarmIntegrationProviderServerModules = generateFarmIntegrationProviderServerModules; exports.ServerRenderer = ServerRenderer; exports.FarmApp = FarmApp; exports.createFarmApp = createFarmApp; exports.FarmPluginOptionsError = FarmPluginOptionsError; exports.farmPluginMayAffectRuntimePath = farmPluginMayAffectRuntimePath; exports.generateFarmClientPluginEntryCode = generateFarmClientPluginEntryCode; exports.resolveFarmClientCacheAdapterEntry = resolveFarmClientCacheAdapterEntry; exports.generateClientCachePersistenceCode = generateClientCachePersistenceCode; exports.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE = FARM_LAYOUT_ELEMENT_CLIENT_SOURCE; exports.createFarmClientOptimizeDepsEntries = createFarmClientOptimizeDepsEntries; exports.createFarmClientOptimizeDepsConfig = createFarmClientOptimizeDepsConfig; exports.createFarmSourceAlias = createFarmSourceAlias; exports.mergeFarmViteConfig = mergeFarmViteConfig; exports.mergeFarmProductionViteConfig = mergeFarmProductionViteConfig; exports.createFarmThemeCssPlugin = createFarmThemeCssPlugin; exports.farmI18nClientBridgePlugin = farmI18nClientBridgePlugin; exports.farmServerOnlyEntriesPlugin = farmServerOnlyEntriesPlugin; exports.withFarmRequestTracing = withFarmRequestTracing; exports.rewriteEarlySsrRelativeImports = rewriteEarlySsrRelativeImports; exports.transformIsolatedClientBoundaryModule = transformIsolatedClientBoundaryModule; exports.shouldEmitFarmClientRootHmr = shouldEmitFarmClientRootHmr; exports.farmPlugin = farmPlugin; exports.defineConfig = defineConfig; exports.FARM_NODE_RESPONSE_END_PENDING = FARM_NODE_RESPONSE_END_PENDING; exports.FarmRuntimeShutdownError = FarmRuntimeShutdownError; exports.PluginManager = PluginManager; exports.definePlugin = definePlugin;