@farm.js/core 0.1.48 → 0.1.49

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 (135) hide show
  1. package/dist/{agent-mcp-DAjB8Eyu.d.ts → agent-mcp-Bb8hnnqd.d.ts} +1 -1
  2. package/dist/{agent-mcp-CXN3g0eX.d.mts → agent-mcp-ir3v4fHf.d.mts} +1 -1
  3. package/dist/agent-runtime.d.mts +1 -1
  4. package/dist/agent-runtime.d.ts +1 -1
  5. package/dist/api/route-manager.d.mts +3 -3
  6. package/dist/api/route-manager.d.ts +3 -3
  7. package/dist/api/runtime.d.mts +2 -2
  8. package/dist/api/runtime.d.ts +2 -2
  9. package/dist/api.d.mts +3 -3
  10. package/dist/api.d.ts +3 -3
  11. package/dist/{app-DytgRPjJ.d.mts → app-DLzz02du.d.mts} +4 -4
  12. package/dist/{app-manifest-DPgW5ke5.d.mts → app-manifest-Crn8Qd3U.d.mts} +1 -1
  13. package/dist/{app-manifest-BUu7YGAx.d.ts → app-manifest-DNeTKMRL.d.ts} +1 -1
  14. package/dist/app-markdown.d.mts +2 -2
  15. package/dist/app-markdown.d.ts +2 -2
  16. package/dist/{app-VK9sHDn5.d.ts → app-y649szYm.d.ts} +4 -4
  17. package/dist/{chunk-Q2ZKQ6GD.cjs → chunk-4HM5B5RR.cjs} +62 -62
  18. package/dist/{chunk-MZZA6ZQV.mjs → chunk-7PZVXMWG.mjs} +4 -4
  19. package/dist/{chunk-HRLYO2XJ.mjs → chunk-ACI52TCN.mjs} +1 -1
  20. package/dist/{chunk-VDLF2DJA.cjs → chunk-AIHD6VME.cjs} +276 -91
  21. package/dist/{chunk-YSPMY4B7.cjs → chunk-C5S457CK.cjs} +170 -108
  22. package/dist/{chunk-NRFUVDTH.mjs → chunk-DGVVVYKD.mjs} +1 -1
  23. package/dist/{chunk-WUEDTW6E.cjs → chunk-FR4HJDI6.cjs} +21 -0
  24. package/dist/{chunk-HUL4LTC6.cjs → chunk-HTLCLOXQ.cjs} +63 -20
  25. package/dist/{chunk-N7SPZJLY.mjs → chunk-IVHPRF4W.mjs} +5 -5
  26. package/dist/{chunk-6M3HXUBQ.mjs → chunk-J27BZO67.mjs} +21 -0
  27. package/dist/{chunk-JLS6ZLFM.cjs → chunk-J5VCA45K.cjs} +1 -1
  28. package/dist/{chunk-ZGS3ZDF7.cjs → chunk-NPPT4RWF.cjs} +2 -2
  29. package/dist/{chunk-TFA6BUAE.cjs → chunk-OY5XDG24.cjs} +4 -4
  30. package/dist/{chunk-N6SIQJEJ.mjs → chunk-RYDDUCNJ.mjs} +54 -11
  31. package/dist/{chunk-C2R5RVLA.cjs → chunk-VCKGOXFI.cjs} +73 -1
  32. package/dist/{chunk-TQWGOQ7O.mjs → chunk-Z3BXMMFF.mjs} +80 -18
  33. package/dist/{chunk-NE33FRQ5.mjs → chunk-Z4LTSH7D.mjs} +207 -22
  34. package/dist/{chunk-NIPKC4DA.mjs → chunk-ZIBIE7AH.mjs} +72 -0
  35. package/dist/{client-plugins-BlEzV5FO.d.mts → client-plugins-BNBeyLMi.d.mts} +4 -2
  36. package/dist/{client-plugins-DqjCsKMN.d.ts → client-plugins-DFDQUI9Q.d.ts} +4 -2
  37. package/dist/client-plugins.d.mts +1 -1
  38. package/dist/client-plugins.d.ts +1 -1
  39. package/dist/client.d.mts +5 -5
  40. package/dist/client.d.ts +5 -5
  41. package/dist/config.d.mts +1 -1
  42. package/dist/config.d.ts +1 -1
  43. package/dist/desktop.d.mts +2 -2
  44. package/dist/desktop.d.ts +2 -2
  45. package/dist/{dev-guard-4NQ3LFO5.cjs → dev-guard-PLHL6OTJ.cjs} +3 -2
  46. package/dist/{dev-guard-MPZUJFIV.mjs → dev-guard-YO6KPIOQ.mjs} +2 -1
  47. package/dist/docs.d.mts +2 -2
  48. package/dist/docs.d.ts +2 -2
  49. package/dist/{index-CMigAr9f.d.mts → index-CeJ9_s9p.d.mts} +1 -1
  50. package/dist/{index-n3hjOvVC.d.ts → index-DBdiTkNc.d.ts} +1 -1
  51. package/dist/index.cjs +7 -7
  52. package/dist/index.d.mts +15 -15
  53. package/dist/index.d.ts +15 -15
  54. package/dist/index.mjs +6 -6
  55. package/dist/integrations.d.mts +1 -1
  56. package/dist/integrations.d.ts +1 -1
  57. package/dist/internal/app-markdown-runtime.d.mts +2 -2
  58. package/dist/internal/app-markdown-runtime.d.ts +2 -2
  59. package/dist/internal/build-runtime.cjs +9 -8
  60. package/dist/internal/build-runtime.d.mts +3 -3
  61. package/dist/internal/build-runtime.d.ts +3 -3
  62. package/dist/internal/build-runtime.mjs +8 -7
  63. package/dist/internal/client-error-overlay.cjs +4 -4
  64. package/dist/internal/client-error-overlay.mjs +1 -1
  65. package/dist/internal/compression-runtime.d.mts +1 -1
  66. package/dist/internal/compression-runtime.d.ts +1 -1
  67. package/dist/internal/config-runtime.d.mts +2 -2
  68. package/dist/internal/config-runtime.d.ts +2 -2
  69. package/dist/internal/desktop-guard.cjs +2 -2
  70. package/dist/internal/desktop-guard.d.mts +7 -0
  71. package/dist/internal/desktop-guard.d.ts +7 -0
  72. package/dist/internal/desktop-guard.mjs +1 -1
  73. package/dist/internal/infra-analytics-runtime.cjs +5 -5
  74. package/dist/internal/infra-analytics-runtime.mjs +3 -3
  75. package/dist/internal/islands-runtime.cjs +4 -1
  76. package/dist/internal/islands-runtime.d.mts +9 -12
  77. package/dist/internal/islands-runtime.d.ts +9 -12
  78. package/dist/internal/islands-runtime.mjs +5 -2
  79. package/dist/internal/product-telemetry-runtime.cjs +2 -2
  80. package/dist/internal/product-telemetry-runtime.mjs +1 -1
  81. package/dist/internal/production-runtime.cjs +4 -4
  82. package/dist/internal/production-runtime.d.mts +10 -10
  83. package/dist/internal/production-runtime.d.ts +10 -10
  84. package/dist/internal/production-runtime.mjs +3 -3
  85. package/dist/markdown.d.mts +1 -1
  86. package/dist/markdown.d.ts +1 -1
  87. package/dist/middleware.d.mts +3 -3
  88. package/dist/middleware.d.ts +3 -3
  89. package/dist/navigation.d.mts +4 -4
  90. package/dist/navigation.d.ts +4 -4
  91. package/dist/plugin.cjs +6 -6
  92. package/dist/plugin.d.mts +3 -3
  93. package/dist/plugin.d.ts +3 -3
  94. package/dist/plugin.mjs +5 -5
  95. package/dist/{production-runtime-YVDGYWBG.d.ts → production-runtime-B3qFFtKF.d.ts} +1 -1
  96. package/dist/{production-runtime-bWZJMcQb.d.mts → production-runtime-DcD-GRAv.d.mts} +1 -1
  97. package/dist/{programmatic-routes-client-BFKOTEXN.d.mts → programmatic-routes-client-DzbYGiZQ.d.mts} +2 -2
  98. package/dist/{programmatic-routes-client-DviwGeAv.d.ts → programmatic-routes-client-fD9f4XqU.d.ts} +2 -2
  99. package/dist/{render-plan-DqWXo3-B.d.ts → render-plan-B6cfssrr.d.ts} +1 -1
  100. package/dist/{render-plan-CS8l0zaK.d.mts → render-plan-DqJ51ufr.d.mts} +1 -1
  101. package/dist/renderer-client.d.mts +3 -3
  102. package/dist/renderer-client.d.ts +3 -3
  103. package/dist/{request-D4XqmnJF.d.mts → request-UuAxHn8h.d.mts} +1 -1
  104. package/dist/{request-CBrHpaCC.d.ts → request-jhvUMXRx.d.ts} +1 -1
  105. package/dist/request.d.mts +2 -2
  106. package/dist/request.d.ts +2 -2
  107. package/dist/{route-rendering-3pRPtyO2.d.mts → route-rendering-Cou00t1X.d.mts} +1 -1
  108. package/dist/{route-rendering-Bltnu8a3.d.ts → route-rendering-Sn50cYZf.d.ts} +1 -1
  109. package/dist/{router-BFSmKGtI.d.mts → router-0X9DCTcm.d.mts} +1 -1
  110. package/dist/{router-DDT7bkg7.d.ts → router-xwLvi48p.d.ts} +1 -1
  111. package/dist/routes.d.mts +1 -1
  112. package/dist/routes.d.ts +1 -1
  113. package/dist/{rsc-pipeline-ULFIB3UT.mjs → rsc-pipeline-F6ZPH5MU.mjs} +2 -1
  114. package/dist/{rsc-pipeline-4KOITP64.cjs → rsc-pipeline-VKHMABDJ.cjs} +3 -2
  115. package/dist/{runtime-Cpylaypt.d.mts → runtime-CMrsyChI.d.mts} +1 -1
  116. package/dist/{runtime-C6yG64je.d.ts → runtime-tkSXZiqO.d.ts} +1 -1
  117. package/dist/server-plugins.d.mts +2 -2
  118. package/dist/server-plugins.d.ts +2 -2
  119. package/dist/server.cjs +18 -18
  120. package/dist/server.d.mts +9 -9
  121. package/dist/server.d.ts +9 -9
  122. package/dist/server.mjs +7 -7
  123. package/dist/{spa-router-CKuS81mi.d.ts → spa-router-B06APnGK.d.ts} +2 -2
  124. package/dist/{spa-router-CkTPnA4L.d.mts → spa-router-B48EjsS1.d.mts} +2 -2
  125. package/dist/testing.d.mts +1 -1
  126. package/dist/testing.d.ts +1 -1
  127. package/dist/{utils-C0ORLYXc.d.ts → utils-C5fyK2tE.d.ts} +1 -1
  128. package/dist/{utils-IA9wVkef.d.mts → utils-hyAwmcN6.d.mts} +1 -1
  129. package/dist/version.cjs +2 -2
  130. package/dist/version.mjs +1 -1
  131. package/dist/vite.cjs +6 -6
  132. package/dist/vite.d.mts +4 -4
  133. package/dist/vite.d.ts +4 -4
  134. package/dist/vite.mjs +5 -5
  135. package/package.json +2 -2
