nitro 3.0.0 → 3.0.1-alpha.1

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 (293) hide show
  1. package/dist/_build/common.mjs +68 -0
  2. package/dist/_build/common2.mjs +772 -0
  3. package/dist/_build/rolldown.mjs +206 -0
  4. package/dist/_build/rollup.mjs +289 -0
  5. package/dist/_build/vite.build.mjs +56 -0
  6. package/dist/_build/vite.plugin.mjs +768 -0
  7. package/dist/_chunks/ANM1K1bE.mjs +304 -0
  8. package/dist/_chunks/B-D1JOIz.mjs +1355 -0
  9. package/dist/_chunks/BX9-zVkM.mjs +59 -0
  10. package/dist/_chunks/Bqks5huO.mjs +31 -0
  11. package/dist/_chunks/C7CbzoI1.mjs +39 -0
  12. package/dist/_dev.d.mts +12 -0
  13. package/dist/_dev.mjs +705 -0
  14. package/dist/_libs/acorn.mjs +5034 -0
  15. package/dist/_libs/c12.mjs +2858 -0
  16. package/dist/_libs/chokidar.mjs +1561 -0
  17. package/dist/_libs/citty.mjs +333 -0
  18. package/dist/_libs/commondir.mjs +22 -0
  19. package/dist/_libs/compatx.mjs +46 -0
  20. package/dist/_libs/confbox.mjs +2920 -0
  21. package/dist/_libs/deepmerge.mjs +86 -0
  22. package/dist/_libs/dot-prop.mjs +138 -0
  23. package/dist/_libs/duplexer.mjs +71 -0
  24. package/dist/_libs/escape-string-regexp.mjs +8 -0
  25. package/dist/_libs/estree-walker.mjs +330 -0
  26. package/dist/_libs/etag.mjs +80 -0
  27. package/dist/_libs/fdir.mjs +514 -0
  28. package/dist/_libs/function-bind.mjs +63 -0
  29. package/dist/_libs/gen-mapping.mjs +612 -0
  30. package/dist/_libs/giget.mjs +19289 -0
  31. package/dist/_libs/gzip-size.mjs +21 -0
  32. package/dist/_libs/hasown.mjs +14 -0
  33. package/dist/_libs/httpxy.mjs +410 -0
  34. package/dist/_libs/is-core-module.mjs +220 -0
  35. package/dist/_libs/is-module.mjs +13 -0
  36. package/dist/_libs/is-reference.mjs +32 -0
  37. package/dist/_libs/js-tokens.mjs +382 -0
  38. package/dist/_libs/klona.mjs +38 -0
  39. package/dist/_libs/knitwork.mjs +124 -0
  40. package/dist/_libs/local-pkg.mjs +1686 -0
  41. package/dist/_libs/magic-string.mjs +939 -0
  42. package/dist/_libs/mime.mjs +1391 -0
  43. package/dist/_libs/node-fetch-native.mjs +173 -0
  44. package/dist/_libs/path-parse.mjs +47 -0
  45. package/dist/_libs/pathe.mjs +41 -0
  46. package/dist/_libs/picomatch.mjs +1673 -0
  47. package/dist/_libs/plugin-alias.mjs +64 -0
  48. package/dist/_libs/plugin-commonjs.mjs +1491 -0
  49. package/dist/_libs/plugin-inject.mjs +135 -0
  50. package/dist/_libs/plugin-json.mjs +36 -0
  51. package/dist/_libs/plugin-node-resolve.mjs +1553 -0
  52. package/dist/_libs/plugin-replace.mjs +104 -0
  53. package/dist/_libs/pretty-bytes.mjs +116 -0
  54. package/dist/_libs/remapping.mjs +117 -0
  55. package/dist/_libs/rou3.mjs +319 -0
  56. package/dist/_libs/std-env.mjs +158 -0
  57. package/dist/_libs/strip-literal.mjs +51 -0
  58. package/dist/_libs/tinyglobby.mjs +292 -0
  59. package/dist/_libs/tsconfck.mjs +832 -0
  60. package/dist/_libs/ultrahtml.mjs +138 -0
  61. package/dist/_libs/unimport.mjs +3520 -0
  62. package/dist/_libs/untyped.mjs +271 -0
  63. package/dist/_libs/unwasm.mjs +5836 -0
  64. package/dist/_libs/vite-plugin-fullstack.mjs +561 -0
  65. package/dist/_presets.mjs +1752 -0
  66. package/dist/builder.d.mts +63 -0
  67. package/dist/builder.mjs +33 -0
  68. package/dist/cli/_chunks/build.mjs +48 -0
  69. package/dist/cli/_chunks/common.mjs +15 -0
  70. package/dist/cli/_chunks/detect-acorn.mjs +12 -0
  71. package/dist/cli/_chunks/dev.mjs +68 -0
  72. package/dist/cli/_chunks/dist.mjs +3 -0
  73. package/dist/cli/_chunks/dist2.mjs +3 -0
  74. package/dist/cli/_chunks/dist3.mjs +3 -0
  75. package/dist/cli/_chunks/dist4.mjs +4 -0
  76. package/dist/cli/_chunks/dist5.mjs +4 -0
  77. package/dist/cli/_chunks/esm.mjs +3 -0
  78. package/dist/cli/_chunks/json5.mjs +4 -0
  79. package/dist/cli/_chunks/jsonc.mjs +4 -0
  80. package/dist/cli/_chunks/list.mjs +27 -0
  81. package/dist/cli/_chunks/multipart-parser.mjs +6 -0
  82. package/dist/cli/_chunks/prepare.mjs +19 -0
  83. package/dist/cli/_chunks/run.mjs +55 -0
  84. package/dist/cli/_chunks/task.mjs +16 -0
  85. package/dist/cli/_chunks/toml.mjs +4 -0
  86. package/dist/cli/_chunks/yaml.mjs +4 -0
  87. package/dist/cli/index.d.mts +1 -1
  88. package/dist/cli/index.mjs +20 -476
  89. package/dist/node_modules/@poppinss/dumper/build/formatters/html/main.js +1 -1
  90. package/dist/node_modules/@poppinss/dumper/package.json +1 -1
  91. package/dist/node_modules/@sindresorhus/is/distribution/index.js +1 -1
  92. package/dist/node_modules/@sindresorhus/is/package.json +1 -1
  93. package/dist/node_modules/@speed-highlight/core/dist/index.js +2 -2
  94. package/dist/node_modules/@speed-highlight/core/dist/terminal.js +2 -2
  95. package/dist/node_modules/@speed-highlight/core/package.json +7 -3
  96. package/dist/node_modules/cookie-es/dist/index.mjs +262 -0
  97. package/dist/node_modules/cookie-es/package.json +37 -0
  98. package/dist/node_modules/hookable/dist/index.mjs +243 -266
  99. package/dist/node_modules/hookable/package.json +29 -26
  100. package/dist/node_modules/rendu/dist/index.mjs +380 -0
  101. package/dist/node_modules/rendu/package.json +47 -0
  102. package/dist/node_modules/youch/build/{chunk-VE4LENUR.js → chunk-F4I6KX4R.js} +2 -1
  103. package/dist/node_modules/youch/build/{chunk-JAN2TFI2.js → chunk-YYEJ3AGB.js} +4 -1
  104. package/dist/node_modules/youch/build/index.js +16 -8
  105. package/dist/node_modules/youch/build/public/error_stack/script.js +20 -22
  106. package/dist/node_modules/youch/build/public/header/script.js +0 -2
  107. package/dist/node_modules/youch/build/public/layout/script.js +0 -8
  108. package/dist/node_modules/youch/build/public/layout/style.css +4 -0
  109. package/dist/node_modules/youch/package.json +16 -17
  110. package/dist/presets/_nitro/runtime/nitro-dev.d.mts +1 -0
  111. package/dist/presets/_nitro/runtime/nitro-dev.mjs +48 -42
  112. package/dist/presets/_nitro/runtime/nitro-prerenderer.d.mts +2 -2
  113. package/dist/presets/_nitro/runtime/nitro-prerenderer.mjs +10 -14
  114. package/dist/presets/_nitro/runtime/service-worker.d.mts +1 -0
  115. package/dist/presets/_nitro/runtime/service-worker.mjs +15 -12
  116. package/dist/presets/aws-amplify/runtime/aws-amplify.d.mts +1 -0
  117. package/dist/presets/aws-amplify/runtime/aws-amplify.mjs +7 -6
  118. package/dist/presets/aws-lambda/runtime/_utils.d.mts +8 -13
  119. package/dist/presets/aws-lambda/runtime/_utils.mjs +95 -81
  120. package/dist/presets/aws-lambda/runtime/aws-lambda-streaming.d.mts +1 -2
  121. package/dist/presets/aws-lambda/runtime/aws-lambda-streaming.mjs +26 -28
  122. package/dist/presets/aws-lambda/runtime/aws-lambda.mjs +8 -8
  123. package/dist/presets/azure/runtime/_utils.mjs +43 -43
  124. package/dist/presets/azure/runtime/azure-swa.d.mts +2 -2
  125. package/dist/presets/azure/runtime/azure-swa.mjs +24 -22
  126. package/dist/presets/bun/runtime/bun.d.mts +2 -0
  127. package/dist/presets/bun/runtime/bun.mjs +34 -21
  128. package/dist/presets/cloudflare/runtime/_module-handler.d.mts +10 -7
  129. package/dist/presets/cloudflare/runtime/_module-handler.mjs +80 -88
  130. package/dist/presets/cloudflare/runtime/cloudflare-durable.d.mts +6 -14
  131. package/dist/presets/cloudflare/runtime/cloudflare-durable.mjs +60 -63
  132. package/dist/presets/cloudflare/runtime/cloudflare-module.d.mts +1 -7
  133. package/dist/presets/cloudflare/runtime/cloudflare-module.mjs +14 -16
  134. package/dist/presets/cloudflare/runtime/cloudflare-pages.d.mts +12 -12
  135. package/dist/presets/cloudflare/runtime/cloudflare-pages.mjs +40 -42
  136. package/dist/presets/cloudflare/runtime/plugin.dev.d.mts +2 -2
  137. package/dist/presets/cloudflare/runtime/plugin.dev.mjs +89 -82
  138. package/dist/presets/cloudflare/runtime/shims/workers.dev.mjs +27 -0
  139. package/dist/presets/deno/runtime/deno-deploy.d.mts +4 -0
  140. package/dist/presets/deno/runtime/deno-deploy.mjs +15 -12
  141. package/dist/presets/deno/runtime/deno-server.d.mts +0 -3
  142. package/dist/presets/deno/runtime/deno-server.mjs +32 -52
  143. package/dist/presets/netlify/runtime/netlify-edge.d.mts +2 -1
  144. package/dist/presets/netlify/runtime/netlify-edge.mjs +15 -12
  145. package/dist/presets/netlify/runtime/netlify.mjs +12 -18
  146. package/dist/presets/node/runtime/node-cluster.d.mts +3 -1
  147. package/dist/presets/node/runtime/node-cluster.mjs +50 -54
  148. package/dist/presets/node/runtime/node-middleware.d.mts +2 -3
  149. package/dist/presets/node/runtime/node-middleware.mjs +9 -8
  150. package/dist/presets/node/runtime/node-server.mjs +37 -34
  151. package/dist/presets/standard/runtime/server.d.mts +1 -3
  152. package/dist/presets/standard/runtime/server.mjs +2 -4
  153. package/dist/presets/stormkit/runtime/stormkit.d.mts +13 -13
  154. package/dist/presets/stormkit/runtime/stormkit.mjs +21 -21
  155. package/dist/presets/vercel/runtime/vercel.node.d.mts +3 -0
  156. package/dist/presets/vercel/runtime/vercel.node.mjs +15 -0
  157. package/dist/presets/vercel/runtime/{vercel.d.mts → vercel.web.d.mts} +3 -3
  158. package/dist/presets/vercel/runtime/vercel.web.mjs +20 -0
  159. package/dist/presets/winterjs/runtime/winterjs.d.mts +2 -0
  160. package/dist/presets/winterjs/runtime/winterjs.mjs +73 -69
  161. package/dist/presets/zeabur/runtime/zeabur.d.mts +1 -1
  162. package/dist/presets/zeabur/runtime/zeabur.mjs +1 -1
  163. package/dist/runtime/app.d.mts +1 -0
  164. package/dist/runtime/app.mjs +1 -0
  165. package/dist/runtime/cache.d.mts +1 -0
  166. package/dist/runtime/cache.mjs +1 -0
  167. package/dist/runtime/config.d.mts +3 -0
  168. package/dist/runtime/config.mjs +4 -0
  169. package/dist/runtime/context.d.mts +1 -0
  170. package/dist/runtime/context.mjs +1 -0
  171. package/dist/runtime/database.d.mts +1 -0
  172. package/dist/runtime/database.mjs +1 -0
  173. package/dist/runtime/internal/app.d.mts +11 -1
  174. package/dist/runtime/internal/app.mjs +188 -140
  175. package/dist/runtime/internal/cache.d.mts +9 -5
  176. package/dist/runtime/internal/cache.mjs +248 -219
  177. package/dist/runtime/internal/context.d.mts +9 -9
  178. package/dist/runtime/internal/context.mjs +17 -10
  179. package/dist/runtime/internal/database.mjs +8 -10
  180. package/dist/runtime/internal/error/dev.d.mts +5 -4
  181. package/dist/runtime/internal/error/dev.mjs +106 -105
  182. package/dist/runtime/internal/error/hooks.d.mts +1 -0
  183. package/dist/runtime/internal/error/hooks.mjs +9 -0
  184. package/dist/runtime/internal/error/prod.d.mts +5 -4
  185. package/dist/runtime/internal/error/prod.mjs +51 -59
  186. package/dist/runtime/internal/error/utils.d.mts +4 -4
  187. package/dist/runtime/internal/error/utils.mjs +1 -1
  188. package/dist/runtime/internal/meta.d.mts +1 -1
  189. package/dist/runtime/internal/meta.mjs +1 -1
  190. package/dist/runtime/internal/plugin.d.mts +2 -2
  191. package/dist/runtime/internal/plugin.mjs +1 -1
  192. package/dist/runtime/internal/route-rules.d.mts +8 -8
  193. package/dist/runtime/internal/route-rules.mjs +54 -52
  194. package/dist/runtime/internal/routes/dev-tasks.d.mts +1 -2
  195. package/dist/runtime/internal/routes/dev-tasks.mjs +16 -18
  196. package/dist/runtime/internal/routes/openapi.d.mts +1 -0
  197. package/dist/runtime/internal/routes/openapi.mjs +81 -87
  198. package/dist/runtime/internal/routes/renderer-template.d.mts +1 -1
  199. package/dist/runtime/internal/routes/renderer-template.dev.d.mts +1 -2
  200. package/dist/runtime/internal/routes/renderer-template.dev.mjs +15 -17
  201. package/dist/runtime/internal/routes/renderer-template.mjs +1 -1
  202. package/dist/runtime/internal/routes/scalar.d.mts +1 -0
  203. package/dist/runtime/internal/routes/scalar.mjs +22 -23
  204. package/dist/runtime/internal/routes/swagger.d.mts +1 -0
  205. package/dist/runtime/internal/routes/swagger.mjs +9 -11
  206. package/dist/runtime/internal/runtime-config.d.mts +4 -4
  207. package/dist/runtime/internal/runtime-config.mjs +40 -35
  208. package/dist/runtime/internal/static.mjs +63 -74
  209. package/dist/runtime/internal/storage.mjs +2 -2
  210. package/dist/runtime/internal/task.d.mts +6 -6
  211. package/dist/runtime/internal/task.mjs +56 -60
  212. package/dist/runtime/internal/vite/dev-entry.mjs +11 -1
  213. package/dist/runtime/internal/vite/dev-worker.mjs +9 -57
  214. package/dist/runtime/internal/vite/ssr-renderer.mjs +3 -1
  215. package/{lib/runtime-meta.d.mts → dist/runtime/meta.d.mts} +1 -1
  216. package/dist/runtime/meta.mjs +26 -0
  217. package/dist/runtime/nitro.d.mts +12 -0
  218. package/dist/runtime/nitro.mjs +32 -0
  219. package/dist/runtime/runtime-config.d.mts +1 -0
  220. package/dist/runtime/runtime-config.mjs +1 -0
  221. package/dist/runtime/storage.d.mts +1 -0
  222. package/dist/runtime/storage.mjs +1 -0
  223. package/dist/runtime/task.d.mts +1 -0
  224. package/dist/runtime/task.mjs +1 -0
  225. package/dist/runtime/vite-runtime.d.mts +8 -0
  226. package/dist/runtime/vite-runtime.mjs +9 -0
  227. package/dist/types/index.d.mts +2625 -2297
  228. package/dist/types/index.mjs +1 -1
  229. package/dist/vite.d.mts +49 -51
  230. package/dist/vite.mjs +44 -68
  231. package/lib/tsconfig.json +27 -0
  232. package/package.json +86 -76
  233. package/dist/_chunks/app.mjs +0 -19797
  234. package/dist/_chunks/build.mjs +0 -84
  235. package/dist/_chunks/build2.mjs +0 -318
  236. package/dist/_chunks/build3.mjs +0 -6452
  237. package/dist/_chunks/detect-acorn.mjs +0 -503
  238. package/dist/_chunks/index.mjs +0 -22242
  239. package/dist/_chunks/index2.mjs +0 -297
  240. package/dist/_chunks/index3.mjs +0 -1058
  241. package/dist/_chunks/index4.mjs +0 -1206
  242. package/dist/_chunks/info.mjs +0 -11157
  243. package/dist/_chunks/json5.mjs +0 -68
  244. package/dist/_chunks/jsonc.mjs +0 -51
  245. package/dist/_chunks/pathe.M-eThtNZ.mjs +0 -204
  246. package/dist/_chunks/plugin.mjs +0 -960
  247. package/dist/_chunks/server.mjs +0 -254
  248. package/dist/_chunks/snapshot.mjs +0 -284
  249. package/dist/_chunks/toml.mjs +0 -259
  250. package/dist/_chunks/yaml.mjs +0 -86
  251. package/dist/cli/build.mjs +0 -54
  252. package/dist/cli/common.mjs +0 -13
  253. package/dist/cli/dev.mjs +0 -95
  254. package/dist/cli/index2.mjs +0 -17
  255. package/dist/cli/list.mjs +0 -34
  256. package/dist/cli/prepare.mjs +0 -24
  257. package/dist/cli/run.mjs +0 -60
  258. package/dist/index.d.mts +0 -52
  259. package/dist/index.mjs +0 -55
  260. package/dist/node_modules/cookie/dist/index.js +0 -239
  261. package/dist/node_modules/cookie/package.json +0 -42
  262. package/dist/node_modules/klona/dist/index.mjs +0 -81
  263. package/dist/node_modules/klona/full/index.mjs +0 -53
  264. package/dist/node_modules/klona/package.json +0 -74
  265. package/dist/node_modules/std-env/dist/index.mjs +0 -1
  266. package/dist/node_modules/std-env/package.json +0 -46
  267. package/dist/presets/vercel/runtime/vercel.mjs +0 -17
  268. package/dist/presets.mjs +0 -2460
  269. package/dist/runtime/index.d.mts +0 -11
  270. package/dist/runtime/index.mjs +0 -17
  271. package/dist/runtime/internal/debug.d.mts +0 -2
  272. package/dist/runtime/internal/debug.mjs +0 -5
  273. package/dist/runtime/internal/empty.d.mts +0 -0
  274. package/dist/runtime/internal/index.d.mts +0 -3
  275. package/dist/runtime/internal/index.mjs +0 -3
  276. package/dist/runtime/internal/lib/http-graceful-shutdown.d.mts +0 -16
  277. package/dist/runtime/internal/lib/http-graceful-shutdown.mjs +0 -213
  278. package/dist/runtime/internal/renderer.d.mts +0 -3
  279. package/dist/runtime/internal/renderer.mjs +0 -36
  280. package/dist/runtime/internal/shutdown.d.mts +0 -9
  281. package/dist/runtime/internal/shutdown.mjs +0 -34
  282. package/dist/runtime/internal/utils.d.mts +0 -1
  283. package/dist/runtime/internal/utils.mjs +0 -15
  284. package/dist/runtime/internal/vite/dev-entry.d.mts +0 -1
  285. package/dist/runtime/internal/vite/dev-worker.d.mts +0 -1
  286. package/dist/runtime/internal/vite/prod-setup.d.mts +0 -4
  287. package/dist/runtime/internal/vite/prod-setup.mjs +0 -55
  288. package/dist/runtime/internal/vite/ssr-renderer.d.mts +0 -4
  289. package/lib/config.d.mts +0 -9
  290. package/lib/config.mjs +0 -5
  291. package/lib/meta.d.mts +0 -5
  292. package/lib/meta.mjs +0 -21
  293. package/lib/runtime-meta.mjs +0 -38
