@farm.js/core 0.1.17 → 0.1.19

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 (269) hide show
  1. package/dist/after.cjs +12 -225
  2. package/dist/agent-runtime.cjs +83 -2800
  3. package/dist/api/client.cjs +17 -4060
  4. package/dist/api/route-manager.cjs +34 -4354
  5. package/dist/api/runtime.cjs +29 -2696
  6. package/dist/api.cjs +88 -8434
  7. package/dist/app-markdown.cjs +39 -280
  8. package/dist/app-markdown.mjs +3 -3
  9. package/dist/cache.cjs +38 -1560
  10. package/dist/chunk-22GUSVNJ.cjs +351 -0
  11. package/dist/{chunk-EN7WTEAY.mjs → chunk-2ANEVVF7.mjs} +1 -1
  12. package/dist/chunk-2CQ74SP6.cjs +13 -0
  13. package/dist/{chunk-YD4J4XCI.mjs → chunk-2GNATDDE.mjs} +1 -1
  14. package/dist/chunk-2SJ4RQ6P.cjs +57 -0
  15. package/dist/chunk-3376ZTRC.cjs +1 -0
  16. package/dist/chunk-4PNUXIVU.cjs +472 -0
  17. package/dist/chunk-4PPEPOZZ.cjs +21 -0
  18. package/dist/chunk-4ZFL5GFN.cjs +520 -0
  19. package/dist/chunk-5OVTOKGH.cjs +65 -0
  20. package/dist/chunk-5QIKR7RR.cjs +224 -0
  21. package/dist/chunk-5ZSWG4UX.cjs +127 -0
  22. package/dist/chunk-62YJ2IEB.cjs +238 -0
  23. package/dist/chunk-6EODJYCX.cjs +183 -0
  24. package/dist/chunk-6EXBPJ24.cjs +434 -0
  25. package/dist/chunk-6QQDAAAZ.cjs +38 -0
  26. package/dist/chunk-6V4TDWEC.cjs +455 -0
  27. package/dist/chunk-72ADZ6GQ.cjs +19 -0
  28. package/dist/chunk-75BRBIFP.cjs +172 -0
  29. package/dist/{chunk-ZCNJKLA2.mjs → chunk-7BC6GAL7.mjs} +1 -1
  30. package/dist/chunk-7W3CPVXS.cjs +24 -0
  31. package/dist/chunk-A6WIQH5Z.cjs +31 -0
  32. package/dist/chunk-A777V5WU.cjs +725 -0
  33. package/dist/chunk-AFOD3LYZ.cjs +377 -0
  34. package/dist/chunk-AH7HOAQ3.cjs +151 -0
  35. package/dist/chunk-AMDMVWMI.cjs +39 -0
  36. package/dist/chunk-AORPIPNB.cjs +552 -0
  37. package/dist/chunk-ARJWXNQL.cjs +256 -0
  38. package/dist/chunk-AYJR42WX.cjs +711 -0
  39. package/dist/chunk-BBVSJVBZ.cjs +600 -0
  40. package/dist/chunk-BIDYX3SL.cjs +91 -0
  41. package/dist/chunk-BYODCJD6.cjs +663 -0
  42. package/dist/chunk-C3VRMB6H.cjs +85 -0
  43. package/dist/chunk-C5GUTBZK.cjs +173 -0
  44. package/dist/chunk-CIAGU2X4.cjs +337 -0
  45. package/dist/chunk-CMGMGHUZ.cjs +27 -0
  46. package/dist/chunk-CXP5U3RW.cjs +54 -0
  47. package/dist/chunk-D2ULAULS.cjs +166 -0
  48. package/dist/chunk-D7JTOLFK.cjs +285 -0
  49. package/dist/chunk-DVM4FKZL.cjs +169 -0
  50. package/dist/chunk-DYEJQTDN.cjs +49 -0
  51. package/dist/chunk-E2ROOWQC.cjs +2225 -0
  52. package/dist/chunk-E3UK5IIB.cjs +593 -0
  53. package/dist/chunk-EM6SBQKM.cjs +470 -0
  54. package/dist/chunk-FJSWYIR7.cjs +482 -0
  55. package/dist/chunk-FK6GO24V.cjs +54 -0
  56. package/dist/{chunk-MVIWBEJF.mjs → chunk-FVZGEVTO.mjs} +7 -7
  57. package/dist/chunk-FXUUWYAX.cjs +654 -0
  58. package/dist/chunk-G3HRIVEY.cjs +395 -0
  59. package/dist/chunk-G643DQCH.cjs +13 -0
  60. package/dist/chunk-G7HXGLEC.cjs +175 -0
  61. package/dist/chunk-GDSHDTJ4.cjs +152 -0
  62. package/dist/chunk-GPVTX3HT.cjs +1415 -0
  63. package/dist/chunk-H6G5INWM.cjs +1094 -0
  64. package/dist/{chunk-DHDVMXYK.mjs → chunk-HALDNTIV.mjs} +30 -4
  65. package/dist/chunk-HBTUGXHS.cjs +180 -0
  66. package/dist/chunk-HREOKQWT.cjs +45 -0
  67. package/dist/{chunk-5QOEPUYE.mjs → chunk-HSDL2AUR.mjs} +1 -1
  68. package/dist/chunk-I4J452B7.cjs +435 -0
  69. package/dist/chunk-I57LW5VZ.cjs +94 -0
  70. package/dist/chunk-I5YBCWQ6.cjs +40 -0
  71. package/dist/chunk-I7PUUDGY.cjs +389 -0
  72. package/dist/chunk-IAMRBF3Z.cjs +86 -0
  73. package/dist/chunk-IQXFRNY2.cjs +169 -0
  74. package/dist/chunk-ISTFC3MZ.cjs +1357 -0
  75. package/dist/chunk-IXTFU4PL.cjs +2355 -0
  76. package/dist/chunk-J3LOGE4T.cjs +42 -0
  77. package/dist/chunk-J7FSKED3.cjs +93 -0
  78. package/dist/chunk-JDNHKPTD.cjs +22 -0
  79. package/dist/chunk-JSROZYYO.cjs +164 -0
  80. package/dist/chunk-K6FNHVDR.cjs +696 -0
  81. package/dist/chunk-KGZIORNL.cjs +43 -0
  82. package/dist/chunk-KR6CKSXT.cjs +15 -0
  83. package/dist/chunk-KROWKCUH.cjs +185 -0
  84. package/dist/chunk-KVFPGF2M.cjs +46 -0
  85. package/dist/{chunk-TNBAYAWO.mjs → chunk-L4DVIHOC.mjs} +1 -1
  86. package/dist/chunk-LCCBO7PJ.cjs +46 -0
  87. package/dist/chunk-LIUGYUX3.cjs +22 -0
  88. package/dist/chunk-LTNGXMQ6.cjs +55 -0
  89. package/dist/chunk-M2L4MYDQ.cjs +14 -0
  90. package/dist/chunk-MCJLA63J.cjs +1 -0
  91. package/dist/chunk-MKB2EGIR.cjs +148 -0
  92. package/dist/chunk-MQ3H6LT5.cjs +202 -0
  93. package/dist/chunk-MT763TDW.cjs +43 -0
  94. package/dist/{chunk-XWAYMDLB.mjs → chunk-MVUREHPN.mjs} +1 -1
  95. package/dist/chunk-MWSK6C4J.cjs +18 -0
  96. package/dist/chunk-MWWVKDW3.cjs +169 -0
  97. package/dist/{chunk-6VQIKZZO.mjs → chunk-N255VYFP.mjs} +1 -1
  98. package/dist/chunk-NBAHDVOJ.cjs +2040 -0
  99. package/dist/chunk-NO3WWW3N.cjs +192 -0
  100. package/dist/chunk-NSFC3LHB.cjs +10244 -0
  101. package/dist/chunk-NZKJGRB3.cjs +230 -0
  102. package/dist/chunk-OAVTUMJP.cjs +1496 -0
  103. package/dist/{chunk-SXHV42UQ.mjs → chunk-OFEY6KHO.mjs} +88 -13
  104. package/dist/chunk-OHY2ZWUG.cjs +25 -0
  105. package/dist/chunk-OI6CMLWX.cjs +47 -0
  106. package/dist/chunk-OWOUTKIJ.cjs +558 -0
  107. package/dist/chunk-OX6O6WVA.cjs +74 -0
  108. package/dist/chunk-OXSIH4D6.cjs +476 -0
  109. package/dist/chunk-OYDRPBBV.cjs +453 -0
  110. package/dist/chunk-OYEUREB6.cjs +35 -0
  111. package/dist/chunk-PCOTGFSM.cjs +139 -0
  112. package/dist/{chunk-76DG3LF3.mjs → chunk-PGQBL5DN.mjs} +1 -1
  113. package/dist/chunk-PZYCPSCC.cjs +35 -0
  114. package/dist/chunk-QBK2AA4U.cjs +445 -0
  115. package/dist/{chunk-UTBVHYS3.mjs → chunk-QBPKKQTD.mjs} +2 -2
  116. package/dist/chunk-QBPXNZGV.cjs +487 -0
  117. package/dist/chunk-QNPEUFHQ.cjs +27 -0
  118. package/dist/chunk-QZRVZSPN.cjs +236 -0
  119. package/dist/chunk-R5A5KNVX.cjs +20 -0
  120. package/dist/chunk-R5JIFR6B.cjs +42 -0
  121. package/dist/chunk-R6AIILII.cjs +193 -0
  122. package/dist/chunk-RFYO7QUD.cjs +9 -0
  123. package/dist/chunk-RG3ZOTG5.cjs +34 -0
  124. package/dist/chunk-ROUTX2E5.cjs +390 -0
  125. package/dist/chunk-RTHIVJ2G.cjs +54 -0
  126. package/dist/chunk-S27FMYAM.cjs +644 -0
  127. package/dist/chunk-S3A45T7F.cjs +166 -0
  128. package/dist/chunk-S3JO3N4H.cjs +17 -0
  129. package/dist/chunk-SK35NQKK.cjs +27 -0
  130. package/dist/chunk-SU7MH53P.cjs +180 -0
  131. package/dist/chunk-SVRTJOUF.cjs +113 -0
  132. package/dist/chunk-SWN467MP.cjs +18 -0
  133. package/dist/chunk-SYQ3MOWW.cjs +73 -0
  134. package/dist/chunk-T5CERMEH.cjs +417 -0
  135. package/dist/chunk-TFAXUHWX.cjs +206 -0
  136. package/dist/chunk-TIWHTW3Q.cjs +24 -0
  137. package/dist/chunk-TKJZFIML.cjs +20 -0
  138. package/dist/chunk-TKNSDBBN.cjs +193 -0
  139. package/dist/chunk-U4KT7QP3.cjs +23 -0
  140. package/dist/chunk-U5BMPGS3.cjs +862 -0
  141. package/dist/chunk-UJ2C4ICS.cjs +277 -0
  142. package/dist/chunk-UQZ4AYTH.cjs +168 -0
  143. package/dist/chunk-US2QVW3E.cjs +36 -0
  144. package/dist/{chunk-QGVJVSNX.mjs → chunk-V4AICMQA.mjs} +2 -2
  145. package/dist/chunk-VB6UCX3V.cjs +421 -0
  146. package/dist/chunk-VEKFLAQM.cjs +300 -0
  147. package/dist/chunk-VQDBNVOO.cjs +14 -0
  148. package/dist/chunk-W4E7WMXE.cjs +71 -0
  149. package/dist/chunk-WJ3HK3LJ.cjs +1102 -0
  150. package/dist/chunk-WMAPPDMM.cjs +28 -0
  151. package/dist/chunk-WMOGFOUJ.cjs +223 -0
  152. package/dist/chunk-WPYFSQKK.cjs +37 -0
  153. package/dist/{chunk-56DAX2BE.mjs → chunk-WZXN4R5Y.mjs} +24 -13
  154. package/dist/chunk-XDGMADQM.cjs +14225 -0
  155. package/dist/chunk-XGC343EY.cjs +443 -0
  156. package/dist/chunk-XSKZORAS.cjs +727 -0
  157. package/dist/chunk-XWAWFQFS.cjs +82 -0
  158. package/dist/chunk-Y4YMF2NQ.cjs +460 -0
  159. package/dist/chunk-Y4YWHNKU.cjs +250 -0
  160. package/dist/chunk-Y53ZSFN6.cjs +504 -0
  161. package/dist/chunk-YA6LLTIJ.cjs +411 -0
  162. package/dist/chunk-YFPGHF5F.cjs +202 -0
  163. package/dist/chunk-YJRZR7VU.cjs +28 -0
  164. package/dist/chunk-YTAABQEV.cjs +1 -0
  165. package/dist/chunk-YX3DBN4M.cjs +18 -0
  166. package/dist/chunk-YZTASLPQ.cjs +64 -0
  167. package/dist/chunk-Z5HIWVDP.cjs +2173 -0
  168. package/dist/chunk-ZEG3OPIB.cjs +93 -0
  169. package/dist/chunk-ZMN3H73H.cjs +155 -0
  170. package/dist/client/lifecycle.cjs +6 -35
  171. package/dist/client-plugins.cjs +7 -448
  172. package/dist/client.cjs +171 -9808
  173. package/dist/config.cjs +8 -36
  174. package/dist/cron.cjs +24 -491
  175. package/dist/deferred.cjs +26 -475
  176. package/dist/deployment.cjs +39 -210
  177. package/dist/devtools-5KGPDVKL.cjs +388 -0
  178. package/dist/{devtools-UFVTMQX5.mjs → devtools-FY5R7TQ4.mjs} +3 -3
  179. package/dist/devtools-client-4WAPJY5L.cjs +254 -0
  180. package/dist/devtools-ui-5GBDIGMK.cjs +1296 -0
  181. package/dist/docs.cjs +46 -5657
  182. package/dist/docs.mjs +5 -5
  183. package/dist/env-types.cjs +5 -226
  184. package/dist/env.cjs +21 -338
  185. package/dist/environment/vite.cjs +8 -372
  186. package/dist/environment.cjs +12 -94
  187. package/dist/font.cjs +13 -63
  188. package/dist/headers.cjs +7 -123
  189. package/dist/i18n/client.cjs +55 -294
  190. package/dist/i18n/index.cjs +22 -209
  191. package/dist/i18n/server.cjs +22 -745
  192. package/dist/image/server.cjs +13 -729
  193. package/dist/image/sharp.cjs +33 -171
  194. package/dist/image.cjs +41 -85
  195. package/dist/index.cjs +1151 -68080
  196. package/dist/index.mjs +14 -14
  197. package/dist/instrumentation.cjs +12 -138
  198. package/dist/integration-orm-55F7CII5.cjs +13 -0
  199. package/dist/integrations.cjs +55 -4090
  200. package/dist/internal/app-markdown-runtime.cjs +27 -224
  201. package/dist/internal/app-markdown-runtime.mjs +2 -2
  202. package/dist/internal/build-runtime.cjs +120 -52259
  203. package/dist/internal/build-runtime.mjs +13 -13
  204. package/dist/internal/cli-runtime.cjs +67 -13811
  205. package/dist/internal/cli-runtime.mjs +7 -7
  206. package/dist/internal/client-error-overlay.cjs +80 -733
  207. package/dist/internal/client-error-overlay.mjs +1 -1
  208. package/dist/internal/client-runtime.cjs +81 -913
  209. package/dist/internal/compression-runtime.cjs +8 -214
  210. package/dist/internal/config-runtime.cjs +42 -6547
  211. package/dist/internal/config-runtime.mjs +3 -3
  212. package/dist/internal/docs-precompiled-runtime.cjs +26 -46
  213. package/dist/internal/infra-analytics-runtime.cjs +10 -536
  214. package/dist/internal/isolated-boundary.cjs +14 -414
  215. package/dist/internal/metadata-image-runtime.cjs +7 -285
  216. package/dist/internal/product-telemetry-runtime.cjs +42 -97
  217. package/dist/internal/product-telemetry-runtime.mjs +1 -1
  218. package/dist/internal/production-node-env.cjs +6 -63
  219. package/dist/internal/production-runtime.cjs +418 -7133
  220. package/dist/internal/production-runtime.mjs +3 -3
  221. package/dist/internal/request-cookies.cjs +6 -54
  222. package/dist/json-ld.cjs +24 -50
  223. package/dist/layers-E4WPJNY5.cjs +17 -0
  224. package/dist/manager-G4B2IPYE.cjs +14 -0
  225. package/dist/markdown.cjs +21 -547
  226. package/dist/markdown.mjs +1 -1
  227. package/dist/middleware.cjs +36 -2995
  228. package/dist/navigation.cjs +22 -2588
  229. package/dist/nitro-4I2MYLY2.cjs +652 -0
  230. package/dist/observability.cjs +22 -614
  231. package/dist/og.cjs +5 -28
  232. package/dist/plugin.cjs +106 -37442
  233. package/dist/plugin.mjs +9 -9
  234. package/dist/query/client.cjs +113 -449
  235. package/dist/query/index.cjs +26 -288
  236. package/dist/query/parsers.cjs +23 -247
  237. package/dist/query/server.cjs +36 -298
  238. package/dist/renderer/react/client.cjs +9 -43
  239. package/dist/renderer/react/server.cjs +40 -103
  240. package/dist/renderer/react/vite.cjs +7 -29
  241. package/dist/renderer-client.cjs +126 -4295
  242. package/dist/renderer.cjs +31 -249
  243. package/dist/request.cjs +5 -68
  244. package/dist/router.cjs +11 -474
  245. package/dist/routes.cjs +42 -2461
  246. package/dist/{schema-dev-notice-2IE2F2XI.mjs → schema-dev-notice-O67CPXJ6.mjs} +1 -1
  247. package/dist/schema-dev-notice-Y7MQEFGN.cjs +56 -0
  248. package/dist/schema.cjs +6 -33
  249. package/dist/search-client-G3RICOFU.cjs +13 -0
  250. package/dist/server-action-security.cjs +25 -541
  251. package/dist/server-fn-client.cjs +6 -337
  252. package/dist/server-fn.cjs +32 -1841
  253. package/dist/server-plugins.cjs +15 -884
  254. package/dist/server-query-client.cjs +15 -1883
  255. package/dist/server-query.cjs +16 -1838
  256. package/dist/server.cjs +296 -44681
  257. package/dist/server.mjs +11 -11
  258. package/dist/storage.cjs +57 -576
  259. package/dist/testing.cjs +89 -3186
  260. package/dist/theme/client.cjs +13 -108
  261. package/dist/theme/index.cjs +6 -68
  262. package/dist/theme/runtime.cjs +13 -78
  263. package/dist/theme/server.cjs +10 -179
  264. package/dist/version.cjs +4 -32
  265. package/dist/version.mjs +1 -1
  266. package/dist/vite.cjs +119 -37773
  267. package/dist/vite.mjs +9 -9
  268. package/dist/workflows.cjs +19 -1040
  269. package/package.json +1 -1