@@ -28,10 +28,12 @@ var _chunkPEHL3IZLcjs = require('./chunk-PEHL3IZL.cjs');
28
28
 
29
29
 
30
30
 
31
- var _chunkC2R5RVLAcjs = require('./chunk-C2R5RVLA.cjs');
32
31
 
33
32
 
34
- var _chunkZGS3ZDF7cjs = require('./chunk-ZGS3ZDF7.cjs');
33
+ var _chunkVCKGOXFIcjs = require('./chunk-VCKGOXFI.cjs');
34
+
35
+
36
+ var _chunkNPPT4RWFcjs = require('./chunk-NPPT4RWF.cjs');
35
37
 
36
38
 
37
39
 
@@ -248,7 +250,7 @@ var _chunkJYT7AN37cjs = require('./chunk-JYT7AN37.cjs');
248
250
  var _chunkB5BBTPJQcjs = require('./chunk-B5BBTPJQ.cjs');
249
251
 
250
252
 
251
- var _chunkJLS6ZLFMcjs = require('./chunk-JLS6ZLFM.cjs');
253
+ var _chunkJ5VCA45Kcjs = require('./chunk-J5VCA45K.cjs');
252
254
 
253
255
 
254
256
 
@@ -1919,8 +1921,8 @@ var RouteManager = class {
1919
1921
  )
1920
1922
  );
