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