@@ -1,288 +1,10 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
9
- var __export = (target, all) => {
10
- for (var name in all)
11
- __defProp(target, name, { get: all[name], enumerable: true });
12
- };
13
- var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from))
16
- if (!__hasOwnProp.call(to, key) && key !== except)
17
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
- }
19
- return to;
20
- };
21
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
- // If the importer is in node compatibility mode or this is not an ESM
23
- // file that has been converted to a CommonJS file using a Babel-
24
- // compatible transform (i.e. "__esModule" has not been set), then set
25
- // "default" to the CommonJS "module.exports" for node compatibility.
26
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
- mod
28
- ));
29
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
30
2
 
31
- // src/metadata-image.ts
32
- var metadata_image_exports = {};
33
- __export(metadata_image_exports, {
34
- createFarmMetadataImageResponse: () => createFarmMetadataImageResponse
35
- });
36
- module.exports = __toCommonJS(metadata_image_exports);
3
+ var _chunkTKNSDBBNcjs = require('../chunk-TKNSDBBN.cjs');
4
+ require('../chunk-TKJZFIML.cjs');
5
+ require('../chunk-EM6SBQKM.cjs');
6
+ require('../chunk-NO3WWW3N.cjs');
7
+ require('../chunk-S3JO3N4H.cjs');
37
8
 
