nitro-nightly 3.0.1-20260120-020848-6786d069 → 3.0.1-20260120-133205-cbfce96c

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 (92) 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/@hiogawa/vite-plugin-fullstack.mjs +652 -0
  11. package/dist/_libs/@jridgewell/gen-mapping.mjs +448 -0
  12. package/dist/_libs/@jridgewell/remapping.mjs +117 -0
  13. package/dist/_libs/@rollup/plugin-alias.mjs +64 -0
  14. package/dist/_libs/@rollup/plugin-commonjs.d.mts +241 -0
  15. package/dist/_libs/@rollup/plugin-commonjs.mjs +1300 -0
  16. package/dist/_libs/{plugin-alias+plugin-inject.mjs → @rollup/plugin-inject.mjs} +2 -65
  17. package/dist/_libs/@rollup/plugin-json.mjs +36 -0
  18. package/dist/_libs/@rollup/plugin-node-resolve.mjs +1972 -0
  19. package/dist/_libs/c12.d.mts +214 -0
  20. package/dist/_libs/{c12+dotenv+rc9.mjs → c12.mjs} +105 -12
  21. package/dist/_libs/{chokidar+readdirp.mjs → chokidar.mjs} +8 -1
  22. package/dist/_libs/compatx.d.mts +47 -0
  23. package/dist/_libs/confbox.mjs +2488 -70
  24. package/dist/_libs/esbuild.d.mts +20 -0
  25. package/dist/_libs/escape-string-regexp.mjs +8 -0
  26. package/dist/_libs/estree-walker.mjs +187 -0
  27. package/dist/_libs/giget.mjs +3550 -0
  28. package/dist/_libs/httpxy.d.mts +79 -0
  29. package/dist/_libs/httpxy.mjs +6 -1
  30. package/dist/_libs/klona.mjs +38 -0
  31. package/dist/_libs/magic-string.d.mts +220 -0
  32. package/dist/_libs/mlly.d.mts +57 -0
  33. package/dist/_libs/pkg-types.d.mts +23 -0
  34. package/dist/_libs/rou3.d.mts +43 -0
  35. package/dist/_libs/rou3.mjs +322 -0
  36. package/dist/_libs/std-env.d.mts +4 -0
  37. package/dist/_libs/tsconfck.mjs +832 -0
  38. package/dist/_libs/ultrahtml.mjs +138 -0
  39. package/dist/_libs/unimport.d.mts +426 -0
  40. package/dist/_libs/unimport.mjs +1781 -5
  41. package/dist/_libs/unwasm.d.mts +29 -0
  42. package/dist/_presets.mjs +3 -8
  43. package/dist/builder.mjs +6 -8
  44. package/dist/cli/_chunks/build.mjs +1 -1
  45. package/dist/cli/_chunks/dev.mjs +2 -3
  46. package/dist/cli/_chunks/list.mjs +1 -1
  47. package/dist/cli/_chunks/prepare.mjs +1 -1
  48. package/dist/cli/_chunks/run.mjs +1 -1
  49. package/dist/cli/_chunks/task.mjs +16 -0
  50. package/dist/cli/index.mjs +1 -1
  51. package/dist/presets/aws-lambda/runtime/_utils.d.mts +0 -5
  52. package/dist/presets/netlify/runtime/netlify-edge.d.mts +0 -1
  53. package/dist/presets/winterjs/runtime/winterjs.d.mts +0 -1
  54. package/dist/runtime/internal/error/dev.d.mts +0 -1
  55. package/dist/runtime/internal/route-rules.d.mts +0 -4
  56. package/dist/runtime/internal/routes/openapi.d.mts +0 -1
  57. package/dist/runtime/internal/routes/scalar.d.mts +0 -1
  58. package/dist/runtime/internal/routes/swagger.d.mts +0 -1
  59. package/dist/runtime/internal/runtime-config.d.mts +0 -1
  60. package/dist/runtime/nitro.d.mts +0 -3
  61. package/dist/runtime/virtual/renderer-template.d.mts +0 -1
  62. package/dist/types/index.d.mts +36 -1405
  63. package/dist/vite.mjs +18 -641
  64. package/package.json +2 -2
  65. package/dist/_chunks/nitro3.mjs +0 -2696
  66. package/dist/_chunks/nitro4.mjs +0 -176
  67. package/dist/_chunks/nitro5.mjs +0 -733
  68. package/dist/_chunks/nitro6.mjs +0 -1458
  69. package/dist/_chunks/nitro7.mjs +0 -7561
  70. package/dist/_chunks/nitro8.mjs +0 -3524
  71. package/dist/_chunks/nitro9.mjs +0 -1729
  72. package/dist/_libs/_.mjs +0 -3
  73. package/dist/_libs/_2.mjs +0 -3
  74. package/dist/_libs/_3.mjs +0 -4
  75. package/dist/_libs/_4.mjs +0 -6
  76. package/dist/_libs/_5.mjs +0 -3
  77. package/dist/_libs/_6.mjs +0 -3
  78. package/dist/_libs/acorn+confbox+js-tokens+magic-string+mlly+pkg-types+sourcemap-codec+strip-literal+unimport.mjs +0 -8900
  79. package/dist/_libs/confbox+exsolve+pkg-types.mjs +0 -1249
  80. package/dist/_libs/confbox2.mjs +0 -786
  81. package/dist/_libs/confbox3.mjs +0 -404
  82. package/dist/_libs/confbox4.mjs +0 -3
  83. package/dist/_libs/estree-walker+unimport.mjs +0 -378
  84. package/dist/_libs/fdir+picomatch+tinyglobby.mjs +0 -2471
  85. package/dist/_libs/gen-mapping+remapping+resolve-uri+trace-mapping+unimport+unplugin+unplugin-utils+webpack-virtual-modules.mjs +0 -2150
  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/vite-plugin-fullstack.mjs +0 -26
