@farm.js/core 0.1.69 → 0.1.70

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 (306) hide show
  1. package/dist/{agent-mcp-handler-FER4MQDF.cjs → agent-mcp-handler-6T2Z7TB6.cjs} +8 -5
  2. package/dist/{agent-mcp-handler-AZ7QW4UP.mjs → agent-mcp-handler-CPU354QQ.mjs} +7 -4
  3. package/dist/{agent-mcp.d-DOfBMEzP.d.mts → agent-mcp.d-DulgFLBt.d.ts} +13 -4
  4. package/dist/{agent-mcp.d-DnIgriX1.d.ts → agent-mcp.d-TAs1ES2F.d.mts} +13 -4
  5. package/dist/agent-runtime.cjs +3 -3
  6. package/dist/agent-runtime.d.mts +3 -2
  7. package/dist/agent-runtime.d.ts +3 -2
  8. package/dist/agent-runtime.mjs +2 -2
  9. package/dist/analyzer-GUIRJWZH.cjs +16 -0
  10. package/dist/{analyzer-NAL5TJUP.mjs → analyzer-QGRBLETM.mjs} +2 -2
  11. package/dist/api/node.d.mts +5 -4
  12. package/dist/api/node.d.ts +5 -4
  13. package/dist/api/route-manager.cjs +4 -4
  14. package/dist/api/route-manager.d.mts +16 -7
  15. package/dist/api/route-manager.d.ts +16 -7
  16. package/dist/api/route-manager.mjs +3 -3
  17. package/dist/api/runtime.d.mts +4 -3
  18. package/dist/api/runtime.d.ts +4 -3
  19. package/dist/api.cjs +6 -6
  20. package/dist/api.d.mts +8 -7
  21. package/dist/api.d.ts +8 -7
  22. package/dist/api.mjs +5 -5
  23. package/dist/{app-manifest.d-_BVbI0xp.d.mts → app-manifest.d-6zXb90o6.d.mts} +1 -1
  24. package/dist/{app-manifest.d-CaAcaukR.d.ts → app-manifest.d-C-nf3Vmm.d.ts} +1 -1
  25. package/dist/app-markdown.cjs +5 -4
  26. package/dist/app-markdown.d.mts +4 -3
  27. package/dist/app-markdown.d.ts +4 -3
  28. package/dist/app-markdown.mjs +4 -3
  29. package/dist/{app.d-BWeDqOaF.d.ts → app.d-C2xeMIYT.d.ts} +18 -8
  30. package/dist/{app.d-CaPwtytN.d.mts → app.d-DF0aundc.d.mts} +18 -8
  31. package/dist/{base-path.d-CTDVF0Fc.d.mts → base-path.d-BJ3SYpB8.d.mts} +6 -1
  32. package/dist/{base-path.d-CTDVF0Fc.d.ts → base-path.d-BJ3SYpB8.d.ts} +6 -1
  33. package/dist/{chunk-4ZXKYCYK.mjs → chunk-255J7K4X.mjs} +1 -1
  34. package/dist/{chunk-RVGLYMJM.cjs → chunk-2AM26UGI.cjs} +2 -2
  35. package/dist/{chunk-UPOYKX4S.cjs → chunk-2MR4MABG.cjs} +4 -4
  36. package/dist/chunk-2RCCFB2Y.cjs +129 -0
  37. package/dist/{chunk-K6VFYFOY.cjs → chunk-2W4GNXGX.cjs} +2 -2
  38. package/dist/{chunk-F6YLXK5L.cjs → chunk-32SYRIQ7.cjs} +18 -18
  39. package/dist/{chunk-CV6MFQ4Y.mjs → chunk-3AUINHFG.mjs} +1 -1
  40. package/dist/{chunk-ZYCEEE3V.mjs → chunk-3EXCZJEN.mjs} +2 -2
  41. package/dist/{chunk-MMDKYJ5V.cjs → chunk-3GNVIYPO.cjs} +7 -7
  42. package/dist/{chunk-65Y5SIBH.cjs → chunk-3QM74STY.cjs} +1 -1
  43. package/dist/{chunk-SZORL7EW.mjs → chunk-3WS5AZ3R.mjs} +5 -5
  44. package/dist/{chunk-FJMC24KG.cjs → chunk-42KMUIWZ.cjs} +0 -3
  45. package/dist/{chunk-LR4KP3I7.cjs → chunk-4AC4PXZO.cjs} +2 -2
  46. package/dist/{chunk-YVPX5PI5.mjs → chunk-4O26BPUY.mjs} +8 -0
  47. package/dist/{chunk-LENKRGBV.mjs → chunk-5CFHQ7HM.mjs} +1 -1
  48. package/dist/{chunk-G7NBPP7H.mjs → chunk-5IJRJWJS.mjs} +1 -1
  49. package/dist/{chunk-MV7NWU23.mjs → chunk-5R3JQPWD.mjs} +1 -1
  50. package/dist/{chunk-3Y52TWYU.mjs → chunk-62ZRA7XU.mjs} +0 -3
  51. package/dist/{chunk-ABIBASLJ.cjs → chunk-65FPDDT4.cjs} +2 -2
  52. package/dist/{chunk-K6SXMVXO.mjs → chunk-75E5FDX2.mjs} +22 -7
  53. package/dist/{chunk-K76CBYQM.mjs → chunk-7A3URI2F.mjs} +20 -0
  54. package/dist/{chunk-ZR2QB45W.mjs → chunk-A2TH5MKE.mjs} +4 -4
  55. package/dist/{chunk-L5OZN6YW.cjs → chunk-A7HCBHMC.cjs} +3 -3
  56. package/dist/{chunk-VX2HZGC7.cjs → chunk-ACGBXN3U.cjs} +2 -2
  57. package/dist/{chunk-TKYOJ5G2.cjs → chunk-BPUVDCGG.cjs} +5 -5
  58. package/dist/{chunk-FT6KJHS3.cjs → chunk-C2JOS77Z.cjs} +4 -1
  59. package/dist/{chunk-UHU4QALN.mjs → chunk-CCHJWJGP.mjs} +177 -102
  60. package/dist/{chunk-CRVSYDHV.mjs → chunk-CKQAQFF6.mjs} +2 -2
  61. package/dist/chunk-DC2AXGNZ.mjs +129 -0
  62. package/dist/{chunk-4W4ZWSV2.cjs → chunk-DIHBWZDZ.cjs} +391 -335
  63. package/dist/{chunk-Q4HH5Q6A.cjs → chunk-DMXMIE2C.cjs} +2 -2
  64. package/dist/{chunk-23VJEGKC.cjs → chunk-DVJM55D2.cjs} +9 -1
  65. package/dist/{chunk-QSUYB3RH.cjs → chunk-DZHTNSQ5.cjs} +14 -14
  66. package/dist/{chunk-OIOPQ25L.mjs → chunk-E77IA5IF.mjs} +46 -33
  67. package/dist/{chunk-PEYDQMSA.mjs → chunk-EDZU7YRK.mjs} +5 -5
  68. package/dist/{chunk-EZTKXD6P.cjs → chunk-FDGYDQGL.cjs} +8 -1
  69. package/dist/{chunk-PLJKJJ2H.mjs → chunk-FETMUBIA.mjs} +27 -82
  70. package/dist/{chunk-HJZZSBVK.cjs → chunk-FILXOEWD.cjs} +2 -2
  71. package/dist/{chunk-L6NWQ3DR.cjs → chunk-FJ5YCERM.cjs} +375 -300
  72. package/dist/{chunk-PDFFYZAT.cjs → chunk-GF22VGMS.cjs} +2 -2
  73. package/dist/{chunk-OOJBBHYW.cjs → chunk-GVYZCJZH.cjs} +30 -1
  74. package/dist/{chunk-5TOWKGV3.mjs → chunk-HAXFV2CD.mjs} +1 -1
  75. package/dist/{chunk-YOHHL2UE.mjs → chunk-I4KPA2C6.mjs} +1 -1
  76. package/dist/{chunk-4JRAMCUP.cjs → chunk-I7NUT24Z.cjs} +22 -22
  77. package/dist/{chunk-VO65MYJD.cjs → chunk-IEN2EFE5.cjs} +4 -4
  78. package/dist/{chunk-NVOMQLI2.mjs → chunk-IWJONXPF.mjs} +11 -0
  79. package/dist/{chunk-RLH5AH2M.mjs → chunk-JDO346NV.mjs} +1 -1
  80. package/dist/{chunk-PDQ6EGPK.mjs → chunk-JFVT5ZZV.mjs} +2 -2
  81. package/dist/{chunk-ULMXZYOA.mjs → chunk-JRF2SKCD.mjs} +1 -1
  82. package/dist/{chunk-YIHRZBD7.cjs → chunk-JRGR5Z4K.cjs} +1 -1
  83. package/dist/{chunk-UKZ6AWKZ.cjs → chunk-JWY66PID.cjs} +44 -1
  84. package/dist/{chunk-BDYM2TN3.cjs → chunk-JX5VOLAV.cjs} +8 -8
  85. package/dist/{chunk-WMLSZAKN.mjs → chunk-JZQS3ZOI.mjs} +1 -1
  86. package/dist/{chunk-GQ6QOH7T.cjs → chunk-K4UGCUXX.cjs} +12 -12
  87. package/dist/{chunk-OFBLGH6V.cjs → chunk-K66JILV3.cjs} +47 -34
  88. package/dist/{chunk-QOGIZKSO.cjs → chunk-K7JMTAFH.cjs} +5 -5
  89. package/dist/{chunk-IFR74W6S.mjs → chunk-KPJYBSHL.mjs} +4 -1
  90. package/dist/{chunk-CKCKCUYO.mjs → chunk-KPMLDT3B.mjs} +146 -90
  91. package/dist/{chunk-KI3MU7B5.mjs → chunk-LDVJIBGN.mjs} +1 -1
  92. package/dist/{chunk-GUMKIQJL.cjs → chunk-LECZ5DPZ.cjs} +2 -2
  93. package/dist/{chunk-5FBZJJGA.mjs → chunk-LXEJNWF5.mjs} +2 -2
  94. package/dist/{chunk-DHR2WDSL.cjs → chunk-M6U6E4F7.cjs} +335 -285
  95. package/dist/{chunk-AKIQ54FK.cjs → chunk-MBCRWU3P.cjs} +26 -81
  96. package/dist/{chunk-P2NBQ5JI.mjs → chunk-MWUDEYBI.mjs} +1 -1
  97. package/dist/{chunk-22LGTSBA.cjs → chunk-MZLJFNMH.cjs} +1 -1
  98. package/dist/{chunk-MAGFDK4Q.mjs → chunk-N62IYXYD.mjs} +1 -1
  99. package/dist/{chunk-ZPKJPM7K.mjs → chunk-NA77GEIU.mjs} +2 -2
  100. package/dist/{chunk-FVYBEMOD.cjs → chunk-NAXKOTPP.cjs} +6 -6
  101. package/dist/{chunk-I7J5RLGO.cjs → chunk-NLBHLPEO.cjs} +12 -1
  102. package/dist/{chunk-3EEINK7G.cjs → chunk-NSZY3EWG.cjs} +10 -7
  103. package/dist/{chunk-ANMIR6US.mjs → chunk-NYF7A4UW.mjs} +1 -1
  104. package/dist/{chunk-QO43L7Z4.cjs → chunk-O32QPFVV.cjs} +25 -7
  105. package/dist/{chunk-CO6UYM2D.mjs → chunk-O5QUJEWT.mjs} +1 -1
  106. package/dist/{chunk-JL2YW5KX.mjs → chunk-OAEDVXVE.mjs} +44 -1
  107. package/dist/{chunk-GTQOEEE7.cjs → chunk-Q5HMVGR5.cjs} +13 -13
  108. package/dist/{chunk-5NFQ6AZI.cjs → chunk-QEWWKYDL.cjs} +25 -10
  109. package/dist/{chunk-QOSDWGKT.mjs → chunk-QVBXTSIZ.mjs} +1 -1
  110. package/dist/{chunk-2P7UYHZP.mjs → chunk-QZHTDVH4.mjs} +1 -1
  111. package/dist/{chunk-HEJM46HQ.mjs → chunk-R7254L3R.mjs} +5 -2
  112. package/dist/{chunk-OGVTUGMU.mjs → chunk-REP6HWJN.mjs} +13 -3
  113. package/dist/{chunk-IYLZZTP6.mjs → chunk-RMOU3PR4.mjs} +112 -62
  114. package/dist/{chunk-WYL4ODZ4.mjs → chunk-SE7HPBYK.mjs} +30 -1
  115. package/dist/{chunk-D5F7RPZP.mjs → chunk-THG2TVDH.mjs} +3 -3
  116. package/dist/{chunk-TEJ67GD2.mjs → chunk-TLSSIYAL.mjs} +20 -5
  117. package/dist/{chunk-DWLNLU55.cjs → chunk-TPYAYFMF.cjs} +2 -2
  118. package/dist/{chunk-Y6KHPJDB.cjs → chunk-U7VH3Q5E.cjs} +2 -2
  119. package/dist/{chunk-X3MHKLCO.cjs → chunk-VG6HYT5K.cjs} +26 -11
  120. package/dist/{chunk-437QZIC2.cjs → chunk-VNBDN5W2.cjs} +5 -5
  121. package/dist/{chunk-AJNBTOVQ.mjs → chunk-WW3LRNQV.mjs} +1 -1
  122. package/dist/{chunk-GFPS7MNE.mjs → chunk-WX63N6C5.mjs} +4 -4
  123. package/dist/{chunk-6GQJVY4E.cjs → chunk-XYVPTTUT.cjs} +13 -13
  124. package/dist/{chunk-VOQ7XZZT.cjs → chunk-Y2SZVIVH.cjs} +20 -0
  125. package/dist/{chunk-XCAQTCGK.mjs → chunk-YBY34UHB.mjs} +1 -1
  126. package/dist/{chunk-YGJ5P3TJ.mjs → chunk-Z3GPAFIA.mjs} +21 -3
  127. package/dist/{chunk-4E57QHPW.cjs → chunk-ZUVAGMQ5.cjs} +17 -7
  128. package/dist/{chunk-23LVFSID.mjs → chunk-ZXDX7VYZ.mjs} +7 -0
  129. package/dist/{client-component.d-CnEeVvGG.d.mts → client-component.d-Bk5qKJM-.d.mts} +2 -2
  130. package/dist/{client-component.d-CfJxuXZl.d.ts → client-component.d-DNbC4oWI.d.ts} +2 -2
  131. package/dist/{client-plugins.d-D7dHV1Nf.d.ts → client-plugins.d-DwUqh4gp.d.ts} +36 -3
  132. package/dist/{client-plugins.d-Do5ULA0x.d.mts → client-plugins.d-Pi9nG0W0.d.mts} +36 -3
  133. package/dist/client-plugins.d.mts +3 -2
  134. package/dist/client-plugins.d.ts +3 -2
  135. package/dist/client.cjs +6 -6
  136. package/dist/client.d.mts +8 -7
  137. package/dist/client.d.ts +8 -7
  138. package/dist/client.mjs +5 -5
  139. package/dist/config.d.mts +3 -2
  140. package/dist/config.d.ts +3 -2
  141. package/dist/deployment.cjs +4 -2
  142. package/dist/deployment.d.mts +7 -1
  143. package/dist/deployment.d.ts +7 -1
  144. package/dist/deployment.mjs +5 -3
  145. package/dist/desktop.d.mts +4 -3
  146. package/dist/desktop.d.ts +4 -3
  147. package/dist/{dev-guard-ONNMVQUN.mjs → dev-guard-ZDIELV6Q.mjs} +1 -1
  148. package/dist/{dev-guard-2UW2KERP.cjs → dev-guard-ZLLKVO5T.cjs} +2 -2
  149. package/dist/{devtools-BP4EBTKQ.mjs → devtools-CB43AHEP.mjs} +8 -7
  150. package/dist/{devtools-7HNDS4SY.cjs → devtools-L5DUNDF3.cjs} +9 -8
  151. package/dist/docs.cjs +12 -11
  152. package/dist/docs.d.mts +4 -3
  153. package/dist/docs.d.ts +4 -3
  154. package/dist/docs.mjs +11 -10
  155. package/dist/environment/vite.cjs +3 -3
  156. package/dist/environment/vite.mjs +2 -2
  157. package/dist/headers.d-CE6OWB-n.d.ts +18 -0
  158. package/dist/headers.d-DED1hHh4.d.mts +18 -0
  159. package/dist/i18n/client.cjs +2 -2
  160. package/dist/i18n/client.d.mts +2 -2
  161. package/dist/i18n/client.d.ts +2 -2
  162. package/dist/i18n/client.mjs +1 -1
  163. package/dist/i18n/index.cjs +2 -2
  164. package/dist/i18n/index.d.mts +3 -3
  165. package/dist/i18n/index.d.ts +3 -3
  166. package/dist/i18n/index.mjs +1 -1
  167. package/dist/i18n/server.cjs +3 -3
  168. package/dist/i18n/server.d.mts +5 -5
  169. package/dist/i18n/server.d.ts +5 -5
  170. package/dist/i18n/server.mjs +2 -2
  171. package/dist/index.cjs +46 -43
  172. package/dist/{index.d-B1MpEJAo.d.mts → index.d-CbvOjJcp.d.mts} +1 -1
  173. package/dist/{index.d-CVFk37uX.d.ts → index.d-c9UwIqDy.d.ts} +1 -1
  174. package/dist/index.d.mts +25 -23
  175. package/dist/index.d.ts +25 -23
  176. package/dist/index.mjs +59 -56
  177. package/dist/integrations/orm.d.mts +3 -2
  178. package/dist/integrations/orm.d.ts +3 -2
  179. package/dist/integrations.cjs +3 -3
  180. package/dist/integrations.d.mts +3 -2
  181. package/dist/integrations.d.ts +3 -2
  182. package/dist/integrations.mjs +2 -2
  183. package/dist/internal/app-markdown-runtime.cjs +4 -3
  184. package/dist/internal/app-markdown-runtime.d.mts +4 -3
  185. package/dist/internal/app-markdown-runtime.d.ts +4 -3
  186. package/dist/internal/app-markdown-runtime.mjs +3 -2
  187. package/dist/internal/build-runtime.cjs +35 -35
  188. package/dist/internal/build-runtime.d.mts +5 -4
  189. package/dist/internal/build-runtime.d.ts +5 -4
  190. package/dist/internal/build-runtime.mjs +34 -34
  191. package/dist/internal/cli-runtime.cjs +15 -14
  192. package/dist/internal/cli-runtime.mjs +14 -13
  193. package/dist/internal/client-error-overlay.cjs +4 -4
  194. package/dist/internal/client-error-overlay.mjs +1 -1
  195. package/dist/internal/client-runtime.cjs +5 -3
  196. package/dist/internal/client-runtime.d.mts +17 -7
  197. package/dist/internal/client-runtime.d.ts +17 -7
  198. package/dist/internal/client-runtime.mjs +4 -2
  199. package/dist/internal/compression-runtime.d.mts +3 -2
  200. package/dist/internal/compression-runtime.d.ts +3 -2
  201. package/dist/internal/config-runtime.cjs +10 -9
  202. package/dist/internal/config-runtime.d.mts +6 -5
  203. package/dist/internal/config-runtime.d.ts +6 -5
  204. package/dist/internal/config-runtime.mjs +9 -8
  205. package/dist/internal/infra-analytics-runtime.cjs +12 -9
  206. package/dist/internal/infra-analytics-runtime.mjs +10 -7
  207. package/dist/internal/native-server-fns.cjs +4 -4
  208. package/dist/internal/native-server-fns.mjs +3 -3
  209. package/dist/internal/product-telemetry-runtime.cjs +3 -3
  210. package/dist/internal/product-telemetry-runtime.mjs +2 -2
  211. package/dist/internal/production-runtime.cjs +48 -17
  212. package/dist/internal/production-runtime.d.mts +48 -18
  213. package/dist/internal/production-runtime.d.ts +48 -18
  214. package/dist/internal/production-runtime.mjs +50 -19
  215. package/dist/internal/vercel-edge-middleware.cjs +3 -2
  216. package/dist/internal/vercel-edge-middleware.d.mts +2 -2
  217. package/dist/internal/vercel-edge-middleware.d.ts +2 -2
  218. package/dist/internal/vercel-edge-middleware.mjs +2 -1
  219. package/dist/markdown.cjs +3 -2
  220. package/dist/markdown.d.mts +3 -2
  221. package/dist/markdown.d.ts +3 -2
  222. package/dist/markdown.mjs +2 -1
  223. package/dist/middleware.cjs +6 -5
  224. package/dist/middleware.d.mts +4 -3
  225. package/dist/middleware.d.ts +4 -3
  226. package/dist/middleware.mjs +5 -4
  227. package/dist/mobile.d.mts +3 -3
  228. package/dist/mobile.d.ts +3 -3
  229. package/dist/{mount.d-CBqr-LfI.d.mts → mount.d-BvWxf8ZE.d.mts} +1 -1
  230. package/dist/{mount.d-CGzN61Kq.d.ts → mount.d-DngLY7NL.d.ts} +1 -1
  231. package/dist/{native-tree-W2SSJB3Y.cjs → native-tree-GF4BH33L.cjs} +4 -3
  232. package/dist/{native-tree-Y5YQANW7.mjs → native-tree-L2IIEBXH.mjs} +3 -2
  233. package/dist/{navigation-delegate.d-BwCOhpj7.d.mts → navigation-delegate.d-CMyl1h2l.d.mts} +1 -1
  234. package/dist/{navigation-delegate.d-CLH2dXjy.d.ts → navigation-delegate.d-zZogiDfa.d.ts} +1 -1
  235. package/dist/navigation.cjs +5 -5
  236. package/dist/navigation.d.mts +6 -5
  237. package/dist/navigation.d.ts +6 -5
  238. package/dist/navigation.mjs +4 -4
  239. package/dist/plugin.cjs +28 -27
  240. package/dist/plugin.d.mts +6 -4
  241. package/dist/plugin.d.ts +6 -4
  242. package/dist/plugin.mjs +27 -26
  243. package/dist/{production-runtime.d-DMZY3OgV.d.mts → production-runtime.d-B0IeWWyO.d.mts} +23 -2
  244. package/dist/{production-runtime.d-BMyyLGBB.d.ts → production-runtime.d-q3aHIv5Y.d.ts} +23 -2
  245. package/dist/query/client.cjs +6 -6
  246. package/dist/query/client.mjs +2 -2
  247. package/dist/{render-plan.d-W6LmjD6y.d.ts → render-plan.d-DQj2bzd2.d.ts} +1 -1
  248. package/dist/{render-plan.d-CzGDjcT0.d.mts → render-plan.d-Di1znBDW.d.mts} +1 -1
  249. package/dist/renderer-client.cjs +7 -7
  250. package/dist/renderer-client.d.mts +6 -5
  251. package/dist/renderer-client.d.ts +6 -5
  252. package/dist/renderer-client.mjs +3 -3
  253. package/dist/{request.d-CTVRZiQv.d.ts → request.d-C5vyoYeL.d.ts} +1 -1
  254. package/dist/{request.d-CgNVderU.d.mts → request.d-CJWzfDYJ.d.mts} +1 -1
  255. package/dist/request.d.mts +4 -3
  256. package/dist/request.d.ts +4 -3
  257. package/dist/{resolver.d-JnZKKsc5.d.mts → resolver.d-9iKC79CU.d.mts} +1 -1
  258. package/dist/{resolver.d-BHyZgpa7.d.ts → resolver.d-CY6mEa_F.d.ts} +1 -1
  259. package/dist/response.d-B_MtBCnF.d.mts +12 -0
  260. package/dist/response.d-B_MtBCnF.d.ts +12 -0
  261. package/dist/{route-rendering.d-D0bmZVJA.d.mts → route-rendering.d-C-et2TZ1.d.mts} +9 -2
  262. package/dist/{route-rendering.d-FDSNtCMg.d.ts → route-rendering.d-DhsY5M2I.d.ts} +9 -2
  263. package/dist/{router.d-GRKm_uAV.d.mts → router.d-BMDS5s5X.d.mts} +1 -1
  264. package/dist/{router.d-DZ3ldniI.d.ts → router.d-CJB-Ntni.d.ts} +1 -1
  265. package/dist/{routes.d-CrEy0lJS.d.mts → routes.d-D3aJw1H5.d.mts} +1 -1
  266. package/dist/{routes.d-9GFFNioh.d.ts → routes.d-K-Qg79AA.d.ts} +1 -1
  267. package/dist/routes.d.mts +3 -2
  268. package/dist/routes.d.ts +3 -2
  269. package/dist/{index.d-BNNDpql4.d.ts → routing.d-BxOZ2YWc.d.ts} +1 -2
  270. package/dist/{index.d-BqcfqJvt.d.mts → routing.d-DwSUVZbF.d.mts} +1 -2
  271. package/dist/{rsc-pipeline-PJZOVYSY.mjs → rsc-pipeline-AXQJCCHI.mjs} +12 -11
  272. package/dist/{rsc-pipeline-J4KKBSCH.cjs → rsc-pipeline-NJKLZ3YE.cjs} +13 -12
  273. package/dist/{runtime-OLEO5NXF.cjs → runtime-DMW6DDOI.cjs} +19 -18
  274. package/dist/{runtime-QDBSE4H6.mjs → runtime-JXNEKOSE.mjs} +11 -10
  275. package/dist/{runtime.d-BtL3PCL3.d.ts → runtime.d-B_uPfMjA.d.ts} +2 -2
  276. package/dist/{runtime.d-DqXihlxm.d.mts → runtime.d-BonodRI9.d.mts} +1 -1
  277. package/dist/{runtime.d-3iJAKptR.d.mts → runtime.d-nUz0HAL4.d.mts} +2 -2
  278. package/dist/{runtime.d-pqFQBU2N.d.ts → runtime.d-uw4123iI.d.ts} +1 -1
  279. package/dist/server-plugins.cjs +3 -2
  280. package/dist/server-plugins.d.mts +6 -12
  281. package/dist/server-plugins.d.ts +6 -12
  282. package/dist/server-plugins.mjs +2 -1
  283. package/dist/server.cjs +60 -52
  284. package/dist/server.d.mts +23 -14
  285. package/dist/server.d.ts +23 -14
  286. package/dist/server.mjs +38 -30
  287. package/dist/{spa-router.d-DhOhaQ-7.d.ts → spa-router.d-l0d9pPZj.d.ts} +3 -3
  288. package/dist/{spa-router.d-Dhvy60p4.d.mts → spa-router.d-rha3M95y.d.mts} +3 -3
  289. package/dist/testing.cjs +3 -3
  290. package/dist/testing.d.mts +3 -2
  291. package/dist/testing.d.ts +3 -2
  292. package/dist/testing.mjs +3 -3
  293. package/dist/{types.d-C41ePjvP.d.ts → types.d-wVRlLtBf.d.mts} +1 -1
  294. package/dist/{types.d-C41ePjvP.d.mts → types.d-wVRlLtBf.d.ts} +1 -1
  295. package/dist/{utils.d-BVCMRRau.d.ts → utils.d-BK-PTOF8.d.ts} +1 -1
  296. package/dist/{utils.d-Q8EHCpkF.d.mts → utils.d-BzuTobEc.d.mts} +1 -1
  297. package/dist/version.cjs +2 -2
  298. package/dist/version.mjs +1 -1
  299. package/dist/vite.cjs +35 -27
  300. package/dist/vite.d.mts +26 -6
  301. package/dist/vite.d.ts +26 -6
  302. package/dist/vite.mjs +34 -26
  303. package/package.json +2 -2
  304. package/dist/analyzer-SAJSV6SP.cjs +0 -16
  305. package/dist/response.d-BolW0Vx_.d.mts +0 -10
  306. package/dist/response.d-BolW0Vx_.d.ts +0 -10