38
- // src/response-body.ts
39
- function omitFarmResponseBody(response) {
40
- if (response.body) {
41
- void response.body.cancel().catch(() => void 0);
42
- }
43
- return new Response(null, {
44
- status: response.status,
45
- statusText: response.statusText,
46
- headers: response.headers
47
- });
48
- }
49
- __name(omitFarmResponseBody, "omitFarmResponseBody");
50
9
 
51
- // src/server-http.ts
52
- function matchesFarmIfNoneMatch(value, etag) {
53
- const expected = parseEntityTag(trimOptionalWhitespace(etag));
54
- if (!expected) return false;
55
- const values = Array.isArray(value) ? value : [value];
56
- const combined = values.filter((header) => typeof header === "string").join(",");
57
- const fieldValue = trimOptionalWhitespace(combined);
58
- if (!fieldValue) return false;
59
- if (fieldValue === "*") return true;
60
- let matched = false;
61
- let hasEntityTag = false;
62
- for (const candidate of splitEntityTags(fieldValue)) {
63
- const token = trimOptionalWhitespace(candidate);
64
- if (!token) continue;
65
- const parsed = parseEntityTag(token);
66
- if (!parsed) return false;
67
- hasEntityTag = true;
68
- if (parsed === expected) matched = true;
69
- }
70
- return hasEntityTag && matched;
71
- }
72
- __name(matchesFarmIfNoneMatch, "matchesFarmIfNoneMatch");
73
- function trimOptionalWhitespace(value) {
74
- return value.replace(/^[\t ]+|[\t ]+$/g, "");
75
- }
76
- __name(trimOptionalWhitespace, "trimOptionalWhitespace");
77
- function parseEntityTag(value) {
78
- const opaqueTag = value.startsWith("W/") ? value.slice(2) : value;
79
- if (opaqueTag.length < 2 || opaqueTag[0] !== '"' || opaqueTag.at(-1) !== '"') return null;
80
- for (let index = 1; index < opaqueTag.length - 1; index++) {
81
- const code = opaqueTag.charCodeAt(index);
82
- if (code === 33 || code >= 35 && code <= 126 || code >= 128) continue;
83
- return null;
84
- }
85
- return opaqueTag;
86
- }
87
- __name(parseEntityTag, "parseEntityTag");
88
- function splitEntityTags(value) {
89
- const tags = [];
90
- let start = 0;
91
- let quoted = false;
92
- for (let index = 0; index < value.length; index++) {
93
- const character = value[index];
94
- if (character === '"') {
95
- quoted = !quoted;
96
- } else if (character === "," && !quoted) {
97
- tags.push(value.slice(start, index));
98
- start = index + 1;
99
- }
100
- }
101
- tags.push(value.slice(start));
102
- return tags;
103
- }
104
- __name(splitEntityTags, "splitEntityTags");
105
-
106
- // src/metadata-image.ts
107
- var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.element");
108
- var REACT_TRANSITIONAL_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.transitional.element");
109
- var REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref");
110
- var REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo");
111
- var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
112
- function isResponse(value) {
113
- return typeof Response !== "undefined" && (value instanceof Response || Boolean(
114
- value && typeof value === "object" && typeof value.arrayBuffer === "function" && value.headers
115
- ));
116
- }
117
- __name(isResponse, "isResponse");
118
- function isThenable(value) {
119
- return Boolean(
120
- value && (typeof value === "object" || typeof value === "function") && typeof value.then === "function"
121
- );
122
- }
123
- __name(isThenable, "isThenable");
124
- function isReactElement(value) {
125
- if (!value || typeof value !== "object") return false;
126
- const marker = value.$$typeof;
127
- return marker === REACT_ELEMENT_TYPE || marker === REACT_TRANSITIONAL_ELEMENT_TYPE;
128
- }
129
- __name(isReactElement, "isReactElement");
130
- async function prepareMetadataImageNode(node) {
131
- if (isThenable(node)) {
132
- return prepareMetadataImageNode(await node);
133
- }
134
- if (Array.isArray(node)) {
135
- return Promise.all(node.map((child) => prepareMetadataImageNode(child)));
136
- }
137
- if (!isReactElement(node)) {
138
- return node;
139
- }
140
- const element = node;
141
- const type = element.type;
142
- const props = element.props || {};
143
- if (typeof type === "function") {
144
- if (type.prototype?.isReactComponent) {
145
- throw new Error(
146
- "Metadata image components must be stateless function components; React class components are not supported."
147
- );
148
- }
149
- return prepareMetadataImageNode(await type(props));
150
- }
151
- if (type && typeof type === "object") {
152
- if (type.$$typeof === REACT_MEMO_TYPE) {
153
- const { createElement: createElement2 } = await import("react");
154
- return prepareMetadataImageNode(createElement2(type.type, props));
155
- }
156
- if (type.$$typeof === REACT_FORWARD_REF_TYPE) {
157
- return prepareMetadataImageNode(await type.render(props, null));
158
- }
159
- if (type.$$typeof === REACT_LAZY_TYPE) {
160
- const { createElement: createElement2 } = await import("react");
161
- let resolvedType;
162
- try {
163
- resolvedType = type._init(type._payload);
164
- } catch (suspension) {
165
- if (suspension && typeof suspension.then === "function") {
166
- await suspension;
167
- resolvedType = type._init(type._payload);
168
- } else {
169
- throw suspension;
170
- }
171
- }
172
- return prepareMetadataImageNode(createElement2(resolvedType, props));
173
- }
174
- }
175
- const preparedChildren = await prepareMetadataImageNode(props.children);
176
- const preparedProps = { ...props };
177
- if (typeof preparedProps.className === "string") {
178
- preparedProps.tw = [preparedProps.tw, preparedProps.className].filter(Boolean).join(" ");
179
- delete preparedProps.className;
180
- }
181
- delete preparedProps.children;
182
- const { createElement } = await import("react");
183
- return createElement(type, {
184
- ...preparedProps,
185
- key: element.key,
186
- children: preparedChildren
187
- });
188
- }
189
- __name(prepareMetadataImageNode, "prepareMetadataImageNode");
190
- async function normalizeFonts(fonts) {
191
- if (!fonts?.length) return void 0;
192
- return Promise.all(
193
- fonts.map(async (font) => {
194
- const data = await font.data;
195
- const arrayBuffer = ArrayBuffer.isView(data) ? toArrayBuffer(data) : data;
196
- return { ...font, data: arrayBuffer };
197
- })
198
- );
199
- }
200
- __name(normalizeFonts, "normalizeFonts");
201
- function resolveCacheControl(revalidate) {
202
- if (revalidate === false) {
203
- return "public, max-age=31536000, immutable";
204
- }
205
- if (typeof revalidate === "number" && Number.isFinite(revalidate) && revalidate > 0) {
206
- return `public, s-maxage=${Math.floor(revalidate)}, stale-while-revalidate=300`;
207
- }
208
- return "public, max-age=0, must-revalidate";
209
- }
210
- __name(resolveCacheControl, "resolveCacheControl");
211
- function toArrayBuffer(value) {
212
- if (value instanceof ArrayBuffer) return value;
213
- const bytes = new Uint8Array(value.byteLength);
214
- bytes.set(new Uint8Array(value.buffer, value.byteOffset, value.byteLength));
215
- return bytes.buffer;
216
- }
217
- __name(toArrayBuffer, "toArrayBuffer");
218
- async function createEntityTag(body) {
219
- const digest = await globalThis.crypto.subtle.digest("SHA-256", body);
220
- const hash = Array.from(new Uint8Array(digest), (byte) => byte.toString(16).padStart(2, "0")).join("").slice(0, 32);
221
- return `"${hash}"`;
222
- }
223
- __name(createEntityTag, "createEntityTag");
224
- async function finalizeMetadataImageResponse(body, headers, options) {
225
- const responseHeaders = new Headers(headers);
226
- const etag = await createEntityTag(body);
227
- responseHeaders.set("ETag", etag);
228
- responseHeaders.set("Content-Length", String(body.byteLength));
229
- responseHeaders.set("X-Content-Type-Options", "nosniff");
230
- if (matchesFarmIfNoneMatch(options.ifNoneMatch, etag)) {
231
- return new Response(null, { status: 304, headers: responseHeaders });
232
- }
233
- return new Response(options.method?.toUpperCase() === "HEAD" ? null : body, {
234
- status: 200,
235
- headers: responseHeaders
236
- });
237
- }
238
- __name(finalizeMetadataImageResponse, "finalizeMetadataImageResponse");
239
- async function createFarmMetadataImageResponse(value, imageModule, options = {}) {
240
- const method = (options.method || "GET").toUpperCase();
241
- if (method !== "GET" && method !== "HEAD") {
242
- return new Response(null, { status: 405, headers: { Allow: "GET, HEAD" } });
243
- }
244
- if (isResponse(value)) {
245
- return method === "HEAD" ? omitFarmResponseBody(value) : value;
246
- }
247
- const cacheControl = resolveCacheControl(imageModule.revalidate);
248
- const explicitContentType = imageModule.contentType?.split(";", 1)[0]?.trim().toLowerCase();
249
- if (isReactElement(value) && explicitContentType !== "image/svg+xml") {
250
- const { ImageResponse } = await import("@vercel/og");
251
- const element = await prepareMetadataImageNode(value);
252
- const response = new ImageResponse(element, {
253
- width: imageModule.size?.width || 1200,
254
- height: imageModule.size?.height || 630,
255
- fonts: await normalizeFonts(imageModule.fonts),
256
- emoji: imageModule.emoji,
257
- debug: imageModule.debug,
258
- headers: { "cache-control": cacheControl }
259
- });
260
- const headers = new Headers(response.headers);
261
- headers.set("Cache-Control", cacheControl);
262
- return finalizeMetadataImageResponse(await response.arrayBuffer(), headers, options);
263
- }
264
- let body;
265
- if (typeof value === "string") {
266
- body = toArrayBuffer(new TextEncoder().encode(value));
267
- } else if (value instanceof ArrayBuffer || ArrayBuffer.isView(value)) {
268
- body = toArrayBuffer(value);
269
- } else if (isReactElement(value)) {
270
- const { renderToStaticMarkup } = await import("react-dom/server");
271
- body = toArrayBuffer(new TextEncoder().encode(renderToStaticMarkup(value)));
272
- } else {
273
- throw new Error("Metadata image must return a Response, string, bytes, or React element");
274
- }
275
- return finalizeMetadataImageResponse(
276
- body,
277
- {
278
- "Content-Type": imageModule.contentType || "image/svg+xml; charset=utf-8",
279
- "Cache-Control": cacheControl
280
- },
281
- options
282
- );
283
- }
284
- __name(createFarmMetadataImageResponse, "createFarmMetadataImageResponse");
285
- // Annotate the CommonJS export names for ESM import in node:
286
- 0 && (module.exports = {
287
- createFarmMetadataImageResponse
288
- });
10
+ exports.createFarmMetadataImageResponse = _chunkTKNSDBBNcjs.createFarmMetadataImageResponse;
@@ -1,66 +1,12 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
20
2
 