@@ -0,0 +1,21 @@
1
+ import { i as __toESM } from "../_chunks/Bqks5huO.mjs";
2
+ import { t as require_duplexer } from "./duplexer.mjs";
3
+ import fs from "node:fs";
4
+ import { promisify } from "node:util";
5
+ import zlib from "node:zlib";
6
+ import "node:stream";
7
+
8
+ //#region node_modules/.pnpm/gzip-size@7.0.0/node_modules/gzip-size/index.js
9
+ var import_duplexer = /* @__PURE__ */ __toESM(require_duplexer(), 1);
10
+ const getOptions = (options) => ({
11
+ level: 9,
12
+ ...options
13
+ });
14
+ const gzip = promisify(zlib.gzip);
15
+ async function gzipSize(input, options) {
16
+ if (!input) return 0;
17
+ return (await gzip(input, getOptions(options))).length;
18
+ }
19
+
20
+ //#endregion
21
+ export { gzipSize as t };
@@ -0,0 +1,14 @@
1
+ import { t as __commonJS } from "../_chunks/Bqks5huO.mjs";
2
+ import { t as require_function_bind } from "./function-bind.mjs";
3
+
4
+ //#region node_modules/.pnpm/hasown@2.0.2/node_modules/hasown/index.js
5
+ var require_hasown = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/hasown@2.0.2/node_modules/hasown/index.js": ((exports, module) => {
6
+ var call = Function.prototype.call;
7
+ var $hasOwn = Object.prototype.hasOwnProperty;
8
+ var bind = require_function_bind();
9
+ /** @type {import('.')} */
10
+ module.exports = bind.call(call, $hasOwn);
11
+ }) });
12
+
13
+ //#endregion
14
+ export { require_hasown as t };
@@ -0,0 +1,410 @@
1
+ import http from "node:http";
2
+ import https from "node:https";
3
+ import { EventEmitter } from "node:events";
4
+
5
+ //#region node_modules/.pnpm/httpxy@0.1.7/node_modules/httpxy/dist/index.mjs
6
+ const upgradeHeader = /(^|,)\s*upgrade\s*($|,)/i;
7
+ const isSSL = /^https|wss/;
8
+ function setupOutgoing(outgoing, options, req, forward) {
9
+ outgoing.port = options[forward || "target"].port || (isSSL.test(options[forward || "target"].protocol) ? 443 : 80);
10
+ for (const e of [
11
+ "host",
12
+ "hostname",
13
+ "socketPath",
14
+ "pfx",
15
+ "key",
16
+ "passphrase",
17
+ "cert",
18
+ "ca",
19
+ "ciphers",
20
+ "secureProtocol"
21
+ ]) outgoing[e] = options[forward || "target"][e];
22
+ outgoing.method = options.method || req.method;
23
+ outgoing.headers = { ...req.headers };
24
+ if (options.headers) outgoing.headers = {
25
+ ...outgoing.headers,
26
+ ...options.headers
27
+ };
28
+ if (options.auth) outgoing.auth = options.auth;
29
+ if (options.ca) outgoing.ca = options.ca;
30
+ if (isSSL.test(options[forward || "target"].protocol)) outgoing.rejectUnauthorized = options.secure === void 0 ? true : options.secure;
31
+ outgoing.agent = options.agent || false;
32
+ outgoing.localAddress = options.localAddress;
33
+ if (!outgoing.agent) {
34
+ outgoing.headers = outgoing.headers || {};
35
+ if (typeof outgoing.headers.connection !== "string" || !upgradeHeader.test(outgoing.headers.connection)) outgoing.headers.connection = "close";
36
+ }
37
+ const target = options[forward || "target"];
38
+ const targetPath = target && options.prependPath !== false ? target.pathname || target.path || "" : "";
39
+ const parsed = new URL(req.url, "http://localhost");
40
+ let outgoingPath = options.toProxy ? req.url : parsed.pathname + parsed.search || "";
41
+ outgoingPath = options.ignorePath ? "" : outgoingPath;
42
+ outgoing.path = joinURL(targetPath, outgoingPath);
43
+ if (options.changeOrigin) outgoing.headers.host = requiresPort(outgoing.port, options[forward || "target"].protocol) && !hasPort(outgoing.host) ? outgoing.host + ":" + outgoing.port : outgoing.host;
44
+ return outgoing;
45
+ }
46
+ function joinURL(base, path) {
47
+ if (!base || base === "/") return path || "/";
48
+ if (!path || path === "/") return base || "/";
49
+ const baseHasTrailing = base[base.length - 1] === "/";
50
+ const pathHasLeading = path[0] === "/";
51
+ if (baseHasTrailing && pathHasLeading) return base + path.slice(1);
52
+ if (!baseHasTrailing && !pathHasLeading) return base + "/" + path;
53
+ return base + path;
54
+ }
55
+ function setupSocket(socket) {
56
+ socket.setTimeout(0);
57
+ socket.setNoDelay(true);
58
+ socket.setKeepAlive(true, 0);
59
+ return socket;
60
+ }
61
+ function getPort(req) {
62
+ const res = req.headers.host ? req.headers.host.match(/:(\d+)/) : "";
63
+ if (res) return res[1];
64
+ return hasEncryptedConnection(req) ? "443" : "80";
65
+ }
66
+ function hasEncryptedConnection(req) {
67
+ return Boolean(req.connection.encrypted || req.connection.pair);
68
+ }
69
+ function rewriteCookieProperty(header, config, property) {
70
+ if (Array.isArray(header)) return header.map(function(headerElement) {
71
+ return rewriteCookieProperty(headerElement, config, property);
72
+ });
73
+ return header.replace(new RegExp(String.raw`(;\s*` + property + "=)([^;]+)", "i"), function(match, prefix, previousValue) {
74
+ let newValue;
75
+ if (previousValue in config) newValue = config[previousValue];
76
+ else if ("*" in config) newValue = config["*"];
77
+ else return match;
78
+ return newValue ? prefix + newValue : "";
79
+ });
80
+ }
81
+ function hasPort(host) {
82
+ return !!~host.indexOf(":");
83
+ }
84
+ function requiresPort(_port, _protocol) {
85
+ const protocol = _protocol.split(":")[0];
86
+ const port = +_port;
87
+ if (!port) return false;
88
+ switch (protocol) {
89
+ case "http":
90
+ case "ws": return port !== 80;
91
+ case "https":
92
+ case "wss": return port !== 443;
93
+ case "ftp": return port !== 21;
94
+ case "gopher": return port !== 70;
95
+ case "file": return false;
96
+ }
97
+ return port !== 0;
98
+ }
99
+ function defineProxyMiddleware(m) {
100
+ return m;
101
+ }
102
+ function defineProxyOutgoingMiddleware(m) {
103
+ return m;
104
+ }
105
+ const redirectRegex = /^201|30([1278])$/;
106
+ const webOutgoingMiddleware = [
107
+ defineProxyOutgoingMiddleware((req, res, proxyRes) => {
108
+ if (req.httpVersion === "1.0") delete proxyRes.headers["transfer-encoding"];
109
+ }),
110
+ defineProxyOutgoingMiddleware((req, res, proxyRes) => {
111
+ if (req.httpVersion === "1.0") proxyRes.headers.connection = req.headers.connection || "close";
112
+ else if (req.httpVersion !== "2.0" && !proxyRes.headers.connection) proxyRes.headers.connection = req.headers.connection || "keep-alive";
113
+ }),
114
+ defineProxyOutgoingMiddleware((req, res, proxyRes, options) => {
115
+ if ((options.hostRewrite || options.autoRewrite || options.protocolRewrite) && proxyRes.headers.location && redirectRegex.test(String(proxyRes.statusCode))) {
116
+ const target = new URL(options.target);
117
+ const u = new URL(proxyRes.headers.location);
118
+ if (target.host !== u.host) return;
119
+ if (options.hostRewrite) u.host = options.hostRewrite;
120
+ else if (options.autoRewrite) u.host = req.headers.host;
121
+ if (options.protocolRewrite) u.protocol = options.protocolRewrite;
122
+ proxyRes.headers.location = u.toString();
123
+ }
124
+ }),
125
+ defineProxyOutgoingMiddleware((req, res, proxyRes, options) => {
126
+ let rewriteCookieDomainConfig = options.cookieDomainRewrite;
127
+ let rewriteCookiePathConfig = options.cookiePathRewrite;
128
+ const preserveHeaderKeyCase = options.preserveHeaderKeyCase;
129
+ let rawHeaderKeyMap;
130
+ const setHeader = function(key, header) {
131
+ if (header === void 0) return;
132
+ if (rewriteCookieDomainConfig && key.toLowerCase() === "set-cookie") header = rewriteCookieProperty(header, rewriteCookieDomainConfig, "domain");
133
+ if (rewriteCookiePathConfig && key.toLowerCase() === "set-cookie") header = rewriteCookieProperty(header, rewriteCookiePathConfig, "path");
134
+ res.setHeader(String(key).trim(), header);
135
+ };
136
+ if (typeof rewriteCookieDomainConfig === "string") rewriteCookieDomainConfig = { "*": rewriteCookieDomainConfig };
137
+ if (typeof rewriteCookiePathConfig === "string") rewriteCookiePathConfig = { "*": rewriteCookiePathConfig };
138
+ if (preserveHeaderKeyCase && proxyRes.rawHeaders !== void 0) {
139
+ rawHeaderKeyMap = {};
140
+ for (let i = 0; i < proxyRes.rawHeaders.length; i += 2) {
141
+ const key = proxyRes.rawHeaders[i];
142
+ rawHeaderKeyMap[key.toLowerCase()] = key;
143
+ }
144
+ }
145
+ for (let key of Object.keys(proxyRes.headers)) {
146
+ const header = proxyRes.headers[key];
147
+ if (preserveHeaderKeyCase && rawHeaderKeyMap) key = rawHeaderKeyMap[key] || key;
148
+ setHeader(key, header);
149
+ }
150
+ }),
151
+ defineProxyOutgoingMiddleware((req, res, proxyRes) => {
152
+ if (proxyRes.statusMessage) {
153
+ res.statusCode = proxyRes.statusCode;
154
+ res.statusMessage = proxyRes.statusMessage;
155
+ } else res.statusCode = proxyRes.statusCode;
156
+ })
157
+ ];
158
+ const nativeAgents = {
159
+ http,
160
+ https
161
+ };
162
+ const webIncomingMiddleware = [
163
+ defineProxyMiddleware((req) => {
164
+ if ((req.method === "DELETE" || req.method === "OPTIONS") && !req.headers["content-length"]) {
165
+ req.headers["content-length"] = "0";
166
+ delete req.headers["transfer-encoding"];
167
+ }
168
+ }),
169
+ defineProxyMiddleware((req, res, options) => {
170
+ if (options.timeout) req.socket.setTimeout(options.timeout);
171
+ }),
172
+ defineProxyMiddleware((req, res, options) => {
173
+ if (!options.xfwd) return;
174
+ const encrypted = req.isSpdy || hasEncryptedConnection(req);
175
+ const values = {
176
+ for: req.connection.remoteAddress || req.socket.remoteAddress,
177
+ port: getPort(req),
178
+ proto: encrypted ? "https" : "http"
179
+ };
180
+ for (const header of [
181
+ "for",
182
+ "port",
183
+ "proto"
184
+ ]) req.headers["x-forwarded-" + header] = (req.headers["x-forwarded-" + header] || "") + (req.headers["x-forwarded-" + header] ? "," : "") + values[header];
185
+ req.headers["x-forwarded-host"] = req.headers["x-forwarded-host"] || req.headers.host || "";
186
+ }),
187
+ defineProxyMiddleware((req, res, options, server, head, callback) => {
188
+ server.emit("start", req, res, options.target || options.forward);
189
+ const agents = nativeAgents;
190
+ const http$1 = agents.http;
191
+ const https$1 = agents.https;
192
+ if (options.forward) {
193
+ const forwardReq = (options.forward.protocol === "https:" ? https$1 : http$1).request(setupOutgoing(options.ssl || {}, options, req, "forward"));
194
+ const forwardError = createErrorHandler(forwardReq, options.forward);
195
+ req.on("error", forwardError);
196
+ forwardReq.on("error", forwardError);
197
+ (options.buffer || req).pipe(forwardReq);
198
+ if (!options.target) {
199
+ res.end();
200
+ return;
201
+ }
202
+ }
203
+ const proxyReq = (options.target.protocol === "https:" ? https$1 : http$1).request(setupOutgoing(options.ssl || {}, options, req));
204
+ proxyReq.on("socket", (socket) => {
205
+ if (server && !proxyReq.getHeader("expect")) server.emit("proxyReq", proxyReq, req, res, options);
206
+ });
207
+ if (options.proxyTimeout) proxyReq.setTimeout(options.proxyTimeout, function() {
208
+ proxyReq.abort();
209
+ });
210
+ req.on("aborted", function() {
211
+ proxyReq.abort();
212
+ });
213
+ const proxyError = createErrorHandler(proxyReq, options.target);
214
+ req.on("error", proxyError);
215
+ proxyReq.on("error", proxyError);
216
+ function createErrorHandler(proxyReq2, url) {
217
+ return function proxyError2(err) {
218
+ if (req.socket.destroyed && err.code === "ECONNRESET") {
219
+ server.emit("econnreset", err, req, res, url);
220
+ return proxyReq2.abort();
221
+ }
222
+ if (callback) callback(err, req, res, url);
223
+ else server.emit("error", err, req, res, url);
224
+ };
225
+ }
226
+ (options.buffer || req).pipe(proxyReq);
227
+ proxyReq.on("response", function(proxyRes) {
228
+ if (server) server.emit("proxyRes", proxyRes, req, res);
229
+ if (!res.headersSent && !options.selfHandleResponse) {
230
+ for (const pass of webOutgoingMiddleware) if (pass(req, res, proxyRes, options)) break;
231
+ }
232
+ if (res.finished) {
233
+ if (server) server.emit("end", req, res, proxyRes);
234
+ } else {
235
+ res.on("close", function() {
236
+ proxyRes.destroy();
237
+ });
238
+ proxyRes.on("end", function() {
239
+ if (server) server.emit("end", req, res, proxyRes);
240
+ });
241
+ if (!options.selfHandleResponse) proxyRes.pipe(res);
242
+ }
243
+ });
244
+ })
245
+ ];
246
+ const websocketIncomingMiddleware = [
247
+ defineProxyMiddleware((req, socket) => {
248
+ if (req.method !== "GET" || !req.headers.upgrade) {
249
+ socket.destroy();
250
+ return true;
251
+ }
252
+ if (req.headers.upgrade.toLowerCase() !== "websocket") {
253
+ socket.destroy();
254
+ return true;
255
+ }
256
+ }),
257
+ defineProxyMiddleware((req, socket, options) => {
258
+ if (!options.xfwd) return;
259
+ const values = {
260
+ for: req.connection.remoteAddress || req.socket.remoteAddress,
261
+ port: getPort(req),
262
+ proto: hasEncryptedConnection(req) ? "wss" : "ws"
263
+ };
264
+ for (const header of [
265
+ "for",
266
+ "port",
267
+ "proto"
268
+ ]) req.headers["x-forwarded-" + header] = (req.headers["x-forwarded-" + header] || "") + (req.headers["x-forwarded-" + header] ? "," : "") + values[header];
269
+ }),
270
+ defineProxyMiddleware((req, socket, options, server, head, callback) => {
271
+ const createHttpHeader = function(line, headers) {
272
+ return Object.keys(headers).reduce(function(head2, key) {
273
+ const value = headers[key];
274
+ if (!Array.isArray(value)) {
275
+ head2.push(key + ": " + value);
276
+ return head2;
277
+ }
278
+ for (const element of value) head2.push(key + ": " + element);
279
+ return head2;
280
+ }, [line]).join("\r\n") + "\r\n\r\n";
281
+ };
282
+ setupSocket(socket);
283
+ if (head && head.length > 0) socket.unshift(head);
284
+ const proxyReq = (isSSL.test(options.target.protocol) ? https : http).request(setupOutgoing(options.ssl || {}, options, req));
285
+ if (server) server.emit("proxyReqWs", proxyReq, req, socket, options, head);
286
+ proxyReq.on("error", onOutgoingError);
287
+ proxyReq.on("response", function(res) {
288
+ if (!res.upgrade) {
289
+ socket.write(createHttpHeader("HTTP/" + res.httpVersion + " " + res.statusCode + " " + res.statusMessage, res.headers));
290
+ res.pipe(socket);
291
+ }
292
+ });
293
+ proxyReq.on("upgrade", function(proxyRes, proxySocket, proxyHead) {
294
+ proxySocket.on("error", onOutgoingError);
295
+ proxySocket.on("end", function() {
296
+ server.emit("close", proxyRes, proxySocket, proxyHead);
297
+ });
298
+ socket.on("error", function() {
299
+ proxySocket.end();
300
+ });
301
+ setupSocket(proxySocket);
302
+ if (proxyHead && proxyHead.length > 0) proxySocket.unshift(proxyHead);
303
+ socket.write(createHttpHeader("HTTP/1.1 101 Switching Protocols", proxyRes.headers));
304
+ proxySocket.pipe(socket).pipe(proxySocket);
305
+ server.emit("open", proxySocket);
306
+ server.emit("proxySocket", proxySocket);
307
+ });
308
+ proxyReq.end();
309
+ function onOutgoingError(err) {
310
+ if (callback) callback(err, req, socket);
311
+ else server.emit("error", err, req, socket);
312
+ socket.end();
313
+ }
314
+ })
315
+ ];
316
+ var ProxyServer = class extends EventEmitter {
317
+ _server;
318
+ _webPasses = [...webIncomingMiddleware];
319
+ _wsPasses = [...websocketIncomingMiddleware];
320
+ options;
321
+ web;
322
+ ws;
323
+ /**
324
+ * Creates the proxy server with specified options.
325
+ * @param options - Config object passed to the proxy
326
+ */
327
+ constructor(options = {}) {
328
+ super();
329
+ this.options = options || {};
330
+ this.options.prependPath = options.prependPath !== false;
331
+ this.web = _createProxyFn("web", this);
332
+ this.ws = _createProxyFn("ws", this);
333
+ }
334
+ /**
335
+ * A function that wraps the object in a webserver, for your convenience
336
+ * @param port - Port to listen on
337
+ * @param hostname - The hostname to listen on
338
+ */
339
+ listen(port, hostname) {
340
+ const closure = (req, res) => {
341
+ this.web(req, res);
342
+ };
343
+ this._server = this.options.ssl ? https.createServer(this.options.ssl, closure) : http.createServer(closure);
344
+ if (this.options.ws) this._server.on("upgrade", (req, socket, head) => {
345
+ this._ws(req, socket, head);
346
+ });
347
+ this._server.listen(port, hostname);
348
+ return this;
349
+ }
350
+ /**
351
+ * A function that closes the inner webserver and stops listening on given port
352
+ */
353
+ close(callback) {
354
+ if (this._server) this._server.close((...args) => {
355
+ this._server = void 0;
356
+ if (callback) Reflect.apply(callback, void 0, args);
357
+ });
358
+ }
359
+ before(type, passName, pass) {
360
+ if (type !== "ws" && type !== "web") throw new Error("type must be `web` or `ws`");
361
+ const passes = type === "ws" ? this._wsPasses : this._webPasses;
362
+ let i = false;
363
+ for (const [idx, v] of passes.entries()) if (v.name === passName) i = idx;
364
+ if (i === false) throw new Error("No such pass");
365
+ passes.splice(i, 0, pass);
366
+ }
367
+ after(type, passName, pass) {
368
+ if (type !== "ws" && type !== "web") throw new Error("type must be `web` or `ws`");
369
+ const passes = type === "ws" ? this._wsPasses : this._webPasses;
370
+ let i = false;
371
+ for (const [idx, v] of passes.entries()) if (v.name === passName) i = idx;
372
+ if (i === false) throw new Error("No such pass");
373
+ passes.splice(i++, 0, pass);
374
+ }
375
+ };
376
+ function createProxyServer(options = {}) {
377
+ return new ProxyServer(options);
378
+ }
379
+ function _createProxyFn(type, server) {
380
+ return function(req, res, opts, head) {
381
+ const requestOptions = {
382
+ ...opts,
383
+ ...server.options
384
+ };
385
+ for (const key of ["target", "forward"]) if (typeof requestOptions[key] === "string") requestOptions[key] = new URL(requestOptions[key]);
386
+ if (!requestOptions.target && !requestOptions.forward) return this.emit("error", /* @__PURE__ */ new Error("Must provide a proper URL as target"));
387
+ let _resolve;
388
+ let _reject;
389
+ const callbackPromise = new Promise((resolve, reject) => {
390
+ _resolve = resolve;
391
+ _reject = reject;
392
+ });
393
+ res.on("close", () => {
394
+ _resolve();
395
+ });
396
+ res.on("error", (error) => {
397
+ _reject(error);
398
+ });
399
+ for (const pass of type === "ws" ? server._wsPasses : server._webPasses) if (pass(req, res, requestOptions, server, head, (error) => {
400
+ _reject(error);
401
+ })) {
402
+ _resolve();
403
+ break;
404
+ }
405
+ return callbackPromise;
406
+ };
407
+ }
408
+
409
+ //#endregion
410
+ export { createProxyServer as n, ProxyServer as t };
@@ -0,0 +1,220 @@
1
+ import { t as __commonJS } from "../_chunks/Bqks5huO.mjs";
2
+ import { t as require_hasown } from "./hasown.mjs";
3
+
4
+ //#region node_modules/.pnpm/is-core-module@2.16.1/node_modules/is-core-module/core.json
5
+ var require_core = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/is-core-module@2.16.1/node_modules/is-core-module/core.json": ((exports, module) => {
6
+ module.exports = {
7
+ "assert": true,
8
+ "node:assert": [">= 14.18 && < 15", ">= 16"],
9
+ "assert/strict": ">= 15",
10
+ "node:assert/strict": ">= 16",
11
+ "async_hooks": ">= 8",
12
+ "node:async_hooks": [">= 14.18 && < 15", ">= 16"],
13
+ "buffer_ieee754": ">= 0.5 && < 0.9.7",
14
+ "buffer": true,
15
+ "node:buffer": [">= 14.18 && < 15", ">= 16"],
16
+ "child_process": true,
17
+ "node:child_process": [">= 14.18 && < 15", ">= 16"],
18
+ "cluster": ">= 0.5",
19
+ "node:cluster": [">= 14.18 && < 15", ">= 16"],
20
+ "console": true,
21
+ "node:console": [">= 14.18 && < 15", ">= 16"],
22
+ "constants": true,
23
+ "node:constants": [">= 14.18 && < 15", ">= 16"],
24
+ "crypto": true,
25
+ "node:crypto": [">= 14.18 && < 15", ">= 16"],
26
+ "_debug_agent": ">= 1 && < 8",
27
+ "_debugger": "< 8",
28
+ "dgram": true,
29
+ "node:dgram": [">= 14.18 && < 15", ">= 16"],
30
+ "diagnostics_channel": [">= 14.17 && < 15", ">= 15.1"],
31
+ "node:diagnostics_channel": [">= 14.18 && < 15", ">= 16"],
32
+ "dns": true,
33
+ "node:dns": [">= 14.18 && < 15", ">= 16"],
34
+ "dns/promises": ">= 15",
35
+ "node:dns/promises": ">= 16",
36
+ "domain": ">= 0.7.12",
37
+ "node:domain": [">= 14.18 && < 15", ">= 16"],
38
+ "events": true,
39
+ "node:events": [">= 14.18 && < 15", ">= 16"],
40
+ "freelist": "< 6",
41
+ "fs": true,
42
+ "node:fs": [">= 14.18 && < 15", ">= 16"],
43
+ "fs/promises": [">= 10 && < 10.1", ">= 14"],
44
+ "node:fs/promises": [">= 14.18 && < 15", ">= 16"],
45
+ "_http_agent": ">= 0.11.1",
46
+ "node:_http_agent": [">= 14.18 && < 15", ">= 16"],
47
+ "_http_client": ">= 0.11.1",
48
+ "node:_http_client": [">= 14.18 && < 15", ">= 16"],
49
+ "_http_common": ">= 0.11.1",
50
+ "node:_http_common": [">= 14.18 && < 15", ">= 16"],
51
+ "_http_incoming": ">= 0.11.1",
52
+ "node:_http_incoming": [">= 14.18 && < 15", ">= 16"],
53
+ "_http_outgoing": ">= 0.11.1",
54
+ "node:_http_outgoing": [">= 14.18 && < 15", ">= 16"],
55
+ "_http_server": ">= 0.11.1",
56
+ "node:_http_server": [">= 14.18 && < 15", ">= 16"],
57
+ "http": true,
58
+ "node:http": [">= 14.18 && < 15", ">= 16"],
59
+ "http2": ">= 8.8",
60
+ "node:http2": [">= 14.18 && < 15", ">= 16"],
61
+ "https": true,
62
+ "node:https": [">= 14.18 && < 15", ">= 16"],
63
+ "inspector": ">= 8",
64
+ "node:inspector": [">= 14.18 && < 15", ">= 16"],
65
+ "inspector/promises": [">= 19"],
66
+ "node:inspector/promises": [">= 19"],
67
+ "_linklist": "< 8",
68
+ "module": true,
69
+ "node:module": [">= 14.18 && < 15", ">= 16"],
70
+ "net": true,
71
+ "node:net": [">= 14.18 && < 15", ">= 16"],
72
+ "node-inspect/lib/_inspect": ">= 7.6 && < 12",
73
+ "node-inspect/lib/internal/inspect_client": ">= 7.6 && < 12",
74
+ "node-inspect/lib/internal/inspect_repl": ">= 7.6 && < 12",
75
+ "os": true,
76
+ "node:os": [">= 14.18 && < 15", ">= 16"],
77
+ "path": true,
78
+ "node:path": [">= 14.18 && < 15", ">= 16"],
79
+ "path/posix": ">= 15.3",
80
+ "node:path/posix": ">= 16",
81
+ "path/win32": ">= 15.3",
82
+ "node:path/win32": ">= 16",
83
+ "perf_hooks": ">= 8.5",
84
+ "node:perf_hooks": [">= 14.18 && < 15", ">= 16"],
85
+ "process": ">= 1",
86
+ "node:process": [">= 14.18 && < 15", ">= 16"],
87
+ "punycode": ">= 0.5",
88
+ "node:punycode": [">= 14.18 && < 15", ">= 16"],
89
+ "querystring": true,
90
+ "node:querystring": [">= 14.18 && < 15", ">= 16"],
91
+ "readline": true,
92
+ "node:readline": [">= 14.18 && < 15", ">= 16"],
93
+ "readline/promises": ">= 17",
94
+ "node:readline/promises": ">= 17",
95
+ "repl": true,
96
+ "node:repl": [">= 14.18 && < 15", ">= 16"],
97
+ "node:sea": [">= 20.12 && < 21", ">= 21.7"],
98
+ "smalloc": ">= 0.11.5 && < 3",
99
+ "node:sqlite": [">= 22.13 && < 23", ">= 23.4"],
100
+ "_stream_duplex": ">= 0.9.4",
101
+ "node:_stream_duplex": [">= 14.18 && < 15", ">= 16"],
102
+ "_stream_transform": ">= 0.9.4",
103
+ "node:_stream_transform": [">= 14.18 && < 15", ">= 16"],
104
+ "_stream_wrap": ">= 1.4.1",
105
+ "node:_stream_wrap": [">= 14.18 && < 15", ">= 16"],
106
+ "_stream_passthrough": ">= 0.9.4",
107
+ "node:_stream_passthrough": [">= 14.18 && < 15", ">= 16"],
108
+ "_stream_readable": ">= 0.9.4",
109
+ "node:_stream_readable": [">= 14.18 && < 15", ">= 16"],
110
+ "_stream_writable": ">= 0.9.4",
111
+ "node:_stream_writable": [">= 14.18 && < 15", ">= 16"],
112
+ "stream": true,
113
+ "node:stream": [">= 14.18 && < 15", ">= 16"],
114
+ "stream/consumers": ">= 16.7",
115
+ "node:stream/consumers": ">= 16.7",
116
+ "stream/promises": ">= 15",
117
+ "node:stream/promises": ">= 16",
118
+ "stream/web": ">= 16.5",
119
+ "node:stream/web": ">= 16.5",
120
+ "string_decoder": true,
121
+ "node:string_decoder": [">= 14.18 && < 15", ">= 16"],
122
+ "sys": [">= 0.4 && < 0.7", ">= 0.8"],
123
+ "node:sys": [">= 14.18 && < 15", ">= 16"],
124
+ "test/reporters": ">= 19.9 && < 20.2",
125
+ "node:test/reporters": [
126
+ ">= 18.17 && < 19",
127
+ ">= 19.9",
128
+ ">= 20"
129
+ ],
130
+ "test/mock_loader": ">= 22.3 && < 22.7",
131
+ "node:test/mock_loader": ">= 22.3 && < 22.7",
132
+ "node:test": [">= 16.17 && < 17", ">= 18"],
133
+ "timers": true,
134
+ "node:timers": [">= 14.18 && < 15", ">= 16"],
135
+ "timers/promises": ">= 15",
136
+ "node:timers/promises": ">= 16",
137
+ "_tls_common": ">= 0.11.13",
138
+ "node:_tls_common": [">= 14.18 && < 15", ">= 16"],
139
+ "_tls_legacy": ">= 0.11.3 && < 10",
140
+ "_tls_wrap": ">= 0.11.3",
141
+ "node:_tls_wrap": [">= 14.18 && < 15", ">= 16"],
142
+ "tls": true,
143
+ "node:tls": [">= 14.18 && < 15", ">= 16"],
144
+ "trace_events": ">= 10",
145
+ "node:trace_events": [">= 14.18 && < 15", ">= 16"],
146
+ "tty": true,
147
+ "node:tty": [">= 14.18 && < 15", ">= 16"],
148
+ "url": true,
149
+ "node:url": [">= 14.18 && < 15", ">= 16"],
150
+ "util": true,
151
+ "node:util": [">= 14.18 && < 15", ">= 16"],
152
+ "util/types": ">= 15.3",
153
+ "node:util/types": ">= 16",
154
+ "v8/tools/arguments": ">= 10 && < 12",
155
+ "v8/tools/codemap": [">= 4.4 && < 5", ">= 5.2 && < 12"],
156
+ "v8/tools/consarray": [">= 4.4 && < 5", ">= 5.2 && < 12"],
157
+ "v8/tools/csvparser": [">= 4.4 && < 5", ">= 5.2 && < 12"],
158
+ "v8/tools/logreader": [">= 4.4 && < 5", ">= 5.2 && < 12"],
159
+ "v8/tools/profile_view": [">= 4.4 && < 5", ">= 5.2 && < 12"],
160
+ "v8/tools/splaytree": [">= 4.4 && < 5", ">= 5.2 && < 12"],
161
+ "v8": ">= 1",
162
+ "node:v8": [">= 14.18 && < 15", ">= 16"],
163
+ "vm": true,
164
+ "node:vm": [">= 14.18 && < 15", ">= 16"],
165
+ "wasi": [
166
+ ">= 13.4 && < 13.5",
167
+ ">= 18.17 && < 19",
168
+ ">= 20"
169
+ ],
170
+ "node:wasi": [">= 18.17 && < 19", ">= 20"],
171
+ "worker_threads": ">= 11.7",
172
+ "node:worker_threads": [">= 14.18 && < 15", ">= 16"],
173
+ "zlib": ">= 0.5",
174
+ "node:zlib": [">= 14.18 && < 15", ">= 16"]
175
+ };
176
+ }) });
177
+
178
+ //#endregion
179
+ //#region node_modules/.pnpm/is-core-module@2.16.1/node_modules/is-core-module/index.js
180
+ var require_is_core_module = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/is-core-module@2.16.1/node_modules/is-core-module/index.js": ((exports, module) => {
181
+ var hasOwn = require_hasown();
182
+ function specifierIncluded(current, specifier) {
183
+ var nodeParts = current.split(".");
184
+ var parts = specifier.split(" ");
185
+ var op = parts.length > 1 ? parts[0] : "=";
186
+ var versionParts = (parts.length > 1 ? parts[1] : parts[0]).split(".");
187
+ for (var i = 0; i < 3; ++i) {
188
+ var cur = parseInt(nodeParts[i] || 0, 10);
189
+ var ver = parseInt(versionParts[i] || 0, 10);
190
+ if (cur === ver) continue;
191
+ if (op === "<") return cur < ver;
192
+ if (op === ">=") return cur >= ver;
193
+ return false;
194
+ }
195
+ return op === ">=";
196
+ }
197
+ function matchesRange(current, range) {
198
+ var specifiers = range.split(/ ?&& ?/);
199
+ if (specifiers.length === 0) return false;
200
+ for (var i = 0; i < specifiers.length; ++i) if (!specifierIncluded(current, specifiers[i])) return false;
201
+ return true;
202
+ }
203
+ function versionIncluded(nodeVersion, specifierValue) {
204
+ if (typeof specifierValue === "boolean") return specifierValue;
205
+ var current = typeof nodeVersion === "undefined" ? process.versions && process.versions.node : nodeVersion;
206
+ if (typeof current !== "string") throw new TypeError(typeof nodeVersion === "undefined" ? "Unable to determine current node version" : "If provided, a valid node version is required");
207
+ if (specifierValue && typeof specifierValue === "object") {
208
+ for (var i = 0; i < specifierValue.length; ++i) if (matchesRange(current, specifierValue[i])) return true;
209
+ return false;
210
+ }
211
+ return matchesRange(current, specifierValue);
212
+ }
213
+ var data = require_core();
214
+ module.exports = function isCore(x, nodeVersion) {
215
+ return hasOwn(data, x) && versionIncluded(nodeVersion, data[x]);
216
+ };
217
+ }) });
218
+
219
+ //#endregion
220
+ export { require_is_core_module as t };
@@ -0,0 +1,13 @@
1
+ import { t as __commonJS } from "../_chunks/Bqks5huO.mjs";
2
+
3
+ //#region node_modules/.pnpm/is-module@1.0.0/node_modules/is-module/index.js
4
+ var require_is_module = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/is-module@1.0.0/node_modules/is-module/index.js": ((exports, module) => {
5
+ var ES6ImportExportRegExp = /(?:^\s*|[}{\(\);,\n]\s*)(import\s+['"]|(import|module)\s+[^"'\(\)\n;]+\s+from\s+['"]|export\s+(\*|\{|default|function|var|const|let|[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*))/;
6
+ var ES6AliasRegExp = /(?:^\s*|[}{\(\);,\n]\s*)(export\s*\*\s*from\s*(?:'([^']+)'|"([^"]+)"))/;
7
+ module.exports = function(sauce) {
8
+ return ES6ImportExportRegExp.test(sauce) || ES6AliasRegExp.test(sauce);
9
+ };
10
+ }) });
11
+
12
+ //#endregion
13
+ export { require_is_module as t };