nitro-nightly 3.0.1-20260120-020848-6786d069 → 3.0.1-20260120-133849-ca1a9dee

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 (93) hide show
  1. package/dist/_build/common.mjs +24931 -0
  2. package/dist/_build/rolldown.mjs +6 -11
  3. package/dist/_build/rollup.mjs +201 -0
  4. package/dist/_build/vite.build.mjs +1 -1
  5. package/dist/_chunks/dev.mjs +4 -6
  6. package/dist/_chunks/nitro.mjs +1183 -24
  7. package/dist/_chunks/nitro2.mjs +91 -248
  8. package/dist/_chunks/utils.mjs +254 -0
  9. package/dist/_common.mjs +45 -0
  10. package/dist/_libs/c12+giget+readdirp+chokidar.d.mts +214 -0
  11. package/dist/_libs/citty.mjs +140 -110
  12. package/dist/_libs/commondir+is-reference.mjs +1300 -0
  13. package/dist/_libs/compatx.d.mts +47 -0
  14. package/dist/_libs/confbox.mjs +2488 -70
  15. package/dist/_libs/esbuild.d.mts +20 -0
  16. package/dist/_libs/escape-string-regexp.mjs +8 -0
  17. package/dist/_libs/estree-walker.mjs +187 -0
  18. package/dist/_libs/hasown+resolve+deepmerge.mjs +1972 -0
  19. package/dist/_libs/httpxy.d.mts +79 -0
  20. package/dist/_libs/httpxy.mjs +6 -1
  21. package/dist/_libs/klona.mjs +38 -0
  22. package/dist/_libs/magic-string.d.mts +220 -0
  23. package/dist/_libs/mlly.d.mts +57 -0
  24. package/dist/_libs/nypm+giget+tinyexec.mjs +3603 -0
  25. package/dist/_libs/pkg-types.d.mts +23 -0
  26. package/dist/_libs/plugin-alias.mjs +64 -0
  27. package/dist/_libs/{plugin-alias+plugin-inject.mjs → plugin-inject.mjs} +2 -65
  28. package/dist/_libs/plugin-json.mjs +36 -0
  29. package/dist/_libs/pluginutils+plugin-commonjs.d.mts +241 -0
  30. package/dist/_libs/pluginutils.mjs +652 -0
  31. package/dist/_libs/{c12+dotenv+rc9.mjs → rc9+c12+dotenv.mjs} +105 -12
  32. package/dist/_libs/{chokidar+readdirp.mjs → readdirp+chokidar.mjs} +8 -1
  33. package/dist/_libs/remapping.mjs +117 -0
  34. package/dist/_libs/resolve-uri+gen-mapping.mjs +448 -0
  35. package/dist/_libs/rou3.d.mts +43 -0
  36. package/dist/_libs/rou3.mjs +322 -0
  37. package/dist/_libs/std-env.d.mts +4 -0
  38. package/dist/_libs/tsconfck.mjs +832 -0
  39. package/dist/_libs/ultrahtml.mjs +138 -0
  40. package/dist/_libs/{gen-mapping+remapping+resolve-uri+trace-mapping+unimport+unplugin+unplugin-utils+webpack-virtual-modules.mjs → unimport+unplugin.mjs} +228 -593
  41. package/dist/_libs/unplugin+unimport.d.mts +426 -0
  42. package/dist/_libs/unwasm.d.mts +29 -0
  43. package/dist/_presets.mjs +3 -8
  44. package/dist/builder.mjs +6 -8
  45. package/dist/cli/_chunks/build.mjs +1 -1
  46. package/dist/cli/_chunks/dev.mjs +2 -3
  47. package/dist/cli/_chunks/list.mjs +1 -1
  48. package/dist/cli/_chunks/prepare.mjs +1 -1
  49. package/dist/cli/_chunks/run.mjs +1 -1
  50. package/dist/cli/_chunks/task.mjs +16 -0
  51. package/dist/cli/index.mjs +1 -1
  52. package/dist/presets/aws-lambda/runtime/_utils.d.mts +0 -5
  53. package/dist/presets/netlify/runtime/netlify-edge.d.mts +0 -1
  54. package/dist/presets/winterjs/runtime/winterjs.d.mts +0 -1
  55. package/dist/runtime/internal/error/dev.d.mts +0 -1
  56. package/dist/runtime/internal/route-rules.d.mts +0 -4
  57. package/dist/runtime/internal/routes/openapi.d.mts +0 -1
  58. package/dist/runtime/internal/routes/scalar.d.mts +0 -1
  59. package/dist/runtime/internal/routes/swagger.d.mts +0 -1
  60. package/dist/runtime/internal/runtime-config.d.mts +0 -1
  61. package/dist/runtime/nitro.d.mts +0 -3
  62. package/dist/runtime/virtual/renderer-template.d.mts +0 -1
  63. package/dist/types/index.d.mts +25 -1394
  64. package/dist/vite.mjs +18 -641
  65. package/package.json +5 -5
  66. package/dist/_chunks/nitro3.mjs +0 -2696
  67. package/dist/_chunks/nitro4.mjs +0 -176
  68. package/dist/_chunks/nitro5.mjs +0 -733
  69. package/dist/_chunks/nitro6.mjs +0 -1458
  70. package/dist/_chunks/nitro7.mjs +0 -7561
  71. package/dist/_chunks/nitro8.mjs +0 -3524
  72. package/dist/_chunks/nitro9.mjs +0 -1729
  73. package/dist/_libs/_.mjs +0 -3
  74. package/dist/_libs/_2.mjs +0 -3
  75. package/dist/_libs/_3.mjs +0 -4
  76. package/dist/_libs/_4.mjs +0 -6
  77. package/dist/_libs/_5.mjs +0 -3
  78. package/dist/_libs/_6.mjs +0 -3
  79. package/dist/_libs/acorn+confbox+js-tokens+magic-string+mlly+pkg-types+sourcemap-codec+strip-literal+unimport.mjs +0 -8900
  80. package/dist/_libs/confbox+exsolve+pkg-types.mjs +0 -1249
  81. package/dist/_libs/confbox2.mjs +0 -786
  82. package/dist/_libs/confbox3.mjs +0 -404
  83. package/dist/_libs/confbox4.mjs +0 -3
  84. package/dist/_libs/estree-walker+unimport.mjs +0 -378
  85. package/dist/_libs/fdir+picomatch+tinyglobby.mjs +0 -2471
  86. package/dist/_libs/giget+node-fetch-native.mjs +0 -2692
  87. package/dist/_libs/local-pkg+quansync+unimport.mjs +0 -1526
  88. package/dist/_libs/nypm+tinyexec.mjs +0 -858
  89. package/dist/_libs/pathe.mjs +0 -164
  90. package/dist/_libs/perfect-debounce.mjs +0 -89
  91. package/dist/_libs/std-env.mjs +0 -158
  92. package/dist/_libs/unimport.mjs +0 -9
  93. package/dist/_libs/vite-plugin-fullstack.mjs +0 -26