21
- // src/product-telemetry.ts
22
- var product_telemetry_exports = {};
23
- __export(product_telemetry_exports, {
24
- FARM_PRODUCTION_SITE_ATTESTATION_EVENT_TYPE: () => FARM_PRODUCTION_SITE_ATTESTATION_EVENT_TYPE,
25
- FARM_PRODUCTION_SITE_ATTESTATION_PATH: () => FARM_PRODUCTION_SITE_ATTESTATION_PATH,
26
- FARM_PRODUCTION_SITE_TELEMETRY_EVENT_TYPE: () => FARM_PRODUCTION_SITE_TELEMETRY_EVENT_TYPE,
27
- FARM_PRODUCTION_SITE_TELEMETRY_PACKAGE_NAME: () => FARM_PRODUCTION_SITE_TELEMETRY_PACKAGE_NAME,
28
- FARM_PRODUCTION_SITE_TELEMETRY_SCHEMA_VERSION: () => FARM_PRODUCTION_SITE_TELEMETRY_SCHEMA_VERSION,
29
- createFarmProductionSiteReporter: () => createFarmProductionSiteReporter,
30
- detectFarmProductionSiteOrigin: () => detectFarmProductionSiteOrigin,
31
- normalizeFarmProductionSiteOrigin: () => normalizeFarmProductionSiteOrigin
32
- });
33
- module.exports = __toCommonJS(product_telemetry_exports);
3
+ var _chunkCXP5U3RWcjs = require('../chunk-CXP5U3RW.cjs');
34
4
 
