@farm.js/core 0.2.2 → 0.2.4

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 (199) hide show
  1. package/dist/{agent-mcp.d-gI3ahrF6.d.mts → agent-mcp.d-CaJJsAVy.d.mts} +1 -1
  2. package/dist/{agent-mcp.d-DuZjglYX.d.ts → agent-mcp.d-klsG_XKS.d.ts} +1 -1
  3. package/dist/agent-runtime.d.mts +1 -1
  4. package/dist/agent-runtime.d.ts +1 -1
  5. package/dist/{analyzer-UXWYUTBK.mjs → analyzer-CY7BS4GB.mjs} +2 -2
  6. package/dist/analyzer-KHCOL6JF.cjs +17 -0
  7. package/dist/api/node.d.mts +3 -3
  8. package/dist/api/node.d.ts +3 -3
  9. package/dist/api/route-manager.cjs +4 -4
  10. package/dist/api/route-manager.d.mts +3 -3
  11. package/dist/api/route-manager.d.ts +3 -3
  12. package/dist/api/route-manager.mjs +3 -3
  13. package/dist/api/runtime.d.mts +2 -2
  14. package/dist/api/runtime.d.ts +2 -2
  15. package/dist/api.cjs +5 -5
  16. package/dist/api.d.mts +4 -4
  17. package/dist/api.d.ts +4 -4
  18. package/dist/api.mjs +4 -4
  19. package/dist/{app-manifest.d-bHK9EGPI.d.mts → app-manifest.d-BIdn8Whr.d.mts} +1 -1
  20. package/dist/{app-manifest.d-B3h89j6a.d.ts → app-manifest.d-DkIbmExG.d.ts} +1 -1
  21. package/dist/app-markdown.d.mts +2 -2
  22. package/dist/app-markdown.d.ts +2 -2
  23. package/dist/{app.d-C3uyET_L.d.ts → app.d-DhZ61V9X.d.ts} +8 -5
  24. package/dist/{app.d-Cr7fXGvJ.d.mts → app.d-DnqxbvCI.d.mts} +8 -5
  25. package/dist/{chunk-YOVSWY2E.mjs → chunk-2XDRRAAD.mjs} +1 -1
  26. package/dist/{chunk-2T4GGCQT.cjs → chunk-6UBGXEIH.cjs} +2 -2
  27. package/dist/{chunk-BEAQVRMQ.cjs → chunk-76ES7BCO.cjs} +80 -75
  28. package/dist/{chunk-TK2JJCP5.mjs → chunk-7FNKBP3J.mjs} +186 -29
  29. package/dist/{chunk-ST3U7XVO.mjs → chunk-7IM2MKRK.mjs} +1 -1
  30. package/dist/{chunk-GL4SPJTE.cjs → chunk-7Q6KUXH6.cjs} +58 -27
  31. package/dist/{chunk-5CG2UD6B.cjs → chunk-AMSX2U4D.cjs} +304 -7
  32. package/dist/{chunk-NPR6SCEV.mjs → chunk-AOSZIHL7.mjs} +1 -1
  33. package/dist/chunk-APVJJCMB.mjs +547 -0
  34. package/dist/{chunk-LQZXCSYG.mjs → chunk-B6K2ZM3C.mjs} +5 -3
  35. package/dist/{chunk-IEXZMDF4.mjs → chunk-BCIUG6EQ.mjs} +2 -2
  36. package/dist/{chunk-JCERO6YF.mjs → chunk-BUIZTM3Q.mjs} +1 -1
  37. package/dist/{chunk-SJQ24IB5.cjs → chunk-BY5VQ57W.cjs} +11 -11
  38. package/dist/{chunk-GKDOKES3.mjs → chunk-CQ5LVPBL.mjs} +1 -1
  39. package/dist/{chunk-Q4FHYBFT.cjs → chunk-CSCORWIQ.cjs} +11 -11
  40. package/dist/{chunk-6VMBLDWY.mjs → chunk-CV7C75LN.mjs} +1 -1
  41. package/dist/{chunk-CZMMU3FP.mjs → chunk-D4DAL7KK.mjs} +35 -4
  42. package/dist/{chunk-ZVT2F3JU.mjs → chunk-DR65XXXD.mjs} +2 -2
  43. package/dist/{chunk-PRKFECGT.cjs → chunk-DZWX7FDX.cjs} +6 -4
  44. package/dist/{chunk-A4AYTO2E.cjs → chunk-EZRB5N6S.cjs} +1 -1
  45. package/dist/{chunk-B7CZ7T2I.cjs → chunk-JEJXSTYR.cjs} +2 -2
  46. package/dist/{chunk-56F4CDKE.cjs → chunk-JRPCCBGL.cjs} +449 -291
  47. package/dist/{chunk-JM5VSEYC.cjs → chunk-KHTDVXXR.cjs} +2 -2
  48. package/dist/{chunk-PYPHM7AS.cjs → chunk-LH7S7FI3.cjs} +5 -1
  49. package/dist/{chunk-ZND5D4IC.cjs → chunk-LJZZDRD5.cjs} +363 -326
  50. package/dist/{chunk-WXPY5FRF.cjs → chunk-P2PF5FUW.cjs} +2 -2
  51. package/dist/{chunk-CPL7WIMP.mjs → chunk-P3UT3OLV.mjs} +2 -2
  52. package/dist/{chunk-PZ5ZJAAO.mjs → chunk-POCWXRXW.mjs} +1 -1
  53. package/dist/{chunk-L7Z6OAE2.cjs → chunk-PVR63WHW.cjs} +4 -4
  54. package/dist/{chunk-Z23OCU33.cjs → chunk-RF3VCNV7.cjs} +6 -6
  55. package/dist/{chunk-5AOARZJT.cjs → chunk-T2VXOAC3.cjs} +4 -4
  56. package/dist/{chunk-FEWGKBMM.mjs → chunk-UIBCPZFO.mjs} +85 -48
  57. package/dist/{chunk-MYJPW4XN.mjs → chunk-UKGAP2OK.mjs} +3 -3
  58. package/dist/{chunk-DZXD6CYJ.mjs → chunk-V2RXBDV6.mjs} +4 -0
  59. package/dist/{chunk-ALGAGXWB.mjs → chunk-XEOIZ4QC.mjs} +1 -1
  60. package/dist/{chunk-D2VLHRBN.cjs → chunk-Y3MTKPLN.cjs} +4 -4
  61. package/dist/{chunk-FDS6U2NT.cjs → chunk-Y7FLPQSL.cjs} +3 -3
  62. package/dist/{chunk-MEXGQE4T.mjs → chunk-YR7ZI57S.mjs} +17 -12
  63. package/dist/{client-component.d-BavTzqsn.d.ts → client-component.d-BHE9Ns8s.d.ts} +1 -1
  64. package/dist/{client-component.d-X3j9FOZ2.d.mts → client-component.d-uya-qDZu.d.mts} +1 -1
  65. package/dist/{client-plugins.d-DnnAopKG.d.mts → client-plugins.d-CqFAvu-W.d.mts} +38 -1
  66. package/dist/{client-plugins.d-CqTr5IrQ.d.ts → client-plugins.d-Dp89a9Gf.d.ts} +38 -1
  67. package/dist/client-plugins.d.mts +1 -1
  68. package/dist/client-plugins.d.ts +1 -1
  69. package/dist/client.d.mts +7 -7
  70. package/dist/client.d.ts +7 -7
  71. package/dist/config.d.mts +1 -1
  72. package/dist/config.d.ts +1 -1
  73. package/dist/desktop.d.mts +2 -2
  74. package/dist/desktop.d.ts +2 -2
  75. package/dist/{devtools-RFVGDHXH.mjs → devtools-CRZCFRRL.mjs} +1 -1
  76. package/dist/{devtools-4LMM3DDJ.cjs → devtools-ZHYYPMZ3.cjs} +2 -2
  77. package/dist/docs.cjs +3 -3
  78. package/dist/docs.d.mts +3 -3
  79. package/dist/docs.d.ts +3 -3
  80. package/dist/docs.mjs +2 -2
  81. package/dist/environment/vite.cjs +4 -4
  82. package/dist/environment/vite.mjs +3 -3
  83. package/dist/{handler.d-BSlpYCDB.d.mts → handler.d-BgJGywnq.d.mts} +1 -1
  84. package/dist/{handler.d-DgX7gPO6.d.ts → handler.d-DHxaRQr7.d.ts} +1 -1
  85. package/dist/{headers.d-CmxW42R2.d.ts → headers.d-DVm2BMtR.d.ts} +1 -1
  86. package/dist/{headers.d-Cf8l5LMo.d.mts → headers.d-QrzpChrN.d.mts} +1 -1
  87. package/dist/index.cjs +19 -19
  88. package/dist/{index.d-BZZt7kxO.d.ts → index.d-B8lXhfTs.d.ts} +1 -1
  89. package/dist/{index.d-7xoJqKRZ.d.mts → index.d-Bpu1TV0-.d.mts} +1 -1
  90. package/dist/index.d.mts +22 -22
  91. package/dist/index.d.ts +22 -22
  92. package/dist/index.mjs +18 -18
  93. package/dist/integrations/orm.d.mts +1 -1
  94. package/dist/integrations/orm.d.ts +1 -1
  95. package/dist/integrations.d.mts +1 -1
  96. package/dist/integrations.d.ts +1 -1
  97. package/dist/internal/app-markdown-runtime.d.mts +2 -2
  98. package/dist/internal/app-markdown-runtime.d.ts +2 -2
  99. package/dist/internal/build-runtime.cjs +18 -18
  100. package/dist/internal/build-runtime.d.mts +4 -4
  101. package/dist/internal/build-runtime.d.ts +4 -4
  102. package/dist/internal/build-runtime.mjs +17 -17
  103. package/dist/internal/cli-runtime.cjs +7 -7
  104. package/dist/internal/cli-runtime.d.mts +7 -7
  105. package/dist/internal/cli-runtime.d.ts +7 -7
  106. package/dist/internal/cli-runtime.mjs +6 -6
  107. package/dist/internal/client-error-overlay.cjs +4 -4
  108. package/dist/internal/client-error-overlay.mjs +1 -1
  109. package/dist/internal/client-runtime.d.mts +5 -5
  110. package/dist/internal/client-runtime.d.ts +5 -5
  111. package/dist/internal/compression-runtime.d.mts +1 -1
  112. package/dist/internal/compression-runtime.d.ts +1 -1
  113. package/dist/internal/config-runtime.cjs +3 -3
  114. package/dist/internal/config-runtime.d.mts +3 -3
  115. package/dist/internal/config-runtime.d.ts +3 -3
  116. package/dist/internal/config-runtime.mjs +2 -2
  117. package/dist/internal/infra-analytics-runtime.cjs +6 -6
  118. package/dist/internal/infra-analytics-runtime.mjs +4 -4
  119. package/dist/internal/native-server-fns.cjs +4 -4
  120. package/dist/internal/native-server-fns.mjs +3 -3
  121. package/dist/internal/product-telemetry-runtime.cjs +3 -3
  122. package/dist/internal/product-telemetry-runtime.mjs +2 -2
  123. package/dist/internal/production-runtime.cjs +4 -4
  124. package/dist/internal/production-runtime.d.mts +10 -10
  125. package/dist/internal/production-runtime.d.ts +10 -10
  126. package/dist/internal/production-runtime.mjs +3 -3
  127. package/dist/internal/spa-router.d.mts +3 -3
  128. package/dist/internal/spa-router.d.ts +3 -3
  129. package/dist/internal/start-manifest.d.mts +1 -1
  130. package/dist/internal/start-manifest.d.ts +1 -1
  131. package/dist/markdown.d.mts +1 -1
  132. package/dist/markdown.d.ts +1 -1
  133. package/dist/middleware.d.mts +1 -1
  134. package/dist/middleware.d.ts +1 -1
  135. package/dist/{mount.d-CD-xVBu7.d.ts → mount.d-Cw_75kb9.d.ts} +1 -1
  136. package/dist/{mount.d-Dd0xeRMl.d.mts → mount.d-CyfNKOHK.d.mts} +1 -1
  137. package/dist/{navigation-delegate.d-Bses_F-y.d.ts → navigation-delegate.d--imR0rY7.d.ts} +1 -1
  138. package/dist/{navigation-delegate.d-dBNg976E.d.mts → navigation-delegate.d-DVEtyGYw.d.mts} +1 -1
  139. package/dist/navigation.d.mts +4 -4
  140. package/dist/navigation.d.ts +4 -4
  141. package/dist/plugin.cjs +13 -13
  142. package/dist/plugin.d.mts +5 -5
  143. package/dist/plugin.d.ts +5 -5
  144. package/dist/plugin.mjs +12 -12
  145. package/dist/{render-plan.d-vOdZHHLI.d.mts → render-plan.d-CTehM6y8.d.mts} +1 -1
  146. package/dist/{render-plan.d-DaIwnRK2.d.ts → render-plan.d-DpxLd_1i.d.ts} +1 -1
  147. package/dist/renderer-client.d.mts +5 -5
  148. package/dist/renderer-client.d.ts +5 -5
  149. package/dist/{request.d-CgXp3EEc.d.ts → request.d-BFXzOr32.d.ts} +1 -1
  150. package/dist/{request.d-B8U4pVFP.d.mts → request.d-BmQzlKtT.d.mts} +1 -1
  151. package/dist/request.d.mts +2 -2
  152. package/dist/request.d.ts +2 -2
  153. package/dist/{route-rendering.d-Di0AxFix.d.ts → route-rendering.d-bEil1VkF.d.ts} +1 -1
  154. package/dist/{route-rendering.d-BQvNYQqu.d.mts → route-rendering.d-geg68qd0.d.mts} +1 -1
  155. package/dist/{router.d-BJVGhSAJ.d.ts → router.d-4OCT2ak5.d.ts} +1 -1
  156. package/dist/{router.d-hNedVdoB.d.mts → router.d-CQjEcNih.d.mts} +1 -1
  157. package/dist/routes.cjs +3 -3
  158. package/dist/routes.d.mts +1 -1
  159. package/dist/routes.d.ts +1 -1
  160. package/dist/routes.mjs +2 -2
  161. package/dist/{rsc-pipeline-NCJ3NIE5.mjs → rsc-pipeline-JISGZS6G.mjs} +2 -2
  162. package/dist/{rsc-pipeline-HT4G3QGT.cjs → rsc-pipeline-R5W3PAAL.cjs} +3 -3
  163. package/dist/{runtime-6UF5XKUP.cjs → runtime-HSTND4FF.cjs} +8 -8
  164. package/dist/{runtime-VHXIEXL7.mjs → runtime-I2SBIB2Q.mjs} +5 -5
  165. package/dist/{runtime.d-0R8nHCM6.d.ts → runtime.d-BKoa6J55.d.ts} +1 -1
  166. package/dist/{runtime.d-DpeuF_T-.d.mts → runtime.d-DjYo5E1n.d.mts} +1 -1
  167. package/dist/{schema-dependencies.d-_Wyey4Wv.d.mts → schema-dependencies.d-CGNgsyKS.d.mts} +1 -1
  168. package/dist/{schema-dependencies.d-tkUHREqz.d.ts → schema-dependencies.d-CRoN2Q9N.d.ts} +1 -1
  169. package/dist/{server-components-status.d-sN7ju-ie.d.mts → server-components-status.d-Crl3IonP.d.mts} +1 -1
  170. package/dist/{server-components-status.d-B2Z5WvO5.d.ts → server-components-status.d-CwfcQD6n.d.ts} +1 -1
  171. package/dist/server-plugins.d.mts +3 -3
  172. package/dist/server-plugins.d.ts +3 -3
  173. package/dist/server.cjs +34 -34
  174. package/dist/server.d.mts +11 -11
  175. package/dist/server.d.ts +11 -11
  176. package/dist/server.mjs +14 -14
  177. package/dist/{spa-router.d-MjT6sGb9.d.ts → spa-router.d-Bv-r3AAK.d.ts} +2 -2
  178. package/dist/{spa-router.d-D3AtR2Bc.d.mts → spa-router.d-DhO_PJHP.d.mts} +2 -2
  179. package/dist/{ssg.d-C1SNuPz5.d.ts → ssg.d-CzFOAkqy.d.mts} +13 -2
  180. package/dist/{ssg.d-B32Cp_XW.d.mts → ssg.d-SfEQfMsA.d.ts} +13 -2
  181. package/dist/{store-core.d-BZ3YXs70.d.ts → store-core.d-Ch0N8dni.d.ts} +2 -2
  182. package/dist/{store-core.d-BbVdaoA0.d.mts → store-core.d-pKJCUdTR.d.mts} +2 -2
  183. package/dist/testing.cjs +5 -5
  184. package/dist/testing.d.mts +1 -1
  185. package/dist/testing.d.ts +1 -1
  186. package/dist/testing.mjs +4 -4
  187. package/dist/{utils.d-Bjbm44fP.d.ts → utils.d-BaLODLrK.d.ts} +1 -1
  188. package/dist/{utils.d-CoLozp7-.d.mts → utils.d-TPjb_Q7w.d.mts} +1 -1
  189. package/dist/version.cjs +2 -2
  190. package/dist/version.mjs +1 -1
  191. package/dist/vite.cjs +13 -13
  192. package/dist/vite.d.mts +6 -6
  193. package/dist/vite.d.ts +6 -6
  194. package/dist/vite.mjs +12 -12
  195. package/package.json +2 -2
  196. package/dist/analyzer-ENHO4SA5.cjs +0 -17
  197. package/dist/chunk-Q4CPBKPT.mjs +0 -251
  198. /package/dist/{chunk-JL2HNLMC.mjs → chunk-3QC2XTCN.mjs} +0 -0
  199. /package/dist/{chunk-COXMHCIV.cjs → chunk-GDKJGL7D.cjs} +0 -0
@@ -44,7 +44,7 @@ var _chunk6QWCFVGLcjs = require('./chunk-6QWCFVGL.cjs');
44
44
 
45
45
 
46
46
 
47
- var _chunkBEAQVRMQcjs = require('./chunk-BEAQVRMQ.cjs');
47
+ var _chunk76ES7BCOcjs = require('./chunk-76ES7BCO.cjs');
48
48
 
49
49
 
50
50
 
@@ -59,10 +59,10 @@ var _chunk5B2Y4EVScjs = require('./chunk-5B2Y4EVS.cjs');
59
59
 
60
60
 
61
61
 
62
- var _chunkGL4SPJTEcjs = require('./chunk-GL4SPJTE.cjs');
62
+ var _chunk7Q6KUXH6cjs = require('./chunk-7Q6KUXH6.cjs');
63
63
 
64
64
 
65
- var _chunk5AOARZJTcjs = require('./chunk-5AOARZJT.cjs');
65
+ var _chunkT2VXOAC3cjs = require('./chunk-T2VXOAC3.cjs');
66
66
 
67
67
 
68
68
 
@@ -89,13 +89,13 @@ var _chunkXVD5Y6S4cjs = require('./chunk-XVD5Y6S4.cjs');
89
89
 
90
90
 
91
91
 
92
- var _chunkL7Z6OAE2cjs = require('./chunk-L7Z6OAE2.cjs');
92
+ var _chunkPVR63WHWcjs = require('./chunk-PVR63WHW.cjs');
93
93
 
94
94
 
95
95
  var _chunkR6GOH5CHcjs = require('./chunk-R6GOH5CH.cjs');
96
96
 
97
97
 
98
- var _chunk2T4GGCQTcjs = require('./chunk-2T4GGCQT.cjs');
98
+ var _chunk6UBGXEIHcjs = require('./chunk-6UBGXEIH.cjs');
99
99
 
100
100
 
101
101
 
@@ -148,7 +148,7 @@ var _chunkSIQPXYBBcjs = require('./chunk-SIQPXYBB.cjs');
148
148
 
149
149
 
150
150
 
151
- var _chunkSJQ24IB5cjs = require('./chunk-SJQ24IB5.cjs');
151
+ var _chunkBY5VQ57Wcjs = require('./chunk-BY5VQ57W.cjs');
152
152
 
153
153
 
154
154
 
@@ -253,7 +253,7 @@ var _chunkIVEV44O2cjs = require('./chunk-IVEV44O2.cjs');
253
253
  var _chunkKSRWTQ6Jcjs = require('./chunk-KSRWTQ6J.cjs');
254
254
 
255
255
 
256
- var _chunkD2VLHRBNcjs = require('./chunk-D2VLHRBN.cjs');
256
+ var _chunkY3MTKPLNcjs = require('./chunk-Y3MTKPLN.cjs');
257
257
 
258
258
 
259
259
 
@@ -278,7 +278,8 @@ var _chunk3ACTVXZGcjs = require('./chunk-3ACTVXZG.cjs');
278
278
 
279
279
 
280
280
 
281
- var _chunkPYPHM7AScjs = require('./chunk-PYPHM7AS.cjs');
281
+
282
+ var _chunkLH7S7FI3cjs = require('./chunk-LH7S7FI3.cjs');
282
283
 
283
284
 
284
285
  var _chunkCH2JX3CMcjs = require('./chunk-CH2JX3CM.cjs');
@@ -321,7 +322,7 @@ var _chunkK6LZMZNBcjs = require('./chunk-K6LZMZNB.cjs');
321
322
  var _chunkRFKPIAOFcjs = require('./chunk-RFKPIAOF.cjs');
322
323
 
323
324
 
324
- var _chunkA4AYTO2Ecjs = require('./chunk-A4AYTO2E.cjs');
325
+ var _chunkEZRB5N6Scjs = require('./chunk-EZRB5N6S.cjs');
325
326
 
326
327
 
327
328
  var _chunkG5KGLMPNcjs = require('./chunk-G5KGLMPN.cjs');
@@ -738,7 +739,7 @@ function findClientServerFnViolation(code, id) {
738
739
  return null;
739
740
  }