@@ -0,0 +1,1972 @@
1
+ import { i as __toESM, r as __require, t as __commonJSMin } from "../_common.mjs";
2
+ import { c as createFilter } from "../_build/common.mjs";
3
+ import nativeFs, { realpathSync } from "fs";
4
+ import path, { dirname, extname, normalize, resolve, sep } from "path";
5
+ import { builtinModules } from "module";
6
+ import { fileURLToPath, pathToFileURL } from "url";
7
+ import { promisify } from "util";
8
+
9
+ //#region node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js
10
+ var require_cjs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
11
+ var isMergeableObject = function isMergeableObject(value) {
12
+ return isNonNullObject(value) && !isSpecial(value);
13
+ };
14
+ function isNonNullObject(value) {
15
+ return !!value && typeof value === "object";
16
+ }
17
+ function isSpecial(value) {
18
+ var stringValue = Object.prototype.toString.call(value);
19
+ return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value);
20
+ }
21
+ var REACT_ELEMENT_TYPE = typeof Symbol === "function" && Symbol.for ? Symbol.for("react.element") : 60103;
22
+ function isReactElement(value) {
23
+ return value.$$typeof === REACT_ELEMENT_TYPE;
24
+ }
25
+ function emptyTarget(val) {
26
+ return Array.isArray(val) ? [] : {};
27
+ }
28
+ function cloneUnlessOtherwiseSpecified(value, options) {
29
+ return options.clone !== false && options.isMergeableObject(value) ? deepmerge(emptyTarget(value), value, options) : value;
30
+ }
31
+ function defaultArrayMerge(target, source, options) {
32
+ return target.concat(source).map(function(element) {
33
+ return cloneUnlessOtherwiseSpecified(element, options);
34
+ });
35
+ }
36
+ function getMergeFunction(key, options) {
37
+ if (!options.customMerge) return deepmerge;
38
+ var customMerge = options.customMerge(key);
39
+ return typeof customMerge === "function" ? customMerge : deepmerge;
40
+ }
41
+ function getEnumerableOwnPropertySymbols(target) {
42
+ return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
43
+ return Object.propertyIsEnumerable.call(target, symbol);
44
+ }) : [];
45
+ }
46
+ function getKeys(target) {
47
+ return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target));
48
+ }
49
+ function propertyIsOnObject(object, property) {
50
+ try {
51
+ return property in object;
52
+ } catch (_) {
53
+ return false;
54
+ }
55
+ }
56
+ function propertyIsUnsafe(target, key) {
57
+ return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key));
58
+ }
59
+ function mergeObject(target, source, options) {
60
+ var destination = {};
61
+ if (options.isMergeableObject(target)) getKeys(target).forEach(function(key) {
62
+ destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
63
+ });
64
+ getKeys(source).forEach(function(key) {
65
+ if (propertyIsUnsafe(target, key)) return;
66
+ if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
67
+ else destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
68
+ });
69
+ return destination;
70
+ }
71
+ function deepmerge(target, source, options) {
72
+ options = options || {};
73
+ options.arrayMerge = options.arrayMerge || defaultArrayMerge;
74
+ options.isMergeableObject = options.isMergeableObject || isMergeableObject;
75
+ options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
76
+ var sourceIsArray = Array.isArray(source);
77
+ if (!(sourceIsArray === Array.isArray(target))) return cloneUnlessOtherwiseSpecified(source, options);
78
+ else if (sourceIsArray) return options.arrayMerge(target, source, options);
79
+ else return mergeObject(target, source, options);
80
+ }
81
+ deepmerge.all = function deepmergeAll(array, options) {
82
+ if (!Array.isArray(array)) throw new Error("first argument should be an array");
83
+ return array.reduce(function(prev, next) {
84
+ return deepmerge(prev, next, options);
85
+ }, {});
86
+ };
87
+ var deepmerge_1 = deepmerge;
88
+ module.exports = deepmerge_1;
89
+ }));
90
+
91
+ //#endregion
92
+ //#region node_modules/.pnpm/is-module@1.0.0/node_modules/is-module/index.js
93
+ var require_is_module = /* @__PURE__ */ __commonJSMin(((exports, module) => {
94
+ 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]*))/;
95
+ var ES6AliasRegExp = /(?:^\s*|[}{\(\);,\n]\s*)(export\s*\*\s*from\s*(?:'([^']+)'|"([^"]+)"))/;
96
+ module.exports = function(sauce) {
97
+ return ES6ImportExportRegExp.test(sauce) || ES6AliasRegExp.test(sauce);
98
+ };
99
+ }));
100
+
101
+ //#endregion
102
+ //#region node_modules/.pnpm/resolve@1.22.11/node_modules/resolve/lib/homedir.js
103
+ var require_homedir = /* @__PURE__ */ __commonJSMin(((exports, module) => {
104
+ var os = __require("os");
105
+ module.exports = os.homedir || function homedir() {
106
+ var home = process.env.HOME;
107
+ var user = process.env.LOGNAME || process.env.USER || process.env.LNAME || process.env.USERNAME;
108
+ if (process.platform === "win32") return process.env.USERPROFILE || process.env.HOMEDRIVE + process.env.HOMEPATH || home || null;
109
+ if (process.platform === "darwin") return home || (user ? "/Users/" + user : null);
110
+ if (process.platform === "linux") return home || (process.getuid() === 0 ? "/root" : user ? "/home/" + user : null);
111
+ return home || null;
112
+ };
113
+ }));
114
+
115
+ //#endregion
116
+ //#region node_modules/.pnpm/resolve@1.22.11/node_modules/resolve/lib/caller.js
117
+ var require_caller = /* @__PURE__ */ __commonJSMin(((exports, module) => {
118
+ module.exports = function() {
119
+ var origPrepareStackTrace = Error.prepareStackTrace;
120
+ Error.prepareStackTrace = function(_, stack$1) {
121
+ return stack$1;
122
+ };
123
+ var stack = (/* @__PURE__ */ new Error()).stack;
124
+ Error.prepareStackTrace = origPrepareStackTrace;
125
+ return stack[2].getFileName();
126
+ };
127
+ }));
128
+
129
+ //#endregion
130
+ //#region node_modules/.pnpm/path-parse@1.0.7/node_modules/path-parse/index.js
131
+ var require_path_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
132
+ var isWindows = process.platform === "win32";
133
+ var splitWindowsRe = /^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/;
134
+ var win32 = {};
135
+ function win32SplitPath(filename) {
136
+ return splitWindowsRe.exec(filename).slice(1);
137
+ }
138
+ win32.parse = function(pathString) {
139
+ if (typeof pathString !== "string") throw new TypeError("Parameter 'pathString' must be a string, not " + typeof pathString);
140
+ var allParts = win32SplitPath(pathString);
141
+ if (!allParts || allParts.length !== 5) throw new TypeError("Invalid path '" + pathString + "'");
142
+ return {
143
+ root: allParts[1],
144
+ dir: allParts[0] === allParts[1] ? allParts[0] : allParts[0].slice(0, -1),
145
+ base: allParts[2],
146
+ ext: allParts[4],
147
+ name: allParts[3]
148
+ };
149
+ };
150
+ var splitPathRe = /^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/;
151
+ var posix = {};
152
+ function posixSplitPath(filename) {
153
+ return splitPathRe.exec(filename).slice(1);
154
+ }
155
+ posix.parse = function(pathString) {
156
+ if (typeof pathString !== "string") throw new TypeError("Parameter 'pathString' must be a string, not " + typeof pathString);
157
+ var allParts = posixSplitPath(pathString);
158
+ if (!allParts || allParts.length !== 5) throw new TypeError("Invalid path '" + pathString + "'");
159
+ return {
160
+ root: allParts[1],
161
+ dir: allParts[0].slice(0, -1),
162
+ base: allParts[2],
163
+ ext: allParts[4],
164
+ name: allParts[3]
165
+ };
166
+ };
167
+ if (isWindows) module.exports = win32.parse;
168
+ else module.exports = posix.parse;
169
+ module.exports.posix = posix.parse;
170
+ module.exports.win32 = win32.parse;
171
+ }));
172
+
173
+ //#endregion
174
+ //#region node_modules/.pnpm/resolve@1.22.11/node_modules/resolve/lib/node-modules-paths.js
175
+ var require_node_modules_paths = /* @__PURE__ */ __commonJSMin(((exports, module) => {
176
+ var path$3 = __require("path");
177
+ var parse = path$3.parse || require_path_parse();
178
+ var driveLetterRegex = /^([A-Za-z]:)/;
179
+ var uncPathRegex = /^\\\\/;
180
+ var getNodeModulesDirs = function getNodeModulesDirs(absoluteStart, modules) {
181
+ var prefix = "/";
182
+ if (driveLetterRegex.test(absoluteStart)) prefix = "";
183
+ else if (uncPathRegex.test(absoluteStart)) prefix = "\\\\";
184
+ var paths = [absoluteStart];
185
+ var parsed = parse(absoluteStart);
186
+ while (parsed.dir !== paths[paths.length - 1]) {
187
+ paths.push(parsed.dir);
188
+ parsed = parse(parsed.dir);
189
+ }
190
+ return paths.reduce(function(dirs, aPath) {
191
+ return dirs.concat(modules.map(function(moduleDir) {
192
+ return path$3.resolve(prefix, aPath, moduleDir);
193
+ }));
194
+ }, []);
195
+ };
196
+ module.exports = function nodeModulesPaths(start, opts, request) {
197
+ var modules = opts && opts.moduleDirectory ? [].concat(opts.moduleDirectory) : ["node_modules"];
198
+ if (opts && typeof opts.paths === "function") return opts.paths(request, start, function() {
199
+ return getNodeModulesDirs(start, modules);
200
+ }, opts);
201
+ var dirs = getNodeModulesDirs(start, modules);
202
+ return opts && opts.paths ? dirs.concat(opts.paths) : dirs;
203
+ };
204
+ }));
205
+
206
+ //#endregion
207
+ //#region node_modules/.pnpm/resolve@1.22.11/node_modules/resolve/lib/normalize-options.js
208
+ var require_normalize_options = /* @__PURE__ */ __commonJSMin(((exports, module) => {
209
+ module.exports = function(x, opts) {
210
+ /**
211
+ * This file is purposefully a passthrough. It's expected that third-party
212
+ * environments will override it at runtime in order to inject special logic
213
+ * into `resolve` (by manipulating the options). One such example is the PnP
214
+ * code path in Yarn.
215
+ */
216
+ return opts || {};
217
+ };
218
+ }));
219
+
220
+ //#endregion
221
+ //#region node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.js
222
+ var require_implementation = /* @__PURE__ */ __commonJSMin(((exports, module) => {
223
+ var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
224
+ var toStr = Object.prototype.toString;
225
+ var max = Math.max;
226
+ var funcType = "[object Function]";
227
+ var concatty = function concatty(a, b) {
228
+ var arr = [];
229
+ for (var i = 0; i < a.length; i += 1) arr[i] = a[i];
230
+ for (var j = 0; j < b.length; j += 1) arr[j + a.length] = b[j];
231
+ return arr;
232
+ };
233
+ var slicy = function slicy(arrLike, offset) {
234
+ var arr = [];
235
+ for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) arr[j] = arrLike[i];
236
+ return arr;
237
+ };
238
+ var joiny = function(arr, joiner) {
239
+ var str = "";
240
+ for (var i = 0; i < arr.length; i += 1) {
241
+ str += arr[i];
242
+ if (i + 1 < arr.length) str += joiner;
243
+ }
244
+ return str;
245
+ };
246
+ module.exports = function bind(that) {
247
+ var target = this;
248
+ if (typeof target !== "function" || toStr.apply(target) !== funcType) throw new TypeError(ERROR_MESSAGE + target);
249
+ var args = slicy(arguments, 1);
250
+ var bound;
251
+ var binder = function() {
252
+ if (this instanceof bound) {
253
+ var result = target.apply(this, concatty(args, arguments));
254
+ if (Object(result) === result) return result;
255
+ return this;
256
+ }
257
+ return target.apply(that, concatty(args, arguments));
258
+ };
259
+ var boundLength = max(0, target.length - args.length);
260
+ var boundArgs = [];
261
+ for (var i = 0; i < boundLength; i++) boundArgs[i] = "$" + i;
262
+ bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
263
+ if (target.prototype) {
264
+ var Empty = function Empty$1() {};
265
+ Empty.prototype = target.prototype;
266
+ bound.prototype = new Empty();
267
+ Empty.prototype = null;
268
+ }
269
+ return bound;
270
+ };
271
+ }));
272
+
273
+ //#endregion
274
+ //#region node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.js
275
+ var require_function_bind = /* @__PURE__ */ __commonJSMin(((exports, module) => {
276
+ var implementation = require_implementation();
277
+ module.exports = Function.prototype.bind || implementation;
278
+ }));
279
+
280
+ //#endregion
281
+ //#region node_modules/.pnpm/hasown@2.0.2/node_modules/hasown/index.js
282
+ var require_hasown = /* @__PURE__ */ __commonJSMin(((exports, module) => {
283
+ var call = Function.prototype.call;
284
+ var $hasOwn = Object.prototype.hasOwnProperty;
285
+ var bind = require_function_bind();
286
+ /** @type {import('.')} */
287
+ module.exports = bind.call(call, $hasOwn);
288
+ }));
289
+
290
+ //#endregion
291
+ //#region node_modules/.pnpm/is-core-module@2.16.1/node_modules/is-core-module/core.json
292
+ var require_core$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
293
+ module.exports = {
294
+ "assert": true,
295
+ "node:assert": [">= 14.18 && < 15", ">= 16"],
296
+ "assert/strict": ">= 15",
297
+ "node:assert/strict": ">= 16",
298
+ "async_hooks": ">= 8",
299
+ "node:async_hooks": [">= 14.18 && < 15", ">= 16"],
300
+ "buffer_ieee754": ">= 0.5 && < 0.9.7",
301
+ "buffer": true,
302
+ "node:buffer": [">= 14.18 && < 15", ">= 16"],
303
+ "child_process": true,
304
+ "node:child_process": [">= 14.18 && < 15", ">= 16"],
305
+ "cluster": ">= 0.5",
306
+ "node:cluster": [">= 14.18 && < 15", ">= 16"],
307
+ "console": true,
308
+ "node:console": [">= 14.18 && < 15", ">= 16"],
309
+ "constants": true,
310
+ "node:constants": [">= 14.18 && < 15", ">= 16"],
311
+ "crypto": true,
312
+ "node:crypto": [">= 14.18 && < 15", ">= 16"],
313
+ "_debug_agent": ">= 1 && < 8",
314
+ "_debugger": "< 8",
315
+ "dgram": true,
316
+ "node:dgram": [">= 14.18 && < 15", ">= 16"],
317
+ "diagnostics_channel": [">= 14.17 && < 15", ">= 15.1"],
318
+ "node:diagnostics_channel": [">= 14.18 && < 15", ">= 16"],
319
+ "dns": true,
320
+ "node:dns": [">= 14.18 && < 15", ">= 16"],
321
+ "dns/promises": ">= 15",
322
+ "node:dns/promises": ">= 16",
323
+ "domain": ">= 0.7.12",
324
+ "node:domain": [">= 14.18 && < 15", ">= 16"],
325
+ "events": true,
326
+ "node:events": [">= 14.18 && < 15", ">= 16"],
327
+ "freelist": "< 6",
328
+ "fs": true,
329
+ "node:fs": [">= 14.18 && < 15", ">= 16"],
330
+ "fs/promises": [">= 10 && < 10.1", ">= 14"],
331
+ "node:fs/promises": [">= 14.18 && < 15", ">= 16"],
332
+ "_http_agent": ">= 0.11.1",
333
+ "node:_http_agent": [">= 14.18 && < 15", ">= 16"],
334
+ "_http_client": ">= 0.11.1",
335
+ "node:_http_client": [">= 14.18 && < 15", ">= 16"],
336
+ "_http_common": ">= 0.11.1",
337
+ "node:_http_common": [">= 14.18 && < 15", ">= 16"],
338
+ "_http_incoming": ">= 0.11.1",
339
+ "node:_http_incoming": [">= 14.18 && < 15", ">= 16"],
340
+ "_http_outgoing": ">= 0.11.1",
341
+ "node:_http_outgoing": [">= 14.18 && < 15", ">= 16"],
342
+ "_http_server": ">= 0.11.1",
343
+ "node:_http_server": [">= 14.18 && < 15", ">= 16"],
344
+ "http": true,
345
+ "node:http": [">= 14.18 && < 15", ">= 16"],
346
+ "http2": ">= 8.8",
347
+ "node:http2": [">= 14.18 && < 15", ">= 16"],
348
+ "https": true,
349
+ "node:https": [">= 14.18 && < 15", ">= 16"],
350
+ "inspector": ">= 8",
351
+ "node:inspector": [">= 14.18 && < 15", ">= 16"],
352
+ "inspector/promises": [">= 19"],
353
+ "node:inspector/promises": [">= 19"],
354
+ "_linklist": "< 8",
355
+ "module": true,
356
+ "node:module": [">= 14.18 && < 15", ">= 16"],
357
+ "net": true,
358
+ "node:net": [">= 14.18 && < 15", ">= 16"],
359
+ "node-inspect/lib/_inspect": ">= 7.6 && < 12",
360
+ "node-inspect/lib/internal/inspect_client": ">= 7.6 && < 12",
361
+ "node-inspect/lib/internal/inspect_repl": ">= 7.6 && < 12",
362
+ "os": true,
363
+ "node:os": [">= 14.18 && < 15", ">= 16"],
364
+ "path": true,
365
+ "node:path": [">= 14.18 && < 15", ">= 16"],
366
+ "path/posix": ">= 15.3",
367
+ "node:path/posix": ">= 16",
368
+ "path/win32": ">= 15.3",
369
+ "node:path/win32": ">= 16",
370
+ "perf_hooks": ">= 8.5",
371
+ "node:perf_hooks": [">= 14.18 && < 15", ">= 16"],
372
+ "process": ">= 1",
373
+ "node:process": [">= 14.18 && < 15", ">= 16"],
374
+ "punycode": ">= 0.5",
375
+ "node:punycode": [">= 14.18 && < 15", ">= 16"],
376
+ "querystring": true,
377
+ "node:querystring": [">= 14.18 && < 15", ">= 16"],
378
+ "readline": true,
379
+ "node:readline": [">= 14.18 && < 15", ">= 16"],
380
+ "readline/promises": ">= 17",
381
+ "node:readline/promises": ">= 17",
382
+ "repl": true,
383
+ "node:repl": [">= 14.18 && < 15", ">= 16"],
384
+ "node:sea": [">= 20.12 && < 21", ">= 21.7"],
385
+ "smalloc": ">= 0.11.5 && < 3",
386
+ "node:sqlite": [">= 22.13 && < 23", ">= 23.4"],
387
+ "_stream_duplex": ">= 0.9.4",
388
+ "node:_stream_duplex": [">= 14.18 && < 15", ">= 16"],
389
+ "_stream_transform": ">= 0.9.4",
390
+ "node:_stream_transform": [">= 14.18 && < 15", ">= 16"],
391
+ "_stream_wrap": ">= 1.4.1",
392
+ "node:_stream_wrap": [">= 14.18 && < 15", ">= 16"],
393
+ "_stream_passthrough": ">= 0.9.4",
394
+ "node:_stream_passthrough": [">= 14.18 && < 15", ">= 16"],
395
+ "_stream_readable": ">= 0.9.4",
396
+ "node:_stream_readable": [">= 14.18 && < 15", ">= 16"],
397
+ "_stream_writable": ">= 0.9.4",
398
+ "node:_stream_writable": [">= 14.18 && < 15", ">= 16"],
399
+ "stream": true,
400
+ "node:stream": [">= 14.18 && < 15", ">= 16"],
401
+ "stream/consumers": ">= 16.7",
402
+ "node:stream/consumers": ">= 16.7",
403
+ "stream/promises": ">= 15",
404
+ "node:stream/promises": ">= 16",
405
+ "stream/web": ">= 16.5",
406
+ "node:stream/web": ">= 16.5",
407
+ "string_decoder": true,
408
+ "node:string_decoder": [">= 14.18 && < 15", ">= 16"],
409
+ "sys": [">= 0.4 && < 0.7", ">= 0.8"],
410
+ "node:sys": [">= 14.18 && < 15", ">= 16"],
411
+ "test/reporters": ">= 19.9 && < 20.2",
412
+ "node:test/reporters": [
413
+ ">= 18.17 && < 19",
414
+ ">= 19.9",
415
+ ">= 20"
416
+ ],
417
+ "test/mock_loader": ">= 22.3 && < 22.7",
418
+ "node:test/mock_loader": ">= 22.3 && < 22.7",
419
+ "node:test": [">= 16.17 && < 17", ">= 18"],
420
+ "timers": true,
421
+ "node:timers": [">= 14.18 && < 15", ">= 16"],
422
+ "timers/promises": ">= 15",
423
+ "node:timers/promises": ">= 16",
424
+ "_tls_common": ">= 0.11.13",
425
+ "node:_tls_common": [">= 14.18 && < 15", ">= 16"],
426
+ "_tls_legacy": ">= 0.11.3 && < 10",
427
+ "_tls_wrap": ">= 0.11.3",
428
+ "node:_tls_wrap": [">= 14.18 && < 15", ">= 16"],
429
+ "tls": true,
430
+ "node:tls": [">= 14.18 && < 15", ">= 16"],
431
+ "trace_events": ">= 10",
432
+ "node:trace_events": [">= 14.18 && < 15", ">= 16"],
433
+ "tty": true,
434
+ "node:tty": [">= 14.18 && < 15", ">= 16"],
435
+ "url": true,
436
+ "node:url": [">= 14.18 && < 15", ">= 16"],
437
+ "util": true,
438
+ "node:util": [">= 14.18 && < 15", ">= 16"],
439
+ "util/types": ">= 15.3",
440
+ "node:util/types": ">= 16",
441
+ "v8/tools/arguments": ">= 10 && < 12",
442
+ "v8/tools/codemap": [">= 4.4 && < 5", ">= 5.2 && < 12"],
443
+ "v8/tools/consarray": [">= 4.4 && < 5", ">= 5.2 && < 12"],
444
+ "v8/tools/csvparser": [">= 4.4 && < 5", ">= 5.2 && < 12"],
445
+ "v8/tools/logreader": [">= 4.4 && < 5", ">= 5.2 && < 12"],
446
+ "v8/tools/profile_view": [">= 4.4 && < 5", ">= 5.2 && < 12"],
447
+ "v8/tools/splaytree": [">= 4.4 && < 5", ">= 5.2 && < 12"],
448
+ "v8": ">= 1",
449
+ "node:v8": [">= 14.18 && < 15", ">= 16"],
450
+ "vm": true,
451
+ "node:vm": [">= 14.18 && < 15", ">= 16"],
452
+ "wasi": [
453
+ ">= 13.4 && < 13.5",
454
+ ">= 18.17 && < 19",
455
+ ">= 20"
456
+ ],
457
+ "node:wasi": [">= 18.17 && < 19", ">= 20"],
458
+ "worker_threads": ">= 11.7",
459
+ "node:worker_threads": [">= 14.18 && < 15", ">= 16"],
460
+ "zlib": ">= 0.5",
461
+ "node:zlib": [">= 14.18 && < 15", ">= 16"]
462
+ };
463
+ }));
464
+
465
+ //#endregion
466
+ //#region node_modules/.pnpm/is-core-module@2.16.1/node_modules/is-core-module/index.js
467
+ var require_is_core_module = /* @__PURE__ */ __commonJSMin(((exports, module) => {
468
+ var hasOwn = require_hasown();
469
+ function specifierIncluded(current, specifier) {
470
+ var nodeParts = current.split(".");
471
+ var parts = specifier.split(" ");
472
+ var op = parts.length > 1 ? parts[0] : "=";
473
+ var versionParts = (parts.length > 1 ? parts[1] : parts[0]).split(".");
474
+ for (var i = 0; i < 3; ++i) {
475
+ var cur = parseInt(nodeParts[i] || 0, 10);
476
+ var ver = parseInt(versionParts[i] || 0, 10);
477
+ if (cur === ver) continue;
478
+ if (op === "<") return cur < ver;
479
+ if (op === ">=") return cur >= ver;
480
+ return false;
481
+ }
482
+ return op === ">=";
483
+ }
484
+ function matchesRange(current, range) {
485
+ var specifiers = range.split(/ ?&& ?/);
486
+ if (specifiers.length === 0) return false;
487
+ for (var i = 0; i < specifiers.length; ++i) if (!specifierIncluded(current, specifiers[i])) return false;
488
+ return true;
489
+ }
490
+ function versionIncluded(nodeVersion, specifierValue) {
491
+ if (typeof specifierValue === "boolean") return specifierValue;
492
+ var current = typeof nodeVersion === "undefined" ? process.versions && process.versions.node : nodeVersion;
493
+ if (typeof current !== "string") throw new TypeError(typeof nodeVersion === "undefined" ? "Unable to determine current node version" : "If provided, a valid node version is required");
494
+ if (specifierValue && typeof specifierValue === "object") {
495
+ for (var i = 0; i < specifierValue.length; ++i) if (matchesRange(current, specifierValue[i])) return true;
496
+ return false;
497
+ }
498
+ return matchesRange(current, specifierValue);
499
+ }
500
+ var data = require_core$2();
501
+ module.exports = function isCore(x, nodeVersion) {
502
+ return hasOwn(data, x) && versionIncluded(nodeVersion, data[x]);
503
+ };
504
+ }));
505
+
506
+ //#endregion
507
+ //#region node_modules/.pnpm/resolve@1.22.11/node_modules/resolve/lib/async.js
508
+ var require_async = /* @__PURE__ */ __commonJSMin(((exports, module) => {
509
+ var fs$1 = __require("fs");
510
+ var getHomedir = require_homedir();
511
+ var path$2 = __require("path");
512
+ var caller = require_caller();
513
+ var nodeModulesPaths = require_node_modules_paths();
514
+ var normalizeOptions = require_normalize_options();
515
+ var isCore = require_is_core_module();
516
+ var realpathFS = process.platform !== "win32" && fs$1.realpath && typeof fs$1.realpath.native === "function" ? fs$1.realpath.native : fs$1.realpath;
517
+ var relativePathRegex = /^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/;
518
+ var windowsDriveRegex = /^\w:[/\\]*$/;
519
+ var nodeModulesRegex = /[/\\]node_modules[/\\]*$/;
520
+ var homedir = getHomedir();
521
+ var defaultPaths = function() {
522
+ return [path$2.join(homedir, ".node_modules"), path$2.join(homedir, ".node_libraries")];
523
+ };
524
+ var defaultIsFile = function isFile(file, cb) {
525
+ fs$1.stat(file, function(err, stat$1) {
526
+ if (!err) return cb(null, stat$1.isFile() || stat$1.isFIFO());
527
+ if (err.code === "ENOENT" || err.code === "ENOTDIR") return cb(null, false);
528
+ return cb(err);
529
+ });
530
+ };
531
+ var defaultIsDir = function isDirectory(dir, cb) {
532
+ fs$1.stat(dir, function(err, stat$1) {
533
+ if (!err) return cb(null, stat$1.isDirectory());
534
+ if (err.code === "ENOENT" || err.code === "ENOTDIR") return cb(null, false);
535
+ return cb(err);
536
+ });
537
+ };
538
+ var defaultRealpath = function realpath$1(x, cb) {
539
+ realpathFS(x, function(realpathErr, realPath) {
540
+ if (realpathErr && realpathErr.code !== "ENOENT") cb(realpathErr);
541
+ else cb(null, realpathErr ? x : realPath);
542
+ });
543
+ };
544
+ var maybeRealpath = function maybeRealpath(realpath$1, x, opts, cb) {
545
+ if (opts && opts.preserveSymlinks === false) realpath$1(x, cb);
546
+ else cb(null, x);
547
+ };
548
+ var defaultReadPackage = function defaultReadPackage(readFile$2, pkgfile, cb) {
549
+ readFile$2(pkgfile, function(readFileErr, body) {
550
+ if (readFileErr) cb(readFileErr);
551
+ else try {
552
+ cb(null, JSON.parse(body));
553
+ } catch (jsonErr) {
554
+ cb(null);
555
+ }
556
+ });
557
+ };
558
+ var getPackageCandidates = function getPackageCandidates(x, start, opts) {
559
+ var dirs = nodeModulesPaths(start, opts, x);
560
+ for (var i = 0; i < dirs.length; i++) dirs[i] = path$2.join(dirs[i], x);
561
+ return dirs;
562
+ };
563
+ module.exports = function resolve$2(x, options, callback) {
564
+ var cb = callback;
565
+ var opts = options;
566
+ if (typeof options === "function") {
567
+ cb = opts;
568
+ opts = {};
569
+ }
570
+ if (typeof x !== "string") {
571
+ var err = /* @__PURE__ */ new TypeError("Path must be a string.");
572
+ return process.nextTick(function() {
573
+ cb(err);
574
+ });
575
+ }
576
+ opts = normalizeOptions(x, opts);
577
+ var isFile = opts.isFile || defaultIsFile;
578
+ var isDirectory = opts.isDirectory || defaultIsDir;
579
+ var readFile$2 = opts.readFile || fs$1.readFile;
580
+ var realpath$1 = opts.realpath || defaultRealpath;
581
+ var readPackage = opts.readPackage || defaultReadPackage;
582
+ if (opts.readFile && opts.readPackage) {
583
+ var conflictErr = /* @__PURE__ */ new TypeError("`readFile` and `readPackage` are mutually exclusive.");
584
+ return process.nextTick(function() {
585
+ cb(conflictErr);
586
+ });
587
+ }
588
+ var packageIterator = opts.packageIterator;
589
+ var extensions = opts.extensions || [".js"];
590
+ var includeCoreModules = opts.includeCoreModules !== false;
591
+ var basedir = opts.basedir || path$2.dirname(caller());
592
+ var parent = opts.filename || basedir;
593
+ opts.paths = opts.paths || defaultPaths();
594
+ maybeRealpath(realpath$1, path$2.resolve(basedir), opts, function(err$1, realStart) {
595
+ if (err$1) cb(err$1);
596
+ else init(realStart);
597
+ });
598
+ var res;
599
+ function init(basedir$1) {
600
+ if (relativePathRegex.test(x)) {
601
+ res = path$2.resolve(basedir$1, x);
602
+ if (x === "." || x === ".." || x.slice(-1) === "/") res += "/";
603
+ if (x.slice(-1) === "/" && res === basedir$1) loadAsDirectory(res, opts.package, onfile);
604
+ else loadAsFile(res, opts.package, onfile);
605
+ } else if (includeCoreModules && isCore(x)) return cb(null, x);
606
+ else loadNodeModules(x, basedir$1, function(err$1, n, pkg) {
607
+ if (err$1) cb(err$1);
608
+ else if (n) return maybeRealpath(realpath$1, n, opts, function(err$2, realN) {
609
+ if (err$2) cb(err$2);
610
+ else cb(null, realN, pkg);
611
+ });
612
+ else {
613
+ var moduleError = /* @__PURE__ */ new Error("Cannot find module '" + x + "' from '" + parent + "'");
614
+ moduleError.code = "MODULE_NOT_FOUND";
615
+ cb(moduleError);
616
+ }
617
+ });
618
+ }
619
+ function onfile(err$1, m, pkg) {
620
+ if (err$1) cb(err$1);
621
+ else if (m) cb(null, m, pkg);
622
+ else loadAsDirectory(res, function(err$2, d, pkg$1) {
623
+ if (err$2) cb(err$2);
624
+ else if (d) maybeRealpath(realpath$1, d, opts, function(err$3, realD) {
625
+ if (err$3) cb(err$3);
626
+ else cb(null, realD, pkg$1);
627
+ });
628
+ else {
629
+ var moduleError = /* @__PURE__ */ new Error("Cannot find module '" + x + "' from '" + parent + "'");
630
+ moduleError.code = "MODULE_NOT_FOUND";
631
+ cb(moduleError);
632
+ }
633
+ });
634
+ }
635
+ function loadAsFile(x$1, thePackage, callback$1) {
636
+ var loadAsFilePackage = thePackage;
637
+ var cb$1 = callback$1;
638
+ if (typeof loadAsFilePackage === "function") {
639
+ cb$1 = loadAsFilePackage;
640
+ loadAsFilePackage = void 0;
641
+ }
642
+ load([""].concat(extensions), x$1, loadAsFilePackage);
643
+ function load(exts, x$2, loadPackage) {
644
+ if (exts.length === 0) return cb$1(null, void 0, loadPackage);
645
+ var file = x$2 + exts[0];
646
+ var pkg = loadPackage;
647
+ if (pkg) onpkg(null, pkg);
648
+ else loadpkg(path$2.dirname(file), onpkg);
649
+ function onpkg(err$1, pkg_, dir) {
650
+ pkg = pkg_;
651
+ if (err$1) return cb$1(err$1);
652
+ if (dir && pkg && opts.pathFilter) {
653
+ var rfile = path$2.relative(dir, file);
654
+ var rel = rfile.slice(0, rfile.length - exts[0].length);
655
+ var r = opts.pathFilter(pkg, x$2, rel);
656
+ if (r) return load([""].concat(extensions.slice()), path$2.resolve(dir, r), pkg);
657
+ }
658
+ isFile(file, onex);
659
+ }
660
+ function onex(err$1, ex) {
661
+ if (err$1) return cb$1(err$1);
662
+ if (ex) return cb$1(null, file, pkg);
663
+ load(exts.slice(1), x$2, pkg);
664
+ }
665
+ }
666
+ }
667
+ function loadpkg(dir, cb$1) {
668
+ if (dir === "" || dir === "/") return cb$1(null);
669
+ if (process.platform === "win32" && windowsDriveRegex.test(dir)) return cb$1(null);
670
+ if (nodeModulesRegex.test(dir)) return cb$1(null);
671
+ maybeRealpath(realpath$1, dir, opts, function(unwrapErr, pkgdir) {
672
+ if (unwrapErr) return loadpkg(path$2.dirname(dir), cb$1);
673
+ var pkgfile = path$2.join(pkgdir, "package.json");
674
+ isFile(pkgfile, function(err$1, ex) {
675
+ if (!ex) return loadpkg(path$2.dirname(dir), cb$1);
676
+ readPackage(readFile$2, pkgfile, function(err$2, pkgParam) {
677
+ if (err$2) cb$1(err$2);
678
+ var pkg = pkgParam;
679
+ if (pkg && opts.packageFilter) pkg = opts.packageFilter(pkg, pkgfile);
680
+ cb$1(null, pkg, dir);
681
+ });
682
+ });
683
+ });
684
+ }
685
+ function loadAsDirectory(x$1, loadAsDirectoryPackage, callback$1) {
686
+ var cb$1 = callback$1;
687
+ var fpkg = loadAsDirectoryPackage;
688
+ if (typeof fpkg === "function") {
689
+ cb$1 = fpkg;
690
+ fpkg = opts.package;
691
+ }
692
+ maybeRealpath(realpath$1, x$1, opts, function(unwrapErr, pkgdir) {
693
+ if (unwrapErr) return cb$1(unwrapErr);
694
+ var pkgfile = path$2.join(pkgdir, "package.json");
695
+ isFile(pkgfile, function(err$1, ex) {
696
+ if (err$1) return cb$1(err$1);
697
+ if (!ex) return loadAsFile(path$2.join(x$1, "index"), fpkg, cb$1);
698
+ readPackage(readFile$2, pkgfile, function(err$2, pkgParam) {
699
+ if (err$2) return cb$1(err$2);
700
+ var pkg = pkgParam;
701
+ if (pkg && opts.packageFilter) pkg = opts.packageFilter(pkg, pkgfile);
702
+ if (pkg && pkg.main) {
703
+ if (typeof pkg.main !== "string") {
704
+ var mainError = /* @__PURE__ */ new TypeError("package “" + pkg.name + "” `main` must be a string");
705
+ mainError.code = "INVALID_PACKAGE_MAIN";
706
+ return cb$1(mainError);
707
+ }
708
+ if (pkg.main === "." || pkg.main === "./") pkg.main = "index";
709
+ loadAsFile(path$2.resolve(x$1, pkg.main), pkg, function(err$3, m, pkg$1) {
710
+ if (err$3) return cb$1(err$3);
711
+ if (m) return cb$1(null, m, pkg$1);
712
+ if (!pkg$1) return loadAsFile(path$2.join(x$1, "index"), pkg$1, cb$1);
713
+ loadAsDirectory(path$2.resolve(x$1, pkg$1.main), pkg$1, function(err$4, n, pkg$2) {
714
+ if (err$4) return cb$1(err$4);
715
+ if (n) return cb$1(null, n, pkg$2);
716
+ loadAsFile(path$2.join(x$1, "index"), pkg$2, cb$1);
717
+ });
718
+ });
719
+ return;
720
+ }
721
+ loadAsFile(path$2.join(x$1, "/index"), pkg, cb$1);
722
+ });
723
+ });
724
+ });
725
+ }
726
+ function processDirs(cb$1, dirs) {
727
+ if (dirs.length === 0) return cb$1(null, void 0);
728
+ var dir = dirs[0];
729
+ isDirectory(path$2.dirname(dir), isdir);
730
+ function isdir(err$1, isdir$1) {
731
+ if (err$1) return cb$1(err$1);
732
+ if (!isdir$1) return processDirs(cb$1, dirs.slice(1));
733
+ loadAsFile(dir, opts.package, onfile$1);
734
+ }
735
+ function onfile$1(err$1, m, pkg) {
736
+ if (err$1) return cb$1(err$1);
737
+ if (m) return cb$1(null, m, pkg);
738
+ loadAsDirectory(dir, opts.package, ondir);
739
+ }
740
+ function ondir(err$1, n, pkg) {
741
+ if (err$1) return cb$1(err$1);
742
+ if (n) return cb$1(null, n, pkg);
743
+ processDirs(cb$1, dirs.slice(1));
744
+ }
745
+ }
746
+ function loadNodeModules(x$1, start, cb$1) {
747
+ var thunk = function() {
748
+ return getPackageCandidates(x$1, start, opts);
749
+ };
750
+ processDirs(cb$1, packageIterator ? packageIterator(x$1, start, thunk, opts) : thunk());
751
+ }
752
+ };
753
+ }));
754
+
755
+ //#endregion
756
+ //#region node_modules/.pnpm/resolve@1.22.11/node_modules/resolve/lib/core.json
757
+ var require_core$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
758
+ module.exports = {
759
+ "assert": true,
760
+ "node:assert": [">= 14.18 && < 15", ">= 16"],
761
+ "assert/strict": ">= 15",
762
+ "node:assert/strict": ">= 16",
763
+ "async_hooks": ">= 8",
764
+ "node:async_hooks": [">= 14.18 && < 15", ">= 16"],
765
+ "buffer_ieee754": ">= 0.5 && < 0.9.7",
766
+ "buffer": true,
767
+ "node:buffer": [">= 14.18 && < 15", ">= 16"],
768
+ "child_process": true,
769
+ "node:child_process": [">= 14.18 && < 15", ">= 16"],
770
+ "cluster": ">= 0.5",
771
+ "node:cluster": [">= 14.18 && < 15", ">= 16"],
772
+ "console": true,
773
+ "node:console": [">= 14.18 && < 15", ">= 16"],
774
+ "constants": true,
775
+ "node:constants": [">= 14.18 && < 15", ">= 16"],
776
+ "crypto": true,
777
+ "node:crypto": [">= 14.18 && < 15", ">= 16"],
778
+ "_debug_agent": ">= 1 && < 8",
779
+ "_debugger": "< 8",
780
+ "dgram": true,
781
+ "node:dgram": [">= 14.18 && < 15", ">= 16"],
782
+ "diagnostics_channel": [">= 14.17 && < 15", ">= 15.1"],
783
+ "node:diagnostics_channel": [">= 14.18 && < 15", ">= 16"],
784
+ "dns": true,
785
+ "node:dns": [">= 14.18 && < 15", ">= 16"],
786
+ "dns/promises": ">= 15",
787
+ "node:dns/promises": ">= 16",
788
+ "domain": ">= 0.7.12",
789
+ "node:domain": [">= 14.18 && < 15", ">= 16"],
790
+ "events": true,
791
+ "node:events": [">= 14.18 && < 15", ">= 16"],
792
+ "freelist": "< 6",
793
+ "fs": true,
794
+ "node:fs": [">= 14.18 && < 15", ">= 16"],
795
+ "fs/promises": [">= 10 && < 10.1", ">= 14"],
796
+ "node:fs/promises": [">= 14.18 && < 15", ">= 16"],
797
+ "_http_agent": ">= 0.11.1",
798
+ "node:_http_agent": [">= 14.18 && < 15", ">= 16"],
799
+ "_http_client": ">= 0.11.1",
800
+ "node:_http_client": [">= 14.18 && < 15", ">= 16"],
801
+ "_http_common": ">= 0.11.1",
802
+ "node:_http_common": [">= 14.18 && < 15", ">= 16"],
803
+ "_http_incoming": ">= 0.11.1",
804
+ "node:_http_incoming": [">= 14.18 && < 15", ">= 16"],
805
+ "_http_outgoing": ">= 0.11.1",
806
+ "node:_http_outgoing": [">= 14.18 && < 15", ">= 16"],
807
+ "_http_server": ">= 0.11.1",
808
+ "node:_http_server": [">= 14.18 && < 15", ">= 16"],
809
+ "http": true,
810
+ "node:http": [">= 14.18 && < 15", ">= 16"],
811
+ "http2": ">= 8.8",
812
+ "node:http2": [">= 14.18 && < 15", ">= 16"],
813
+ "https": true,
814
+ "node:https": [">= 14.18 && < 15", ">= 16"],
815
+ "inspector": ">= 8",
816
+ "node:inspector": [">= 14.18 && < 15", ">= 16"],
817
+ "inspector/promises": [">= 19"],
818
+ "node:inspector/promises": [">= 19"],
819
+ "_linklist": "< 8",
820
+ "module": true,
821
+ "node:module": [">= 14.18 && < 15", ">= 16"],
822
+ "net": true,
823
+ "node:net": [">= 14.18 && < 15", ">= 16"],
824
+ "node-inspect/lib/_inspect": ">= 7.6 && < 12",
825
+ "node-inspect/lib/internal/inspect_client": ">= 7.6 && < 12",
826
+ "node-inspect/lib/internal/inspect_repl": ">= 7.6 && < 12",
827
+ "os": true,
828
+ "node:os": [">= 14.18 && < 15", ">= 16"],
829
+ "path": true,
830
+ "node:path": [">= 14.18 && < 15", ">= 16"],
831
+ "path/posix": ">= 15.3",
832
+ "node:path/posix": ">= 16",
833
+ "path/win32": ">= 15.3",
834
+ "node:path/win32": ">= 16",
835
+ "perf_hooks": ">= 8.5",
836
+ "node:perf_hooks": [">= 14.18 && < 15", ">= 16"],
837
+ "process": ">= 1",
838
+ "node:process": [">= 14.18 && < 15", ">= 16"],
839
+ "punycode": ">= 0.5",
840
+ "node:punycode": [">= 14.18 && < 15", ">= 16"],
841
+ "querystring": true,
842
+ "node:querystring": [">= 14.18 && < 15", ">= 16"],
843
+ "readline": true,
844
+ "node:readline": [">= 14.18 && < 15", ">= 16"],
845
+ "readline/promises": ">= 17",
846
+ "node:readline/promises": ">= 17",
847
+ "repl": true,
848
+ "node:repl": [">= 14.18 && < 15", ">= 16"],
849
+ "node:sea": [">= 20.12 && < 21", ">= 21.7"],
850
+ "smalloc": ">= 0.11.5 && < 3",
851
+ "node:sqlite": [">= 22.13 && < 23", ">= 23.4"],
852
+ "_stream_duplex": ">= 0.9.4",
853
+ "node:_stream_duplex": [">= 14.18 && < 15", ">= 16"],
854
+ "_stream_transform": ">= 0.9.4",
855
+ "node:_stream_transform": [">= 14.18 && < 15", ">= 16"],
856
+ "_stream_wrap": ">= 1.4.1",
857
+ "node:_stream_wrap": [">= 14.18 && < 15", ">= 16"],
858
+ "_stream_passthrough": ">= 0.9.4",
859
+ "node:_stream_passthrough": [">= 14.18 && < 15", ">= 16"],
860
+ "_stream_readable": ">= 0.9.4",
861
+ "node:_stream_readable": [">= 14.18 && < 15", ">= 16"],
862
+ "_stream_writable": ">= 0.9.4",
863
+ "node:_stream_writable": [">= 14.18 && < 15", ">= 16"],
864
+ "stream": true,
865
+ "node:stream": [">= 14.18 && < 15", ">= 16"],
866
+ "stream/consumers": ">= 16.7",
867
+ "node:stream/consumers": ">= 16.7",
868
+ "stream/promises": ">= 15",
869
+ "node:stream/promises": ">= 16",
870
+ "stream/web": ">= 16.5",
871
+ "node:stream/web": ">= 16.5",
872
+ "string_decoder": true,
873
+ "node:string_decoder": [">= 14.18 && < 15", ">= 16"],
874
+ "sys": [">= 0.4 && < 0.7", ">= 0.8"],
875
+ "node:sys": [">= 14.18 && < 15", ">= 16"],
876
+ "test/reporters": ">= 19.9 && < 20.2",
877
+ "node:test/reporters": [
878
+ ">= 18.17 && < 19",
879
+ ">= 19.9",
880
+ ">= 20"
881
+ ],
882
+ "test/mock_loader": ">= 22.3 && < 22.7",
883
+ "node:test/mock_loader": ">= 22.3 && < 22.7",
884
+ "node:test": [">= 16.17 && < 17", ">= 18"],
885
+ "timers": true,
886
+ "node:timers": [">= 14.18 && < 15", ">= 16"],
887
+ "timers/promises": ">= 15",
888
+ "node:timers/promises": ">= 16",
889
+ "_tls_common": ">= 0.11.13",
890
+ "node:_tls_common": [">= 14.18 && < 15", ">= 16"],
891
+ "_tls_legacy": ">= 0.11.3 && < 10",
892
+ "_tls_wrap": ">= 0.11.3",
893
+ "node:_tls_wrap": [">= 14.18 && < 15", ">= 16"],
894
+ "tls": true,
895
+ "node:tls": [">= 14.18 && < 15", ">= 16"],
896
+ "trace_events": ">= 10",
897
+ "node:trace_events": [">= 14.18 && < 15", ">= 16"],
898
+ "tty": true,
899
+ "node:tty": [">= 14.18 && < 15", ">= 16"],
900
+ "url": true,
901
+ "node:url": [">= 14.18 && < 15", ">= 16"],
902
+ "util": true,
903
+ "node:util": [">= 14.18 && < 15", ">= 16"],
904
+ "util/types": ">= 15.3",
905
+ "node:util/types": ">= 16",
906
+ "v8/tools/arguments": ">= 10 && < 12",
907
+ "v8/tools/codemap": [">= 4.4 && < 5", ">= 5.2 && < 12"],
908
+ "v8/tools/consarray": [">= 4.4 && < 5", ">= 5.2 && < 12"],
909
+ "v8/tools/csvparser": [">= 4.4 && < 5", ">= 5.2 && < 12"],
910
+ "v8/tools/logreader": [">= 4.4 && < 5", ">= 5.2 && < 12"],
911
+ "v8/tools/profile_view": [">= 4.4 && < 5", ">= 5.2 && < 12"],
912
+ "v8/tools/splaytree": [">= 4.4 && < 5", ">= 5.2 && < 12"],
913
+ "v8": ">= 1",
914
+ "node:v8": [">= 14.18 && < 15", ">= 16"],
915
+ "vm": true,
916
+ "node:vm": [">= 14.18 && < 15", ">= 16"],
917
+ "wasi": [
918
+ ">= 13.4 && < 13.5",
919
+ ">= 18.17 && < 19",
920
+ ">= 20"
921
+ ],
922
+ "node:wasi": [">= 18.17 && < 19", ">= 20"],
923
+ "worker_threads": ">= 11.7",
924
+ "node:worker_threads": [">= 14.18 && < 15", ">= 16"],
925
+ "zlib": ">= 0.5",
926
+ "node:zlib": [">= 14.18 && < 15", ">= 16"]
927
+ };
928
+ }));
929
+
930
+ //#endregion
931
+ //#region node_modules/.pnpm/resolve@1.22.11/node_modules/resolve/lib/core.js
932
+ var require_core = /* @__PURE__ */ __commonJSMin(((exports, module) => {
933
+ var isCoreModule = require_is_core_module();
934
+ var data = require_core$1();
935
+ var core = {};
936
+ for (var mod in data) if (Object.prototype.hasOwnProperty.call(data, mod)) core[mod] = isCoreModule(mod);
937
+ module.exports = core;
938
+ }));
939
+
940
+ //#endregion
941
+ //#region node_modules/.pnpm/resolve@1.22.11/node_modules/resolve/lib/is-core.js
942
+ var require_is_core = /* @__PURE__ */ __commonJSMin(((exports, module) => {
943
+ var isCoreModule = require_is_core_module();
944
+ module.exports = function isCore(x) {
945
+ return isCoreModule(x);
946
+ };
947
+ }));
948
+
949
+ //#endregion
950
+ //#region node_modules/.pnpm/resolve@1.22.11/node_modules/resolve/lib/sync.js
951
+ var require_sync = /* @__PURE__ */ __commonJSMin(((exports, module) => {
952
+ var isCore = require_is_core_module();
953
+ var fs = __require("fs");
954
+ var path$1 = __require("path");
955
+ var getHomedir = require_homedir();
956
+ var caller = require_caller();
957
+ var nodeModulesPaths = require_node_modules_paths();
958
+ var normalizeOptions = require_normalize_options();
959
+ var realpathFS = process.platform !== "win32" && fs.realpathSync && typeof fs.realpathSync.native === "function" ? fs.realpathSync.native : fs.realpathSync;
960
+ var relativePathRegex = /^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/;
961
+ var windowsDriveRegex = /^\w:[/\\]*$/;
962
+ var nodeModulesRegex = /[/\\]node_modules[/\\]*$/;
963
+ var homedir = getHomedir();
964
+ var defaultPaths = function() {
965
+ return [path$1.join(homedir, ".node_modules"), path$1.join(homedir, ".node_libraries")];
966
+ };
967
+ var defaultIsFile = function isFile(file) {
968
+ try {
969
+ var stat$1 = fs.statSync(file, { throwIfNoEntry: false });
970
+ } catch (e) {
971
+ if (e && (e.code === "ENOENT" || e.code === "ENOTDIR")) return false;
972
+ throw e;
973
+ }
974
+ return !!stat$1 && (stat$1.isFile() || stat$1.isFIFO());
975
+ };
976
+ var defaultIsDir = function isDirectory(dir) {
977
+ try {
978
+ var stat$1 = fs.statSync(dir, { throwIfNoEntry: false });
979
+ } catch (e) {
980
+ if (e && (e.code === "ENOENT" || e.code === "ENOTDIR")) return false;
981
+ throw e;
982
+ }
983
+ return !!stat$1 && stat$1.isDirectory();
984
+ };
985
+ var defaultRealpathSync = function realpathSync$1(x) {
986
+ try {
987
+ return realpathFS(x);
988
+ } catch (realpathErr) {
989
+ if (realpathErr.code !== "ENOENT") throw realpathErr;
990
+ }
991
+ return x;
992
+ };
993
+ var maybeRealpathSync = function maybeRealpathSync(realpathSync$1, x, opts) {
994
+ if (opts && opts.preserveSymlinks === false) return realpathSync$1(x);
995
+ return x;
996
+ };
997
+ var defaultReadPackageSync = function defaultReadPackageSync(readFileSync$1, pkgfile) {
998
+ var body = readFileSync$1(pkgfile);
999
+ try {
1000
+ return JSON.parse(body);
1001
+ } catch (jsonErr) {}
1002
+ };
1003
+ var getPackageCandidates = function getPackageCandidates(x, start, opts) {
1004
+ var dirs = nodeModulesPaths(start, opts, x);
1005
+ for (var i = 0; i < dirs.length; i++) dirs[i] = path$1.join(dirs[i], x);
1006
+ return dirs;
1007
+ };
1008
+ module.exports = function resolveSync(x, options) {
1009
+ if (typeof x !== "string") throw new TypeError("Path must be a string.");
1010
+ var opts = normalizeOptions(x, options);
1011
+ var isFile = opts.isFile || defaultIsFile;
1012
+ var readFileSync$1 = opts.readFileSync || fs.readFileSync;
1013
+ var isDirectory = opts.isDirectory || defaultIsDir;
1014
+ var realpathSync$1 = opts.realpathSync || defaultRealpathSync;
1015
+ var readPackageSync = opts.readPackageSync || defaultReadPackageSync;
1016
+ if (opts.readFileSync && opts.readPackageSync) throw new TypeError("`readFileSync` and `readPackageSync` are mutually exclusive.");
1017
+ var packageIterator = opts.packageIterator;
1018
+ var extensions = opts.extensions || [".js"];
1019
+ var includeCoreModules = opts.includeCoreModules !== false;
1020
+ var basedir = opts.basedir || path$1.dirname(caller());
1021
+ var parent = opts.filename || basedir;
1022
+ opts.paths = opts.paths || defaultPaths();
1023
+ var absoluteStart = maybeRealpathSync(realpathSync$1, path$1.resolve(basedir), opts);
1024
+ if (relativePathRegex.test(x)) {
1025
+ var res = path$1.resolve(absoluteStart, x);
1026
+ if (x === "." || x === ".." || x.slice(-1) === "/") res += "/";
1027
+ var m = loadAsFileSync(res) || loadAsDirectorySync(res);
1028
+ if (m) return maybeRealpathSync(realpathSync$1, m, opts);
1029
+ } else if (includeCoreModules && isCore(x)) return x;
1030
+ else {
1031
+ var n = loadNodeModulesSync(x, absoluteStart);
1032
+ if (n) return maybeRealpathSync(realpathSync$1, n, opts);
1033
+ }
1034
+ var err = /* @__PURE__ */ new Error("Cannot find module '" + x + "' from '" + parent + "'");
1035
+ err.code = "MODULE_NOT_FOUND";
1036
+ throw err;
1037
+ function loadAsFileSync(x$1) {
1038
+ var pkg = loadpkg(path$1.dirname(x$1));
1039
+ if (pkg && pkg.dir && pkg.pkg && opts.pathFilter) {
1040
+ var rfile = path$1.relative(pkg.dir, x$1);
1041
+ var r = opts.pathFilter(pkg.pkg, x$1, rfile);
1042
+ if (r) x$1 = path$1.resolve(pkg.dir, r);
1043
+ }
1044
+ if (isFile(x$1)) return x$1;
1045
+ for (var i = 0; i < extensions.length; i++) {
1046
+ var file = x$1 + extensions[i];
1047
+ if (isFile(file)) return file;
1048
+ }
1049
+ }
1050
+ function loadpkg(dir) {
1051
+ if (dir === "" || dir === "/") return;
1052
+ if (process.platform === "win32" && windowsDriveRegex.test(dir)) return;
1053
+ if (nodeModulesRegex.test(dir)) return;
1054
+ var pkgfile = path$1.join(maybeRealpathSync(realpathSync$1, dir, opts), "package.json");
1055
+ if (!isFile(pkgfile)) return loadpkg(path$1.dirname(dir));
1056
+ var pkg = readPackageSync(readFileSync$1, pkgfile);
1057
+ if (pkg && opts.packageFilter) pkg = opts.packageFilter(pkg, dir);
1058
+ return {
1059
+ pkg,
1060
+ dir
1061
+ };
1062
+ }
1063
+ function loadAsDirectorySync(x$1) {
1064
+ var pkgfile = path$1.join(maybeRealpathSync(realpathSync$1, x$1, opts), "/package.json");
1065
+ if (isFile(pkgfile)) {
1066
+ try {
1067
+ var pkg = readPackageSync(readFileSync$1, pkgfile);
1068
+ } catch (e) {}
1069
+ if (pkg && opts.packageFilter) pkg = opts.packageFilter(pkg, x$1);
1070
+ if (pkg && pkg.main) {
1071
+ if (typeof pkg.main !== "string") {
1072
+ var mainError = /* @__PURE__ */ new TypeError("package “" + pkg.name + "” `main` must be a string");
1073
+ mainError.code = "INVALID_PACKAGE_MAIN";
1074
+ throw mainError;
1075
+ }
1076
+ if (pkg.main === "." || pkg.main === "./") pkg.main = "index";
1077
+ try {
1078
+ var m$1 = loadAsFileSync(path$1.resolve(x$1, pkg.main));
1079
+ if (m$1) return m$1;
1080
+ var n$1 = loadAsDirectorySync(path$1.resolve(x$1, pkg.main));
1081
+ if (n$1) return n$1;
1082
+ } catch (e) {}
1083
+ }
1084
+ }
1085
+ return loadAsFileSync(path$1.join(x$1, "/index"));
1086
+ }
1087
+ function loadNodeModulesSync(x$1, start) {
1088
+ var thunk = function() {
1089
+ return getPackageCandidates(x$1, start, opts);
1090
+ };
1091
+ var dirs = packageIterator ? packageIterator(x$1, start, thunk, opts) : thunk();
1092
+ for (var i = 0; i < dirs.length; i++) {
1093
+ var dir = dirs[i];
1094
+ if (isDirectory(path$1.dirname(dir))) {
1095
+ var m$1 = loadAsFileSync(dir);
1096
+ if (m$1) return m$1;
1097
+ var n$1 = loadAsDirectorySync(dir);
1098
+ if (n$1) return n$1;
1099
+ }
1100
+ }
1101
+ }
1102
+ };
1103
+ }));
1104
+
1105
+ //#endregion
1106
+ //#region node_modules/.pnpm/resolve@1.22.11/node_modules/resolve/index.js
1107
+ var require_resolve = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1108
+ var async = require_async();
1109
+ async.core = require_core();
1110
+ async.isCore = require_is_core();
1111
+ async.sync = require_sync();
1112
+ module.exports = async;
1113
+ }));
1114
+
1115
+ //#endregion
1116
+ //#region node_modules/.pnpm/@rollup+plugin-node-resolve@16.0.3_rollup@4.55.2/node_modules/@rollup/plugin-node-resolve/dist/es/index.js
1117
+ var import_cjs = /* @__PURE__ */ __toESM(require_cjs(), 1);
1118
+ var import_is_module = /* @__PURE__ */ __toESM(require_is_module(), 1);
1119
+ var import_resolve = /* @__PURE__ */ __toESM(require_resolve(), 1);
1120
+ var version = "16.0.3";
1121
+ var peerDependencies = { rollup: "^2.78.0||^3.0.0||^4.0.0" };
1122
+ promisify(nativeFs.access);
1123
+ const readFile$1 = promisify(nativeFs.readFile);
1124
+ const realpath = promisify(nativeFs.realpath);
1125
+ const stat = promisify(nativeFs.stat);
1126
+ async function fileExists(filePath) {
1127
+ try {
1128
+ return (await stat(filePath)).isFile();
1129
+ } catch {
1130
+ return false;
1131
+ }
1132
+ }
1133
+ async function resolveSymlink(path$4) {
1134
+ return await fileExists(path$4) ? realpath(path$4) : path$4;
1135
+ }
1136
+ const onError = (error) => {
1137
+ if (error.code === "ENOENT") return false;
1138
+ throw error;
1139
+ };
1140
+ const makeCache = (fn) => {
1141
+ const cache = /* @__PURE__ */ new Map();
1142
+ const wrapped = async (param, done) => {
1143
+ if (cache.has(param) === false) cache.set(param, fn(param).catch((err) => {
1144
+ cache.delete(param);
1145
+ throw err;
1146
+ }));
1147
+ try {
1148
+ return done(null, await cache.get(param));
1149
+ } catch (error) {
1150
+ return done(error);
1151
+ }
1152
+ };
1153
+ wrapped.clear = () => cache.clear();
1154
+ return wrapped;
1155
+ };
1156
+ const isDirCached = makeCache(async (file) => {
1157
+ try {
1158
+ return (await stat(file)).isDirectory();
1159
+ } catch (error) {
1160
+ return onError(error);
1161
+ }
1162
+ });
1163
+ const isFileCached = makeCache(async (file) => {
1164
+ try {
1165
+ return (await stat(file)).isFile();
1166
+ } catch (error) {
1167
+ return onError(error);
1168
+ }
1169
+ });
1170
+ const readCachedFile = makeCache(readFile$1);
1171
+ function handleDeprecatedOptions(opts) {
1172
+ const warnings = [];
1173
+ if (opts.customResolveOptions) {
1174
+ const { customResolveOptions } = opts;
1175
+ if (customResolveOptions.moduleDirectory) {
1176
+ opts.moduleDirectories = Array.isArray(customResolveOptions.moduleDirectory) ? customResolveOptions.moduleDirectory : [customResolveOptions.moduleDirectory];
1177
+ warnings.push("node-resolve: The `customResolveOptions.moduleDirectory` option has been deprecated. Use `moduleDirectories`, which must be an array.");
1178
+ }
1179
+ if (customResolveOptions.preserveSymlinks) throw new Error("node-resolve: `customResolveOptions.preserveSymlinks` is no longer an option. We now always use the rollup `preserveSymlinks` option.");
1180
+ [
1181
+ "basedir",
1182
+ "package",
1183
+ "extensions",
1184
+ "includeCoreModules",
1185
+ "readFile",
1186
+ "isFile",
1187
+ "isDirectory",
1188
+ "realpath",
1189
+ "packageFilter",
1190
+ "pathFilter",
1191
+ "paths",
1192
+ "packageIterator"
1193
+ ].forEach((resolveOption) => {
1194
+ if (customResolveOptions[resolveOption]) throw new Error(`node-resolve: \`customResolveOptions.${resolveOption}\` is no longer an option. If you need this, please open an issue.`);
1195
+ });
1196
+ }
1197
+ return { warnings };
1198
+ }
1199
+ function getPackageName(id) {
1200
+ if (id.startsWith(".") || id.startsWith("/")) return null;
1201
+ const split = id.split("/");
1202
+ if (split[0][0] === "@") return `${split[0]}/${split[1]}`;
1203
+ return split[0];
1204
+ }
1205
+ function getMainFields(options) {
1206
+ let mainFields;
1207
+ if (options.mainFields) ({mainFields} = options);
1208
+ else mainFields = ["module", "main"];
1209
+ if (options.browser && mainFields.indexOf("browser") === -1) return ["browser"].concat(mainFields);
1210
+ if (!mainFields.length) throw new Error("Please ensure at least one `mainFields` value is specified");
1211
+ return mainFields;
1212
+ }
1213
+ function getPackageInfo(options) {
1214
+ const { cache, extensions, pkg, mainFields, preserveSymlinks, useBrowserOverrides, rootDir, ignoreSideEffectsForRoot } = options;
1215
+ let { pkgPath } = options;
1216
+ if (cache.has(pkgPath)) return cache.get(pkgPath);
1217
+ if (!preserveSymlinks) pkgPath = realpathSync(pkgPath);
1218
+ const pkgRoot = dirname(pkgPath);
1219
+ const packageInfo = {
1220
+ packageJson: { ...pkg },
1221
+ packageJsonPath: pkgPath,
1222
+ root: pkgRoot,
1223
+ resolvedMainField: "main",
1224
+ browserMappedMain: false,
1225
+ resolvedEntryPoint: ""
1226
+ };
1227
+ let overriddenMain = false;
1228
+ for (let i = 0; i < mainFields.length; i++) {
1229
+ const field = mainFields[i];
1230
+ if (typeof pkg[field] === "string") {
1231
+ pkg.main = pkg[field];
1232
+ packageInfo.resolvedMainField = field;
1233
+ overriddenMain = true;
1234
+ break;
1235
+ }
1236
+ }
1237
+ const internalPackageInfo = {
1238
+ cachedPkg: pkg,
1239
+ hasModuleSideEffects: () => null,
1240
+ hasPackageEntry: overriddenMain !== false || mainFields.indexOf("main") !== -1,
1241
+ packageBrowserField: useBrowserOverrides && typeof pkg.browser === "object" && Object.keys(pkg.browser).reduce((browser, key) => {
1242
+ let resolved = pkg.browser[key];
1243
+ if (resolved && resolved[0] === ".") resolved = resolve(pkgRoot, resolved);
1244
+ browser[key] = resolved;
1245
+ if (key[0] === ".") {
1246
+ const absoluteKey = resolve(pkgRoot, key);
1247
+ browser[absoluteKey] = resolved;
1248
+ if (!extname(key)) extensions.reduce((subBrowser, ext) => {
1249
+ subBrowser[absoluteKey + ext] = subBrowser[key];
1250
+ return subBrowser;
1251
+ }, browser);
1252
+ }
1253
+ return browser;
1254
+ }, {}),
1255
+ packageInfo
1256
+ };
1257
+ const browserMap = internalPackageInfo.packageBrowserField;
1258
+ if (useBrowserOverrides && typeof pkg.browser === "object" && browserMap.hasOwnProperty(pkg.main)) {
1259
+ packageInfo.resolvedEntryPoint = browserMap[pkg.main];
1260
+ packageInfo.browserMappedMain = true;
1261
+ } else {
1262
+ packageInfo.resolvedEntryPoint = resolve(pkgRoot, pkg.main || "index.js");
1263
+ packageInfo.browserMappedMain = false;
1264
+ }
1265
+ if (!ignoreSideEffectsForRoot || rootDir !== pkgRoot) {
1266
+ const packageSideEffects = pkg.sideEffects;
1267
+ if (typeof packageSideEffects === "boolean") internalPackageInfo.hasModuleSideEffects = () => packageSideEffects;
1268
+ else if (Array.isArray(packageSideEffects)) internalPackageInfo.hasModuleSideEffects = createFilter(packageSideEffects.map((sideEffect) => {
1269
+ if (sideEffect.includes("/")) return sideEffect;
1270
+ return `**/${sideEffect}`;
1271
+ }), null, { resolve: pkgRoot });
1272
+ }
1273
+ cache.set(pkgPath, internalPackageInfo);
1274
+ return internalPackageInfo;
1275
+ }
1276
+ function normalizeInput(input) {
1277
+ if (Array.isArray(input)) return input;
1278
+ else if (typeof input === "object") return Object.values(input);
1279
+ return [input];
1280
+ }
1281
+ function isModuleDir(current, moduleDirs) {
1282
+ return moduleDirs.some((dir) => current.endsWith(dir));
1283
+ }
1284
+ async function findPackageJson(base, moduleDirs) {
1285
+ const { root } = path.parse(base);
1286
+ let current = base;
1287
+ while (current !== root && !isModuleDir(current, moduleDirs)) {
1288
+ const pkgJsonPath = path.join(current, "package.json");
1289
+ if (await fileExists(pkgJsonPath)) {
1290
+ const pkgJsonString = nativeFs.readFileSync(pkgJsonPath, "utf-8");
1291
+ return {
1292
+ pkgJson: JSON.parse(pkgJsonString),
1293
+ pkgPath: current,
1294
+ pkgJsonPath
1295
+ };
1296
+ }
1297
+ current = path.resolve(current, "..");
1298
+ }
1299
+ return null;
1300
+ }
1301
+ function isUrl(str) {
1302
+ try {
1303
+ return !!new URL(str);
1304
+ } catch (_) {
1305
+ return false;
1306
+ }
1307
+ }
1308
+ /**
1309
+ * Conditions is an export object where all keys are conditions like 'node' (aka do not with '.')
1310
+ */
1311
+ function isConditions(exports) {
1312
+ return typeof exports === "object" && Object.keys(exports).every((k) => !k.startsWith("."));
1313
+ }
1314
+ /**
1315
+ * Mappings is an export object where all keys start with '.
1316
+ */
1317
+ function isMappings(exports) {
1318
+ return typeof exports === "object" && !isConditions(exports);
1319
+ }
1320
+ /**
1321
+ * Check for mixed exports, which are exports where some keys start with '.' and some do not
1322
+ */
1323
+ function isMixedExports(exports) {
1324
+ const keys = Object.keys(exports);
1325
+ return keys.some((k) => k.startsWith(".")) && keys.some((k) => !k.startsWith("."));
1326
+ }
1327
+ function createBaseErrorMsg(importSpecifier, importer) {
1328
+ return `Could not resolve import "${importSpecifier}" in ${importer}`;
1329
+ }
1330
+ function createErrorMsg(context, reason, isImports) {
1331
+ const { importSpecifier, importer, pkgJsonPath } = context;
1332
+ return `${createBaseErrorMsg(importSpecifier, importer)} using ${isImports ? "imports" : "exports"} defined in ${pkgJsonPath}.${reason ? ` ${reason}` : ""}`;
1333
+ }
1334
+ var ResolveError = class extends Error {};
1335
+ var InvalidConfigurationError = class extends ResolveError {
1336
+ constructor(context, reason) {
1337
+ super(createErrorMsg(context, `Invalid "exports" field. ${reason}`));
1338
+ }
1339
+ };
1340
+ var InvalidModuleSpecifierError = class extends ResolveError {
1341
+ constructor(context, isImports, reason) {
1342
+ super(createErrorMsg(context, reason, isImports));
1343
+ }
1344
+ };
1345
+ var InvalidPackageTargetError = class extends ResolveError {
1346
+ constructor(context, reason) {
1347
+ super(createErrorMsg(context, reason));
1348
+ }
1349
+ };
1350
+ /**
1351
+ * Check for invalid path segments
1352
+ */
1353
+ function includesInvalidSegments(pathSegments, moduleDirs) {
1354
+ const invalidSegments = [
1355
+ "",
1356
+ ".",
1357
+ "..",
1358
+ ...moduleDirs
1359
+ ];
1360
+ return pathSegments.some((v) => invalidSegments.includes(v) || invalidSegments.includes(decodeURI(v)));
1361
+ }
1362
+ async function resolvePackageTarget(context, { target, patternMatch, isImports }) {
1363
+ if (typeof target === "string") {
1364
+ if (!target.startsWith("./")) {
1365
+ if (!isImports || ["/", "../"].some((p) => target.startsWith(p)) || isUrl(target)) throw new InvalidPackageTargetError(context, `Invalid mapping: "${target}".`);
1366
+ if (typeof patternMatch === "string") {
1367
+ const result$1 = await context.resolveId(target.replace(/\*/g, patternMatch), context.pkgURL.href);
1368
+ return result$1 ? pathToFileURL(result$1.location).href : null;
1369
+ }
1370
+ const result = await context.resolveId(target, context.pkgURL.href);
1371
+ return result ? pathToFileURL(result.location).href : null;
1372
+ }
1373
+ if (context.allowExportsFolderMapping) target = target.replace(/\/$/, "/*");
1374
+ {
1375
+ const pathSegments = target.split(/\/|\\/);
1376
+ const firstDot = pathSegments.indexOf(".");
1377
+ firstDot !== -1 && pathSegments.slice(firstDot);
1378
+ if (firstDot !== -1 && firstDot < pathSegments.length - 1 && includesInvalidSegments(pathSegments.slice(firstDot + 1), context.moduleDirs)) throw new InvalidPackageTargetError(context, `Invalid mapping: "${target}".`);
1379
+ }
1380
+ const resolvedTarget = new URL(target, context.pkgURL);
1381
+ if (!resolvedTarget.href.startsWith(context.pkgURL.href)) throw new InvalidPackageTargetError(context, `Resolved to ${resolvedTarget.href} which is outside package ${context.pkgURL.href}`);
1382
+ if (!patternMatch) return resolvedTarget;
1383
+ if (includesInvalidSegments(patternMatch.split(/\/|\\/), context.moduleDirs)) throw new InvalidModuleSpecifierError(context);
1384
+ return resolvedTarget.href.replace(/\*/g, patternMatch);
1385
+ }
1386
+ if (Array.isArray(target)) {
1387
+ if (target.length === 0) return null;
1388
+ let lastError = null;
1389
+ for (const item of target) try {
1390
+ const resolved = await resolvePackageTarget(context, {
1391
+ target: item,
1392
+ patternMatch,
1393
+ isImports
1394
+ });
1395
+ if (resolved !== void 0) return resolved;
1396
+ } catch (error) {
1397
+ if (!(error instanceof InvalidPackageTargetError)) throw error;
1398
+ else lastError = error;
1399
+ }
1400
+ if (lastError) throw lastError;
1401
+ return null;
1402
+ }
1403
+ if (target && typeof target === "object") {
1404
+ for (const [key, value] of Object.entries(target)) if (key === "default" || context.conditions.includes(key)) {
1405
+ const resolved = await resolvePackageTarget(context, {
1406
+ target: value,
1407
+ patternMatch,
1408
+ isImports
1409
+ });
1410
+ if (resolved !== void 0) return resolved;
1411
+ }
1412
+ return;
1413
+ }
1414
+ if (target === null) return null;
1415
+ throw new InvalidPackageTargetError(context, `Invalid exports field.`);
1416
+ }
1417
+ /**
1418
+ * Implementation of Node's `PATTERN_KEY_COMPARE` function
1419
+ */
1420
+ function nodePatternKeyCompare(keyA, keyB) {
1421
+ const baseLengthA = keyA.includes("*") ? keyA.indexOf("*") + 1 : keyA.length;
1422
+ const rval = (keyB.includes("*") ? keyB.indexOf("*") + 1 : keyB.length) - baseLengthA;
1423
+ if (rval !== 0) return rval;
1424
+ if (!keyA.includes("*")) return 1;
1425
+ if (!keyB.includes("*")) return -1;
1426
+ return keyB.length - keyA.length;
1427
+ }
1428
+ async function resolvePackageImportsExports(context, { matchKey, matchObj, isImports }) {
1429
+ if (!matchKey.includes("*") && matchKey in matchObj) {
1430
+ const target = matchObj[matchKey];
1431
+ return await resolvePackageTarget(context, {
1432
+ target,
1433
+ patternMatch: "",
1434
+ isImports
1435
+ });
1436
+ }
1437
+ const expansionKeys = Object.keys(matchObj).filter((k) => k.endsWith("/") || k.includes("*")).sort(nodePatternKeyCompare);
1438
+ for (const expansionKey of expansionKeys) {
1439
+ const indexOfAsterisk = expansionKey.indexOf("*");
1440
+ const patternBase = indexOfAsterisk === -1 ? expansionKey : expansionKey.substring(0, indexOfAsterisk);
1441
+ if (matchKey.startsWith(patternBase) && matchKey !== patternBase) {
1442
+ const patternTrailer = indexOfAsterisk !== -1 ? expansionKey.substring(indexOfAsterisk + 1) : "";
1443
+ if (patternTrailer.length === 0 || matchKey.endsWith(patternTrailer) && matchKey.length >= expansionKey.length) {
1444
+ const target = matchObj[expansionKey];
1445
+ return await resolvePackageTarget(context, {
1446
+ target,
1447
+ patternMatch: matchKey.substring(patternBase.length, matchKey.length - patternTrailer.length),
1448
+ isImports
1449
+ });
1450
+ }
1451
+ }
1452
+ }
1453
+ throw new InvalidModuleSpecifierError(context, isImports);
1454
+ }
1455
+ /**
1456
+ * Implementation of PACKAGE_EXPORTS_RESOLVE
1457
+ */
1458
+ async function resolvePackageExports(context, subpath, exports) {
1459
+ if (isMixedExports(exports)) throw new InvalidConfigurationError(context, "All keys must either start with ./, or without one.");
1460
+ if (subpath === ".") {
1461
+ let mainExport;
1462
+ if (typeof exports === "string" || Array.isArray(exports) || isConditions(exports)) mainExport = exports;
1463
+ else if (isMappings(exports)) mainExport = exports["."];
1464
+ if (mainExport) {
1465
+ const resolved = await resolvePackageTarget(context, {
1466
+ target: mainExport,
1467
+ patternMatch: "",
1468
+ isImports: false
1469
+ });
1470
+ if (resolved) return resolved;
1471
+ }
1472
+ } else if (isMappings(exports)) {
1473
+ const resolvedMatch = await resolvePackageImportsExports(context, {
1474
+ matchKey: subpath,
1475
+ matchObj: exports,
1476
+ isImports: false
1477
+ });
1478
+ if (resolvedMatch) return resolvedMatch;
1479
+ }
1480
+ throw new InvalidModuleSpecifierError(context);
1481
+ }
1482
+ async function resolvePackageImports({ importSpecifier, importer, moduleDirs, conditions, resolveId }) {
1483
+ const result = await findPackageJson(importer, moduleDirs);
1484
+ if (!result) throw new Error(`${createBaseErrorMsg(importSpecifier, importer)}. Could not find a parent package.json.`);
1485
+ const { pkgPath, pkgJsonPath, pkgJson } = result;
1486
+ const context = {
1487
+ importer,
1488
+ importSpecifier,
1489
+ moduleDirs,
1490
+ pkgURL: pathToFileURL(`${pkgPath}/`),
1491
+ pkgJsonPath,
1492
+ conditions,
1493
+ resolveId
1494
+ };
1495
+ if (!importSpecifier.startsWith("#")) throw new InvalidModuleSpecifierError(context, true, "Invalid import specifier.");
1496
+ if (importSpecifier === "#" || importSpecifier.startsWith("#/")) throw new InvalidModuleSpecifierError(context, true, "Invalid import specifier.");
1497
+ const { imports } = pkgJson;
1498
+ if (!imports) throw new InvalidModuleSpecifierError(context, true);
1499
+ return resolvePackageImportsExports(context, {
1500
+ matchKey: importSpecifier,
1501
+ matchObj: imports,
1502
+ isImports: true
1503
+ });
1504
+ }
1505
+ const resolveImportPath = promisify(import_resolve.default);
1506
+ const readFile = promisify(nativeFs.readFile);
1507
+ async function getPackageJson(importer, pkgName, resolveOptions, moduleDirectories) {
1508
+ if (importer) {
1509
+ const selfPackageJsonResult = await findPackageJson(importer, moduleDirectories);
1510
+ if (selfPackageJsonResult && selfPackageJsonResult.pkgJson.name === pkgName) return selfPackageJsonResult;
1511
+ }
1512
+ try {
1513
+ const pkgJsonPath = await resolveImportPath(`${pkgName}/package.json`, resolveOptions);
1514
+ return {
1515
+ pkgJsonPath,
1516
+ pkgJson: JSON.parse(await readFile(pkgJsonPath, "utf-8")),
1517
+ pkgPath: dirname(pkgJsonPath)
1518
+ };
1519
+ } catch (_) {
1520
+ return null;
1521
+ }
1522
+ }
1523
+ async function resolveIdClassic({ importSpecifier, packageInfoCache, extensions, mainFields, preserveSymlinks, useBrowserOverrides, baseDir, moduleDirectories, modulePaths, rootDir, ignoreSideEffectsForRoot }) {
1524
+ let hasModuleSideEffects = () => null;
1525
+ let hasPackageEntry = true;
1526
+ let packageBrowserField = false;
1527
+ let packageInfo;
1528
+ const filter = (pkg, pkgPath) => {
1529
+ const info = getPackageInfo({
1530
+ cache: packageInfoCache,
1531
+ extensions,
1532
+ pkg,
1533
+ pkgPath,
1534
+ mainFields,
1535
+ preserveSymlinks,
1536
+ useBrowserOverrides,
1537
+ rootDir,
1538
+ ignoreSideEffectsForRoot
1539
+ });
1540
+ ({packageInfo, hasModuleSideEffects, hasPackageEntry, packageBrowserField} = info);
1541
+ return info.cachedPkg;
1542
+ };
1543
+ const resolveOptions = {
1544
+ basedir: baseDir,
1545
+ readFile: readCachedFile,
1546
+ isFile: isFileCached,
1547
+ isDirectory: isDirCached,
1548
+ extensions,
1549
+ includeCoreModules: false,
1550
+ moduleDirectory: moduleDirectories,
1551
+ paths: modulePaths,
1552
+ preserveSymlinks,
1553
+ packageFilter: filter
1554
+ };
1555
+ let location;
1556
+ try {
1557
+ location = await resolveImportPath(importSpecifier, resolveOptions);
1558
+ } catch (error) {
1559
+ if (error.code !== "MODULE_NOT_FOUND") throw error;
1560
+ return null;
1561
+ }
1562
+ return {
1563
+ location: preserveSymlinks ? location : await resolveSymlink(location),
1564
+ hasModuleSideEffects,
1565
+ hasPackageEntry,
1566
+ packageBrowserField,
1567
+ packageInfo
1568
+ };
1569
+ }
1570
+ async function resolveWithExportMap({ importer, importSpecifier, exportConditions, packageInfoCache, extensions, mainFields, preserveSymlinks, useBrowserOverrides, baseDir, moduleDirectories, modulePaths, rootDir, ignoreSideEffectsForRoot, allowExportsFolderMapping }) {
1571
+ if (importSpecifier.startsWith("#")) {
1572
+ const resolveResult = await resolvePackageImports({
1573
+ importSpecifier,
1574
+ importer,
1575
+ moduleDirs: moduleDirectories,
1576
+ conditions: exportConditions,
1577
+ resolveId(id) {
1578
+ return resolveImportSpecifiers({
1579
+ importer,
1580
+ importSpecifierList: [id],
1581
+ exportConditions,
1582
+ packageInfoCache,
1583
+ extensions,
1584
+ mainFields,
1585
+ preserveSymlinks,
1586
+ useBrowserOverrides,
1587
+ baseDir,
1588
+ moduleDirectories,
1589
+ modulePaths,
1590
+ rootDir,
1591
+ ignoreSideEffectsForRoot,
1592
+ allowExportsFolderMapping
1593
+ });
1594
+ }
1595
+ });
1596
+ if (resolveResult == null) throw new ResolveError(`Could not resolve import "${importSpecifier}" in ${importer} using imports.`);
1597
+ const location = fileURLToPath(resolveResult);
1598
+ return {
1599
+ location: preserveSymlinks ? location : await resolveSymlink(location),
1600
+ hasModuleSideEffects: () => null,
1601
+ hasPackageEntry: true,
1602
+ packageBrowserField: false,
1603
+ packageInfo: void 0
1604
+ };
1605
+ }
1606
+ const pkgName = getPackageName(importSpecifier);
1607
+ if (pkgName) {
1608
+ let hasModuleSideEffects = () => null;
1609
+ let hasPackageEntry = true;
1610
+ let packageBrowserField = false;
1611
+ let packageInfo;
1612
+ const filter = (pkg, pkgPath) => {
1613
+ const info = getPackageInfo({
1614
+ cache: packageInfoCache,
1615
+ extensions,
1616
+ pkg,
1617
+ pkgPath,
1618
+ mainFields,
1619
+ preserveSymlinks,
1620
+ useBrowserOverrides,
1621
+ rootDir,
1622
+ ignoreSideEffectsForRoot
1623
+ });
1624
+ ({packageInfo, hasModuleSideEffects, hasPackageEntry, packageBrowserField} = info);
1625
+ return info.cachedPkg;
1626
+ };
1627
+ const result = await getPackageJson(importer, pkgName, {
1628
+ basedir: baseDir,
1629
+ readFile: readCachedFile,
1630
+ isFile: isFileCached,
1631
+ isDirectory: isDirCached,
1632
+ extensions,
1633
+ includeCoreModules: false,
1634
+ moduleDirectory: moduleDirectories,
1635
+ paths: modulePaths,
1636
+ preserveSymlinks,
1637
+ packageFilter: filter
1638
+ }, moduleDirectories);
1639
+ if (result && result.pkgJson.exports) {
1640
+ const { pkgJson, pkgJsonPath } = result;
1641
+ const subpath = pkgName === importSpecifier ? "." : `.${importSpecifier.substring(pkgName.length)}`;
1642
+ const location = fileURLToPath(await resolvePackageExports({
1643
+ importer,
1644
+ importSpecifier,
1645
+ moduleDirs: moduleDirectories,
1646
+ pkgURL: pathToFileURL(pkgJsonPath.replace("package.json", "")),
1647
+ pkgJsonPath,
1648
+ allowExportsFolderMapping,
1649
+ conditions: exportConditions
1650
+ }, subpath, pkgJson.exports));
1651
+ if (location) return {
1652
+ location: preserveSymlinks ? location : await resolveSymlink(location),
1653
+ hasModuleSideEffects,
1654
+ hasPackageEntry,
1655
+ packageBrowserField,
1656
+ packageInfo
1657
+ };
1658
+ }
1659
+ }
1660
+ return null;
1661
+ }
1662
+ async function resolveWithClassic({ importer, importSpecifierList, exportConditions, warn, packageInfoCache, extensions, mainFields, preserveSymlinks, useBrowserOverrides, baseDir, moduleDirectories, modulePaths, rootDir, ignoreSideEffectsForRoot }) {
1663
+ for (let i = 0; i < importSpecifierList.length; i++) {
1664
+ const result = await resolveIdClassic({
1665
+ importer,
1666
+ importSpecifier: importSpecifierList[i],
1667
+ exportConditions,
1668
+ warn,
1669
+ packageInfoCache,
1670
+ extensions,
1671
+ mainFields,
1672
+ preserveSymlinks,
1673
+ useBrowserOverrides,
1674
+ baseDir,
1675
+ moduleDirectories,
1676
+ modulePaths,
1677
+ rootDir,
1678
+ ignoreSideEffectsForRoot
1679
+ });
1680
+ if (result) return result;
1681
+ }
1682
+ return null;
1683
+ }
1684
+ async function resolveImportSpecifiers({ importer, importSpecifierList, exportConditions, warn, packageInfoCache, extensions, mainFields, preserveSymlinks, useBrowserOverrides, baseDir, moduleDirectories, modulePaths, rootDir, ignoreSideEffectsForRoot, allowExportsFolderMapping }) {
1685
+ try {
1686
+ const exportMapRes = await resolveWithExportMap({
1687
+ importer,
1688
+ importSpecifier: importSpecifierList[0],
1689
+ exportConditions,
1690
+ packageInfoCache,
1691
+ extensions,
1692
+ mainFields,
1693
+ preserveSymlinks,
1694
+ useBrowserOverrides,
1695
+ baseDir,
1696
+ moduleDirectories,
1697
+ modulePaths,
1698
+ rootDir,
1699
+ ignoreSideEffectsForRoot,
1700
+ allowExportsFolderMapping
1701
+ });
1702
+ if (exportMapRes) return exportMapRes;
1703
+ } catch (error) {
1704
+ if (error instanceof ResolveError) {
1705
+ warn(error);
1706
+ return null;
1707
+ }
1708
+ throw error;
1709
+ }
1710
+ return resolveWithClassic({
1711
+ importer,
1712
+ importSpecifierList,
1713
+ exportConditions,
1714
+ warn,
1715
+ packageInfoCache,
1716
+ extensions,
1717
+ mainFields,
1718
+ preserveSymlinks,
1719
+ useBrowserOverrides,
1720
+ baseDir,
1721
+ moduleDirectories,
1722
+ modulePaths,
1723
+ rootDir,
1724
+ ignoreSideEffectsForRoot
1725
+ });
1726
+ }
1727
+ const versionRegexp = /\^(\d+\.\d+\.\d+)/g;
1728
+ function validateVersion(actualVersion, peerDependencyVersion) {
1729
+ let minMajor = Infinity;
1730
+ let minMinor = Infinity;
1731
+ let minPatch = Infinity;
1732
+ let foundVersion;
1733
+ while (foundVersion = versionRegexp.exec(peerDependencyVersion)) {
1734
+ const [foundMajor, foundMinor, foundPatch] = foundVersion[1].split(".").map(Number);
1735
+ if (foundMajor < minMajor) {
1736
+ minMajor = foundMajor;
1737
+ minMinor = foundMinor;
1738
+ minPatch = foundPatch;
1739
+ }
1740
+ }
1741
+ if (!actualVersion) throw new Error(`Insufficient Rollup version: "@rollup/plugin-node-resolve" requires at least rollup@${minMajor}.${minMinor}.${minPatch}.`);
1742
+ const [major, minor, patch] = actualVersion.split(".").map(Number);
1743
+ if (major < minMajor || major === minMajor && (minor < minMinor || minor === minMinor && patch < minPatch)) throw new Error(`Insufficient rollup version: "@rollup/plugin-node-resolve" requires at least rollup@${minMajor}.${minMinor}.${minPatch} but found rollup@${actualVersion}.`);
1744
+ }
1745
+ const ES6_BROWSER_EMPTY = "\0node-resolve:empty.js";
1746
+ const deepFreeze = (object) => {
1747
+ Object.freeze(object);
1748
+ for (const value of Object.values(object)) if (typeof value === "object" && !Object.isFrozen(value)) deepFreeze(value);
1749
+ return object;
1750
+ };
1751
+ const baseConditions = ["default", "module"];
1752
+ const baseConditionsEsm = [...baseConditions, "import"];
1753
+ const baseConditionsCjs = [...baseConditions, "require"];
1754
+ const defaults = {
1755
+ dedupe: [],
1756
+ extensions: [
1757
+ ".mjs",
1758
+ ".js",
1759
+ ".json",
1760
+ ".node"
1761
+ ],
1762
+ resolveOnly: [],
1763
+ moduleDirectories: ["node_modules"],
1764
+ modulePaths: [],
1765
+ ignoreSideEffectsForRoot: false,
1766
+ allowExportsFolderMapping: true
1767
+ };
1768
+ const nodeImportPrefix = /^node:/;
1769
+ const DEFAULTS = deepFreeze((0, import_cjs.default)({}, defaults));
1770
+ function nodeResolve(opts = {}) {
1771
+ const { warnings } = handleDeprecatedOptions(opts);
1772
+ const options = {
1773
+ ...defaults,
1774
+ ...opts
1775
+ };
1776
+ const { extensions, jail, moduleDirectories, modulePaths, ignoreSideEffectsForRoot } = options;
1777
+ const exportConditions = options.exportConditions || [];
1778
+ const devProdCondition = exportConditions.includes("development") || exportConditions.includes("production") ? [] : [process.env.NODE_ENV && process.env.NODE_ENV !== "production" ? "development" : "production"];
1779
+ const conditionsEsm = [
1780
+ ...baseConditionsEsm,
1781
+ ...exportConditions,
1782
+ ...devProdCondition
1783
+ ];
1784
+ const conditionsCjs = [
1785
+ ...baseConditionsCjs,
1786
+ ...exportConditions,
1787
+ ...devProdCondition
1788
+ ];
1789
+ const packageInfoCache = /* @__PURE__ */ new Map();
1790
+ const idToPackageInfo = /* @__PURE__ */ new Map();
1791
+ const mainFields = getMainFields(options);
1792
+ const useBrowserOverrides = mainFields.indexOf("browser") !== -1;
1793
+ const isPreferBuiltinsSet = Object.prototype.hasOwnProperty.call(options, "preferBuiltins");
1794
+ const preferBuiltins = isPreferBuiltinsSet ? options.preferBuiltins : true;
1795
+ const rootDir = resolve(options.rootDir || process.cwd());
1796
+ let { dedupe } = options;
1797
+ let rollupOptions;
1798
+ if (moduleDirectories.some((name) => name.includes("/"))) throw new Error("`moduleDirectories` option must only contain directory names. If you want to load modules from somewhere not supported by the default module resolution algorithm, see `modulePaths`.");
1799
+ if (typeof dedupe !== "function") dedupe = (importee) => options.dedupe.includes(importee) || options.dedupe.includes(getPackageName(importee));
1800
+ const allowPatterns = (patterns) => {
1801
+ const regexPatterns = patterns.map((pattern) => {
1802
+ if (pattern instanceof RegExp) return pattern;
1803
+ const normalized = pattern.replace(/[\\^$*+?.()|[\]{}]/g, "\\$&");
1804
+ return /* @__PURE__ */ new RegExp(`^${normalized}$`);
1805
+ });
1806
+ return (id) => !regexPatterns.length || regexPatterns.some((pattern) => pattern.test(id));
1807
+ };
1808
+ const resolveOnly = typeof options.resolveOnly === "function" ? options.resolveOnly : allowPatterns(options.resolveOnly);
1809
+ const browserMapCache = /* @__PURE__ */ new Map();
1810
+ let preserveSymlinks;
1811
+ const resolveLikeNode = async (context, importee, importer, custom) => {
1812
+ const [importPath, params] = importee.split("?");
1813
+ const importSuffix = `${params ? `?${params}` : ""}`;
1814
+ importee = importPath;
1815
+ const baseDir = !importer || dedupe(importee) ? rootDir : dirname(importer);
1816
+ const browser = browserMapCache.get(importer);
1817
+ if (useBrowserOverrides && browser) {
1818
+ const resolvedImportee = resolve(baseDir, importee);
1819
+ if (browser[importee] === false || browser[resolvedImportee] === false) return { id: ES6_BROWSER_EMPTY };
1820
+ const browserImportee = importee[0] !== "." && browser[importee] || browser[resolvedImportee] || browser[`${resolvedImportee}.js`] || browser[`${resolvedImportee}.json`];
1821
+ if (browserImportee) importee = browserImportee;
1822
+ }
1823
+ const parts = importee.split(/[/\\]/);
1824
+ let id = parts.shift();
1825
+ let isRelativeImport = false;
1826
+ if (id[0] === "@" && parts.length > 0) id += `/${parts.shift()}`;
1827
+ else if (id[0] === ".") {
1828
+ id = resolve(baseDir, importee);
1829
+ isRelativeImport = true;
1830
+ }
1831
+ if (!isRelativeImport && !resolveOnly(id)) {
1832
+ if (normalizeInput(rollupOptions.input).includes(importee)) return null;
1833
+ return false;
1834
+ }
1835
+ const importSpecifierList = [importee];
1836
+ if (importer === void 0 && importee[0] && !importee[0].match(/^\.?\.?\//)) importSpecifierList.push(`./${importee}`);
1837
+ if (importer && /\.(ts|mts|cts|tsx)$/.test(importer)) {
1838
+ for (const [importeeExt, resolvedExt] of [
1839
+ [".js", ".ts"],
1840
+ [".js", ".tsx"],
1841
+ [".jsx", ".tsx"],
1842
+ [".mjs", ".mts"],
1843
+ [".cjs", ".cts"]
1844
+ ]) if (importee.endsWith(importeeExt) && extensions.includes(resolvedExt)) importSpecifierList.push(importee.slice(0, -importeeExt.length) + resolvedExt);
1845
+ }
1846
+ const warn = (...args) => context.warn(...args);
1847
+ const exportConditions$1 = custom && custom["node-resolve"] && custom["node-resolve"].isRequire ? conditionsCjs : conditionsEsm;
1848
+ if (useBrowserOverrides && !exportConditions$1.includes("browser")) exportConditions$1.push("browser");
1849
+ const resolvedWithoutBuiltins = await resolveImportSpecifiers({
1850
+ importer,
1851
+ importSpecifierList,
1852
+ exportConditions: exportConditions$1,
1853
+ warn,
1854
+ packageInfoCache,
1855
+ extensions,
1856
+ mainFields,
1857
+ preserveSymlinks,
1858
+ useBrowserOverrides,
1859
+ baseDir,
1860
+ moduleDirectories,
1861
+ modulePaths,
1862
+ rootDir,
1863
+ ignoreSideEffectsForRoot,
1864
+ allowExportsFolderMapping: options.allowExportsFolderMapping
1865
+ });
1866
+ const importeeIsBuiltin = builtinModules.includes(importee.replace(nodeImportPrefix, ""));
1867
+ const preferImporteeIsBuiltin = typeof preferBuiltins === "function" ? preferBuiltins(importee) : preferBuiltins;
1868
+ const resolved = importeeIsBuiltin && preferImporteeIsBuiltin ? {
1869
+ packageInfo: void 0,
1870
+ hasModuleSideEffects: () => null,
1871
+ hasPackageEntry: true,
1872
+ packageBrowserField: false
1873
+ } : resolvedWithoutBuiltins;
1874
+ if (!resolved) return null;
1875
+ const { packageInfo, hasModuleSideEffects, hasPackageEntry, packageBrowserField } = resolved;
1876
+ let { location } = resolved;
1877
+ if (packageBrowserField) {
1878
+ if (Object.prototype.hasOwnProperty.call(packageBrowserField, location)) {
1879
+ if (!packageBrowserField[location]) {
1880
+ browserMapCache.set(location, packageBrowserField);
1881
+ return { id: ES6_BROWSER_EMPTY };
1882
+ }
1883
+ location = packageBrowserField[location];
1884
+ }
1885
+ browserMapCache.set(location, packageBrowserField);
1886
+ }
1887
+ if (hasPackageEntry && !preserveSymlinks) {
1888
+ if (await fileExists(location)) location = await realpath(location);
1889
+ }
1890
+ idToPackageInfo.set(location, packageInfo);
1891
+ if (hasPackageEntry) {
1892
+ if (importeeIsBuiltin && preferImporteeIsBuiltin) {
1893
+ if (!isPreferBuiltinsSet && resolvedWithoutBuiltins && resolved !== importee) context.warn({
1894
+ message: `preferring built-in module '${importee}' over local alternative at '${resolvedWithoutBuiltins.location}', pass 'preferBuiltins: false' to disable this behavior or 'preferBuiltins: true' to disable this warning.or passing a function to 'preferBuiltins' to provide more fine-grained control over which built-in modules to prefer.`,
1895
+ pluginCode: "PREFER_BUILTINS"
1896
+ });
1897
+ return false;
1898
+ } else if (jail && location.indexOf(normalize(jail.trim(sep))) !== 0) return null;
1899
+ }
1900
+ if (options.modulesOnly && await fileExists(location)) {
1901
+ if ((0, import_is_module.default)(await readFile$1(location, "utf-8"))) return {
1902
+ id: `${location}${importSuffix}`,
1903
+ moduleSideEffects: hasModuleSideEffects(location)
1904
+ };
1905
+ return null;
1906
+ }
1907
+ return {
1908
+ id: `${location}${importSuffix}`,
1909
+ moduleSideEffects: hasModuleSideEffects(location)
1910
+ };
1911
+ };
1912
+ return {
1913
+ name: "node-resolve",
1914
+ version,
1915
+ buildStart(buildOptions) {
1916
+ validateVersion(this.meta.rollupVersion, peerDependencies.rollup);
1917
+ rollupOptions = buildOptions;
1918
+ for (const warning of warnings) this.warn(warning);
1919
+ ({preserveSymlinks} = buildOptions);
1920
+ },
1921
+ generateBundle() {
1922
+ readCachedFile.clear();
1923
+ isFileCached.clear();
1924
+ isDirCached.clear();
1925
+ },
1926
+ resolveId: {
1927
+ order: "post",
1928
+ async handler(importee, importer, resolveOptions) {
1929
+ if (importee === ES6_BROWSER_EMPTY) return importee;
1930
+ if (importee && importee.includes("\0")) return null;
1931
+ const { custom = {} } = resolveOptions;
1932
+ const { "node-resolve": { resolved: alreadyResolved } = {} } = custom;
1933
+ if (alreadyResolved) return alreadyResolved;
1934
+ if (importer && importer.includes("\0")) importer = void 0;
1935
+ const resolved = await resolveLikeNode(this, importee, importer, custom);
1936
+ if (resolved) {
1937
+ const resolvedResolved = await this.resolve(resolved.id, importer, {
1938
+ ...resolveOptions,
1939
+ skipSelf: false,
1940
+ custom: {
1941
+ ...custom,
1942
+ "node-resolve": {
1943
+ ...custom["node-resolve"],
1944
+ resolved,
1945
+ importee
1946
+ }
1947
+ }
1948
+ });
1949
+ if (resolvedResolved) {
1950
+ if (resolvedResolved.external) return false;
1951
+ if (resolvedResolved.id !== resolved.id) return resolvedResolved;
1952
+ return {
1953
+ ...resolved,
1954
+ meta: resolvedResolved.meta
1955
+ };
1956
+ }
1957
+ }
1958
+ return resolved;
1959
+ }
1960
+ },
1961
+ load(importee) {
1962
+ if (importee === ES6_BROWSER_EMPTY) return "export default {};";
1963
+ return null;
1964
+ },
1965
+ getPackageInfoForId(id) {
1966
+ return idToPackageInfo.get(id);
1967
+ }
1968
+ };
1969
+ }
1970
+
1971
+ //#endregion
1972
+ export { nodeResolve as t };