35
- // src/deployment-environment.ts
36
- function isFarmProductionDeploymentEnvironment(env = process.env) {
37
- const environment = normalizeEnvironment(env.VERCEL_ENV);
38
- const targetEnvironment = normalizeEnvironment(env.VERCEL_TARGET_ENV);
39
- if (environment && environment !== "production") return false;
40
- if (targetEnvironment && targetEnvironment !== "production") return false;
41
- if (isTrue(env.NETLIFY)) {
42
- const context = normalizeEnvironment(env.CONTEXT);
43
- if (context && context !== "production") return false;
44
- }
45
- if (isTrue(env.IS_PULL_REQUEST)) return false;
46
- return true;
47
- }
48
- __name(isFarmProductionDeploymentEnvironment, "isFarmProductionDeploymentEnvironment");
49
- function normalizeEnvironment(value) {
50
- const normalized = value?.trim().toLowerCase();
51
- return normalized || void 0;
52
- }
53
- __name(normalizeEnvironment, "normalizeEnvironment");
54
- function isTrue(value) {
55
- return value !== void 0 && ["1", "true", "yes", "on"].includes(value.toLowerCase());
56
- }
57
- __name(isTrue, "isTrue");
58
5
 
59
- // package.json
60
- var version = "0.1.17";
6
+ var _chunkRFYO7QUDcjs = require('../chunk-RFYO7QUD.cjs');
61
7
 
