nitro-nightly 3.0.1-20260106-130706-e20c92d9 → 3.0.1-20260106-202835-5325b208

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 (74) hide show
  1. package/dist/_build/rolldown.mjs +6 -14
  2. package/dist/_build/rollup.mjs +6 -41
  3. package/dist/_build/rollup2.mjs +56 -0
  4. package/dist/_build/shared.mjs +2 -1
  5. package/dist/_build/shared2.mjs +1 -1
  6. package/dist/_build/shared3.mjs +1 -1
  7. package/dist/_build/vite.build.mjs +1 -19
  8. package/dist/_dev.mjs +2 -1
  9. package/dist/_libs/@hiogawa/vite-plugin-fullstack.mjs +5 -1560
  10. package/dist/_libs/@jridgewell/gen-mapping.mjs +2 -304
  11. package/dist/_libs/@jridgewell/remapping.mjs +2 -1
  12. package/dist/_libs/@jridgewell/resolve-uri.mjs +166 -0
  13. package/dist/_libs/@jridgewell/sourcemap-codec.mjs +167 -0
  14. package/dist/_libs/@jridgewell/trace-mapping.mjs +141 -0
  15. package/dist/_libs/@rolldown/pluginutils.mjs +31 -0
  16. package/dist/_libs/@rollup/plugin-commonjs.mjs +33 -2636
  17. package/dist/_libs/@rollup/plugin-inject.mjs +3 -2
  18. package/dist/_libs/@rollup/plugin-json.mjs +1 -1
  19. package/dist/_libs/@rollup/plugin-node-resolve.mjs +7 -1111
  20. package/dist/_libs/@rollup/plugin-replace.mjs +2 -2
  21. package/dist/_libs/@rollup/pluginutils.mjs +241 -0
  22. package/dist/_libs/c12.mjs +63 -2513
  23. package/dist/_libs/chokidar.mjs +1 -234
  24. package/dist/_libs/commondir.mjs +22 -0
  25. package/dist/_libs/confbox.mjs +1102 -502
  26. package/dist/_libs/deepmerge.mjs +86 -0
  27. package/dist/_libs/dotenv.mjs +345 -0
  28. package/dist/_libs/estree-walker.mjs +144 -1
  29. package/dist/_libs/exsolve.mjs +1007 -0
  30. package/dist/_libs/fdir.mjs +514 -0
  31. package/dist/_libs/function-bind.mjs +63 -0
  32. package/dist/_libs/giget.mjs +1376 -2234
  33. package/dist/_libs/hasown.mjs +14 -0
  34. package/dist/_libs/is-core-module.mjs +220 -0
  35. package/dist/_libs/is-module.mjs +13 -0
  36. package/dist/_libs/is-reference.mjs +33 -0
  37. package/dist/_libs/js-tokens.mjs +382 -0
  38. package/dist/_libs/local-pkg.mjs +6 -1560
  39. package/dist/_libs/magic-string.mjs +939 -0
  40. package/dist/_libs/mlly.mjs +1415 -0
  41. package/dist/_libs/node-fetch-native.mjs +7 -0
  42. package/dist/_libs/nypm.mjs +239 -0
  43. package/dist/_libs/path-parse.mjs +47 -0
  44. package/dist/_libs/pathe.mjs +163 -2
  45. package/dist/_libs/perfect-debounce.mjs +89 -0
  46. package/dist/_libs/picomatch.mjs +1673 -0
  47. package/dist/_libs/pkg-types.mjs +197 -0
  48. package/dist/_libs/quansync.mjs +90 -0
  49. package/dist/_libs/rc9.mjs +136 -0
  50. package/dist/_libs/readdirp.mjs +237 -0
  51. package/dist/_libs/resolve.mjs +689 -0
  52. package/dist/_libs/strip-literal.mjs +51 -0
  53. package/dist/_libs/tinyexec.mjs +627 -0
  54. package/dist/_libs/tinyglobby.mjs +2 -1
  55. package/dist/_libs/unimport.mjs +42 -1575
  56. package/dist/_libs/unplugin-utils.mjs +61 -0
  57. package/dist/_libs/unplugin.mjs +1225 -0
  58. package/dist/_libs/unwasm.mjs +3 -2
  59. package/dist/_libs/webpack-virtual-modules.mjs +272 -0
  60. package/dist/_nitro.mjs +7 -4
  61. package/dist/_nitro2.mjs +3 -3
  62. package/dist/_presets.mjs +5 -3
  63. package/dist/builder.mjs +4 -4
  64. package/dist/cli/_chunks/{build.mjs → build2.mjs} +1 -1
  65. package/dist/cli/_chunks/dev.mjs +1 -1
  66. package/dist/cli/_chunks/list.mjs +1 -1
  67. package/dist/cli/_chunks/prepare.mjs +1 -1
  68. package/dist/cli/_chunks/run.mjs +1 -1
  69. package/dist/cli/index.mjs +1 -1
  70. package/dist/types/index.d.mts +4 -4
  71. package/dist/vite.mjs +1824 -19
  72. package/package.json +2 -2
  73. package/dist/_build/shared4.mjs +0 -1114
  74. package/dist/_build/vite.plugin.mjs +0 -712
@@ -1,4 +1,7 @@
1
- import { i as __toESM, n as __exportAll, t as __commonJSMin } from "../../_rolldown.mjs";
1
+ import { n as __exportAll } from "../../_rolldown.mjs";
2
+ import { t as MagicString } from "../magic-string.mjs";
3
+ import { t as stripLiteral } from "../strip-literal.mjs";
4
+ import { t as exactRegex } from "../@rolldown/pluginutils.mjs";
2
5
  import fs from "node:fs";
3
6
  import { fileURLToPath } from "node:url";
4
7
  import path from "node:path";
@@ -7,1564 +10,6 @@ import { createHash } from "node:crypto";
7
10
  import { isCSSRequest, normalizePath } from "vite";
8
11
  import assert$1 from "node:assert/strict";
9
12
 