740
741
  function createServerFnBoundaryDiagnostic(violation, id, location) {
741
- return _chunkSJQ24IB5cjs.createFarmDiagnostic.call(void 0,
742
+ return _chunkBY5VQ57Wcjs.createFarmDiagnostic.call(void 0,
742
743
  "CLIENT_SERVER_FUNCTION",
743
744
  id,
744
745
  `${violation.factory} handlers run only on the server, but this module is bundled into the client, so the handler and its Node-only imports would run in the browser.`,
@@ -998,21 +999,21 @@ function readPropertyKey(property) {
998
999
  function createClientBoundaryDiagnostic(file, finding, location) {
999
1000
  switch (finding.kind) {
1000
1001
  case "server-env":
1001
- return _chunkSJQ24IB5cjs.createFarmDiagnostic.call(void 0,
1002
+ return _chunkBY5VQ57Wcjs.createFarmDiagnostic.call(void 0,
1002
1003
  "CLIENT_SERVER_ENV",
1003
1004
  file,
1004
1005
  `process.env.${finding.name} is read at module scope in a module compiled for the browser, where it is undefined.`,
1005
1006
  location
1006
1007
  );
1007
1008
  case "public-env":
1008
- return _chunkSJQ24IB5cjs.createFarmDiagnostic.call(void 0,
1009
+ return _chunkBY5VQ57Wcjs.createFarmDiagnostic.call(void 0,
1009
1010
  "CLIENT_PROCESS_ENV_PUBLIC",
1010
1011
  file,
1011
1012
  `process.env.${finding.name} is declared public, but process.env is not populated in the browser, so this module-scope read is undefined there.`,
1012
1013
  location
1013
1014
  );
1014
1015
  case "builtin":
1015
- return _chunkSJQ24IB5cjs.createFarmDiagnostic.call(void 0,
1016
+ return _chunkBY5VQ57Wcjs.createFarmDiagnostic.call(void 0,
1016
1017
  "CLIENT_NODE_BUILTIN",
1017
1018
  file,
1018
1019
  `"${finding.name}" is imported into a module compiled for the browser, which gets a stub whose exports without a Web API equivalent are undefined.`,
@@ -1319,7 +1320,7 @@ function loadFarmWorkflowsDevRuntime() {
1319
1320
  return import("./workflows.cjs");
1320
1321
  }
1321
1322
  function loadFarmDevtoolsSnapshotRuntime() {
1322
- return import("./devtools-4LMM3DDJ.cjs");
1323
+ return import("./devtools-ZHYYPMZ3.cjs");
1323
1324
  }
1324
1325
  function loadFarmDevtoolsUIRuntime() {
1325
1326
  return import("./devtools-ui-TPBPQEEB.cjs");
@@ -1369,16 +1370,16 @@ var FARM_SERVER_ONLY_PACKAGE_ID = "\0farm:server-only";
1369
1370
  var FARM_PLATFORM_ENTRY = "@farm.js/core/platform";
1370
1371
  var FARM_PLATFORM_CLIENT_ID = "\0farm:platform-client";
1371
1372
  var FARM_SERVER_ONLY_ENTRIES_RESOLVE_FILTER = [
1372
- _chunkBEAQVRMQcjs.exactIdPattern.call(void 0, [FARM_PLATFORM_ENTRY, SERVER_ONLY_PACKAGE, ...FARM_SERVER_ONLY_ENTRIES]),
1373
- new RegExp(`^${_chunkSJQ24IB5cjs.FARM_RESOLVE_FROM_PREFIX}`),
1373
+ _chunk76ES7BCOcjs.exactIdPattern.call(void 0, [FARM_PLATFORM_ENTRY, SERVER_ONLY_PACKAGE, ...FARM_SERVER_ONLY_ENTRIES]),
1374
+ new RegExp(`^${_chunkBY5VQ57Wcjs.FARM_RESOLVE_FROM_PREFIX}`),
1374
1375
  // What isBuiltin() accepts: `node:` ids and the builtin names, subpaths such as fs/promises
1375
1376
  // included.
1376
1377
  /^node:/,
1377
- _chunkBEAQVRMQcjs.exactIdPattern.call(void 0, _module.builtinModules)
1378
+ _chunk76ES7BCOcjs.exactIdPattern.call(void 0, _module.builtinModules)
1378
1379
  ];
1379
1380
  var FARM_SERVER_ONLY_ENTRIES_LOAD_FILTER = [
1380
- _chunkBEAQVRMQcjs.exactIdPattern.call(void 0, [FARM_SERVER_ONLY_PACKAGE_ID, FARM_PLATFORM_CLIENT_ID]),
1381
- new RegExp(`^${_chunkSJQ24IB5cjs.FARM_BROWSER_BUILTIN_PREFIX}`)
1381
+ _chunk76ES7BCOcjs.exactIdPattern.call(void 0, [FARM_SERVER_ONLY_PACKAGE_ID, FARM_PLATFORM_CLIENT_ID]),
1382
+ new RegExp(`^${_chunkBY5VQ57Wcjs.FARM_BROWSER_BUILTIN_PREFIX}`)
1382
1383
  ];
1383
1384
  function createFarmPlatformClientModule(platform) {
1384
1385
  return `export function platform() { return ${JSON.stringify(platform)}; }
@@ -1414,7 +1415,7 @@ function farmIslandContainersPlugin(config) {
1414
1415
  // without calling into JavaScript.
1415
1416
  filter: {
1416
1417
  id: { include: /\.[jt]sx(?:$|\?)/, exclude: /\/node_modules\// },
1417
- code: _chunkSJQ24IB5cjs.FARM_ISLAND_CONTAINER_TAG
1418
+ code: _chunkBY5VQ57Wcjs.FARM_ISLAND_CONTAINER_TAG
1418
1419
  },
1419
1420
  handler(code, id) {
1420
1421
  if (_chunkCYUTK4JPcjs.resolveFarmServerComponentsMode.call(void 0, _chunkCYUTK4JPcjs.readFarmServerComponentsConfig.call(void 0, config)) !== "islands") {
@@ -1423,20 +1424,20 @@ function farmIslandContainersPlugin(config) {
1423
1424
  if (id.startsWith("\0") || id.includes("/node_modules/") || !/\.[jt]sx(?:$|\?)/.test(id)) {
1424
1425
  return null;
1425
1426
  }
1426
- if (_chunkSJQ24IB5cjs.hasUseClientDirective.call(void 0, code)) return null;
1427
- if (!_chunkSJQ24IB5cjs.FARM_ISLAND_CONTAINER_TAG.test(code)) return null;
1427
+ if (_chunkBY5VQ57Wcjs.hasUseClientDirective.call(void 0, code)) return null;
1428
+ if (!_chunkBY5VQ57Wcjs.FARM_ISLAND_CONTAINER_TAG.test(code)) return null;
1428
1429
  const file = id.split("?", 1)[0];
1429
- const inspect = () => _chunkSJQ24IB5cjs.getFarmClientRenderingBindings.call(void 0, code, file, root);
1430
+ const inspect = () => _chunkBY5VQ57Wcjs.getFarmClientRenderingBindings.call(void 0, code, file, root);
1430
1431
  const bindings = farmApi ? farmApi.inspectPackages(inspect) : inspect();
1431
1432
  if (bindings.length === 0) return null;
1432
- const grown = _chunkSJQ24IB5cjs.wrapFarmIslandContainers.call(void 0, {
1433
+ const grown = _chunkBY5VQ57Wcjs.wrapFarmIslandContainers.call(void 0, {
1433
1434
  code,
1434
1435
  file,
1435
1436
  bindings,
1436
- reference: _chunkSJQ24IB5cjs.farmIslandContainerReferencePath.call(void 0, root)
1437
+ reference: _chunkBY5VQ57Wcjs.farmIslandContainerReferencePath.call(void 0, root)
1437
1438
  });
1438
1439
  if (grown === null) return null;
1439
- _chunkSJQ24IB5cjs.ensureFarmIslandContainerReference.call(void 0, root);
1440
+ _chunkBY5VQ57Wcjs.ensureFarmIslandContainerReference.call(void 0, root);
1440
1441
  return { code: grown, map: null };
1441
1442
  }
1442
1443
  }
@@ -1451,18 +1452,18 @@ function farmServerOnlyEntriesPlugin(options = {}) {
1451
1452
  config(config) {
1452
1453
  const appRoot = path6.resolve(_nullishCoalesce(config.root, () => ( process.cwd())));
1453
1454
  if (options.distDir) {
1454
- _chunkSJQ24IB5cjs.usePackageScanCacheFile.call(void 0,
1455
+ _chunkBY5VQ57Wcjs.usePackageScanCacheFile.call(void 0,
1455
1456
  path6.resolve(appRoot, options.distDir, "cache", "package-scans.json")
1456
1457
  );
1457
1458
  }
1458
- const bundledPackages = _chunkSJQ24IB5cjs.collectFarmServerBundledPackageInfo.call(void 0, appRoot);
1459
+ const bundledPackages = _chunkBY5VQ57Wcjs.collectFarmServerBundledPackageInfo.call(void 0, appRoot);
1459
1460
  const prebundle = options.prebundleServerPackages ? createFarmServerPrebundleConfig(bundledPackages) : {};
1460
- _chunkSJQ24IB5cjs.persistPackageScanCache.call(void 0, );
1461
+ _chunkBY5VQ57Wcjs.persistPackageScanCache.call(void 0, );
1461
1462
  return {
1462
1463
  optimizeDeps: {
1463
1464
  // A package that defines fonts is served unbundled, so Farm's font compiler sees it.
1464
1465
  exclude: bundledPackages.filter(({ fonts }) => fonts).map(({ name }) => name),
1465
- rolldownOptions: { plugins: [_chunkSJQ24IB5cjs.farmBrowserBuiltinsOptimizerPlugin.call(void 0, )] }
1466
+ rolldownOptions: { plugins: [_chunkBY5VQ57Wcjs.farmBrowserBuiltinsOptimizerPlugin.call(void 0, )] }
1466
1467
  },
1467
1468
  ssr: {
1468
1469
  noExternal: [
@@ -1488,8 +1489,8 @@ function farmServerOnlyEntriesPlugin(options = {}) {
1488
1489
  return FARM_SERVER_ONLY_PACKAGE_ID;
1489
1490
  }
1490
1491
  this.error(
1491
- _chunkSJQ24IB5cjs.formatFarmDiagnostic.call(void 0,
1492
- _chunkSJQ24IB5cjs.createFarmDiagnostic.call(void 0,
1492
+ _chunkBY5VQ57Wcjs.formatFarmDiagnostic.call(void 0,
1493
+ _chunkBY5VQ57Wcjs.createFarmDiagnostic.call(void 0,
1493
1494
  "CLIENT_SERVER_ONLY_IMPORT",
1494
1495
  _nullishCoalesce(importer, () => ( "<unknown module>")),
1495
1496
  `${importer ? "This module" : "A module"} imports "server-only", so it must not reach the browser, but client code imports it.`
@@ -1499,9 +1500,9 @@ function farmServerOnlyEntriesPlugin(options = {}) {
1499
1500
  );
1500
1501
  }
1501
1502
  if (!_optionalChain([options2, 'optionalAccess', _77 => _77.ssr]) && _module.isBuiltin.call(void 0, id)) {
1502
- return _chunkSJQ24IB5cjs.resolveFarmBrowserBuiltin.call(void 0, this, id, importer, options2);
1503
+ return _chunkBY5VQ57Wcjs.resolveFarmBrowserBuiltin.call(void 0, this, id, importer, options2);
1503
1504
  }
1504
- const resolveFrom = importer ? _chunkSJQ24IB5cjs.parseFarmResolveFrom.call(void 0, id, importer.split("?", 1)[0]) : null;
1505
+ const resolveFrom = importer ? _chunkBY5VQ57Wcjs.parseFarmResolveFrom.call(void 0, id, importer.split("?", 1)[0]) : null;
1505
1506
  if (resolveFrom) {
1506
1507
  const directory = path6.dirname(resolveFrom.importer);
1507
1508
  return this.resolve(resolveFrom.specifier, resolveFrom.importer, {
@@ -1518,8 +1519,8 @@ function farmServerOnlyEntriesPlugin(options = {}) {
1518
1519
  const importedBy = importer ? ` (imported by ${importer})` : "";
1519
1520
  if (!_optionalChain([options2, 'optionalAccess', _78 => _78.ssr])) {
1520
1521
  this.error(
1521
- _chunkSJQ24IB5cjs.formatFarmDiagnostic.call(void 0,
1522
- _chunkSJQ24IB5cjs.createFarmDiagnostic.call(void 0,
1522
+ _chunkBY5VQ57Wcjs.formatFarmDiagnostic.call(void 0,
1523
+ _chunkBY5VQ57Wcjs.createFarmDiagnostic.call(void 0,
1523
1524
  "CLIENT_SERVER_ONLY_ENTRY",
1524
1525
  _nullishCoalesce(importer, () => ( id)),
1525
1526
  `${id} is server-only and cannot be imported into client code.`
@@ -1544,7 +1545,7 @@ function farmServerOnlyEntriesPlugin(options = {}) {
1544
1545
  if (id === FARM_PLATFORM_CLIENT_ID) {
1545
1546
  return createFarmPlatformClientModule(_nullishCoalesce(options.platform, () => ( _chunk5B2Y4EVScjs.resolveFarmPlatform.call(void 0, ))));
1546
1547
  }
1547
- return _nullishCoalesce(_chunkSJQ24IB5cjs.loadFarmBrowserBuiltin.call(void 0, id), () => ( null));
1548
+ return _nullishCoalesce(_chunkBY5VQ57Wcjs.loadFarmBrowserBuiltin.call(void 0, id), () => ( null));
1548
1549
  }
1549
1550
  }
1550
1551
  };
@@ -2050,14 +2051,14 @@ function isResolvedEnvScope(value) {
2050
2051
  function isPotentialProgrammaticRouteSourceFile(normalizedFile, srcDirSlug) {
2051
2052
  return normalizedFile.startsWith(`${srcDirSlug}/`) && /\.(ts|tsx|js|jsx)$/.test(normalizedFile) && // A declaration file, including TypeScript's `.d.<ext>.ts` form such as a
2052
2053
  // Polyroute `route.d.rs.ts`, has no runtime code to register a route.
2053
- !/\.d(\.[^./]+)?\.ts$/.test(normalizedFile) && !normalizedFile.endsWith("/farm-routes.d.ts") && !normalizedFile.endsWith("/farm-env.d.ts") && !normalizedFile.endsWith("/lib/api.generated.ts");
2054
+ !/\.d(\.[^./]+)?\.ts$/.test(normalizedFile) && !normalizedFile.endsWith("/farm-routes.d.ts") && !normalizedFile.endsWith("/farm-env.d.ts") && !normalizedFile.endsWith("/lib/api.generated.ts") && !_chunkLH7S7FI3cjs.isTestSourceFile.call(void 0, normalizedFile.slice(srcDirSlug.length));
2054
2055
  }
2055
2056
  function fileContainsProgrammaticPageRoute(file) {
2056
2057
  if (!fs2.existsSync(file)) {
2057
2058
  return false;
2058
2059
  }
2059
2060
  try {
2060
- return _chunkPYPHM7AScjs.scanProgrammaticPagePaths.call(void 0, fs2.readFileSync(file, "utf8")).length > 0;
2061
+ return _chunkLH7S7FI3cjs.scanProgrammaticPagePaths.call(void 0, fs2.readFileSync(file, "utf8")).length > 0;
2061
2062
  } catch (e15) {
2062
2063
  return false;
2063
2064
  }
@@ -2160,7 +2161,7 @@ function transformIsolatedClientBoundaryModule(options) {
2160
2161
  return null;
2161
2162
  }
2162
2163
  const body = Array.isArray(ast.body) ? ast.body : [];
2163
- const everyExportIsComponent = options.code.includes(_chunkSJQ24IB5cjs.FARM_CLIENT_REFERENCE_PRAGMA) || options.moduleReference.includes(_chunkSJQ24IB5cjs.FARM_CLIENT_REFERENCE_DIRECTORY);
2164
+ const everyExportIsComponent = options.code.includes(_chunkBY5VQ57Wcjs.FARM_CLIENT_REFERENCE_PRAGMA) || options.moduleReference.includes(_chunkBY5VQ57Wcjs.FARM_CLIENT_REFERENCE_DIRECTORY);
2164
2165
  const replacements = [];
2165
2166
  const wrapperStatements = [];
2166
2167
  const originalEntries = [];
@@ -2315,16 +2316,16 @@ async function warnClientBoundaryOnce(context, id, code, config) {
2315
2316
  for (const finding of analyzeClientBoundary(program, publicKeys)) {
2316
2317
  if (finding.kind === "builtin" && !finding.name.startsWith("node:")) {
2317
2318
  const resolved = await context.resolve(finding.name, id).catch(() => null);
2318
- if (!_optionalChain([resolved, 'optionalAccess', _105 => _105.id, 'access', _106 => _106.startsWith, 'call', _107 => _107(_chunkSJQ24IB5cjs.FARM_BROWSER_BUILTIN_PREFIX)])) continue;
2319
+ if (!_optionalChain([resolved, 'optionalAccess', _105 => _105.id, 'access', _106 => _106.startsWith, 'call', _107 => _107(_chunkBY5VQ57Wcjs.FARM_BROWSER_BUILTIN_PREFIX)])) continue;
2319
2320
  }
2320
2321
  findings.push(finding);
2321
2322
  }
2322
2323
  if (findings.length === 0) return;
2323
2324
  warnedClientBoundaryIds.add(id);
2324
- const locate = _chunkSJQ24IB5cjs.createFarmSourceLocator.call(void 0, code, () => context.getCombinedSourcemap());
2325
+ const locate = _chunkBY5VQ57Wcjs.createFarmSourceLocator.call(void 0, code, () => context.getCombinedSourcemap());
2325
2326
  _chunk7ZDLE77Pcjs.logger.warn(
2326
2327
  findings.map(
2327
- (finding) => _chunkSJQ24IB5cjs.formatFarmDiagnostic.call(void 0,
2328
+ (finding) => _chunkBY5VQ57Wcjs.formatFarmDiagnostic.call(void 0,
2328
2329
  createClientBoundaryDiagnostic(id, finding, locate(finding.start)),
2329
2330
  config.root
2330
2331
  )
@@ -2395,12 +2396,12 @@ function hasFarmSourceAliasOverride(alias) {
2395
2396
  function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2396
2397
  const rendererDisabled = _chunkLEZJZX4Ccjs.isFarmRendererDisabled.call(void 0, options.renderer);
2397
2398
  const imageImports = farmImageImportsPlugin();
2398
- const fontImports = _chunkBEAQVRMQcjs.farmFontImportsPlugin.call(void 0, {
2399
+ const fontImports = _chunk76ES7BCOcjs.farmFontImportsPlugin.call(void 0, {
2399
2400
  root: options.root,
2400
2401
  basePath: options.basePath,
2401
2402
  publicDir: options.publicDir,
2402
2403
  // A production build never starts the app, so it reads the directories from these options.
2403
- isLayoutModule: (id) => _chunkBEAQVRMQcjs.isFarmLayoutModule.call(void 0, id, _chunkPFVNPOKNcjs.getFarmAppDirectories.call(void 0, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _110 => _110.getConfig, 'call', _111 => _111()]), () => ( options))))
2404
+ isLayoutModule: (id) => _chunk76ES7BCOcjs.isFarmLayoutModule.call(void 0, id, _chunkPFVNPOKNcjs.getFarmAppDirectories.call(void 0, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _110 => _110.getConfig, 'call', _111 => _111()]), () => ( options))))
2404
2405
  });
2405
2406
  let farmApp;
2406
2407
  const isFarmGeneratedOutput = (file) => {
@@ -2431,8 +2432,8 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2431
2432
  if (mdxComponents) files.add(mdxComponents);
2432
2433
  return files;
2433
2434
  };
2434
- const islxActionsMode = () => _chunkBEAQVRMQcjs.resolveFarmIslxActionsMode.call(void 0, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _117 => _117.getConfig, 'call', _118 => _118()]), () => ( options)));
2435
- const islandsServerFns = () => _chunkBEAQVRMQcjs.farmBrowserServerFnsEnabled.call(void 0, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _119 => _119.getConfig, 'call', _120 => _120()]), () => ( options)));
2435
+ const islxActionsMode = () => _chunk76ES7BCOcjs.resolveFarmIslxActionsMode.call(void 0, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _117 => _117.getConfig, 'call', _118 => _118()]), () => ( options)));
2436
+ const islandsServerFns = () => _chunk76ES7BCOcjs.farmBrowserServerFnsEnabled.call(void 0, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _119 => _119.getConfig, 'call', _120 => _120()]), () => ( options)));
2436
2437
  let reactRefreshActive = false;
2437
2438
  let server;
2438
2439
  let deferredGates;
@@ -2442,6 +2443,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2442
2443
  let openAPIManager = null;
2443
2444
  let middlewareManager;
2444
2445
  let refreshRouteDiscovery = null;
2446
+ let refreshFarmDocsConfig = null;
2445
2447
  const pendingRouteReloads = /* @__PURE__ */ new Set();
2446
2448
  let workflowHandler = null;
2447
2449
  let isBuild = false;
@@ -2462,7 +2464,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2462
2464
  console.log(log);
2463
2465
  };
2464
2466
  const getProgrammaticClientRoutes = () => _nullishCoalesce(options.programmaticClientRoutes, () => ( _optionalChain([farmApp, 'optionalAccess', _121 => _121.getRouteManager, 'call', _122 => _122(), 'access', _123 => _123.getProgrammaticClientRoutes, 'call', _124 => _124()])));
2465
- const inBuildPackageCache = _chunkSJQ24IB5cjs.bindPackageClientBoundaryCache.call(void 0, );
2467
+ const inBuildPackageCache = _chunkBY5VQ57Wcjs.bindPackageClientBoundaryCache.call(void 0, );
2466
2468
  const inspectPackages = (operation) => {
2467
2469
  const routeManager = _optionalChain([farmApp, 'optionalAccess', _125 => _125.getRouteManager, 'call', _126 => _126()]);
2468
2470
  return inBuildPackageCache(
@@ -2485,11 +2487,11 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2485
2487
  isBuild = configEnv.command === "build";
2486
2488
  const farmAliases = {
2487
2489
  ..._chunkPFVNPOKNcjs.getFarmLayerAliases.call(void 0, options.layers),
2488
- ...hasFarmSourceAliasOverride(_optionalChain([userConfig, 'access', _132 => _132.resolve, 'optionalAccess', _133 => _133.alias])) ? {} : _chunkBEAQVRMQcjs.createFarmSourceAlias.call(void 0, options.root || process.cwd(), options.srcDir)
2490
+ ...hasFarmSourceAliasOverride(_optionalChain([userConfig, 'access', _132 => _132.resolve, 'optionalAccess', _133 => _133.alias])) ? {} : _chunk76ES7BCOcjs.createFarmSourceAlias.call(void 0, options.root || process.cwd(), options.srcDir)
2489
2491
  };
2490
2492
  if (Object.keys(farmAliases).length > 0) {
2491
2493
  _nullishCoalesce(userConfig.resolve, () => ( (userConfig.resolve = {})));
2492
- userConfig.resolve.alias = _chunkBEAQVRMQcjs.mergeFarmViteAlias.call(void 0, farmAliases, userConfig.resolve.alias);
2494
+ userConfig.resolve.alias = _chunk76ES7BCOcjs.mergeFarmViteAlias.call(void 0, farmAliases, userConfig.resolve.alias);
2493
2495
  }
2494
2496
  const layerRoots = (_nullishCoalesce(options.layers, () => ( []))).map((layer) => layer.root);
2495
2497
  farmOwnsDevCors = !isBuild && _optionalChain([userConfig, 'access', _134 => _134.server, 'optionalAccess', _135 => _135.cors]) === void 0;
@@ -2537,11 +2539,12 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2537
2539
  }
2538
2540
  },
2539
2541
  async configureServer(viteServer) {
2540
- viteServer.middlewares.use(
2541
- createFarmDevPreviewGuard(viteServer, {
2542
+ viteServer.middlewares.stack.unshift({
2543
+ route: "",
2544
+ handle: createFarmDevPreviewGuard(viteServer, {
2542
2545
  getSourceRoots: () => _chunkPFVNPOKNcjs.getFarmSourceRoots.call(void 0, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _143 => _143.getConfig, 'call', _144 => _144()]), () => ( options)))
2543
2546
  })
2544
- );
2547
+ });
2545
2548
  if (typeof fontImports.configureServer === "function") {
2546
2549
  await fontImports.configureServer.call(this, viteServer);
2547
2550
  }
@@ -2563,7 +2566,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2563
2566
  } catch (e21) {
2564
2567
  }
2565
2568
  };
2566
- farmApp = new (0, _chunkBEAQVRMQcjs.FarmApp)(
2569
+ farmApp = new (0, _chunk76ES7BCOcjs.FarmApp)(
2567
2570
  {
2568
2571
  ...options,
2569
2572
  root: resolveDevelopmentRoot(options.root, server.config.root)
@@ -2571,7 +2574,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2571
2574
  server
2572
2575
  );
2573
2576
  farmApp.getRouteManager().usePackageClientBoundaryCacheFile(
2574
- _chunkSJQ24IB5cjs.resolvePackageClientBoundaryCacheFile.call(void 0,
2577
+ _chunkBY5VQ57Wcjs.resolvePackageClientBoundaryCacheFile.call(void 0,
2575
2578
  farmApp.getConfig().root,
2576
2579
  options.distDir || ".farm"
2577
2580
  )
@@ -2582,7 +2585,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2582
2585
  let farmAppPackages;
2583
2586
  if (_optionalChain([farmConfig, 'access', _157 => _157.agent, 'optionalAccess', _158 => _158.noindexPreviews])) {
2584
2587
  farmMiddlewares.use((_req, res, next) => {
2585
- if (_chunk2T4GGCQTcjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env)) {
2588
+ if (_chunk6UBGXEIHcjs.isFarmPreviewDeploymentEnvironment.call(void 0, process.env)) {
2586
2589
  res.setHeader("X-Robots-Tag", _chunkERSLQ4C7cjs.FARM_PREVIEW_ROBOTS_TAG);
2587
2590
  }
2588
2591
  next();
@@ -2590,7 +2593,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2590
2593
  }
2591
2594
  const apiServerBasePath = _chunkH5AC3XSEcjs.resolveFarmAPIServerBasePath.call(void 0, farmConfig.api);
2592
2595
  const devBuiltInRoutePaths = new Set(
2593
- _chunkL7Z6OAE2cjs.listFarmBuiltInRoutePaths.call(void 0, {
2596
+ _chunkPVR63WHWcjs.listFarmBuiltInRoutePaths.call(void 0, {
2594
2597
  agent: {
2595
2598
  apiCatalog: true,
2596
2599
  mcp: true,
@@ -2622,6 +2625,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2622
2625
  }
2623
2626
  const sourceRoots = _chunkPFVNPOKNcjs.getFarmSourceRoots.call(void 0, farmConfig);
2624
2627
  server.watcher.add(sourceRoots.map((source) => path6.join(source.root, source.srcDir)));
2628
+ server.watcher.add(farmConfig.layers.map((layer) => layer.root));
2625
2629
  if (farmConfig.i18n.enabled) {
2626
2630
  server.watcher.add(
2627
2631
  farmConfig.i18n.locales.map(
@@ -2641,7 +2645,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2641
2645
  const polyroute = _chunkYCGOQKVCcjs.hasPolyroutePlugin.call(void 0, server.config.plugins);
2642
2646
  const generateTypeArtifacts = async (reason, selection = ALL_TYPE_ARTIFACTS, log = false) => {
2643
2647
  try {
2644
- const result = await _chunkGL4SPJTEcjs.generateFarmTypeArtifacts.call(void 0, {
2648
+ const result = await _chunk7Q6KUXH6cjs.generateFarmTypeArtifacts.call(void 0, {
2645
2649
  root: farmConfig.root,
2646
2650
  srcDir: farmConfig.srcDir,
2647
2651
  layers: farmConfig.layers,
@@ -2706,7 +2710,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2706
2710
  };
2707
2711
  const isProgrammaticRouteFile = (file) => {
2708
2712
  const normalized = file.replace(/\\/g, "/");
2709
- return srcDirSlugs.some((srcDir) => normalized.startsWith(`${srcDir}/`)) && _chunkPYPHM7AScjs.isProgrammaticRoutesFileName.call(void 0, normalized);
2713
+ return srcDirSlugs.some((srcDir) => normalized.startsWith(`${srcDir}/`)) && _chunkLH7S7FI3cjs.isProgrammaticRoutesFileName.call(void 0, normalized);
2710
2714
  };
2711
2715
  const isProgrammaticRouteSourceFile = (file) => {
2712
2716
  const normalized = file.replace(/\\/g, "/");
@@ -2749,7 +2753,13 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2749
2753
  _chunkVB7P66Q4cjs.invalidateFailedFarmDevModules.call(void 0, server);
2750
2754
  }
2751
2755
  const normalizedFile = file.replace(/\\/g, "/");
2752
- const configChanged = isFarmConfigFile(file, farmConfig.root) || layerConfigFiles.has(normalizedFile);
2756
+ const configChanged = isFarmConfigFile(file, farmConfig.root) || layerConfigFiles.has(normalizedFile) || farmConfig.layers.some((layer) => isFarmConfigFile(file, layer.root));
2757
+ if (configChanged) {
2758
+ const displayPath = path6.posix.relative(_chunk7ZDLE77Pcjs.toPosixPath.call(void 0, farmConfig.root), normalizedFile);
2759
+ _chunk7ZDLE77Pcjs.logger.warn(
2760
+ `Farm config changed (${displayPath}). Restart the dev server to apply the change.`
2761
+ );
2762
+ }
2753
2763
  const programmaticRouteChanged = isProgrammaticRouteFile(file) || isProgrammaticRouteSourceFile(file) && (ev === "unlink" || fileContainsProgrammaticPageRoute(file));
2754
2764
  const typeArtifacts = configChanged ? ALL_TYPE_ARTIFACTS : {
2755
2765
  routes: ev !== "change" && (isRouteModuleFile(file) || isRendererRouteFile(file)) || programmaticRouteChanged,
@@ -2831,7 +2841,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2831
2841
  }
2832
2842
  })]);
2833
2843
  }
2834
- apiRouteManager = new (0, _chunkD2VLHRBNcjs.APIRouteManager)(appDirs, server, {
2844
+ apiRouteManager = new (0, _chunkY3MTKPLNcjs.APIRouteManager)(appDirs, server, {
2835
2845
  plugins: farmConfig.plugins,
2836
2846
  i18n: farmApp.getI18nRuntime(),
2837
2847
  bodySizeLimit: serverConfig.bodySizeLimit,
@@ -2940,45 +2950,65 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2940
2950
  },
2941
2951
  href
2942
2952
  );
2943
- const farmDocsHandler = farmDocsDevRuntime ? farmDocsDevRuntime.hasFarmDocsRuntimeAdapter(farmConfig.docs) ? await farmDocsDevRuntime.createFarmDocsAdapterHandler(farmConfig.docs, {
2944
- root: farmConfig.root,
2945
- srcDir: farmConfig.srcDir,
2946
- clientEntry: "/@farm/client.js",
2947
- rendererServer: farmConfig.renderer.server,
2948
- resolveLayoutFonts: resolveDocsLayoutFonts,
2949
- fontStylesheetHref: "/@farm/fonts.css",
2950
- globalStylesheetHref: _chunkBEAQVRMQcjs.resolveDevGlobalStylesheetHref.call(void 0,
2951
- farmConfig.root,
2952
- farmConfig.srcDir
2953
- ),
2954
- loadModule: async (specifier) => {
2955
- const resolved = await server.environments.ssr.pluginContainer.resolveId(specifier);
2956
- if (specifier === _optionalChain([farmConfig, 'access', _191 => _191.docs, 'access', _192 => _192.adapter, 'optionalAccess', _193 => _193.server]) && _optionalChain([resolved, 'optionalAccess', _194 => _194.id])) {
2957
- const file = resolved.id.split("?", 1)[0];
2958
- return import(
2959
- /* @vite-ignore */
2960
- _url.pathToFileURL.call(void 0, file).href
2961
- );
2953
+ let farmDocsRuntimeGeneration = 0;
2954
+ const createFarmDocsAdapterHandler = () => {
2955
+ const generation = ++farmDocsRuntimeGeneration;
2956
+ return farmDocsDevRuntime.createFarmDocsAdapterHandler(farmConfig.docs, {
2957
+ root: farmConfig.root,
2958
+ srcDir: farmConfig.srcDir,
2959
+ clientEntry: "/@farm/client.js",
2960
+ rendererServer: farmConfig.renderer.server,
2961
+ resolveLayoutFonts: resolveDocsLayoutFonts,
2962
+ fontStylesheetHref: "/@farm/fonts.css",
2963
+ globalStylesheetHref: _chunk76ES7BCOcjs.resolveDevGlobalStylesheetHref.call(void 0, farmConfig.root, farmConfig.srcDir),
2964
+ loadModule: async (specifier) => {
2965
+ const resolved = await server.environments.ssr.pluginContainer.resolveId(specifier);
2966
+ if (specifier === _optionalChain([farmConfig, 'access', _191 => _191.docs, 'access', _192 => _192.adapter, 'optionalAccess', _193 => _193.server]) && _optionalChain([resolved, 'optionalAccess', _194 => _194.id])) {
2967
+ const file = resolved.id.split("?", 1)[0];
2968
+ return import(
2969
+ /* @vite-ignore */
2970
+ _url.pathToFileURL.call(void 0, file).href
2971
+ );
2972
+ }
2973
+ return _chunkVB7P66Q4cjs.loadFarmDevModule.call(void 0, server, _nullishCoalesce(_optionalChain([resolved, 'optionalAccess', _195 => _195.id]), () => ( specifier)));
2974
+ },
2975
+ registerMCPServer: (mcpServer) => {
2976
+ if (generation !== farmDocsRuntimeGeneration) return () => {
2977
+ };
2978
+ const dispose = _chunk3ACTVXZGcjs.registerFarmMCPServer.call(void 0, mcpServer);
2979
+ docsMCPServerDisposers.add(dispose);
2980
+ return () => {
2981
+ docsMCPServerDisposers.delete(dispose);
2982
+ dispose();
2983
+ };
2984
+ },
2985
+ isPathGuarded: isFarmDocsPathGuarded
2986
+ });
2987
+ };
2988
+ let farmDocsAdapterHandler = _optionalChain([farmDocsDevRuntime, 'optionalAccess', _196 => _196.hasFarmDocsRuntimeAdapter, 'call', _197 => _197(farmConfig.docs)]) ? createFarmDocsAdapterHandler() : void 0;
2989
+ if (farmDocsAdapterHandler) await farmDocsAdapterHandler;
2990
+ const farmDocsConfigModule = farmDocsAdapterHandler ? _chunkP4ZLFUNBcjs.getFarmDocsAdapterConfigModule.call(void 0, farmConfig.docs) : void 0;
2991
+ if (farmDocsConfigModule) {
2992
+ const configFile = _chunk7ZDLE77Pcjs.toPosixPath.call(void 0, path6.resolve(farmConfig.root, farmDocsConfigModule));
2993
+ refreshFarmDocsConfig = (file) => {
2994
+ if (_chunkVB7P66Q4cjs.invalidateFarmDevDependents.call(void 0, server, file, /* @__PURE__ */ new Set([configFile])).length === 0) {
2995
+ return false;
2962
2996
  }
2963
- return _chunkVB7P66Q4cjs.loadFarmDevModule.call(void 0, server, _nullishCoalesce(_optionalChain([resolved, 'optionalAccess', _195 => _195.id]), () => ( specifier)));
2964
- },
2965
- registerMCPServer: (mcpServer) => {
2966
- const dispose = _chunk3ACTVXZGcjs.registerFarmMCPServer.call(void 0, mcpServer);
2967
- docsMCPServerDisposers.add(dispose);
2968
- return () => {
2969
- docsMCPServerDisposers.delete(dispose);
2970
- dispose();
2971
- };
2972
- },
2973
- isPathGuarded: isFarmDocsPathGuarded
2974
- }) : farmDocsDevRuntime.createFarmDocsHandler(farmConfig.docs, {
2997
+ releaseDocsMCPServers();
2998
+ farmDocsAdapterHandler = createFarmDocsAdapterHandler();
2999
+ farmDocsAdapterHandler.catch(() => {
3000
+ });
3001
+ return true;
3002
+ };
3003
+ }
3004
+ const farmDocsHandler = farmDocsDevRuntime ? farmDocsAdapterHandler ? (request) => farmDocsAdapterHandler.then((handle) => handle(request)) : farmDocsDevRuntime.createFarmDocsHandler(farmConfig.docs, {
2975
3005
  root: farmConfig.root,
2976
3006
  srcDir: farmConfig.srcDir,
2977
3007
  clientEntry: "/@farm/client.js",
2978
3008
  fontAssets: _chunkQTGYT2DFcjs.toFarmDocsPublicFontAssets.call(void 0, farmDocsFontAssetList),
2979
3009
  resolveLayoutFonts: resolveDocsLayoutFonts,
2980
3010
  fontStylesheetHref: "/@farm/fonts.css",
2981
- globalStylesheetHref: _chunkBEAQVRMQcjs.resolveDevGlobalStylesheetHref.call(void 0,
3011
+ globalStylesheetHref: _chunk76ES7BCOcjs.resolveDevGlobalStylesheetHref.call(void 0,
2982
3012
  farmConfig.root,
2983
3013
  farmConfig.srcDir
2984
3014
  ),
@@ -2986,7 +3016,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
2986
3016
  basePath: farmConfig.basePath
2987
3017
  }) : null;
2988
3018
  const farmDocsListsPages = Boolean(
2989
- farmDocsDevRuntime && _optionalChain([pm, 'optionalAccess', _196 => _196.getPlugins, 'call', _197 => _197(), 'access', _198 => _198.some, 'call', _199 => _199((plugin2) => plugin2.name === "farm:infra-analytics")])
3019
+ farmDocsDevRuntime && _optionalChain([pm, 'optionalAccess', _198 => _198.getPlugins, 'call', _199 => _199(), 'access', _200 => _200.some, 'call', _201 => _201((plugin2) => plugin2.name === "farm:infra-analytics")])
2990
3020
  );
2991
3021
  let farmDocsPagePaths;
2992
3022
  const getFarmDocsPagePaths = () => {
@@ -3013,22 +3043,22 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
3013
3043
  });
3014
3044
  }
3015
3045
  }
3016
- const farmInfraAnalyticsPlugin = _optionalChain([pm, 'optionalAccess', _200 => _200.getPlugins, 'call', _201 => _201(), 'access', _202 => _202.find, 'call', _203 => _203((plugin2) => plugin2.name === "farm:infra-analytics")]);
3046
+ const farmInfraAnalyticsPlugin = _optionalChain([pm, 'optionalAccess', _202 => _202.getPlugins, 'call', _203 => _203(), 'access', _204 => _204.find, 'call', _205 => _205((plugin2) => plugin2.name === "farm:infra-analytics")]);
3017
3047
  if (farmInfraAnalyticsPlugin) {
3018
- _chunk5AOARZJTcjs._setFarmInfraAnalyticsWebMCPRoute.call(void 0, farmInfraAnalyticsPlugin, async (pathname) => {
3048
+ _chunkT2VXOAC3cjs._setFarmInfraAnalyticsWebMCPRoute.call(void 0, farmInfraAnalyticsPlugin, async (pathname) => {
3019
3049
  if (farmDocsDevRuntime) {
3020
- const label = _chunkL7Z6OAE2cjs.resolveFarmDocsRouteLabel.call(void 0,
3050
+ const label = _chunkPVR63WHWcjs.resolveFarmDocsRouteLabel.call(void 0,
3021
3051
  _chunkTFCBJFP7cjs.stripFarmBasePath.call(void 0, pathname, farmConfig.basePath),
3022
3052
  {
3023
- path: _optionalChain([farmConfig, 'access', _204 => _204.docs, 'optionalAccess', _205 => _205.entry]) || "/docs",
3024
- roots: _optionalChain([farmConfig, 'access', _206 => _206.docs, 'optionalAccess', _207 => _207.roots, 'optionalAccess', _208 => _208.map, 'call', _209 => _209((root) => root.entry)]),
3053
+ path: _optionalChain([farmConfig, 'access', _206 => _206.docs, 'optionalAccess', _207 => _207.entry]) || "/docs",
3054
+ roots: _optionalChain([farmConfig, 'access', _208 => _208.docs, 'optionalAccess', _209 => _209.roots, 'optionalAccess', _210 => _210.map, 'call', _211 => _211((root) => root.entry)]),
3025
3055
  pages: await getFarmDocsPagePaths()
3026
3056
  }
3027
3057
  );
3028
- if (label) return _chunkL7Z6OAE2cjs.setFarmRouteLabel.call(void 0, { pathname }, label);
3058
+ if (label) return _chunkPVR63WHWcjs.setFarmRouteLabel.call(void 0, { pathname }, label);
3029
3059
  }
3030
3060
  const match = farmApp.getRouteManager().matchRoute(pathname);
3031
- return { pathname, pattern: _optionalChain([match, 'access', _210 => _210.route, 'optionalAccess', _211 => _211.pattern]) || null };
3061
+ return { pathname, pattern: _optionalChain([match, 'access', _212 => _212.route, 'optionalAccess', _213 => _213.pattern]) || null };
3032
3062
  });
3033
3063
  }
3034
3064
  if (farmDocsDevRuntime && !farmDocsDevRuntime.hasFarmDocsRuntimeAdapter(farmConfig.docs)) {
@@ -3103,7 +3133,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
3103
3133
  }
3104
3134
  },
3105
3135
  (request) => {
3106
- const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _212 => _212.getConfig, 'call', _213 => _213()]), () => ( options));
3136
+ const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _214 => _214.getConfig, 'call', _215 => _215()]), () => ( options));
3107
3137
  const currentServerConfig = _chunk7GKZDRY2cjs.resolveFarmServerConfig.call(void 0, currentConfig.server);
3108
3138
  return _chunkIBZW57NWcjs.resolveFarmRequestURL.call(void 0, request, {
3109
3139
  trustProxy: currentServerConfig.trustProxy
@@ -3119,7 +3149,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
3119
3149
  withAPIRequestTracing(async function handleFarmDevRequest(req, res, next) {
3120
3150
  const requestUrl = req.url || "/";
3121
3151
  const requestMethod = req.method || "GET";
3122
- const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _214 => _214.getConfig, 'call', _215 => _215()]), () => ( options));
3152
+ const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _216 => _216.getConfig, 'call', _217 => _217()]), () => ( options));
3123
3153
  const currentServerConfig = _chunk7GKZDRY2cjs.resolveFarmServerConfig.call(void 0, currentConfig.server);
3124
3154
  const parsedRequestUrl = _chunkIBZW57NWcjs.resolveFarmRequestURL.call(void 0, req, {
3125
3155
  trustProxy: currentServerConfig.trustProxy
@@ -3189,7 +3219,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
3189
3219
  if (!rendererDisabled && (requestMethod === "GET" || requestMethod === "HEAD") && requestPathname === _chunkO7B6LJWEcjs.FARM_VIDEO_PLAYER_PATH) {
3190
3220
  res.statusCode = 200;
3191
3221
  res.setHeader("Content-Type", "text/html; charset=utf-8");
3192
- res.end(requestMethod === "HEAD" ? void 0 : _chunkBEAQVRMQcjs.FARM_VIDEO_PLAYER_HTML);
3222
+ res.end(requestMethod === "HEAD" ? void 0 : _chunk76ES7BCOcjs.FARM_VIDEO_PLAYER_HTML);
3193
3223
  return;
3194
3224
  }
3195
3225
  const farmDocsFontPath = farmDocsFontAssets.get(requestPathname);
@@ -3244,7 +3274,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
3244
3274
  openapi: options.openapi
3245
3275
  },
3246
3276
  workflows: discoveredWorkflows,
3247
- plugins: _optionalChain([pm, 'optionalAccess', _216 => _216.getSortedPlugins, 'call', _217 => _217()])
3277
+ plugins: _optionalChain([pm, 'optionalAccess', _218 => _218.getSortedPlugins, 'call', _219 => _219()])
3248
3278
  });
3249
3279
  res.statusCode = 200;
3250
3280
  res.setHeader(
@@ -3279,10 +3309,10 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
3279
3309
  render: {
3280
3310
  pathname: pathname2,
3281
3311
  method: requestMethod,
3282
- routePattern: _optionalChain([match, 'optionalAccess', _218 => _218.route, 'optionalAccess', _219 => _219.pattern]) || null,
3283
- params: _optionalChain([match, 'optionalAccess', _220 => _220.params]) || {}
3312
+ routePattern: _optionalChain([match, 'optionalAccess', _220 => _220.route, 'optionalAccess', _221 => _221.pattern]) || null,
3313
+ params: _optionalChain([match, 'optionalAccess', _222 => _222.params]) || {}
3284
3314
  },
3285
- layoutPatterns: (_optionalChain([match, 'optionalAccess', _221 => _221.layouts]) || []).map((layout) => layout.pattern)
3315
+ layoutPatterns: (_optionalChain([match, 'optionalAccess', _223 => _223.layouts]) || []).map((layout) => layout.pattern)
3286
3316
  };
3287
3317
  return pageHookRouteMatch;
3288
3318
  };
@@ -3370,7 +3400,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
3370
3400
  }
3371
3401
  }
3372
3402
  const runAppMiddlewareForContentRoute = async () => {
3373
- if (!_optionalChain([middlewareManager, 'optionalAccess', _222 => _222.hasMiddleware, 'call', _223 => _223()])) return false;
3403
+ if (!_optionalChain([middlewareManager, 'optionalAccess', _224 => _224.hasMiddleware, 'call', _225 => _225()])) return false;
3374
3404
  const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
3375
3405
  return runFarmMiddlewareWithNavigation(
3376
3406
  farmApp.getServerRenderer(),
@@ -3408,7 +3438,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
3408
3438
  return response.status;
3409
3439
  };
3410
3440
  const runAppMiddlewareInRuntimeSession = async (runtimeSession2, logResponse2) => {
3411
- const interceptor = runtimeSession2 && _optionalChain([pm, 'optionalAccess', _224 => _224.hasRuntimeHook, 'call', _225 => _225("after")]) && _optionalChain([middlewareManager, 'optionalAccess', _226 => _226.hasMiddleware, 'call', _227 => _227()]) ? interceptFarmDevPageResponse({
3441
+ const interceptor = runtimeSession2 && _optionalChain([pm, 'optionalAccess', _226 => _226.hasRuntimeHook, 'call', _227 => _227("after")]) && _optionalChain([middlewareManager, 'optionalAccess', _228 => _228.hasMiddleware, 'call', _229 => _229()]) ? interceptFarmDevPageResponse({
3412
3442
  req,
3413
3443
  res,
3414
3444
  pm,
@@ -3421,7 +3451,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
3421
3451
  urlPath: requestUrl,
3422
3452
  pathname: requestPathname,
3423
3453
  startTime: Date.now(),
3424
- logResponse: (_method, _path, status) => _optionalChain([logResponse2, 'optionalCall', _228 => _228(status)]),
3454
+ logResponse: (_method, _path, status) => _optionalChain([logResponse2, 'optionalCall', _230 => _230(status)]),
3425
3455
  // The runtime reports a runtime.after failure itself.
3426
3456
  emitError: async () => {
3427
3457
  },
@@ -3432,7 +3462,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
3432
3462
  handled = await runAppMiddlewareForContentRoute();
3433
3463
  } catch (error) {
3434
3464
  if (runtimeHookErrorAnswersJSON || res.headersSent) {
3435
- _optionalChain([interceptor, 'optionalAccess', _229 => _229.release, 'call', _230 => _230()]);
3465
+ _optionalChain([interceptor, 'optionalAccess', _231 => _231.release, 'call', _232 => _232()]);
3436
3466
  throw error;
3437
3467
  }
3438
3468
  if (runtimeSession2) await pm.reportRuntimeRequestError(runtimeSession2, error);
@@ -3440,10 +3470,10 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
3440
3470
  return true;
3441
3471
  }
3442
3472
  if (!handled) {
3443
- _optionalChain([interceptor, 'optionalAccess', _231 => _231.release, 'call', _232 => _232()]);
3473
+ _optionalChain([interceptor, 'optionalAccess', _233 => _233.release, 'call', _234 => _234()]);
3444
3474
  return false;
3445
3475
  }
3446
- if (!_optionalChain([interceptor, 'optionalAccess', _233 => _233.isEnded, 'call', _234 => _234()])) _optionalChain([logResponse2, 'optionalCall', _235 => _235(res.statusCode || 200)]);
3476
+ if (!_optionalChain([interceptor, 'optionalAccess', _235 => _235.isEnded, 'call', _236 => _236()])) _optionalChain([logResponse2, 'optionalCall', _237 => _237(res.statusCode || 200)]);
3447
3477
  return true;
3448
3478
  };
3449
3479
  const serveBuiltInRoute = async (respond, {
@@ -3452,7 +3482,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
3452
3482
  label
3453
3483
  } = {}) => {
3454
3484
  const discard = async () => {
3455
- await _optionalChain([computed, 'optionalAccess', _236 => _236.body, 'optionalAccess', _237 => _237.cancel, 'call', _238 => _238(), 'access', _239 => _239.catch, 'call', _240 => _240(() => {
3485
+ await _optionalChain([computed, 'optionalAccess', _238 => _238.body, 'optionalAccess', _239 => _239.cancel, 'call', _240 => _240(), 'access', _241 => _241.catch, 'call', _242 => _242(() => {
3456
3486
  })]);
3457
3487
  };
3458
3488
  const sendRuntimeResponse = async (runtimeSession3, response2) => {
@@ -3469,9 +3499,9 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
3469
3499
  if (pm && opensFarmDevRuntimeSession(pm)) {
3470
3500
  try {
3471
3501
  const routePathname = _chunkTFCBJFP7cjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath);
3472
- const route = _chunkL7Z6OAE2cjs.setFarmRouteLabel.call(void 0,
3502
+ const route = _chunkPVR63WHWcjs.setFarmRouteLabel.call(void 0,
3473
3503
  { pathname: requestPathname },
3474
- label !== void 0 ? label : devBuiltInRoutePaths.has(routePathname) ? routePathname : _chunkL7Z6OAE2cjs.resolveFarmMCPRouteLabel.call(void 0, routePathname, apiServerBasePath)
3504
+ label !== void 0 ? label : devBuiltInRoutePaths.has(routePathname) ? routePathname : _chunkPVR63WHWcjs.resolveFarmMCPRouteLabel.call(void 0, routePathname, apiServerBasePath)
3475
3505
  );
3476
3506
  runtimeSession2 = await pm.beginRuntimeRequest(
3477
3507
  createRequestFromNodeRequest(req, new URL(fullUrl)),
@@ -3509,7 +3539,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
3509
3539
  }
3510
3540
  responding = true;
3511
3541
  response = await respond(
3512
- _nullishCoalesce(_optionalChain([runtimeSession2, 'optionalAccess', _241 => _241.request]), () => ( createRequestFromNodeRequest(req, new URL(fullUrl))))
3542
+ _nullishCoalesce(_optionalChain([runtimeSession2, 'optionalAccess', _243 => _243.request]), () => ( createRequestFromNodeRequest(req, new URL(fullUrl))))
3513
3543
  );
3514
3544
  } catch (error) {
3515
3545
  if (!responding && !res.headersSent) {
@@ -3529,7 +3559,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
3529
3559
  else await _chunk6VC7NUY3cjs.sendWebResponse.call(void 0, res, response);
3530
3560
  };
3531
3561
  const openAPIRequestPathname = openAPIManager ? _chunkTFCBJFP7cjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) : requestPathname;
3532
- if (openAPIManager && _optionalChain([options, 'access', _242 => _242.openapi, 'optionalAccess', _243 => _243.specRoute]) && openAPIRequestPathname === options.openapi.specRoute) {
3562
+ if (openAPIManager && _optionalChain([options, 'access', _244 => _244.openapi, 'optionalAccess', _245 => _245.specRoute]) && openAPIRequestPathname === options.openapi.specRoute) {
3533
3563
  const specManager = openAPIManager;
3534
3564
  await serveBuiltInRoute(async () => {
3535
3565
  if (requestMethod !== "GET" && requestMethod !== "HEAD") {
@@ -3549,7 +3579,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
3549
3579
  });
3550
3580
  return;
3551
3581
  }
3552
- if (openAPIManager && openAPIRequestPathname === _optionalChain([options, 'access', _244 => _244.openapi, 'optionalAccess', _245 => _245.route])) {
3582
+ if (openAPIManager && openAPIRequestPathname === _optionalChain([options, 'access', _246 => _246.openapi, 'optionalAccess', _247 => _247.route])) {
3553
3583
  const docsManager = openAPIManager;
3554
3584
  await serveBuiltInRoute(
3555
3585
  async () => {
@@ -3560,7 +3590,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
3560
3590
  );
3561
3591
  return;
3562
3592
  }
3563
- if (_optionalChain([options, 'access', _246 => _246.agent, 'optionalAccess', _247 => _247.manifest]) !== false && _chunkL7Z6OAE2cjs.isFarmAppManifestPath.call(void 0, _chunkTFCBJFP7cjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath))) {
3593
+ if (_optionalChain([options, 'access', _248 => _248.agent, 'optionalAccess', _249 => _249.manifest]) !== false && _chunkPVR63WHWcjs.isFarmAppManifestPath.call(void 0, _chunkTFCBJFP7cjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath))) {
3564
3594
  const manifestGuardCoversPath = (path7) => _chunkIGBQSUT5cjs.farmPathGuardCoversEndpoint.call(void 0,
3565
3595
  {
3566
3596
  config: farmConfig,
@@ -3570,18 +3600,18 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
3570
3600
  apiServerBasePath
3571
3601
  );
3572
3602
  await serveBuiltInRoute(async () => {
3573
- _nullishCoalesce(farmAppPackages, () => ( (farmAppPackages = _chunkBEAQVRMQcjs.resolveFarmAppPackages.call(void 0, _nullishCoalesce(farmConfig.root, () => ( process.cwd()))))));
3574
- const manifest = await _chunkL7Z6OAE2cjs.createFarmAppManifestResponse.call(void 0,
3603
+ _nullishCoalesce(farmAppPackages, () => ( (farmAppPackages = _chunk76ES7BCOcjs.resolveFarmAppPackages.call(void 0, _nullishCoalesce(farmConfig.root, () => ( process.cwd()))))));
3604
+ const manifest = await _chunkPVR63WHWcjs.createFarmAppManifestResponse.call(void 0,
3575
3605
  new Request(parsedRequestUrl, {
3576
3606
  method: requestMethod,
3577
3607
  headers: { "if-none-match": String(_nullishCoalesce(req.headers["if-none-match"], () => ( ""))) }
3578
3608
  }),
3579
3609
  {
3580
- ..._chunkL7Z6OAE2cjs.resolveFarmAppManifestInput.call(void 0, farmConfig, {
3610
+ ..._chunkPVR63WHWcjs.resolveFarmAppManifestInput.call(void 0, farmConfig, {
3581
3611
  build: "development",
3582
3612
  packages: farmAppPackages,
3583
3613
  // Read again on each request; unchanged files come from a cache.
3584
- webmcpTools: _optionalChain([farmConfig, 'access', _248 => _248.plugins, 'optionalAccess', _249 => _249.some, 'call', _250 => _250(({ name }) => name === "farm:webmcp")]) ? _chunkBEAQVRMQcjs.collectFarmWebMCPTools.call(void 0, _nullishCoalesce(farmConfig.root, () => ( process.cwd())), farmConfig.srcDir) : []
3614
+ webmcpTools: _optionalChain([farmConfig, 'access', _250 => _250.plugins, 'optionalAccess', _251 => _251.some, 'call', _252 => _252(({ name }) => name === "farm:webmcp")]) ? _chunk76ES7BCOcjs.collectFarmWebMCPTools.call(void 0, _nullishCoalesce(farmConfig.root, () => ( process.cwd())), farmConfig.srcDir) : []
3585
3615
  }),
3586
3616
  defaultMCP: () => farmApp.getServerRenderer().getDefaultMCPServer(),
3587
3617
  // A guard written for an MCP server's path keeps its tools out of the public view.
@@ -3599,11 +3629,11 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
3599
3629
  });
3600
3630
  return;
3601
3631
  }
3602
- if (_optionalChain([options, 'access', _251 => _251.agent, 'optionalAccess', _252 => _252.apiCatalog]) && _chunkTFCBJFP7cjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) === _chunkL7Z6OAE2cjs.FARM_API_CATALOG_PATH) {
3632
+ if (_optionalChain([options, 'access', _253 => _253.agent, 'optionalAccess', _254 => _254.apiCatalog]) && _chunkTFCBJFP7cjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath) === _chunkPVR63WHWcjs.FARM_API_CATALOG_PATH) {
3603
3633
  await serveBuiltInRoute(
3604
- () => _chunkL7Z6OAE2cjs.createFarmApiCatalogResponse.call(void 0,
3634
+ () => _chunkPVR63WHWcjs.createFarmApiCatalogResponse.call(void 0,
3605
3635
  requestMethod,
3606
- _chunkL7Z6OAE2cjs.resolveFarmApiCatalogInput.call(void 0, { ...options, api: farmConfig.api }),
3636
+ _chunkPVR63WHWcjs.resolveFarmApiCatalogInput.call(void 0, { ...options, api: farmConfig.api }),
3607
3637
  new Request(parsedRequestUrl, {
3608
3638
  headers: { "user-agent": String(_nullishCoalesce(req.headers["user-agent"], () => ( ""))) }
3609
3639
  })
@@ -3611,8 +3641,8 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
3611
3641
  );
3612
3642
  return;
3613
3643
  }
3614
- if (_optionalChain([options, 'access', _253 => _253.agent, 'optionalAccess', _254 => _254.aiCatalog]) !== false) {
3615
- const aiCatalog = _chunkL7Z6OAE2cjs.createFarmAiCatalogResponse.call(void 0,
3644
+ if (_optionalChain([options, 'access', _255 => _255.agent, 'optionalAccess', _256 => _256.aiCatalog]) !== false) {
3645
+ const aiCatalog = _chunkPVR63WHWcjs.createFarmAiCatalogResponse.call(void 0,
3616
3646
  new Request(parsedRequestUrl, {
3617
3647
  method: requestMethod,
3618
3648
  headers: {
@@ -3660,7 +3690,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
3660
3690
  );
3661
3691
  const docsResponse = await farmDocsHandler(docsHandlerRequest);
3662
3692
  if (docsResponse) {
3663
- const docsPage = _optionalChain([docsResponse, 'access', _255 => _255.headers, 'access', _256 => _256.get, 'call', _257 => _257("content-type"), 'optionalAccess', _258 => _258.toLowerCase, 'call', _259 => _259(), 'access', _260 => _260.includes, 'call', _261 => _261("text/html")]);
3693
+ const docsPage = _optionalChain([docsResponse, 'access', _257 => _257.headers, 'access', _258 => _258.get, 'call', _259 => _259("content-type"), 'optionalAccess', _260 => _260.toLowerCase, 'call', _261 => _261(), 'access', _262 => _262.includes, 'call', _263 => _263("text/html")]);
3664
3694
  await serveBuiltInRoute(
3665
3695
  async (request) => {
3666
3696
  if (!docsPage) {
@@ -3678,7 +3708,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
3678
3708
  farmConfig.deploymentId
3679
3709
  );
3680
3710
  if (deploymentMismatch) {
3681
- await _optionalChain([docsResponse, 'access', _262 => _262.body, 'optionalAccess', _263 => _263.cancel, 'call', _264 => _264()]);
3711
+ await _optionalChain([docsResponse, 'access', _264 => _264.body, 'optionalAccess', _265 => _265.cancel, 'call', _266 => _266()]);
3682
3712
  return _chunkVIDUNAQEcjs.createFarmDeploymentMismatchResponse.call(void 0, deploymentMismatch);
3683
3713
  }
3684
3714
  const page = _chunkSWOJU7LIcjs._withFarmResponseHeaders.call(void 0,
@@ -3699,11 +3729,11 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
3699
3729
  {
3700
3730
  kind: "docs",
3701
3731
  computed: docsResponse,
3702
- label: _chunkL7Z6OAE2cjs.resolveFarmDocsEngineRouteLabel.call(void 0,
3732
+ label: _chunkPVR63WHWcjs.resolveFarmDocsEngineRouteLabel.call(void 0,
3703
3733
  _chunkTFCBJFP7cjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath),
3704
3734
  {
3705
- path: _optionalChain([farmConfig, 'access', _265 => _265.docs, 'optionalAccess', _266 => _266.entry]) || "/docs",
3706
- roots: _optionalChain([farmConfig, 'access', _267 => _267.docs, 'optionalAccess', _268 => _268.roots, 'optionalAccess', _269 => _269.map, 'call', _270 => _270((root) => root.entry)]),
3735
+ path: _optionalChain([farmConfig, 'access', _267 => _267.docs, 'optionalAccess', _268 => _268.entry]) || "/docs",
3736
+ roots: _optionalChain([farmConfig, 'access', _269 => _269.docs, 'optionalAccess', _270 => _270.roots, 'optionalAccess', _271 => _271.map, 'call', _272 => _272((root) => root.entry)]),
3707
3737
  pages: await getFarmDocsPagePaths()
3708
3738
  }
3709
3739
  )
@@ -3712,7 +3742,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
3712
3742
  return;
3713
3743
  }
3714
3744
  }
3715
- if (options.mobileClient && !viteModuleRequest && (requestMethod === "GET" || requestMethod === "HEAD" || requestMethod === "POST") && _optionalChain([req, 'access', _271 => _271.headers, 'access', _272 => _272.accept, 'optionalAccess', _273 => _273.includes, 'call', _274 => _274(_chunkXVD5Y6S4cjs.FARM_NATIVE_TREE_CONTENT_TYPE)])) {
3745
+ if (options.mobileClient && !viteModuleRequest && (requestMethod === "GET" || requestMethod === "HEAD" || requestMethod === "POST") && _optionalChain([req, 'access', _273 => _273.headers, 'access', _274 => _274.accept, 'optionalAccess', _275 => _275.includes, 'call', _276 => _276(_chunkXVD5Y6S4cjs.FARM_NATIVE_TREE_CONTENT_TYPE)])) {
3716
3746
  const { createFarmNativeTreeResponse } = await import("./native-tree-PHCV43W4.cjs");
3717
3747
  const treeBodyInit = requestMethod === "POST" ? { body: _chunk7GKZDRY2cjs.createFarmNodeRequestBodyStream.call(void 0, req), duplex: "half" } : {};
3718
3748
  const treeResponse = await createFarmNativeTreeResponse({
@@ -3730,15 +3760,15 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
3730
3760
  });
3731
3761
  await serveBuiltInRoute(() => treeResponse, {
3732
3762
  computed: treeResponse,
3733
- label: _nullishCoalesce(_optionalChain([farmApp, 'access', _275 => _275.getRouteManager, 'call', _276 => _276(), 'access', _277 => _277.matchRoute, 'call', _278 => _278(_chunkTFCBJFP7cjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath)), 'access', _279 => _279.route, 'optionalAccess', _280 => _280.pattern]), () => ( null))
3763
+ label: _nullishCoalesce(_optionalChain([farmApp, 'access', _277 => _277.getRouteManager, 'call', _278 => _278(), 'access', _279 => _279.matchRoute, 'call', _280 => _280(_chunkTFCBJFP7cjs.stripFarmBasePath.call(void 0, requestPathname, farmConfig.basePath)), 'access', _281 => _281.route, 'optionalAccess', _282 => _282.pattern]), () => ( null))
3734
3764
  });
3735
3765
  return;
3736
3766
  }
3737
3767
  const markdownRouteLabel = () => (
3738
3768
  // On the route path, as production labels it: /fr/index.md is /index.md.
3739
- _chunkL7Z6OAE2cjs.resolveFarmMarkdownRouteLabel.call(void 0,
3769
+ _chunkPVR63WHWcjs.resolveFarmMarkdownRouteLabel.call(void 0,
3740
3770
  toRoutePathname(requestPathname),
3741
- (page) => _optionalChain([farmApp, 'access', _281 => _281.getRouteManager, 'call', _282 => _282(), 'access', _283 => _283.matchRoute, 'call', _284 => _284(page), 'access', _285 => _285.route, 'optionalAccess', _286 => _286.pattern])
3771
+ (page) => _optionalChain([farmApp, 'access', _283 => _283.getRouteManager, 'call', _284 => _284(), 'access', _285 => _285.matchRoute, 'call', _286 => _286(page), 'access', _287 => _287.route, 'optionalAccess', _288 => _288.pattern])
3742
3772
  )
3743
3773
  );
3744
3774
  const markdownSourceResponse = viteModuleRequest ? null : await _chunk27IPPPCVcjs.createFarmMarkdownSourceResponse.call(void 0, {
@@ -3750,14 +3780,14 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
3750
3780
  routePathname: toRoutePathname,
3751
3781
  resolveSource: async (pathname2) => {
3752
3782
  const match = farmApp.getRouteManager().matchRoute(pathname2);
3753
- const sourcePath = _optionalChain([match, 'access', _287 => _287.route, 'optionalAccess', _288 => _288.markdownSourcePath]) || (match.route && _chunk27IPPPCVcjs.isFarmMarkdownPageFile.call(void 0, match.route.modulePath) ? match.route.modulePath : null);
3783
+ const sourcePath = _optionalChain([match, 'access', _289 => _289.route, 'optionalAccess', _290 => _290.markdownSourcePath]) || (match.route && _chunk27IPPPCVcjs.isFarmMarkdownPageFile.call(void 0, match.route.modulePath) ? match.route.modulePath : null);
3754
3784
  if (!sourcePath) {
3755
3785
  return null;
3756
3786
  }
3757
3787
  return {
3758
3788
  source: await fs2.promises.readFile(sourcePath, "utf8"),
3759
3789
  // Project-relative, as production sends it: never the machine's path.
3760
- filePath: _chunkBEAQVRMQcjs.toBakedMarkdownSourcePath.call(void 0, farmApp.getConfig().root, sourcePath)
3790
+ filePath: _chunk76ES7BCOcjs.toBakedMarkdownSourcePath.call(void 0, farmApp.getConfig().root, sourcePath)
3761
3791
  };
3762
3792
  },
3763
3793
  // The anonymous check goes through this server, so its guards and
@@ -3907,7 +3937,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
3907
3937
  "beforeRequest",
3908
3938
  (plugin2) => {
3909
3939
  const owner = _chunkN4AM7Q34cjs.getFarmIntegrationPluginOwner.call(void 0, plugin2);
3910
- return !isFarmConfigRoutePlugin(plugin2) && (_optionalChain([owner, 'optionalAccess', _289 => _289.source]) !== "lifecycle" || owner.key !== matchedRoute.key);
3940
+ return !isFarmConfigRoutePlugin(plugin2) && (_optionalChain([owner, 'optionalAccess', _291 => _291.source]) !== "lifecycle" || owner.key !== matchedRoute.key);
3911
3941
  },
3912
3942
  req,
3913
3943
  res
@@ -3944,7 +3974,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
3944
3974
  isProd: false
3945
3975
  },
3946
3976
  request,
3947
- { clientAddress: _optionalChain([req, 'access', _290 => _290.socket, 'optionalAccess', _291 => _291.remoteAddress]) }
3977
+ { clientAddress: _optionalChain([req, 'access', _292 => _292.socket, 'optionalAccess', _293 => _293.remoteAddress]) }
3948
3978
  );
3949
3979
  if (!result) {
3950
3980
  throw new Error(`Matched integration route did not return a response`);
@@ -3952,7 +3982,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
3952
3982
  return result;
3953
3983
  } catch (error) {
3954
3984
  _chunk7ZDLE77Pcjs.logger.error(`Integration route error: ${error}`);
3955
- await _optionalChain([runtime, 'optionalAccess', _292 => _292.reportError, 'call', _293 => _293(error)]);
3985
+ await _optionalChain([runtime, 'optionalAccess', _294 => _294.reportError, 'call', _295 => _295(error)]);
3956
3986
  return _chunk5P3TZGS3cjs.createFarmInternalServerErrorResponse.call(void 0, );
3957
3987
  }
3958
3988
  };
@@ -4006,7 +4036,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
4006
4036
  _chunkN4AM7Q34cjs.matchIntegrationRoute.call(void 0, configuredIntegrations, {
4007
4037
  pathname: requestPathname,
4008
4038
  method: requestMethod
4009
- }) || routeManager3.matchRedirect(requestPathname) || apiRouteManager.matchRoute(requestPathname) || farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _294 => _294.isFarmDocsAPIRequest, 'call', _295 => _295(requestPathname)]) || routeManager3.matchRoute(requestPathname).route || routeManager3.matchMetadataRoute(requestPathname) || routeManager3.matchMetadataImage(requestPathname)
4039
+ }) || routeManager3.matchRedirect(requestPathname) || apiRouteManager.matchRoute(requestPathname) || farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _296 => _296.isFarmDocsAPIRequest, 'call', _297 => _297(requestPathname)]) || routeManager3.matchRoute(requestPathname).route || routeManager3.matchMetadataRoute(requestPathname) || routeManager3.matchMetadataImage(requestPathname)
4010
4040
  );
4011
4041
  };
4012
4042
  try {
@@ -4096,15 +4126,15 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
4096
4126
  );
4097
4127
  };
4098
4128
  const isDocsAPIRequest = Boolean(
4099
- farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _296 => _296.isFarmDocsAPIRequest, 'call', _297 => _297(pathname2)])
4129
+ farmDocsAPIHandler && _optionalChain([farmDocsDevRuntime, 'optionalAccess', _298 => _298.isFarmDocsAPIRequest, 'call', _299 => _299(pathname2)])
4100
4130
  );
4101
4131
  const docsRuntimeOptions = () => ({
4102
4132
  kind: "docs",
4103
- route: _chunkL7Z6OAE2cjs.setFarmRouteLabel.call(void 0,
4133
+ route: _chunkPVR63WHWcjs.setFarmRouteLabel.call(void 0,
4104
4134
  { pathname: pathname2, pattern: urlPath2 },
4105
- _chunkL7Z6OAE2cjs.resolveFarmDocsRouteLabel.call(void 0, pathname2, {
4106
- path: _optionalChain([farmConfig, 'access', _298 => _298.docs, 'optionalAccess', _299 => _299.entry]) || "/docs",
4107
- roots: _optionalChain([farmConfig, 'access', _300 => _300.docs, 'optionalAccess', _301 => _301.roots, 'optionalAccess', _302 => _302.map, 'call', _303 => _303((root) => root.entry)])
4135
+ _chunkPVR63WHWcjs.resolveFarmDocsRouteLabel.call(void 0, pathname2, {
4136
+ path: _optionalChain([farmConfig, 'access', _300 => _300.docs, 'optionalAccess', _301 => _301.entry]) || "/docs",
4137
+ roots: _optionalChain([farmConfig, 'access', _302 => _302.docs, 'optionalAccess', _303 => _303.roots, 'optionalAccess', _304 => _304.map, 'call', _305 => _305((root) => root.entry)])
4108
4138
  })
4109
4139
  )
4110
4140
  });
@@ -4186,7 +4216,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
4186
4216
  const routedApiRoute = rewritten ? apiRouteManager.matchRoute(routedPathname) : matchedApiRoute || apiRouteManager.matchRoute(pathname2);
4187
4217
  const hasExplicitAPIRoute = Boolean(routedApiRoute);
4188
4218
  if (apiHandler && hasExplicitAPIRoute) {
4189
- const apiRoutePattern = _optionalChain([routedApiRoute, 'optionalAccess', _304 => _304.route, 'access', _305 => _305.path]) || urlPath2;
4219
+ const apiRoutePattern = _optionalChain([routedApiRoute, 'optionalAccess', _306 => _306.route, 'access', _307 => _307.path]) || urlPath2;
4190
4220
  _chunkRFKPIAOFcjs.emitFarmEvent.call(void 0, {
4191
4221
  type: "route.matched",
4192
4222
  pathname: pathname2,
@@ -4236,7 +4266,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
4236
4266
  error
4237
4267
  });
4238
4268
  _chunk7ZDLE77Pcjs.logger.error(`API route error: ${error}`);
4239
- await _optionalChain([runtime, 'optionalAccess', _306 => _306.reportError, 'call', _307 => _307(error)]);
4269
+ await _optionalChain([runtime, 'optionalAccess', _308 => _308.reportError, 'call', _309 => _309(error)]);
4240
4270
  response = _chunk5P3TZGS3cjs.createFarmInternalServerErrorResponse.call(void 0, );
4241
4271
  }
4242
4272
  return pm ? await pm.runHookSerial("afterApiHandler", response, apiLifecyclePayload) : response;
@@ -4341,12 +4371,12 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
4341
4371
  }
4342
4372
  return;
4343
4373
  }
4344
- if (_optionalChain([req, 'access', _308 => _308.url, 'optionalAccess', _309 => _309.startsWith, 'call', _310 => _310("/@")]) || _optionalChain([req, 'access', _311 => _311.url, 'optionalAccess', _312 => _312.startsWith, 'call', _313 => _313("/node_modules")])) {
4374
+ if (_optionalChain([req, 'access', _310 => _310.url, 'optionalAccess', _311 => _311.startsWith, 'call', _312 => _312("/@")]) || _optionalChain([req, 'access', _313 => _313.url, 'optionalAccess', _314 => _314.startsWith, 'call', _315 => _315("/node_modules")])) {
4345
4375
  return next();
4346
4376
  }
4347
4377
  if (!deferredDottedRequests.has(req) && shouldBypassFarmRouterForDottedPath(
4348
4378
  requestPathname,
4349
- _optionalChain([farmApp, 'optionalAccess', _314 => _314.getRouteManager, 'call', _315 => _315()]),
4379
+ _optionalChain([farmApp, 'optionalAccess', _316 => _316.getRouteManager, 'call', _317 => _317()]),
4350
4380
  [server.config.publicDir, server.config.root],
4351
4381
  farmAgentGeneratedPaths(farmConfig),
4352
4382
  requestMethod
@@ -4354,7 +4384,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
4354
4384
  if (!viteModuleRequest) deferredDottedRequests.set(req, requestUrl);
4355
4385
  return next();
4356
4386
  }
4357
- if (_optionalChain([req, 'access', _316 => _316.url, 'optionalAccess', _317 => _317.startsWith, 'call', _318 => _318("/__farm/page-data")])) {
4387
+ if (_optionalChain([req, 'access', _318 => _318.url, 'optionalAccess', _319 => _319.startsWith, 'call', _320 => _320("/__farm/page-data")])) {
4358
4388
  const urlObj = parsedRequestUrl;
4359
4389
  const targetPath = urlObj.searchParams.get("path") || "/";
4360
4390
  let renderedRequest;
@@ -4384,7 +4414,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
4384
4414
  renderedRequest = targetRequest;
4385
4415
  let middlewareMap = /* @__PURE__ */ new Map();
4386
4416
  let middlewareContext = /* @__PURE__ */ new Map();
4387
- if (_optionalChain([middlewareManager, 'optionalAccess', _319 => _319.hasMiddleware, 'call', _320 => _320()])) {
4417
+ if (_optionalChain([middlewareManager, 'optionalAccess', _321 => _321.hasMiddleware, 'call', _322 => _322()])) {
4388
4418
  const targetNodeRequest = createPageDataMiddlewareRequest(req, targetRequestUrl);
4389
4419
  const targetNodeResponse = createPageDataMiddlewareResponse(res);
4390
4420
  const handled = await runFarmMiddlewareWithNavigation(
@@ -4418,10 +4448,10 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
4418
4448
  if (pm) {
4419
4449
  await pm.runHookParallel("afterRouteMatch", {
4420
4450
  pathname: targetPath,
4421
- matched: !!_optionalChain([match, 'optionalAccess', _321 => _321.route]),
4422
- routePattern: _optionalChain([match, 'optionalAccess', _322 => _322.route, 'optionalAccess', _323 => _323.pattern]) || null,
4423
- params: _optionalChain([match, 'optionalAccess', _324 => _324.params]) || {},
4424
- layoutPatterns: (_optionalChain([match, 'optionalAccess', _325 => _325.layouts]) || []).map((l) => l.pattern)
4451
+ matched: !!_optionalChain([match, 'optionalAccess', _323 => _323.route]),
4452
+ routePattern: _optionalChain([match, 'optionalAccess', _324 => _324.route, 'optionalAccess', _325 => _325.pattern]) || null,
4453
+ params: _optionalChain([match, 'optionalAccess', _326 => _326.params]) || {},
4454
+ layoutPatterns: (_optionalChain([match, 'optionalAccess', _327 => _327.layouts]) || []).map((l) => l.pattern)
4425
4455
  });
4426
4456
  }
4427
4457
  if (!match) {
@@ -4456,7 +4486,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
4456
4486
  );
4457
4487
  const loadingModule = loadingBoundary ? await routeManager3.loadRouteModule(loadingBoundary.modulePath) : null;
4458
4488
  const navigationManifest = routeManager3.generateClientManifest(server.config.root);
4459
- const moduleMetadata = _nullishCoalesce(navigationManifest.routes.find((entry) => entry.pattern === route.pattern), () => ( _chunkSJQ24IB5cjs.getClientModuleMetadata.call(void 0, route.modulePath, server.config.root)));
4489
+ const moduleMetadata = _nullishCoalesce(navigationManifest.routes.find((entry) => entry.pattern === route.pattern), () => ( _chunkBY5VQ57Wcjs.getClientModuleMetadata.call(void 0, route.modulePath, server.config.root)));
4460
4490
  const isClientComponent = moduleMetadata.isClientComponent;
4461
4491
  const shouldHydrate = moduleMetadata.shouldHydrate;
4462
4492
  let mergedMetadata = {};
@@ -4467,7 +4497,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
4467
4497
  (layout) => _nullishCoalesce(navigationManifest.layouts.find(
4468
4498
  (entry) => entry.pattern === layout.pattern
4469
4499
  ), () => ( {
4470
- ..._chunkSJQ24IB5cjs.getClientModuleMetadata.call(void 0, layout.modulePath, server.config.root),
4500
+ ..._chunkBY5VQ57Wcjs.getClientModuleMetadata.call(void 0, layout.modulePath, server.config.root),
4471
4501
  serverTree: false
4472
4502
  }))
4473
4503
  );
@@ -4481,17 +4511,17 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
4481
4511
  )
4482
4512
  ];
4483
4513
  const hydrationIslandStrategy = _chunkCYUTK4JPcjs.resolveFarmServerComponentsMode.call(void 0,
4484
- _chunkCYUTK4JPcjs.readFarmServerComponentsConfig.call(void 0, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _326 => _326.getConfig, 'call', _327 => _327()]), () => ( options)))
4485
- ) === "islands" ? _chunkBEAQVRMQcjs.resolveFarmRouteRootStrategy.call(void 0,
4514
+ _chunkCYUTK4JPcjs.readFarmServerComponentsConfig.call(void 0, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _328 => _328.getConfig, 'call', _329 => _329()]), () => ( options)))
4515
+ ) === "islands" ? _chunk76ES7BCOcjs.resolveFarmRouteRootStrategy.call(void 0,
4486
4516
  route,
4487
4517
  { shouldHydrate, islandStrategy: _nullishCoalesce(moduleMetadata.islandStrategy, () => ( null)) },
4488
4518
  layouts.map((layout, index) => ({
4489
4519
  pattern: layout.pattern,
4490
4520
  modulePath: layout.modulePath,
4491
- shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access', _328 => _328[index], 'optionalAccess', _329 => _329.shouldHydrate]) === true,
4521
+ shouldHydrate: _optionalChain([layoutHydrationMetadata, 'access', _330 => _330[index], 'optionalAccess', _331 => _331.shouldHydrate]) === true,
4492
4522
  // Manifest entries carry it; metadata read from source does not.
4493
- hasIsolatedClientBoundaries: _optionalChain([layoutHydrationMetadata, 'access', _330 => _330[index], 'optionalAccess', _331 => _331.hasIsolatedClientBoundaries]) === true,
4494
- islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access', _332 => _332[index], 'optionalAccess', _333 => _333.islandStrategy]), () => ( null))
4523
+ hasIsolatedClientBoundaries: _optionalChain([layoutHydrationMetadata, 'access', _332 => _332[index], 'optionalAccess', _333 => _333.hasIsolatedClientBoundaries]) === true,
4524
+ islandStrategy: _nullishCoalesce(_optionalChain([layoutHydrationMetadata, 'access', _334 => _334[index], 'optionalAccess', _335 => _335.islandStrategy]), () => ( null))
4495
4525
  })),
4496
4526
  server.config.root,
4497
4527
  true
@@ -4548,7 +4578,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
4548
4578
  const slotModule = await routeManager3.loadRouteModule(slot.route.modulePath);
4549
4579
  const slotMetadata = _nullishCoalesce(navigationManifest.slots.find(
4550
4580
  (entry) => entry.name === slot.name && entry.ownerPattern === slot.ownerPattern && entry.pattern === slot.route.pattern
4551
- ), () => ( _chunkSJQ24IB5cjs.getClientModuleMetadata.call(void 0, slot.route.modulePath, server.config.root)));
4581
+ ), () => ( _chunkBY5VQ57Wcjs.getClientModuleMetadata.call(void 0, slot.route.modulePath, server.config.root)));
4552
4582
  const slotContext = await _chunkYZMSJRM5cjs.resolveFarmRouteContext.call(void 0, farmApp.getConfig(), {
4553
4583
  request: targetRequest,
4554
4584
  params: slot.params,
@@ -4598,7 +4628,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
4598
4628
  pageShouldHydrate: shouldHydrate,
4599
4629
  layoutShouldHydrate: shouldHydrateLayout,
4600
4630
  islandStrategy: hydrationIslandStrategy,
4601
- rendering: _chunkGL4SPJTEcjs.resolveRouteRenderingConfig.call(void 0, routeModule)
4631
+ rendering: _chunk7Q6KUXH6cjs.resolveRouteRenderingConfig.call(void 0, routeModule)
4602
4632
  });
4603
4633
  const destinationLayoutPatterns = layouts.map((layout) => layout.pattern);
4604
4634
  const layoutStartIndex = _chunkIGBQSUT5cjs.getSharedLayoutPrefixLength.call(void 0,
@@ -4612,13 +4642,13 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
4612
4642
  middlewareContext,
4613
4643
  () => renderer.renderNavigationFragment({
4614
4644
  PageComponent: routeModule.default,
4615
- LoadingComponent: _optionalChain([loadingModule, 'optionalAccess', _334 => _334.default]),
4645
+ LoadingComponent: _optionalChain([loadingModule, 'optionalAccess', _336 => _336.default]),
4616
4646
  pageProps: routeProps,
4617
4647
  params,
4618
4648
  layouts: layouts.map((layout, index) => ({
4619
4649
  pattern: layout.pattern,
4620
4650
  module: layoutModules[index],
4621
- serverTree: _optionalChain([layoutHydrationMetadata, 'access', _335 => _335[index], 'optionalAccess', _336 => _336.serverTree])
4651
+ serverTree: _optionalChain([layoutHydrationMetadata, 'access', _337 => _337[index], 'optionalAccess', _338 => _338.serverTree])
4622
4652
  })),
4623
4653
  layoutStartIndex,
4624
4654
  slots: routeSlots.map((slot) => ({
@@ -4726,14 +4756,14 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
4726
4756
  trustProxy: currentServerConfig.trustProxy
4727
4757
  }).pathname;
4728
4758
  const routeManager2 = farmApp.getRouteManager();
4729
- const hasBeforeRequestHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _337 => _337.hasHook, 'call', _338 => _338("beforeRequest")]), () => ( false));
4730
- const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _339 => _339.hasHook, 'call', _340 => _340("afterResponse")]), () => ( false));
4731
- const hasHTMLTransformHook = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _341 => _341.hasHook, 'call', _342 => _342("transformHTML")]), () => ( false))) || (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _343 => _343.hasHook, 'call', _344 => _344("afterRender")]), () => ( false)));
4759
+ const hasBeforeRequestHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _339 => _339.hasHook, 'call', _340 => _340("beforeRequest")]), () => ( false));
4760
+ const hasAfterResponseHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _341 => _341.hasHook, 'call', _342 => _342("afterResponse")]), () => ( false));
4761
+ const hasHTMLTransformHook = (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _343 => _343.hasHook, 'call', _344 => _344("transformHTML")]), () => ( false))) || (_nullishCoalesce(_optionalChain([pm, 'optionalAccess', _345 => _345.hasHook, 'call', _346 => _346("afterRender")]), () => ( false)));
4732
4762
  const opensRuntimeSession = pm ? opensFarmDevRuntimeSession(pm) : false;
4733
- const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _345 => _345.hasRuntimeHook, 'call', _346 => _346("after")]), () => ( false));
4763
+ const hasRuntimeAfterHook = _nullishCoalesce(_optionalChain([pm, 'optionalAccess', _347 => _347.hasRuntimeHook, 'call', _348 => _348("after")]), () => ( false));
4734
4764
  const pageBuiltInRouteLabel = (pathname2) => {
4735
4765
  const routePathname = _chunkTFCBJFP7cjs.stripFarmBasePath.call(void 0, pathname2, farmConfig.basePath);
4736
- const mcpLabel = _chunkL7Z6OAE2cjs.resolveFarmMCPRouteLabel.call(void 0, routePathname, apiServerBasePath);
4766
+ const mcpLabel = _chunkPVR63WHWcjs.resolveFarmMCPRouteLabel.call(void 0, routePathname, apiServerBasePath);
4737
4767
  if (mcpLabel) return mcpLabel;
4738
4768
  if (farmAgentGeneratedPaths(farmConfig).includes(routePathname)) return routePathname;
4739
4769
  return routePathname === _chunkR6GOH5CHcjs.FARM_DEFAULT_MCP_PATH && farmApp.getServerRenderer().getDefaultMCPServer() ? _chunkR6GOH5CHcjs.FARM_DEFAULT_MCP_PATH : null;
@@ -4742,13 +4772,13 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
4742
4772
  const match = routeManager2.matchRoute(pathname2);
4743
4773
  return {
4744
4774
  kind: "page",
4745
- route: _chunkL7Z6OAE2cjs.setFarmRouteLabel.call(void 0,
4775
+ route: _chunkPVR63WHWcjs.setFarmRouteLabel.call(void 0,
4746
4776
  {
4747
4777
  pathname: pathname2,
4748
- pattern: _optionalChain([match, 'optionalAccess', _347 => _347.route, 'optionalAccess', _348 => _348.pattern]) || null,
4749
- params: _optionalChain([match, 'optionalAccess', _349 => _349.params]) || {}
4778
+ pattern: _optionalChain([match, 'optionalAccess', _349 => _349.route, 'optionalAccess', _350 => _350.pattern]) || null,
4779
+ params: _optionalChain([match, 'optionalAccess', _351 => _351.params]) || {}
4750
4780
  },
4751
- _optionalChain([match, 'optionalAccess', _350 => _350.route]) ? null : pageBuiltInRouteLabel(pathname2)
4781
+ _optionalChain([match, 'optionalAccess', _352 => _352.route]) ? null : pageBuiltInRouteLabel(pathname2)
4752
4782
  )
4753
4783
  };
4754
4784
  };
@@ -4828,7 +4858,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
4828
4858
  }) : void 0;
4829
4859
  let middlewareFailed = false;
4830
4860
  try {
4831
- if (_optionalChain([middlewareManager, 'optionalAccess', _351 => _351.hasMiddleware, 'call', _352 => _352()])) {
4861
+ if (_optionalChain([middlewareManager, 'optionalAccess', _353 => _353.hasMiddleware, 'call', _354 => _354()])) {
4832
4862
  const middlewareRequest = createRequestFromNodeRequest(req, new URL(fullUrl));
4833
4863
  const handled = await runFarmMiddlewareWithNavigation(
4834
4864
  farmApp.getServerRenderer(),
@@ -4841,7 +4871,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
4841
4871
  throw error;
4842
4872
  });
4843
4873
  if (handled) {
4844
- if (!_optionalChain([responseInterceptor, 'optionalAccess', _353 => _353.isEnded, 'call', _354 => _354()])) {
4874
+ if (!_optionalChain([responseInterceptor, 'optionalAccess', _355 => _355.isEnded, 'call', _356 => _356()])) {
4845
4875
  const duration = Date.now() - startTime;
4846
4876
  logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
4847
4877
  }
@@ -4856,8 +4886,8 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
4856
4886
  res
4857
4887
  );
4858
4888
  }
4859
- if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess', _355 => _355.isEnded, 'call', _356 => _356()])) {
4860
- if (!_optionalChain([responseInterceptor, 'optionalAccess', _357 => _357.isEnded, 'call', _358 => _358()])) {
4889
+ if (res.writableEnded || _optionalChain([responseInterceptor, 'optionalAccess', _357 => _357.isEnded, 'call', _358 => _358()])) {
4890
+ if (!_optionalChain([responseInterceptor, 'optionalAccess', _359 => _359.isEnded, 'call', _360 => _360()])) {
4861
4891
  const duration = Date.now() - startTime;
4862
4892
  logResponse(method, urlPath, res.statusCode || 200, duration, "PAGE");
4863
4893
  }
@@ -4876,8 +4906,8 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
4876
4906
  await pm.reportRuntimeRequestError(runtimeSession, error);
4877
4907
  } else {
4878
4908
  await pm.failRuntimeRequest(runtimeSession, error);
4879
- if (!res.headersSent && !_optionalChain([responseInterceptor, 'optionalAccess', _359 => _359.isEnded, 'call', _360 => _360()])) {
4880
- _optionalChain([responseInterceptor, 'optionalAccess', _361 => _361.release, 'call', _362 => _362()]);
4909
+ if (!res.headersSent && !_optionalChain([responseInterceptor, 'optionalAccess', _361 => _361.isEnded, 'call', _362 => _362()])) {
4910
+ _optionalChain([responseInterceptor, 'optionalAccess', _363 => _363.release, 'call', _364 => _364()]);
4881
4911
  console.error("[FARM] Page error:", error);
4882
4912
  sendFarmDevRuntimeHookError(res, runtimeHookErrorAnswersJSON);
4883
4913
  return;
@@ -4894,7 +4924,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
4894
4924
  }
4895
4925
  })
4896
4926
  );
4897
- const farmRequestMiddleware = _optionalChain([farmMiddlewares, 'access', _363 => _363.stack, 'access', _364 => _364.at, 'call', _365 => _365(-1), 'optionalAccess', _366 => _366.handle]);
4927
+ const farmRequestMiddleware = _optionalChain([farmMiddlewares, 'access', _365 => _365.stack, 'access', _366 => _366.at, 'call', _367 => _367(-1), 'optionalAccess', _368 => _368.handle]);
4898
4928
  if (farmOwnsDevCors && viteServer.config.server.cors === false) {
4899
4929
  farmMiddlewares.use(createFarmDevViteCorsMiddleware());
4900
4930
  }
@@ -4923,7 +4953,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
4923
4953
  });
4924
4954
  }
4925
4955
  if (id.startsWith("@farm.js/core/internal/") && importer && isOutsideAppRoot(importer)) {
4926
- const root = _optionalChain([farmApp, 'optionalAccess', _367 => _367.getConfig, 'call', _368 => _368(), 'access', _369 => _369.root]) || _optionalChain([server, 'optionalAccess', _370 => _370.config, 'access', _371 => _371.root]) || options.root;
4956
+ const root = _optionalChain([farmApp, 'optionalAccess', _369 => _369.getConfig, 'call', _370 => _370(), 'access', _371 => _371.root]) || _optionalChain([server, 'optionalAccess', _372 => _372.config, 'access', _373 => _373.root]) || options.root;
4927
4957
  return this.resolve(id, path6.join(root, "package.json"), {
4928
4958
  ...resolveOptions,
4929
4959
  skipSelf: true
@@ -4937,7 +4967,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
4937
4967
  const imageId = await imageImports.resolveId.call(this, id, importer, resolveOptions);
4938
4968
  if (imageId) return imageId;
4939
4969
  }
4940
- if (_chunkPYPHM7AScjs.parseProgrammaticRouteModuleId.call(void 0, id)) {
4970
+ if (_chunkLH7S7FI3cjs.parseProgrammaticRouteModuleId.call(void 0, id)) {
4941
4971
  return id;
4942
4972
  }
4943
4973
  if (isFarmClientVirtualId(id) || id === FARM_DEV_CLIENT_BOOT_ID) {
@@ -4951,7 +4981,7 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
4951
4981
  }
4952
4982
  },
4953
4983
  async load(id, loadOptions) {
4954
- if (pendingClientSetup && !_optionalChain([loadOptions, 'optionalAccess', _372 => _372.ssr]) && !farmSetupContext.getStore()) {
4984
+ if (pendingClientSetup && !_optionalChain([loadOptions, 'optionalAccess', _374 => _374.ssr]) && !farmSetupContext.getStore()) {
4955
4985
  await pendingClientSetup;
4956
4986
  }
4957
4987
  if (_chunk7O3YJ6NPcjs.isFarmServerFnBoundaryId.call(void 0, id) && islandsServerFns()) {
@@ -4968,9 +4998,9 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
4968
4998
  const imageModule = await imageImports.load.call(this, id);
4969
4999
  if (imageModule) return imageModule;
4970
5000
  }
4971
- if (_chunkPYPHM7AScjs.parseProgrammaticRouteModuleId.call(void 0, id)) {
4972
- const renderer = _optionalChain([farmApp, 'optionalAccess', _373 => _373.getConfig, 'call', _374 => _374(), 'access', _375 => _375.renderer]) || _chunkLEZJZX4Ccjs.resolveFarmRenderer.call(void 0, options.renderer);
4973
- const root = _optionalChain([server, 'optionalAccess', _376 => _376.config, 'access', _377 => _377.root]) || options.root;
5001
+ if (_chunkLH7S7FI3cjs.parseProgrammaticRouteModuleId.call(void 0, id)) {
5002
+ const renderer = _optionalChain([farmApp, 'optionalAccess', _375 => _375.getConfig, 'call', _376 => _376(), 'access', _377 => _377.renderer]) || _chunkLEZJZX4Ccjs.resolveFarmRenderer.call(void 0, options.renderer);
5003
+ const root = _optionalChain([server, 'optionalAccess', _378 => _378.config, 'access', _379 => _379.root]) || options.root;
4974
5004
  if (isClientEnvironment(this, loadOptions)) {
4975
5005
  return generateProgrammaticClientRouteModuleForId(
4976
5006
  id,
@@ -4986,19 +5016,19 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
4986
5016
  return FARM_DEV_CLIENT_BOOT_MODULE;
4987
5017
  }
4988
5018
  if (isFarmClientVirtualId(id)) {
4989
- const resolvedConfig = _optionalChain([farmApp, 'optionalAccess', _378 => _378.getConfig, 'call', _379 => _379()]);
4990
- const renderer = _optionalChain([resolvedConfig, 'optionalAccess', _380 => _380.renderer]) || _chunkLEZJZX4Ccjs.resolveFarmRenderer.call(void 0, options.renderer);
4991
- const integrations = _optionalChain([resolvedConfig, 'optionalAccess', _381 => _381.integrations]) || options.integrations;
4992
- const root = _optionalChain([resolvedConfig, 'optionalAccess', _382 => _382.root]) || _optionalChain([server, 'optionalAccess', _383 => _383.config, 'access', _384 => _384.root]) || process.cwd();
4993
- const docs = _optionalChain([resolvedConfig, 'optionalAccess', _385 => _385.docs]);
5019
+ const resolvedConfig = _optionalChain([farmApp, 'optionalAccess', _380 => _380.getConfig, 'call', _381 => _381()]);
5020
+ const renderer = _optionalChain([resolvedConfig, 'optionalAccess', _382 => _382.renderer]) || _chunkLEZJZX4Ccjs.resolveFarmRenderer.call(void 0, options.renderer);
5021
+ const integrations = _optionalChain([resolvedConfig, 'optionalAccess', _383 => _383.integrations]) || options.integrations;
5022
+ const root = _optionalChain([resolvedConfig, 'optionalAccess', _384 => _384.root]) || _optionalChain([server, 'optionalAccess', _385 => _385.config, 'access', _386 => _386.root]) || process.cwd();
5023
+ const docs = _optionalChain([resolvedConfig, 'optionalAccess', _387 => _387.docs]);
4994
5024
  const adapterOwnsDocsRuntime = _chunkVZ2P6GRCcjs.hasFarmDocsRuntimeAdapter.call(void 0, docs);
4995
- const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _386 => _386.devtools]), () => ( _chunkRQSPBWXJcjs.resolveFarmDevtoolsConfig.call(void 0, false, "production")));
5025
+ const devtools = _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _388 => _388.devtools]), () => ( _chunkRQSPBWXJcjs.resolveFarmDevtoolsConfig.call(void 0, false, "production")));
4996
5026
  const [docsRuntime, docsSearchRuntime, devtoolsClientRuntime] = await Promise.all([
4997
- _optionalChain([docs, 'optionalAccess', _387 => _387.enabled]) ? loadFarmDocsDevRuntime() : null,
4998
- _optionalChain([docs, 'optionalAccess', _388 => _388.enabled]) && !adapterOwnsDocsRuntime ? loadFarmDocsSearchDevRuntime() : null,
5027
+ _optionalChain([docs, 'optionalAccess', _389 => _389.enabled]) ? loadFarmDocsDevRuntime() : null,
5028
+ _optionalChain([docs, 'optionalAccess', _390 => _390.enabled]) && !adapterOwnsDocsRuntime ? loadFarmDocsSearchDevRuntime() : null,
4999
5029
  devtools.enabled ? loadFarmDevtoolsClientRuntime() : null
5000
5030
  ]);
5001
- const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess', _389 => _389.isFarmDocsSearchEnabled, 'call', _390 => _390(docs)]), () => ( false));
5031
+ const docsSearchEnabled = _nullishCoalesce(_optionalChain([docsSearchRuntime, 'optionalAccess', _391 => _391.isFarmDocsSearchEnabled, 'call', _392 => _392(docs)]), () => ( false));
5002
5032
  const generatedDocsSearchRuntime = docsSearchRuntime ? docsSearchRuntime.generateFarmDocsSearchClientRuntime(
5003
5033
  docsSearchEnabled,
5004
5034
  docsSearchEnabled ? docsSearchRuntime.resolveFarmDocsSearchClientModule(root) : void 0
@@ -5006,8 +5036,8 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
5006
5036
  const generatedDevtoolsClientRuntime = devtoolsClientRuntime ? devtoolsClientRuntime.generateFarmDevtoolsClientRuntime(devtools) : "";
5007
5037
  const generatedDevIndicatorsClientRuntime = farmApp ? _chunkVZ2P6GRCcjs.generateFarmDevIndicatorsClientRuntime.call(void 0, farmApp.getConfig().devIndicators) : "";
5008
5038
  const integrationProviders = _chunkN4AM7Q34cjs.getIntegrationProviders.call(void 0, integrations);
5009
- const isolatedHydrationMode = _chunkSJQ24IB5cjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
5010
- _optionalChain([resolvedConfig, 'optionalAccess', _391 => _391.experimental, 'optionalAccess', _392 => _392.isolatedClientHydration]),
5039
+ const isolatedHydrationMode = _chunkBY5VQ57Wcjs.resolveFarmIsolatedClientHydrationMode.call(void 0,
5040
+ _optionalChain([resolvedConfig, 'optionalAccess', _393 => _393.experimental, 'optionalAccess', _394 => _394.isolatedClientHydration]),
5011
5041
  {
5012
5042
  serverComponents: _chunkCYUTK4JPcjs.resolveFarmServerComponentsMode.call(void 0, _chunkCYUTK4JPcjs.readFarmServerComponentsConfig.call(void 0, resolvedConfig)) === "rsc",
5013
5043
  hasUnsupportedIntegrationProvider: integrationProviders.filter((provider) => provider.component || provider.type === "clerk").some((provider) => !_chunkN4AM7Q34cjs.providerSupportsIslands.call(void 0, provider))
@@ -5017,22 +5047,22 @@ function farmPlugin(options = {}, initialPluginManager, deferredSetup) {
5017
5047
  integrationProviders,
5018
5048
  [
5019
5049
  ..._chunkN4AM7Q34cjs.getIntegrationDocumentNavigationMatchers.call(void 0, integrations),
5020
- ..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess', _393 => _393.getFarmDocsDocumentNavigationMatchers, 'call', _394 => _394(docs)]), () => ( []))
5050
+ ..._nullishCoalesce(_optionalChain([docsRuntime, 'optionalAccess', _395 => _395.getFarmDocsDocumentNavigationMatchers, 'call', _396 => _396(docs)]), () => ( []))
5021
5051
  ],
5022
5052
  generatedDocsSearchRuntime,
5023
5053
  `${generatedDevtoolsClientRuntime}
5024
5054
  ${generatedDevIndicatorsClientRuntime}`,
5025
- _optionalChain([resolvedConfig, 'optionalAccess', _395 => _395.plugins]) || [],
5055
+ _optionalChain([resolvedConfig, 'optionalAccess', _397 => _397.plugins]) || [],
5026
5056
  root,
5027
- _optionalChain([resolvedConfig, 'optionalAccess', _396 => _396.srcDir]) || options.srcDir || "src",
5028
- _optionalChain([resolvedConfig, 'optionalAccess', _397 => _397.publicRuntimeConfig]) || options.publicRuntimeConfig,
5029
- adapterOwnsDocsRuntime ? _chunkVZ2P6GRCcjs.getFarmDocsAdapterUIModule.call(void 0, _optionalChain([docs, 'optionalAccess', _398 => _398.adapter])) : void 0,
5057
+ _optionalChain([resolvedConfig, 'optionalAccess', _398 => _398.srcDir]) || options.srcDir || "src",
5058
+ _optionalChain([resolvedConfig, 'optionalAccess', _399 => _399.publicRuntimeConfig]) || options.publicRuntimeConfig,
5059
+ adapterOwnsDocsRuntime ? _chunkVZ2P6GRCcjs.getFarmDocsAdapterUIModule.call(void 0, _optionalChain([docs, 'optionalAccess', _400 => _400.adapter])) : void 0,
5030
5060
  renderer,
5031
- isolatedHydrationMode === "enabled" || _chunkLEZJZX4Ccjs.isReactRenderer.call(void 0, renderer) && _optionalChain([(_nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _399 => _399.getRouteManager, 'call', _400 => _400(), 'access', _401 => _401.getIsolatedClientBoundaryModules, 'call', _402 => _402(root)])))), 'optionalAccess', _403 => _403.size]) > 0,
5032
- _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _404 => _404.trailingSlash]), () => ( false)),
5033
- _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _405 => _405.basePath]), () => ( "/")),
5034
- _chunkBEAQVRMQcjs.generateClientCachePersistenceCode.call(void 0,
5035
- _chunkBEAQVRMQcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, _optionalChain([resolvedConfig, 'optionalAccess', _406 => _406.cache]))
5061
+ isolatedHydrationMode === "enabled" || _chunkLEZJZX4Ccjs.isReactRenderer.call(void 0, renderer) && _optionalChain([(_nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _401 => _401.getRouteManager, 'call', _402 => _402(), 'access', _403 => _403.getIsolatedClientBoundaryModules, 'call', _404 => _404(root)])))), 'optionalAccess', _405 => _405.size]) > 0,
5062
+ _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _406 => _406.trailingSlash]), () => ( false)),
5063
+ _nullishCoalesce(_optionalChain([resolvedConfig, 'optionalAccess', _407 => _407.basePath]), () => ( "/")),
5064
+ _chunk76ES7BCOcjs.generateClientCachePersistenceCode.call(void 0,
5065
+ _chunk76ES7BCOcjs.resolveFarmClientCacheAdapterEntry.call(void 0, root, _optionalChain([resolvedConfig, 'optionalAccess', _408 => _408.cache]))
5036
5066
  ),
5037
5067
  adapterOwnsDocsRuntime ? _chunkP4ZLFUNBcjs.getFarmDocsAdapterConfigModule.call(void 0, docs) : void 0,
5038
5068
  _chunkCYUTK4JPcjs.resolveFarmServerComponentsMode.call(void 0, _chunkCYUTK4JPcjs.readFarmServerComponentsConfig.call(void 0, resolvedConfig)) === "islands"
@@ -5042,7 +5072,7 @@ ${generatedDevIndicatorsClientRuntime}`,
5042
5072
  return generateServerCode();
5043
5073
  }
5044
5074
  if (id === "/@farm/manifest") {
5045
- const routeManager = _optionalChain([farmApp, 'optionalAccess', _407 => _407.getRouteManager, 'call', _408 => _408()]);
5075
+ const routeManager = _optionalChain([farmApp, 'optionalAccess', _409 => _409.getRouteManager, 'call', _410 => _410()]);
5046
5076
  if (!routeManager) {
5047
5077
  return `
5048
5078
  export const getManifest = () => ({
@@ -5054,11 +5084,11 @@ export const getManifest = () => ({
5054
5084
  });
5055
5085
  `;
5056
5086
  }
5057
- const globalStylesheetHref = _chunkBEAQVRMQcjs.resolveDevGlobalStylesheetHref.call(void 0,
5087
+ const globalStylesheetHref = _chunk76ES7BCOcjs.resolveDevGlobalStylesheetHref.call(void 0,
5058
5088
  server.config.root,
5059
- _optionalChain([farmApp, 'optionalAccess', _409 => _409.getConfig, 'call', _410 => _410(), 'access', _411 => _411.srcDir])
5089
+ _optionalChain([farmApp, 'optionalAccess', _411 => _411.getConfig, 'call', _412 => _412(), 'access', _413 => _413.srcDir])
5060
5090
  );
5061
- const fullManifest = _chunkBEAQVRMQcjs.createFarmDevClientManifest.call(void 0,
5091
+ const fullManifest = _chunk76ES7BCOcjs.createFarmDevClientManifest.call(void 0,
5062
5092
  routeManager.generateClientManifest(server.config.root),
5063
5093
  {
5064
5094
  sharedAssets: globalStylesheetHref ? [{ tag: "link", attrs: { rel: "stylesheet", href: globalStylesheetHref } }] : []
@@ -5074,51 +5104,51 @@ export { manifest };
5074
5104
  }
5075
5105
  },
5076
5106
  async transform(code, id, transformOptions) {
5077
- if (pendingClientSetup && !_optionalChain([transformOptions, 'optionalAccess', _412 => _412.ssr]) && !farmSetupContext.getStore()) {
5107
+ if (pendingClientSetup && !_optionalChain([transformOptions, 'optionalAccess', _414 => _414.ssr]) && !farmSetupContext.getStore()) {
5078
5108
  await pendingClientSetup;
5079
5109
  }
5080
- const runtimeModule = !isBuild && _optionalChain([transformOptions, 'optionalAccess', _413 => _413.ssr]) === true && isOutsideAppRoot(id) ? toFarmRuntimeModuleId : void 0;
5081
- const actionConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _414 => _414.getConfig, 'call', _415 => _415()]), () => ( options));
5110
+ const runtimeModule = !isBuild && _optionalChain([transformOptions, 'optionalAccess', _415 => _415.ssr]) === true && isOutsideAppRoot(id) ? toFarmRuntimeModuleId : void 0;
5111
+ const actionConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _416 => _416.getConfig, 'call', _417 => _417()]), () => ( options));
5082
5112
  let rewrotePackageImports = false;
5083
- if (_chunkCYUTK4JPcjs.resolveFarmServerComponentsMode.call(void 0, _chunkCYUTK4JPcjs.readFarmServerComponentsConfig.call(void 0, actionConfig)) === "islands" && (!id.includes("/node_modules/") && !isFarmCoreModule(id) || _optionalChain([transformOptions, 'optionalAccess', _416 => _416.ssr]) === true && farmReactServerFiles.has(id.split("?", 1)[0])) && !id.startsWith("\0") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id) && !_chunkSJQ24IB5cjs.hasUseClientDirective.call(void 0, code)) {
5113
+ if (_chunkCYUTK4JPcjs.resolveFarmServerComponentsMode.call(void 0, _chunkCYUTK4JPcjs.readFarmServerComponentsConfig.call(void 0, actionConfig)) === "islands" && (!id.includes("/node_modules/") && !isFarmCoreModule(id) || _optionalChain([transformOptions, 'optionalAccess', _418 => _418.ssr]) === true && farmReactServerFiles.has(id.split("?", 1)[0])) && !id.startsWith("\0") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id) && !_chunkBY5VQ57Wcjs.hasUseClientDirective.call(void 0, code)) {
5084
5114
  const file = id.split("?", 1)[0];
5085
- const projectRoot = actionConfig.root || _optionalChain([server, 'optionalAccess', _417 => _417.config, 'access', _418 => _418.root]) || process.cwd();
5115
+ const projectRoot = actionConfig.root || _optionalChain([server, 'optionalAccess', _419 => _419.config, 'access', _420 => _420.root]) || process.cwd();
5086
5116
  const buildSnapshot = isBuild ? options.sourceSnapshot : void 0;
5087
5117
  const rewrite = () => {
5088
- if (_optionalChain([transformOptions, 'optionalAccess', _419 => _419.ssr]) === true) {
5118
+ if (_optionalChain([transformOptions, 'optionalAccess', _421 => _421.ssr]) === true) {
5089
5119
  if (farmReactServerFiles.has(file)) {
5090
- for (const child of _chunkSJQ24IB5cjs.farmRelativeImportFiles.call(void 0, code, file))
5120
+ for (const child of _chunkBY5VQ57Wcjs.farmRelativeImportFiles.call(void 0, code, file))
5091
5121
  farmReactServerFiles.add(child);
5092
5122
  }
5093
- const serverModule = farmReactServerFiles.has(file) || !_chunkSJQ24IB5cjs.getFarmClientReachableModules.call(void 0,
5123
+ const serverModule = farmReactServerFiles.has(file) || !_chunkBY5VQ57Wcjs.getFarmClientReachableModules.call(void 0,
5094
5124
  path6.resolve(projectRoot, actionConfig.srcDir || "src"),
5095
5125
  projectRoot
5096
5126
  ).has(path6.resolve(file));
5097
- const reactServer = !serverModule ? null : _chunkSJQ24IB5cjs.rewriteFarmReactServerImports.call(void 0, {
5127
+ const reactServer = !serverModule ? null : _chunkBY5VQ57Wcjs.rewriteFarmReactServerImports.call(void 0, {
5098
5128
  code,
5099
5129
  file,
5100
- reference: (specifier, exportName) => _chunkSJQ24IB5cjs.ensureFarmPackageClientReference.call(void 0, projectRoot, specifier, exportName, file),
5130
+ reference: (specifier, exportName) => _chunkBY5VQ57Wcjs.ensureFarmPackageClientReference.call(void 0, projectRoot, specifier, exportName, file),
5101
5131
  onServerFile: (serverFile) => farmReactServerFiles.add(serverFile)
5102
5132
  });
5103
5133
  if (reactServer !== null) {
5104
5134
  code = reactServer;
5105
5135
  rewrotePackageImports = true;
5106
5136
  }
5107
- const internal = farmReactServerFiles.has(file) ? _chunkSJQ24IB5cjs.rewriteFarmReactServerClientModuleImports.call(void 0, {
5137
+ const internal = farmReactServerFiles.has(file) ? _chunkBY5VQ57Wcjs.rewriteFarmReactServerClientModuleImports.call(void 0, {
5108
5138
  code,
5109
5139
  file,
5110
- reference: (clientFile) => _chunkSJQ24IB5cjs.ensureFarmInternalClientReference.call(void 0, projectRoot, clientFile)
5140
+ reference: (clientFile) => _chunkBY5VQ57Wcjs.ensureFarmInternalClientReference.call(void 0, projectRoot, clientFile)
5111
5141
  }) : null;
5112
5142
  if (internal !== null) {
5113
5143
  code = internal;
5114
5144
  rewrotePackageImports = true;
5115
5145
  }
5116
5146
  }
5117
- const rewritePackageImports = (source2) => _chunkSJQ24IB5cjs.rewriteFarmPackageClientImports.call(void 0, {
5147
+ const rewritePackageImports = (source2) => _chunkBY5VQ57Wcjs.rewriteFarmPackageClientImports.call(void 0, {
5118
5148
  code: source2,
5119
5149
  file,
5120
5150
  root: projectRoot,
5121
- isClientPackage: (specifier) => _chunkSJQ24IB5cjs.isFarmPackageClientBoundary.call(void 0, file, specifier, projectRoot)
5151
+ isClientPackage: (specifier) => _chunkBY5VQ57Wcjs.isFarmPackageClientBoundary.call(void 0, file, specifier, projectRoot)
5122
5152
  });
5123
5153
  const source = code;
5124
5154
  const referenced = inspectPackages(() => rewritePackageImports(source));
@@ -5126,11 +5156,11 @@ export { manifest };
5126
5156
  code = referenced;
5127
5157
  rewrotePackageImports = true;
5128
5158
  }
5129
- if (_optionalChain([transformOptions, 'optionalAccess', _420 => _420.ssr]) === true) {
5159
+ if (_optionalChain([transformOptions, 'optionalAccess', _422 => _422.ssr]) === true) {
5130
5160
  const cached = rewriteFarmReactCacheImport(
5131
5161
  code,
5132
5162
  file,
5133
- _optionalChain([runtimeModule, 'optionalCall', _421 => _421(FARM_REACT_CACHE_MODULE)])
5163
+ _optionalChain([runtimeModule, 'optionalCall', _423 => _423(FARM_REACT_CACHE_MODULE)])
5134
5164
  );
5135
5165
  if (cached !== null) {
5136
5166
  code = cached;
@@ -5138,12 +5168,12 @@ export { manifest };
5138
5168
  }
5139
5169
  }
5140
5170
  };
5141
- if (buildSnapshot) _chunkSJQ24IB5cjs.withFarmSourceSnapshotOf.call(void 0, buildSnapshot, rewrite);
5171
+ if (buildSnapshot) _chunkBY5VQ57Wcjs.withFarmSourceSnapshotOf.call(void 0, buildSnapshot, rewrite);
5142
5172
  else rewrite();
5143
5173
  }
5144
5174
  if (islandsServerFns() && !_chunk7O3YJ6NPcjs.isFarmServerFnBoundaryId.call(void 0, id) && !id.includes("/node_modules/") && /\.[cm]?[jt]sx?(?:$|\?)/.test(id)) {
5145
5175
  const serverFns = _chunk7O3YJ6NPcjs.transformFarmServerFns.call(void 0, code, id, {
5146
- environment: _optionalChain([transformOptions, 'optionalAccess', _422 => _422.ssr]) === true ? "rsc" : "client"
5176
+ environment: _optionalChain([transformOptions, 'optionalAccess', _424 => _424.ssr]) === true ? "rsc" : "client"
5147
5177
  });
5148
5178
  if (serverFns) {
5149
5179
  if (!serverFns.code.includes("use server")) return { code: serverFns.code, map: null };
@@ -5156,8 +5186,8 @@ export { manifest };
5156
5186
  const actionModule = transformFarmFormActionModule({
5157
5187
  code,
5158
5188
  id,
5159
- root: actionConfig.root || _optionalChain([server, 'optionalAccess', _423 => _423.config, 'access', _424 => _424.root]) || process.cwd(),
5160
- ssr: _optionalChain([transformOptions, 'optionalAccess', _425 => _425.ssr]) === true,
5189
+ root: actionConfig.root || _optionalChain([server, 'optionalAccess', _425 => _425.config, 'access', _426 => _426.root]) || process.cwd(),
5190
+ ssr: _optionalChain([transformOptions, 'optionalAccess', _427 => _427.ssr]) === true,
5161
5191
  // Parsed by file type: page components are TSX.
5162
5192
  parse: (source) => _vite.parseSync.call(void 0, file, source).program,
5163
5193
  runtimeModule,
@@ -5165,21 +5195,21 @@ export { manifest };
5165
5195
  });
5166
5196
  if (actionModule) return { code: actionModule, map: null };
5167
5197
  }
5168
- if (!_optionalChain([transformOptions, 'optionalAccess', _426 => _426.ssr])) {
5169
- const docsConfigModule = _chunkP4ZLFUNBcjs.getFarmDocsAdapterConfigModule.call(void 0, _optionalChain([farmApp, 'optionalAccess', _427 => _427.getConfig, 'call', _428 => _428(), 'optionalAccess', _429 => _429.docs]));
5170
- if (_chunkBEAQVRMQcjs.isFarmDocsClientConfigModule.call(void 0, id, docsConfigModule)) {
5171
- const redacted = _chunkBEAQVRMQcjs.redactFarmDocsClientConfig.call(void 0, code, id.split("?")[0]);
5198
+ if (!_optionalChain([transformOptions, 'optionalAccess', _428 => _428.ssr])) {
5199
+ const docsConfigModule = _chunkP4ZLFUNBcjs.getFarmDocsAdapterConfigModule.call(void 0, _optionalChain([farmApp, 'optionalAccess', _429 => _429.getConfig, 'call', _430 => _430(), 'optionalAccess', _431 => _431.docs]));
5200
+ if (_chunk76ES7BCOcjs.isFarmDocsClientConfigModule.call(void 0, id, docsConfigModule)) {
5201
+ const redacted = _chunk76ES7BCOcjs.redactFarmDocsClientConfig.call(void 0, code, id.split("?")[0]);
5172
5202
  if (redacted !== null) return { code: redacted, map: null };
5173
5203
  }
5174
5204
  }
5175
- if (!_optionalChain([transformOptions, 'optionalAccess', _430 => _430.ssr])) {
5176
- const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _431 => _431.getConfig, 'call', _432 => _432()]), () => ( options));
5177
- if ((_optionalChain([currentConfig, 'access', _433 => _433.experimental, 'optionalAccess', _434 => _434.serverActions]) !== true || !serverFnTransformActive) && !islandsServerFns()) {
5205
+ if (!_optionalChain([transformOptions, 'optionalAccess', _432 => _432.ssr])) {
5206
+ const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _433 => _433.getConfig, 'call', _434 => _434()]), () => ( options));
5207
+ if ((_optionalChain([currentConfig, 'access', _435 => _435.experimental, 'optionalAccess', _436 => _436.serverActions]) !== true || !serverFnTransformActive) && !islandsServerFns()) {
5178
5208
  const violation = findClientServerFnViolation(code, id);
5179
5209
  if (violation) {
5180
- const locate = _chunkSJQ24IB5cjs.createFarmSourceLocator.call(void 0, code, () => this.getCombinedSourcemap());
5210
+ const locate = _chunkBY5VQ57Wcjs.createFarmSourceLocator.call(void 0, code, () => this.getCombinedSourcemap());
5181
5211
  this.error(
5182
- _chunkSJQ24IB5cjs.formatFarmDiagnostic.call(void 0,
5212
+ _chunkBY5VQ57Wcjs.formatFarmDiagnostic.call(void 0,
5183
5213
  createServerFnBoundaryDiagnostic(violation, id, locate(violation.start)),
5184
5214
  currentConfig.root
5185
5215
  )
@@ -5187,8 +5217,8 @@ export { manifest };
5187
5217
  }
5188
5218
  }
5189
5219
  }
5190
- if (!_optionalChain([transformOptions, 'optionalAccess', _435 => _435.ssr]) && shouldInspectClientBoundary(id, code)) {
5191
- await warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _436 => _436.getConfig, 'call', _437 => _437()]), () => ( options)));
5220
+ if (!_optionalChain([transformOptions, 'optionalAccess', _437 => _437.ssr]) && shouldInspectClientBoundary(id, code)) {
5221
+ await warnClientBoundaryOnce(this, id, code, _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _438 => _438.getConfig, 'call', _439 => _439()]), () => ( options)));
5192
5222
  }
5193
5223
  if (typeof imageImports.transform === "function") {
5194
5224
  const imageModule = await imageImports.transform.call(this, code, id, transformOptions);
@@ -5203,13 +5233,13 @@ export { manifest };
5203
5233
  id,
5204
5234
  transformOptions
5205
5235
  );
5206
- const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess', _438 => _438.code, 'optionalAccess', _439 => _439.toString, 'call', _440 => _440()]);
5236
+ const fontCode = typeof fontResult === "string" ? fontResult : _optionalChain([fontResult, 'optionalAccess', _440 => _440.code, 'optionalAccess', _441 => _441.toString, 'call', _442 => _442()]);
5207
5237
  if (fontCode) {
5208
5238
  transformedCode = fontCode;
5209
5239
  transformed = true;
5210
5240
  }
5211
5241
  }
5212
- if (_optionalChain([transformOptions, 'optionalAccess', _441 => _441.ssr]) && server) {
5242
+ if (_optionalChain([transformOptions, 'optionalAccess', _443 => _443.ssr]) && server) {
5213
5243
  const rewrittenImports = rewriteEarlySsrRelativeImports({
5214
5244
  code: transformedCode,
5215
5245
  id,
@@ -5221,27 +5251,27 @@ export { manifest };
5221
5251
  transformed = true;
5222
5252
  }
5223
5253
  }
5224
- if (_chunkSJQ24IB5cjs.hasUseClientDirective.call(void 0, transformedCode)) {
5254
+ if (_chunkBY5VQ57Wcjs.hasUseClientDirective.call(void 0, transformedCode)) {
5225
5255
  const clientBoundarySource = transformedCode;
5226
5256
  const moduleInfo = this.getModuleInfo(id);
5227
5257
  if (moduleInfo) {
5228
5258
  moduleInfo.isClientComponent = true;
5229
5259
  }
5230
- transformedCode = _chunkSJQ24IB5cjs.stripUseClientDirective.call(void 0, transformedCode);
5260
+ transformedCode = _chunkBY5VQ57Wcjs.stripUseClientDirective.call(void 0, transformedCode);
5231
5261
  transformed = true;
5232
- const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _442 => _442.getConfig, 'call', _443 => _443()]), () => ( options));
5262
+ const currentConfig = _nullishCoalesce(_optionalChain([farmApp, 'optionalAccess', _444 => _444.getConfig, 'call', _445 => _445()]), () => ( options));
5233
5263
  let isolatedModuleReference = null;
5234
5264
  let rendererIslandModule = false;
5235
- const root = currentConfig.root || _optionalChain([server, 'optionalAccess', _444 => _444.config, 'access', _445 => _445.root]) || process.cwd();
5265
+ const root = currentConfig.root || _optionalChain([server, 'optionalAccess', _446 => _446.config, 'access', _447 => _447.root]) || process.cwd();
5236
5266
  const cleanId = id.split("?", 1)[0];
5237
- const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _446 => _446.getRouteManager, 'call', _447 => _447(), 'access', _448 => _448.getIsolatedClientBoundaryModules, 'call', _449 => _449(root)])));
5238
- const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess', _450 => _450.has, 'call', _451 => _451(path6.resolve(cleanId))]) === true;
5239
- if (_chunkLEZJZX4Ccjs.isReactRenderer.call(void 0, _chunkLEZJZX4Ccjs.resolveFarmRenderer.call(void 0, currentConfig.renderer)) && selectedForIsolatedHydration && (_chunkSJQ24IB5cjs.isIsolatableClientBoundarySource.call(void 0, clientBoundarySource) || // A generated client reference, whose marker comment compiled TSX no longer has.
5240
- cleanId.replace(/\\/g, "/").includes(_chunkSJQ24IB5cjs.FARM_CLIENT_REFERENCE_DIRECTORY))) {
5267
+ const selectedIsolatedModules = _nullishCoalesce(options.isolatedClientBoundaryModules, () => ( _optionalChain([farmApp, 'optionalAccess', _448 => _448.getRouteManager, 'call', _449 => _449(), 'access', _450 => _450.getIsolatedClientBoundaryModules, 'call', _451 => _451(root)])));
5268
+ const selectedForIsolatedHydration = _optionalChain([selectedIsolatedModules, 'optionalAccess', _452 => _452.has, 'call', _453 => _453(path6.resolve(cleanId))]) === true;
5269
+ if (_chunkLEZJZX4Ccjs.isReactRenderer.call(void 0, _chunkLEZJZX4Ccjs.resolveFarmRenderer.call(void 0, currentConfig.renderer)) && selectedForIsolatedHydration && (_chunkBY5VQ57Wcjs.isIsolatableClientBoundarySource.call(void 0, clientBoundarySource) || // A generated client reference, whose marker comment compiled TSX no longer has.
5270
+ cleanId.replace(/\\/g, "/").includes(_chunkBY5VQ57Wcjs.FARM_CLIENT_REFERENCE_DIRECTORY))) {
5241
5271
  isolatedModuleReference = _chunk7ZDLE77Pcjs.toViteModuleId.call(void 0, cleanId, root);
5242
5272
  const islandsMode = _chunkCYUTK4JPcjs.resolveFarmServerComponentsMode.call(void 0, _chunkCYUTK4JPcjs.readFarmServerComponentsConfig.call(void 0, currentConfig)) === "islands";
5243
- const explicitStrategy = _chunkSJQ24IB5cjs.getIslandStrategyExport.call(void 0, clientBoundarySource);
5244
- const inference = islandsMode && explicitStrategy === null ? _chunkBEAQVRMQcjs.inferFarmIslandStrategy.call(void 0, cleanId, root) : null;
5273
+ const explicitStrategy = _chunkBY5VQ57Wcjs.getIslandStrategyExport.call(void 0, clientBoundarySource);
5274
+ const inference = islandsMode && explicitStrategy === null ? _chunk76ES7BCOcjs.inferFarmIslandStrategy.call(void 0, cleanId, root) : null;
5245
5275
  if (inference) {
5246
5276
  for (const file of inference.files) {
5247
5277
  if (file !== path6.resolve(cleanId)) this.addWatchFile(file);
@@ -5254,8 +5284,8 @@ export { manifest };
5254
5284
  islandStrategy: _nullishCoalesce(explicitStrategy, () => ( "load")),
5255
5285
  parse: (source) => this.parse(source),
5256
5286
  slots: islandsMode,
5257
- browser: _optionalChain([transformOptions, 'optionalAccess', _452 => _452.ssr]) !== true,
5258
- inferredInteraction: _optionalChain([inference, 'optionalAccess', _453 => _453.strategy]) === "interaction",
5287
+ browser: _optionalChain([transformOptions, 'optionalAccess', _454 => _454.ssr]) !== true,
5288
+ inferredInteraction: _optionalChain([inference, 'optionalAccess', _455 => _455.strategy]) === "interaction",
5259
5289
  runtimeModule
5260
5290
  });
5261
5291
  if (!transformedBoundary) {
@@ -5264,14 +5294,14 @@ export { manifest };
5264
5294
  );
5265
5295
  }
5266
5296
  transformedCode = transformedBoundary;
5267
- } else if (selectedForIsolatedHydration && _chunkGUYGMTWAcjs.usesFarmRendererIslands.call(void 0, currentConfig) && (_chunkSJQ24IB5cjs.isIsolatableClientBoundarySource.call(void 0, clientBoundarySource) || cleanId.replace(/\\/g, "/").includes(_chunkSJQ24IB5cjs.FARM_CLIENT_REFERENCE_DIRECTORY))) {
5297
+ } else if (selectedForIsolatedHydration && _chunkGUYGMTWAcjs.usesFarmRendererIslands.call(void 0, currentConfig) && (_chunkBY5VQ57Wcjs.isIsolatableClientBoundarySource.call(void 0, clientBoundarySource) || cleanId.replace(/\\/g, "/").includes(_chunkBY5VQ57Wcjs.FARM_CLIENT_REFERENCE_DIRECTORY))) {
5268
5298
  rendererIslandModule = true;
5269
- if (_optionalChain([transformOptions, 'optionalAccess', _454 => _454.ssr]) === true) {
5299
+ if (_optionalChain([transformOptions, 'optionalAccess', _456 => _456.ssr]) === true) {
5270
5300
  const renderer = _chunkLEZJZX4Ccjs.resolveFarmRenderer.call(void 0, currentConfig.renderer);
5271
5301
  const transformedBoundary = transformIsolatedClientBoundaryModule({
5272
5302
  code: transformedCode,
5273
5303
  moduleReference: _chunk7ZDLE77Pcjs.toViteModuleId.call(void 0, cleanId, root),
5274
- islandStrategy: _nullishCoalesce(_chunkSJQ24IB5cjs.getIslandStrategyExport.call(void 0, clientBoundarySource), () => ( "load")),
5304
+ islandStrategy: _nullishCoalesce(_chunkBY5VQ57Wcjs.getIslandStrategyExport.call(void 0, clientBoundarySource), () => ( "load")),
5275
5305
  parse: (source) => this.parse(source),
5276
5306
  withIsland: renderer.server
5277
5307
  });
@@ -5304,7 +5334,7 @@ export { manifest };
5304
5334
  );
5305
5335
  return;
5306
5336
  }` : "";
5307
- const rendererIslandHmr = rendererIslandModule && !_optionalChain([transformOptions, 'optionalAccess', _455 => _455.ssr]) && !/\bimport\.meta\.hot\b/.test(transformedCode) && shouldEmitFarmClientRootHmr(currentConfig.renderer);
5337
+ const rendererIslandHmr = rendererIslandModule && !_optionalChain([transformOptions, 'optionalAccess', _457 => _457.ssr]) && !/\bimport\.meta\.hot\b/.test(transformedCode) && shouldEmitFarmClientRootHmr(currentConfig.renderer);
5308
5338
  const hmrCode = rendererIslandHmr ? `
5309
5339
  if (import.meta.hot) {
5310
5340
  import.meta.hot.accept((newModule) => {
@@ -5314,7 +5344,7 @@ if (import.meta.hot) {
5314
5344
  }
5315
5345
  });
5316
5346
  }
5317
- ` : _optionalChain([transformOptions, 'optionalAccess', _456 => _456.ssr]) || reactRefreshActive || rendererIslandModule || !shouldEmitFarmClientRootHmr(currentConfig.renderer) ? "" : `
5347
+ ` : _optionalChain([transformOptions, 'optionalAccess', _458 => _458.ssr]) || reactRefreshActive || rendererIslandModule || !shouldEmitFarmClientRootHmr(currentConfig.renderer) ? "" : `
5318
5348
  if (import.meta.hot) {
5319
5349
  import.meta.hot.accept((newModule) => {
5320
5350
  ${isolatedHmrUpdate}
@@ -5370,14 +5400,14 @@ if (import.meta.hot) {
5370
5400
  }
5371
5401
  _chunk7ZDLE77Pcjs.logger.info(`Found ${ssgPages.length} SSG pages, ${ssrRoutes.length} SSR routes`);
5372
5402
  _chunk7ZDLE77Pcjs.logger.info("Pre-rendering SSG pages...");
5373
- const outDir = path6.join(_optionalChain([server, 'optionalAccess', _457 => _457.config, 'access', _458 => _458.root]) || process.cwd(), options.outDir || "dist");
5403
+ const outDir = path6.join(_optionalChain([server, 'optionalAccess', _459 => _459.config, 'access', _460 => _460.root]) || process.cwd(), options.outDir || "dist");
5374
5404
  const clientDir = path6.join(outDir, "client");
5375
5405
  for (const page of ssgPages) {
5376
5406
  try {
5377
5407
  const staticRequest = new Request(new URL(page.urlPath, "http://farm.static"));
5378
5408
  await farmApp.getServerRenderer().runWithRequestContext(staticRequest, async () => {
5379
5409
  const mod = await routeManager.loadRouteModule(page.filePath);
5380
- if (!_optionalChain([mod, 'optionalAccess', _459 => _459.default])) return;
5410
+ if (!_optionalChain([mod, 'optionalAccess', _461 => _461.default])) return;
5381
5411
  const { layouts } = routeManager.matchRoute(page.urlPath);
5382
5412
  const layoutModules = await Promise.all(
5383
5413
  layouts.map((l) => routeManager.loadLayoutModule(l.modulePath))
@@ -5409,7 +5439,7 @@ if (import.meta.hot) {
5409
5439
  const i18nSnapshot = _chunkYCIFGYBYcjs.getFarmI18nClientSnapshot.call(void 0, );
5410
5440
  const i18nHead = renderFarmI18nStaticHead(page.urlPath, i18nSnapshot);
5411
5441
  const fullHtml = `<!DOCTYPE html>
5412
- <html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess', _460 => _460.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}>
5442
+ <html lang="${escapeFarmHtmlAttribute(_optionalChain([i18nSnapshot, 'optionalAccess', _462 => _462.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}>
5413
5443
  <head>
5414
5444
  <meta charset="utf-8">
5415
5445
  <meta name="viewport" content="width=device-width, initial-scale=1">
@@ -5454,11 +5484,11 @@ if (import.meta.hot) {
5454
5484
  watchChange(id, change) {
5455
5485
  const watched = _chunk7ZDLE77Pcjs.toPosixPath.call(void 0, id);
5456
5486
  const appSource = !watched.includes("/node_modules/") && !isFarmGeneratedOutput(watched);
5457
- if (appSource) _optionalChain([farmApp, 'optionalAccess', _461 => _461.getRouteManager, 'call', _462 => _462(), 'access', _463 => _463.noteSourceChange, 'call', _464 => _464(id, change.event)]);
5458
- _chunkSJQ24IB5cjs.noteFarmClientReachableModuleChange.call(void 0, id, change.event, { appSource });
5459
- _chunkSJQ24IB5cjs.invalidateFarmClientOnlyScan.call(void 0, id, change.event);
5460
- _chunkBEAQVRMQcjs.invalidateFarmRouteRootInferences.call(void 0, id, change.event);
5461
- _chunkSJQ24IB5cjs.dropLatestPackageClientBoundaryCache.call(void 0, );
5487
+ if (appSource) _optionalChain([farmApp, 'optionalAccess', _463 => _463.getRouteManager, 'call', _464 => _464(), 'access', _465 => _465.noteSourceChange, 'call', _466 => _466(id, change.event)]);
5488
+ _chunkBY5VQ57Wcjs.noteFarmClientReachableModuleChange.call(void 0, id, change.event, { appSource });
5489
+ _chunkBY5VQ57Wcjs.invalidateFarmClientOnlyScan.call(void 0, id, change.event);
5490
+ _chunk76ES7BCOcjs.invalidateFarmRouteRootInferences.call(void 0, id, change.event);
5491
+ _chunkBY5VQ57Wcjs.dropLatestPackageClientBoundaryCache.call(void 0, );
5462
5492
  },
5463
5493
  async handleHotUpdate(ctx) {
5464
5494
  if (pendingClientSetup && !farmSetupContext.getStore()) await pendingClientSetup;
@@ -5483,7 +5513,7 @@ if (import.meta.hot) {
5483
5513
  server2.moduleGraph.invalidateModule(mod);
5484
5514
  }
5485
5515
  }
5486
- const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess', _465 => _465.getConfig, 'call', _466 => _466()]);
5516
+ const currentFarmConfig = _optionalChain([farmApp, 'optionalAccess', _467 => _467.getConfig, 'call', _468 => _468()]);
5487
5517
  const normalizedFile = file.replace(/\\/g, "/");
5488
5518
  const reloadAfterEdit = () => {
5489
5519
  for (const files of pendingRouteReloads) {
@@ -5491,10 +5521,10 @@ if (import.meta.hot) {
5491
5521
  }
5492
5522
  server2.ws.send({ type: "full-reload", path: "*" });
5493
5523
  };
5494
- if (normalizedFile.includes(_chunkSJQ24IB5cjs.FARM_CLIENT_REFERENCE_DIRECTORY) && normalizedFile.startsWith(
5524
+ if (normalizedFile.includes(_chunkBY5VQ57Wcjs.FARM_CLIENT_REFERENCE_DIRECTORY) && normalizedFile.startsWith(
5495
5525
  path6.posix.join(
5496
- _chunk7ZDLE77Pcjs.toPosixPath.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess', _467 => _467.root]) || options.root || server2.config.root),
5497
- _chunkSJQ24IB5cjs.FARM_CLIENT_REFERENCE_DIRECTORY
5526
+ _chunk7ZDLE77Pcjs.toPosixPath.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess', _469 => _469.root]) || options.root || server2.config.root),
5527
+ _chunkBY5VQ57Wcjs.FARM_CLIENT_REFERENCE_DIRECTORY
5498
5528
  )
5499
5529
  ))
5500
5530
  return modules;
@@ -5505,17 +5535,17 @@ if (import.meta.hot) {
5505
5535
  (appDir) => normalizedFile.startsWith(`${_chunk7ZDLE77Pcjs.toPosixPath.call(void 0, appDir)}/api/`)
5506
5536
  )) {
5507
5537
  for (const mod of modules) server2.moduleGraph.invalidateModule(mod);
5508
- await _optionalChain([refreshRouteDiscovery, 'optionalCall', _468 => _468(`updated ${file}`)]);
5538
+ await _optionalChain([refreshRouteDiscovery, 'optionalCall', _470 => _470(`updated ${file}`)]);
5509
5539
  reloadAfterEdit();
5510
5540
  return [];
5511
5541
  }
5512
5542
  const currentSrcRoot = currentFarmConfig ? _chunkPFVNPOKNcjs.getFarmSourceRoots.call(void 0, currentFarmConfig).map((source) => path6.join(source.root, source.srcDir).replace(/\\/g, "/")).find((sourceRoot) => normalizedFile.startsWith(`${sourceRoot}/`)) || null : null;
5513
- if (currentSrcRoot && normalizedFile.startsWith(`${currentSrcRoot}/`) && _chunkPYPHM7AScjs.isProgrammaticRoutesFileName.call(void 0, normalizedFile)) {
5543
+ if (currentSrcRoot && normalizedFile.startsWith(`${currentSrcRoot}/`) && _chunkLH7S7FI3cjs.isProgrammaticRoutesFileName.call(void 0, normalizedFile)) {
5514
5544
  logUpdate("PAGE", `updated ${path6.basename(file)}`);
5515
5545
  for (const mod of modules) {
5516
5546
  server2.moduleGraph.invalidateModule(mod);
5517
5547
  }
5518
- await _optionalChain([refreshRouteDiscovery, 'optionalCall', _469 => _469(`updated ${file}`)]);
5548
+ await _optionalChain([refreshRouteDiscovery, 'optionalCall', _471 => _471(`updated ${file}`)]);
5519
5549
  reloadAfterEdit();
5520
5550
  return [];
5521
5551
  }
@@ -5525,22 +5555,27 @@ if (import.meta.hot) {
5525
5555
  for (const mod of modules) {
5526
5556
  server2.moduleGraph.invalidateModule(mod);
5527
5557
  }
5528
- await _optionalChain([refreshRouteDiscovery, 'optionalCall', _470 => _470(`updated ${file}`)]);
5558
+ await _optionalChain([refreshRouteDiscovery, 'optionalCall', _472 => _472(`updated ${file}`)]);
5529
5559
  reloadAfterEdit();
5530
5560
  return [];
5531
5561
  }
5532
5562
  if (apiRouteManager && _chunkVB7P66Q4cjs.invalidateFarmDevDependents.call(void 0, server2, file, apiRouteManager.getSourceFiles()).length > 0) {
5533
- await _optionalChain([refreshRouteDiscovery, 'optionalCall', _471 => _471(`updated ${file}`)]);
5563
+ await _optionalChain([refreshRouteDiscovery, 'optionalCall', _473 => _473(`updated ${file}`)]);
5564
+ }
5565
+ if (_optionalChain([refreshFarmDocsConfig, 'optionalCall', _474 => _474(file)])) {
5566
+ logUpdate("PAGE", `updated ${path6.basename(file)}`);
5567
+ reloadAfterEdit();
5568
+ return [];
5534
5569
  }
5535
- const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess', _472 => _472.experimental, 'optionalAccess', _473 => _473.isolatedClientHydration]);
5536
- const planRouteManager = _optionalChain([farmApp, 'optionalAccess', _474 => _474.getRouteManager, 'call', _475 => _475()]);
5570
+ const isolatedHydrationMode = _optionalChain([currentFarmConfig, 'optionalAccess', _475 => _475.experimental, 'optionalAccess', _476 => _476.isolatedClientHydration]);
5571
+ const planRouteManager = _optionalChain([farmApp, 'optionalAccess', _477 => _477.getRouteManager, 'call', _478 => _478()]);
5537
5572
  const isHydrationPlanSource = /\.[cm]?[jt]sx?$/.test(normalizedFile) && !normalizedFile.includes("/node_modules/") && !isFarmGeneratedOutput(normalizedFile);
5538
- const tracksAsyncOwnerIslands = _chunkLEZJZX4Ccjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess', _476 => _476.renderer])) && planRouteManager !== void 0;
5573
+ const tracksAsyncOwnerIslands = _chunkLEZJZX4Ccjs.isReactRenderer.call(void 0, _optionalChain([currentFarmConfig, 'optionalAccess', _479 => _479.renderer])) && planRouteManager !== void 0;
5539
5574
  let clientPlanCurrent = false;
5540
5575
  if (isHydrationPlanSource && (isolatedHydrationMode === "enabled" || isolatedHydrationMode === "analyze" || tracksAsyncOwnerIslands)) {
5541
5576
  const routeManager = planRouteManager;
5542
- await _optionalChain([ctx, 'access', _477 => _477.read, 'optionalCall', _478 => _478()]);
5543
- if (_optionalChain([routeManager, 'optionalAccess', _479 => _479.isEditPlanNeutral, 'call', _480 => _480(file)])) {
5577
+ await _optionalChain([ctx, 'access', _480 => _480.read, 'optionalCall', _481 => _481()]);
5578
+ if (_optionalChain([routeManager, 'optionalAccess', _482 => _482.isEditPlanNeutral, 'call', _483 => _483(file)])) {
5544
5579
  clientPlanCurrent = true;
5545
5580
  } else if (routeManager) {
5546
5581
  routeManager.noteSourceChange(file, "update");
@@ -5584,7 +5619,7 @@ if (import.meta.hot) {
5584
5619
  }
5585
5620
  }
5586
5621
  }
5587
- const rendererRouteFile = _optionalChain([farmApp, 'optionalAccess', _481 => _481.getRouteManager, 'call', _482 => _482(), 'access', _483 => _483.isRendererRouteModule, 'call', _484 => _484(normalizedFile)]) === true;
5622
+ const rendererRouteFile = _optionalChain([farmApp, 'optionalAccess', _484 => _484.getRouteManager, 'call', _485 => _485(), 'access', _486 => _486.isRendererRouteModule, 'call', _487 => _487(normalizedFile)]) === true;
5588
5623
  if (normalizedFile.includes("/app/") || rendererRouteFile) {
5589
5624
  if (normalizedFile.includes("middleware.")) {
5590
5625
  if (middlewareManager) {
@@ -5602,7 +5637,7 @@ if (import.meta.hot) {
5602
5637
  }
5603
5638
  return [];
5604
5639
  }
5605
- if (!clientPlanCurrent) _optionalChain([farmApp, 'optionalAccess', _485 => _485.getRouteManager, 'call', _486 => _486(), 'access', _487 => _487.invalidateClientManifest, 'call', _488 => _488()]);
5640
+ if (!clientPlanCurrent) _optionalChain([farmApp, 'optionalAccess', _488 => _488.getRouteManager, 'call', _489 => _489(), 'access', _490 => _490.invalidateClientManifest, 'call', _491 => _491()]);
5606
5641
  const manifestModule = server2.moduleGraph.getModuleById("/@farm/manifest");
5607
5642
  if (manifestModule) {
5608
5643
  server2.moduleGraph.invalidateModule(manifestModule);
@@ -5618,14 +5653,14 @@ if (import.meta.hot) {
5618
5653
  }
5619
5654
  }
5620
5655
  if (currentFarmConfig && planRouteManager && _chunkGUYGMTWAcjs.usesFarmRendererIslands.call(void 0, currentFarmConfig) && shouldEmitFarmClientRootHmr(currentFarmConfig.renderer) && reachesSharedFarmRendererIsland(
5621
- _optionalChain([server2, 'access', _489 => _489.environments, 'access', _490 => _490.client, 'optionalAccess', _491 => _491.moduleGraph]),
5656
+ _optionalChain([server2, 'access', _492 => _492.environments, 'access', _493 => _493.client, 'optionalAccess', _494 => _494.moduleGraph]),
5622
5657
  normalizedFile,
5623
5658
  planRouteManager.getIsolatedClientBoundaryModules(currentFarmConfig.root)
5624
5659
  )) {
5625
5660
  reloadAfterEdit();
5626
5661
  return [];
5627
5662
  }
5628
- if (/\.[cm]?[jt]sx?$/.test(normalizedFile) && !_optionalChain([server2, 'access', _492 => _492.environments, 'access', _493 => _493.client, 'optionalAccess', _494 => _494.moduleGraph, 'access', _495 => _495.getModulesByFile, 'call', _496 => _496(normalizedFile), 'optionalAccess', _497 => _497.size]) && _chunkVB7P66Q4cjs.invalidateFarmDevDependents.call(void 0, server2, file, getFarmRenderedServerModules()).length > 0) {
5663
+ if (/\.[cm]?[jt]sx?$/.test(normalizedFile) && !_optionalChain([server2, 'access', _495 => _495.environments, 'access', _496 => _496.client, 'optionalAccess', _497 => _497.moduleGraph, 'access', _498 => _498.getModulesByFile, 'call', _499 => _499(normalizedFile), 'optionalAccess', _500 => _500.size]) && _chunkVB7P66Q4cjs.invalidateFarmDevDependents.call(void 0, server2, file, getFarmRenderedServerModules()).length > 0) {
5629
5664
  logUpdate("PAGE", `updated ${path6.basename(file)}`);
5630
5665
  reloadAfterEdit();
5631
5666
  return [];
@@ -5633,10 +5668,11 @@ if (import.meta.hot) {
5633
5668
  return modules;
5634
5669
  }
5635
5670
  };
5636
- if (!deferredSetup) return plugin;
5637
5671
  const setUpDevServer = plugin.configureServer;
5672
+ plugin.configureServer = { order: "post", handler: setUpDevServer };
5673
+ if (!deferredSetup) return plugin;
5638
5674
  let deferred = false;
5639
- plugin.configureServer = function(viteServer) {
5675
+ const setUpDeferredDevServer = function(viteServer) {
5640
5676
  if (deferred) {
5641
5677
  deferredGates = void 0;
5642
5678
  return setUpDevServer.call(this, viteServer);
@@ -5666,6 +5702,7 @@ if (import.meta.hot) {
5666
5702
  viteServer.middlewares.use(post);
5667
5703
  };
5668
5704
  };
5705
+ plugin.configureServer = { order: "post", handler: setUpDeferredDevServer };
5669
5706
  return plugin;
5670
5707
  }
5671
5708
  function runFarmMiddlewareWithNavigation(renderer, middlewareRequest, req, res, execute) {
@@ -5723,7 +5760,7 @@ function createPageDataMiddlewareResponse(res) {
5723
5760
  return (...args) => {
5724
5761
  if (captures(target.statusCode, target.getHeader("location"))) {
5725
5762
  const callback = args.find((arg) => typeof arg === "function");
5726
- _optionalChain([callback, 'optionalCall', _498 => _498()]);
5763
+ _optionalChain([callback, 'optionalCall', _501 => _501()]);
5727
5764
  return property === "write" ? true : response;
5728
5765
  }
5729
5766
  return target[property](...args);
@@ -5787,27 +5824,27 @@ function isFarmClientVirtualId(id) {
5787
5824
  }
5788
5825
  function isClientEnvironment(context, loadOptions) {
5789
5826
  const environment = context.environment;
5790
- if (_optionalChain([environment, 'optionalAccess', _499 => _499.config, 'optionalAccess', _500 => _500.consumer])) return environment.config.consumer === "client";
5791
- if (_optionalChain([environment, 'optionalAccess', _501 => _501.name])) return environment.name === "client";
5792
- return _optionalChain([loadOptions, 'optionalAccess', _502 => _502.ssr]) !== true;
5827
+ if (_optionalChain([environment, 'optionalAccess', _502 => _502.config, 'optionalAccess', _503 => _503.consumer])) return environment.config.consumer === "client";
5828
+ if (_optionalChain([environment, 'optionalAccess', _504 => _504.name])) return environment.name === "client";
5829
+ return _optionalChain([loadOptions, 'optionalAccess', _505 => _505.ssr]) !== true;
5793
5830
  }
5794
5831
  function invalidateProgrammaticClientRouteModules(server) {
5795
- const graph = _optionalChain([server, 'access', _503 => _503.environments, 'optionalAccess', _504 => _504.client, 'optionalAccess', _505 => _505.moduleGraph]);
5832
+ const graph = _optionalChain([server, 'access', _506 => _506.environments, 'optionalAccess', _507 => _507.client, 'optionalAccess', _508 => _508.moduleGraph]);
5796
5833
  if (!graph) return;
5797
5834
  for (const [id, module] of graph.idToModuleMap) {
5798
- if (_chunkPYPHM7AScjs.parseProgrammaticRouteModuleId.call(void 0, id)) graph.invalidateModule(module);
5835
+ if (_chunkLH7S7FI3cjs.parseProgrammaticRouteModuleId.call(void 0, id)) graph.invalidateModule(module);
5799
5836
  }
5800
5837
  }
5801
5838
  function generateProgrammaticClientRouteModuleForId(moduleId, root, renderer, clientRoutes, watchFile) {
5802
- const parsed = _chunkPYPHM7AScjs.parseProgrammaticRouteModuleId.call(void 0, moduleId);
5839
+ const parsed = _chunkLH7S7FI3cjs.parseProgrammaticRouteModuleId.call(void 0, moduleId);
5803
5840
  const routesFile = resolveRealModuleFile(parsed.filePath, root);
5804
5841
  watchFile(routesFile);
5805
- return _chunkSJQ24IB5cjs.generateProgrammaticClientRouteModule.call(void 0, {
5842
+ return _chunkBY5VQ57Wcjs.generateProgrammaticClientRouteModule.call(void 0, {
5806
5843
  kind: parsed.kind,
5807
5844
  routePath: parsed.routePath,
5808
5845
  routesFile,
5809
- route: parsed.kind === "api" ? void 0 : _optionalChain([clientRoutes, 'optionalAccess', _506 => _506.routes, 'access', _507 => _507.get, 'call', _508 => _508(
5810
- _chunkSJQ24IB5cjs.programmaticClientRouteKey.call(void 0, routesFile, parsed.kind, parsed.routePath)
5846
+ route: parsed.kind === "api" ? void 0 : _optionalChain([clientRoutes, 'optionalAccess', _509 => _509.routes, 'access', _510 => _510.get, 'call', _511 => _511(
5847
+ _chunkBY5VQ57Wcjs.programmaticClientRouteKey.call(void 0, routesFile, parsed.kind, parsed.routePath)
5811
5848
  )]),
5812
5849
  // React's client module exports no createElement; the main client entry imports React too.
5813
5850
  rendererClient: _chunkLEZJZX4Ccjs.isReactRenderer.call(void 0, renderer) ? "react" : renderer.client,
@@ -5815,7 +5852,7 @@ function generateProgrammaticClientRouteModuleForId(moduleId, root, renderer, cl
5815
5852
  });
5816
5853
  }
5817
5854
  function resolveRealModuleFile(filePath, root) {
5818
- const resolved = _nullishCoalesce(_chunkSJQ24IB5cjs.resolveModuleSourcePath.call(void 0, filePath, root), () => ( filePath));
5855
+ const resolved = _nullishCoalesce(_chunkBY5VQ57Wcjs.resolveModuleSourcePath.call(void 0, filePath, root), () => ( filePath));
5819
5856
  try {
5820
5857
  return _chunk7ZDLE77Pcjs.toPosixPath.call(void 0, fs2.realpathSync(resolved));
5821
5858
  } catch (e29) {
@@ -5823,7 +5860,7 @@ function resolveRealModuleFile(filePath, root) {
5823
5860
  }
5824
5861
  }
5825
5862
  function generateProgrammaticRouteModule(moduleId, root, renderer = _chunkLEZJZX4Ccjs.REACT_RENDERER) {
5826
- const parsed = _chunkPYPHM7AScjs.parseProgrammaticRouteModuleId.call(void 0, moduleId);
5863
+ const parsed = _chunkLH7S7FI3cjs.parseProgrammaticRouteModuleId.call(void 0, moduleId);
5827
5864
  if (!parsed) {
5828
5865
  return "";
5829
5866
  }
@@ -6129,12 +6166,12 @@ async function parseRouteModuleProps(routeModule, input) {
6129
6166
  }
6130
6167
  const schemas = routeModule.__farmRouteSchemas;
6131
6168
  const params = parseRouteModuleSchema(
6132
- _optionalChain([schemas, 'optionalAccess', _509 => _509.params]),
6169
+ _optionalChain([schemas, 'optionalAccess', _512 => _512.params]),
6133
6170
  input.props.params,
6134
6171
  "params",
6135
6172
  input.routePath
6136
6173
  );
6137
- const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess', _510 => _510.search]), input.search, "search", input.routePath);
6174
+ const search = parseRouteModuleSchema(_optionalChain([schemas, 'optionalAccess', _513 => _513.search]), input.search, "search", input.routePath);
6138
6175
  return {
6139
6176
  ...input.props,
6140
6177
  params,
@@ -6154,7 +6191,7 @@ function parseRouteModuleSchema(schema, value, label, routePath) {
6154
6191
  }
6155
6192
  }
6156
6193
  function generateClientCode(integrationProviders = [], documentNavigationMatchers = [], docsSearchClientRuntime = EMPTY_FARM_DOCS_SEARCH_CLIENT_RUNTIME, devtoolsClientRuntime = "", plugins = [], root = process.cwd(), srcDir = "src", publicRuntimeConfig = void 0, docsAdapterUI, renderer = _chunkLEZJZX4Ccjs.REACT_RENDERER, isolatedHydrationEnabled = false, trailingSlash = false, basePath = "/", clientCachePersistence = { imports: "", init: "" }, docsConfigModule, islandValues = false) {
6157
- const providerClientCode = _chunkBEAQVRMQcjs.generateFarmIntegrationProviderClientCode.call(void 0,
6194
+ const providerClientCode = _chunk76ES7BCOcjs.generateFarmIntegrationProviderClientCode.call(void 0,
6158
6195
  integrationProviders,
6159
6196
  root,
6160
6197
  _nullishCoalesce(renderer.componentExtensions, () => ( []))
@@ -6252,7 +6289,7 @@ async function createFarmServerTreePageElement(source, pathname) {
6252
6289
  return null;
6253
6290
  }
6254
6291
  }
6255
- ${islandValues ? `${_chunkBEAQVRMQcjs.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE}
6292
+ ${islandValues ? `${_chunk76ES7BCOcjs.FARM_SERVER_TREE_LAYOUT_CLIENT_SOURCE}
6256
6293
  let farmLastRouteState = null;
6257
6294
 
6258
6295
  // A hot update to a layout tree's client module renders the route again.
@@ -7093,7 +7130,7 @@ async function loadLayoutComponents(layouts = [], params = {}, source) {
7093
7130
  return loadedLayouts;
7094
7131
  }
7095
7132
 
7096
- ${_chunkBEAQVRMQcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
7133
+ ${_chunk76ES7BCOcjs.FARM_LAYOUT_ELEMENT_CLIENT_SOURCE}
7097
7134
  function wrapWithLoadedLayouts(element, loadedLayouts, params) {
7098
7135
  let wrapped = element;
7099
7136
  for (let index = loadedLayouts.length - 1; index >= 0; index--) {
@@ -7393,7 +7430,7 @@ function readActiveLayoutPatterns() {
7393
7430
  );
7394
7431
  }
7395
7432
 
7396
- ${_chunkBEAQVRMQcjs.FARM_NAVIGATION_SCRIPT_SOURCE}
7433
+ ${_chunk76ES7BCOcjs.FARM_NAVIGATION_SCRIPT_SOURCE}
7397
7434
 
7398
7435
  function activateFragmentScripts(root) {
7399
7436
  for (const script of Array.from(root.querySelectorAll?.('script') || [])) {
@@ -7452,7 +7489,7 @@ function getLayoutShell(root, patterns, index, find) {
7452
7489
  return shell.innerHTML;
7453
7490
  }
7454
7491
 
7455
- ${islandValues ? _chunkBEAQVRMQcjs.FARM_REFRESH_FIELDS_SOURCE : ""}function replaceNavigationBoundary(
7492
+ ${islandValues ? _chunk76ES7BCOcjs.FARM_REFRESH_FIELDS_SOURCE : ""}function replaceNavigationBoundary(
7456
7493
  container,
7457
7494
  fragment,
7458
7495
  currentPatterns,
@@ -7527,9 +7564,9 @@ ${islandValues ? `
7527
7564
  return nextTarget;
7528
7565
  }
7529
7566
 
7530
- ${islandValues ? `${_chunkBEAQVRMQcjs.FARM_NAVIGATION_STREAM_READER_SOURCE}
7567
+ ${islandValues ? `${_chunk76ES7BCOcjs.FARM_NAVIGATION_STREAM_READER_SOURCE}
7531
7568
 
7532
- ${_chunkBEAQVRMQcjs.FARM_EARLY_NAVIGATION_SOURCE}
7569
+ ${_chunk76ES7BCOcjs.FARM_EARLY_NAVIGATION_SOURCE}
7533
7570
 
7534
7571
  // Islands mode navigates as the production client does: it fetches the page itself, names the
7535
7572
  // layouts it shows by key (F-Layouts), and asks for flush markers (F-Stream), so the shell arrives
@@ -8235,7 +8272,7 @@ function generateClientManifest(bundle) {
8235
8272
  async function defineConfig(config = {}) {
8236
8273
  const tailwindVitePlugin = await _chunkWAQIO2VDcjs.loadTailwindVitePlugin.call(void 0, );
8237
8274
  const appRoot = path6.resolve(config.root || process.cwd());
8238
- if (_optionalChain([config, 'access', _511 => _511.extends, 'optionalAccess', _512 => _512.length])) {
8275
+ if (_optionalChain([config, 'access', _514 => _514.extends, 'optionalAccess', _515 => _515.length])) {
8239
8276
  const { config: layeredConfig } = await import("./layers-6R55QDT5.cjs").then(
8240
8277
  ({ resolveFarmLayers }) => resolveFarmLayers(config, {
8241
8278
  root: appRoot,
@@ -8245,7 +8282,7 @@ async function defineConfig(config = {}) {
8245
8282
  config = layeredConfig;
8246
8283
  }
8247
8284
  config.renderer = _chunkLEZJZX4Ccjs.resolveFarmRenderer.call(void 0, config.renderer);
8248
- config.images = _chunkBEAQVRMQcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, { root: appRoot, dev: true });
8285
+ config.images = _chunk76ES7BCOcjs.resolveFarmImageProviderForRuntime.call(void 0, config.images, { root: appRoot, dev: true });
8249
8286
  const rendererVitePlugins = await _chunkLEZJZX4Ccjs.loadFarmRendererVitePlugins.call(void 0, config.renderer, appRoot, {
8250
8287
  ssr: true
8251
8288
  });
@@ -8337,13 +8374,13 @@ async function defineConfig(config = {}) {
8337
8374
  if (!serverStarted) {
8338
8375
  serverStarted = true;
8339
8376
  const elapsed = Date.now() - startTime;
8340
- const address = _optionalChain([server, 'access', _513 => _513.httpServer, 'optionalAccess', _514 => _514.address, 'call', _515 => _515()]);
8377
+ const address = _optionalChain([server, 'access', _516 => _516.httpServer, 'optionalAccess', _517 => _517.address, 'call', _518 => _518()]);
8341
8378
  const resolvedPort = typeof address === "object" && address ? address.port : server.config.server.port || port || 3e3;
8342
8379
  const hostConfig = server.config.server.host;
8343
8380
  const isExposed = hostConfig === true || hostConfig === "0.0.0.0";
8344
8381
  console.log("");
8345
8382
  console.log(
8346
- ` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${_chunkA4AYTO2Ecjs.FARM_VERSION}`)} ${pc.dim(`ready in ${elapsed}ms`)}`
8383
+ ` ${pc.bold(pc.green("Farm.js"))} ${pc.dim(`v${_chunkEZRB5N6Scjs.FARM_VERSION}`)} ${pc.dim(`ready in ${elapsed}ms`)}`
8347
8384
  );
8348
8385
  console.log("");
8349
8386
  console.log(
@@ -8377,7 +8414,7 @@ async function defineConfig(config = {}) {
8377
8414
  plugins: [
8378
8415
  // `farm dev --desktop`: only the desktop window gets an answer, as in the packaged app.
8379
8416
  _chunk5RYBQKBYcjs.farmDesktopDevGuardPlugin.call(void 0, config.basePath),
8380
- _chunkBEAQVRMQcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
8417
+ _chunk76ES7BCOcjs.createFarmThemeCssPlugin.call(void 0, config.theme, config.basePath),
8381
8418
  tailwindVitePlugin,
8382
8419
  ...rendererVitePlugins,
8383
8420
  ...reactRefreshPlugins,
@@ -8387,14 +8424,14 @@ async function defineConfig(config = {}) {
8387
8424
  farmNavigationPlugin(config.renderer),
8388
8425
  farmIslandContainersPlugin(config),
8389
8426
  farmPlugin(config),
8390
- _chunkSJQ24IB5cjs.farmEnvironmentFunctionsPlugin.call(void 0, config),
8427
+ _chunkBY5VQ57Wcjs.farmEnvironmentFunctionsPlugin.call(void 0, config),
8391
8428
  farmBrandingPlugin
8392
8429
  ],
8393
8430
  customLogger: farmLogger,
8394
8431
  clearScreen: false,
8395
8432
  optimizeDeps: {
8396
- ..._chunkBEAQVRMQcjs.createFarmClientOptimizeDepsConfig.call(void 0,
8397
- _chunkBEAQVRMQcjs.createFarmClientOptimizeDepsEntries.call(void 0,
8433
+ ..._chunk76ES7BCOcjs.createFarmClientOptimizeDepsConfig.call(void 0,
8434
+ _chunk76ES7BCOcjs.createFarmClientOptimizeDepsEntries.call(void 0,
8398
8435
  appRoot,
8399
8436
  _chunkPFVNPOKNcjs.getFarmAppDirectories.call(void 0, { ...config, root: appRoot })
8400
8437
  ),
@@ -8438,7 +8475,7 @@ async function defineConfig(config = {}) {
8438
8475
  // Stub out problematic server-only modules during dev mode
8439
8476
  alias: {
8440
8477
  ..._chunkPFVNPOKNcjs.getFarmLayerAliases.call(void 0, config.layers),
8441
- ..._chunkBEAQVRMQcjs.createFarmSourceAlias.call(void 0, appRoot, config.srcDir),
8478
+ ..._chunk76ES7BCOcjs.createFarmSourceAlias.call(void 0, appRoot, config.srcDir),
8442
8479
  // Nitro internals that should not be resolved in browser
8443
8480
  "supports-color": "data:text/javascript,export default false; export const supportsColor = false; export const stdout = false; export const stderr = false;",
8444
8481
  "@poppinss/dumper": "data:text/javascript,export default {};",