62
- // src/version.ts
63
- var FARM_VERSION = version;
8
+
9
+ var _chunkS3JO3N4Hcjs = require('../chunk-S3JO3N4H.cjs');
64
10
 
65
11
  // src/product-telemetry.ts
66
12
  var FARM_PRODUCTION_SITE_TELEMETRY_SCHEMA_VERSION = 1;
@@ -78,11 +24,11 @@ function detectFarmProductionSiteOrigin(value) {
78
24
  try {
79
25
  const url = value instanceof URL ? value : new URL(value);
80
26
  return normalizeFarmProductionSiteOrigin(url.origin);
81
- } catch {
27
+ } catch (e) {
82
28
  return void 0;
83
29
  }
84
30
  }
85
- __name(detectFarmProductionSiteOrigin, "detectFarmProductionSiteOrigin");
31
+ _chunkS3JO3N4Hcjs.__name.call(void 0, detectFarmProductionSiteOrigin, "detectFarmProductionSiteOrigin");
86
32
  function normalizeFarmProductionSiteOrigin(value) {
87
33
  const candidate = value.trim();
88
34
  if (!candidate || candidate.length > 2048) return void 0;
@@ -97,22 +43,22 @@ function normalizeFarmProductionSiteOrigin(value) {
97
43
  return void 0;
98
44
  }
99
45
  return url.origin;
100
- } catch {
46
+ } catch (e2) {
101
47
  return void 0;
102
48
  }
103
49
  }