@@ -0,0 +1,448 @@
1
+ import { C as decode, w as encode } from "../../_build/common.mjs";
2
+
3
+ //#region node_modules/.pnpm/@jridgewell+resolve-uri@3.1.2/node_modules/@jridgewell/resolve-uri/dist/resolve-uri.mjs
4
+ const schemeRegex = /^[\w+.-]+:\/\//;
5
+ /**
6
+ * Matches the parts of a URL:
7
+ * 1. Scheme, including ":", guaranteed.
8
+ * 2. User/password, including "@", optional.
9
+ * 3. Host, guaranteed.
10
+ * 4. Port, including ":", optional.
11
+ * 5. Path, including "/", optional.
12
+ * 6. Query, including "?", optional.
13
+ * 7. Hash, including "#", optional.
14
+ */
15
+ const urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/;
16
+ /**
17
+ * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start
18
+ * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive).
19
+ *
20
+ * 1. Host, optional.
21
+ * 2. Path, which may include "/", guaranteed.
22
+ * 3. Query, including "?", optional.
23
+ * 4. Hash, including "#", optional.
24
+ */
25
+ const fileRegex = /^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i;
26
+ function isAbsoluteUrl(input) {
27
+ return schemeRegex.test(input);
28
+ }
29
+ function isSchemeRelativeUrl(input) {
30
+ return input.startsWith("//");
31
+ }
32
+ function isAbsolutePath(input) {
33
+ return input.startsWith("/");
34
+ }
35
+ function isFileUrl(input) {
36
+ return input.startsWith("file:");
37
+ }
38
+ function isRelative(input) {
39
+ return /^[.?#]/.test(input);
40
+ }
41
+ function parseAbsoluteUrl(input) {
42
+ const match = urlRegex.exec(input);
43
+ return makeUrl(match[1], match[2] || "", match[3], match[4] || "", match[5] || "/", match[6] || "", match[7] || "");
44
+ }
45
+ function parseFileUrl(input) {
46
+ const match = fileRegex.exec(input);
47
+ const path = match[2];
48
+ return makeUrl("file:", "", match[1] || "", "", isAbsolutePath(path) ? path : "/" + path, match[3] || "", match[4] || "");
49
+ }
50
+ function makeUrl(scheme, user, host, port, path, query, hash) {
51
+ return {
52
+ scheme,
53
+ user,
54
+ host,
55
+ port,
56
+ path,
57
+ query,
58
+ hash,
59
+ type: 7
60
+ };
61
+ }
62
+ function parseUrl(input) {
63
+ if (isSchemeRelativeUrl(input)) {
64
+ const url$1 = parseAbsoluteUrl("http:" + input);
65
+ url$1.scheme = "";
66
+ url$1.type = 6;
67
+ return url$1;
68
+ }
69
+ if (isAbsolutePath(input)) {
70
+ const url$1 = parseAbsoluteUrl("http://foo.com" + input);
71
+ url$1.scheme = "";
72
+ url$1.host = "";
73
+ url$1.type = 5;
74
+ return url$1;
75
+ }
76
+ if (isFileUrl(input)) return parseFileUrl(input);
77
+ if (isAbsoluteUrl(input)) return parseAbsoluteUrl(input);
78
+ const url = parseAbsoluteUrl("http://foo.com/" + input);
79
+ url.scheme = "";
80
+ url.host = "";
81
+ url.type = input ? input.startsWith("?") ? 3 : input.startsWith("#") ? 2 : 4 : 1;
82
+ return url;
83
+ }
84
+ function stripPathFilename(path) {
85
+ if (path.endsWith("/..")) return path;
86
+ const index = path.lastIndexOf("/");
87
+ return path.slice(0, index + 1);
88
+ }
89
+ function mergePaths(url, base) {
90
+ normalizePath(base, base.type);
91
+ if (url.path === "/") url.path = base.path;
92
+ else url.path = stripPathFilename(base.path) + url.path;
93
+ }
94
+ /**
95
+ * The path can have empty directories "//", unneeded parents "foo/..", or current directory
96
+ * "foo/.". We need to normalize to a standard representation.
97
+ */
98
+ function normalizePath(url, type) {
99
+ const rel = type <= 4;
100
+ const pieces = url.path.split("/");
101
+ let pointer = 1;
102
+ let positive = 0;
103
+ let addTrailingSlash = false;
104
+ for (let i = 1; i < pieces.length; i++) {
105
+ const piece = pieces[i];
106
+ if (!piece) {
107
+ addTrailingSlash = true;
108
+ continue;
109
+ }
110
+ addTrailingSlash = false;
111
+ if (piece === ".") continue;
112
+ if (piece === "..") {
113
+ if (positive) {
114
+ addTrailingSlash = true;
115
+ positive--;
116
+ pointer--;
117
+ } else if (rel) pieces[pointer++] = piece;
118
+ continue;
119
+ }
120
+ pieces[pointer++] = piece;
121
+ positive++;
122
+ }
123
+ let path = "";
124
+ for (let i = 1; i < pointer; i++) path += "/" + pieces[i];
125
+ if (!path || addTrailingSlash && !path.endsWith("/..")) path += "/";
126
+ url.path = path;
127
+ }
128
+ /**
129
+ * Attempts to resolve `input` URL/path relative to `base`.
130
+ */
131
+ function resolve(input, base) {
132
+ if (!input && !base) return "";
133
+ const url = parseUrl(input);
134
+ let inputType = url.type;
135
+ if (base && inputType !== 7) {
136
+ const baseUrl = parseUrl(base);
137
+ const baseType = baseUrl.type;
138
+ switch (inputType) {
139
+ case 1: url.hash = baseUrl.hash;
140
+ case 2: url.query = baseUrl.query;
141
+ case 3:
142
+ case 4: mergePaths(url, baseUrl);
143
+ case 5:
144
+ url.user = baseUrl.user;
145
+ url.host = baseUrl.host;
146
+ url.port = baseUrl.port;
147
+ case 6: url.scheme = baseUrl.scheme;
148
+ }
149
+ if (baseType > inputType) inputType = baseType;
150
+ }
151
+ normalizePath(url, inputType);
152
+ const queryHash = url.query + url.hash;
153
+ switch (inputType) {
154
+ case 2:
155
+ case 3: return queryHash;
156
+ case 4: {
157
+ const path = url.path.slice(1);
158
+ if (!path) return queryHash || ".";
159
+ if (isRelative(base || input) && !isRelative(path)) return "./" + path + queryHash;
160
+ return path + queryHash;
161
+ }
162
+ case 5: return url.path + queryHash;
163
+ default: return url.scheme + "//" + url.user + url.host + url.port + url.path + queryHash;
164
+ }
165
+ }
166
+
167
+ //#endregion
168
+ //#region node_modules/.pnpm/@jridgewell+trace-mapping@0.3.31/node_modules/@jridgewell/trace-mapping/dist/trace-mapping.mjs
169
+ function stripFilename(path) {
170
+ if (!path) return "";
171
+ const index = path.lastIndexOf("/");
172
+ return path.slice(0, index + 1);
173
+ }
174
+ function resolver(mapUrl, sourceRoot) {
175
+ const from = stripFilename(mapUrl);
176
+ const prefix = sourceRoot ? sourceRoot + "/" : "";
177
+ return (source) => resolve(prefix + (source || ""), from);
178
+ }
179
+ var COLUMN$1 = 0;
180
+ function maybeSort(mappings, owned) {
181
+ const unsortedIndex = nextUnsortedSegmentLine(mappings, 0);
182
+ if (unsortedIndex === mappings.length) return mappings;
183
+ if (!owned) mappings = mappings.slice();
184
+ for (let i = unsortedIndex; i < mappings.length; i = nextUnsortedSegmentLine(mappings, i + 1)) mappings[i] = sortSegments(mappings[i], owned);
185
+ return mappings;
186
+ }
187
+ function nextUnsortedSegmentLine(mappings, start) {
188
+ for (let i = start; i < mappings.length; i++) if (!isSorted(mappings[i])) return i;
189
+ return mappings.length;
190
+ }
191
+ function isSorted(line) {
192
+ for (let j = 1; j < line.length; j++) if (line[j][COLUMN$1] < line[j - 1][COLUMN$1]) return false;
193
+ return true;
194
+ }
195
+ function sortSegments(line, owned) {
196
+ if (!owned) line = line.slice();
197
+ return line.sort(sortComparator);
198
+ }
199
+ function sortComparator(a, b) {
200
+ return a[COLUMN$1] - b[COLUMN$1];
201
+ }
202
+ var found = false;
203
+ function binarySearch(haystack, needle, low, high) {
204
+ while (low <= high) {
205
+ const mid = low + (high - low >> 1);
206
+ const cmp = haystack[mid][COLUMN$1] - needle;
207
+ if (cmp === 0) {
208
+ found = true;
209
+ return mid;
210
+ }
211
+ if (cmp < 0) low = mid + 1;
212
+ else high = mid - 1;
213
+ }
214
+ found = false;
215
+ return low - 1;
216
+ }
217
+ function upperBound(haystack, needle, index) {
218
+ for (let i = index + 1; i < haystack.length; index = i++) if (haystack[i][COLUMN$1] !== needle) break;
219
+ return index;
220
+ }
221
+ function lowerBound(haystack, needle, index) {
222
+ for (let i = index - 1; i >= 0; index = i--) if (haystack[i][COLUMN$1] !== needle) break;
223
+ return index;
224
+ }
225
+ function memoizedState() {
226
+ return {
227
+ lastKey: -1,
228
+ lastNeedle: -1,
229
+ lastIndex: -1
230
+ };
231
+ }
232
+ function memoizedBinarySearch(haystack, needle, state, key) {
233
+ const { lastKey, lastNeedle, lastIndex } = state;
234
+ let low = 0;
235
+ let high = haystack.length - 1;
236
+ if (key === lastKey) {
237
+ if (needle === lastNeedle) {
238
+ found = lastIndex !== -1 && haystack[lastIndex][COLUMN$1] === needle;
239
+ return lastIndex;
240
+ }
241
+ if (needle >= lastNeedle) low = lastIndex === -1 ? 0 : lastIndex;
242
+ else high = lastIndex;
243
+ }
244
+ state.lastKey = key;
245
+ state.lastNeedle = needle;
246
+ return state.lastIndex = binarySearch(haystack, needle, low, high);
247
+ }
248
+ function parse(map) {
249
+ return typeof map === "string" ? JSON.parse(map) : map;
250
+ }
251
+ var LEAST_UPPER_BOUND = -1;
252
+ var GREATEST_LOWER_BOUND = 1;
253
+ var TraceMap = class {
254
+ constructor(map, mapUrl) {
255
+ const isString = typeof map === "string";
256
+ if (!isString && map._decodedMemo) return map;
257
+ const parsed = parse(map);
258
+ const { version, file, names, sourceRoot, sources, sourcesContent } = parsed;
259
+ this.version = version;
260
+ this.file = file;
261
+ this.names = names || [];
262
+ this.sourceRoot = sourceRoot;
263
+ this.sources = sources;
264
+ this.sourcesContent = sourcesContent;
265
+ this.ignoreList = parsed.ignoreList || parsed.x_google_ignoreList || void 0;
266
+ const resolve$1 = resolver(mapUrl, sourceRoot);
267
+ this.resolvedSources = sources.map(resolve$1);
268
+ const { mappings } = parsed;
269
+ if (typeof mappings === "string") {
270
+ this._encoded = mappings;
271
+ this._decoded = void 0;
272
+ } else if (Array.isArray(mappings)) {
273
+ this._encoded = void 0;
274
+ this._decoded = maybeSort(mappings, isString);
275
+ } else if (parsed.sections) throw new Error(`TraceMap passed sectioned source map, please use FlattenMap export instead`);
276
+ else throw new Error(`invalid source map: ${JSON.stringify(parsed)}`);
277
+ this._decodedMemo = memoizedState();
278
+ this._bySources = void 0;
279
+ this._bySourceMemos = void 0;
280
+ }
281
+ };
282
+ function cast$1(map) {
283
+ return map;
284
+ }
285
+ function decodedMappings(map) {
286
+ var _a;
287
+ return (_a = cast$1(map))._decoded || (_a._decoded = decode(cast$1(map)._encoded));
288
+ }
289
+ function traceSegment(map, line, column) {
290
+ const decoded = decodedMappings(map);
291
+ if (line >= decoded.length) return null;
292
+ const segments = decoded[line];
293
+ const index = traceSegmentInternal(segments, cast$1(map)._decodedMemo, line, column, GREATEST_LOWER_BOUND);
294
+ return index === -1 ? null : segments[index];
295
+ }
296
+ function traceSegmentInternal(segments, memo, line, column, bias) {
297
+ let index = memoizedBinarySearch(segments, column, memo, line);
298
+ if (found) index = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index);
299
+ else if (bias === LEAST_UPPER_BOUND) index++;
300
+ if (index === -1 || index === segments.length) return -1;
301
+ return index;
302
+ }
303
+
304
+ //#endregion
305
+ //#region node_modules/.pnpm/@jridgewell+gen-mapping@0.3.13/node_modules/@jridgewell/gen-mapping/dist/gen-mapping.mjs
306
+ var SetArray = class {
307
+ constructor() {
308
+ this._indexes = { __proto__: null };
309
+ this.array = [];
310
+ }
311
+ };
312
+ function cast(set) {
313
+ return set;
314
+ }
315
+ function get(setarr, key) {
316
+ return cast(setarr)._indexes[key];
317
+ }
318
+ function put(setarr, key) {
319
+ const index = get(setarr, key);
320
+ if (index !== void 0) return index;
321
+ const { array, _indexes: indexes } = cast(setarr);
322
+ return indexes[key] = array.push(key) - 1;
323
+ }
324
+ function remove(setarr, key) {
325
+ const index = get(setarr, key);
326
+ if (index === void 0) return;
327
+ const { array, _indexes: indexes } = cast(setarr);
328
+ for (let i = index + 1; i < array.length; i++) {
329
+ const k = array[i];
330
+ array[i - 1] = k;
331
+ indexes[k]--;
332
+ }
333
+ indexes[key] = void 0;
334
+ array.pop();
335
+ }
336
+ var COLUMN = 0;
337
+ var SOURCES_INDEX = 1;
338
+ var SOURCE_LINE = 2;
339
+ var SOURCE_COLUMN = 3;
340
+ var NAMES_INDEX = 4;
341
+ var NO_NAME = -1;
342
+ var GenMapping = class {
343
+ constructor({ file, sourceRoot } = {}) {
344
+ this._names = new SetArray();
345
+ this._sources = new SetArray();
346
+ this._sourcesContent = [];
347
+ this._mappings = [];
348
+ this.file = file;
349
+ this.sourceRoot = sourceRoot;
350
+ this._ignoreList = new SetArray();
351
+ }
352
+ };
353
+ function cast2(map) {
354
+ return map;
355
+ }
356
+ var maybeAddSegment = (map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) => {
357
+ return addSegmentInternal(true, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content);
358
+ };
359
+ function setSourceContent(map, source, content) {
360
+ const { _sources: sources, _sourcesContent: sourcesContent } = cast2(map);
361
+ const index = put(sources, source);
362
+ sourcesContent[index] = content;
363
+ }
364
+ function setIgnore(map, source, ignore = true) {
365
+ const { _sources: sources, _sourcesContent: sourcesContent, _ignoreList: ignoreList } = cast2(map);
366
+ const index = put(sources, source);
367
+ if (index === sourcesContent.length) sourcesContent[index] = null;
368
+ if (ignore) put(ignoreList, index);
369
+ else remove(ignoreList, index);
370
+ }
371
+ function toDecodedMap(map) {
372
+ const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names, _ignoreList: ignoreList } = cast2(map);
373
+ removeEmptyFinalLines(mappings);
374
+ return {
375
+ version: 3,
376
+ file: map.file || void 0,
377
+ names: names.array,
378
+ sourceRoot: map.sourceRoot || void 0,
379
+ sources: sources.array,
380
+ sourcesContent,
381
+ mappings,
382
+ ignoreList: ignoreList.array
383
+ };
384
+ }
385
+ function toEncodedMap(map) {
386
+ const decoded = toDecodedMap(map);
387
+ return Object.assign({}, decoded, { mappings: encode(decoded.mappings) });
388
+ }
389
+ function addSegmentInternal(skipable, map, genLine, genColumn, source, sourceLine, sourceColumn, name, content) {
390
+ const { _mappings: mappings, _sources: sources, _sourcesContent: sourcesContent, _names: names } = cast2(map);
391
+ const line = getIndex(mappings, genLine);
392
+ const index = getColumnIndex(line, genColumn);
393
+ if (!source) {
394
+ if (skipable && skipSourceless(line, index)) return;
395
+ return insert(line, index, [genColumn]);
396
+ }
397
+ assert(sourceLine);
398
+ assert(sourceColumn);
399
+ const sourcesIndex = put(sources, source);
400
+ const namesIndex = name ? put(names, name) : NO_NAME;
401
+ if (sourcesIndex === sourcesContent.length) sourcesContent[sourcesIndex] = content != null ? content : null;
402
+ if (skipable && skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex)) return;
403
+ return insert(line, index, name ? [
404
+ genColumn,
405
+ sourcesIndex,
406
+ sourceLine,
407
+ sourceColumn,
408
+ namesIndex
409
+ ] : [
410
+ genColumn,
411
+ sourcesIndex,
412
+ sourceLine,
413
+ sourceColumn
414
+ ]);
415
+ }
416
+ function assert(_val) {}
417
+ function getIndex(arr, index) {
418
+ for (let i = arr.length; i <= index; i++) arr[i] = [];
419
+ return arr[index];
420
+ }
421
+ function getColumnIndex(line, genColumn) {
422
+ let index = line.length;
423
+ for (let i = index - 1; i >= 0; index = i--) if (genColumn >= line[i][COLUMN]) break;
424
+ return index;
425
+ }
426
+ function insert(array, index, value) {
427
+ for (let i = array.length; i > index; i--) array[i] = array[i - 1];
428
+ array[index] = value;
429
+ }
430
+ function removeEmptyFinalLines(mappings) {
431
+ const { length } = mappings;
432
+ let len = length;
433
+ for (let i = len - 1; i >= 0; len = i, i--) if (mappings[i].length > 0) break;
434
+ if (len < length) mappings.length = len;
435
+ }
436
+ function skipSourceless(line, index) {
437
+ if (index === 0) return true;
438
+ return line[index - 1].length === 1;
439
+ }
440
+ function skipSource(line, index, sourcesIndex, sourceLine, sourceColumn, namesIndex) {
441
+ if (index === 0) return false;
442
+ const prev = line[index - 1];
443
+ if (prev.length === 1) return false;
444
+ return sourcesIndex === prev[SOURCES_INDEX] && sourceLine === prev[SOURCE_LINE] && sourceColumn === prev[SOURCE_COLUMN] && namesIndex === (prev.length === 5 ? prev[NAMES_INDEX] : NO_NAME);
445
+ }
446
+
447
+ //#endregion
448
+ export { toDecodedMap as a, decodedMappings as c, setSourceContent as i, traceSegment as l, maybeAddSegment as n, toEncodedMap as o, setIgnore as r, TraceMap as s, GenMapping as t };
@@ -0,0 +1,117 @@
1
+ import { a as toDecodedMap, c as decodedMappings, i as setSourceContent, l as traceSegment, n as maybeAddSegment, o as toEncodedMap, r as setIgnore, s as TraceMap, t as GenMapping } from "./gen-mapping.mjs";
2
+
3
+ //#region node_modules/.pnpm/@jridgewell+remapping@2.3.5/node_modules/@jridgewell/remapping/dist/remapping.mjs
4
+ var SOURCELESS_MAPPING = /* @__PURE__ */ SegmentObject("", -1, -1, "", null, false);
5
+ var EMPTY_SOURCES = [];
6
+ function SegmentObject(source, line, column, name, content, ignore) {
7
+ return {
8
+ source,
9
+ line,
10
+ column,
11
+ name,
12
+ content,
13
+ ignore
14
+ };
15
+ }
16
+ function Source(map, sources, source, content, ignore) {
17
+ return {
18
+ map,
19
+ sources,
20
+ source,
21
+ content,
22
+ ignore
23
+ };
24
+ }
25
+ function MapSource(map, sources) {
26
+ return Source(map, sources, "", null, false);
27
+ }
28
+ function OriginalSource(source, content, ignore) {
29
+ return Source(null, EMPTY_SOURCES, source, content, ignore);
30
+ }
31
+ function traceMappings(tree) {
32
+ const gen = new GenMapping({ file: tree.map.file });
33
+ const { sources: rootSources, map } = tree;
34
+ const rootNames = map.names;
35
+ const rootMappings = decodedMappings(map);
36
+ for (let i = 0; i < rootMappings.length; i++) {
37
+ const segments = rootMappings[i];
38
+ for (let j = 0; j < segments.length; j++) {
39
+ const segment = segments[j];
40
+ const genCol = segment[0];
41
+ let traced = SOURCELESS_MAPPING;
42
+ if (segment.length !== 1) {
43
+ const source2 = rootSources[segment[1]];
44
+ traced = originalPositionFor(source2, segment[2], segment[3], segment.length === 5 ? rootNames[segment[4]] : "");
45
+ if (traced == null) continue;
46
+ }
47
+ const { column, line, name, content, source, ignore } = traced;
48
+ maybeAddSegment(gen, i, genCol, source, line, column, name);
49
+ if (source && content != null) setSourceContent(gen, source, content);
50
+ if (ignore) setIgnore(gen, source, true);
51
+ }
52
+ }
53
+ return gen;
54
+ }
55
+ function originalPositionFor(source, line, column, name) {
56
+ if (!source.map) return SegmentObject(source.source, line, column, name, source.content, source.ignore);
57
+ const segment = traceSegment(source.map, line, column);
58
+ if (segment == null) return null;
59
+ if (segment.length === 1) return SOURCELESS_MAPPING;
60
+ return originalPositionFor(source.sources[segment[1]], segment[2], segment[3], segment.length === 5 ? source.map.names[segment[4]] : name);
61
+ }
62
+ function asArray(value) {
63
+ if (Array.isArray(value)) return value;
64
+ return [value];
65
+ }
66
+ function buildSourceMapTree(input, loader) {
67
+ const maps = asArray(input).map((m) => new TraceMap(m, ""));
68
+ const map = maps.pop();
69
+ for (let i = 0; i < maps.length; i++) if (maps[i].sources.length > 1) throw new Error(`Transformation map ${i} must have exactly one source file.
70
+ Did you specify these with the most recent transformation maps first?`);
71
+ let tree = build(map, loader, "", 0);
72
+ for (let i = maps.length - 1; i >= 0; i--) tree = MapSource(maps[i], [tree]);
73
+ return tree;
74
+ }
75
+ function build(map, loader, importer, importerDepth) {
76
+ const { resolvedSources, sourcesContent, ignoreList } = map;
77
+ const depth = importerDepth + 1;
78
+ return MapSource(map, resolvedSources.map((sourceFile, i) => {
79
+ const ctx = {
80
+ importer,
81
+ depth,
82
+ source: sourceFile || "",
83
+ content: void 0,
84
+ ignore: void 0
85
+ };
86
+ const sourceMap = loader(ctx.source, ctx);
87
+ const { source, content, ignore } = ctx;
88
+ if (sourceMap) return build(new TraceMap(sourceMap, source), loader, source, depth);
89
+ return OriginalSource(source, content !== void 0 ? content : sourcesContent ? sourcesContent[i] : null, ignore !== void 0 ? ignore : ignoreList ? ignoreList.includes(i) : false);
90
+ }));
91
+ }
92
+ var SourceMap = class {
93
+ constructor(map, options) {
94
+ const out = options.decodedMappings ? toDecodedMap(map) : toEncodedMap(map);
95
+ this.version = out.version;
96
+ this.file = out.file;
97
+ this.mappings = out.mappings;
98
+ this.names = out.names;
99
+ this.ignoreList = out.ignoreList;
100
+ this.sourceRoot = out.sourceRoot;
101
+ this.sources = out.sources;
102
+ if (!options.excludeContent) this.sourcesContent = out.sourcesContent;
103
+ }
104
+ toString() {
105
+ return JSON.stringify(this);
106
+ }
107
+ };
108
+ function remapping(input, loader, options) {
109
+ const opts = typeof options === "object" ? options : {
110
+ excludeContent: !!options,
111
+ decodedMappings: false
112
+ };
113
+ return new SourceMap(traceMappings(buildSourceMapTree(input, loader)), opts);
114
+ }
115
+
116
+ //#endregion
117
+ export { remapping as t };
@@ -0,0 +1,64 @@
1
+ import path from "node:path";
2
+
3
+ //#region node_modules/.pnpm/@rollup+plugin-alias@6.0.0_rollup@4.55.2/node_modules/@rollup/plugin-alias/dist/index.js
4
+ function matches(pattern, importee) {
5
+ if (pattern instanceof RegExp) return pattern.test(importee);
6
+ if (importee.length < pattern.length) return false;
7
+ if (importee === pattern) return true;
8
+ return importee.startsWith(pattern + "/");
9
+ }
10
+ function getEntries({ entries, customResolver }) {
11
+ if (!entries) return [];
12
+ const resolverFunctionFromOptions = resolveCustomResolver(customResolver);
13
+ if (Array.isArray(entries)) return entries.map((entry) => {
14
+ return {
15
+ find: entry.find,
16
+ replacement: entry.replacement,
17
+ resolverFunction: resolveCustomResolver(entry.customResolver) || resolverFunctionFromOptions
18
+ };
19
+ });
20
+ return Object.entries(entries).map(([key, value]) => {
21
+ return {
22
+ find: key,
23
+ replacement: value,
24
+ resolverFunction: resolverFunctionFromOptions
25
+ };
26
+ });
27
+ }
28
+ function getHookFunction(hook) {
29
+ if (typeof hook === "function") return hook;
30
+ if (hook && "handler" in hook && typeof hook.handler === "function") return hook.handler;
31
+ return null;
32
+ }
33
+ function resolveCustomResolver(customResolver) {
34
+ if (typeof customResolver === "function") return customResolver;
35
+ if (customResolver) return getHookFunction(customResolver.resolveId);
36
+ return null;
37
+ }
38
+ function alias(options = {}) {
39
+ const entries = getEntries(options);
40
+ if (entries.length === 0) return {
41
+ name: "alias",
42
+ resolveId: () => null
43
+ };
44
+ return {
45
+ name: "alias",
46
+ async buildStart(inputOptions) {
47
+ await Promise.all([...Array.isArray(options.entries) ? options.entries : [], options].map(({ customResolver }) => customResolver && getHookFunction(customResolver.buildStart)?.call(this, inputOptions)));
48
+ },
49
+ resolveId(importee, importer, resolveOptions) {
50
+ const matchedEntry = entries.find((entry) => matches(entry.find, importee));
51
+ if (!matchedEntry) return null;
52
+ const updatedId = importee.replace(matchedEntry.find, matchedEntry.replacement);
53
+ if (matchedEntry.resolverFunction) return matchedEntry.resolverFunction.call(this, updatedId, importer, resolveOptions);
54
+ return this.resolve(updatedId, importer, Object.assign({ skipSelf: true }, resolveOptions)).then((resolved) => {
55
+ if (resolved) return resolved;
56
+ if (!path.isAbsolute(updatedId)) this.warn(`rewrote ${importee} to ${updatedId} but was not an absolute path and was not handled by other plugins. This will lead to duplicated modules for the same path. To avoid duplicating modules, you should resolve to an absolute path.`);
57
+ return { id: updatedId };
58
+ });
59
+ }
60
+ };
61
+ }
62
+
63
+ //#endregion
64
+ export { alias as t };