@@ -1,20 +1,12 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkHXNLKCWHcjs = require('./chunk-HXNLKCWH.cjs');
4
3
 
5
4
 
6
-
7
-
8
-
9
-
10
- var _chunkPWKAX5MScjs = require('./chunk-PWKAX5MS.cjs');
5
+ var _chunk2RCCFB2Ycjs = require('./chunk-2RCCFB2Y.cjs');
11
6
 
12
7
 
13
8
  var _chunkHDPT6OYEcjs = require('./chunk-HDPT6OYE.cjs');
14
9
 
15
-
16
- var _chunk7JUIK547cjs = require('./chunk-7JUIK547.cjs');
17
-
18
10
  // src/plugins/redirects.ts
19
11
  var FARM_CONFIG_REDIRECTS_PLUGIN_NAME = "farm:redirects";
20
12
  var configRedirectMatchers = /* @__PURE__ */ new WeakMap();
@@ -24,35 +16,7 @@ function createRedirectsPlugin(redirects, {
24
16
  i18n,
25
17
  basePath
26
18
  } = {}) {
27
- for (const redirect of redirects) {
28
- if (redirect.statusCode !== void 0 && !_chunk7JUIK547cjs.isFarmRedirectStatus.call(void 0, redirect.statusCode)) {
29
- throw new RangeError(
30
- `Redirect "${redirect.source}" statusCode must be one of 301, 302, 303, 307, or 308.`
31
- );
32
- }
33
- }
34
- const compiledRedirects = redirects.map((redirect) => ({
35
- redirect,
36
- pattern: _chunkPWKAX5MScjs.compileConfigRoutePattern.call(void 0, redirect.source)
37
- }));
38
- const matchRedirect = (url) => {
39
- const routePath = _chunkPWKAX5MScjs.resolveConfigRoutePathname.call(void 0, url.pathname, i18n, basePath);
40
- for (const { redirect, pattern } of compiledRedirects) {
41
- const match = routePath.pathname.match(pattern.regex);
42
- if (!match) continue;
43
- const localizedDestination = _chunkPWKAX5MScjs.resolveConfigRedirectDestination.call(void 0,
44
- _chunkPWKAX5MScjs.interpolateConfigRouteDestination.call(void 0, redirect.destination, match, pattern.tokens),
45
- routePath.locale,
46
- i18n,
47
- basePath
48
- );
49
- return {
50
- destination: _chunkHXNLKCWHcjs.appendFarmRedirectQuery.call(void 0, localizedDestination, url.search),
51
- statusCode: _nullishCoalesce(redirect.statusCode, () => ( (redirect.permanent ? 308 : 307)))
52
- };
53
- }
54
- return null;
55
- };
19
+ const matchRedirect = _chunk2RCCFB2Ycjs.createConfigRedirectMatcher.call(void 0, redirects, { i18n, basePath });
56
20
  const plugin = {
57
21
  name: FARM_CONFIG_REDIRECTS_PLUGIN_NAME,
58
22
  enforce: "pre",
@@ -144,16 +108,28 @@ function applyWriteHeadHeaders(res, headers) {
144
108
  if (value !== void 0) res.setHeader(key, value);
145
109
  }
146
110
  }
111
+ function installConfigResponseHeaders(res, matchedHeaders) {
112
+ applyResponseHeaders(res, matchedHeaders);
113
+ const responseWithFinalizer = res;
114
+ if (matchedHeaders.length === 0 || responseWithFinalizer[FARM_CONFIG_HEADERS_FINALIZER]) {
115
+ return;
116
+ }
117
+ responseWithFinalizer[FARM_CONFIG_HEADERS_FINALIZER] = true;
118
+ const writeHead = res.writeHead;
119
+ res.writeHead = ((statusCode, ...args) => {
120
+ const statusMessage = typeof args[0] === "string" ? args.shift() : void 0;
121
+ applyWriteHeadHeaders(res, args[0]);
122
+ applyResponseHeaders(res, matchedHeaders);
123
+ return statusMessage === void 0 ? writeHead.call(res, statusCode) : writeHead.call(res, statusCode, statusMessage);
124
+ });
125
+ }
147
126
  function createHeadersPlugin(headers, {
148
127
  beforeRequest: overrideBeforeRequest,
149
128
  afterResponse: overrideAfterResponse,
150
129
  i18n,
151
130
  basePath
152
131
  } = {}) {
153
- const compiledHeaders = headers.map((config) => ({
154
- config,
155
- pattern: _chunkPWKAX5MScjs.compileConfigRoutePattern.call(void 0, config.source)
156
- }));
132
+ const matchHeaders = _chunk2RCCFB2Ycjs.createConfigHeadersMatcher.call(void 0, headers, { i18n, basePath });
157
133
  return {
158
134
  name: FARM_CONFIG_HEADERS_PLUGIN_NAME,
159
135
  enforce: "pre",
@@ -161,22 +137,7 @@ function createHeadersPlugin(headers, {
161
137
  if (overrideBeforeRequest) {
162
138
  await overrideBeforeRequest(req, res, context);
163
139
  }
164
- const url = _chunkHDPT6OYEcjs.resolveFarmRequestURL.call(void 0, req);
165
- const pathname = _chunkPWKAX5MScjs.resolveConfigRoutePathname.call(void 0, url.pathname, i18n, basePath).pathname;
166
- const matchedHeaders = compiledHeaders.filter(({ pattern }) => pattern.regex.test(pathname)).map(({ config }) => config.headers);
167
- applyResponseHeaders(res, matchedHeaders);
168
- const responseWithFinalizer = res;
169
- if (matchedHeaders.length === 0 || responseWithFinalizer[FARM_CONFIG_HEADERS_FINALIZER]) {
170
- return;
171
- }
172
- responseWithFinalizer[FARM_CONFIG_HEADERS_FINALIZER] = true;
173
- const writeHead = res.writeHead;
174
- res.writeHead = ((statusCode, ...args) => {
175
- const statusMessage = typeof args[0] === "string" ? args.shift() : void 0;
176
- applyWriteHeadHeaders(res, args[0]);
177
- applyResponseHeaders(res, matchedHeaders);
178
- return statusMessage === void 0 ? writeHead.call(res, statusCode) : writeHead.call(res, statusCode, statusMessage);
179
- });
140
+ installConfigResponseHeaders(res, matchHeaders(_chunkHDPT6OYEcjs.resolveFarmRequestURL.call(void 0, req)));
180
141
  },
181
142
  async afterResponse(req, res, context) {
182
143
  if (overrideAfterResponse) {
@@ -194,10 +155,7 @@ function createRewritesPlugin(rewrites, {
194
155
  i18n,
195
156
  basePath
196
157
  } = {}) {
197
- const compiledRewrites = rewrites.map((rewrite) => ({
198
- rewrite,
199
- pattern: _chunkPWKAX5MScjs.compileConfigRoutePattern.call(void 0, rewrite.source)
200
- }));
158
+ const matchRewrite = _chunk2RCCFB2Ycjs.createConfigRewriteMatcher.call(void 0, rewrites, { i18n, basePath });
201
159
  return {
202
160
  name: FARM_CONFIG_REWRITES_PLUGIN_NAME,
203
161
  enforce: "pre",
@@ -206,23 +164,9 @@ function createRewritesPlugin(rewrites, {
206
164
  await overrideBeforeRequest(req, res, context);
207
165
  }
208
166
  const url = _chunkHDPT6OYEcjs.resolveFarmRequestURL.call(void 0, req);
209
- const routePath = _chunkPWKAX5MScjs.resolveConfigRoutePathname.call(void 0, url.pathname, i18n, basePath);
210
- const pathname = routePath.pathname;
211
- for (const { rewrite, pattern } of compiledRewrites) {
212
- const match = pathname.match(pattern.regex);
213
- if (match) {
214
- const newPath = _chunkPWKAX5MScjs.localizeConfigRouteDestination.call(void 0,
215
- _chunkPWKAX5MScjs.interpolateConfigRouteDestination.call(void 0, rewrite.destination, match, pattern.tokens),
216
- routePath.locale,
217
- i18n
218
- );
219
- const destinationUrl = new URL(newPath, url);
220
- if (!destinationUrl.search && url.search) {
221
- destinationUrl.search = url.search;
222
- }
223
- req.url = destinationUrl.origin === url.origin ? destinationUrl.pathname + destinationUrl.search : destinationUrl.href;
224
- break;
225
- }
167
+ const destinationUrl = matchRewrite(url);
168
+ if (destinationUrl) {
169
+ req.url = destinationUrl.origin === url.origin ? destinationUrl.pathname + destinationUrl.search : destinationUrl.href;
226
170
  }
227
171
  },
228
172
  async afterResponse(req, res, context) {
@@ -241,4 +185,5 @@ function createRewritesPlugin(rewrites, {
241
185
 
242
186
 
243
187
 
244
- exports.FARM_CONFIG_REDIRECTS_PLUGIN_NAME = FARM_CONFIG_REDIRECTS_PLUGIN_NAME; exports.createRedirectsPlugin = createRedirectsPlugin; exports.getConfigRedirectMatcher = getConfigRedirectMatcher; exports.FARM_CONFIG_HEADERS_PLUGIN_NAME = FARM_CONFIG_HEADERS_PLUGIN_NAME; exports.createHeadersPlugin = createHeadersPlugin; exports.FARM_CONFIG_REWRITES_PLUGIN_NAME = FARM_CONFIG_REWRITES_PLUGIN_NAME; exports.createRewritesPlugin = createRewritesPlugin;
188
+
189
+ exports.FARM_CONFIG_REDIRECTS_PLUGIN_NAME = FARM_CONFIG_REDIRECTS_PLUGIN_NAME; exports.createRedirectsPlugin = createRedirectsPlugin; exports.getConfigRedirectMatcher = getConfigRedirectMatcher; exports.FARM_CONFIG_HEADERS_PLUGIN_NAME = FARM_CONFIG_HEADERS_PLUGIN_NAME; exports.installConfigResponseHeaders = installConfigResponseHeaders; exports.createHeadersPlugin = createHeadersPlugin; exports.FARM_CONFIG_REWRITES_PLUGIN_NAME = FARM_CONFIG_REWRITES_PLUGIN_NAME; exports.createRewritesPlugin = createRewritesPlugin;
@@ -10,7 +10,7 @@ import {
10
10
  } from "./chunk-LLZSYFOM.mjs";
11
11
  import {
12
12
  _readFarmRenderedHtml
13
- } from "./chunk-IFR74W6S.mjs";
13
+ } from "./chunk-KPJYBSHL.mjs";
14
14
 
15
15
  // src/mobile/native-tree.ts
16
16
  var URLENCODED = "application/x-www-form-urlencoded";
@@ -1,5 +1,5 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});// package.json
2
- var version = "0.1.69";
2
+ var version = "0.1.70";
3
3
 
4
4
  // src/version.ts
5
5
  var FARM_VERSION = version;
@@ -15,7 +15,7 @@ import {
15
15
  } from "./chunk-423SSBYQ.mjs";
16
16
  import {
17
17
  FARM_VERSION
18
- } from "./chunk-ANMIR6US.mjs";
18
+ } from "./chunk-NYF7A4UW.mjs";
19
19
 
20
20
  // src/mobile/analyzer.ts
21
21
  import { createHash } from "crypto";
@@ -3,13 +3,13 @@ import {
3
3
  } from "./chunk-XAXTTBUT.mjs";
4
4
  import {
5
5
  serializeFarmLlmsTxt
6
- } from "./chunk-YGJ5P3TJ.mjs";
6
+ } from "./chunk-Z3GPAFIA.mjs";
7
7
  import {
8
8
  stampFarmCspNonce
9
9
  } from "./chunk-22W4FNTG.mjs";
10
10
  import {
11
11
  emitFarmAgentRead
12
- } from "./chunk-IFR74W6S.mjs";
12
+ } from "./chunk-KPJYBSHL.mjs";
13
13
  import {
14
14
  resolveFarmThemeConfig
15
15
  } from "./chunk-YWPNIYUP.mjs";
@@ -4,7 +4,7 @@
4
4
  var _chunkDZZHTMWMcjs = require('./chunk-DZZHTMWM.cjs');
5
5
 
6
6
 
7
- var _chunkOOJBBHYWcjs = require('./chunk-OOJBBHYW.cjs');
7
+ var _chunkGVYZCJZHcjs = require('./chunk-GVYZCJZH.cjs');
8
8
 
9
9
 
10
10
 
@@ -18,7 +18,7 @@ var _chunkERMUL73Lcjs = require('./chunk-ERMUL73L.cjs');
18
18
  var _chunk6JHZPB52cjs = require('./chunk-6JHZPB52.cjs');
19
19
 
20
20
 
21
- var _chunkFT6KJHS3cjs = require('./chunk-FT6KJHS3.cjs');
21
+ var _chunkC2JOS77Zcjs = require('./chunk-C2JOS77Z.cjs');
22
22
 
23
23
 
24
24
  var _chunkKORZ6PREcjs = require('./chunk-KORZ6PRE.cjs');
@@ -1283,11 +1283,11 @@ function shouldReturnMarkdown(request) {
1283
1283
  if (url.pathname.endsWith(".md")) return true;
1284
1284
  const accept = request.headers.get("accept");
1285
1285
  const markdown = Math.max(
1286
- _chunkFT6KJHS3cjs.farmAcceptQuality.call(void 0, accept, "text/markdown"),
1287
- _chunkFT6KJHS3cjs.farmAcceptQuality.call(void 0, accept, "text/plain")
1286
+ _chunkC2JOS77Zcjs.farmAcceptQuality.call(void 0, accept, "text/markdown"),
1287
+ _chunkC2JOS77Zcjs.farmAcceptQuality.call(void 0, accept, "text/plain")
1288
1288
  );
1289
1289
  if (markdown <= 0) return false;
1290
- return markdown >= _chunkFT6KJHS3cjs.farmAcceptQuality.call(void 0, accept, "text/html", { wildcards: true });
1290
+ return markdown >= _chunkC2JOS77Zcjs.farmAcceptQuality.call(void 0, accept, "text/html", { wildcards: true });
1291
1291
  }
1292
1292
  function escapeAttribute(value) {
1293
1293
  return escapeHtml(value).replace(/'/g, "&#39;");
@@ -1864,7 +1864,7 @@ ${items.map(
1864
1864
  }
1865
1865
  function renderDocsRuntimeScript(docs, basePath) {
1866
1866
  const docsEntry = JSON.stringify(_chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, normalizeEntry2(docs.entry), basePath));
1867
- const reconcileHeadRuntime = `const farmNavigationHeadSelector=${JSON.stringify(_chunkOOJBBHYWcjs.FARM_NAVIGATION_HEAD_SELECTOR)};const reconcileDocsHead=(nextDoc)=>{const nextTitle=nextDoc.querySelector("title");document.title=nextTitle?.textContent||"";document.head.querySelectorAll(farmNavigationHeadSelector).forEach((node)=>node.remove());nextDoc.head.querySelectorAll(farmNavigationHeadSelector).forEach((node)=>document.head.appendChild(document.importNode(node,true)))}`;
1867
+ const reconcileHeadRuntime = `const farmNavigationHeadSelector=${JSON.stringify(_chunkGVYZCJZHcjs.FARM_NAVIGATION_HEAD_SELECTOR)};const reconcileDocsHead=(nextDoc)=>{const nextTitle=nextDoc.querySelector("title");document.title=nextTitle?.textContent||"";document.head.querySelectorAll(farmNavigationHeadSelector).forEach((node)=>node.remove());nextDoc.head.querySelectorAll(farmNavigationHeadSelector).forEach((node)=>document.head.appendChild(document.importNode(node,true)))}`;
1868
1868
  return `<script>(()=>{if(window.__farmDocsRuntime)return;window.__farmDocsRuntime=true;document.documentElement.dataset.farmDocsRuntime="true";document.documentElement.dataset.farmDocsRuntimeId=Math.random().toString(36).slice(2);${reconcileHeadRuntime};const docsEntry=${docsEntry};let cleanupToc=()=>{};let closeMobileSidebar=()=>{};const normalizePath=(path)=>path.length>1?path.replace(/\\/+$/,""):path;const isDocsPath=(path)=>{const next=normalizePath(path);const entry=normalizePath(docsEntry);if(next.endsWith(".md"))return false;if(entry==="/")return true;return next===entry||next.startsWith(entry+"/")};const initToc=()=>{cleanupToc();const toc=document.getElementById("nd-toc");if(!toc){cleanupToc=()=>{};return}const links=Array.from(toc.querySelectorAll("[data-toc-item]"));const thumb=toc.querySelector("[data-toc-thumb]");const pairs=links.map((link)=>{let id=link.hash.slice(1);try{id=decodeURIComponent(id)}catch{}return{link,heading:document.getElementById(id)}}).filter((item)=>item.heading);const setActive=(active)=>{for(const {link} of pairs){const selected=link===active.link;link.dataset.active=selected?"true":"false";link.classList.toggle("fd-toc-link-active",selected)}if(!thumb)return;const styles=getComputedStyle(active.link);const top=active.link.offsetTop+parseFloat(styles.paddingTop||"0");const bottom=active.link.offsetTop+active.link.clientHeight-parseFloat(styles.paddingBottom||"0");thumb.style.clipPath="polygon(0 "+top+"px,100% "+top+"px,100% "+bottom+"px,0 "+bottom+"px)"};const update=()=>{if(pairs.length===0)return;const offset=Math.min(window.innerHeight*0.3,160);let active=pairs[0];for(const pair of pairs){if(pair.heading.getBoundingClientRect().top<=offset)active=pair;else break}setActive(active)};let frame=0;const schedule=()=>{if(frame)return;frame=requestAnimationFrame(()=>{frame=0;update()})};const onHashChange=()=>setTimeout(schedule,0);window.addEventListener("scroll",schedule,{passive:true});window.addEventListener("resize",schedule);window.addEventListener("hashchange",onHashChange);cleanupToc=()=>{window.removeEventListener("scroll",schedule);window.removeEventListener("resize",schedule);window.removeEventListener("hashchange",onHashChange);if(frame)cancelAnimationFrame(frame);frame=0};update()};const getSidebar=()=>document.getElementById("nd-sidebar");const ensureActiveVisible=()=>{const sidebar=getSidebar();if(!sidebar)return;const active=sidebar.querySelector('a[data-active="true"]');if(!(active instanceof HTMLElement))return;const activeRect=active.getBoundingClientRect();const sidebarRect=sidebar.getBoundingClientRect();if(activeRect.top<sidebarRect.top||activeRect.bottom>sidebarRect.bottom)sidebar.scrollTop+=activeRect.top-sidebarRect.top-(sidebar.clientHeight-activeRect.height)/2};const setSidebarActive=(path)=>{const sidebar=getSidebar();if(!sidebar)return;const current=normalizePath(path);for(const link of Array.from(sidebar.querySelectorAll("a[href]"))){try{link.dataset.active=normalizePath(new URL(link.href,location.href).pathname)===current?"true":"false"}catch{}}ensureActiveVisible()};const initMobileSidebar=()=>{const layout=document.getElementById("nd-docs-layout");const sidebar=getSidebar();const toggle=document.querySelector("[data-sidebar-toggle]");const backdrop=document.querySelector("[data-sidebar-backdrop]");if(!layout||!sidebar||!(toggle instanceof HTMLButtonElement))return;const setOpen=(open)=>{layout.dataset.sidebarOpen=open?"true":"false";sidebar.classList.toggle("fd-sidebar-open",open);document.documentElement.dataset.farmDocsSidebar=open?"open":"closed";toggle.setAttribute("aria-expanded",open?"true":"false");toggle.setAttribute("aria-label",open?"Close menu":"Open menu")};const toggleOpen=()=>setOpen(layout.dataset.sidebarOpen!=="true");closeMobileSidebar=()=>setOpen(false);toggle.addEventListener("click",(event)=>{event.preventDefault();toggleOpen()});backdrop?.addEventListener("click",()=>closeMobileSidebar());document.addEventListener("keydown",(event)=>{if(event.key==="Escape")closeMobileSidebar()});sidebar.addEventListener("click",(event)=>{const target=event.target instanceof Element?event.target.closest("a[href]"):null;if(target)closeMobileSidebar()});closeMobileSidebar()};const initSidebarScroll=()=>{const sidebar=getSidebar();if(!sidebar)return;const key="farmdocs:sidebar-scroll:"+location.origin;const getStorage=()=>{try{return window.sessionStorage}catch{return null}};const readSaved=()=>{try{const raw=getStorage()?.getItem(key);if(!raw)return null;const parsed=JSON.parse(raw);return parsed&&typeof parsed==="object"?parsed:null}catch{return null}};const save=(path=location.pathname)=>{try{getStorage()?.setItem(key,JSON.stringify({path,scrollTop:sidebar.scrollTop}))}catch{}};const saved=readSaved();if(saved?.path===location.pathname&&Number.isFinite(Number(saved.scrollTop)))sidebar.scrollTop=Number(saved.scrollTop);ensureActiveVisible();save();sidebar.addEventListener("scroll",()=>save(),{passive:true});sidebar.addEventListener("click",(event)=>{const target=event.target instanceof Element?event.target.closest("a[href]"):null;if(!target)return;try{save(new URL(target.href,location.href).pathname)}catch{save()}});window.addEventListener("beforeunload",()=>save())};let navigateController=null;const getPageKey=(root)=>{const article=root.getElementById("nd-page");if(!article)return"";return article.querySelector("h1")?.textContent?.trim()||article.textContent?.replace(/\\s+/g," ").trim().slice(0,160)||""};const swapDocsPage=(html,url)=>{const nextDoc=new DOMParser().parseFromString(html,"text/html");const nextArticle=nextDoc.getElementById("nd-page");const currentArticle=document.getElementById("nd-page");if(!nextArticle||!currentArticle)return false;const nextKey=getPageKey(nextDoc);const importedArticle=document.importNode(nextArticle,true);currentArticle.replaceWith(importedArticle);const renderedArticle=document.getElementById("nd-page");if(!renderedArticle||renderedArticle===currentArticle||(nextKey&&getPageKey(document)!==nextKey))return false;const nextToc=nextDoc.getElementById("nd-toc");const currentToc=document.getElementById("nd-toc");if(nextToc&&currentToc)currentToc.replaceWith(document.importNode(nextToc,true));reconcileDocsHead(nextDoc);setSidebarActive(url.pathname);initToc();closeMobileSidebar();return true};const navigateDocs=async(url,{replace=false,scroll=true}={})=>{if(!isDocsPath(url.pathname))return false;if(navigateController)navigateController.abort();const controller=new AbortController();navigateController=controller;document.documentElement.dataset.farmDocsNavigating="true";try{const response=await fetch(url.href,{cache:"no-store",headers:{accept:"text/html","x-farm-docs-navigate":"1"},signal:controller.signal});if(!response.ok||!((response.headers.get("content-type")||"").includes("text/html")))return false;const html=await response.text();if(!swapDocsPage(html,url))return false;if(replace)history.replaceState({farmDocs:true},"",url.href);else history.pushState({farmDocs:true},"",url.href);if(scroll){if(url.hash){let id=url.hash.slice(1);try{id=decodeURIComponent(id)}catch{}document.getElementById(id)?.scrollIntoView({block:"start"})}else window.scrollTo({top:0,left:0})}return true}catch(error){if(error?.name==="AbortError")return true;return false}finally{if(navigateController===controller){delete document.documentElement.dataset.farmDocsNavigating;navigateController=null}}};const initClientNavigation=()=>{document.addEventListener("click",(event)=>{if(event.defaultPrevented||event.button!==0||event.metaKey||event.ctrlKey||event.shiftKey||event.altKey)return;const target=event.target instanceof Element?event.target.closest("a[href]"):null;if(!target||target.target||target.hasAttribute("download"))return;let url;try{url=new URL(target.href,location.href)}catch{return}if(url.origin!==location.origin||!isDocsPath(url.pathname))return;if(normalizePath(url.pathname)===normalizePath(location.pathname)&&url.hash)return;event.preventDefault();navigateDocs(url).then((handled)=>{if(!handled)location.href=url.href})});window.addEventListener("popstate",()=>{navigateDocs(new URL(location.href),{replace:true,scroll:false}).then((handled)=>{if(!handled)location.reload()})})};const init=()=>{initToc();initMobileSidebar();initSidebarScroll();initClientNavigation()};if(document.readyState==="loading")document.addEventListener("DOMContentLoaded",init,{once:true});else init()})();</script>`;
1869
1869
  }
1870
1870
  function renderDocsPageActionsRuntimeScript() {
@@ -115,6 +115,16 @@ function createFarmDeploymentCookie(deploymentId, path = "/", secure = false) {
115
115
  secure ? "Secure" : ""
116
116
  ].filter(Boolean).join("; ");
117
117
  }
118
+ function withoutFarmDeploymentCookie(cookieHeader) {
119
+ if (!cookieHeader) return void 0;
120
+ if (!cookieHeader.includes(FARM_DEPLOYMENT_COOKIE)) return cookieHeader;
121
+ const remaining = cookieHeader.split(";").filter((part) => {
122
+ const separator = part.indexOf("=");
123
+ const name = (separator === -1 ? part : part.slice(0, separator)).trim();
124
+ return name !== FARM_DEPLOYMENT_COOKIE && part.trim() !== "";
125
+ }).join(";").trim();
126
+ return remaining || void 0;
127
+ }
118
128
  function readCookie(cookieHeader, name) {
119
129
  if (!cookieHeader) return void 0;
120
130
  for (const part of cookieHeader.split(";")) {
@@ -165,4 +175,5 @@ function resolveCloudflareProcessEnvFlags(wrangler) {
165
175
 
166
176
 
167
177
 
168
- exports.FARM_DEPLOYMENT_ID_HEADER = FARM_DEPLOYMENT_ID_HEADER; exports.FARM_DEPLOYMENT_MISMATCH_HEADER = FARM_DEPLOYMENT_MISMATCH_HEADER; exports.FARM_DEPLOYMENT_COOKIE = FARM_DEPLOYMENT_COOKIE; exports.FARM_DEPLOYMENT_MISMATCH_CODE = FARM_DEPLOYMENT_MISMATCH_CODE; exports.FARM_DEPLOYMENT_MISMATCH_STATUS = FARM_DEPLOYMENT_MISMATCH_STATUS; exports.getFarmPresetRuntime = getFarmPresetRuntime; exports.FarmDeploymentMismatchError = FarmDeploymentMismatchError; exports.normalizeFarmDeploymentId = normalizeFarmDeploymentId; exports.createFarmDeploymentRequestHeaders = createFarmDeploymentRequestHeaders; exports.getFarmRequestDeploymentId = getFarmRequestDeploymentId; exports.getFarmDeploymentMismatch = getFarmDeploymentMismatch; exports.createFarmDeploymentMismatchResponse = createFarmDeploymentMismatchResponse; exports.withFarmDeploymentResponse = withFarmDeploymentResponse; exports.getFarmResponseDeploymentId = getFarmResponseDeploymentId; exports.isFarmDeploymentMismatchResponse = isFarmDeploymentMismatchResponse; exports.createFarmDeploymentMismatchError = createFarmDeploymentMismatchError; exports.createFarmDeploymentCookie = createFarmDeploymentCookie; exports.resolveCloudflareProcessEnvFlags = resolveCloudflareProcessEnvFlags;
178
+
179
+ exports.FARM_DEPLOYMENT_ID_HEADER = FARM_DEPLOYMENT_ID_HEADER; exports.FARM_DEPLOYMENT_MISMATCH_HEADER = FARM_DEPLOYMENT_MISMATCH_HEADER; exports.FARM_DEPLOYMENT_COOKIE = FARM_DEPLOYMENT_COOKIE; exports.FARM_DEPLOYMENT_MISMATCH_CODE = FARM_DEPLOYMENT_MISMATCH_CODE; exports.FARM_DEPLOYMENT_MISMATCH_STATUS = FARM_DEPLOYMENT_MISMATCH_STATUS; exports.getFarmPresetRuntime = getFarmPresetRuntime; exports.FarmDeploymentMismatchError = FarmDeploymentMismatchError; exports.normalizeFarmDeploymentId = normalizeFarmDeploymentId; exports.createFarmDeploymentRequestHeaders = createFarmDeploymentRequestHeaders; exports.getFarmRequestDeploymentId = getFarmRequestDeploymentId; exports.getFarmDeploymentMismatch = getFarmDeploymentMismatch; exports.createFarmDeploymentMismatchResponse = createFarmDeploymentMismatchResponse; exports.withFarmDeploymentResponse = withFarmDeploymentResponse; exports.getFarmResponseDeploymentId = getFarmResponseDeploymentId; exports.isFarmDeploymentMismatchResponse = isFarmDeploymentMismatchResponse; exports.createFarmDeploymentMismatchError = createFarmDeploymentMismatchError; exports.createFarmDeploymentCookie = createFarmDeploymentCookie; exports.withoutFarmDeploymentCookie = withoutFarmDeploymentCookie; exports.resolveCloudflareProcessEnvFlags = resolveCloudflareProcessEnvFlags;
@@ -8,7 +8,10 @@ var _chunkUNJZGVPUcjs = require('./chunk-UNJZGVPU.cjs');
8
8
 
9
9
 
10
10
 
11
- var _chunkFT6KJHS3cjs = require('./chunk-FT6KJHS3.cjs');
11
+ var _chunkC2JOS77Zcjs = require('./chunk-C2JOS77Z.cjs');
12
+
13
+
14
+ var _chunkNLBHLPEOcjs = require('./chunk-NLBHLPEO.cjs');
12
15
 
13
16
  // src/app-markdown-runtime.ts
14
17
  var _url = require('url');
@@ -18,7 +21,7 @@ function isFarmMarkdownPageFile(filePath) {
18
21
  function normalizeFarmMarkdownRoutePath(pathname, routePathname) {
19
22
  const withoutExtension = pathname.replace(/\.md$/i, "");
20
23
  const normalized = withoutExtension.startsWith("/") ? withoutExtension : `/${withoutExtension}`;
21
- return _chunkFT6KJHS3cjs._resolveFarmMarkdownIndexAlias.call(void 0, normalized.replace(/\/+$/g, "") || "/", routePathname);
24
+ return _chunkC2JOS77Zcjs._resolveFarmMarkdownIndexAlias.call(void 0, normalized.replace(/\/+$/g, "") || "/", routePathname);
22
25
  }
23
26
  function parseMarkdownFrontmatter(source) {
24
27
  if (!source.startsWith("---")) {
@@ -171,7 +174,7 @@ async function anonymousVisitorOpensPage(options, url, targetPathname) {
171
174
  if (!PAGE_CHECK_DROPPED_HEADERS.has(name.toLowerCase())) headers.append(name, value);
172
175
  }
173
176
  headers.set("accept", "text/html");
174
- headers.set(_chunkFT6KJHS3cjs.FARM_MARKDOWN_PAGE_CHECK_HEADER, _chunkFT6KJHS3cjs._getFarmMarkdownPageCheckToken.call(void 0, ));
177
+ headers.set(_chunkC2JOS77Zcjs.FARM_MARKDOWN_PAGE_CHECK_HEADER, _chunkC2JOS77Zcjs._getFarmMarkdownPageCheckToken.call(void 0, ));
175
178
  const response = await options.renderPage(
176
179
  new Request(pageUrl, {
177
180
  method: "GET",
@@ -203,7 +206,7 @@ async function createFarmMarkdownSourceResponse(options) {
203
206
  }
204
207
  const url = new URL(options.request.url);
205
208
  const hasMarkdownExtension = url.pathname.toLowerCase().endsWith(".md");
206
- if (!hasMarkdownExtension && !_chunkFT6KJHS3cjs.requestAcceptsMarkdown.call(void 0, options.request.headers.get("accept"))) {
209
+ if (!hasMarkdownExtension && !_chunkC2JOS77Zcjs.requestAcceptsMarkdown.call(void 0, options.request.headers.get("accept"))) {
207
210
  return null;
208
211
  }
209
212
  const targetPathname = normalizeFarmMarkdownRoutePath(url.pathname, options.routePathname);
@@ -229,7 +232,7 @@ async function createFarmMarkdownSourceResponse(options) {
229
232
  );
230
233
  if (publicResponse.headers.get("X-Farm-Markdown-Route") === targetPathname && publicResponse.headers.has("X-Farm-Markdown-Source")) {
231
234
  let response = publicResponse;
232
- if (options.request.headers.has("cookie") || options.request.headers.has("authorization")) {
235
+ if (_chunkNLBHLPEOcjs.withoutFarmDeploymentCookie.call(void 0, options.request.headers.get("cookie")) || options.request.headers.has("authorization")) {
233
236
  const headers2 = new Headers(publicResponse.headers);
234
237
  headers2.set("Cache-Control", "private, no-store");
235
238
  response = new Response(publicResponse.body, {
@@ -257,7 +260,7 @@ async function createFarmMarkdownSourceResponse(options) {
257
260
  }
258
261
  const headers = new Headers({
259
262
  "Content-Type": "text/markdown; charset=utf-8",
260
- "Content-Location": _chunkFT6KJHS3cjs._getFarmMarkdownPath.call(void 0,
263
+ "Content-Location": _chunkC2JOS77Zcjs._getFarmMarkdownPath.call(void 0,
261
264
  targetPathname,
262
265
  _optionalChain([options, 'access', _26 => _26.routePathname, 'optionalCall', _27 => _27(targetPathname)])
263
266
  ),
@@ -268,7 +271,7 @@ async function createFarmMarkdownSourceResponse(options) {
268
271
  if (!hasMarkdownExtension) {
269
272
  headers.set("Vary", "Accept");
270
273
  }
271
- return _chunkFT6KJHS3cjs.createFarmMarkdownViewResponse.call(void 0, {
274
+ return _chunkC2JOS77Zcjs.createFarmMarkdownViewResponse.call(void 0, {
272
275
  request: options.request,
273
276
  requestUrl: url,
274
277
  markdown: source.source,
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "0.1.69";
2
+ var version = "0.1.70";
3
3
 
4
4
  // src/version.ts
5
5
  var FARM_VERSION = version;
@@ -3,7 +3,13 @@
3
3
 
4
4
 
5
5
 
6
- var _chunkFT6KJHS3cjs = require('./chunk-FT6KJHS3.cjs');
6
+ var _chunkC2JOS77Zcjs = require('./chunk-C2JOS77Z.cjs');
7
+
8
+
9
+ var _chunkDVJM55D2cjs = require('./chunk-DVJM55D2.cjs');
10
+
11
+
12
+ var _chunkOWQV6MLMcjs = require('./chunk-OWQV6MLM.cjs');
7
13
 
8
14
 
9
15
  var _chunkD22BUQKWcjs = require('./chunk-D22BUQKW.cjs');
@@ -59,22 +65,33 @@ function collectFarmLlmsTxtPages(sources, options) {
59
65
  for (const source of sources) {
60
66
  const path = source.pattern;
61
67
  if (path.includes("[") || pages.has(path)) continue;
62
- if (include.length && !include.some((pattern) => _chunkFT6KJHS3cjs.matchesFarmMarkdownRoutePattern.call(void 0, pattern, path))) {
68
+ if (include.length && !include.some((pattern) => _chunkC2JOS77Zcjs.matchesFarmMarkdownRoutePattern.call(void 0, pattern, path))) {
63
69
  continue;
64
70
  }
65
- if (exclude.some((pattern) => _chunkFT6KJHS3cjs.matchesFarmMarkdownRoutePattern.call(void 0, pattern, path))) continue;
71
+ if (exclude.some((pattern) => _chunkC2JOS77Zcjs.matchesFarmMarkdownRoutePattern.call(void 0, pattern, path))) continue;
66
72
  if (isFarmMetadataNoIndex(source.metadata)) continue;
67
- const target = _chunkFT6KJHS3cjs.isFarmMarkdownMirrorExposed.call(void 0, options.markdown, path) ? _chunkFT6KJHS3cjs.getFarmMarkdownMirrorPath.call(void 0, path) : path;
73
+ const target = _chunkC2JOS77Zcjs.isFarmMarkdownMirrorExposed.call(void 0, options.markdown, path) ? getFarmAgentPagePublicPath(_chunkC2JOS77Zcjs.getFarmMarkdownMirrorPath.call(void 0, path), options) : _chunkDVJM55D2cjs.normalizeFarmTrailingSlashPathname.call(void 0,
74
+ getFarmAgentPagePublicPath(path, options),
75
+ options.trailingSlash === true
76
+ );
68
77
  const description = readMetadataString(source.metadata, "description");
69
78
  pages.set(path, {
70
79
  path,
71
80
  title: _nullishCoalesce(readMetadataTitle(source.metadata), () => ( fallbackPageTitle(path))),
72
- url: `${options.origin}${_chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, target, options.basePath)}`,
81
+ url: `${options.origin}${target}`,
73
82
  ...description ? { description } : {}
74
83
  });
75
84
  }
76
85
  return [...pages.values()].sort((left, right) => left.path.localeCompare(right.path));
77
86
  }
87
+ function getFarmAgentPagePublicPath(pathname, options) {
88
+ const { i18n } = options;
89
+ if (!i18n || i18n.enabled === false) return _chunkD22BUQKWcjs.applyFarmBasePath.call(void 0, pathname, options.basePath);
90
+ return _chunkOWQV6MLMcjs.localizeFarmPathname.call(void 0, pathname, i18n.defaultLocale, {
91
+ ...i18n,
92
+ basePath: _nullishCoalesce(options.basePath, () => ( i18n.basePath))
93
+ });
94
+ }
78
95
  function resolveFarmAgentOrigin(metadataBase, requestOrigin) {
79
96
  if (typeof metadataBase !== "string" && !(metadataBase instanceof URL)) return requestOrigin;
80
97
  try {
@@ -182,7 +199,7 @@ function createFarmLlmsMarkdownReader(fetchMarkdown) {
182
199
  try {
183
200
  const response = await fetchMarkdown(
184
201
  new Request(url, {
185
- headers: { accept: "text/markdown", [_chunkFT6KJHS3cjs.FARM_INTERNAL_READ_HEADER]: "llms-full" }
202
+ headers: { accept: "text/markdown", [_chunkC2JOS77Zcjs.FARM_INTERNAL_READ_HEADER]: "llms-full" }
186
203
  })
187
204
  );
188
205
  const type = _nullishCoalesce(response.headers.get("content-type"), () => ( ""));
@@ -368,4 +385,5 @@ function isRecord(value) {
368
385
 
369
386
 
370
387
 
371
- exports.resolveFarmLlmsTxtConfig = resolveFarmLlmsTxtConfig; exports.collectFarmLlmsTxtPages = collectFarmLlmsTxtPages; exports.resolveFarmAgentOrigin = resolveFarmAgentOrigin; exports.readFarmLlmsMarkdownFrom = readFarmLlmsMarkdownFrom; exports.isFarmMetadataNoIndex = isFarmMetadataNoIndex; exports.isFarmPageNoIndex = isFarmPageNoIndex; exports.createFarmDefaultLlmsTxt = createFarmDefaultLlmsTxt; exports.serializeFarmLlmsTxt = serializeFarmLlmsTxt; exports.createFarmLlmsMarkdownReader = createFarmLlmsMarkdownReader; exports.renderFarmLlmsFullTxt = renderFarmLlmsFullTxt; exports.createFarmLlmsFullRenderer = createFarmLlmsFullRenderer;
388
+
389
+ exports.resolveFarmLlmsTxtConfig = resolveFarmLlmsTxtConfig; exports.collectFarmLlmsTxtPages = collectFarmLlmsTxtPages; exports.getFarmAgentPagePublicPath = getFarmAgentPagePublicPath; exports.resolveFarmAgentOrigin = resolveFarmAgentOrigin; exports.readFarmLlmsMarkdownFrom = readFarmLlmsMarkdownFrom; exports.isFarmMetadataNoIndex = isFarmMetadataNoIndex; exports.isFarmPageNoIndex = isFarmPageNoIndex; exports.createFarmDefaultLlmsTxt = createFarmDefaultLlmsTxt; exports.serializeFarmLlmsTxt = serializeFarmLlmsTxt; exports.createFarmLlmsMarkdownReader = createFarmLlmsMarkdownReader; exports.renderFarmLlmsFullTxt = renderFarmLlmsFullTxt; exports.createFarmLlmsFullRenderer = createFarmLlmsFullRenderer;
@@ -153,7 +153,7 @@ async function sendWebResponse(res, response) {
153
153
  }
154
154
  }
155
155
  async function fetchFarmExternalRewrite(request) {
156
- const response = await fetch(request);
156
+ const response = await fetch(request, { redirect: "manual" });
157
157
  if (!response.headers.has("content-encoding")) return response;
158
158
  const headers = new Headers(response.headers);
159
159
  headers.delete("content-encoding");
@@ -21,6 +21,12 @@ import {
21
21
  import {
22
22
  emitFarmEvent
23
23
  } from "./chunk-2DA7CLY7.mjs";
24
+ import {
25
+ FARM_DEPLOYMENT_ID_HEADER,
26
+ createFarmDeploymentCookie,
27
+ getFarmDeploymentMismatch,
28
+ withoutFarmDeploymentCookie
29
+ } from "./chunk-IWJONXPF.mjs";
24
30
  import {
25
31
  _withFarmResponseHeaders
26
32
  } from "./chunk-LM55GS4R.mjs";
@@ -678,6 +684,24 @@ var CDN_CACHE_CONTROL_HEADERS = [
678
684
  "netlify-cdn-cache-control",
679
685
  "cloudflare-cdn-cache-control"
680
686
  ];
687
+ function _hasPrivateFarmRequestHeaders(request, localeCookie) {
688
+ if (request.headers.get("authorization")) return true;
689
+ const cookieHeader = withoutFarmDeploymentCookie(request.headers.get("cookie"));
690
+ if (!cookieHeader) return false;
691
+ return !(localeCookie && isOnlyFarmLocaleCookie(cookieHeader, localeCookie));
692
+ }
693
+ function isOnlyFarmLocaleCookie(cookieHeader, localeCookie) {
694
+ const parts = cookieHeader.split(";");
695
+ if (parts.length !== 1) return false;
696
+ const cookie = parts[0].trim();
697
+ const separator = cookie.indexOf("=");
698
+ if (separator <= 0) return false;
699
+ try {
700
+ return decodeURIComponent(cookie.slice(0, separator).trim()) === localeCookie.name && localeCookie.locales.includes(decodeURIComponent(cookie.slice(separator + 1).trim()));
701
+ } catch {
702
+ return false;
703
+ }
704
+ }
681
705
  function _withFarmGuardedResponseCache(response) {
682
706
  const shareable = !PRIVATE_CACHE_DIRECTIVE.test(response.headers.get("cache-control") ?? "");
683
707
  if (!shareable && !CDN_CACHE_CONTROL_HEADERS.some((name) => response.headers.has(name))) {
@@ -688,11 +712,30 @@ function _withFarmGuardedResponseCache(response) {
688
712
  for (const name of CDN_CACHE_CONTROL_HEADERS) headers.delete(name);
689
713
  });
690
714
  }
715
+ function _withFarmDeploymentCookie(request, response, deploymentId, cookiePath) {
716
+ if (request.method.toUpperCase() !== "GET") return response;
717
+ if (response.headers.get(FARM_DEPLOYMENT_ID_HEADER) !== deploymentId) return response;
718
+ if (!PRIVATE_CACHE_DIRECTIVE.test(response.headers.get("cache-control") ?? "")) return response;
719
+ if (CDN_CACHE_CONTROL_HEADERS.some((name) => response.headers.has(name))) return response;
720
+ if (getFarmDeploymentMismatch(request, deploymentId)) return response;
721
+ return _withFarmResponseHeaders(response, (headers) => {
722
+ headers.append(
723
+ "Set-Cookie",
724
+ createFarmDeploymentCookie(
725
+ deploymentId,
726
+ cookiePath,
727
+ new URL(request.url).protocol === "https:"
728
+ )
729
+ );
730
+ });
731
+ }
691
732
 
692
733
  export {
693
734
  matchesMiddlewareConfig2 as matchesMiddlewareConfig,
694
735
  createProductionMiddlewareRunner,
695
736
  applyProductionMiddlewareHeaders,
696
737
  CDN_CACHE_CONTROL_HEADERS,
697
- _withFarmGuardedResponseCache
738
+ _hasPrivateFarmRequestHeaders,
739
+ _withFarmGuardedResponseCache,
740
+ _withFarmDeploymentCookie
698
741
  };
@@ -9,7 +9,7 @@ var _chunkKBGZ5FD6cjs = require('./chunk-KBGZ5FD6.cjs');
9
9
  var _chunkP2355C6Ecjs = require('./chunk-P2355C6E.cjs');
10
10
 
11
11
 
12
- var _chunkOFBLGH6Vcjs = require('./chunk-OFBLGH6V.cjs');
12
+ var _chunkK66JILV3cjs = require('./chunk-K66JILV3.cjs');
13
13
 
14
14
 
15
15
  var _chunkQEJWNXRIcjs = require('./chunk-QEJWNXRI.cjs');
@@ -35,7 +35,7 @@ var _chunkE7QOEV5Zcjs = require('./chunk-E7QOEV5Z.cjs');
35
35
  var _chunkY3WG64CPcjs = require('./chunk-Y3WG64CP.cjs');
36
36
 
37
37
 
38
- var _chunkYIHRZBD7cjs = require('./chunk-YIHRZBD7.cjs');
38
+ var _chunkJRGR5Z4Kcjs = require('./chunk-JRGR5Z4K.cjs');
39
39
 
40
40
 
41
41
  var _chunkJYNNIGQOcjs = require('./chunk-JYNNIGQO.cjs');
@@ -55,7 +55,7 @@ var _chunkCFG4QERRcjs = require('./chunk-CFG4QERR.cjs');
55
55
 
56
56
 
57
57
 
58
- var _chunkVOQ7XZZTcjs = require('./chunk-VOQ7XZZT.cjs');
58
+ var _chunkY2SZVIVHcjs = require('./chunk-Y2SZVIVH.cjs');
59
59
 
60
60
 
61
61
  var _chunkHDPT6OYEcjs = require('./chunk-HDPT6OYE.cjs');
@@ -148,7 +148,7 @@ function farmApiPlugin(options = {}) {
148
148
  const existing = apiRoutesCache.get(routePath);
149
149
  const existingFile = _optionalChain([endpointSources, 'access', _4 => _4.get, 'call', _5 => _5(routePath), 'optionalAccess', _6 => _6.get, 'call', _7 => _7(normalizedMethod)]);
150
150
  if (existingFile) {
151
- throw new (0, _chunkOFBLGH6Vcjs.APIRouteConflictError)(routePath, normalizedMethod, existingFile, filePath);
151
+ throw new (0, _chunkK66JILV3cjs.APIRouteConflictError)(routePath, normalizedMethod, existingFile, filePath);
152
152
  }
153
153
  if (existing) {
154
154
  if (!existing.methods.includes(normalizedMethod)) {
@@ -323,7 +323,7 @@ function farmApiPlugin(options = {}) {
323
323
  log(`API route discovered: ${availableMethods.join(", ")} ${routePath}`);
324
324
  }
325
325
  } catch (e) {
326
- if (e instanceof _chunkOFBLGH6Vcjs.APIRouteConflictError || e instanceof _chunkYTVSWXEZcjs.AmbiguousRouteError) throw e;
326
+ if (e instanceof _chunkK66JILV3cjs.APIRouteConflictError || e instanceof _chunkYTVSWXEZcjs.AmbiguousRouteError) throw e;
327
327
  log(`API route load failed at ${filePath}: ${e.message}`);
328
328
  }
329
329
  }
@@ -350,7 +350,7 @@ function farmApiPlugin(options = {}) {
350
350
  }
351
351
  }
352
352
  } catch (e) {
353
- if (e instanceof _chunkOFBLGH6Vcjs.APIRouteConflictError || e instanceof _chunkYTVSWXEZcjs.AmbiguousRouteError) throw e;
353
+ if (e instanceof _chunkK66JILV3cjs.APIRouteConflictError || e instanceof _chunkYTVSWXEZcjs.AmbiguousRouteError) throw e;
354
354
  log(`Root routes.ts load failed: ${e.message}`);
355
355
  }
356
356
  break;
@@ -381,7 +381,7 @@ function farmApiPlugin(options = {}) {
381
381
  }
382
382
  }
383
383
  } catch (e) {
384
- if (e instanceof _chunkOFBLGH6Vcjs.APIRouteConflictError || e instanceof _chunkYTVSWXEZcjs.AmbiguousRouteError) throw e;
384
+ if (e instanceof _chunkK66JILV3cjs.APIRouteConflictError || e instanceof _chunkYTVSWXEZcjs.AmbiguousRouteError) throw e;
385
385
  log(`Programmatic routes file load failed at ${routeFile}: ${e.message}`);
386
386
  }
387
387
  }
@@ -446,14 +446,14 @@ function farmApiPlugin(options = {}) {
446
446
  request,
447
447
  (resolution) => {
448
448
  const config = i18n.runtime.config;
449
- const vary = _chunkVOQ7XZZTcjs.getFarmLocaleVaryHeaders.call(void 0, config, resolution);
449
+ const vary = _chunkY2SZVIVHcjs.getFarmLocaleVaryHeaders.call(void 0, config, resolution);
450
450
  if (vary.length > 0) {
451
451
  const current = String(_nullishCoalesce(res.getHeader("Vary"), () => ( "")));
452
452
  res.setHeader("Vary", [current, ...vary].filter(Boolean).join(", "));
453
453
  }
454
454
  if (resolution.persist) {
455
455
  const cookies = res.getHeader("Set-Cookie");
456
- const cookie = _chunkVOQ7XZZTcjs.createFarmLocaleCookie.call(void 0, resolution.locale, config);
456
+ const cookie = _chunkY2SZVIVHcjs.createFarmLocaleCookie.call(void 0, resolution.locale, config);
457
457
  res.setHeader(
458
458
  "Set-Cookie",
459
459
  cookies === void 0 ? cookie : [...[cookies].flat().map(String), cookie]
@@ -526,11 +526,11 @@ function farmApiPlugin(options = {}) {
526
526
  const response = await apiRouterHandler(request);
527
527
  const duration = Date.now() - startTime;
528
528
  logResponse(method, currentPathname, response.status, duration);
529
- await _chunkYIHRZBD7cjs.sendWebResponse.call(void 0, res, response);
529
+ await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0, res, response);
530
530
  } catch (error) {
531
531
  const bodyErrorResponse = _chunkCFG4QERRcjs.createFarmRequestBodyErrorResponse.call(void 0, error);
532
532
  if (bodyErrorResponse) {
533
- await _chunkYIHRZBD7cjs.sendWebResponse.call(void 0, res, bodyErrorResponse);
533
+ await _chunkJRGR5Z4Kcjs.sendWebResponse.call(void 0, res, bodyErrorResponse);
534
534
  return;
535
535
  }
536
536
  const duration = Date.now() - startTime;
@@ -606,7 +606,7 @@ function farmApiPlugin(options = {}) {
606
606
  log(`API router recreated`);
607
607
  } catch (e) {
608
608
  restoreRouteState(previousState);
609
- if (e instanceof _chunkOFBLGH6Vcjs.APIRouteConflictError || e instanceof _chunkYTVSWXEZcjs.AmbiguousRouteError) throw e;
609
+ if (e instanceof _chunkK66JILV3cjs.APIRouteConflictError || e instanceof _chunkYTVSWXEZcjs.AmbiguousRouteError) throw e;
610
610
  log(`Root routes.ts HMR failed: ${e.message}`);
611
611
  }
612
612
  return [];
@@ -644,7 +644,7 @@ function farmApiPlugin(options = {}) {
644
644
  log(`API router recreated`);
645
645
  } catch (e) {
646
646
  restoreRouteState(previousState);
647
- if (e instanceof _chunkOFBLGH6Vcjs.APIRouteConflictError || e instanceof _chunkYTVSWXEZcjs.AmbiguousRouteError) throw e;
647
+ if (e instanceof _chunkK66JILV3cjs.APIRouteConflictError || e instanceof _chunkYTVSWXEZcjs.AmbiguousRouteError) throw e;
648
648
  log(`API route HMR failed: ${e.message}`);
649
649
  }
650
650
  return [];