unplugin-version-injector 2.0.0-beta.1 → 2.0.0-beta.3

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.
package/dist/webpack.js CHANGED
@@ -8,7 +8,2684 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
8
8
  var fs__default = /*#__PURE__*/_interopDefault(fs);
9
9
  var path__default = /*#__PURE__*/_interopDefault(path);
10
10
 
11
- // src/shared/utils.ts
11
+ var __getOwnPropNames = Object.getOwnPropertyNames;
12
+ var __commonJS = (cb, mod) => function __require() {
13
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
14
+ };
15
+
16
+ // node_modules/.pnpm/webpack-sources@3.2.3/node_modules/webpack-sources/lib/Source.js
17
+ var require_Source = __commonJS({
18
+ "node_modules/.pnpm/webpack-sources@3.2.3/node_modules/webpack-sources/lib/Source.js"(exports, module) {
19
+ var Source = class {
20
+ source() {
21
+ throw new Error("Abstract");
22
+ }
23
+ buffer() {
24
+ const source = this.source();
25
+ if (Buffer.isBuffer(source)) return source;
26
+ return Buffer.from(source, "utf-8");
27
+ }
28
+ size() {
29
+ return this.buffer().length;
30
+ }
31
+ map(options) {
32
+ return null;
33
+ }
34
+ sourceAndMap(options) {
35
+ return {
36
+ source: this.source(),
37
+ map: this.map(options)
38
+ };
39
+ }
40
+ updateHash(hash) {
41
+ throw new Error("Abstract");
42
+ }
43
+ };
44
+ module.exports = Source;
45
+ }
46
+ });
47
+
48
+ // node_modules/.pnpm/webpack-sources@3.2.3/node_modules/webpack-sources/lib/helpers/getGeneratedSourceInfo.js
49
+ var require_getGeneratedSourceInfo = __commonJS({
50
+ "node_modules/.pnpm/webpack-sources@3.2.3/node_modules/webpack-sources/lib/helpers/getGeneratedSourceInfo.js"(exports, module) {
51
+ var CHAR_CODE_NEW_LINE = "\n".charCodeAt(0);
52
+ var getGeneratedSourceInfo = (source) => {
53
+ if (source === void 0) {
54
+ return {};
55
+ }
56
+ const lastLineStart = source.lastIndexOf("\n");
57
+ if (lastLineStart === -1) {
58
+ return {
59
+ generatedLine: 1,
60
+ generatedColumn: source.length,
61
+ source
62
+ };
63
+ }
64
+ let generatedLine = 2;
65
+ for (let i = 0; i < lastLineStart; i++) {
66
+ if (source.charCodeAt(i) === CHAR_CODE_NEW_LINE) generatedLine++;
67
+ }
68
+ return {
69
+ generatedLine,
70
+ generatedColumn: source.length - lastLineStart - 1,
71
+ source
72
+ };
73
+ };
74
+ module.exports = getGeneratedSourceInfo;
75
+ }
76
+ });
77
+
78
+ // node_modules/.pnpm/webpack-sources@3.2.3/node_modules/webpack-sources/lib/helpers/splitIntoLines.js
79
+ var require_splitIntoLines = __commonJS({
80
+ "node_modules/.pnpm/webpack-sources@3.2.3/node_modules/webpack-sources/lib/helpers/splitIntoLines.js"(exports, module) {
81
+ var splitIntoLines = (str) => {
82
+ const results = [];
83
+ const len = str.length;
84
+ let i = 0;
85
+ for (; i < len; ) {
86
+ const cc = str.charCodeAt(i);
87
+ if (cc === 10) {
88
+ results.push("\n");
89
+ i++;
90
+ } else {
91
+ let j = i + 1;
92
+ while (j < len && str.charCodeAt(j) !== 10) j++;
93
+ results.push(str.slice(i, j + 1));
94
+ i = j + 1;
95
+ }
96
+ }
97
+ return results;
98
+ };
99
+ module.exports = splitIntoLines;
100
+ }
101
+ });
102
+
103
+ // node_modules/.pnpm/webpack-sources@3.2.3/node_modules/webpack-sources/lib/helpers/streamChunksOfRawSource.js
104
+ var require_streamChunksOfRawSource = __commonJS({
105
+ "node_modules/.pnpm/webpack-sources@3.2.3/node_modules/webpack-sources/lib/helpers/streamChunksOfRawSource.js"(exports, module) {
106
+ var getGeneratedSourceInfo = require_getGeneratedSourceInfo();
107
+ var splitIntoLines = require_splitIntoLines();
108
+ var streamChunksOfRawSource = (source, onChunk, onSource, onName) => {
109
+ let line = 1;
110
+ const matches = splitIntoLines(source);
111
+ let match;
112
+ for (match of matches) {
113
+ onChunk(match, line, 0, -1, -1, -1, -1);
114
+ line++;
115
+ }
116
+ return matches.length === 0 || match.endsWith("\n") ? {
117
+ generatedLine: matches.length + 1,
118
+ generatedColumn: 0
119
+ } : {
120
+ generatedLine: matches.length,
121
+ generatedColumn: match.length
122
+ };
123
+ };
124
+ module.exports = (source, onChunk, onSource, onName, finalSource) => {
125
+ return finalSource ? getGeneratedSourceInfo(source) : streamChunksOfRawSource(source, onChunk);
126
+ };
127
+ }
128
+ });
129
+
130
+ // node_modules/.pnpm/webpack-sources@3.2.3/node_modules/webpack-sources/lib/RawSource.js
131
+ var require_RawSource = __commonJS({
132
+ "node_modules/.pnpm/webpack-sources@3.2.3/node_modules/webpack-sources/lib/RawSource.js"(exports, module) {
133
+ var streamChunksOfRawSource = require_streamChunksOfRawSource();
134
+ var Source = require_Source();
135
+ var RawSource = class extends Source {
136
+ constructor(value, convertToString = false) {
137
+ super();
138
+ const isBuffer = Buffer.isBuffer(value);
139
+ if (!isBuffer && typeof value !== "string") {
140
+ throw new TypeError("argument 'value' must be either string of Buffer");
141
+ }
142
+ this._valueIsBuffer = !convertToString && isBuffer;
143
+ this._value = convertToString && isBuffer ? void 0 : value;
144
+ this._valueAsBuffer = isBuffer ? value : void 0;
145
+ this._valueAsString = isBuffer ? void 0 : value;
146
+ }
147
+ isBuffer() {
148
+ return this._valueIsBuffer;
149
+ }
150
+ source() {
151
+ if (this._value === void 0) {
152
+ this._value = this._valueAsBuffer.toString("utf-8");
153
+ }
154
+ return this._value;
155
+ }
156
+ buffer() {
157
+ if (this._valueAsBuffer === void 0) {
158
+ this._valueAsBuffer = Buffer.from(this._value, "utf-8");
159
+ }
160
+ return this._valueAsBuffer;
161
+ }
162
+ map(options) {
163
+ return null;
164
+ }
165
+ /**
166
+ * @param {object} options options
167
+ * @param {function(string, number, number, number, number, number, number): void} onChunk called for each chunk of code
168
+ * @param {function(number, string, string)} onSource called for each source
169
+ * @param {function(number, string)} onName called for each name
170
+ * @returns {void}
171
+ */
172
+ streamChunks(options, onChunk, onSource, onName) {
173
+ if (this._value === void 0) {
174
+ this._value = Buffer.from(this._valueAsBuffer, "utf-8");
175
+ }
176
+ if (this._valueAsString === void 0) {
177
+ this._valueAsString = typeof this._value === "string" ? this._value : this._value.toString("utf-8");
178
+ }
179
+ return streamChunksOfRawSource(
180
+ this._valueAsString,
181
+ onChunk,
182
+ onSource,
183
+ onName,
184
+ !!(options && options.finalSource)
185
+ );
186
+ }
187
+ updateHash(hash) {
188
+ if (this._valueAsBuffer === void 0) {
189
+ this._valueAsBuffer = Buffer.from(this._value, "utf-8");
190
+ }
191
+ hash.update("RawSource");
192
+ hash.update(this._valueAsBuffer);
193
+ }
194
+ };
195
+ module.exports = RawSource;
196
+ }
197
+ });
198
+
199
+ // node_modules/.pnpm/webpack-sources@3.2.3/node_modules/webpack-sources/lib/helpers/createMappingsSerializer.js
200
+ var require_createMappingsSerializer = __commonJS({
201
+ "node_modules/.pnpm/webpack-sources@3.2.3/node_modules/webpack-sources/lib/helpers/createMappingsSerializer.js"(exports, module) {
202
+ var ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(
203
+ ""
204
+ );
205
+ var CONTINUATION_BIT = 32;
206
+ var createMappingsSerializer = (options) => {
207
+ const linesOnly = options && options.columns === false;
208
+ return linesOnly ? createLinesOnlyMappingsSerializer() : createFullMappingsSerializer();
209
+ };
210
+ var createFullMappingsSerializer = () => {
211
+ let currentLine = 1;
212
+ let currentColumn = 0;
213
+ let currentSourceIndex = 0;
214
+ let currentOriginalLine = 1;
215
+ let currentOriginalColumn = 0;
216
+ let currentNameIndex = 0;
217
+ let activeMapping = false;
218
+ let activeName = false;
219
+ let initial = true;
220
+ return (generatedLine, generatedColumn, sourceIndex, originalLine, originalColumn, nameIndex) => {
221
+ if (activeMapping && currentLine === generatedLine) {
222
+ if (sourceIndex === currentSourceIndex && originalLine === currentOriginalLine && originalColumn === currentOriginalColumn && !activeName && nameIndex < 0) {
223
+ return "";
224
+ }
225
+ } else {
226
+ if (sourceIndex < 0) {
227
+ return "";
228
+ }
229
+ }
230
+ let str;
231
+ if (currentLine < generatedLine) {
232
+ str = ";".repeat(generatedLine - currentLine);
233
+ currentLine = generatedLine;
234
+ currentColumn = 0;
235
+ initial = false;
236
+ } else if (initial) {
237
+ str = "";
238
+ initial = false;
239
+ } else {
240
+ str = ",";
241
+ }
242
+ const writeValue = (value) => {
243
+ const sign = value >>> 31 & 1;
244
+ const mask = value >> 31;
245
+ const absValue = value + mask ^ mask;
246
+ let data = absValue << 1 | sign;
247
+ for (; ; ) {
248
+ const sextet = data & 31;
249
+ data >>= 5;
250
+ if (data === 0) {
251
+ str += ALPHABET[sextet];
252
+ break;
253
+ } else {
254
+ str += ALPHABET[sextet | CONTINUATION_BIT];
255
+ }
256
+ }
257
+ };
258
+ writeValue(generatedColumn - currentColumn);
259
+ currentColumn = generatedColumn;
260
+ if (sourceIndex >= 0) {
261
+ activeMapping = true;
262
+ if (sourceIndex === currentSourceIndex) {
263
+ str += "A";
264
+ } else {
265
+ writeValue(sourceIndex - currentSourceIndex);
266
+ currentSourceIndex = sourceIndex;
267
+ }
268
+ writeValue(originalLine - currentOriginalLine);
269
+ currentOriginalLine = originalLine;
270
+ if (originalColumn === currentOriginalColumn) {
271
+ str += "A";
272
+ } else {
273
+ writeValue(originalColumn - currentOriginalColumn);
274
+ currentOriginalColumn = originalColumn;
275
+ }
276
+ if (nameIndex >= 0) {
277
+ writeValue(nameIndex - currentNameIndex);
278
+ currentNameIndex = nameIndex;
279
+ activeName = true;
280
+ } else {
281
+ activeName = false;
282
+ }
283
+ } else {
284
+ activeMapping = false;
285
+ }
286
+ return str;
287
+ };
288
+ };
289
+ var createLinesOnlyMappingsSerializer = () => {
290
+ let lastWrittenLine = 0;
291
+ let currentLine = 1;
292
+ let currentSourceIndex = 0;
293
+ let currentOriginalLine = 1;
294
+ return (generatedLine, _generatedColumn, sourceIndex, originalLine, _originalColumn, _nameIndex) => {
295
+ if (sourceIndex < 0) {
296
+ return "";
297
+ }
298
+ if (lastWrittenLine === generatedLine) {
299
+ return "";
300
+ }
301
+ let str;
302
+ const writeValue = (value) => {
303
+ const sign = value >>> 31 & 1;
304
+ const mask = value >> 31;
305
+ const absValue = value + mask ^ mask;
306
+ let data = absValue << 1 | sign;
307
+ for (; ; ) {
308
+ const sextet = data & 31;
309
+ data >>= 5;
310
+ if (data === 0) {
311
+ str += ALPHABET[sextet];
312
+ break;
313
+ } else {
314
+ str += ALPHABET[sextet | CONTINUATION_BIT];
315
+ }
316
+ }
317
+ };
318
+ lastWrittenLine = generatedLine;
319
+ if (generatedLine === currentLine + 1) {
320
+ currentLine = generatedLine;
321
+ if (sourceIndex === currentSourceIndex) {
322
+ currentSourceIndex = sourceIndex;
323
+ if (originalLine === currentOriginalLine + 1) {
324
+ currentOriginalLine = originalLine;
325
+ return ";AACA";
326
+ } else {
327
+ str = ";AA";
328
+ writeValue(originalLine - currentOriginalLine);
329
+ currentOriginalLine = originalLine;
330
+ return str + "A";
331
+ }
332
+ } else {
333
+ str = ";A";
334
+ writeValue(sourceIndex - currentSourceIndex);
335
+ currentSourceIndex = sourceIndex;
336
+ writeValue(originalLine - currentOriginalLine);
337
+ currentOriginalLine = originalLine;
338
+ return str + "A";
339
+ }
340
+ } else {
341
+ str = ";".repeat(generatedLine - currentLine);
342
+ currentLine = generatedLine;
343
+ if (sourceIndex === currentSourceIndex) {
344
+ currentSourceIndex = sourceIndex;
345
+ if (originalLine === currentOriginalLine + 1) {
346
+ currentOriginalLine = originalLine;
347
+ return str + "AACA";
348
+ } else {
349
+ str += "AA";
350
+ writeValue(originalLine - currentOriginalLine);
351
+ currentOriginalLine = originalLine;
352
+ return str + "A";
353
+ }
354
+ } else {
355
+ str += "A";
356
+ writeValue(sourceIndex - currentSourceIndex);
357
+ currentSourceIndex = sourceIndex;
358
+ writeValue(originalLine - currentOriginalLine);
359
+ currentOriginalLine = originalLine;
360
+ return str + "A";
361
+ }
362
+ }
363
+ };
364
+ };
365
+ module.exports = createMappingsSerializer;
366
+ }
367
+ });
368
+
369
+ // node_modules/.pnpm/webpack-sources@3.2.3/node_modules/webpack-sources/lib/helpers/getFromStreamChunks.js
370
+ var require_getFromStreamChunks = __commonJS({
371
+ "node_modules/.pnpm/webpack-sources@3.2.3/node_modules/webpack-sources/lib/helpers/getFromStreamChunks.js"(exports) {
372
+ var createMappingsSerializer = require_createMappingsSerializer();
373
+ exports.getSourceAndMap = (inputSource, options) => {
374
+ let code = "";
375
+ let mappings = "";
376
+ let sources = [];
377
+ let sourcesContent = [];
378
+ let names = [];
379
+ const addMapping = createMappingsSerializer(options);
380
+ const { source } = inputSource.streamChunks(
381
+ Object.assign({}, options, { finalSource: true }),
382
+ (chunk, generatedLine, generatedColumn, sourceIndex, originalLine, originalColumn, nameIndex) => {
383
+ if (chunk !== void 0) code += chunk;
384
+ mappings += addMapping(
385
+ generatedLine,
386
+ generatedColumn,
387
+ sourceIndex,
388
+ originalLine,
389
+ originalColumn,
390
+ nameIndex
391
+ );
392
+ },
393
+ (sourceIndex, source2, sourceContent) => {
394
+ while (sources.length < sourceIndex) {
395
+ sources.push(null);
396
+ }
397
+ sources[sourceIndex] = source2;
398
+ if (sourceContent !== void 0) {
399
+ while (sourcesContent.length < sourceIndex) {
400
+ sourcesContent.push(null);
401
+ }
402
+ sourcesContent[sourceIndex] = sourceContent;
403
+ }
404
+ },
405
+ (nameIndex, name) => {
406
+ while (names.length < nameIndex) {
407
+ names.push(null);
408
+ }
409
+ names[nameIndex] = name;
410
+ }
411
+ );
412
+ return {
413
+ source: source !== void 0 ? source : code,
414
+ map: mappings.length > 0 ? {
415
+ version: 3,
416
+ file: "x",
417
+ mappings,
418
+ sources,
419
+ sourcesContent: sourcesContent.length > 0 ? sourcesContent : void 0,
420
+ names
421
+ } : null
422
+ };
423
+ };
424
+ exports.getMap = (source, options) => {
425
+ let mappings = "";
426
+ let sources = [];
427
+ let sourcesContent = [];
428
+ let names = [];
429
+ const addMapping = createMappingsSerializer(options);
430
+ source.streamChunks(
431
+ Object.assign({}, options, { source: false, finalSource: true }),
432
+ (chunk, generatedLine, generatedColumn, sourceIndex, originalLine, originalColumn, nameIndex) => {
433
+ mappings += addMapping(
434
+ generatedLine,
435
+ generatedColumn,
436
+ sourceIndex,
437
+ originalLine,
438
+ originalColumn,
439
+ nameIndex
440
+ );
441
+ },
442
+ (sourceIndex, source2, sourceContent) => {
443
+ while (sources.length < sourceIndex) {
444
+ sources.push(null);
445
+ }
446
+ sources[sourceIndex] = source2;
447
+ if (sourceContent !== void 0) {
448
+ while (sourcesContent.length < sourceIndex) {
449
+ sourcesContent.push(null);
450
+ }
451
+ sourcesContent[sourceIndex] = sourceContent;
452
+ }
453
+ },
454
+ (nameIndex, name) => {
455
+ while (names.length < nameIndex) {
456
+ names.push(null);
457
+ }
458
+ names[nameIndex] = name;
459
+ }
460
+ );
461
+ return mappings.length > 0 ? {
462
+ version: 3,
463
+ file: "x",
464
+ mappings,
465
+ sources,
466
+ sourcesContent: sourcesContent.length > 0 ? sourcesContent : void 0,
467
+ names
468
+ } : null;
469
+ };
470
+ }
471
+ });
472
+
473
+ // node_modules/.pnpm/webpack-sources@3.2.3/node_modules/webpack-sources/lib/helpers/splitIntoPotentialTokens.js
474
+ var require_splitIntoPotentialTokens = __commonJS({
475
+ "node_modules/.pnpm/webpack-sources@3.2.3/node_modules/webpack-sources/lib/helpers/splitIntoPotentialTokens.js"(exports, module) {
476
+ var splitIntoPotentialTokens = (str) => {
477
+ const len = str.length;
478
+ if (len === 0) return null;
479
+ const results = [];
480
+ let i = 0;
481
+ for (; i < len; ) {
482
+ const s = i;
483
+ block: {
484
+ let cc = str.charCodeAt(i);
485
+ while (cc !== 10 && cc !== 59 && cc !== 123 && cc !== 125) {
486
+ if (++i >= len) break block;
487
+ cc = str.charCodeAt(i);
488
+ }
489
+ while (cc === 59 || cc === 32 || cc === 123 || cc === 125 || cc === 13 || cc === 9) {
490
+ if (++i >= len) break block;
491
+ cc = str.charCodeAt(i);
492
+ }
493
+ if (cc === 10) {
494
+ i++;
495
+ }
496
+ }
497
+ results.push(str.slice(s, i));
498
+ }
499
+ return results;
500
+ };
501
+ module.exports = splitIntoPotentialTokens;
502
+ }
503
+ });
504
+
505
+ // node_modules/.pnpm/webpack-sources@3.2.3/node_modules/webpack-sources/lib/OriginalSource.js
506
+ var require_OriginalSource = __commonJS({
507
+ "node_modules/.pnpm/webpack-sources@3.2.3/node_modules/webpack-sources/lib/OriginalSource.js"(exports, module) {
508
+ var { getMap, getSourceAndMap } = require_getFromStreamChunks();
509
+ var splitIntoLines = require_splitIntoLines();
510
+ var getGeneratedSourceInfo = require_getGeneratedSourceInfo();
511
+ var Source = require_Source();
512
+ var splitIntoPotentialTokens = require_splitIntoPotentialTokens();
513
+ var OriginalSource = class extends Source {
514
+ constructor(value, name) {
515
+ super();
516
+ const isBuffer = Buffer.isBuffer(value);
517
+ this._value = isBuffer ? void 0 : value;
518
+ this._valueAsBuffer = isBuffer ? value : void 0;
519
+ this._name = name;
520
+ }
521
+ getName() {
522
+ return this._name;
523
+ }
524
+ source() {
525
+ if (this._value === void 0) {
526
+ this._value = this._valueAsBuffer.toString("utf-8");
527
+ }
528
+ return this._value;
529
+ }
530
+ buffer() {
531
+ if (this._valueAsBuffer === void 0) {
532
+ this._valueAsBuffer = Buffer.from(this._value, "utf-8");
533
+ }
534
+ return this._valueAsBuffer;
535
+ }
536
+ map(options) {
537
+ return getMap(this, options);
538
+ }
539
+ sourceAndMap(options) {
540
+ return getSourceAndMap(this, options);
541
+ }
542
+ /**
543
+ * @param {object} options options
544
+ * @param {function(string, number, number, number, number, number, number): void} onChunk called for each chunk of code
545
+ * @param {function(number, string, string)} onSource called for each source
546
+ * @param {function(number, string)} onName called for each name
547
+ * @returns {void}
548
+ */
549
+ streamChunks(options, onChunk, onSource, onName) {
550
+ if (this._value === void 0) {
551
+ this._value = this._valueAsBuffer.toString("utf-8");
552
+ }
553
+ onSource(0, this._name, this._value);
554
+ const finalSource = !!(options && options.finalSource);
555
+ if (!options || options.columns !== false) {
556
+ const matches = splitIntoPotentialTokens(this._value);
557
+ let line = 1;
558
+ let column = 0;
559
+ if (matches !== null) {
560
+ for (const match of matches) {
561
+ const isEndOfLine = match.endsWith("\n");
562
+ if (isEndOfLine && match.length === 1) {
563
+ if (!finalSource) onChunk(match, line, column, -1, -1, -1, -1);
564
+ } else {
565
+ const chunk = finalSource ? void 0 : match;
566
+ onChunk(chunk, line, column, 0, line, column, -1);
567
+ }
568
+ if (isEndOfLine) {
569
+ line++;
570
+ column = 0;
571
+ } else {
572
+ column += match.length;
573
+ }
574
+ }
575
+ }
576
+ return {
577
+ generatedLine: line,
578
+ generatedColumn: column,
579
+ source: finalSource ? this._value : void 0
580
+ };
581
+ } else if (finalSource) {
582
+ const result = getGeneratedSourceInfo(this._value);
583
+ const { generatedLine, generatedColumn } = result;
584
+ if (generatedColumn === 0) {
585
+ for (let line = 1; line < generatedLine; line++)
586
+ onChunk(void 0, line, 0, 0, line, 0, -1);
587
+ } else {
588
+ for (let line = 1; line <= generatedLine; line++)
589
+ onChunk(void 0, line, 0, 0, line, 0, -1);
590
+ }
591
+ return result;
592
+ } else {
593
+ let line = 1;
594
+ const matches = splitIntoLines(this._value);
595
+ let match;
596
+ for (match of matches) {
597
+ onChunk(finalSource ? void 0 : match, line, 0, 0, line, 0, -1);
598
+ line++;
599
+ }
600
+ return matches.length === 0 || match.endsWith("\n") ? {
601
+ generatedLine: matches.length + 1,
602
+ generatedColumn: 0,
603
+ source: finalSource ? this._value : void 0
604
+ } : {
605
+ generatedLine: matches.length,
606
+ generatedColumn: match.length,
607
+ source: finalSource ? this._value : void 0
608
+ };
609
+ }
610
+ }
611
+ updateHash(hash) {
612
+ if (this._valueAsBuffer === void 0) {
613
+ this._valueAsBuffer = Buffer.from(this._value, "utf-8");
614
+ }
615
+ hash.update("OriginalSource");
616
+ hash.update(this._valueAsBuffer);
617
+ hash.update(this._name || "");
618
+ }
619
+ };
620
+ module.exports = OriginalSource;
621
+ }
622
+ });
623
+
624
+ // node_modules/.pnpm/webpack-sources@3.2.3/node_modules/webpack-sources/lib/helpers/getSource.js
625
+ var require_getSource = __commonJS({
626
+ "node_modules/.pnpm/webpack-sources@3.2.3/node_modules/webpack-sources/lib/helpers/getSource.js"(exports, module) {
627
+ var getSource = (sourceMap, index) => {
628
+ if (index < 0) return null;
629
+ const { sourceRoot, sources } = sourceMap;
630
+ const source = sources[index];
631
+ if (!sourceRoot) return source;
632
+ if (sourceRoot.endsWith("/")) return sourceRoot + source;
633
+ return sourceRoot + "/" + source;
634
+ };
635
+ module.exports = getSource;
636
+ }
637
+ });
638
+
639
+ // node_modules/.pnpm/webpack-sources@3.2.3/node_modules/webpack-sources/lib/helpers/readMappings.js
640
+ var require_readMappings = __commonJS({
641
+ "node_modules/.pnpm/webpack-sources@3.2.3/node_modules/webpack-sources/lib/helpers/readMappings.js"(exports, module) {
642
+ var ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
643
+ var CONTINUATION_BIT = 32;
644
+ var END_SEGMENT_BIT = 64;
645
+ var NEXT_LINE = END_SEGMENT_BIT | 1;
646
+ var INVALID = END_SEGMENT_BIT | 2;
647
+ var DATA_MASK = 31;
648
+ var ccToValue = new Uint8Array("z".charCodeAt(0) + 1);
649
+ {
650
+ ccToValue.fill(INVALID);
651
+ for (let i = 0; i < ALPHABET.length; i++) {
652
+ ccToValue[ALPHABET.charCodeAt(i)] = i;
653
+ }
654
+ ccToValue[",".charCodeAt(0)] = END_SEGMENT_BIT;
655
+ ccToValue[";".charCodeAt(0)] = NEXT_LINE;
656
+ }
657
+ var ccMax = ccToValue.length - 1;
658
+ var readMappings = (mappings, onMapping) => {
659
+ const currentData = new Uint32Array([0, 0, 1, 0, 0]);
660
+ let currentDataPos = 0;
661
+ let currentValue = 0;
662
+ let currentValuePos = 0;
663
+ let generatedLine = 1;
664
+ let generatedColumn = -1;
665
+ for (let i = 0; i < mappings.length; i++) {
666
+ const cc = mappings.charCodeAt(i);
667
+ if (cc > ccMax) continue;
668
+ const value = ccToValue[cc];
669
+ if ((value & END_SEGMENT_BIT) !== 0) {
670
+ if (currentData[0] > generatedColumn) {
671
+ if (currentDataPos === 1) {
672
+ onMapping(generatedLine, currentData[0], -1, -1, -1, -1);
673
+ } else if (currentDataPos === 4) {
674
+ onMapping(
675
+ generatedLine,
676
+ currentData[0],
677
+ currentData[1],
678
+ currentData[2],
679
+ currentData[3],
680
+ -1
681
+ );
682
+ } else if (currentDataPos === 5) {
683
+ onMapping(
684
+ generatedLine,
685
+ currentData[0],
686
+ currentData[1],
687
+ currentData[2],
688
+ currentData[3],
689
+ currentData[4]
690
+ );
691
+ }
692
+ generatedColumn = currentData[0];
693
+ }
694
+ currentDataPos = 0;
695
+ if (value === NEXT_LINE) {
696
+ generatedLine++;
697
+ currentData[0] = 0;
698
+ generatedColumn = -1;
699
+ }
700
+ } else if ((value & CONTINUATION_BIT) === 0) {
701
+ currentValue |= value << currentValuePos;
702
+ const finalValue = currentValue & 1 ? -(currentValue >> 1) : currentValue >> 1;
703
+ currentData[currentDataPos++] += finalValue;
704
+ currentValuePos = 0;
705
+ currentValue = 0;
706
+ } else {
707
+ currentValue |= (value & DATA_MASK) << currentValuePos;
708
+ currentValuePos += 5;
709
+ }
710
+ }
711
+ if (currentDataPos === 1) {
712
+ onMapping(generatedLine, currentData[0], -1, -1, -1, -1);
713
+ } else if (currentDataPos === 4) {
714
+ onMapping(
715
+ generatedLine,
716
+ currentData[0],
717
+ currentData[1],
718
+ currentData[2],
719
+ currentData[3],
720
+ -1
721
+ );
722
+ } else if (currentDataPos === 5) {
723
+ onMapping(
724
+ generatedLine,
725
+ currentData[0],
726
+ currentData[1],
727
+ currentData[2],
728
+ currentData[3],
729
+ currentData[4]
730
+ );
731
+ }
732
+ };
733
+ module.exports = readMappings;
734
+ }
735
+ });
736
+
737
+ // node_modules/.pnpm/webpack-sources@3.2.3/node_modules/webpack-sources/lib/helpers/streamChunksOfSourceMap.js
738
+ var require_streamChunksOfSourceMap = __commonJS({
739
+ "node_modules/.pnpm/webpack-sources@3.2.3/node_modules/webpack-sources/lib/helpers/streamChunksOfSourceMap.js"(exports, module) {
740
+ var getGeneratedSourceInfo = require_getGeneratedSourceInfo();
741
+ var getSource = require_getSource();
742
+ var readMappings = require_readMappings();
743
+ var splitIntoLines = require_splitIntoLines();
744
+ var streamChunksOfSourceMapFull = (source, sourceMap, onChunk, onSource, onName) => {
745
+ const lines = splitIntoLines(source);
746
+ if (lines.length === 0) {
747
+ return {
748
+ generatedLine: 1,
749
+ generatedColumn: 0
750
+ };
751
+ }
752
+ const { sources, sourcesContent, names, mappings } = sourceMap;
753
+ for (let i = 0; i < sources.length; i++) {
754
+ onSource(
755
+ i,
756
+ getSource(sourceMap, i),
757
+ sourcesContent && sourcesContent[i] || void 0
758
+ );
759
+ }
760
+ if (names) {
761
+ for (let i = 0; i < names.length; i++) {
762
+ onName(i, names[i]);
763
+ }
764
+ }
765
+ const lastLine = lines[lines.length - 1];
766
+ const lastNewLine = lastLine.endsWith("\n");
767
+ const finalLine = lastNewLine ? lines.length + 1 : lines.length;
768
+ const finalColumn = lastNewLine ? 0 : lastLine.length;
769
+ let currentGeneratedLine = 1;
770
+ let currentGeneratedColumn = 0;
771
+ let mappingActive = false;
772
+ let activeMappingSourceIndex = -1;
773
+ let activeMappingOriginalLine = -1;
774
+ let activeMappingOriginalColumn = -1;
775
+ let activeMappingNameIndex = -1;
776
+ const onMapping = (generatedLine, generatedColumn, sourceIndex, originalLine, originalColumn, nameIndex) => {
777
+ if (mappingActive && currentGeneratedLine <= lines.length) {
778
+ let chunk;
779
+ const mappingLine = currentGeneratedLine;
780
+ const mappingColumn = currentGeneratedColumn;
781
+ const line = lines[currentGeneratedLine - 1];
782
+ if (generatedLine !== currentGeneratedLine) {
783
+ chunk = line.slice(currentGeneratedColumn);
784
+ currentGeneratedLine++;
785
+ currentGeneratedColumn = 0;
786
+ } else {
787
+ chunk = line.slice(currentGeneratedColumn, generatedColumn);
788
+ currentGeneratedColumn = generatedColumn;
789
+ }
790
+ if (chunk) {
791
+ onChunk(
792
+ chunk,
793
+ mappingLine,
794
+ mappingColumn,
795
+ activeMappingSourceIndex,
796
+ activeMappingOriginalLine,
797
+ activeMappingOriginalColumn,
798
+ activeMappingNameIndex
799
+ );
800
+ }
801
+ mappingActive = false;
802
+ }
803
+ if (generatedLine > currentGeneratedLine && currentGeneratedColumn > 0) {
804
+ if (currentGeneratedLine <= lines.length) {
805
+ const chunk = lines[currentGeneratedLine - 1].slice(
806
+ currentGeneratedColumn
807
+ );
808
+ onChunk(
809
+ chunk,
810
+ currentGeneratedLine,
811
+ currentGeneratedColumn,
812
+ -1,
813
+ -1,
814
+ -1,
815
+ -1
816
+ );
817
+ }
818
+ currentGeneratedLine++;
819
+ currentGeneratedColumn = 0;
820
+ }
821
+ while (generatedLine > currentGeneratedLine) {
822
+ if (currentGeneratedLine <= lines.length) {
823
+ onChunk(
824
+ lines[currentGeneratedLine - 1],
825
+ currentGeneratedLine,
826
+ 0,
827
+ -1,
828
+ -1,
829
+ -1,
830
+ -1
831
+ );
832
+ }
833
+ currentGeneratedLine++;
834
+ }
835
+ if (generatedColumn > currentGeneratedColumn) {
836
+ if (currentGeneratedLine <= lines.length) {
837
+ const chunk = lines[currentGeneratedLine - 1].slice(
838
+ currentGeneratedColumn,
839
+ generatedColumn
840
+ );
841
+ onChunk(
842
+ chunk,
843
+ currentGeneratedLine,
844
+ currentGeneratedColumn,
845
+ -1,
846
+ -1,
847
+ -1,
848
+ -1
849
+ );
850
+ }
851
+ currentGeneratedColumn = generatedColumn;
852
+ }
853
+ if (sourceIndex >= 0 && (generatedLine < finalLine || generatedLine === finalLine && generatedColumn < finalColumn)) {
854
+ mappingActive = true;
855
+ activeMappingSourceIndex = sourceIndex;
856
+ activeMappingOriginalLine = originalLine;
857
+ activeMappingOriginalColumn = originalColumn;
858
+ activeMappingNameIndex = nameIndex;
859
+ }
860
+ };
861
+ readMappings(mappings, onMapping);
862
+ onMapping(finalLine, finalColumn, -1, -1, -1, -1);
863
+ return {
864
+ generatedLine: finalLine,
865
+ generatedColumn: finalColumn
866
+ };
867
+ };
868
+ var streamChunksOfSourceMapLinesFull = (source, sourceMap, onChunk, onSource, _onName) => {
869
+ const lines = splitIntoLines(source);
870
+ if (lines.length === 0) {
871
+ return {
872
+ generatedLine: 1,
873
+ generatedColumn: 0
874
+ };
875
+ }
876
+ const { sources, sourcesContent, mappings } = sourceMap;
877
+ for (let i = 0; i < sources.length; i++) {
878
+ onSource(
879
+ i,
880
+ getSource(sourceMap, i),
881
+ sourcesContent && sourcesContent[i] || void 0
882
+ );
883
+ }
884
+ let currentGeneratedLine = 1;
885
+ const onMapping = (generatedLine, _generatedColumn, sourceIndex, originalLine, originalColumn, _nameIndex) => {
886
+ if (sourceIndex < 0 || generatedLine < currentGeneratedLine || generatedLine > lines.length) {
887
+ return;
888
+ }
889
+ while (generatedLine > currentGeneratedLine) {
890
+ if (currentGeneratedLine <= lines.length) {
891
+ onChunk(
892
+ lines[currentGeneratedLine - 1],
893
+ currentGeneratedLine,
894
+ 0,
895
+ -1,
896
+ -1,
897
+ -1,
898
+ -1
899
+ );
900
+ }
901
+ currentGeneratedLine++;
902
+ }
903
+ if (generatedLine <= lines.length) {
904
+ onChunk(
905
+ lines[generatedLine - 1],
906
+ generatedLine,
907
+ 0,
908
+ sourceIndex,
909
+ originalLine,
910
+ originalColumn,
911
+ -1
912
+ );
913
+ currentGeneratedLine++;
914
+ }
915
+ };
916
+ readMappings(mappings, onMapping);
917
+ for (; currentGeneratedLine <= lines.length; currentGeneratedLine++) {
918
+ onChunk(
919
+ lines[currentGeneratedLine - 1],
920
+ currentGeneratedLine,
921
+ 0,
922
+ -1,
923
+ -1,
924
+ -1,
925
+ -1
926
+ );
927
+ }
928
+ const lastLine = lines[lines.length - 1];
929
+ const lastNewLine = lastLine.endsWith("\n");
930
+ const finalLine = lastNewLine ? lines.length + 1 : lines.length;
931
+ const finalColumn = lastNewLine ? 0 : lastLine.length;
932
+ return {
933
+ generatedLine: finalLine,
934
+ generatedColumn: finalColumn
935
+ };
936
+ };
937
+ var streamChunksOfSourceMapFinal = (source, sourceMap, onChunk, onSource, onName) => {
938
+ const result = getGeneratedSourceInfo(source);
939
+ const { generatedLine: finalLine, generatedColumn: finalColumn } = result;
940
+ if (finalLine === 1 && finalColumn === 0) return result;
941
+ const { sources, sourcesContent, names, mappings } = sourceMap;
942
+ for (let i = 0; i < sources.length; i++) {
943
+ onSource(
944
+ i,
945
+ getSource(sourceMap, i),
946
+ sourcesContent && sourcesContent[i] || void 0
947
+ );
948
+ }
949
+ if (names) {
950
+ for (let i = 0; i < names.length; i++) {
951
+ onName(i, names[i]);
952
+ }
953
+ }
954
+ let mappingActiveLine = 0;
955
+ const onMapping = (generatedLine, generatedColumn, sourceIndex, originalLine, originalColumn, nameIndex) => {
956
+ if (generatedLine >= finalLine && (generatedColumn >= finalColumn || generatedLine > finalLine)) {
957
+ return;
958
+ }
959
+ if (sourceIndex >= 0) {
960
+ onChunk(
961
+ void 0,
962
+ generatedLine,
963
+ generatedColumn,
964
+ sourceIndex,
965
+ originalLine,
966
+ originalColumn,
967
+ nameIndex
968
+ );
969
+ mappingActiveLine = generatedLine;
970
+ } else if (mappingActiveLine === generatedLine) {
971
+ onChunk(void 0, generatedLine, generatedColumn, -1, -1, -1, -1);
972
+ mappingActiveLine = 0;
973
+ }
974
+ };
975
+ readMappings(mappings, onMapping);
976
+ return result;
977
+ };
978
+ var streamChunksOfSourceMapLinesFinal = (source, sourceMap, onChunk, onSource, _onName) => {
979
+ const result = getGeneratedSourceInfo(source);
980
+ const { generatedLine, generatedColumn } = result;
981
+ if (generatedLine === 1 && generatedColumn === 0) {
982
+ return {
983
+ generatedLine: 1,
984
+ generatedColumn: 0
985
+ };
986
+ }
987
+ const { sources, sourcesContent, mappings } = sourceMap;
988
+ for (let i = 0; i < sources.length; i++) {
989
+ onSource(
990
+ i,
991
+ getSource(sourceMap, i),
992
+ sourcesContent && sourcesContent[i] || void 0
993
+ );
994
+ }
995
+ const finalLine = generatedColumn === 0 ? generatedLine - 1 : generatedLine;
996
+ let currentGeneratedLine = 1;
997
+ const onMapping = (generatedLine2, _generatedColumn, sourceIndex, originalLine, originalColumn, _nameIndex) => {
998
+ if (sourceIndex >= 0 && currentGeneratedLine <= generatedLine2 && generatedLine2 <= finalLine) {
999
+ onChunk(
1000
+ void 0,
1001
+ generatedLine2,
1002
+ 0,
1003
+ sourceIndex,
1004
+ originalLine,
1005
+ originalColumn,
1006
+ -1
1007
+ );
1008
+ currentGeneratedLine = generatedLine2 + 1;
1009
+ }
1010
+ };
1011
+ readMappings(mappings, onMapping);
1012
+ return result;
1013
+ };
1014
+ module.exports = (source, sourceMap, onChunk, onSource, onName, finalSource, columns) => {
1015
+ if (columns) {
1016
+ return finalSource ? streamChunksOfSourceMapFinal(
1017
+ source,
1018
+ sourceMap,
1019
+ onChunk,
1020
+ onSource,
1021
+ onName
1022
+ ) : streamChunksOfSourceMapFull(
1023
+ source,
1024
+ sourceMap,
1025
+ onChunk,
1026
+ onSource,
1027
+ onName
1028
+ );
1029
+ } else {
1030
+ return finalSource ? streamChunksOfSourceMapLinesFinal(
1031
+ source,
1032
+ sourceMap,
1033
+ onChunk,
1034
+ onSource) : streamChunksOfSourceMapLinesFull(
1035
+ source,
1036
+ sourceMap,
1037
+ onChunk,
1038
+ onSource);
1039
+ }
1040
+ };
1041
+ }
1042
+ });
1043
+
1044
+ // node_modules/.pnpm/webpack-sources@3.2.3/node_modules/webpack-sources/lib/helpers/streamChunksOfCombinedSourceMap.js
1045
+ var require_streamChunksOfCombinedSourceMap = __commonJS({
1046
+ "node_modules/.pnpm/webpack-sources@3.2.3/node_modules/webpack-sources/lib/helpers/streamChunksOfCombinedSourceMap.js"(exports, module) {
1047
+ var streamChunksOfSourceMap = require_streamChunksOfSourceMap();
1048
+ var splitIntoLines = require_splitIntoLines();
1049
+ var streamChunksOfCombinedSourceMap = (source, sourceMap, innerSourceName, innerSource, innerSourceMap, removeInnerSource, onChunk, onSource, onName, finalSource, columns) => {
1050
+ let sourceMapping = /* @__PURE__ */ new Map();
1051
+ let nameMapping = /* @__PURE__ */ new Map();
1052
+ const sourceIndexMapping = [];
1053
+ const nameIndexMapping = [];
1054
+ const nameIndexValueMapping = [];
1055
+ let innerSourceIndex = -2;
1056
+ const innerSourceIndexMapping = [];
1057
+ const innerSourceIndexValueMapping = [];
1058
+ const innerSourceContents = [];
1059
+ const innerSourceContentLines = [];
1060
+ const innerNameIndexMapping = [];
1061
+ const innerNameIndexValueMapping = [];
1062
+ const innerSourceMapLineData = [];
1063
+ const findInnerMapping = (line, column) => {
1064
+ if (line > innerSourceMapLineData.length) return -1;
1065
+ const { mappingsData } = innerSourceMapLineData[line - 1];
1066
+ let l = 0;
1067
+ let r = mappingsData.length / 5;
1068
+ while (l < r) {
1069
+ let m = l + r >> 1;
1070
+ if (mappingsData[m * 5] <= column) {
1071
+ l = m + 1;
1072
+ } else {
1073
+ r = m;
1074
+ }
1075
+ }
1076
+ if (l === 0) return -1;
1077
+ return l - 1;
1078
+ };
1079
+ return streamChunksOfSourceMap(
1080
+ source,
1081
+ sourceMap,
1082
+ (chunk, generatedLine, generatedColumn, sourceIndex, originalLine, originalColumn, nameIndex) => {
1083
+ if (sourceIndex === innerSourceIndex) {
1084
+ const idx = findInnerMapping(originalLine, originalColumn);
1085
+ if (idx !== -1) {
1086
+ const { chunks, mappingsData } = innerSourceMapLineData[originalLine - 1];
1087
+ const mi = idx * 5;
1088
+ const innerSourceIndex2 = mappingsData[mi + 1];
1089
+ const innerOriginalLine = mappingsData[mi + 2];
1090
+ let innerOriginalColumn = mappingsData[mi + 3];
1091
+ let innerNameIndex = mappingsData[mi + 4];
1092
+ if (innerSourceIndex2 >= 0) {
1093
+ const innerChunk = chunks[idx];
1094
+ const innerGeneratedColumn = mappingsData[mi];
1095
+ const locationInChunk = originalColumn - innerGeneratedColumn;
1096
+ if (locationInChunk > 0) {
1097
+ let originalSourceLines = innerSourceIndex2 < innerSourceContentLines.length ? innerSourceContentLines[innerSourceIndex2] : null;
1098
+ if (originalSourceLines === void 0) {
1099
+ const originalSource = innerSourceContents[innerSourceIndex2];
1100
+ originalSourceLines = originalSource ? splitIntoLines(originalSource) : null;
1101
+ innerSourceContentLines[innerSourceIndex2] = originalSourceLines;
1102
+ }
1103
+ if (originalSourceLines !== null) {
1104
+ const originalChunk = innerOriginalLine <= originalSourceLines.length ? originalSourceLines[innerOriginalLine - 1].slice(
1105
+ innerOriginalColumn,
1106
+ innerOriginalColumn + locationInChunk
1107
+ ) : "";
1108
+ if (innerChunk.slice(0, locationInChunk) === originalChunk) {
1109
+ innerOriginalColumn += locationInChunk;
1110
+ innerNameIndex = -1;
1111
+ }
1112
+ }
1113
+ }
1114
+ let sourceIndex2 = innerSourceIndex2 < innerSourceIndexMapping.length ? innerSourceIndexMapping[innerSourceIndex2] : -2;
1115
+ if (sourceIndex2 === -2) {
1116
+ const [source2, sourceContent] = innerSourceIndex2 < innerSourceIndexValueMapping.length ? innerSourceIndexValueMapping[innerSourceIndex2] : [null, void 0];
1117
+ let globalIndex = sourceMapping.get(source2);
1118
+ if (globalIndex === void 0) {
1119
+ sourceMapping.set(source2, globalIndex = sourceMapping.size);
1120
+ onSource(globalIndex, source2, sourceContent);
1121
+ }
1122
+ sourceIndex2 = globalIndex;
1123
+ innerSourceIndexMapping[innerSourceIndex2] = sourceIndex2;
1124
+ }
1125
+ let finalNameIndex = -1;
1126
+ if (innerNameIndex >= 0) {
1127
+ finalNameIndex = innerNameIndex < innerNameIndexMapping.length ? innerNameIndexMapping[innerNameIndex] : -2;
1128
+ if (finalNameIndex === -2) {
1129
+ const name = innerNameIndex < innerNameIndexValueMapping.length ? innerNameIndexValueMapping[innerNameIndex] : void 0;
1130
+ if (name) {
1131
+ let globalIndex = nameMapping.get(name);
1132
+ if (globalIndex === void 0) {
1133
+ nameMapping.set(name, globalIndex = nameMapping.size);
1134
+ onName(globalIndex, name);
1135
+ }
1136
+ finalNameIndex = globalIndex;
1137
+ } else {
1138
+ finalNameIndex = -1;
1139
+ }
1140
+ innerNameIndexMapping[innerNameIndex] = finalNameIndex;
1141
+ }
1142
+ } else if (nameIndex >= 0) {
1143
+ let originalSourceLines = innerSourceContentLines[innerSourceIndex2];
1144
+ if (originalSourceLines === void 0) {
1145
+ const originalSource = innerSourceContents[innerSourceIndex2];
1146
+ originalSourceLines = originalSource ? splitIntoLines(originalSource) : null;
1147
+ innerSourceContentLines[innerSourceIndex2] = originalSourceLines;
1148
+ }
1149
+ if (originalSourceLines !== null) {
1150
+ const name = nameIndexValueMapping[nameIndex];
1151
+ const originalName = innerOriginalLine <= originalSourceLines.length ? originalSourceLines[innerOriginalLine - 1].slice(
1152
+ innerOriginalColumn,
1153
+ innerOriginalColumn + name.length
1154
+ ) : "";
1155
+ if (name === originalName) {
1156
+ finalNameIndex = nameIndex < nameIndexMapping.length ? nameIndexMapping[nameIndex] : -2;
1157
+ if (finalNameIndex === -2) {
1158
+ const name2 = nameIndexValueMapping[nameIndex];
1159
+ if (name2) {
1160
+ let globalIndex = nameMapping.get(name2);
1161
+ if (globalIndex === void 0) {
1162
+ nameMapping.set(name2, globalIndex = nameMapping.size);
1163
+ onName(globalIndex, name2);
1164
+ }
1165
+ finalNameIndex = globalIndex;
1166
+ } else {
1167
+ finalNameIndex = -1;
1168
+ }
1169
+ nameIndexMapping[nameIndex] = finalNameIndex;
1170
+ }
1171
+ }
1172
+ }
1173
+ }
1174
+ onChunk(
1175
+ chunk,
1176
+ generatedLine,
1177
+ generatedColumn,
1178
+ sourceIndex2,
1179
+ innerOriginalLine,
1180
+ innerOriginalColumn,
1181
+ finalNameIndex
1182
+ );
1183
+ return;
1184
+ }
1185
+ }
1186
+ if (removeInnerSource) {
1187
+ onChunk(chunk, generatedLine, generatedColumn, -1, -1, -1, -1);
1188
+ return;
1189
+ } else {
1190
+ if (sourceIndexMapping[sourceIndex] === -2) {
1191
+ let globalIndex = sourceMapping.get(innerSourceName);
1192
+ if (globalIndex === void 0) {
1193
+ sourceMapping.set(source, globalIndex = sourceMapping.size);
1194
+ onSource(globalIndex, innerSourceName, innerSource);
1195
+ }
1196
+ sourceIndexMapping[sourceIndex] = globalIndex;
1197
+ }
1198
+ }
1199
+ }
1200
+ const finalSourceIndex = sourceIndex < 0 || sourceIndex >= sourceIndexMapping.length ? -1 : sourceIndexMapping[sourceIndex];
1201
+ if (finalSourceIndex < 0) {
1202
+ onChunk(chunk, generatedLine, generatedColumn, -1, -1, -1, -1);
1203
+ } else {
1204
+ let finalNameIndex = -1;
1205
+ if (nameIndex >= 0 && nameIndex < nameIndexMapping.length) {
1206
+ finalNameIndex = nameIndexMapping[nameIndex];
1207
+ if (finalNameIndex === -2) {
1208
+ const name = nameIndexValueMapping[nameIndex];
1209
+ let globalIndex = nameMapping.get(name);
1210
+ if (globalIndex === void 0) {
1211
+ nameMapping.set(name, globalIndex = nameMapping.size);
1212
+ onName(globalIndex, name);
1213
+ }
1214
+ finalNameIndex = globalIndex;
1215
+ nameIndexMapping[nameIndex] = finalNameIndex;
1216
+ }
1217
+ }
1218
+ onChunk(
1219
+ chunk,
1220
+ generatedLine,
1221
+ generatedColumn,
1222
+ finalSourceIndex,
1223
+ originalLine,
1224
+ originalColumn,
1225
+ finalNameIndex
1226
+ );
1227
+ }
1228
+ },
1229
+ (i, source2, sourceContent) => {
1230
+ if (source2 === innerSourceName) {
1231
+ innerSourceIndex = i;
1232
+ if (innerSource !== void 0) sourceContent = innerSource;
1233
+ else innerSource = sourceContent;
1234
+ sourceIndexMapping[i] = -2;
1235
+ streamChunksOfSourceMap(
1236
+ sourceContent,
1237
+ innerSourceMap,
1238
+ (chunk, generatedLine, generatedColumn, sourceIndex, originalLine, originalColumn, nameIndex) => {
1239
+ while (innerSourceMapLineData.length < generatedLine) {
1240
+ innerSourceMapLineData.push({
1241
+ mappingsData: [],
1242
+ chunks: []
1243
+ });
1244
+ }
1245
+ const data = innerSourceMapLineData[generatedLine - 1];
1246
+ data.mappingsData.push(
1247
+ generatedColumn,
1248
+ sourceIndex,
1249
+ originalLine,
1250
+ originalColumn,
1251
+ nameIndex
1252
+ );
1253
+ data.chunks.push(chunk);
1254
+ },
1255
+ (i2, source3, sourceContent2) => {
1256
+ innerSourceContents[i2] = sourceContent2;
1257
+ innerSourceContentLines[i2] = void 0;
1258
+ innerSourceIndexMapping[i2] = -2;
1259
+ innerSourceIndexValueMapping[i2] = [source3, sourceContent2];
1260
+ },
1261
+ (i2, name) => {
1262
+ innerNameIndexMapping[i2] = -2;
1263
+ innerNameIndexValueMapping[i2] = name;
1264
+ },
1265
+ false,
1266
+ columns
1267
+ );
1268
+ } else {
1269
+ let globalIndex = sourceMapping.get(source2);
1270
+ if (globalIndex === void 0) {
1271
+ sourceMapping.set(source2, globalIndex = sourceMapping.size);
1272
+ onSource(globalIndex, source2, sourceContent);
1273
+ }
1274
+ sourceIndexMapping[i] = globalIndex;
1275
+ }
1276
+ },
1277
+ (i, name) => {
1278
+ nameIndexMapping[i] = -2;
1279
+ nameIndexValueMapping[i] = name;
1280
+ },
1281
+ finalSource,
1282
+ columns
1283
+ );
1284
+ };
1285
+ module.exports = streamChunksOfCombinedSourceMap;
1286
+ }
1287
+ });
1288
+
1289
+ // node_modules/.pnpm/webpack-sources@3.2.3/node_modules/webpack-sources/lib/SourceMapSource.js
1290
+ var require_SourceMapSource = __commonJS({
1291
+ "node_modules/.pnpm/webpack-sources@3.2.3/node_modules/webpack-sources/lib/SourceMapSource.js"(exports, module) {
1292
+ var Source = require_Source();
1293
+ var streamChunksOfSourceMap = require_streamChunksOfSourceMap();
1294
+ var streamChunksOfCombinedSourceMap = require_streamChunksOfCombinedSourceMap();
1295
+ var { getMap, getSourceAndMap } = require_getFromStreamChunks();
1296
+ var SourceMapSource = class extends Source {
1297
+ constructor(value, name, sourceMap, originalSource, innerSourceMap, removeOriginalSource) {
1298
+ super();
1299
+ const valueIsBuffer = Buffer.isBuffer(value);
1300
+ this._valueAsString = valueIsBuffer ? void 0 : value;
1301
+ this._valueAsBuffer = valueIsBuffer ? value : void 0;
1302
+ this._name = name;
1303
+ this._hasSourceMap = !!sourceMap;
1304
+ const sourceMapIsBuffer = Buffer.isBuffer(sourceMap);
1305
+ const sourceMapIsString = typeof sourceMap === "string";
1306
+ this._sourceMapAsObject = sourceMapIsBuffer || sourceMapIsString ? void 0 : sourceMap;
1307
+ this._sourceMapAsString = sourceMapIsString ? sourceMap : void 0;
1308
+ this._sourceMapAsBuffer = sourceMapIsBuffer ? sourceMap : void 0;
1309
+ this._hasOriginalSource = !!originalSource;
1310
+ const originalSourceIsBuffer = Buffer.isBuffer(originalSource);
1311
+ this._originalSourceAsString = originalSourceIsBuffer ? void 0 : originalSource;
1312
+ this._originalSourceAsBuffer = originalSourceIsBuffer ? originalSource : void 0;
1313
+ this._hasInnerSourceMap = !!innerSourceMap;
1314
+ const innerSourceMapIsBuffer = Buffer.isBuffer(innerSourceMap);
1315
+ const innerSourceMapIsString = typeof innerSourceMap === "string";
1316
+ this._innerSourceMapAsObject = innerSourceMapIsBuffer || innerSourceMapIsString ? void 0 : innerSourceMap;
1317
+ this._innerSourceMapAsString = innerSourceMapIsString ? innerSourceMap : void 0;
1318
+ this._innerSourceMapAsBuffer = innerSourceMapIsBuffer ? innerSourceMap : void 0;
1319
+ this._removeOriginalSource = removeOriginalSource;
1320
+ }
1321
+ _ensureValueBuffer() {
1322
+ if (this._valueAsBuffer === void 0) {
1323
+ this._valueAsBuffer = Buffer.from(this._valueAsString, "utf-8");
1324
+ }
1325
+ }
1326
+ _ensureValueString() {
1327
+ if (this._valueAsString === void 0) {
1328
+ this._valueAsString = this._valueAsBuffer.toString("utf-8");
1329
+ }
1330
+ }
1331
+ _ensureOriginalSourceBuffer() {
1332
+ if (this._originalSourceAsBuffer === void 0 && this._hasOriginalSource) {
1333
+ this._originalSourceAsBuffer = Buffer.from(
1334
+ this._originalSourceAsString,
1335
+ "utf-8"
1336
+ );
1337
+ }
1338
+ }
1339
+ _ensureOriginalSourceString() {
1340
+ if (this._originalSourceAsString === void 0 && this._hasOriginalSource) {
1341
+ this._originalSourceAsString = this._originalSourceAsBuffer.toString(
1342
+ "utf-8"
1343
+ );
1344
+ }
1345
+ }
1346
+ _ensureInnerSourceMapObject() {
1347
+ if (this._innerSourceMapAsObject === void 0 && this._hasInnerSourceMap) {
1348
+ this._ensureInnerSourceMapString();
1349
+ this._innerSourceMapAsObject = JSON.parse(this._innerSourceMapAsString);
1350
+ }
1351
+ }
1352
+ _ensureInnerSourceMapBuffer() {
1353
+ if (this._innerSourceMapAsBuffer === void 0 && this._hasInnerSourceMap) {
1354
+ this._ensureInnerSourceMapString();
1355
+ this._innerSourceMapAsBuffer = Buffer.from(
1356
+ this._innerSourceMapAsString,
1357
+ "utf-8"
1358
+ );
1359
+ }
1360
+ }
1361
+ _ensureInnerSourceMapString() {
1362
+ if (this._innerSourceMapAsString === void 0 && this._hasInnerSourceMap) {
1363
+ if (this._innerSourceMapAsBuffer !== void 0) {
1364
+ this._innerSourceMapAsString = this._innerSourceMapAsBuffer.toString(
1365
+ "utf-8"
1366
+ );
1367
+ } else {
1368
+ this._innerSourceMapAsString = JSON.stringify(
1369
+ this._innerSourceMapAsObject
1370
+ );
1371
+ }
1372
+ }
1373
+ }
1374
+ _ensureSourceMapObject() {
1375
+ if (this._sourceMapAsObject === void 0) {
1376
+ this._ensureSourceMapString();
1377
+ this._sourceMapAsObject = JSON.parse(this._sourceMapAsString);
1378
+ }
1379
+ }
1380
+ _ensureSourceMapBuffer() {
1381
+ if (this._sourceMapAsBuffer === void 0) {
1382
+ this._ensureSourceMapString();
1383
+ this._sourceMapAsBuffer = Buffer.from(this._sourceMapAsString, "utf-8");
1384
+ }
1385
+ }
1386
+ _ensureSourceMapString() {
1387
+ if (this._sourceMapAsString === void 0) {
1388
+ if (this._sourceMapAsBuffer !== void 0) {
1389
+ this._sourceMapAsString = this._sourceMapAsBuffer.toString("utf-8");
1390
+ } else {
1391
+ this._sourceMapAsString = JSON.stringify(this._sourceMapAsObject);
1392
+ }
1393
+ }
1394
+ }
1395
+ getArgsAsBuffers() {
1396
+ this._ensureValueBuffer();
1397
+ this._ensureSourceMapBuffer();
1398
+ this._ensureOriginalSourceBuffer();
1399
+ this._ensureInnerSourceMapBuffer();
1400
+ return [
1401
+ this._valueAsBuffer,
1402
+ this._name,
1403
+ this._sourceMapAsBuffer,
1404
+ this._originalSourceAsBuffer,
1405
+ this._innerSourceMapAsBuffer,
1406
+ this._removeOriginalSource
1407
+ ];
1408
+ }
1409
+ buffer() {
1410
+ this._ensureValueBuffer();
1411
+ return this._valueAsBuffer;
1412
+ }
1413
+ source() {
1414
+ this._ensureValueString();
1415
+ return this._valueAsString;
1416
+ }
1417
+ map(options) {
1418
+ if (!this._hasInnerSourceMap) {
1419
+ this._ensureSourceMapObject();
1420
+ return this._sourceMapAsObject;
1421
+ }
1422
+ return getMap(this, options);
1423
+ }
1424
+ sourceAndMap(options) {
1425
+ if (!this._hasInnerSourceMap) {
1426
+ this._ensureValueString();
1427
+ this._ensureSourceMapObject();
1428
+ return {
1429
+ source: this._valueAsString,
1430
+ map: this._sourceMapAsObject
1431
+ };
1432
+ }
1433
+ return getSourceAndMap(this, options);
1434
+ }
1435
+ streamChunks(options, onChunk, onSource, onName) {
1436
+ this._ensureValueString();
1437
+ this._ensureSourceMapObject();
1438
+ this._ensureOriginalSourceString();
1439
+ if (this._hasInnerSourceMap) {
1440
+ this._ensureInnerSourceMapObject();
1441
+ return streamChunksOfCombinedSourceMap(
1442
+ this._valueAsString,
1443
+ this._sourceMapAsObject,
1444
+ this._name,
1445
+ this._originalSourceAsString,
1446
+ this._innerSourceMapAsObject,
1447
+ this._removeOriginalSource,
1448
+ onChunk,
1449
+ onSource,
1450
+ onName,
1451
+ !!(options && options.finalSource),
1452
+ !!(options && options.columns !== false)
1453
+ );
1454
+ } else {
1455
+ return streamChunksOfSourceMap(
1456
+ this._valueAsString,
1457
+ this._sourceMapAsObject,
1458
+ onChunk,
1459
+ onSource,
1460
+ onName,
1461
+ !!(options && options.finalSource),
1462
+ !!(options && options.columns !== false)
1463
+ );
1464
+ }
1465
+ }
1466
+ updateHash(hash) {
1467
+ this._ensureValueBuffer();
1468
+ this._ensureSourceMapBuffer();
1469
+ this._ensureOriginalSourceBuffer();
1470
+ this._ensureInnerSourceMapBuffer();
1471
+ hash.update("SourceMapSource");
1472
+ hash.update(this._valueAsBuffer);
1473
+ hash.update(this._sourceMapAsBuffer);
1474
+ if (this._hasOriginalSource) {
1475
+ hash.update(this._originalSourceAsBuffer);
1476
+ }
1477
+ if (this._hasInnerSourceMap) {
1478
+ hash.update(this._innerSourceMapAsBuffer);
1479
+ }
1480
+ hash.update(this._removeOriginalSource ? "true" : "false");
1481
+ }
1482
+ };
1483
+ module.exports = SourceMapSource;
1484
+ }
1485
+ });
1486
+
1487
+ // node_modules/.pnpm/webpack-sources@3.2.3/node_modules/webpack-sources/lib/helpers/streamChunks.js
1488
+ var require_streamChunks = __commonJS({
1489
+ "node_modules/.pnpm/webpack-sources@3.2.3/node_modules/webpack-sources/lib/helpers/streamChunks.js"(exports, module) {
1490
+ var streamChunksOfRawSource = require_streamChunksOfRawSource();
1491
+ var streamChunksOfSourceMap = require_streamChunksOfSourceMap();
1492
+ module.exports = (source, options, onChunk, onSource, onName) => {
1493
+ if (typeof source.streamChunks === "function") {
1494
+ return source.streamChunks(options, onChunk, onSource, onName);
1495
+ } else {
1496
+ const sourceAndMap = source.sourceAndMap(options);
1497
+ if (sourceAndMap.map) {
1498
+ return streamChunksOfSourceMap(
1499
+ sourceAndMap.source,
1500
+ sourceAndMap.map,
1501
+ onChunk,
1502
+ onSource,
1503
+ onName,
1504
+ !!(options && options.finalSource),
1505
+ !!(options && options.columns !== false)
1506
+ );
1507
+ } else {
1508
+ return streamChunksOfRawSource(
1509
+ sourceAndMap.source,
1510
+ onChunk,
1511
+ onSource,
1512
+ onName,
1513
+ !!(options && options.finalSource)
1514
+ );
1515
+ }
1516
+ }
1517
+ };
1518
+ }
1519
+ });
1520
+
1521
+ // node_modules/.pnpm/webpack-sources@3.2.3/node_modules/webpack-sources/lib/helpers/streamAndGetSourceAndMap.js
1522
+ var require_streamAndGetSourceAndMap = __commonJS({
1523
+ "node_modules/.pnpm/webpack-sources@3.2.3/node_modules/webpack-sources/lib/helpers/streamAndGetSourceAndMap.js"(exports, module) {
1524
+ var createMappingsSerializer = require_createMappingsSerializer();
1525
+ var streamChunks = require_streamChunks();
1526
+ var streamAndGetSourceAndMap = (inputSource, options, onChunk, onSource, onName) => {
1527
+ let code = "";
1528
+ let mappings = "";
1529
+ let sources = [];
1530
+ let sourcesContent = [];
1531
+ let names = [];
1532
+ const addMapping = createMappingsSerializer(
1533
+ Object.assign({}, options, { columns: true })
1534
+ );
1535
+ const finalSource = !!(options && options.finalSource);
1536
+ const { generatedLine, generatedColumn, source } = streamChunks(
1537
+ inputSource,
1538
+ options,
1539
+ (chunk, generatedLine2, generatedColumn2, sourceIndex, originalLine, originalColumn, nameIndex) => {
1540
+ if (chunk !== void 0) code += chunk;
1541
+ mappings += addMapping(
1542
+ generatedLine2,
1543
+ generatedColumn2,
1544
+ sourceIndex,
1545
+ originalLine,
1546
+ originalColumn,
1547
+ nameIndex
1548
+ );
1549
+ return onChunk(
1550
+ finalSource ? void 0 : chunk,
1551
+ generatedLine2,
1552
+ generatedColumn2,
1553
+ sourceIndex,
1554
+ originalLine,
1555
+ originalColumn,
1556
+ nameIndex
1557
+ );
1558
+ },
1559
+ (sourceIndex, source2, sourceContent) => {
1560
+ while (sources.length < sourceIndex) {
1561
+ sources.push(null);
1562
+ }
1563
+ sources[sourceIndex] = source2;
1564
+ if (sourceContent !== void 0) {
1565
+ while (sourcesContent.length < sourceIndex) {
1566
+ sourcesContent.push(null);
1567
+ }
1568
+ sourcesContent[sourceIndex] = sourceContent;
1569
+ }
1570
+ return onSource(sourceIndex, source2, sourceContent);
1571
+ },
1572
+ (nameIndex, name) => {
1573
+ while (names.length < nameIndex) {
1574
+ names.push(null);
1575
+ }
1576
+ names[nameIndex] = name;
1577
+ return onName(nameIndex, name);
1578
+ }
1579
+ );
1580
+ const resultSource = source !== void 0 ? source : code;
1581
+ return {
1582
+ result: {
1583
+ generatedLine,
1584
+ generatedColumn,
1585
+ source: finalSource ? resultSource : void 0
1586
+ },
1587
+ source: resultSource,
1588
+ map: mappings.length > 0 ? {
1589
+ version: 3,
1590
+ file: "x",
1591
+ mappings,
1592
+ sources,
1593
+ sourcesContent: sourcesContent.length > 0 ? sourcesContent : void 0,
1594
+ names
1595
+ } : null
1596
+ };
1597
+ };
1598
+ module.exports = streamAndGetSourceAndMap;
1599
+ }
1600
+ });
1601
+
1602
+ // node_modules/.pnpm/webpack-sources@3.2.3/node_modules/webpack-sources/lib/CachedSource.js
1603
+ var require_CachedSource = __commonJS({
1604
+ "node_modules/.pnpm/webpack-sources@3.2.3/node_modules/webpack-sources/lib/CachedSource.js"(exports, module) {
1605
+ var Source = require_Source();
1606
+ var streamChunksOfSourceMap = require_streamChunksOfSourceMap();
1607
+ var streamChunksOfRawSource = require_streamChunksOfRawSource();
1608
+ var streamAndGetSourceAndMap = require_streamAndGetSourceAndMap();
1609
+ var mapToBufferedMap = (map) => {
1610
+ if (typeof map !== "object" || !map) return map;
1611
+ const bufferedMap = Object.assign({}, map);
1612
+ if (map.mappings) {
1613
+ bufferedMap.mappings = Buffer.from(map.mappings, "utf-8");
1614
+ }
1615
+ if (map.sourcesContent) {
1616
+ bufferedMap.sourcesContent = map.sourcesContent.map(
1617
+ (str) => str && Buffer.from(str, "utf-8")
1618
+ );
1619
+ }
1620
+ return bufferedMap;
1621
+ };
1622
+ var bufferedMapToMap = (bufferedMap) => {
1623
+ if (typeof bufferedMap !== "object" || !bufferedMap) return bufferedMap;
1624
+ const map = Object.assign({}, bufferedMap);
1625
+ if (bufferedMap.mappings) {
1626
+ map.mappings = bufferedMap.mappings.toString("utf-8");
1627
+ }
1628
+ if (bufferedMap.sourcesContent) {
1629
+ map.sourcesContent = bufferedMap.sourcesContent.map(
1630
+ (buffer) => buffer && buffer.toString("utf-8")
1631
+ );
1632
+ }
1633
+ return map;
1634
+ };
1635
+ var CachedSource = class extends Source {
1636
+ constructor(source, cachedData) {
1637
+ super();
1638
+ this._source = source;
1639
+ this._cachedSourceType = cachedData ? cachedData.source : void 0;
1640
+ this._cachedSource = void 0;
1641
+ this._cachedBuffer = cachedData ? cachedData.buffer : void 0;
1642
+ this._cachedSize = cachedData ? cachedData.size : void 0;
1643
+ this._cachedMaps = cachedData ? cachedData.maps : /* @__PURE__ */ new Map();
1644
+ this._cachedHashUpdate = cachedData ? cachedData.hash : void 0;
1645
+ }
1646
+ getCachedData() {
1647
+ const bufferedMaps = /* @__PURE__ */ new Map();
1648
+ for (const pair of this._cachedMaps) {
1649
+ let cacheEntry = pair[1];
1650
+ if (cacheEntry.bufferedMap === void 0) {
1651
+ cacheEntry.bufferedMap = mapToBufferedMap(
1652
+ this._getMapFromCacheEntry(cacheEntry)
1653
+ );
1654
+ }
1655
+ bufferedMaps.set(pair[0], {
1656
+ map: void 0,
1657
+ bufferedMap: cacheEntry.bufferedMap
1658
+ });
1659
+ }
1660
+ if (this._cachedSource) {
1661
+ this.buffer();
1662
+ }
1663
+ return {
1664
+ buffer: this._cachedBuffer,
1665
+ source: this._cachedSourceType !== void 0 ? this._cachedSourceType : typeof this._cachedSource === "string" ? true : Buffer.isBuffer(this._cachedSource) ? false : void 0,
1666
+ size: this._cachedSize,
1667
+ maps: bufferedMaps,
1668
+ hash: this._cachedHashUpdate
1669
+ };
1670
+ }
1671
+ originalLazy() {
1672
+ return this._source;
1673
+ }
1674
+ original() {
1675
+ if (typeof this._source === "function") this._source = this._source();
1676
+ return this._source;
1677
+ }
1678
+ source() {
1679
+ const source = this._getCachedSource();
1680
+ if (source !== void 0) return source;
1681
+ return this._cachedSource = this.original().source();
1682
+ }
1683
+ _getMapFromCacheEntry(cacheEntry) {
1684
+ if (cacheEntry.map !== void 0) {
1685
+ return cacheEntry.map;
1686
+ } else if (cacheEntry.bufferedMap !== void 0) {
1687
+ return cacheEntry.map = bufferedMapToMap(cacheEntry.bufferedMap);
1688
+ }
1689
+ }
1690
+ _getCachedSource() {
1691
+ if (this._cachedSource !== void 0) return this._cachedSource;
1692
+ if (this._cachedBuffer && this._cachedSourceType !== void 0) {
1693
+ return this._cachedSource = this._cachedSourceType ? this._cachedBuffer.toString("utf-8") : this._cachedBuffer;
1694
+ }
1695
+ }
1696
+ buffer() {
1697
+ if (this._cachedBuffer !== void 0) return this._cachedBuffer;
1698
+ if (this._cachedSource !== void 0) {
1699
+ if (Buffer.isBuffer(this._cachedSource)) {
1700
+ return this._cachedBuffer = this._cachedSource;
1701
+ }
1702
+ return this._cachedBuffer = Buffer.from(this._cachedSource, "utf-8");
1703
+ }
1704
+ if (typeof this.original().buffer === "function") {
1705
+ return this._cachedBuffer = this.original().buffer();
1706
+ }
1707
+ const bufferOrString = this.source();
1708
+ if (Buffer.isBuffer(bufferOrString)) {
1709
+ return this._cachedBuffer = bufferOrString;
1710
+ }
1711
+ return this._cachedBuffer = Buffer.from(bufferOrString, "utf-8");
1712
+ }
1713
+ size() {
1714
+ if (this._cachedSize !== void 0) return this._cachedSize;
1715
+ if (this._cachedBuffer !== void 0) {
1716
+ return this._cachedSize = this._cachedBuffer.length;
1717
+ }
1718
+ const source = this._getCachedSource();
1719
+ if (source !== void 0) {
1720
+ return this._cachedSize = Buffer.byteLength(source);
1721
+ }
1722
+ return this._cachedSize = this.original().size();
1723
+ }
1724
+ sourceAndMap(options) {
1725
+ const key = options ? JSON.stringify(options) : "{}";
1726
+ const cacheEntry = this._cachedMaps.get(key);
1727
+ if (cacheEntry !== void 0) {
1728
+ const map2 = this._getMapFromCacheEntry(cacheEntry);
1729
+ return { source: this.source(), map: map2 };
1730
+ }
1731
+ let source = this._getCachedSource();
1732
+ let map;
1733
+ if (source !== void 0) {
1734
+ map = this.original().map(options);
1735
+ } else {
1736
+ const sourceAndMap = this.original().sourceAndMap(options);
1737
+ source = sourceAndMap.source;
1738
+ map = sourceAndMap.map;
1739
+ this._cachedSource = source;
1740
+ }
1741
+ this._cachedMaps.set(key, {
1742
+ map,
1743
+ bufferedMap: void 0
1744
+ });
1745
+ return { source, map };
1746
+ }
1747
+ streamChunks(options, onChunk, onSource, onName) {
1748
+ const key = options ? JSON.stringify(options) : "{}";
1749
+ if (this._cachedMaps.has(key) && (this._cachedBuffer !== void 0 || this._cachedSource !== void 0)) {
1750
+ const { source: source2, map: map2 } = this.sourceAndMap(options);
1751
+ if (map2) {
1752
+ return streamChunksOfSourceMap(
1753
+ source2,
1754
+ map2,
1755
+ onChunk,
1756
+ onSource,
1757
+ onName,
1758
+ !!(options && options.finalSource),
1759
+ true
1760
+ );
1761
+ } else {
1762
+ return streamChunksOfRawSource(
1763
+ source2,
1764
+ onChunk,
1765
+ onSource,
1766
+ onName,
1767
+ !!(options && options.finalSource)
1768
+ );
1769
+ }
1770
+ }
1771
+ const { result, source, map } = streamAndGetSourceAndMap(
1772
+ this.original(),
1773
+ options,
1774
+ onChunk,
1775
+ onSource,
1776
+ onName
1777
+ );
1778
+ this._cachedSource = source;
1779
+ this._cachedMaps.set(key, {
1780
+ map,
1781
+ bufferedMap: void 0
1782
+ });
1783
+ return result;
1784
+ }
1785
+ map(options) {
1786
+ const key = options ? JSON.stringify(options) : "{}";
1787
+ const cacheEntry = this._cachedMaps.get(key);
1788
+ if (cacheEntry !== void 0) {
1789
+ return this._getMapFromCacheEntry(cacheEntry);
1790
+ }
1791
+ const map = this.original().map(options);
1792
+ this._cachedMaps.set(key, {
1793
+ map,
1794
+ bufferedMap: void 0
1795
+ });
1796
+ return map;
1797
+ }
1798
+ updateHash(hash) {
1799
+ if (this._cachedHashUpdate !== void 0) {
1800
+ for (const item of this._cachedHashUpdate) hash.update(item);
1801
+ return;
1802
+ }
1803
+ const update = [];
1804
+ let currentString = void 0;
1805
+ const tracker = {
1806
+ update: (item) => {
1807
+ if (typeof item === "string" && item.length < 10240) {
1808
+ if (currentString === void 0) {
1809
+ currentString = item;
1810
+ } else {
1811
+ currentString += item;
1812
+ if (currentString.length > 102400) {
1813
+ update.push(Buffer.from(currentString));
1814
+ currentString = void 0;
1815
+ }
1816
+ }
1817
+ } else {
1818
+ if (currentString !== void 0) {
1819
+ update.push(Buffer.from(currentString));
1820
+ currentString = void 0;
1821
+ }
1822
+ update.push(item);
1823
+ }
1824
+ }
1825
+ };
1826
+ this.original().updateHash(tracker);
1827
+ if (currentString !== void 0) {
1828
+ update.push(Buffer.from(currentString));
1829
+ }
1830
+ for (const item of update) hash.update(item);
1831
+ this._cachedHashUpdate = update;
1832
+ }
1833
+ };
1834
+ module.exports = CachedSource;
1835
+ }
1836
+ });
1837
+
1838
+ // node_modules/.pnpm/webpack-sources@3.2.3/node_modules/webpack-sources/lib/ConcatSource.js
1839
+ var require_ConcatSource = __commonJS({
1840
+ "node_modules/.pnpm/webpack-sources@3.2.3/node_modules/webpack-sources/lib/ConcatSource.js"(exports, module) {
1841
+ var Source = require_Source();
1842
+ var RawSource = require_RawSource();
1843
+ var streamChunks = require_streamChunks();
1844
+ var { getMap, getSourceAndMap } = require_getFromStreamChunks();
1845
+ var stringsAsRawSources = /* @__PURE__ */ new WeakSet();
1846
+ var ConcatSource = class _ConcatSource extends Source {
1847
+ constructor() {
1848
+ super();
1849
+ this._children = [];
1850
+ for (let i = 0; i < arguments.length; i++) {
1851
+ const item = arguments[i];
1852
+ if (item instanceof _ConcatSource) {
1853
+ for (const child of item._children) {
1854
+ this._children.push(child);
1855
+ }
1856
+ } else {
1857
+ this._children.push(item);
1858
+ }
1859
+ }
1860
+ this._isOptimized = arguments.length === 0;
1861
+ }
1862
+ getChildren() {
1863
+ if (!this._isOptimized) this._optimize();
1864
+ return this._children;
1865
+ }
1866
+ add(item) {
1867
+ if (item instanceof _ConcatSource) {
1868
+ for (const child of item._children) {
1869
+ this._children.push(child);
1870
+ }
1871
+ } else {
1872
+ this._children.push(item);
1873
+ }
1874
+ this._isOptimized = false;
1875
+ }
1876
+ addAllSkipOptimizing(items) {
1877
+ for (const item of items) {
1878
+ this._children.push(item);
1879
+ }
1880
+ }
1881
+ buffer() {
1882
+ if (!this._isOptimized) this._optimize();
1883
+ const buffers = [];
1884
+ for (const child of this._children) {
1885
+ if (typeof child.buffer === "function") {
1886
+ buffers.push(child.buffer());
1887
+ } else {
1888
+ const bufferOrString = child.source();
1889
+ if (Buffer.isBuffer(bufferOrString)) {
1890
+ buffers.push(bufferOrString);
1891
+ } else {
1892
+ buffers.push(Buffer.from(bufferOrString, "utf-8"));
1893
+ }
1894
+ }
1895
+ }
1896
+ return Buffer.concat(buffers);
1897
+ }
1898
+ source() {
1899
+ if (!this._isOptimized) this._optimize();
1900
+ let source = "";
1901
+ for (const child of this._children) {
1902
+ source += child.source();
1903
+ }
1904
+ return source;
1905
+ }
1906
+ size() {
1907
+ if (!this._isOptimized) this._optimize();
1908
+ let size = 0;
1909
+ for (const child of this._children) {
1910
+ size += child.size();
1911
+ }
1912
+ return size;
1913
+ }
1914
+ map(options) {
1915
+ return getMap(this, options);
1916
+ }
1917
+ sourceAndMap(options) {
1918
+ return getSourceAndMap(this, options);
1919
+ }
1920
+ streamChunks(options, onChunk, onSource, onName) {
1921
+ if (!this._isOptimized) this._optimize();
1922
+ if (this._children.length === 1)
1923
+ return this._children[0].streamChunks(options, onChunk, onSource, onName);
1924
+ let currentLineOffset = 0;
1925
+ let currentColumnOffset = 0;
1926
+ let sourceMapping = /* @__PURE__ */ new Map();
1927
+ let nameMapping = /* @__PURE__ */ new Map();
1928
+ const finalSource = !!(options && options.finalSource);
1929
+ let code = "";
1930
+ let needToCloseMapping = false;
1931
+ for (const item of this._children) {
1932
+ const sourceIndexMapping = [];
1933
+ const nameIndexMapping = [];
1934
+ let lastMappingLine = 0;
1935
+ const { generatedLine, generatedColumn, source } = streamChunks(
1936
+ item,
1937
+ options,
1938
+ // eslint-disable-next-line no-loop-func
1939
+ (chunk, generatedLine2, generatedColumn2, sourceIndex, originalLine, originalColumn, nameIndex) => {
1940
+ const line = generatedLine2 + currentLineOffset;
1941
+ const column = generatedLine2 === 1 ? generatedColumn2 + currentColumnOffset : generatedColumn2;
1942
+ if (needToCloseMapping) {
1943
+ if (generatedLine2 !== 1 || generatedColumn2 !== 0) {
1944
+ onChunk(
1945
+ void 0,
1946
+ currentLineOffset + 1,
1947
+ currentColumnOffset,
1948
+ -1,
1949
+ -1,
1950
+ -1,
1951
+ -1
1952
+ );
1953
+ }
1954
+ needToCloseMapping = false;
1955
+ }
1956
+ const resultSourceIndex = sourceIndex < 0 || sourceIndex >= sourceIndexMapping.length ? -1 : sourceIndexMapping[sourceIndex];
1957
+ const resultNameIndex = nameIndex < 0 || nameIndex >= nameIndexMapping.length ? -1 : nameIndexMapping[nameIndex];
1958
+ lastMappingLine = resultSourceIndex < 0 ? 0 : generatedLine2;
1959
+ if (finalSource) {
1960
+ if (chunk !== void 0) code += chunk;
1961
+ if (resultSourceIndex >= 0) {
1962
+ onChunk(
1963
+ void 0,
1964
+ line,
1965
+ column,
1966
+ resultSourceIndex,
1967
+ originalLine,
1968
+ originalColumn,
1969
+ resultNameIndex
1970
+ );
1971
+ }
1972
+ } else {
1973
+ if (resultSourceIndex < 0) {
1974
+ onChunk(chunk, line, column, -1, -1, -1, -1);
1975
+ } else {
1976
+ onChunk(
1977
+ chunk,
1978
+ line,
1979
+ column,
1980
+ resultSourceIndex,
1981
+ originalLine,
1982
+ originalColumn,
1983
+ resultNameIndex
1984
+ );
1985
+ }
1986
+ }
1987
+ },
1988
+ (i, source2, sourceContent) => {
1989
+ let globalIndex = sourceMapping.get(source2);
1990
+ if (globalIndex === void 0) {
1991
+ sourceMapping.set(source2, globalIndex = sourceMapping.size);
1992
+ onSource(globalIndex, source2, sourceContent);
1993
+ }
1994
+ sourceIndexMapping[i] = globalIndex;
1995
+ },
1996
+ (i, name) => {
1997
+ let globalIndex = nameMapping.get(name);
1998
+ if (globalIndex === void 0) {
1999
+ nameMapping.set(name, globalIndex = nameMapping.size);
2000
+ onName(globalIndex, name);
2001
+ }
2002
+ nameIndexMapping[i] = globalIndex;
2003
+ }
2004
+ );
2005
+ if (source !== void 0) code += source;
2006
+ if (needToCloseMapping) {
2007
+ if (generatedLine !== 1 || generatedColumn !== 0) {
2008
+ onChunk(
2009
+ void 0,
2010
+ currentLineOffset + 1,
2011
+ currentColumnOffset,
2012
+ -1,
2013
+ -1,
2014
+ -1,
2015
+ -1
2016
+ );
2017
+ needToCloseMapping = false;
2018
+ }
2019
+ }
2020
+ if (generatedLine > 1) {
2021
+ currentColumnOffset = generatedColumn;
2022
+ } else {
2023
+ currentColumnOffset += generatedColumn;
2024
+ }
2025
+ needToCloseMapping = needToCloseMapping || finalSource && lastMappingLine === generatedLine;
2026
+ currentLineOffset += generatedLine - 1;
2027
+ }
2028
+ return {
2029
+ generatedLine: currentLineOffset + 1,
2030
+ generatedColumn: currentColumnOffset,
2031
+ source: finalSource ? code : void 0
2032
+ };
2033
+ }
2034
+ updateHash(hash) {
2035
+ if (!this._isOptimized) this._optimize();
2036
+ hash.update("ConcatSource");
2037
+ for (const item of this._children) {
2038
+ item.updateHash(hash);
2039
+ }
2040
+ }
2041
+ _optimize() {
2042
+ const newChildren = [];
2043
+ let currentString = void 0;
2044
+ let currentRawSources = void 0;
2045
+ const addStringToRawSources = (string) => {
2046
+ if (currentRawSources === void 0) {
2047
+ currentRawSources = string;
2048
+ } else if (Array.isArray(currentRawSources)) {
2049
+ currentRawSources.push(string);
2050
+ } else {
2051
+ currentRawSources = [
2052
+ typeof currentRawSources === "string" ? currentRawSources : currentRawSources.source(),
2053
+ string
2054
+ ];
2055
+ }
2056
+ };
2057
+ const addSourceToRawSources = (source) => {
2058
+ if (currentRawSources === void 0) {
2059
+ currentRawSources = source;
2060
+ } else if (Array.isArray(currentRawSources)) {
2061
+ currentRawSources.push(source.source());
2062
+ } else {
2063
+ currentRawSources = [
2064
+ typeof currentRawSources === "string" ? currentRawSources : currentRawSources.source(),
2065
+ source.source()
2066
+ ];
2067
+ }
2068
+ };
2069
+ const mergeRawSources = () => {
2070
+ if (Array.isArray(currentRawSources)) {
2071
+ const rawSource = new RawSource(currentRawSources.join(""));
2072
+ stringsAsRawSources.add(rawSource);
2073
+ newChildren.push(rawSource);
2074
+ } else if (typeof currentRawSources === "string") {
2075
+ const rawSource = new RawSource(currentRawSources);
2076
+ stringsAsRawSources.add(rawSource);
2077
+ newChildren.push(rawSource);
2078
+ } else {
2079
+ newChildren.push(currentRawSources);
2080
+ }
2081
+ };
2082
+ for (const child of this._children) {
2083
+ if (typeof child === "string") {
2084
+ if (currentString === void 0) {
2085
+ currentString = child;
2086
+ } else {
2087
+ currentString += child;
2088
+ }
2089
+ } else {
2090
+ if (currentString !== void 0) {
2091
+ addStringToRawSources(currentString);
2092
+ currentString = void 0;
2093
+ }
2094
+ if (stringsAsRawSources.has(child)) {
2095
+ addSourceToRawSources(child);
2096
+ } else {
2097
+ if (currentRawSources !== void 0) {
2098
+ mergeRawSources();
2099
+ currentRawSources = void 0;
2100
+ }
2101
+ newChildren.push(child);
2102
+ }
2103
+ }
2104
+ }
2105
+ if (currentString !== void 0) {
2106
+ addStringToRawSources(currentString);
2107
+ }
2108
+ if (currentRawSources !== void 0) {
2109
+ mergeRawSources();
2110
+ }
2111
+ this._children = newChildren;
2112
+ this._isOptimized = true;
2113
+ }
2114
+ };
2115
+ module.exports = ConcatSource;
2116
+ }
2117
+ });
2118
+
2119
+ // node_modules/.pnpm/webpack-sources@3.2.3/node_modules/webpack-sources/lib/ReplaceSource.js
2120
+ var require_ReplaceSource = __commonJS({
2121
+ "node_modules/.pnpm/webpack-sources@3.2.3/node_modules/webpack-sources/lib/ReplaceSource.js"(exports, module) {
2122
+ var { getMap, getSourceAndMap } = require_getFromStreamChunks();
2123
+ var streamChunks = require_streamChunks();
2124
+ var Source = require_Source();
2125
+ var splitIntoLines = require_splitIntoLines();
2126
+ var hasStableSort = typeof process === "object" && process.versions && typeof process.versions.v8 === "string" && !/^[0-6]\./.test(process.versions.v8);
2127
+ var MAX_SOURCE_POSITION = 536870912;
2128
+ var Replacement = class {
2129
+ constructor(start, end, content, name) {
2130
+ this.start = start;
2131
+ this.end = end;
2132
+ this.content = content;
2133
+ this.name = name;
2134
+ if (!hasStableSort) {
2135
+ this.index = -1;
2136
+ }
2137
+ }
2138
+ };
2139
+ var ReplaceSource = class extends Source {
2140
+ constructor(source, name) {
2141
+ super();
2142
+ this._source = source;
2143
+ this._name = name;
2144
+ this._replacements = [];
2145
+ this._isSorted = true;
2146
+ }
2147
+ getName() {
2148
+ return this._name;
2149
+ }
2150
+ getReplacements() {
2151
+ this._sortReplacements();
2152
+ return this._replacements;
2153
+ }
2154
+ replace(start, end, newValue, name) {
2155
+ if (typeof newValue !== "string")
2156
+ throw new Error(
2157
+ "insertion must be a string, but is a " + typeof newValue
2158
+ );
2159
+ this._replacements.push(new Replacement(start, end, newValue, name));
2160
+ this._isSorted = false;
2161
+ }
2162
+ insert(pos, newValue, name) {
2163
+ if (typeof newValue !== "string")
2164
+ throw new Error(
2165
+ "insertion must be a string, but is a " + typeof newValue + ": " + newValue
2166
+ );
2167
+ this._replacements.push(new Replacement(pos, pos - 1, newValue, name));
2168
+ this._isSorted = false;
2169
+ }
2170
+ source() {
2171
+ if (this._replacements.length === 0) {
2172
+ return this._source.source();
2173
+ }
2174
+ let current = this._source.source();
2175
+ let pos = 0;
2176
+ const result = [];
2177
+ this._sortReplacements();
2178
+ for (const replacement of this._replacements) {
2179
+ const start = Math.floor(replacement.start);
2180
+ const end = Math.floor(replacement.end + 1);
2181
+ if (pos < start) {
2182
+ const offset = start - pos;
2183
+ result.push(current.slice(0, offset));
2184
+ current = current.slice(offset);
2185
+ pos = start;
2186
+ }
2187
+ result.push(replacement.content);
2188
+ if (pos < end) {
2189
+ const offset = end - pos;
2190
+ current = current.slice(offset);
2191
+ pos = end;
2192
+ }
2193
+ }
2194
+ result.push(current);
2195
+ return result.join("");
2196
+ }
2197
+ map(options) {
2198
+ if (this._replacements.length === 0) {
2199
+ return this._source.map(options);
2200
+ }
2201
+ return getMap(this, options);
2202
+ }
2203
+ sourceAndMap(options) {
2204
+ if (this._replacements.length === 0) {
2205
+ return this._source.sourceAndMap(options);
2206
+ }
2207
+ return getSourceAndMap(this, options);
2208
+ }
2209
+ original() {
2210
+ return this._source;
2211
+ }
2212
+ _sortReplacements() {
2213
+ if (this._isSorted) return;
2214
+ if (hasStableSort) {
2215
+ this._replacements.sort(function(a, b) {
2216
+ const diff1 = a.start - b.start;
2217
+ if (diff1 !== 0) return diff1;
2218
+ const diff2 = a.end - b.end;
2219
+ if (diff2 !== 0) return diff2;
2220
+ return 0;
2221
+ });
2222
+ } else {
2223
+ this._replacements.forEach((repl, i) => repl.index = i);
2224
+ this._replacements.sort(function(a, b) {
2225
+ const diff1 = a.start - b.start;
2226
+ if (diff1 !== 0) return diff1;
2227
+ const diff2 = a.end - b.end;
2228
+ if (diff2 !== 0) return diff2;
2229
+ return a.index - b.index;
2230
+ });
2231
+ }
2232
+ this._isSorted = true;
2233
+ }
2234
+ streamChunks(options, onChunk, onSource, onName) {
2235
+ this._sortReplacements();
2236
+ const repls = this._replacements;
2237
+ let pos = 0;
2238
+ let i = 0;
2239
+ let replacmentEnd = -1;
2240
+ let nextReplacement = i < repls.length ? Math.floor(repls[i].start) : MAX_SOURCE_POSITION;
2241
+ let generatedLineOffset = 0;
2242
+ let generatedColumnOffset = 0;
2243
+ let generatedColumnOffsetLine = 0;
2244
+ const sourceContents = [];
2245
+ const nameMapping = /* @__PURE__ */ new Map();
2246
+ const nameIndexMapping = [];
2247
+ const checkOriginalContent = (sourceIndex, line2, column, expectedChunk) => {
2248
+ let content = sourceIndex < sourceContents.length ? sourceContents[sourceIndex] : void 0;
2249
+ if (content === void 0) return false;
2250
+ if (typeof content === "string") {
2251
+ content = splitIntoLines(content);
2252
+ sourceContents[sourceIndex] = content;
2253
+ }
2254
+ const contentLine = line2 <= content.length ? content[line2 - 1] : null;
2255
+ if (contentLine === null) return false;
2256
+ return contentLine.slice(column, column + expectedChunk.length) === expectedChunk;
2257
+ };
2258
+ let { generatedLine, generatedColumn } = streamChunks(
2259
+ this._source,
2260
+ Object.assign({}, options, { finalSource: false }),
2261
+ (chunk, generatedLine2, generatedColumn2, sourceIndex, originalLine, originalColumn, nameIndex) => {
2262
+ let chunkPos = 0;
2263
+ let endPos = pos + chunk.length;
2264
+ if (replacmentEnd > pos) {
2265
+ if (replacmentEnd >= endPos) {
2266
+ const line3 = generatedLine2 + generatedLineOffset;
2267
+ if (chunk.endsWith("\n")) {
2268
+ generatedLineOffset--;
2269
+ if (generatedColumnOffsetLine === line3) {
2270
+ generatedColumnOffset += generatedColumn2;
2271
+ }
2272
+ } else if (generatedColumnOffsetLine === line3) {
2273
+ generatedColumnOffset -= chunk.length;
2274
+ } else {
2275
+ generatedColumnOffset = -chunk.length;
2276
+ generatedColumnOffsetLine = line3;
2277
+ }
2278
+ pos = endPos;
2279
+ return;
2280
+ }
2281
+ chunkPos = replacmentEnd - pos;
2282
+ if (checkOriginalContent(
2283
+ sourceIndex,
2284
+ originalLine,
2285
+ originalColumn,
2286
+ chunk.slice(0, chunkPos)
2287
+ )) {
2288
+ originalColumn += chunkPos;
2289
+ }
2290
+ pos += chunkPos;
2291
+ const line2 = generatedLine2 + generatedLineOffset;
2292
+ if (generatedColumnOffsetLine === line2) {
2293
+ generatedColumnOffset -= chunkPos;
2294
+ } else {
2295
+ generatedColumnOffset = -chunkPos;
2296
+ generatedColumnOffsetLine = line2;
2297
+ }
2298
+ generatedColumn2 += chunkPos;
2299
+ }
2300
+ if (nextReplacement < endPos) {
2301
+ do {
2302
+ let line2 = generatedLine2 + generatedLineOffset;
2303
+ if (nextReplacement > pos) {
2304
+ const offset2 = nextReplacement - pos;
2305
+ const chunkSlice = chunk.slice(chunkPos, chunkPos + offset2);
2306
+ onChunk(
2307
+ chunkSlice,
2308
+ line2,
2309
+ generatedColumn2 + (line2 === generatedColumnOffsetLine ? generatedColumnOffset : 0),
2310
+ sourceIndex,
2311
+ originalLine,
2312
+ originalColumn,
2313
+ nameIndex < 0 || nameIndex >= nameIndexMapping.length ? -1 : nameIndexMapping[nameIndex]
2314
+ );
2315
+ generatedColumn2 += offset2;
2316
+ chunkPos += offset2;
2317
+ pos = nextReplacement;
2318
+ if (checkOriginalContent(
2319
+ sourceIndex,
2320
+ originalLine,
2321
+ originalColumn,
2322
+ chunkSlice
2323
+ )) {
2324
+ originalColumn += chunkSlice.length;
2325
+ }
2326
+ }
2327
+ const { content, name } = repls[i];
2328
+ let matches2 = splitIntoLines(content);
2329
+ let replacementNameIndex = nameIndex;
2330
+ if (sourceIndex >= 0 && name) {
2331
+ let globalIndex = nameMapping.get(name);
2332
+ if (globalIndex === void 0) {
2333
+ globalIndex = nameMapping.size;
2334
+ nameMapping.set(name, globalIndex);
2335
+ onName(globalIndex, name);
2336
+ }
2337
+ replacementNameIndex = globalIndex;
2338
+ }
2339
+ for (let m = 0; m < matches2.length; m++) {
2340
+ const contentLine = matches2[m];
2341
+ onChunk(
2342
+ contentLine,
2343
+ line2,
2344
+ generatedColumn2 + (line2 === generatedColumnOffsetLine ? generatedColumnOffset : 0),
2345
+ sourceIndex,
2346
+ originalLine,
2347
+ originalColumn,
2348
+ replacementNameIndex
2349
+ );
2350
+ replacementNameIndex = -1;
2351
+ if (m === matches2.length - 1 && !contentLine.endsWith("\n")) {
2352
+ if (generatedColumnOffsetLine === line2) {
2353
+ generatedColumnOffset += contentLine.length;
2354
+ } else {
2355
+ generatedColumnOffset = contentLine.length;
2356
+ generatedColumnOffsetLine = line2;
2357
+ }
2358
+ } else {
2359
+ generatedLineOffset++;
2360
+ line2++;
2361
+ generatedColumnOffset = -generatedColumn2;
2362
+ generatedColumnOffsetLine = line2;
2363
+ }
2364
+ }
2365
+ replacmentEnd = Math.max(
2366
+ replacmentEnd,
2367
+ Math.floor(repls[i].end + 1)
2368
+ );
2369
+ i++;
2370
+ nextReplacement = i < repls.length ? Math.floor(repls[i].start) : MAX_SOURCE_POSITION;
2371
+ const offset = chunk.length - endPos + replacmentEnd - chunkPos;
2372
+ if (offset > 0) {
2373
+ if (replacmentEnd >= endPos) {
2374
+ let line4 = generatedLine2 + generatedLineOffset;
2375
+ if (chunk.endsWith("\n")) {
2376
+ generatedLineOffset--;
2377
+ if (generatedColumnOffsetLine === line4) {
2378
+ generatedColumnOffset += generatedColumn2;
2379
+ }
2380
+ } else if (generatedColumnOffsetLine === line4) {
2381
+ generatedColumnOffset -= chunk.length - chunkPos;
2382
+ } else {
2383
+ generatedColumnOffset = chunkPos - chunk.length;
2384
+ generatedColumnOffsetLine = line4;
2385
+ }
2386
+ pos = endPos;
2387
+ return;
2388
+ }
2389
+ const line3 = generatedLine2 + generatedLineOffset;
2390
+ if (checkOriginalContent(
2391
+ sourceIndex,
2392
+ originalLine,
2393
+ originalColumn,
2394
+ chunk.slice(chunkPos, chunkPos + offset)
2395
+ )) {
2396
+ originalColumn += offset;
2397
+ }
2398
+ chunkPos += offset;
2399
+ pos += offset;
2400
+ if (generatedColumnOffsetLine === line3) {
2401
+ generatedColumnOffset -= offset;
2402
+ } else {
2403
+ generatedColumnOffset = -offset;
2404
+ generatedColumnOffsetLine = line3;
2405
+ }
2406
+ generatedColumn2 += offset;
2407
+ }
2408
+ } while (nextReplacement < endPos);
2409
+ }
2410
+ if (chunkPos < chunk.length) {
2411
+ const chunkSlice = chunkPos === 0 ? chunk : chunk.slice(chunkPos);
2412
+ const line2 = generatedLine2 + generatedLineOffset;
2413
+ onChunk(
2414
+ chunkSlice,
2415
+ line2,
2416
+ generatedColumn2 + (line2 === generatedColumnOffsetLine ? generatedColumnOffset : 0),
2417
+ sourceIndex,
2418
+ originalLine,
2419
+ originalColumn,
2420
+ nameIndex < 0 ? -1 : nameIndexMapping[nameIndex]
2421
+ );
2422
+ }
2423
+ pos = endPos;
2424
+ },
2425
+ (sourceIndex, source, sourceContent) => {
2426
+ while (sourceContents.length < sourceIndex)
2427
+ sourceContents.push(void 0);
2428
+ sourceContents[sourceIndex] = sourceContent;
2429
+ onSource(sourceIndex, source, sourceContent);
2430
+ },
2431
+ (nameIndex, name) => {
2432
+ let globalIndex = nameMapping.get(name);
2433
+ if (globalIndex === void 0) {
2434
+ globalIndex = nameMapping.size;
2435
+ nameMapping.set(name, globalIndex);
2436
+ onName(globalIndex, name);
2437
+ }
2438
+ nameIndexMapping[nameIndex] = globalIndex;
2439
+ }
2440
+ );
2441
+ let remainer = "";
2442
+ for (; i < repls.length; i++) {
2443
+ remainer += repls[i].content;
2444
+ }
2445
+ let line = generatedLine + generatedLineOffset;
2446
+ let matches = splitIntoLines(remainer);
2447
+ for (let m = 0; m < matches.length; m++) {
2448
+ const contentLine = matches[m];
2449
+ onChunk(
2450
+ contentLine,
2451
+ line,
2452
+ generatedColumn + (line === generatedColumnOffsetLine ? generatedColumnOffset : 0),
2453
+ -1,
2454
+ -1,
2455
+ -1,
2456
+ -1
2457
+ );
2458
+ if (m === matches.length - 1 && !contentLine.endsWith("\n")) {
2459
+ if (generatedColumnOffsetLine === line) {
2460
+ generatedColumnOffset += contentLine.length;
2461
+ } else {
2462
+ generatedColumnOffset = contentLine.length;
2463
+ generatedColumnOffsetLine = line;
2464
+ }
2465
+ } else {
2466
+ generatedLineOffset++;
2467
+ line++;
2468
+ generatedColumnOffset = -generatedColumn;
2469
+ generatedColumnOffsetLine = line;
2470
+ }
2471
+ }
2472
+ return {
2473
+ generatedLine: line,
2474
+ generatedColumn: generatedColumn + (line === generatedColumnOffsetLine ? generatedColumnOffset : 0)
2475
+ };
2476
+ }
2477
+ updateHash(hash) {
2478
+ this._sortReplacements();
2479
+ hash.update("ReplaceSource");
2480
+ this._source.updateHash(hash);
2481
+ hash.update(this._name || "");
2482
+ for (const repl of this._replacements) {
2483
+ hash.update(`${repl.start}${repl.end}${repl.content}${repl.name}`);
2484
+ }
2485
+ }
2486
+ };
2487
+ module.exports = ReplaceSource;
2488
+ }
2489
+ });
2490
+
2491
+ // node_modules/.pnpm/webpack-sources@3.2.3/node_modules/webpack-sources/lib/PrefixSource.js
2492
+ var require_PrefixSource = __commonJS({
2493
+ "node_modules/.pnpm/webpack-sources@3.2.3/node_modules/webpack-sources/lib/PrefixSource.js"(exports, module) {
2494
+ var Source = require_Source();
2495
+ var RawSource = require_RawSource();
2496
+ var streamChunks = require_streamChunks();
2497
+ var { getMap, getSourceAndMap } = require_getFromStreamChunks();
2498
+ var REPLACE_REGEX = /\n(?=.|\s)/g;
2499
+ var PrefixSource = class extends Source {
2500
+ constructor(prefix, source) {
2501
+ super();
2502
+ this._source = typeof source === "string" || Buffer.isBuffer(source) ? new RawSource(source, true) : source;
2503
+ this._prefix = prefix;
2504
+ }
2505
+ getPrefix() {
2506
+ return this._prefix;
2507
+ }
2508
+ original() {
2509
+ return this._source;
2510
+ }
2511
+ source() {
2512
+ const node = this._source.source();
2513
+ const prefix = this._prefix;
2514
+ return prefix + node.replace(REPLACE_REGEX, "\n" + prefix);
2515
+ }
2516
+ // TODO efficient buffer() implementation
2517
+ map(options) {
2518
+ return getMap(this, options);
2519
+ }
2520
+ sourceAndMap(options) {
2521
+ return getSourceAndMap(this, options);
2522
+ }
2523
+ streamChunks(options, onChunk, onSource, onName) {
2524
+ const prefix = this._prefix;
2525
+ const prefixOffset = prefix.length;
2526
+ const linesOnly = !!(options && options.columns === false);
2527
+ const { generatedLine, generatedColumn, source } = streamChunks(
2528
+ this._source,
2529
+ options,
2530
+ (chunk, generatedLine2, generatedColumn2, sourceIndex, originalLine, originalColumn, nameIndex) => {
2531
+ if (generatedColumn2 !== 0) {
2532
+ generatedColumn2 += prefixOffset;
2533
+ } else if (chunk !== void 0) {
2534
+ if (linesOnly || sourceIndex < 0) {
2535
+ chunk = prefix + chunk;
2536
+ } else if (prefixOffset > 0) {
2537
+ onChunk(prefix, generatedLine2, generatedColumn2, -1, -1, -1, -1);
2538
+ generatedColumn2 += prefixOffset;
2539
+ }
2540
+ } else if (!linesOnly) {
2541
+ generatedColumn2 += prefixOffset;
2542
+ }
2543
+ onChunk(
2544
+ chunk,
2545
+ generatedLine2,
2546
+ generatedColumn2,
2547
+ sourceIndex,
2548
+ originalLine,
2549
+ originalColumn,
2550
+ nameIndex
2551
+ );
2552
+ },
2553
+ onSource,
2554
+ onName
2555
+ );
2556
+ return {
2557
+ generatedLine,
2558
+ generatedColumn: generatedColumn === 0 ? 0 : prefixOffset + generatedColumn,
2559
+ source: source !== void 0 ? prefix + source.replace(REPLACE_REGEX, "\n" + prefix) : void 0
2560
+ };
2561
+ }
2562
+ updateHash(hash) {
2563
+ hash.update("PrefixSource");
2564
+ this._source.updateHash(hash);
2565
+ hash.update(this._prefix);
2566
+ }
2567
+ };
2568
+ module.exports = PrefixSource;
2569
+ }
2570
+ });
2571
+
2572
+ // node_modules/.pnpm/webpack-sources@3.2.3/node_modules/webpack-sources/lib/SizeOnlySource.js
2573
+ var require_SizeOnlySource = __commonJS({
2574
+ "node_modules/.pnpm/webpack-sources@3.2.3/node_modules/webpack-sources/lib/SizeOnlySource.js"(exports, module) {
2575
+ var Source = require_Source();
2576
+ var SizeOnlySource = class extends Source {
2577
+ constructor(size) {
2578
+ super();
2579
+ this._size = size;
2580
+ }
2581
+ _error() {
2582
+ return new Error(
2583
+ "Content and Map of this Source is not available (only size() is supported)"
2584
+ );
2585
+ }
2586
+ size() {
2587
+ return this._size;
2588
+ }
2589
+ source() {
2590
+ throw this._error();
2591
+ }
2592
+ buffer() {
2593
+ throw this._error();
2594
+ }
2595
+ map(options) {
2596
+ throw this._error();
2597
+ }
2598
+ updateHash() {
2599
+ throw this._error();
2600
+ }
2601
+ };
2602
+ module.exports = SizeOnlySource;
2603
+ }
2604
+ });
2605
+
2606
+ // node_modules/.pnpm/webpack-sources@3.2.3/node_modules/webpack-sources/lib/CompatSource.js
2607
+ var require_CompatSource = __commonJS({
2608
+ "node_modules/.pnpm/webpack-sources@3.2.3/node_modules/webpack-sources/lib/CompatSource.js"(exports, module) {
2609
+ var Source = require_Source();
2610
+ var CompatSource = class _CompatSource extends Source {
2611
+ static from(sourceLike) {
2612
+ return sourceLike instanceof Source ? sourceLike : new _CompatSource(sourceLike);
2613
+ }
2614
+ constructor(sourceLike) {
2615
+ super();
2616
+ this._sourceLike = sourceLike;
2617
+ }
2618
+ source() {
2619
+ return this._sourceLike.source();
2620
+ }
2621
+ buffer() {
2622
+ if (typeof this._sourceLike.buffer === "function") {
2623
+ return this._sourceLike.buffer();
2624
+ }
2625
+ return super.buffer();
2626
+ }
2627
+ size() {
2628
+ if (typeof this._sourceLike.size === "function") {
2629
+ return this._sourceLike.size();
2630
+ }
2631
+ return super.size();
2632
+ }
2633
+ map(options) {
2634
+ if (typeof this._sourceLike.map === "function") {
2635
+ return this._sourceLike.map(options);
2636
+ }
2637
+ return super.map(options);
2638
+ }
2639
+ sourceAndMap(options) {
2640
+ if (typeof this._sourceLike.sourceAndMap === "function") {
2641
+ return this._sourceLike.sourceAndMap(options);
2642
+ }
2643
+ return super.sourceAndMap(options);
2644
+ }
2645
+ updateHash(hash) {
2646
+ if (typeof this._sourceLike.updateHash === "function") {
2647
+ return this._sourceLike.updateHash(hash);
2648
+ }
2649
+ if (typeof this._sourceLike.map === "function") {
2650
+ throw new Error(
2651
+ "A Source-like object with a 'map' method must also provide an 'updateHash' method"
2652
+ );
2653
+ }
2654
+ hash.update(this.buffer());
2655
+ }
2656
+ };
2657
+ module.exports = CompatSource;
2658
+ }
2659
+ });
2660
+
2661
+ // node_modules/.pnpm/webpack-sources@3.2.3/node_modules/webpack-sources/lib/index.js
2662
+ var require_lib = __commonJS({
2663
+ "node_modules/.pnpm/webpack-sources@3.2.3/node_modules/webpack-sources/lib/index.js"(exports) {
2664
+ var defineExport = (name, fn) => {
2665
+ let value;
2666
+ Object.defineProperty(exports, name, {
2667
+ get: () => {
2668
+ if (fn !== void 0) {
2669
+ value = fn();
2670
+ fn = void 0;
2671
+ }
2672
+ return value;
2673
+ },
2674
+ configurable: true
2675
+ });
2676
+ };
2677
+ defineExport("Source", () => require_Source());
2678
+ defineExport("RawSource", () => require_RawSource());
2679
+ defineExport("OriginalSource", () => require_OriginalSource());
2680
+ defineExport("SourceMapSource", () => require_SourceMapSource());
2681
+ defineExport("CachedSource", () => require_CachedSource());
2682
+ defineExport("ConcatSource", () => require_ConcatSource());
2683
+ defineExport("ReplaceSource", () => require_ReplaceSource());
2684
+ defineExport("PrefixSource", () => require_PrefixSource());
2685
+ defineExport("SizeOnlySource", () => require_SizeOnlySource());
2686
+ defineExport("CompatSource", () => require_CompatSource());
2687
+ }
2688
+ });
12
2689
  function getPackageVersion(startDir) {
13
2690
  try {
14
2691
  let dir = startDir || process.cwd();
@@ -58,12 +2735,15 @@ function versionInjectorPlugin(options = {}) {
58
2735
  return {
59
2736
  apply(compiler) {
60
2737
  var _a, _b;
61
- const isWebpack5 = (_b = (_a = compiler.webpack) == null ? void 0 : _a.version) == null ? void 0 : _b.startsWith("5");
2738
+ const isWebpack5 = Boolean((_b = (_a = compiler.webpack) == null ? void 0 : _a.version) == null ? void 0 : _b.startsWith("5"));
62
2739
  compiler.hooks.compilation.tap("webpack-version-injector", (compilation) => {
63
- if (isWebpack5) {
2740
+ if (isWebpack5 && compiler.webpack) {
64
2741
  const { Compilation, sources } = compiler.webpack;
65
2742
  compilation.hooks.processAssets.tap(
66
- { name: "webpack-version-injector", stage: Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_INLINE },
2743
+ {
2744
+ name: "webpack-version-injector",
2745
+ stage: Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_INLINE
2746
+ },
67
2747
  (assets) => {
68
2748
  for (const name in assets) {
69
2749
  if (name.endsWith(".html")) {
@@ -74,6 +2754,18 @@ function versionInjectorPlugin(options = {}) {
74
2754
  }
75
2755
  }
76
2756
  );
2757
+ } else {
2758
+ const RawSourceLegacy = require_lib().RawSource;
2759
+ compiler.hooks.emit.tapAsync("webpack-version-injector", (compilation2, callback) => {
2760
+ for (const name in compilation2.assets) {
2761
+ if (name.endsWith(".html")) {
2762
+ const html = compilation2.assets[name].source().toString();
2763
+ const result = inject(html);
2764
+ compilation2.assets[name] = new RawSourceLegacy(result);
2765
+ }
2766
+ }
2767
+ callback();
2768
+ });
77
2769
  }
78
2770
  });
79
2771
  }