104
- __name(normalizeFarmProductionSiteOrigin, "normalizeFarmProductionSiteOrigin");
50
+ _chunkS3JO3N4Hcjs.__name.call(void 0, normalizeFarmProductionSiteOrigin, "normalizeFarmProductionSiteOrigin");
105
51
  function createFarmProductionSiteReporter(options) {
106
- const now = options.now ?? Date.now;
107
- const reportIntervalMs = options.reportIntervalMs ?? REPORT_INTERVAL_MS;
108
- const retryIntervalMs = options.retryIntervalMs ?? RETRY_INTERVAL_MS;
109
- const send = options.fetch ?? globalThis.fetch;
52
+ const now = _nullishCoalesce(options.now, () => ( Date.now));
53
+ const reportIntervalMs = _nullishCoalesce(options.reportIntervalMs, () => ( REPORT_INTERVAL_MS));
54
+ const retryIntervalMs = _nullishCoalesce(options.retryIntervalMs, () => ( RETRY_INTERVAL_MS));
55
+ const send = _nullishCoalesce(options.fetch, () => ( globalThis.fetch));
110
56
  const reportStates = /* @__PURE__ */ new Map();
111
57
  const attestation = {
112
58
  schemaVersion: FARM_PRODUCTION_SITE_TELEMETRY_SCHEMA_VERSION,
113
59
  eventType: FARM_PRODUCTION_SITE_ATTESTATION_EVENT_TYPE,
114
60
  packageName: FARM_PRODUCTION_SITE_TELEMETRY_PACKAGE_NAME,
115
- packageVersion: sanitizeDetail(FARM_VERSION, "unknown"),
61
+ packageVersion: sanitizeDetail(_chunkRFYO7QUDcjs.FARM_VERSION, "unknown"),
116
62
  renderer: sanitizeDetail(options.renderer, "custom"),
117
63
  deployTarget: sanitizeDetail(options.deployTarget, "custom")
118
64
  };
@@ -122,7 +68,7 @@ function createFarmProductionSiteReporter(options) {
122
68
  let pathname;
123
69
  try {
124
70
  pathname = new URL(request.url).pathname;
125
- } catch {
71
+ } catch (e3) {
126
72
  return null;
127
73
  }
128
74
  if (pathname !== FARM_PRODUCTION_SITE_ATTESTATION_PATH) return null;
@@ -148,7 +94,7 @@ function createFarmProductionSiteReporter(options) {
148
94
  },
149
95
  report(requestUrl, waitUntil) {
150
96
  if (productionTelemetryDisabled()) return;
151
- if (!isFarmProductionDeploymentEnvironment()) {
97
+ if (!_chunkCXP5U3RWcjs.isFarmProductionDeploymentEnvironment.call(void 0, )) {
152
98
  debug("production-site check-in skipped outside a production deployment");
153
99
  return;
154
100
  }
@@ -182,7 +128,7 @@ function createFarmProductionSiteReporter(options) {
182
128
  if (waitUntil) {
183
129
  try {
184
130
  waitUntil(state.pending);
185
- } catch {
131
+ } catch (e4) {
186
132
  }
187
133
  } else {
188
134
  void state.pending;
@@ -190,7 +136,7 @@ function createFarmProductionSiteReporter(options) {
190
136
  }
191
137
  };
192
138
  }
193
- __name(createFarmProductionSiteReporter, "createFarmProductionSiteReporter");
139
+ _chunkS3JO3N4Hcjs.__name.call(void 0, createFarmProductionSiteReporter, "createFarmProductionSiteReporter");
194
140
  async function deliver(send, endpoint, payload) {
195
141
  if (!endpoint) {
196
142
  debug("invalid or insecure production-site telemetry endpoint; check-in skipped");
@@ -198,7 +144,7 @@ async function deliver(send, endpoint, payload) {
198
144
  }
199
145
  const controller = new AbortController();
200
146
  const timeout = setTimeout(() => controller.abort(), REQUEST_TIMEOUT_MS);
201
- timeout.unref?.();
147
+ _optionalChain([timeout, 'access', _ => _.unref, 'optionalCall', _2 => _2()]);
202
148
  try {
203
149
  const response = await send(endpoint, {
204
150
  method: "POST",
@@ -216,17 +162,17 @@ async function deliver(send, endpoint, payload) {
216
162
  debug("production-site check-in was accepted but not stored");
217
163
  return false;
218
164
  }
219
- } catch {
165
+ } catch (e5) {
220
166
  }
221
167
  return true;
222
- } catch {
168
+ } catch (e6) {
223
169
  debug("production-site check-in failed");
224
170
  return false;
225
171
  } finally {
226
172
  clearTimeout(timeout);
227
173
  }
228
174
  }
229
- __name(deliver, "deliver");
175
+ _chunkS3JO3N4Hcjs.__name.call(void 0, deliver, "deliver");
230
176
  function resolveSiteTelemetryEndpoint(explicit) {
231
177
  const candidate = explicit || process.env.FARM_TELEMETRY_SITE_ENDPOINT;
232
178
  if (!candidate) return DEFAULT_SITE_TELEMETRY_ENDPOINT;
@@ -237,43 +183,42 @@ function resolveSiteTelemetryEndpoint(explicit) {
237
183
  if (url.protocol === "https:" || url.protocol === "http:" && isLocal) {
238
184
  return url.toString();
239
185
  }
240
- } catch {
186
+ } catch (e7) {
241
187
  }
242
188
  return void 0;
243
189
  }
244
- __name(resolveSiteTelemetryEndpoint, "resolveSiteTelemetryEndpoint");
190
+ _chunkS3JO3N4Hcjs.__name.call(void 0, resolveSiteTelemetryEndpoint, "resolveSiteTelemetryEndpoint");
245
191
  function productionTelemetryDisabled() {
246
192
  if (process.env.DO_NOT_TRACK !== void 0 && !isFalse(process.env.DO_NOT_TRACK)) return true;
247
- if (isTrue2(process.env.FARM_TELEMETRY_DISABLED)) return true;
193
+ if (isTrue(process.env.FARM_TELEMETRY_DISABLED)) return true;
248
194
  return isFalse(process.env.FARM_TELEMETRY);
249
195
  }
250
- __name(productionTelemetryDisabled, "productionTelemetryDisabled");
196
+ _chunkS3JO3N4Hcjs.__name.call(void 0, productionTelemetryDisabled, "productionTelemetryDisabled");
251
197
  function sanitizeDetail(value, fallback) {
252
198
  return value && SAFE_DETAIL_PATTERN.test(value) ? value : fallback;
253
199
  }
254
- __name(sanitizeDetail, "sanitizeDetail");
255
- function isTrue2(value) {
200
+ _chunkS3JO3N4Hcjs.__name.call(void 0, sanitizeDetail, "sanitizeDetail");
201
+ function isTrue(value) {
256
202
  return value !== void 0 && ["1", "true", "yes", "on"].includes(value.toLowerCase());
257
203
  }
258
- __name(isTrue2, "isTrue");
204
+ _chunkS3JO3N4Hcjs.__name.call(void 0, isTrue, "isTrue");
259
205
  function isFalse(value) {
260
206
  return value !== void 0 && ["0", "false", "no", "off"].includes(value.toLowerCase());
261
207
  }
262
- __name(isFalse, "isFalse");
208
+ _chunkS3JO3N4Hcjs.__name.call(void 0, isFalse, "isFalse");
263
209
  function debug(message) {
264
- if (!isTrue2(process.env.FARM_TELEMETRY_DEBUG)) return;
210
+ if (!isTrue(process.env.FARM_TELEMETRY_DEBUG)) return;
265
211
  process.stderr.write(`[farm.telemetry] ${message}
266
212
  `);
267
213
  }
268
- __name(debug, "debug");
269
- // Annotate the CommonJS export names for ESM import in node:
270
- 0 && (module.exports = {
271
- FARM_PRODUCTION_SITE_ATTESTATION_EVENT_TYPE,
272
- FARM_PRODUCTION_SITE_ATTESTATION_PATH,
273
- FARM_PRODUCTION_SITE_TELEMETRY_EVENT_TYPE,
274
- FARM_PRODUCTION_SITE_TELEMETRY_PACKAGE_NAME,
275
- FARM_PRODUCTION_SITE_TELEMETRY_SCHEMA_VERSION,
276
- createFarmProductionSiteReporter,
277
- detectFarmProductionSiteOrigin,
278
- normalizeFarmProductionSiteOrigin
279
- });
214
+ _chunkS3JO3N4Hcjs.__name.call(void 0, debug, "debug");
215
+
216
+
217
+
218
+
219
+
220
+
221
+
222
+
223
+
224
+ exports.FARM_PRODUCTION_SITE_ATTESTATION_EVENT_TYPE = FARM_PRODUCTION_SITE_ATTESTATION_EVENT_TYPE; exports.FARM_PRODUCTION_SITE_ATTESTATION_PATH = FARM_PRODUCTION_SITE_ATTESTATION_PATH; exports.FARM_PRODUCTION_SITE_TELEMETRY_EVENT_TYPE = FARM_PRODUCTION_SITE_TELEMETRY_EVENT_TYPE; exports.FARM_PRODUCTION_SITE_TELEMETRY_PACKAGE_NAME = FARM_PRODUCTION_SITE_TELEMETRY_PACKAGE_NAME; exports.FARM_PRODUCTION_SITE_TELEMETRY_SCHEMA_VERSION = FARM_PRODUCTION_SITE_TELEMETRY_SCHEMA_VERSION; exports.createFarmProductionSiteReporter = createFarmProductionSiteReporter; exports.detectFarmProductionSiteOrigin = detectFarmProductionSiteOrigin; exports.normalizeFarmProductionSiteOrigin = normalizeFarmProductionSiteOrigin;
@@ -3,7 +3,7 @@ import {
3
3
  } from "../chunk-BOYNDCZL.mjs";
4
4
  import {
5
5
  FARM_VERSION
6
- } from "../chunk-YD4J4XCI.mjs";
6
+ } from "../chunk-2GNATDDE.mjs";
7
7
  import {
8
8
  __name
9
9
  } from "../chunk-LPEX4YW6.mjs";
@@ -1,64 +1,7 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
20
2
 
21
- // src/build/production-node-env.ts
22
- var production_node_env_exports = {};
23
- __export(production_node_env_exports, {
24
- withProductionNodeEnv: () => withProductionNodeEnv
25
- });
26
- module.exports = __toCommonJS(production_node_env_exports);
27
- var productionNodeEnvStateKey = /* @__PURE__ */ Symbol.for("@farm.js/core/production-node-env-state");
28
- function getProductionNodeEnvState() {
29
- return Reflect.get(globalThis, productionNodeEnvStateKey);
30
- }
31
- __name(getProductionNodeEnvState, "getProductionNodeEnvState");
32
- async function withProductionNodeEnv(operation) {
33
- let state = getProductionNodeEnvState();
34
- if (state) {
35
- state.depth += 1;
36
- } else {
37
- state = {
38
- depth: 1,
39
- original: process.env.NODE_ENV
40
- };
41
- Reflect.set(globalThis, productionNodeEnvStateKey, state);
42
- }
43
- process.env.NODE_ENV = "production";
44
- try {
45
- return await operation();
46
- } finally {
47
- state.depth -= 1;
48
- if (state.depth > 0) {
49
- process.env.NODE_ENV = "production";
50
- } else {
51
- Reflect.deleteProperty(globalThis, productionNodeEnvStateKey);
52
- if (state.original === void 0) {
53
- delete process.env.NODE_ENV;
54
- } else {
55
- process.env.NODE_ENV = state.original;
56
- }
57
- }
58
- }
59
- }
60
- __name(withProductionNodeEnv, "withProductionNodeEnv");
61
- // Annotate the CommonJS export names for ESM import in node:
62
- 0 && (module.exports = {
63
- withProductionNodeEnv
64
- });
3
+ var _chunkMT763TDWcjs = require('../chunk-MT763TDW.cjs');
4
+ require('../chunk-S3JO3N4H.cjs');
5
+
6
+
7
+ exports.withProductionNodeEnv = _chunkMT763TDWcjs.withProductionNodeEnv;