10
- //#region node_modules/.pnpm/@jridgewell+sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
11
- var comma = ",".charCodeAt(0);
12
- var semicolon = ";".charCodeAt(0);
13
- var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
14
- var intToChar = new Uint8Array(64);
15
- var charToInt = new Uint8Array(128);
16
- for (let i = 0; i < chars.length; i++) {
17
- const c = chars.charCodeAt(i);
18
- intToChar[i] = c;
19
- charToInt[c] = i;
20
- }
21
- function decodeInteger(reader, relative$1) {
22
- let value = 0;
23
- let shift = 0;
24
- let integer = 0;
25
- do {
26
- integer = charToInt[reader.next()];
27
- value |= (integer & 31) << shift;
28
- shift += 5;
29
- } while (integer & 32);
30
- const shouldNegate = value & 1;
31
- value >>>= 1;
32
- if (shouldNegate) value = -2147483648 | -value;
33
- return relative$1 + value;
34
- }
35
- function encodeInteger(builder, num, relative$1) {
36
- let delta = num - relative$1;
37
- delta = delta < 0 ? -delta << 1 | 1 : delta << 1;
38
- do {
39
- let clamped = delta & 31;
40
- delta >>>= 5;
41
- if (delta > 0) clamped |= 32;
42
- builder.write(intToChar[clamped]);
43
- } while (delta > 0);
44
- return num;
45
- }
46
- function hasMoreVlq(reader, max) {
47
- if (reader.pos >= max) return false;
48
- return reader.peek() !== comma;
49
- }
50
- var bufLength = 1024 * 16;
51
- var td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? { decode(buf) {
52
- return Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength).toString();
53
- } } : { decode(buf) {
54
- let out = "";
55
- for (let i = 0; i < buf.length; i++) out += String.fromCharCode(buf[i]);
56
- return out;
57
- } };
58
- var StringWriter = class {
59
- constructor() {
60
- this.pos = 0;
61
- this.out = "";
62
- this.buffer = new Uint8Array(bufLength);
63
- }
64
- write(v) {
65
- const { buffer } = this;
66
- buffer[this.pos++] = v;
67
- if (this.pos === bufLength) {
68
- this.out += td.decode(buffer);
69
- this.pos = 0;
70
- }
71
- }
72
- flush() {
73
- const { buffer, out, pos } = this;
74
- return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;
75
- }
76
- };
77
- var StringReader = class {
78
- constructor(buffer) {
79
- this.pos = 0;
80
- this.buffer = buffer;
81
- }
82
- next() {
83
- return this.buffer.charCodeAt(this.pos++);
84
- }
85
- peek() {
86
- return this.buffer.charCodeAt(this.pos);
87
- }
88
- indexOf(char) {
89
- const { buffer, pos } = this;
90
- const idx = buffer.indexOf(char, pos);
91
- return idx === -1 ? buffer.length : idx;
92
- }
93
- };
94
- function decode(mappings) {
95
- const { length } = mappings;
96
- const reader = new StringReader(mappings);
97
- const decoded = [];
98
- let genColumn = 0;
99
- let sourcesIndex = 0;
100
- let sourceLine = 0;
101
- let sourceColumn = 0;
102
- let namesIndex = 0;
103
- do {
104
- const semi = reader.indexOf(";");
105
- const line = [];
106
- let sorted = true;
107
- let lastCol = 0;
108
- genColumn = 0;
109
- while (reader.pos < semi) {
110
- let seg;
111
- genColumn = decodeInteger(reader, genColumn);
112
- if (genColumn < lastCol) sorted = false;
113
- lastCol = genColumn;
114
- if (hasMoreVlq(reader, semi)) {
115
- sourcesIndex = decodeInteger(reader, sourcesIndex);
116
- sourceLine = decodeInteger(reader, sourceLine);
117
- sourceColumn = decodeInteger(reader, sourceColumn);
118
- if (hasMoreVlq(reader, semi)) {
119
- namesIndex = decodeInteger(reader, namesIndex);
120
- seg = [
121
- genColumn,
122
- sourcesIndex,
123
- sourceLine,
124
- sourceColumn,
125
- namesIndex
126
- ];
127
- } else seg = [
128
- genColumn,
129
- sourcesIndex,
130
- sourceLine,
131
- sourceColumn
132
- ];
133
- } else seg = [genColumn];
134
- line.push(seg);
135
- reader.pos++;
136
- }
137
- if (!sorted) sort(line);
138
- decoded.push(line);
139
- reader.pos = semi + 1;
140
- } while (reader.pos <= length);
141
- return decoded;
142
- }
143
- function sort(line) {
144
- line.sort(sortComparator);
145
- }
146
- function sortComparator(a, b) {
147
- return a[0] - b[0];
148
- }
149
- function encode(decoded) {
150
- const writer = new StringWriter();
151
- let sourcesIndex = 0;
152
- let sourceLine = 0;
153
- let sourceColumn = 0;
154
- let namesIndex = 0;
155
- for (let i = 0; i < decoded.length; i++) {
156
- const line = decoded[i];
157
- if (i > 0) writer.write(semicolon);
158
- if (line.length === 0) continue;
159
- let genColumn = 0;
160
- for (let j = 0; j < line.length; j++) {
161
- const segment = line[j];
162
- if (j > 0) writer.write(comma);
163
- genColumn = encodeInteger(writer, segment[0], genColumn);
164
- if (segment.length === 1) continue;
165
- sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex);
166
- sourceLine = encodeInteger(writer, segment[2], sourceLine);
167
- sourceColumn = encodeInteger(writer, segment[3], sourceColumn);
168
- if (segment.length === 4) continue;
169
- namesIndex = encodeInteger(writer, segment[4], namesIndex);
170
- }
171
- }
172
- return writer.flush();
173
- }
174
-
175
- //#endregion
176
- //#region node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.mjs
177
- var BitSet = class BitSet {
178
- constructor(arg) {
179
- this.bits = arg instanceof BitSet ? arg.bits.slice() : [];
180
- }
181
- add(n$1) {
182
- this.bits[n$1 >> 5] |= 1 << (n$1 & 31);
183
- }
184
- has(n$1) {
185
- return !!(this.bits[n$1 >> 5] & 1 << (n$1 & 31));
186
- }
187
- };
188
- var Chunk = class Chunk {
189
- constructor(start, end, content) {
190
- this.start = start;
191
- this.end = end;
192
- this.original = content;
193
- this.intro = "";
194
- this.outro = "";
195
- this.content = content;
196
- this.storeName = false;
197
- this.edited = false;
198
- this.previous = null;
199
- this.next = null;
200
- }
201
- appendLeft(content) {
202
- this.outro += content;
203
- }
204
- appendRight(content) {
205
- this.intro = this.intro + content;
206
- }
207
- clone() {
208
- const chunk = new Chunk(this.start, this.end, this.original);
209
- chunk.intro = this.intro;
210
- chunk.outro = this.outro;
211
- chunk.content = this.content;
212
- chunk.storeName = this.storeName;
213
- chunk.edited = this.edited;
214
- return chunk;
215
- }
216
- contains(index) {
217
- return this.start < index && index < this.end;
218
- }
219
- eachNext(fn) {
220
- let chunk = this;
221
- while (chunk) {
222
- fn(chunk);
223
- chunk = chunk.next;
224
- }
225
- }
226
- eachPrevious(fn) {
227
- let chunk = this;
228
- while (chunk) {
229
- fn(chunk);
230
- chunk = chunk.previous;
231
- }
232
- }
233
- edit(content, storeName, contentOnly) {
234
- this.content = content;
235
- if (!contentOnly) {
236
- this.intro = "";
237
- this.outro = "";
238
- }
239
- this.storeName = storeName;
240
- this.edited = true;
241
- return this;
242
- }
243
- prependLeft(content) {
244
- this.outro = content + this.outro;
245
- }
246
- prependRight(content) {
247
- this.intro = content + this.intro;
248
- }
249
- reset() {
250
- this.intro = "";
251
- this.outro = "";
252
- if (this.edited) {
253
- this.content = this.original;
254
- this.storeName = false;
255
- this.edited = false;
256
- }
257
- }
258
- split(index) {
259
- const sliceIndex = index - this.start;
260
- const originalBefore = this.original.slice(0, sliceIndex);
261
- const originalAfter = this.original.slice(sliceIndex);
262
- this.original = originalBefore;
263
- const newChunk = new Chunk(index, this.end, originalAfter);
264
- newChunk.outro = this.outro;
265
- this.outro = "";
266
- this.end = index;
267
- if (this.edited) {
268
- newChunk.edit("", false);
269
- this.content = "";
270
- } else this.content = originalBefore;
271
- newChunk.next = this.next;
272
- if (newChunk.next) newChunk.next.previous = newChunk;
273
- newChunk.previous = this;
274
- this.next = newChunk;
275
- return newChunk;
276
- }
277
- toString() {
278
- return this.intro + this.content + this.outro;
279
- }
280
- trimEnd(rx) {
281
- this.outro = this.outro.replace(rx, "");
282
- if (this.outro.length) return true;
283
- const trimmed = this.content.replace(rx, "");
284
- if (trimmed.length) {
285
- if (trimmed !== this.content) {
286
- this.split(this.start + trimmed.length).edit("", void 0, true);
287
- if (this.edited) this.edit(trimmed, this.storeName, true);
288
- }
289
- return true;
290
- } else {
291
- this.edit("", void 0, true);
292
- this.intro = this.intro.replace(rx, "");
293
- if (this.intro.length) return true;
294
- }
295
- }
296
- trimStart(rx) {
297
- this.intro = this.intro.replace(rx, "");
298
- if (this.intro.length) return true;
299
- const trimmed = this.content.replace(rx, "");
300
- if (trimmed.length) {
301
- if (trimmed !== this.content) {
302
- const newChunk = this.split(this.end - trimmed.length);
303
- if (this.edited) newChunk.edit(trimmed, this.storeName, true);
304
- this.edit("", void 0, true);
305
- }
306
- return true;
307
- } else {
308
- this.edit("", void 0, true);
309
- this.outro = this.outro.replace(rx, "");
310
- if (this.outro.length) return true;
311
- }
312
- }
313
- };
314
- function getBtoa() {
315
- if (typeof globalThis !== "undefined" && typeof globalThis.btoa === "function") return (str) => globalThis.btoa(unescape(encodeURIComponent(str)));
316
- else if (typeof Buffer === "function") return (str) => Buffer.from(str, "utf-8").toString("base64");
317
- else return () => {
318
- throw new Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.");
319
- };
320
- }
321
- const btoa = /* @__PURE__ */ getBtoa();
322
- var SourceMap = class {
323
- constructor(properties) {
324
- this.version = 3;
325
- this.file = properties.file;
326
- this.sources = properties.sources;
327
- this.sourcesContent = properties.sourcesContent;
328
- this.names = properties.names;
329
- this.mappings = encode(properties.mappings);
330
- if (typeof properties.x_google_ignoreList !== "undefined") this.x_google_ignoreList = properties.x_google_ignoreList;
331
- if (typeof properties.debugId !== "undefined") this.debugId = properties.debugId;
332
- }
333
- toString() {
334
- return JSON.stringify(this);
335
- }
336
- toUrl() {
337
- return "data:application/json;charset=utf-8;base64," + btoa(this.toString());
338
- }
339
- };
340
- function guessIndent(code) {
341
- const lines = code.split("\n");
342
- const tabbed = lines.filter((line) => /^\t+/.test(line));
343
- const spaced = lines.filter((line) => /^ {2,}/.test(line));
344
- if (tabbed.length === 0 && spaced.length === 0) return null;
345
- if (tabbed.length >= spaced.length) return " ";
346
- const min = spaced.reduce((previous, current) => {
347
- const numSpaces = /^ +/.exec(current)[0].length;
348
- return Math.min(numSpaces, previous);
349
- }, Infinity);
350
- return new Array(min + 1).join(" ");
351
- }
352
- function getRelativePath(from, to) {
353
- const fromParts = from.split(/[/\\]/);
354
- const toParts = to.split(/[/\\]/);
355
- fromParts.pop();
356
- while (fromParts[0] === toParts[0]) {
357
- fromParts.shift();
358
- toParts.shift();
359
- }
360
- if (fromParts.length) {
361
- let i = fromParts.length;
362
- while (i--) fromParts[i] = "..";
363
- }
364
- return fromParts.concat(toParts).join("/");
365
- }
366
- const toString = Object.prototype.toString;
367
- function isObject(thing) {
368
- return toString.call(thing) === "[object Object]";
369
- }
370
- function getLocator(source) {
371
- const originalLines = source.split("\n");
372
- const lineOffsets = [];
373
- for (let i = 0, pos = 0; i < originalLines.length; i++) {
374
- lineOffsets.push(pos);
375
- pos += originalLines[i].length + 1;
376
- }
377
- return function locate(index) {
378
- let i = 0;
379
- let j = lineOffsets.length;
380
- while (i < j) {
381
- const m = i + j >> 1;
382
- if (index < lineOffsets[m]) j = m;
383
- else i = m + 1;
384
- }
385
- const line = i - 1;
386
- return {
387
- line,
388
- column: index - lineOffsets[line]
389
- };
390
- };
391
- }
392
- const wordRegex = /\w/;
393
- var Mappings = class {
394
- constructor(hires) {
395
- this.hires = hires;
396
- this.generatedCodeLine = 0;
397
- this.generatedCodeColumn = 0;
398
- this.raw = [];
399
- this.rawSegments = this.raw[this.generatedCodeLine] = [];
400
- this.pending = null;
401
- }
402
- addEdit(sourceIndex, content, loc, nameIndex) {
403
- if (content.length) {
404
- const contentLengthMinusOne = content.length - 1;
405
- let contentLineEnd = content.indexOf("\n", 0);
406
- let previousContentLineEnd = -1;
407
- while (contentLineEnd >= 0 && contentLengthMinusOne > contentLineEnd) {
408
- const segment$1 = [
409
- this.generatedCodeColumn,
410
- sourceIndex,
411
- loc.line,
412
- loc.column
413
- ];
414
- if (nameIndex >= 0) segment$1.push(nameIndex);
415
- this.rawSegments.push(segment$1);
416
- this.generatedCodeLine += 1;
417
- this.raw[this.generatedCodeLine] = this.rawSegments = [];
418
- this.generatedCodeColumn = 0;
419
- previousContentLineEnd = contentLineEnd;
420
- contentLineEnd = content.indexOf("\n", contentLineEnd + 1);
421
- }
422
- const segment = [
423
- this.generatedCodeColumn,
424
- sourceIndex,
425
- loc.line,
426
- loc.column
427
- ];
428
- if (nameIndex >= 0) segment.push(nameIndex);
429
- this.rawSegments.push(segment);
430
- this.advance(content.slice(previousContentLineEnd + 1));
431
- } else if (this.pending) {
432
- this.rawSegments.push(this.pending);
433
- this.advance(content);
434
- }
435
- this.pending = null;
436
- }
437
- addUneditedChunk(sourceIndex, chunk, original, loc, sourcemapLocations) {
438
- let originalCharIndex = chunk.start;
439
- let first = true;
440
- let charInHiresBoundary = false;
441
- while (originalCharIndex < chunk.end) {
442
- if (original[originalCharIndex] === "\n") {
443
- loc.line += 1;
444
- loc.column = 0;
445
- this.generatedCodeLine += 1;
446
- this.raw[this.generatedCodeLine] = this.rawSegments = [];
447
- this.generatedCodeColumn = 0;
448
- first = true;
449
- charInHiresBoundary = false;
450
- } else {
451
- if (this.hires || first || sourcemapLocations.has(originalCharIndex)) {
452
- const segment = [
453
- this.generatedCodeColumn,
454
- sourceIndex,
455
- loc.line,
456
- loc.column
457
- ];
458
- if (this.hires === "boundary") if (wordRegex.test(original[originalCharIndex])) {
459
- if (!charInHiresBoundary) {
460
- this.rawSegments.push(segment);
461
- charInHiresBoundary = true;
462
- }
463
- } else {
464
- this.rawSegments.push(segment);
465
- charInHiresBoundary = false;
466
- }
467
- else this.rawSegments.push(segment);
468
- }
469
- loc.column += 1;
470
- this.generatedCodeColumn += 1;
471
- first = false;
472
- }
473
- originalCharIndex += 1;
474
- }
475
- this.pending = null;
476
- }
477
- advance(str) {
478
- if (!str) return;
479
- const lines = str.split("\n");
480
- if (lines.length > 1) {
481
- for (let i = 0; i < lines.length - 1; i++) {
482
- this.generatedCodeLine++;
483
- this.raw[this.generatedCodeLine] = this.rawSegments = [];
484
- }
485
- this.generatedCodeColumn = 0;
486
- }
487
- this.generatedCodeColumn += lines[lines.length - 1].length;
488
- }
489
- };
490
- const n = "\n";
491
- const warned = {
492
- insertLeft: false,
493
- insertRight: false,
494
- storeName: false
495
- };
496
- var MagicString = class MagicString {
497
- constructor(string, options = {}) {
498
- const chunk = new Chunk(0, string.length, string);
499
- Object.defineProperties(this, {
500
- original: {
501
- writable: true,
502
- value: string
503
- },
504
- outro: {
505
- writable: true,
506
- value: ""
507
- },
508
- intro: {
509
- writable: true,
510
- value: ""
511
- },
512
- firstChunk: {
513
- writable: true,
514
- value: chunk
515
- },
516
- lastChunk: {
517
- writable: true,
518
- value: chunk
519
- },
520
- lastSearchedChunk: {
521
- writable: true,
522
- value: chunk
523
- },
524
- byStart: {
525
- writable: true,
526
- value: {}
527
- },
528
- byEnd: {
529
- writable: true,
530
- value: {}
531
- },
532
- filename: {
533
- writable: true,
534
- value: options.filename
535
- },
536
- indentExclusionRanges: {
537
- writable: true,
538
- value: options.indentExclusionRanges
539
- },
540
- sourcemapLocations: {
541
- writable: true,
542
- value: new BitSet()
543
- },
544
- storedNames: {
545
- writable: true,
546
- value: {}
547
- },
548
- indentStr: {
549
- writable: true,
550
- value: void 0
551
- },
552
- ignoreList: {
553
- writable: true,
554
- value: options.ignoreList
555
- },
556
- offset: {
557
- writable: true,
558
- value: options.offset || 0
559
- }
560
- });
561
- this.byStart[0] = chunk;
562
- this.byEnd[string.length] = chunk;
563
- }
564
- addSourcemapLocation(char) {
565
- this.sourcemapLocations.add(char);
566
- }
567
- append(content) {
568
- if (typeof content !== "string") throw new TypeError("outro content must be a string");
569
- this.outro += content;
570
- return this;
571
- }
572
- appendLeft(index, content) {
573
- index = index + this.offset;
574
- if (typeof content !== "string") throw new TypeError("inserted content must be a string");
575
- this._split(index);
576
- const chunk = this.byEnd[index];
577
- if (chunk) chunk.appendLeft(content);
578
- else this.intro += content;
579
- return this;
580
- }
581
- appendRight(index, content) {
582
- index = index + this.offset;
583
- if (typeof content !== "string") throw new TypeError("inserted content must be a string");
584
- this._split(index);
585
- const chunk = this.byStart[index];
586
- if (chunk) chunk.appendRight(content);
587
- else this.outro += content;
588
- return this;
589
- }
590
- clone() {
591
- const cloned = new MagicString(this.original, {
592
- filename: this.filename,
593
- offset: this.offset
594
- });
595
- let originalChunk = this.firstChunk;
596
- let clonedChunk = cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone();
597
- while (originalChunk) {
598
- cloned.byStart[clonedChunk.start] = clonedChunk;
599
- cloned.byEnd[clonedChunk.end] = clonedChunk;
600
- const nextOriginalChunk = originalChunk.next;
601
- const nextClonedChunk = nextOriginalChunk && nextOriginalChunk.clone();
602
- if (nextClonedChunk) {
603
- clonedChunk.next = nextClonedChunk;
604
- nextClonedChunk.previous = clonedChunk;
605
- clonedChunk = nextClonedChunk;
606
- }
607
- originalChunk = nextOriginalChunk;
608
- }
609
- cloned.lastChunk = clonedChunk;
610
- if (this.indentExclusionRanges) cloned.indentExclusionRanges = this.indentExclusionRanges.slice();
611
- cloned.sourcemapLocations = new BitSet(this.sourcemapLocations);
612
- cloned.intro = this.intro;
613
- cloned.outro = this.outro;
614
- return cloned;
615
- }
616
- generateDecodedMap(options) {
617
- options = options || {};
618
- const sourceIndex = 0;
619
- const names = Object.keys(this.storedNames);
620
- const mappings = new Mappings(options.hires);
621
- const locate = getLocator(this.original);
622
- if (this.intro) mappings.advance(this.intro);
623
- this.firstChunk.eachNext((chunk) => {
624
- const loc = locate(chunk.start);
625
- if (chunk.intro.length) mappings.advance(chunk.intro);
626
- if (chunk.edited) mappings.addEdit(sourceIndex, chunk.content, loc, chunk.storeName ? names.indexOf(chunk.original) : -1);
627
- else mappings.addUneditedChunk(sourceIndex, chunk, this.original, loc, this.sourcemapLocations);
628
- if (chunk.outro.length) mappings.advance(chunk.outro);
629
- });
630
- if (this.outro) mappings.advance(this.outro);
631
- return {
632
- file: options.file ? options.file.split(/[/\\]/).pop() : void 0,
633
- sources: [options.source ? getRelativePath(options.file || "", options.source) : options.file || ""],
634
- sourcesContent: options.includeContent ? [this.original] : void 0,
635
- names,
636
- mappings: mappings.raw,
637
- x_google_ignoreList: this.ignoreList ? [sourceIndex] : void 0
638
- };
639
- }
640
- generateMap(options) {
641
- return new SourceMap(this.generateDecodedMap(options));
642
- }
643
- _ensureindentStr() {
644
- if (this.indentStr === void 0) this.indentStr = guessIndent(this.original);
645
- }
646
- _getRawIndentString() {
647
- this._ensureindentStr();
648
- return this.indentStr;
649
- }
650
- getIndentString() {
651
- this._ensureindentStr();
652
- return this.indentStr === null ? " " : this.indentStr;
653
- }
654
- indent(indentStr, options) {
655
- const pattern = /^[^\r\n]/gm;
656
- if (isObject(indentStr)) {
657
- options = indentStr;
658
- indentStr = void 0;
659
- }
660
- if (indentStr === void 0) {
661
- this._ensureindentStr();
662
- indentStr = this.indentStr || " ";
663
- }
664
- if (indentStr === "") return this;
665
- options = options || {};
666
- const isExcluded = {};
667
- if (options.exclude) (typeof options.exclude[0] === "number" ? [options.exclude] : options.exclude).forEach((exclusion) => {
668
- for (let i = exclusion[0]; i < exclusion[1]; i += 1) isExcluded[i] = true;
669
- });
670
- let shouldIndentNextCharacter = options.indentStart !== false;
671
- const replacer = (match) => {
672
- if (shouldIndentNextCharacter) return `${indentStr}${match}`;
673
- shouldIndentNextCharacter = true;
674
- return match;
675
- };
676
- this.intro = this.intro.replace(pattern, replacer);
677
- let charIndex = 0;
678
- let chunk = this.firstChunk;
679
- while (chunk) {
680
- const end = chunk.end;
681
- if (chunk.edited) {
682
- if (!isExcluded[charIndex]) {
683
- chunk.content = chunk.content.replace(pattern, replacer);
684
- if (chunk.content.length) shouldIndentNextCharacter = chunk.content[chunk.content.length - 1] === "\n";
685
- }
686
- } else {
687
- charIndex = chunk.start;
688
- while (charIndex < end) {
689
- if (!isExcluded[charIndex]) {
690
- const char = this.original[charIndex];
691
- if (char === "\n") shouldIndentNextCharacter = true;
692
- else if (char !== "\r" && shouldIndentNextCharacter) {
693
- shouldIndentNextCharacter = false;
694
- if (charIndex === chunk.start) chunk.prependRight(indentStr);
695
- else {
696
- this._splitChunk(chunk, charIndex);
697
- chunk = chunk.next;
698
- chunk.prependRight(indentStr);
699
- }
700
- }
701
- }
702
- charIndex += 1;
703
- }
704
- }
705
- charIndex = chunk.end;
706
- chunk = chunk.next;
707
- }
708
- this.outro = this.outro.replace(pattern, replacer);
709
- return this;
710
- }
711
- insert() {
712
- throw new Error("magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)");
713
- }
714
- insertLeft(index, content) {
715
- if (!warned.insertLeft) {
716
- console.warn("magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead");
717
- warned.insertLeft = true;
718
- }
719
- return this.appendLeft(index, content);
720
- }
721
- insertRight(index, content) {
722
- if (!warned.insertRight) {
723
- console.warn("magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead");
724
- warned.insertRight = true;
725
- }
726
- return this.prependRight(index, content);
727
- }
728
- move(start, end, index) {
729
- start = start + this.offset;
730
- end = end + this.offset;
731
- index = index + this.offset;
732
- if (index >= start && index <= end) throw new Error("Cannot move a selection inside itself");
733
- this._split(start);
734
- this._split(end);
735
- this._split(index);
736
- const first = this.byStart[start];
737
- const last = this.byEnd[end];
738
- const oldLeft = first.previous;
739
- const oldRight = last.next;
740
- const newRight = this.byStart[index];
741
- if (!newRight && last === this.lastChunk) return this;
742
- const newLeft = newRight ? newRight.previous : this.lastChunk;
743
- if (oldLeft) oldLeft.next = oldRight;
744
- if (oldRight) oldRight.previous = oldLeft;
745
- if (newLeft) newLeft.next = first;
746
- if (newRight) newRight.previous = last;
747
- if (!first.previous) this.firstChunk = last.next;
748
- if (!last.next) {
749
- this.lastChunk = first.previous;
750
- this.lastChunk.next = null;
751
- }
752
- first.previous = newLeft;
753
- last.next = newRight || null;
754
- if (!newLeft) this.firstChunk = first;
755
- if (!newRight) this.lastChunk = last;
756
- return this;
757
- }
758
- overwrite(start, end, content, options) {
759
- options = options || {};
760
- return this.update(start, end, content, {
761
- ...options,
762
- overwrite: !options.contentOnly
763
- });
764
- }
765
- update(start, end, content, options) {
766
- start = start + this.offset;
767
- end = end + this.offset;
768
- if (typeof content !== "string") throw new TypeError("replacement content must be a string");
769
- if (this.original.length !== 0) {
770
- while (start < 0) start += this.original.length;
771
- while (end < 0) end += this.original.length;
772
- }
773
- if (end > this.original.length) throw new Error("end is out of bounds");
774
- if (start === end) throw new Error("Cannot overwrite a zero-length range – use appendLeft or prependRight instead");
775
- this._split(start);
776
- this._split(end);
777
- if (options === true) {
778
- if (!warned.storeName) {
779
- console.warn("The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string");
780
- warned.storeName = true;
781
- }
782
- options = { storeName: true };
783
- }
784
- const storeName = options !== void 0 ? options.storeName : false;
785
- const overwrite = options !== void 0 ? options.overwrite : false;
786
- if (storeName) {
787
- const original = this.original.slice(start, end);
788
- Object.defineProperty(this.storedNames, original, {
789
- writable: true,
790
- value: true,
791
- enumerable: true
792
- });
793
- }
794
- const first = this.byStart[start];
795
- const last = this.byEnd[end];
796
- if (first) {
797
- let chunk = first;
798
- while (chunk !== last) {
799
- if (chunk.next !== this.byStart[chunk.end]) throw new Error("Cannot overwrite across a split point");
800
- chunk = chunk.next;
801
- chunk.edit("", false);
802
- }
803
- first.edit(content, storeName, !overwrite);
804
- } else {
805
- const newChunk = new Chunk(start, end, "").edit(content, storeName);
806
- last.next = newChunk;
807
- newChunk.previous = last;
808
- }
809
- return this;
810
- }
811
- prepend(content) {
812
- if (typeof content !== "string") throw new TypeError("outro content must be a string");
813
- this.intro = content + this.intro;
814
- return this;
815
- }
816
- prependLeft(index, content) {
817
- index = index + this.offset;
818
- if (typeof content !== "string") throw new TypeError("inserted content must be a string");
819
- this._split(index);
820
- const chunk = this.byEnd[index];
821
- if (chunk) chunk.prependLeft(content);
822
- else this.intro = content + this.intro;
823
- return this;
824
- }
825
- prependRight(index, content) {
826
- index = index + this.offset;
827
- if (typeof content !== "string") throw new TypeError("inserted content must be a string");
828
- this._split(index);
829
- const chunk = this.byStart[index];
830
- if (chunk) chunk.prependRight(content);
831
- else this.outro = content + this.outro;
832
- return this;
833
- }
834
- remove(start, end) {
835
- start = start + this.offset;
836
- end = end + this.offset;
837
- if (this.original.length !== 0) {
838
- while (start < 0) start += this.original.length;
839
- while (end < 0) end += this.original.length;
840
- }
841
- if (start === end) return this;
842
- if (start < 0 || end > this.original.length) throw new Error("Character is out of bounds");
843
- if (start > end) throw new Error("end must be greater than start");
844
- this._split(start);
845
- this._split(end);
846
- let chunk = this.byStart[start];
847
- while (chunk) {
848
- chunk.intro = "";
849
- chunk.outro = "";
850
- chunk.edit("");
851
- chunk = end > chunk.end ? this.byStart[chunk.end] : null;
852
- }
853
- return this;
854
- }
855
- reset(start, end) {
856
- start = start + this.offset;
857
- end = end + this.offset;
858
- if (this.original.length !== 0) {
859
- while (start < 0) start += this.original.length;
860
- while (end < 0) end += this.original.length;
861
- }
862
- if (start === end) return this;
863
- if (start < 0 || end > this.original.length) throw new Error("Character is out of bounds");
864
- if (start > end) throw new Error("end must be greater than start");
865
- this._split(start);
866
- this._split(end);
867
- let chunk = this.byStart[start];
868
- while (chunk) {
869
- chunk.reset();
870
- chunk = end > chunk.end ? this.byStart[chunk.end] : null;
871
- }
872
- return this;
873
- }
874
- lastChar() {
875
- if (this.outro.length) return this.outro[this.outro.length - 1];
876
- let chunk = this.lastChunk;
877
- do {
878
- if (chunk.outro.length) return chunk.outro[chunk.outro.length - 1];
879
- if (chunk.content.length) return chunk.content[chunk.content.length - 1];
880
- if (chunk.intro.length) return chunk.intro[chunk.intro.length - 1];
881
- } while (chunk = chunk.previous);
882
- if (this.intro.length) return this.intro[this.intro.length - 1];
883
- return "";
884
- }
885
- lastLine() {
886
- let lineIndex = this.outro.lastIndexOf(n);
887
- if (lineIndex !== -1) return this.outro.substr(lineIndex + 1);
888
- let lineStr = this.outro;
889
- let chunk = this.lastChunk;
890
- do {
891
- if (chunk.outro.length > 0) {
892
- lineIndex = chunk.outro.lastIndexOf(n);
893
- if (lineIndex !== -1) return chunk.outro.substr(lineIndex + 1) + lineStr;
894
- lineStr = chunk.outro + lineStr;
895
- }
896
- if (chunk.content.length > 0) {
897
- lineIndex = chunk.content.lastIndexOf(n);
898
- if (lineIndex !== -1) return chunk.content.substr(lineIndex + 1) + lineStr;
899
- lineStr = chunk.content + lineStr;
900
- }
901
- if (chunk.intro.length > 0) {
902
- lineIndex = chunk.intro.lastIndexOf(n);
903
- if (lineIndex !== -1) return chunk.intro.substr(lineIndex + 1) + lineStr;
904
- lineStr = chunk.intro + lineStr;
905
- }
906
- } while (chunk = chunk.previous);
907
- lineIndex = this.intro.lastIndexOf(n);
908
- if (lineIndex !== -1) return this.intro.substr(lineIndex + 1) + lineStr;
909
- return this.intro + lineStr;
910
- }
911
- slice(start = 0, end = this.original.length - this.offset) {
912
- start = start + this.offset;
913
- end = end + this.offset;
914
- if (this.original.length !== 0) {
915
- while (start < 0) start += this.original.length;
916
- while (end < 0) end += this.original.length;
917
- }
918
- let result = "";
919
- let chunk = this.firstChunk;
920
- while (chunk && (chunk.start > start || chunk.end <= start)) {
921
- if (chunk.start < end && chunk.end >= end) return result;
922
- chunk = chunk.next;
923
- }
924
- if (chunk && chunk.edited && chunk.start !== start) throw new Error(`Cannot use replaced character ${start} as slice start anchor.`);
925
- const startChunk = chunk;
926
- while (chunk) {
927
- if (chunk.intro && (startChunk !== chunk || chunk.start === start)) result += chunk.intro;
928
- const containsEnd = chunk.start < end && chunk.end >= end;
929
- if (containsEnd && chunk.edited && chunk.end !== end) throw new Error(`Cannot use replaced character ${end} as slice end anchor.`);
930
- const sliceStart = startChunk === chunk ? start - chunk.start : 0;
931
- const sliceEnd = containsEnd ? chunk.content.length + end - chunk.end : chunk.content.length;
932
- result += chunk.content.slice(sliceStart, sliceEnd);
933
- if (chunk.outro && (!containsEnd || chunk.end === end)) result += chunk.outro;
934
- if (containsEnd) break;
935
- chunk = chunk.next;
936
- }
937
- return result;
938
- }
939
- snip(start, end) {
940
- const clone = this.clone();
941
- clone.remove(0, start);
942
- clone.remove(end, clone.original.length);
943
- return clone;
944
- }
945
- _split(index) {
946
- if (this.byStart[index] || this.byEnd[index]) return;
947
- let chunk = this.lastSearchedChunk;
948
- let previousChunk = chunk;
949
- const searchForward = index > chunk.end;
950
- while (chunk) {
951
- if (chunk.contains(index)) return this._splitChunk(chunk, index);
952
- chunk = searchForward ? this.byStart[chunk.end] : this.byEnd[chunk.start];
953
- if (chunk === previousChunk) return;
954
- previousChunk = chunk;
955
- }
956
- }
957
- _splitChunk(chunk, index) {
958
- if (chunk.edited && chunk.content.length) {
959
- const loc = getLocator(this.original)(index);
960
- throw new Error(`Cannot split a chunk that has already been edited (${loc.line}:${loc.column} – "${chunk.original}")`);
961
- }
962
- const newChunk = chunk.split(index);
963
- this.byEnd[index] = chunk;
964
- this.byStart[index] = newChunk;
965
- this.byEnd[newChunk.end] = newChunk;
966
- if (chunk === this.lastChunk) this.lastChunk = newChunk;
967
- this.lastSearchedChunk = chunk;
968
- return true;
969
- }
970
- toString() {
971
- let str = this.intro;
972
- let chunk = this.firstChunk;
973
- while (chunk) {
974
- str += chunk.toString();
975
- chunk = chunk.next;
976
- }
977
- return str + this.outro;
978
- }
979
- isEmpty() {
980
- let chunk = this.firstChunk;
981
- do
982
- if (chunk.intro.length && chunk.intro.trim() || chunk.content.length && chunk.content.trim() || chunk.outro.length && chunk.outro.trim()) return false;
983
- while (chunk = chunk.next);
984
- return true;
985
- }
986
- length() {
987
- let chunk = this.firstChunk;
988
- let length = 0;
989
- do
990
- length += chunk.intro.length + chunk.content.length + chunk.outro.length;
991
- while (chunk = chunk.next);
992
- return length;
993
- }
994
- trimLines() {
995
- return this.trim("[\\r\\n]");
996
- }
997
- trim(charType) {
998
- return this.trimStart(charType).trimEnd(charType);
999
- }
1000
- trimEndAborted(charType) {
1001
- const rx = /* @__PURE__ */ new RegExp((charType || "\\s") + "+$");
1002
- this.outro = this.outro.replace(rx, "");
1003
- if (this.outro.length) return true;
1004
- let chunk = this.lastChunk;
1005
- do {
1006
- const end = chunk.end;
1007
- const aborted = chunk.trimEnd(rx);
1008
- if (chunk.end !== end) {
1009
- if (this.lastChunk === chunk) this.lastChunk = chunk.next;
1010
- this.byEnd[chunk.end] = chunk;
1011
- this.byStart[chunk.next.start] = chunk.next;
1012
- this.byEnd[chunk.next.end] = chunk.next;
1013
- }
1014
- if (aborted) return true;
1015
- chunk = chunk.previous;
1016
- } while (chunk);
1017
- return false;
1018
- }
1019
- trimEnd(charType) {
1020
- this.trimEndAborted(charType);
1021
- return this;
1022
- }
1023
- trimStartAborted(charType) {
1024
- const rx = /* @__PURE__ */ new RegExp("^" + (charType || "\\s") + "+");
1025
- this.intro = this.intro.replace(rx, "");
1026
- if (this.intro.length) return true;
1027
- let chunk = this.firstChunk;
1028
- do {
1029
- const end = chunk.end;
1030
- const aborted = chunk.trimStart(rx);
1031
- if (chunk.end !== end) {
1032
- if (chunk === this.lastChunk) this.lastChunk = chunk.next;
1033
- this.byEnd[chunk.end] = chunk;
1034
- this.byStart[chunk.next.start] = chunk.next;
1035
- this.byEnd[chunk.next.end] = chunk.next;
1036
- }
1037
- if (aborted) return true;
1038
- chunk = chunk.next;
1039
- } while (chunk);
1040
- return false;
1041
- }
1042
- trimStart(charType) {
1043
- this.trimStartAborted(charType);
1044
- return this;
1045
- }
1046
- hasChanged() {
1047
- return this.original !== this.toString();
1048
- }
1049
- _replaceRegexp(searchValue, replacement) {
1050
- function getReplacement(match, str) {
1051
- if (typeof replacement === "string") return replacement.replace(/\$(\$|&|\d+)/g, (_, i) => {
1052
- if (i === "$") return "$";
1053
- if (i === "&") return match[0];
1054
- if (+i < match.length) return match[+i];
1055
- return `$${i}`;
1056
- });
1057
- else return replacement(...match, match.index, str, match.groups);
1058
- }
1059
- function matchAll(re, str) {
1060
- let match;
1061
- const matches = [];
1062
- while (match = re.exec(str)) matches.push(match);
1063
- return matches;
1064
- }
1065
- if (searchValue.global) matchAll(searchValue, this.original).forEach((match) => {
1066
- if (match.index != null) {
1067
- const replacement$1 = getReplacement(match, this.original);
1068
- if (replacement$1 !== match[0]) this.overwrite(match.index, match.index + match[0].length, replacement$1);
1069
- }
1070
- });
1071
- else {
1072
- const match = this.original.match(searchValue);
1073
- if (match && match.index != null) {
1074
- const replacement$1 = getReplacement(match, this.original);
1075
- if (replacement$1 !== match[0]) this.overwrite(match.index, match.index + match[0].length, replacement$1);
1076
- }
1077
- }
1078
- return this;
1079
- }
1080
- _replaceString(string, replacement) {
1081
- const { original } = this;
1082
- const index = original.indexOf(string);
1083
- if (index !== -1) {
1084
- if (typeof replacement === "function") replacement = replacement(string, index, original);
1085
- if (string !== replacement) this.overwrite(index, index + string.length, replacement);
1086
- }
1087
- return this;
1088
- }
1089
- replace(searchValue, replacement) {
1090
- if (typeof searchValue === "string") return this._replaceString(searchValue, replacement);
1091
- return this._replaceRegexp(searchValue, replacement);
1092
- }
1093
- _replaceAllString(string, replacement) {
1094
- const { original } = this;
1095
- const stringLength = string.length;
1096
- for (let index = original.indexOf(string); index !== -1; index = original.indexOf(string, index + stringLength)) {
1097
- const previous = original.slice(index, index + stringLength);
1098
- let _replacement = replacement;
1099
- if (typeof replacement === "function") _replacement = replacement(previous, index, original);
1100
- if (previous !== _replacement) this.overwrite(index, index + stringLength, _replacement);
1101
- }
1102
- return this;
1103
- }
1104
- replaceAll(searchValue, replacement) {
1105
- if (typeof searchValue === "string") return this._replaceAllString(searchValue, replacement);
1106
- if (!searchValue.global) throw new TypeError("MagicString.prototype.replaceAll called with a non-global RegExp argument");
1107
- return this._replaceRegexp(searchValue, replacement);
1108
- }
1109
- };
1110
-
1111
- //#endregion
1112
- //#region node_modules/.pnpm/js-tokens@9.0.1/node_modules/js-tokens/index.js
1113
- var require_js_tokens = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1114
- var HashbangComment, Identifier, JSXIdentifier, JSXPunctuator, JSXString, JSXText, KeywordsWithExpressionAfter, KeywordsWithNoLineTerminatorAfter, LineTerminatorSequence, MultiLineComment, Newline, NumericLiteral, Punctuator, RegularExpressionLiteral = /\/(?![*\/])(?:\[(?:[^\]\\\n\r\u2028\u2029]+|\\.)*\]?|[^\/[\\\n\r\u2028\u2029]+|\\.)*(\/[$_\u200C\u200D\p{ID_Continue}]*|\\)?/uy, SingleLineComment, StringLiteral, Template, TokensNotPrecedingObjectLiteral, TokensPrecedingExpression, WhiteSpace;
1115
- Punctuator = /--|\+\+|=>|\.{3}|\??\.(?!\d)|(?:&&|\|\||\?\?|[+\-%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2}|\/(?![\/*]))=?|[?~,:;[\](){}]/y;
1116
- Identifier = /(\x23?)(?=[$_\p{ID_Start}\\])(?:[$_\u200C\u200D\p{ID_Continue}]+|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+/uy;
1117
- StringLiteral = /(['"])(?:[^'"\\\n\r]+|(?!\1)['"]|\\(?:\r\n|[^]))*(\1)?/y;
1118
- NumericLiteral = /(?:0[xX][\da-fA-F](?:_?[\da-fA-F])*|0[oO][0-7](?:_?[0-7])*|0[bB][01](?:_?[01])*)n?|0n|[1-9](?:_?\d)*n|(?:(?:0(?!\d)|0\d*[89]\d*|[1-9](?:_?\d)*)(?:\.(?:\d(?:_?\d)*)?)?|\.\d(?:_?\d)*)(?:[eE][+-]?\d(?:_?\d)*)?|0[0-7]+/y;
1119
- Template = /[`}](?:[^`\\$]+|\\[^]|\$(?!\{))*(`|\$\{)?/y;
1120
- WhiteSpace = /[\t\v\f\ufeff\p{Zs}]+/uy;
1121
- LineTerminatorSequence = /\r?\n|[\r\u2028\u2029]/y;
1122
- MultiLineComment = /\/\*(?:[^*]+|\*(?!\/))*(\*\/)?/y;
1123
- SingleLineComment = /\/\/.*/y;
1124
- HashbangComment = /^#!.*/;
1125
- JSXPunctuator = /[<>.:={}]|\/(?![\/*])/y;
1126
- JSXIdentifier = /[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}-]*/uy;
1127
- JSXString = /(['"])(?:[^'"]+|(?!\1)['"])*(\1)?/y;
1128
- JSXText = /[^<>{}]+/y;
1129
- TokensPrecedingExpression = /^(?:[\/+-]|\.{3}|\?(?:InterpolationIn(?:JSX|Template)|NoLineTerminatorHere|NonExpressionParenEnd|UnaryIncDec))?$|[{}([,;<>=*%&|^!~?:]$/;
1130
- TokensNotPrecedingObjectLiteral = /^(?:=>|[;\]){}]|else|\?(?:NoLineTerminatorHere|NonExpressionParenEnd))?$/;
1131
- KeywordsWithExpressionAfter = /^(?:await|case|default|delete|do|else|instanceof|new|return|throw|typeof|void|yield)$/;
1132
- KeywordsWithNoLineTerminatorAfter = /^(?:return|throw|yield)$/;
1133
- Newline = RegExp(LineTerminatorSequence.source);
1134
- module.exports = function* (input, { jsx = false } = {}) {
1135
- var braces, firstCodePoint, isExpression, lastIndex, lastSignificantToken, length, match, mode, nextLastIndex, nextLastSignificantToken, parenNesting, postfixIncDec, punctuator, stack;
1136
- ({length} = input);
1137
- lastIndex = 0;
1138
- lastSignificantToken = "";
1139
- stack = [{ tag: "JS" }];
1140
- braces = [];
1141
- parenNesting = 0;
1142
- postfixIncDec = false;
1143
- if (match = HashbangComment.exec(input)) {
1144
- yield {
1145
- type: "HashbangComment",
1146
- value: match[0]
1147
- };
1148
- lastIndex = match[0].length;
1149
- }
1150
- while (lastIndex < length) {
1151
- mode = stack[stack.length - 1];
1152
- switch (mode.tag) {
1153
- case "JS":
1154
- case "JSNonExpressionParen":
1155
- case "InterpolationInTemplate":
1156
- case "InterpolationInJSX":
1157
- if (input[lastIndex] === "/" && (TokensPrecedingExpression.test(lastSignificantToken) || KeywordsWithExpressionAfter.test(lastSignificantToken))) {
1158
- RegularExpressionLiteral.lastIndex = lastIndex;
1159
- if (match = RegularExpressionLiteral.exec(input)) {
1160
- lastIndex = RegularExpressionLiteral.lastIndex;
1161
- lastSignificantToken = match[0];
1162
- postfixIncDec = true;
1163
- yield {
1164
- type: "RegularExpressionLiteral",
1165
- value: match[0],
1166
- closed: match[1] !== void 0 && match[1] !== "\\"
1167
- };
1168
- continue;
1169
- }
1170
- }
1171
- Punctuator.lastIndex = lastIndex;
1172
- if (match = Punctuator.exec(input)) {
1173
- punctuator = match[0];
1174
- nextLastIndex = Punctuator.lastIndex;
1175
- nextLastSignificantToken = punctuator;
1176
- switch (punctuator) {
1177
- case "(":
1178
- if (lastSignificantToken === "?NonExpressionParenKeyword") stack.push({
1179
- tag: "JSNonExpressionParen",
1180
- nesting: parenNesting
1181
- });
1182
- parenNesting++;
1183
- postfixIncDec = false;
1184
- break;
1185
- case ")":
1186
- parenNesting--;
1187
- postfixIncDec = true;
1188
- if (mode.tag === "JSNonExpressionParen" && parenNesting === mode.nesting) {
1189
- stack.pop();
1190
- nextLastSignificantToken = "?NonExpressionParenEnd";
1191
- postfixIncDec = false;
1192
- }
1193
- break;
1194
- case "{":
1195
- Punctuator.lastIndex = 0;
1196
- isExpression = !TokensNotPrecedingObjectLiteral.test(lastSignificantToken) && (TokensPrecedingExpression.test(lastSignificantToken) || KeywordsWithExpressionAfter.test(lastSignificantToken));
1197
- braces.push(isExpression);
1198
- postfixIncDec = false;
1199
- break;
1200
- case "}":
1201
- switch (mode.tag) {
1202
- case "InterpolationInTemplate":
1203
- if (braces.length === mode.nesting) {
1204
- Template.lastIndex = lastIndex;
1205
- match = Template.exec(input);
1206
- lastIndex = Template.lastIndex;
1207
- lastSignificantToken = match[0];
1208
- if (match[1] === "${") {
1209
- lastSignificantToken = "?InterpolationInTemplate";
1210
- postfixIncDec = false;
1211
- yield {
1212
- type: "TemplateMiddle",
1213
- value: match[0]
1214
- };
1215
- } else {
1216
- stack.pop();
1217
- postfixIncDec = true;
1218
- yield {
1219
- type: "TemplateTail",
1220
- value: match[0],
1221
- closed: match[1] === "`"
1222
- };
1223
- }
1224
- continue;
1225
- }
1226
- break;
1227
- case "InterpolationInJSX": if (braces.length === mode.nesting) {
1228
- stack.pop();
1229
- lastIndex += 1;
1230
- lastSignificantToken = "}";
1231
- yield {
1232
- type: "JSXPunctuator",
1233
- value: "}"
1234
- };
1235
- continue;
1236
- }
1237
- }
1238
- postfixIncDec = braces.pop();
1239
- nextLastSignificantToken = postfixIncDec ? "?ExpressionBraceEnd" : "}";
1240
- break;
1241
- case "]":
1242
- postfixIncDec = true;
1243
- break;
1244
- case "++":
1245
- case "--":
1246
- nextLastSignificantToken = postfixIncDec ? "?PostfixIncDec" : "?UnaryIncDec";
1247
- break;
1248
- case "<":
1249
- if (jsx && (TokensPrecedingExpression.test(lastSignificantToken) || KeywordsWithExpressionAfter.test(lastSignificantToken))) {
1250
- stack.push({ tag: "JSXTag" });
1251
- lastIndex += 1;
1252
- lastSignificantToken = "<";
1253
- yield {
1254
- type: "JSXPunctuator",
1255
- value: punctuator
1256
- };
1257
- continue;
1258
- }
1259
- postfixIncDec = false;
1260
- break;
1261
- default: postfixIncDec = false;
1262
- }
1263
- lastIndex = nextLastIndex;
1264
- lastSignificantToken = nextLastSignificantToken;
1265
- yield {
1266
- type: "Punctuator",
1267
- value: punctuator
1268
- };
1269
- continue;
1270
- }
1271
- Identifier.lastIndex = lastIndex;
1272
- if (match = Identifier.exec(input)) {
1273
- lastIndex = Identifier.lastIndex;
1274
- nextLastSignificantToken = match[0];
1275
- switch (match[0]) {
1276
- case "for":
1277
- case "if":
1278
- case "while":
1279
- case "with": if (lastSignificantToken !== "." && lastSignificantToken !== "?.") nextLastSignificantToken = "?NonExpressionParenKeyword";
1280
- }
1281
- lastSignificantToken = nextLastSignificantToken;
1282
- postfixIncDec = !KeywordsWithExpressionAfter.test(match[0]);
1283
- yield {
1284
- type: match[1] === "#" ? "PrivateIdentifier" : "IdentifierName",
1285
- value: match[0]
1286
- };
1287
- continue;
1288
- }
1289
- StringLiteral.lastIndex = lastIndex;
1290
- if (match = StringLiteral.exec(input)) {
1291
- lastIndex = StringLiteral.lastIndex;
1292
- lastSignificantToken = match[0];
1293
- postfixIncDec = true;
1294
- yield {
1295
- type: "StringLiteral",
1296
- value: match[0],
1297
- closed: match[2] !== void 0
1298
- };
1299
- continue;
1300
- }
1301
- NumericLiteral.lastIndex = lastIndex;
1302
- if (match = NumericLiteral.exec(input)) {
1303
- lastIndex = NumericLiteral.lastIndex;
1304
- lastSignificantToken = match[0];
1305
- postfixIncDec = true;
1306
- yield {
1307
- type: "NumericLiteral",
1308
- value: match[0]
1309
- };
1310
- continue;
1311
- }
1312
- Template.lastIndex = lastIndex;
1313
- if (match = Template.exec(input)) {
1314
- lastIndex = Template.lastIndex;
1315
- lastSignificantToken = match[0];
1316
- if (match[1] === "${") {
1317
- lastSignificantToken = "?InterpolationInTemplate";
1318
- stack.push({
1319
- tag: "InterpolationInTemplate",
1320
- nesting: braces.length
1321
- });
1322
- postfixIncDec = false;
1323
- yield {
1324
- type: "TemplateHead",
1325
- value: match[0]
1326
- };
1327
- } else {
1328
- postfixIncDec = true;
1329
- yield {
1330
- type: "NoSubstitutionTemplate",
1331
- value: match[0],
1332
- closed: match[1] === "`"
1333
- };
1334
- }
1335
- continue;
1336
- }
1337
- break;
1338
- case "JSXTag":
1339
- case "JSXTagEnd":
1340
- JSXPunctuator.lastIndex = lastIndex;
1341
- if (match = JSXPunctuator.exec(input)) {
1342
- lastIndex = JSXPunctuator.lastIndex;
1343
- nextLastSignificantToken = match[0];
1344
- switch (match[0]) {
1345
- case "<":
1346
- stack.push({ tag: "JSXTag" });
1347
- break;
1348
- case ">":
1349
- stack.pop();
1350
- if (lastSignificantToken === "/" || mode.tag === "JSXTagEnd") {
1351
- nextLastSignificantToken = "?JSX";
1352
- postfixIncDec = true;
1353
- } else stack.push({ tag: "JSXChildren" });
1354
- break;
1355
- case "{":
1356
- stack.push({
1357
- tag: "InterpolationInJSX",
1358
- nesting: braces.length
1359
- });
1360
- nextLastSignificantToken = "?InterpolationInJSX";
1361
- postfixIncDec = false;
1362
- break;
1363
- case "/": if (lastSignificantToken === "<") {
1364
- stack.pop();
1365
- if (stack[stack.length - 1].tag === "JSXChildren") stack.pop();
1366
- stack.push({ tag: "JSXTagEnd" });
1367
- }
1368
- }
1369
- lastSignificantToken = nextLastSignificantToken;
1370
- yield {
1371
- type: "JSXPunctuator",
1372
- value: match[0]
1373
- };
1374
- continue;
1375
- }
1376
- JSXIdentifier.lastIndex = lastIndex;
1377
- if (match = JSXIdentifier.exec(input)) {
1378
- lastIndex = JSXIdentifier.lastIndex;
1379
- lastSignificantToken = match[0];
1380
- yield {
1381
- type: "JSXIdentifier",
1382
- value: match[0]
1383
- };
1384
- continue;
1385
- }
1386
- JSXString.lastIndex = lastIndex;
1387
- if (match = JSXString.exec(input)) {
1388
- lastIndex = JSXString.lastIndex;
1389
- lastSignificantToken = match[0];
1390
- yield {
1391
- type: "JSXString",
1392
- value: match[0],
1393
- closed: match[2] !== void 0
1394
- };
1395
- continue;
1396
- }
1397
- break;
1398
- case "JSXChildren":
1399
- JSXText.lastIndex = lastIndex;
1400
- if (match = JSXText.exec(input)) {
1401
- lastIndex = JSXText.lastIndex;
1402
- lastSignificantToken = match[0];
1403
- yield {
1404
- type: "JSXText",
1405
- value: match[0]
1406
- };
1407
- continue;
1408
- }
1409
- switch (input[lastIndex]) {
1410
- case "<":
1411
- stack.push({ tag: "JSXTag" });
1412
- lastIndex++;
1413
- lastSignificantToken = "<";
1414
- yield {
1415
- type: "JSXPunctuator",
1416
- value: "<"
1417
- };
1418
- continue;
1419
- case "{":
1420
- stack.push({
1421
- tag: "InterpolationInJSX",
1422
- nesting: braces.length
1423
- });
1424
- lastIndex++;
1425
- lastSignificantToken = "?InterpolationInJSX";
1426
- postfixIncDec = false;
1427
- yield {
1428
- type: "JSXPunctuator",
1429
- value: "{"
1430
- };
1431
- continue;
1432
- }
1433
- }
1434
- WhiteSpace.lastIndex = lastIndex;
1435
- if (match = WhiteSpace.exec(input)) {
1436
- lastIndex = WhiteSpace.lastIndex;
1437
- yield {
1438
- type: "WhiteSpace",
1439
- value: match[0]
1440
- };
1441
- continue;
1442
- }
1443
- LineTerminatorSequence.lastIndex = lastIndex;
1444
- if (match = LineTerminatorSequence.exec(input)) {
1445
- lastIndex = LineTerminatorSequence.lastIndex;
1446
- postfixIncDec = false;
1447
- if (KeywordsWithNoLineTerminatorAfter.test(lastSignificantToken)) lastSignificantToken = "?NoLineTerminatorHere";
1448
- yield {
1449
- type: "LineTerminatorSequence",
1450
- value: match[0]
1451
- };
1452
- continue;
1453
- }
1454
- MultiLineComment.lastIndex = lastIndex;
1455
- if (match = MultiLineComment.exec(input)) {
1456
- lastIndex = MultiLineComment.lastIndex;
1457
- if (Newline.test(match[0])) {
1458
- postfixIncDec = false;
1459
- if (KeywordsWithNoLineTerminatorAfter.test(lastSignificantToken)) lastSignificantToken = "?NoLineTerminatorHere";
1460
- }
1461
- yield {
1462
- type: "MultiLineComment",
1463
- value: match[0],
1464
- closed: match[1] !== void 0
1465
- };
1466
- continue;
1467
- }
1468
- SingleLineComment.lastIndex = lastIndex;
1469
- if (match = SingleLineComment.exec(input)) {
1470
- lastIndex = SingleLineComment.lastIndex;
1471
- postfixIncDec = false;
1472
- yield {
1473
- type: "SingleLineComment",
1474
- value: match[0]
1475
- };
1476
- continue;
1477
- }
1478
- firstCodePoint = String.fromCodePoint(input.codePointAt(lastIndex));
1479
- lastIndex += firstCodePoint.length;
1480
- lastSignificantToken = firstCodePoint;
1481
- postfixIncDec = false;
1482
- yield {
1483
- type: mode.tag.startsWith("JSX") ? "JSXInvalid" : "Invalid",
1484
- value: firstCodePoint
1485
- };
1486
- }
1487
- };
1488
- }));
1489
-
1490
- //#endregion
1491
- //#region node_modules/.pnpm/strip-literal@3.1.0/node_modules/strip-literal/dist/index.mjs
1492
- var import_js_tokens = /* @__PURE__ */ __toESM(require_js_tokens(), 1);
1493
- const FILL_COMMENT = " ";
1494
- function stripLiteralFromToken(token, fillChar, filter) {
1495
- if (token.type === "SingleLineComment") return FILL_COMMENT.repeat(token.value.length);
1496
- if (token.type === "MultiLineComment") return token.value.replace(/[^\n]/g, FILL_COMMENT);
1497
- if (token.type === "StringLiteral") {
1498
- if (!token.closed) return token.value;
1499
- const body = token.value.slice(1, -1);
1500
- if (filter(body)) return token.value[0] + fillChar.repeat(body.length) + token.value[token.value.length - 1];
1501
- }
1502
- if (token.type === "NoSubstitutionTemplate") {
1503
- const body = token.value.slice(1, -1);
1504
- if (filter(body)) return `\`${body.replace(/[^\n]/g, fillChar)}\``;
1505
- }
1506
- if (token.type === "RegularExpressionLiteral") {
1507
- const body = token.value;
1508
- if (filter(body)) return body.replace(/\/(.*)\/(\w?)$/g, (_, $1, $2) => `/${fillChar.repeat($1.length)}/${$2}`);
1509
- }
1510
- if (token.type === "TemplateHead") {
1511
- const body = token.value.slice(1, -2);
1512
- if (filter(body)) return `\`${body.replace(/[^\n]/g, fillChar)}\${`;
1513
- }
1514
- if (token.type === "TemplateTail") {
1515
- const body = token.value.slice(0, -2);
1516
- if (filter(body)) return `}${body.replace(/[^\n]/g, fillChar)}\``;
1517
- }
1518
- if (token.type === "TemplateMiddle") {
1519
- const body = token.value.slice(1, -2);
1520
- if (filter(body)) return `}${body.replace(/[^\n]/g, fillChar)}\${`;
1521
- }
1522
- return token.value;
1523
- }
1524
- function optionsWithDefaults(options) {
1525
- return {
1526
- fillChar: options?.fillChar ?? " ",
1527
- filter: options?.filter ?? (() => true)
1528
- };
1529
- }
1530
- function stripLiteral(code, options) {
1531
- let result = "";
1532
- const _options = optionsWithDefaults(options);
1533
- for (const token of (0, import_js_tokens.default)(code, { jsx: false })) result += stripLiteralFromToken(token, _options.fillChar, _options.filter);
1534
- return result;
1535
- }
1536
-
1537
- //#endregion
1538
- //#region node_modules/.pnpm/@rolldown+pluginutils@1.0.0-beta.55/node_modules/@rolldown/pluginutils/dist/simple-filters.js
1539
- /**
1540
- * Constructs a RegExp that matches the exact string specified.
1541
- *
1542
- * This is useful for plugin hook filters.
1543
- *
1544
- * @param str the string to match.
1545
- * @param flags flags for the RegExp.
1546
- *
1547
- * @example
1548
- * ```ts
1549
- * import { exactRegex } from '@rolldown/pluginutils';
1550
- * const plugin = {
1551
- * name: 'plugin',
1552
- * resolveId: {
1553
- * filter: { id: exactRegex('foo') },
1554
- * handler(id) {} // will only be called for `foo`
1555
- * }
1556
- * }
1557
- * ```
1558
- */
1559
- function exactRegex(str, flags) {
1560
- return new RegExp(`^${escapeRegex(str)}$`, flags);
1561
- }
1562
- const escapeRegexRE = /[-/\\^$*+?.()|[\]{}]/g;
1563
- function escapeRegex(str) {
1564
- return str.replace(escapeRegexRE, "\\$&");
1565
- }
1566
-
1567
- //#endregion
1568
13
  //#region node_modules/.pnpm/@hiogawa+vite-plugin-fullstack@0.0.11_vite@8.0.0-beta.5_@types+node@25.0.3_jiti@2.6.1_tsx@4.21.0_yaml@2.8.2_/node_modules/@hiogawa/vite-plugin-fullstack/dist/plugin-B4MlD0Bd.js
1569
14
  function parseIdQuery(id) {
1570
15
  if (!id.includes("?")) return {
@@ -2176,4 +621,4 @@ function mergeAssets(...args) {
2176
621
  }
2177
622
 
2178
623
  //#endregion
2179
- export { MagicString as a, stripLiteral as i, runtime_exports as n, decode as o, assetsPlugin as r, encode as s, mergeAssets as t };
624
+ export { runtime_exports as n, assetsPlugin as r, mergeAssets as t };