1921
1923
  this.orderedLayouts = Array.from(this.layouts.values()).sort(
1922
- (left, right) => _chunkC2R5RVLAcjs.getRouteDirectoryDepth.call(void 0, left.pattern) - _chunkC2R5RVLAcjs.getRouteDirectoryDepth.call(void 0, right.pattern)
1923
- ).map((entry) => ({ entry, groupScope: _chunkC2R5RVLAcjs.getRouteGroupScope.call(void 0, entry.pattern) }));
1924
+ (left, right) => _chunkVCKGOXFIcjs.getRouteDirectoryDepth.call(void 0, left.pattern) - _chunkVCKGOXFIcjs.getRouteDirectoryDepth.call(void 0, right.pattern)
1925
+ ).map((entry) => ({ entry, groupScope: _chunkVCKGOXFIcjs.getRouteGroupScope.call(void 0, entry.pattern) }));
1924
1926
  for (const slot of this.routeSlots.values()) {
1925
1927
  if (!this.routeSlotOwnerSegments.has(slot.ownerPattern)) {
1926
1928
  this.routeSlotOwnerSegments.set(
@@ -2232,15 +2234,15 @@ var RouteManager = class {
2232
2234
  enforceFarmIsolatedHydrationRouteBudget(
2233
2235
  layoutEntries.map(({ entry, metadata }) => ({
2234
2236
  pattern: entry.pattern,
2235
- depth: _chunkC2R5RVLAcjs.getRouteDirectoryDepth.call(void 0, entry.pattern),
2237
+ depth: _chunkVCKGOXFIcjs.getRouteDirectoryDepth.call(void 0, entry.pattern),
2236
2238
  metadata
2237
2239
  })),
2238
2240
  routeEntries.map(({ entry, metadata }) => ({
2239
2241
  pattern: getRouteEntryDirectory(entry),
2240
- depth: _chunkC2R5RVLAcjs.getRouteDirectoryDepth.call(void 0, getRouteEntryDirectory(entry)),
2242
+ depth: _chunkVCKGOXFIcjs.getRouteDirectoryDepth.call(void 0, getRouteEntryDirectory(entry)),
2241
2243
  metadata
2242
2244
  })),
2243
- _chunkC2R5RVLAcjs.routeBoundaryCoversDirectory
2245
+ _chunkVCKGOXFIcjs.routeBoundaryCoversDirectory
2244
2246
  );
2245
2247
  for (const { entry, metadata } of [...layoutEntries, ...routeEntries]) {
2246
2248
  if (!metadata.costGuardExceeded) continue;
@@ -2259,7 +2261,7 @@ var RouteManager = class {
2259
2261
  const routes = routeEntries.map(({ entry, metadata }) => {
2260
2262
  const programmaticPage = this.programmaticPages.get(entry.modulePath);
2261
2263
  const layoutShouldHydrate = layoutEntries.some(
2262
- ({ entry: layout, metadata: layoutMetadata }) => layoutMetadata.shouldHydrate && _chunkC2R5RVLAcjs.routeBoundaryCoversDirectory.call(void 0, layout.pattern, getRouteEntryDirectory(entry))
2264
+ ({ entry: layout, metadata: layoutMetadata }) => layoutMetadata.shouldHydrate && _chunkVCKGOXFIcjs.routeBoundaryCoversDirectory.call(void 0, layout.pattern, getRouteEntryDirectory(entry))
2263
2265
  );
2264
2266
  return {
2265
2267
  pattern: entry.pattern,
@@ -2276,7 +2278,7 @@ var RouteManager = class {
2276
2278
  }))
2277
2279
  } : {},
2278
2280
  ...usesFarmServerTree(metadata) ? { serverTree: true } : {},
2279
- renderPlan: _chunkC2R5RVLAcjs.createFarmRouteRenderPlan.call(void 0, {
2281
+ renderPlan: _chunkVCKGOXFIcjs.createFarmRouteRenderPlan.call(void 0, {
2280
2282
  pageShouldHydrate: metadata.shouldHydrate,
2281
2283
  layoutShouldHydrate,
2282
2284
  islandStrategy: metadata.islandStrategy
@@ -2292,7 +2294,7 @@ var RouteManager = class {
2292
2294
  }))
2293
2295
  };
2294
2296
  });
2295
- const treeLayoutPatterns = islandsMode ? _chunkC2R5RVLAcjs.getFarmServerTreeLayoutPatterns.call(void 0,
2297
+ const treeLayoutPatterns = islandsMode ? _chunkVCKGOXFIcjs.getFarmServerTreeLayoutPatterns.call(void 0,
2296
2298
  layoutEntries.map(({ entry, metadata }) => ({
2297
2299
  pattern: entry.pattern,
2298
2300
  shouldHydrate: metadata.shouldHydrate,
@@ -2471,7 +2473,7 @@ var RouteManager = class {
2471
2473
  */
2472
2474
  createRoutePattern(route) {
2473
2475
  if (route.segments.length === 0) return "/";
2474
- return "/" + route.segments.map(_chunkC2R5RVLAcjs.formatRouteSegment).join("/");
2476
+ return "/" + route.segments.map(_chunkVCKGOXFIcjs.formatRouteSegment).join("/");
2475
2477
  }
2476
2478
  registerPageRoute(entry) {
2477
2479
  _chunkYTVSWXEZcjs.assertUniqueRouteParameters.call(void 0, entry.pattern);
@@ -2565,7 +2567,7 @@ var RouteManager = class {
2565
2567
  for (const file of files) {
2566
2568
  const route = _chunkXN2MB4QZcjs.parseRoutePath.call(void 0, file);
2567
2569
  const modulePath = path4.default.join(appDir, file);
2568
- const pattern = _chunkC2R5RVLAcjs.createRouteDirectoryPattern.call(void 0, route);
2570
+ const pattern = _chunkVCKGOXFIcjs.createRouteDirectoryPattern.call(void 0, route);
2569
2571
  const existing = target.get(pattern);
2570
2572
  if (_optionalChain([existing, 'optionalAccess', _136 => _136.sourceRoot]) === source.root) {
2571
2573
  throw new Error(
@@ -2587,7 +2589,7 @@ var RouteManager = class {
2587
2589
  const modulePath = path4.default.join(appDir, file);
2588
2590
  const pattern = this.createRoutePattern(slot.route);
2589
2591
  const ownerPattern = this.createRoutePattern(slot.ownerRoute);
2590
- const ownerDirectory = _chunkC2R5RVLAcjs.createRouteDirectoryPattern.call(void 0, slot.ownerRoute);
2592
+ const ownerDirectory = _chunkVCKGOXFIcjs.createRouteDirectoryPattern.call(void 0, slot.ownerRoute);
2591
2593
  const key = `${ownerPattern}:${slot.name}:${slot.interception ? "intercept" : "slot"}:${slot.fallback ? "default" : pattern}`;
2592
2594
  const existing = this.routeSlots.get(key);
2593
2595
  if (_optionalChain([existing, 'optionalAccess', _137 => _137.sourceRoot]) === source.root) {
@@ -2704,7 +2706,7 @@ var RouteManager = class {
2704
2706
  }
2705
2707
  if (definition.kind === "layout") {
2706
2708
  const route = _chunkE7QOEV5Zcjs.parseProgrammaticRoutePath.call(void 0, definition.path, "layout");
2707
- const pattern = _chunkC2R5RVLAcjs.createRouteDirectoryPattern.call(void 0, route);
2709
+ const pattern = _chunkVCKGOXFIcjs.createRouteDirectoryPattern.call(void 0, route);
2708
2710
  const existing = this.layouts.get(pattern);
2709
2711
  if (_optionalChain([existing, 'optionalAccess', _141 => _141.sourceRoot]) === source.root) {
2710
2712
  throw new Error(
@@ -2751,7 +2753,7 @@ var RouteManager = class {
2751
2753
  const matchingLayouts = [];
2752
2754
  for (const { entry, groupScope } of this.orderedLayouts) {
2753
2755
  if (!_chunkXN2MB4QZcjs.matchRoutePrefixParts.call(void 0, pathnameParts, entry.route.segments)) continue;
2754
- if (groupScope !== null && !_chunkC2R5RVLAcjs.isInRouteGroupScope.call(void 0, route && getRouteEntryDirectory(route), groupScope)) {
2756
+ if (groupScope !== null && !_chunkVCKGOXFIcjs.isInRouteGroupScope.call(void 0, route && getRouteEntryDirectory(route), groupScope)) {
2755
2757
  continue;
2756
2758
  }
2757
2759
  matchingLayouts.push(entry);
@@ -2832,14 +2834,14 @@ var RouteManager = class {
2832
2834
  let page = route;
2833
2835
  for (const boundaryEntry of boundaries.values()) {
2834
2836
  if (!_chunkXN2MB4QZcjs.matchRoutePrefix.call(void 0, normalizedPath, boundaryEntry.route.segments)) continue;
2835
- const groupScope = _chunkC2R5RVLAcjs.getRouteGroupScope.call(void 0, boundaryEntry.pattern);
2837
+ const groupScope = _chunkVCKGOXFIcjs.getRouteGroupScope.call(void 0, boundaryEntry.pattern);
2836
2838
  if (groupScope !== null) {
2837
2839
  if (page === void 0) page = this.matchPageRoute(_chunkXN2MB4QZcjs.splitRoutePath.call(void 0, normalizedPath));
2838
- if (!_chunkC2R5RVLAcjs.isInRouteGroupScope.call(void 0, page && getRouteEntryDirectory(page), groupScope)) continue;
2840
+ if (!_chunkVCKGOXFIcjs.isInRouteGroupScope.call(void 0, page && getRouteEntryDirectory(page), groupScope)) continue;
2839
2841
  }
2840
2842
  const depth = boundaryEntry.route.segments.length;
2841
2843
  const bestDepth = _nullishCoalesce(_optionalChain([bestMatch, 'optionalAccess', _145 => _145.route, 'access', _146 => _146.segments, 'access', _147 => _147.length]), () => ( -1));
2842
- if (!bestMatch || depth > bestDepth || depth === bestDepth && _chunkC2R5RVLAcjs.getRouteDirectoryDepth.call(void 0, boundaryEntry.pattern) > _chunkC2R5RVLAcjs.getRouteDirectoryDepth.call(void 0, bestMatch.pattern)) {
2844
+ if (!bestMatch || depth > bestDepth || depth === bestDepth && _chunkVCKGOXFIcjs.getRouteDirectoryDepth.call(void 0, boundaryEntry.pattern) > _chunkVCKGOXFIcjs.getRouteDirectoryDepth.call(void 0, bestMatch.pattern)) {
2843
2845
  bestMatch = boundaryEntry;
2844
2846
  }
2845
2847
  }
@@ -2953,7 +2955,7 @@ var RouteManager = class {
2953
2955
  }
2954
2956
  };
2955
2957
  function getPageDirectoryField(route, pattern) {
2956
- const directory = _chunkC2R5RVLAcjs.createRouteDirectoryPattern.call(void 0, route);
2958
+ const directory = _chunkVCKGOXFIcjs.createRouteDirectoryPattern.call(void 0, route);
2957
2959
  return directory === pattern ? {} : { directory };
2958
2960
  }
2959
2961
  function interpolateRedirectDestination(destination, params) {
@@ -4552,7 +4554,7 @@ function appendResponseVary(res, value) {
4552
4554
  function renderI18nAlternateLinks(requestPath, snapshot, options) {
4553
4555
  if (snapshot.routing === "none") return "";
4554
4556
  const url = new URL(requestPath, "http://farm.local");
4555
- return _chunkC2R5RVLAcjs.renderFarmLocaleAlternateLinks.call(void 0, url.pathname, snapshot, options);
4557
+ return _chunkVCKGOXFIcjs.renderFarmLocaleAlternateLinks.call(void 0, url.pathname, snapshot, options);
4556
4558
  }
4557
4559
  var PPR_REFRESH_MAX_ATTEMPTS = 3;
4558
4560
  function createPPRRefreshScript() {
@@ -4568,7 +4570,7 @@ function rendererRenderOptions() {
4568
4570
  }
4569
4571
  var FARM_DEV_EARLY_CLIENT_SCRIPT = `<script type="module" async src="/@farm/client.js"></script>`;
4570
4572
  function createDocumentFooter(options) {
4571
- return `</div>
4573
+ return `${options.closeRoot === false ? "" : "</div>"}
4572
4574
  ${options.suspenseRevealFallback}
4573
4575
  ${options.refreshPPR ? createPPRRefreshScript() : ""}
4574
4576
  ${options.deferredHydrationScript || ""}
@@ -5882,7 +5884,7 @@ var ServerRenderer = class {
5882
5884
  }
5883
5885
  }
5884
5886
  _chunkEVIWKPJVcjs.emitFarmEvent.call(void 0, { type: "render.error", route: pathname, error });
5885
- const errorStatus = _chunkC2R5RVLAcjs.resolveDefaultErrorStatus.call(void 0, error);
5887
+ const errorStatus = _chunkVCKGOXFIcjs.resolveDefaultErrorStatus.call(void 0, error);
5886
5888
  if (pprRefreshRoute) {
5887
5889
  _chunkEVIWKPJVcjs.emitFarmEvent.call(void 0, {
5888
5890
  type: "ppr.refresh.error",
@@ -6110,7 +6112,7 @@ var ServerRenderer = class {
6110
6112
  origin: url.origin,
6111
6113
  readMarkdown: llmsContext.markdown
6112
6114
  }) : value;
6113
- const response = _chunkC2R5RVLAcjs.createFarmMetadataRouteResponse.call(void 0, match.metadata.kind, body, routeModule, {
6115
+ const response = _chunkVCKGOXFIcjs.createFarmMetadataRouteResponse.call(void 0, match.metadata.kind, body, routeModule, {
6114
6116
  method,
6115
6117
  request: request2
6116
6118
  });
@@ -6146,7 +6148,7 @@ var ServerRenderer = class {
6146
6148
  }) : context.defaults;
6147
6149
  await _chunkZ5MZDFX4cjs.sendWebResponse.call(void 0,
6148
6150
  res,
6149
- _chunkC2R5RVLAcjs.createFarmMetadataRouteResponse.call(void 0,
6151
+ _chunkVCKGOXFIcjs.createFarmMetadataRouteResponse.call(void 0,
6150
6152
  kind,
6151
6153
  body,
6152
6154
  { revalidate: config.revalidate },
@@ -6181,7 +6183,7 @@ var ServerRenderer = class {
6181
6183
  });
6182
6184
  await _chunkZ5MZDFX4cjs.sendWebResponse.call(void 0,
6183
6185
  res,
6184
- _chunkC2R5RVLAcjs.createFarmMetadataRouteResponse.call(void 0, "robots", robots, {}, { method: req.method })
6186
+ _chunkVCKGOXFIcjs.createFarmMetadataRouteResponse.call(void 0, "robots", robots, {}, { method: req.method })
6185
6187
  );
6186
6188
  } catch (error) {
6187
6189
  _chunkXN2MB4QZcjs.logger.error(`Generated robots.txt failed: ${error}`);
@@ -6225,7 +6227,7 @@ var ServerRenderer = class {
6225
6227
  });
6226
6228
  await _chunkZ5MZDFX4cjs.sendWebResponse.call(void 0,
6227
6229
  res,
6228
- _chunkC2R5RVLAcjs.createFarmMetadataRouteResponse.call(void 0, "sitemap", sitemap, {}, { method: req.method })
6230
+ _chunkVCKGOXFIcjs.createFarmMetadataRouteResponse.call(void 0, "sitemap", sitemap, {}, { method: req.method })
6229
6231
  );
6230
6232
  } catch (error) {
6231
6233
  _chunkXN2MB4QZcjs.logger.error(`Generated sitemap.xml failed: ${error}`);
@@ -6254,7 +6256,7 @@ var ServerRenderer = class {
6254
6256
  getAgentListedRoutes() {
6255
6257
  const guards = { config: this.config, middlewareRoutes: _nullishCoalesce(_optionalChain([this, 'access', _253 => _253.middlewareRoutes, 'optionalCall', _254 => _254()]), () => ( [])) };
6256
6258
  return [...this.routeManager.getRoutes()].filter(
6257
- ([pattern]) => !pattern.includes("[") && !_chunkC2R5RVLAcjs.farmPathGuardCoversPage.call(void 0, guards, pattern)
6259
+ ([pattern]) => !pattern.includes("[") && !_chunkVCKGOXFIcjs.farmPathGuardCoversPage.call(void 0, guards, pattern)
6258
6260
  );
6259
6261
  }
6260
6262
  /**
@@ -6268,7 +6270,7 @@ var ServerRenderer = class {
6268
6270
  if (this.routeManager.matchRoute(_chunkSBABQKPTcjs.FARM_DEFAULT_MCP_PATH).route) return void 0;
6269
6271
  _nullishCoalesce(this.defaultMCPServer, () => ( (this.defaultMCPServer = _chunkSBABQKPTcjs.createFarmDefaultMCPServer.call(void 0,
6270
6272
  readAppPackageIdentity(this.config.root),
6271
- _chunkJLS6ZLFMcjs.FARM_VERSION
6273
+ _chunkJ5VCA45Kcjs.FARM_VERSION
6272
6274
  ))));
6273
6275
  return _chunkSBABQKPTcjs.resolveFarmDefaultMCPServer.call(void 0, this.defaultMCPServer);
6274
6276
  }
@@ -6350,7 +6352,7 @@ var ServerRenderer = class {
6350
6352
  pages,
6351
6353
  config,
6352
6354
  rootMetadata,
6353
- mcp: _optionalChain([this, 'access', _266 => _266.config, 'access', _267 => _267.agent, 'optionalAccess', _268 => _268.aiCatalog]) === false ? [] : _chunkZGS3ZDF7cjs.listFarmMCPLlmsTxtLinks.call(void 0, origin, {
6355
+ mcp: _optionalChain([this, 'access', _266 => _266.config, 'access', _267 => _267.agent, 'optionalAccess', _268 => _268.aiCatalog]) === false ? [] : _chunkNPPT4RWFcjs.listFarmMCPLlmsTxtLinks.call(void 0, origin, {
6354
6356
  basePath: this.config.basePath,
6355
6357
  apiServerBasePath: _chunkB5BBTPJQcjs.resolveFarmAPIServerBasePath.call(void 0,
6356
6358
  _chunkIWFV5ZEDcjs.normalizeFarmAPIConfig.call(void 0,
@@ -6652,19 +6654,19 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
6652
6654
  i18nSnapshot,
6653
6655
  this.getI18nAlternateOptions(req, req.__FARM_METADATA__)
6654
6656
  ) : "";
6655
- const themeDocument = _chunkC2R5RVLAcjs.createFarmThemeDocumentParts.call(void 0,
6657
+ const themeDocument = _chunkVCKGOXFIcjs.createFarmThemeDocumentParts.call(void 0,
6656
6658
  this.config.theme,
6657
6659
  this.config.basePath,
6658
6660
  _chunk4ZJ5C7UJcjs.getTheme.call(void 0, )
6659
6661
  );
6660
6662
  themeDocument.head = farmScripts(themeDocument.head);
6661
- const fullDocument = _chunkC2R5RVLAcjs.extractFarmFullDocument.call(void 0, content);
6663
+ const fullDocument = _chunkVCKGOXFIcjs.extractFarmFullDocument.call(void 0, content);
6662
6664
  let html;
6663
6665
  if (fullDocument) {
6664
6666
  const shouldReplaceLayoutTitle = hasExplicitTitle || rendererHasTitle;
6665
- const documentHtml = shouldReplaceLayoutTitle ? _chunkC2R5RVLAcjs.removeFarmDocumentTitles.call(void 0, fullDocument) : fullDocument;
6666
- const effectiveRendererHead = hasExplicitTitle ? _chunkC2R5RVLAcjs.removeFarmDocumentTitles.call(void 0, rendererHead) : rendererHead;
6667
- html = _chunkC2R5RVLAcjs.composeFarmFullDocument.call(void 0, documentHtml, {
6667
+ const documentHtml = shouldReplaceLayoutTitle ? _chunkVCKGOXFIcjs.removeFarmDocumentTitles.call(void 0, fullDocument) : fullDocument;
6668
+ const effectiveRendererHead = hasExplicitTitle ? _chunkVCKGOXFIcjs.removeFarmDocumentTitles.call(void 0, rendererHead) : rendererHead;
6669
+ html = _chunkVCKGOXFIcjs.composeFarmFullDocument.call(void 0, documentHtml, {
6668
6670
  fallbackIcon: !hasFavicon,
6669
6671
  viewport: viewportTags,
6670
6672
  htmlAttributes: `${i18nSnapshot ? ` lang="${escapeHtmlAttribute2(i18nSnapshot.locale)}" dir="${escapeHtmlAttribute2(i18nSnapshot.direction)}"` : ""}${themeDocument.attributes}`,
@@ -6770,7 +6772,8 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
6770
6772
  async renderWithSSR(element, req, res, clearMiddlewareData, options = {}) {
6771
6773
  const renderToPipeableStream = this.rendererRuntime.renderToPipeableStream;
6772
6774
  const fullDocumentRouteKey = options.observabilityRoute || req.__FARM_ROUTE__ || req.url || "/";
6773
- if (!renderToPipeableStream || _chunkWJFFPXCVcjs._isFarmMarkdownPageCheck.call(void 0, _optionalChain([req, 'access', _293 => _293.headers, 'optionalAccess', _294 => _294[_chunkWJFFPXCVcjs.FARM_MARKDOWN_PAGE_CHECK_HEADER]])) || fullDocumentRoutes.has(fullDocumentRouteKey) || await this.rootLayoutRendersDocument()) {
6775
+ const streamDocument = fullDocumentRoutes.has(fullDocumentRouteKey) || await this.rootLayoutRendersDocument();
6776
+ if (!renderToPipeableStream || _chunkWJFFPXCVcjs._isFarmMarkdownPageCheck.call(void 0, _optionalChain([req, 'access', _293 => _293.headers, 'optionalAccess', _294 => _294[_chunkWJFFPXCVcjs.FARM_MARKDOWN_PAGE_CHECK_HEADER]])) || streamDocument && (options.captureStaticShell || !_chunkRD623KW4cjs.isReactRenderer.call(void 0, this.config.renderer))) {
6774
6777
  return this.renderBufferedSSR(element, req, res, clearMiddlewareData, options);
6775
6778
  }
6776
6779
  return new Promise((resolve3, reject) => {
@@ -6882,6 +6885,7 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
6882
6885
  title,
6883
6886
  tags: metaTags,
6884
6887
  hasFavicon,
6888
+ hasExplicitTitle,
6885
6889
  viewport: viewportTags
6886
6890
  } = _chunk6IOZPJ3Icjs.renderMetadataHead.call(void 0, req.__FARM_METADATA__, {
6887
6891
  pathname: getFarmMetadataPathname(req),
@@ -6894,7 +6898,7 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
6894
6898
  this.getI18nAlternateOptions(req, req.__FARM_METADATA__)
6895
6899
  ) : "";
6896
6900
  const fontHead = renderFarmFontDevHead(this.config.root || process.cwd());
6897
- const themeDocument = _chunkC2R5RVLAcjs.createFarmThemeDocumentParts.call(void 0,
6901
+ const themeDocument = _chunkVCKGOXFIcjs.createFarmThemeDocumentParts.call(void 0,
6898
6902
  this.config.theme,
6899
6903
  this.config.basePath,
6900
6904
  _chunk4ZJ5C7UJcjs.getTheme.call(void 0, )
@@ -6947,25 +6951,70 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
6947
6951
  <body class="">${earlyClient ? `
6948
6952
  ${FARM_DEV_EARLY_CLIENT_SCRIPT}` : ""}
6949
6953
  <div id="root">`;
6950
- const securedShell = stampDocumentHTML(shell);
6951
- htmlParts.push(securedShell);
6952
- _optionalChain([staticShellParts, 'optionalAccess', _300 => _300.push, 'call', _301 => _301(securedShell)]);
6954
+ const securedShell = streamDocument ? "" : stampDocumentHTML(shell);
6955
+ if (securedShell) {
6956
+ htmlParts.push(securedShell);
6957
+ _optionalChain([staticShellParts, 'optionalAccess', _300 => _300.push, 'call', _301 => _301(securedShell)]);
6958
+ }
6959
+ const withEarlyClient = (document) => earlyClient ? {
6960
+ ...document,
6961
+ html: document.html.replace(
6962
+ /<body\b[^>]*>/i,
6963
+ (open) => `${open}
6964
+ ${stampDocumentHTML(FARM_DEV_EARLY_CLIENT_SCRIPT)}`
6965
+ )
6966
+ } : document;
6967
+ const documentTransform = streamDocument ? _chunkVCKGOXFIcjs.createFarmStreamedDocumentTransform.call(void 0,
6968
+ (opening) => withEarlyClient(
6969
+ _chunkVCKGOXFIcjs.openFarmStreamedDocument.call(void 0,
6970
+ hasExplicitTitle ? _chunkVCKGOXFIcjs.removeFarmDocumentTitles.call(void 0, opening) : opening,
6971
+ {
6972
+ fallbackIcon: !hasFavicon,
6973
+ viewport: viewportTags,
6974
+ htmlAttributes: `${i18nSnapshot ? ` lang="${escapeHtmlAttribute2(i18nSnapshot.locale)}" dir="${escapeHtmlAttribute2(i18nSnapshot.direction)}"` : ""}${themeDocument.attributes}`,
6975
+ replaceHtmlAttributes: [
6976
+ ...i18nSnapshot ? ["lang", "dir"] : [],
6977
+ ...themeDocument.attributes ? ["data-theme"] : []
6978
+ ],
6979
+ headAssets: stampDocumentHTML(
6980
+ [
6981
+ themeDocument.head,
6982
+ `<meta name="farm-deployment-id" content="${escapeHtmlAttribute2(deploymentId)}">`,
6983
+ hasExplicitTitle ? `<title>${title}</title>` : "",
6984
+ metaTags,
6985
+ i18nAlternateTags,
6986
+ fontHead,
6987
+ globalStylesheetLink,
6988
+ ...devStyleLinks,
6989
+ `<script type="module" src="/@vite/client"></script>`,
6990
+ propsScript,
6991
+ hydrationClickQueueScript
6992
+ ].filter(Boolean).join("\n ")
6993
+ ),
6994
+ // The footer follows the streamed body.
6995
+ bodyFooter: ""
6996
+ }
6997
+ )
6998
+ ),
6999
+ stampDocumentHTML(shell)
7000
+ ) : void 0;
6953
7001
  let firstChunk = true;
6954
7002
  let checkedFullDocument = false;
6955
7003
  let documentPrefix = "";
6956
7004
  const cspNonceRewriter = cspNonce ? _chunk6JHZPB52cjs.createFarmCspNonceRewriter.call(void 0, cspNonce) : void 0;
6957
7005
  const cspStreamDecoder = cspNonceRewriter ? new TextDecoder() : void 0;
6958
- const recordRenderedChunk = (chunkText) => {
6959
- if (!chunkText) return;
6960
- if (!checkedFullDocument) {
6961
- documentPrefix += chunkText;
6962
- const prefix = _chunkC2R5RVLAcjs.classifyFarmDocumentPrefix.call(void 0, documentPrefix);
7006
+ const recordRenderedChunk = (chunkText, renderedText = chunkText) => {
7007
+ if (!checkedFullDocument && renderedText) {
7008
+ documentPrefix += renderedText;
7009
+ const prefix = _chunkVCKGOXFIcjs.classifyFarmDocumentPrefix.call(void 0, documentPrefix);
6963
7010
  if (prefix !== "pending") {
6964
7011
  checkedFullDocument = true;
6965
7012
  documentPrefix = "";
6966
7013
  if (prefix === "document") fullDocumentRoutes.add(fullDocumentRouteKey);
7014
+ else fullDocumentRoutes.delete(fullDocumentRouteKey);
6967
7015
  }
6968
7016
  }
7017
+ if (!chunkText) return;
6969
7018
  htmlParts.push(chunkText);
6970
7019
  if (staticShellParts && findStaticShellBoundary && !staticShellClosed) {
6971
7020
  const dynamicIndex = findStaticShellBoundary(chunkText);
@@ -6991,12 +7040,16 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
6991
7040
  }
6992
7041
  const chunkText = Buffer.isBuffer(chunk) ? cspStreamDecoder ? cspStreamDecoder.decode(chunk, { stream: true }) : chunk.toString() : String(chunk);
6993
7042
  const securedChunkText = cspNonceRewriter ? cspNonceRewriter.write(chunkText) : chunkText;
6994
- recordRenderedChunk(securedChunkText);
7043
+ const outputText = documentTransform ? documentTransform.write(securedChunkText) : securedChunkText;
7044
+ recordRenderedChunk(outputText, securedChunkText);
6995
7045
  const onWrite = () => {
6996
7046
  if (typeof res.flush === "function") res.flush();
6997
7047
  callback();
6998
7048
  };
6999
- if (cspNonceRewriter) res.write(securedChunkText, onWrite);
7049
+ if (documentTransform) {
7050
+ if (outputText) res.write(outputText, onWrite);
7051
+ else callback();
7052
+ } else if (cspNonceRewriter) res.write(securedChunkText, onWrite);
7000
7053
  else res.write(chunk, encoding, onWrite);
7001
7054
  },
7002
7055
  final: (callback) => {
@@ -7005,7 +7058,8 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
7005
7058
  lateNavigationError = null;
7006
7059
  createLateNavigationRecovery(navigationError).then(
7007
7060
  (recovery) => {
7008
- const secured = filterDocumentHTML(recovery);
7061
+ const filtered = filterDocumentHTML(recovery);
7062
+ const secured = documentTransform ? documentTransform.write(filtered) : filtered;
7009
7063
  htmlParts.push(secured);
7010
7064
  res.write(secured);
7011
7065
  finishStream(callback);
@@ -7022,16 +7076,24 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
7022
7076
  });
7023
7077
  const finishStream = (callback) => {
7024
7078
  if (cspNonceRewriter) {
7025
- const tail = cspNonceRewriter.write(cspStreamDecoder.decode(), true);
7026
- recordRenderedChunk(tail);
7079
+ const rewritten = cspNonceRewriter.write(cspStreamDecoder.decode(), true);
7080
+ const tail = documentTransform ? documentTransform.write(rewritten) : rewritten;
7081
+ recordRenderedChunk(tail, rewritten);
7027
7082
  if (tail) res.write(tail);
7028
7083
  }
7084
+ const documentEnd = _optionalChain([documentTransform, 'optionalAccess', _304 => _304.end, 'call', _305 => _305()]);
7085
+ if (_optionalChain([documentEnd, 'optionalAccess', _306 => _306.text])) {
7086
+ recordRenderedChunk(documentEnd.text, "");
7087
+ res.write(documentEnd.text);
7088
+ }
7029
7089
  const suspenseRevealFallback = `<script>(function(){function moveFragment(srcId,placeholderId){var src=document.getElementById(srcId),ph=document.getElementById(placeholderId);if(!src||!ph||!ph.parentNode)return false;while(src.firstChild)ph.parentNode.insertBefore(src.firstChild,ph);ph.parentNode.removeChild(ph);if(src.parentNode)src.parentNode.removeChild(src);return true}function revealBoundary(boundaryId,sectionId){var boundary=document.getElementById(boundaryId),section=document.getElementById(sectionId);if(!boundary||!section||!boundary.parentNode)return false;var start=boundary.previousSibling;if(!start||start.nodeType!==8)return false;var parent=boundary.parentNode;var node=boundary;var depth=0;while(node){if(node.nodeType===8){var data=node.data;if(data==="/$"||data==="/&"){if(depth===0)break;depth--;}else if(data==="$"||data==="$?"||data==="$~"||data==="$!"||data==="&"){depth++;}}var next=node.nextSibling;parent.removeChild(node);node=next;}while(section.firstChild)parent.insertBefore(section.firstChild,node);if(section.parentNode)section.parentNode.removeChild(section);start.data="$";return true}var tries=0;var timer=setInterval(function(){var changed=false;document.querySelectorAll('div[id^="S:"]').forEach(function(section){var suffix=section.id.slice(2);changed=moveFragment('S:'+suffix,'P:'+suffix)||changed;});document.querySelectorAll('template[id^="B:"]').forEach(function(boundary){var suffix=boundary.id.slice(2);changed=revealBoundary('B:'+suffix,'S:'+suffix)||changed;});tries++;if(tries>80||(!document.querySelector('template[id^="B:"]')&&!document.querySelector('template[id^="P:"]'))){clearInterval(timer);}},50);})();</script>`;
7030
7090
  const footer = stampDocumentHTML(
7031
7091
  createDocumentFooter({
7032
7092
  suspenseRevealFallback,
7033
7093
  deferredHydrationScript: createDeferredHydrationScript(deferredProps.records),
7034
- earlyClient
7094
+ earlyClient,
7095
+ // A full document: Farm's #root closes only where Farm opened it.
7096
+ ..._optionalChain([documentEnd, 'optionalAccess', _307 => _307.document]) ? { closeRoot: documentEnd.rootOpened } : {}
7035
7097
  })
7036
7098
  );
7037
7099
  htmlParts.push(footer);
@@ -7135,7 +7197,7 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
7135
7197
  return await this.routeManager.loadRouteModule(notFoundPath);
7136
7198
  }
7137
7199
  async loadNotFoundComponent() {
7138
- return await _asyncNullishCoalesce(await _asyncOptionalChain([(await this.loadNotFoundModule()), 'optionalAccess', async _304 => _304.default]), async () => ( null));
7200
+ return await _asyncNullishCoalesce(await _asyncOptionalChain([(await this.loadNotFoundModule()), 'optionalAccess', async _308 => _308.default]), async () => ( null));
7139
7201
  }
7140
7202
  /** The not-found document's head: layout and not-found metadata, as production renders it. */
7141
7203
  async notFoundMetadataHead(layoutModule, notFoundModule) {
@@ -7158,13 +7220,13 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
7158
7220
  */
7159
7221
  async createLateNavigationRecoveryHTML(req, error) {
7160
7222
  if (_chunk7JUIK547cjs.isFarmRedirectError.call(void 0, error)) {
7161
- return _chunkC2R5RVLAcjs.createLateRedirectRecovery.call(void 0,
7223
+ return _chunkVCKGOXFIcjs.createLateRedirectRecovery.call(void 0,
7162
7224
  this.localizeRedirectUrl(_chunk7JUIK547cjs.getFarmRedirectError.call(void 0, error).url),
7163
7225
  this.getCspNonce(req) || ""
7164
7226
  );
7165
7227
  }
7166
7228
  const pathname = _chunkHNAISJFDcjs.resolveFarmRequestURL.call(void 0, req, {
7167
- trustProxy: _optionalChain([this, 'access', _305 => _305.config, 'access', _306 => _306.server, 'optionalAccess', _307 => _307.trustProxy])
7229
+ trustProxy: _optionalChain([this, 'access', _309 => _309.config, 'access', _310 => _310.server, 'optionalAccess', _311 => _311.trustProxy])
7168
7230
  }).pathname;
7169
7231
  let content = this.defaultNotFoundContent();
7170
7232
  const NotFoundComponent = await this.loadNotFoundComponent();
@@ -7180,12 +7242,12 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
7180
7242
  _chunkXN2MB4QZcjs.logger.warn(`not-found page could not render outside its layout, using Farm's: ${error2}`);
7181
7243
  }
7182
7244
  }
7183
- return _chunkC2R5RVLAcjs.createLateNotFoundRecovery.call(void 0, content, this.getCspNonce(req) || "");
7245
+ return _chunkVCKGOXFIcjs.createLateNotFoundRecovery.call(void 0, content, this.getCspNonce(req) || "");
7184
7246
  }
7185
7247
  async render404(req, res) {
7186
7248
  res.statusCode = 404;
7187
7249
  const pathname = _chunkHNAISJFDcjs.resolveFarmRequestURL.call(void 0, req, {
7188
- trustProxy: _optionalChain([this, 'access', _308 => _308.config, 'access', _309 => _309.server, 'optionalAccess', _310 => _310.trustProxy])
7250
+ trustProxy: _optionalChain([this, 'access', _312 => _312.config, 'access', _313 => _313.server, 'optionalAccess', _314 => _314.trustProxy])
7189
7251
  }).pathname;
7190
7252
  const acceptHeader = req.headers.accept;
7191
7253
  const accept = Array.isArray(acceptHeader) ? acceptHeader.join(",") : acceptHeader;
@@ -7213,9 +7275,9 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
7213
7275
  );
7214
7276
  if (notFoundPath) {
7215
7277
  const notFoundModule = await this.loadNotFoundModule();
7216
- const NotFoundComponent = _nullishCoalesce(_optionalChain([notFoundModule, 'optionalAccess', _311 => _311.default]), () => ( null));
7278
+ const NotFoundComponent = _nullishCoalesce(_optionalChain([notFoundModule, 'optionalAccess', _315 => _315.default]), () => ( null));
7217
7279
  if (NotFoundComponent) {
7218
- const LayoutComponent = _nullishCoalesce(_optionalChain([layoutModule, 'optionalAccess', _312 => _312.default]), () => ( null));
7280
+ const LayoutComponent = _nullishCoalesce(_optionalChain([layoutModule, 'optionalAccess', _316 => _316.default]), () => ( null));
7219
7281
  let element = this.rendererRuntime.createElement(NotFoundComponent, { pathname });
7220
7282
  if (LayoutComponent) {
7221
7283
  element = this.rendererRuntime.createElement(LayoutComponent, {
@@ -7255,23 +7317,23 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
7255
7317
  res.statusCode = statusCode;
7256
7318
  const isDev = process.env.NODE_ENV === "development";
7257
7319
  const requestUrl = _chunkHNAISJFDcjs.resolveFarmRequestURL.call(void 0, req, {
7258
- trustProxy: _optionalChain([this, 'access', _313 => _313.config, 'access', _314 => _314.server, 'optionalAccess', _315 => _315.trustProxy])
7320
+ trustProxy: _optionalChain([this, 'access', _317 => _317.config, 'access', _318 => _318.server, 'optionalAccess', _319 => _319.trustProxy])
7259
7321
  });
7260
7322
  const diagnostics = isDev ? createDefaultErrorDiagnostics(error, this.config.root || process.cwd()) : void 0;
7261
- const statusText = _chunkC2R5RVLAcjs.getDefaultErrorStatusText.call(void 0, statusCode);
7323
+ const statusText = _chunkVCKGOXFIcjs.getDefaultErrorStatusText.call(void 0, statusCode);
7262
7324
  const content = this.stampFarmScripts(
7263
7325
  req,
7264
- _chunkC2R5RVLAcjs.createDefaultErrorMarkup.call(void 0, {
7326
+ _chunkVCKGOXFIcjs.createDefaultErrorMarkup.call(void 0, {
7265
7327
  statusCode,
7266
7328
  statusText,
7267
7329
  requestPath: requestUrl.pathname,
7268
7330
  method: req.method || "GET",
7269
- message: _optionalChain([diagnostics, 'optionalAccess', _316 => _316.message]),
7270
- errorName: _optionalChain([diagnostics, 'optionalAccess', _317 => _317.name]),
7271
- stack: _optionalChain([diagnostics, 'optionalAccess', _318 => _318.stack]),
7272
- sourceFrame: _optionalChain([diagnostics, 'optionalAccess', _319 => _319.sourceFrame]),
7331
+ message: _optionalChain([diagnostics, 'optionalAccess', _320 => _320.message]),
7332
+ errorName: _optionalChain([diagnostics, 'optionalAccess', _321 => _321.name]),
7333
+ stack: _optionalChain([diagnostics, 'optionalAccess', _322 => _322.stack]),
7334
+ sourceFrame: _optionalChain([diagnostics, 'optionalAccess', _323 => _323.sourceFrame]),
7273
7335
  development: isDev,
7274
- farmVersion: _chunkJLS6ZLFMcjs.FARM_VERSION,
7336
+ farmVersion: _chunkJ5VCA45Kcjs.FARM_VERSION,
7275
7337
  nodeVersion: process.version,
7276
7338
  mode: isDev ? "development" : "production"
7277
7339
  })
@@ -7297,8 +7359,8 @@ window.__FARM_I18N__ = ${_chunkRVGLYMJMcjs.getFarmI18nClientSnapshot.call(void 0
7297
7359
  */
7298
7360
  getI18nAlternateOptions(req, metadata) {
7299
7361
  return {
7300
- metadataBase: _optionalChain([metadata, 'optionalAccess', _320 => _320.metadataBase]),
7301
- origin: req ? _chunkHNAISJFDcjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _321 => _321.config, 'access', _322 => _322.server, 'optionalAccess', _323 => _323.trustProxy]) }).origin : void 0
7362
+ metadataBase: _optionalChain([metadata, 'optionalAccess', _324 => _324.metadataBase]),
7363
+ origin: req ? _chunkHNAISJFDcjs.resolveFarmRequestURL.call(void 0, req, { trustProxy: _optionalChain([this, 'access', _325 => _325.config, 'access', _326 => _326.server, 'optionalAccess', _327 => _327.trustProxy]) }).origin : void 0
7302
7364
  };
7303
7365
  }
7304
7366
  createFullHTML(content, isClientComponent = false, requestPath = "/", metadataHead, alternates = {}) {
@@ -7317,20 +7379,20 @@ ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};`
7317
7379
  this.getI18nAlternateOptions(alternates.req, alternates.metadata)
7318
7380
  ) : "";
7319
7381
  const fontHead = renderFarmFontDevHead(this.config.root || process.cwd());
7320
- const themeDocument = _chunkC2R5RVLAcjs.createFarmThemeDocumentParts.call(void 0,
7382
+ const themeDocument = _chunkVCKGOXFIcjs.createFarmThemeDocumentParts.call(void 0,
7321
7383
  this.config.theme,
7322
7384
  this.config.basePath,
7323
7385
  _chunk4ZJ5C7UJcjs.getTheme.call(void 0, )
7324
7386
  );
7325
7387
  themeDocument.head = farmScripts(themeDocument.head);
7326
7388
  const rendererHydrationScript = farmScripts(
7327
- _optionalChain([this, 'access', _324 => _324.rendererRuntime, 'access', _325 => _325.generateHydrationScript, 'optionalCall', _326 => _326()]) || ""
7389
+ _optionalChain([this, 'access', _328 => _328.rendererRuntime, 'access', _329 => _329.generateHydrationScript, 'optionalCall', _330 => _330()]) || ""
7328
7390
  );
7329
- const viewportTags = _chunk6IOZPJ3Icjs.renderViewportHead.call(void 0, _optionalChain([alternates, 'access', _327 => _327.metadata, 'optionalAccess', _328 => _328.viewport]));
7330
- const fullDocument = _chunkC2R5RVLAcjs.extractFarmFullDocument.call(void 0, content);
7391
+ const viewportTags = _chunk6IOZPJ3Icjs.renderViewportHead.call(void 0, _optionalChain([alternates, 'access', _331 => _331.metadata, 'optionalAccess', _332 => _332.viewport]));
7392
+ const fullDocument = _chunkVCKGOXFIcjs.extractFarmFullDocument.call(void 0, content);
7331
7393
  if (fullDocument) {
7332
- return _chunkC2R5RVLAcjs.composeFarmFullDocument.call(void 0,
7333
- metadataHead ? _chunkC2R5RVLAcjs.removeFarmDocumentTitles.call(void 0, fullDocument) : fullDocument,
7394
+ return _chunkVCKGOXFIcjs.composeFarmFullDocument.call(void 0,
7395
+ metadataHead ? _chunkVCKGOXFIcjs.removeFarmDocumentTitles.call(void 0, fullDocument) : fullDocument,
7334
7396
  {
7335
7397
  fallbackIcon: !metadataHead,
7336
7398
  viewport: viewportTags,
@@ -7356,7 +7418,7 @@ ${i18nSnapshot ? `window.__FARM_I18N__ = ${serializeInlineValue(i18nSnapshot)};`
7356
7418
  );
7357
7419
  }
7358
7420
  return `<!DOCTYPE html>
7359
- <html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _329 => _329.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
7421
+ <html lang="${escapeHtmlAttribute2(_optionalChain([i18nSnapshot, 'optionalAccess', _333 => _333.locale]) || "en")}"${i18nSnapshot ? ` dir="${i18nSnapshot.direction}"` : ""}${themeDocument.attributes}>
7360
7422
  <head>
7361
7423
  ${themeDocument.head}
7362
7424
  <meta charset="utf-8">
@@ -7398,7 +7460,7 @@ ${clientScript}
7398
7460
  res.setHeader(_chunkE552H232cjs.FARM_DEPLOYMENT_ID_HEADER, deploymentId);
7399
7461
  if ((req.method || "GET").toUpperCase() !== "GET") return;
7400
7462
  const forwardedProto = req.headers["x-forwarded-proto"];
7401
- const isSecure = _optionalChain([(Array.isArray(forwardedProto) ? forwardedProto[0] : forwardedProto), 'optionalAccess', _330 => _330.split, 'call', _331 => _331(","), 'access', _332 => _332[0], 'optionalAccess', _333 => _333.trim, 'call', _334 => _334()]) === "https" || Boolean(_optionalChain([req, 'access', _335 => _335.socket, 'optionalAccess', _336 => _336.encrypted]));
7463
+ const isSecure = _optionalChain([(Array.isArray(forwardedProto) ? forwardedProto[0] : forwardedProto), 'optionalAccess', _334 => _334.split, 'call', _335 => _335(","), 'access', _336 => _336[0], 'optionalAccess', _337 => _337.trim, 'call', _338 => _338()]) === "https" || Boolean(_optionalChain([req, 'access', _339 => _339.socket, 'optionalAccess', _340 => _340.encrypted]));
7402
7464
  const cookie = _chunkE552H232cjs.createFarmDeploymentCookie.call(void 0, deploymentId, this.config.basePath || "/", isSecure);
7403
7465
  const existing = res.getHeader("Set-Cookie");
7404
7466
  if (Array.isArray(existing)) {
@@ -7526,10 +7588,10 @@ var FarmApp = class {
7526
7588
  env: config.env || { server: {}, public: {} },
7527
7589
  suppressLintOnLink: _nullishCoalesce(config.suppressLintOnLink, () => ( false)),
7528
7590
  experimental: {
7529
- serverComponents: _nullishCoalesce(_optionalChain([config, 'access', _337 => _337.experimental, 'optionalAccess', _338 => _338.serverComponents]), () => ( false)),
7530
- serverActions: _nullishCoalesce(_optionalChain([config, 'access', _339 => _339.experimental, 'optionalAccess', _340 => _340.serverActions]), () => ( false)),
7531
- isolatedClientHydration: _nullishCoalesce(_optionalChain([config, 'access', _341 => _341.experimental, 'optionalAccess', _342 => _342.isolatedClientHydration]), () => ( "off")),
7532
- ppr: _nullishCoalesce(_optionalChain([config, 'access', _343 => _343.experimental, 'optionalAccess', _344 => _344.ppr]), () => ( false)),
7591
+ serverComponents: _nullishCoalesce(_optionalChain([config, 'access', _341 => _341.experimental, 'optionalAccess', _342 => _342.serverComponents]), () => ( false)),
7592
+ serverActions: _nullishCoalesce(_optionalChain([config, 'access', _343 => _343.experimental, 'optionalAccess', _344 => _344.serverActions]), () => ( false)),
7593
+ isolatedClientHydration: _nullishCoalesce(_optionalChain([config, 'access', _345 => _345.experimental, 'optionalAccess', _346 => _346.isolatedClientHydration]), () => ( "off")),
7594
+ ppr: _nullishCoalesce(_optionalChain([config, 'access', _347 => _347.experimental, 'optionalAccess', _348 => _348.ppr]), () => ( false)),
7533
7595
  ...config.experimental
7534
7596
  },
7535
7597
  agent: _nullishCoalesce(config.agent, () => ( {})),
@@ -7576,7 +7638,7 @@ function isResolvedAuthConfig(value) {
7576
7638
  );
7577
7639
  }
7578
7640
  function normalizeFarmAppAPIConfig(config) {
7579
- if (typeof _optionalChain([config, 'optionalAccess', _345 => _345.baseURL]) === "function" || typeof _optionalChain([config, 'optionalAccess', _346 => _346.basePath]) === "function") {
7641
+ if (typeof _optionalChain([config, 'optionalAccess', _349 => _349.baseURL]) === "function" || typeof _optionalChain([config, 'optionalAccess', _350 => _350.basePath]) === "function") {
7580
7642
  throw new Error(
7581
7643
  "Farm API config resolver functions must be processed with resolveConfig() before creating a FarmApp."
7582
7644
  );
@@ -7591,7 +7653,7 @@ function createFarmApp(config, viteServer) {
7591
7653
  var SHARP_INSTALL_HINT = _chunkKORZ6PREcjs.formatOptionalPeerInstallHint.call(void 0, "sharp", "optimize images");
7592
7654
  var CLOUDFLARE_IMAGE_PRESETS = /* @__PURE__ */ new Set(["cloudflare", "cloudflare-pages", "cloudflare-module"]);
7593
7655
  function resolveFarmImageProviderForRuntime(images, options) {
7594
- const provider = _nullishCoalesce(_optionalChain([images, 'optionalAccess', _347 => _347.provider]), () => ( "auto"));
7656
+ const provider = _nullishCoalesce(_optionalChain([images, 'optionalAccess', _351 => _351.provider]), () => ( "auto"));
7595
7657
  if (provider === "none") return images;
7596
7658
  const usesSharp = options.dev ? true : provider === "node" || provider === "auto" && !CLOUDFLARE_IMAGE_PRESETS.has(options.preset || "");
7597
7659
  if (!usesSharp || _chunkKORZ6PREcjs.isOptionalPeerInstalled.call(void 0, options.root, "sharp")) return images;
@@ -7720,9 +7782,9 @@ function staticValue(node) {
7720
7782
  }
7721
7783
  }
7722
7784
  function property(object, name) {
7723
- return _optionalChain([object, 'access', _348 => _348.properties, 'access', _349 => _349.find, 'call', _350 => _350(
7785
+ return _optionalChain([object, 'access', _352 => _352.properties, 'access', _353 => _353.find, 'call', _354 => _354(
7724
7786
  (entry) => entry.type === "Property" && !entry.computed && (entry.key.name === name || entry.key.value === name)
7725
- ), 'optionalAccess', _351 => _351.value]);
7787
+ ), 'optionalAccess', _355 => _355.value]);
7726
7788
  }
7727
7789
  function toolFromObject(object) {
7728
7790
  const name = staticValue(property(object, "name"));
@@ -7768,7 +7830,7 @@ function findFarmWebMCPTools(code, filename = "module.tsx") {
7768
7830
  if (statement.type !== "ImportDeclaration" || statement.source.value !== WEBMCP_CLIENT)
7769
7831
  continue;
7770
7832
  for (const specifier of statement.specifiers) {
7771
- const imported = _nullishCoalesce(_optionalChain([specifier, 'access', _352 => _352.imported, 'optionalAccess', _353 => _353.name]), () => ( _optionalChain([specifier, 'access', _354 => _354.imported, 'optionalAccess', _355 => _355.value])));
7833
+ const imported = _nullishCoalesce(_optionalChain([specifier, 'access', _356 => _356.imported, 'optionalAccess', _357 => _357.name]), () => ( _optionalChain([specifier, 'access', _358 => _358.imported, 'optionalAccess', _359 => _359.value])));
7772
7834
  if (specifier.type === "ImportSpecifier" && DEFINERS.has(imported))
7773
7835
  locals.set(specifier.local.name, imported);
7774
7836
  }
@@ -7784,7 +7846,7 @@ function findFarmWebMCPTools(code, filename = "module.tsx") {
7784
7846
  const [argument] = current.arguments;
7785
7847
  if (definer && argument) {
7786
7848
  const objects = definer === "registerWebMCPTools" ? argument.type === "ArrayExpression" ? argument.elements.filter(
7787
- (element) => _optionalChain([element, 'optionalAccess', _356 => _356.type]) === "ObjectExpression"
7849
+ (element) => _optionalChain([element, 'optionalAccess', _360 => _360.type]) === "ObjectExpression"
7788
7850
  ) : [] : argument.type === "ObjectExpression" ? [argument] : [];
7789
7851
  for (const object of objects) {
7790
7852
  const tool = toolFromObject(object);
@@ -7863,7 +7925,7 @@ function resolveFarmAppClientEntry(root = process.cwd(), srcDir = "src") {
7863
7925
  return void 0;
7864
7926
  }
7865
7927
  function resolveFarmClientPlugins(plugins, _root) {
7866
- if (!_optionalChain([plugins, 'optionalAccess', _357 => _357.length])) return [];
7928
+ if (!_optionalChain([plugins, 'optionalAccess', _361 => _361.length])) return [];
7867
7929
  return plugins.flatMap((plugin) => {
7868
7930
  if (!plugin.client) return [];
7869
7931
  assertClientLifecycle(plugin.client, plugin.name);
@@ -7940,7 +8002,7 @@ function assertLifecycleObject(value, pluginName, location, allowedKeys) {
7940
8002
  throw new TypeError(`Client plugin "${pluginName}" has an unknown ${location}.${key} option`);
7941
8003
  }
7942
8004
  const descriptor = Object.getOwnPropertyDescriptor(value, key);
7943
- if (!_optionalChain([descriptor, 'optionalAccess', _358 => _358.enumerable])) {
8005
+ if (!_optionalChain([descriptor, 'optionalAccess', _362 => _362.enumerable])) {
7944
8006
  throw new TypeError(`Client plugin "${pluginName}" ${location}.${key} must be enumerable`);
7945
8007
  }
7946
8008
  if (!("value" in descriptor)) {
@@ -8058,7 +8120,7 @@ function assertPublicData(value, pluginName) {
8058
8120
  throwPublicDataError(pluginName, pathSegments, "cannot contain symbol keys");
8059
8121
  }
8060
8122
  const descriptor = Object.getOwnPropertyDescriptor(current, key);
8061
- if (!_optionalChain([descriptor, 'optionalAccess', _359 => _359.enumerable])) {
8123
+ if (!_optionalChain([descriptor, 'optionalAccess', _363 => _363.enumerable])) {
8062
8124
  throwPublicDataError(
8063
8125
  pluginName,
8064
8126
  [...pathSegments, key],
@@ -8099,8 +8161,8 @@ function isArrayIndex(key) {
8099
8161
 
8100
8162
  var ADAPTER_EXTENSIONS = ["ts", "tsx", "js", "jsx", "mts", "mjs"];
8101
8163
  function resolveFarmClientCacheAdapterEntry(root, cache2) {
8102
- const client = _optionalChain([cache2, 'optionalAccess', _360 => _360.client]);
8103
- const adapter = _optionalChain([client, 'optionalAccess', _361 => _361.adapter]);
8164
+ const client = _optionalChain([cache2, 'optionalAccess', _364 => _364.client]);
8165
+ const adapter = _optionalChain([client, 'optionalAccess', _365 => _365.adapter]);
8104
8166
  if (adapter === void 0) return void 0;
8105
8167
  if (typeof adapter !== "string" || adapter.trim().length === 0) {
8106
8168
  throw new Error(
@@ -8115,8 +8177,8 @@ function resolveFarmClientCacheAdapterEntry(root, cache2) {
8115
8177
  );
8116
8178
  }
8117
8179
  const options = {};
8118
- if (_optionalChain([client, 'optionalAccess', _362 => _362.version]) !== void 0) options.version = client.version;
8119
- if (_optionalChain([client, 'optionalAccess', _363 => _363.flushDelayMs]) !== void 0) options.flushDelayMs = client.flushDelayMs;
8180
+ if (_optionalChain([client, 'optionalAccess', _366 => _366.version]) !== void 0) options.version = client.version;
8181
+ if (_optionalChain([client, 'optionalAccess', _367 => _367.flushDelayMs]) !== void 0) options.flushDelayMs = client.flushDelayMs;
8120
8182
  return { importPath: found.replace(/\\/g, "/"), options };
8121
8183
  }
8122
8184
  function resolveAdapterFile(resolved) {
@@ -8316,7 +8378,7 @@ function redactFarmDocsClientConfig(code, filename) {
8316
8378
  const current = node;
8317
8379
  if (current.type === "Property") {
8318
8380
  const name = propertyKeyName(current);
8319
- const valueType = _optionalChain([current, 'access', _364 => _364.value, 'optionalAccess', _365 => _365.type]);
8381
+ const valueType = _optionalChain([current, 'access', _368 => _368.value, 'optionalAccess', _369 => _369.type]);
8320
8382
  const credential = name !== void 0 && (name.toLowerCase() === "headers" || _chunkSM2SYWARcjs.isSecretDocsConfigKey.call(void 0, name) && valueType !== "ObjectExpression" && valueType !== "ArrayExpression");
8321
8383
  if (name && credential) {
8322
8384
  edits.push(
@@ -8356,7 +8418,7 @@ function farmDocsClientConfigPlugin(configModule) {
8356
8418
  name: "farm:docs-client-config",
8357
8419
  enforce: "pre",
8358
8420
  transform(code, id, options) {
8359
- if (_optionalChain([options, 'optionalAccess', _366 => _366.ssr]) || !isFarmDocsClientConfigModule(id, configModule)) return null;
8421
+ if (_optionalChain([options, 'optionalAccess', _370 => _370.ssr]) || !isFarmDocsClientConfigModule(id, configModule)) return null;
8360
8422
  const redacted = redactFarmDocsClientConfig(code, id.split("?")[0]);
8361
8423
  return redacted === null ? null : { code: redacted, map: null };
8362
8424
  }
@@ -8387,7 +8449,7 @@ var FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE = [
8387
8449
  ];
8388
8450
  function getFarmClientOptimizeDepsInclude(renderer) {
8389
8451
  return Array.from(
8390
- /* @__PURE__ */ new Set([...FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE, ..._optionalChain([renderer, 'optionalAccess', _367 => _367.optimizeDeps]) || []])
8452
+ /* @__PURE__ */ new Set([...FARM_CLIENT_OPTIMIZE_DEPS_INCLUDE, ..._optionalChain([renderer, 'optionalAccess', _371 => _371.optimizeDeps]) || []])
8391
8453
  );
8392
8454
  }
8393
8455
  function createFarmClientOptimizeDepsEntries(projectRoot, appDirectories) {
@@ -8410,7 +8472,7 @@ function createFarmClientOptimizeDepsConfig(entries, renderer) {
8410
8472
  // Farm's HTML boots through a virtual module and imports route UI lazily.
8411
8473
  // Explicit entries let Vite finish that crawl before a navigation can
8412
8474
  // rotate the optimizer hash underneath a hydrated React runtime.
8413
- ..._optionalChain([entries, 'optionalAccess', _368 => _368.length]) ? { entries: [...entries] } : {}
8475
+ ..._optionalChain([entries, 'optionalAccess', _372 => _372.length]) ? { entries: [...entries] } : {}
8414
8476
  };
8415
8477
  }
8416
8478
  function createFarmSourceAlias(projectRoot, srcDir = "src") {
@@ -8436,8 +8498,8 @@ function mergeAlias(farmValue, userValue) {
8436
8498
  return [...normalize(userValue), ...normalize(farmValue)];
8437
8499
  }
8438
8500
  function mergeFarmViteConfig(farmConfig, userConfig = {}) {
8439
- const noDiscovery = _nullishCoalesce(_optionalChain([userConfig, 'access', _369 => _369.optimizeDeps, 'optionalAccess', _370 => _370.noDiscovery]), () => ( _optionalChain([farmConfig, 'access', _371 => _371.optimizeDeps, 'optionalAccess', _372 => _372.noDiscovery])));
8440
- const holdUntilCrawlEnd = _nullishCoalesce(_optionalChain([userConfig, 'access', _373 => _373.optimizeDeps, 'optionalAccess', _374 => _374.holdUntilCrawlEnd]), () => ( (_optionalChain([userConfig, 'access', _375 => _375.optimizeDeps, 'optionalAccess', _376 => _376.noDiscovery]) === true ? false : _optionalChain([farmConfig, 'access', _377 => _377.optimizeDeps, 'optionalAccess', _378 => _378.holdUntilCrawlEnd]))));
8501
+ const noDiscovery = _nullishCoalesce(_optionalChain([userConfig, 'access', _373 => _373.optimizeDeps, 'optionalAccess', _374 => _374.noDiscovery]), () => ( _optionalChain([farmConfig, 'access', _375 => _375.optimizeDeps, 'optionalAccess', _376 => _376.noDiscovery])));
8502
+ const holdUntilCrawlEnd = _nullishCoalesce(_optionalChain([userConfig, 'access', _377 => _377.optimizeDeps, 'optionalAccess', _378 => _378.holdUntilCrawlEnd]), () => ( (_optionalChain([userConfig, 'access', _379 => _379.optimizeDeps, 'optionalAccess', _380 => _380.noDiscovery]) === true ? false : _optionalChain([farmConfig, 'access', _381 => _381.optimizeDeps, 'optionalAccess', _382 => _382.holdUntilCrawlEnd]))));
8441
8503
  return {
8442
8504
  ...farmConfig,
8443
8505
  ...userConfig,
@@ -8449,9 +8511,9 @@ function mergeFarmViteConfig(farmConfig, userConfig = {}) {
8449
8511
  resolve: {
8450
8512
  ...farmConfig.resolve,
8451
8513
  ...userConfig.resolve,
8452
- alias: mergeAlias(_optionalChain([farmConfig, 'access', _379 => _379.resolve, 'optionalAccess', _380 => _380.alias]), _optionalChain([userConfig, 'access', _381 => _381.resolve, 'optionalAccess', _382 => _382.alias])),
8514
+ alias: mergeAlias(_optionalChain([farmConfig, 'access', _383 => _383.resolve, 'optionalAccess', _384 => _384.alias]), _optionalChain([userConfig, 'access', _385 => _385.resolve, 'optionalAccess', _386 => _386.alias])),
8453
8515
  dedupe: Array.from(
8454
- /* @__PURE__ */ new Set([..._optionalChain([farmConfig, 'access', _383 => _383.resolve, 'optionalAccess', _384 => _384.dedupe]) || [], ..._optionalChain([userConfig, 'access', _385 => _385.resolve, 'optionalAccess', _386 => _386.dedupe]) || []])
8516
+ /* @__PURE__ */ new Set([..._optionalChain([farmConfig, 'access', _387 => _387.resolve, 'optionalAccess', _388 => _388.dedupe]) || [], ..._optionalChain([userConfig, 'access', _389 => _389.resolve, 'optionalAccess', _390 => _390.dedupe]) || []])
8455
8517
  )
8456
8518
  },
8457
8519
  optimizeDeps: {
@@ -8461,21 +8523,21 @@ function mergeFarmViteConfig(farmConfig, userConfig = {}) {
8461
8523
  holdUntilCrawlEnd,
8462
8524
  include: Array.from(
8463
8525
  /* @__PURE__ */ new Set([
8464
- ..._optionalChain([farmConfig, 'access', _387 => _387.optimizeDeps, 'optionalAccess', _388 => _388.include]) || [],
8465
- ..._optionalChain([userConfig, 'access', _389 => _389.optimizeDeps, 'optionalAccess', _390 => _390.include]) || []
8526
+ ..._optionalChain([farmConfig, 'access', _391 => _391.optimizeDeps, 'optionalAccess', _392 => _392.include]) || [],
8527
+ ..._optionalChain([userConfig, 'access', _393 => _393.optimizeDeps, 'optionalAccess', _394 => _394.include]) || []
8466
8528
  ])
8467
8529
  ),
8468
8530
  exclude: Array.from(
8469
8531
  /* @__PURE__ */ new Set([
8470
- ..._optionalChain([farmConfig, 'access', _391 => _391.optimizeDeps, 'optionalAccess', _392 => _392.exclude]) || [],
8471
- ..._optionalChain([userConfig, 'access', _393 => _393.optimizeDeps, 'optionalAccess', _394 => _394.exclude]) || []
8532
+ ..._optionalChain([farmConfig, 'access', _395 => _395.optimizeDeps, 'optionalAccess', _396 => _396.exclude]) || [],
8533
+ ..._optionalChain([userConfig, 'access', _397 => _397.optimizeDeps, 'optionalAccess', _398 => _398.exclude]) || []
8472
8534
  ])
8473
8535
  )
8474
8536
  },
8475
8537
  ssr: {
8476
8538
  ...farmConfig.ssr,
8477
8539
  ...userConfig.ssr,
8478
- noExternal: mergeNoExternal(_optionalChain([farmConfig, 'access', _395 => _395.ssr, 'optionalAccess', _396 => _396.noExternal]), _optionalChain([userConfig, 'access', _397 => _397.ssr, 'optionalAccess', _398 => _398.noExternal]))
8540
+ noExternal: mergeNoExternal(_optionalChain([farmConfig, 'access', _399 => _399.ssr, 'optionalAccess', _400 => _400.noExternal]), _optionalChain([userConfig, 'access', _401 => _401.ssr, 'optionalAccess', _402 => _402.noExternal]))
8479
8541
  }
8480
8542
  };
8481
8543
  }
@@ -8527,7 +8589,7 @@ function mergeFarmProductionViteConfig(farmConfig, userConfig = {}) {
8527
8589
  ...farmConfig.build,
8528
8590
  rollupOptions: {
8529
8591
  ...userBundlerOptions,
8530
- ..._optionalChain([farmConfig, 'access', _399 => _399.build, 'optionalAccess', _400 => _400.rollupOptions])
8592
+ ..._optionalChain([farmConfig, 'access', _403 => _403.build, 'optionalAccess', _404 => _404.rollupOptions])
8531
8593
  }
8532
8594
  },
8533
8595
  css: farmConfig.css || userCss ? { ...farmConfig.css, ...userCss } : void 0,
@@ -8535,7 +8597,7 @@ function mergeFarmProductionViteConfig(farmConfig, userConfig = {}) {
8535
8597
  esbuild: typeof userEsbuild === "object" && farmConfig.esbuild !== false ? { ...userEsbuild, ...farmConfig.esbuild } : _nullishCoalesce(farmConfig.esbuild, () => ( userEsbuild)),
8536
8598
  ssr: {
8537
8599
  ...merged.ssr,
8538
- external: mergeExternal(_optionalChain([farmConfig, 'access', _401 => _401.ssr, 'optionalAccess', _402 => _402.external]), _optionalChain([userConfig, 'access', _403 => _403.ssr, 'optionalAccess', _404 => _404.external]))
8600
+ external: mergeExternal(_optionalChain([farmConfig, 'access', _405 => _405.ssr, 'optionalAccess', _406 => _406.external]), _optionalChain([userConfig, 'access', _407 => _407.ssr, 'optionalAccess', _408 => _408.external]))
8539
8601
  }
8540
8602
  };
8541
8603
  }