@vue/compiler-sfc 3.6.0-rc.5 → 3.6.0-rc.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/compiler-sfc.cjs.js +574 -332
- package/dist/compiler-sfc.d.ts +158 -179
- package/dist/compiler-sfc.esm-browser.js +1229 -1037
- package/package.json +6 -6
package/dist/compiler-sfc.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/compiler-sfc v3.6.0-rc.
|
|
2
|
+
* @vue/compiler-sfc v3.6.0-rc.7
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -25,7 +25,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
25
25
|
}
|
|
26
26
|
return to;
|
|
27
27
|
};
|
|
28
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
28
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
|
29
29
|
value: mod,
|
|
30
30
|
enumerable: true
|
|
31
31
|
}) : target, mod));
|
|
@@ -143,15 +143,15 @@ function lexBinding(content, start) {
|
|
|
143
143
|
if (char === `'`) state = 1;
|
|
144
144
|
else if (char === `"`) state = 2;
|
|
145
145
|
else if (char === `(`) parenDepth++;
|
|
146
|
-
else if (char === `)`)
|
|
147
|
-
|
|
146
|
+
else if (char === `)`) {
|
|
147
|
+
if (parenDepth > 0) parenDepth--;
|
|
148
|
+
else return i;
|
|
149
|
+
}
|
|
148
150
|
break;
|
|
149
151
|
case 1:
|
|
150
152
|
if (char === `'`) state = 0;
|
|
151
153
|
break;
|
|
152
|
-
case 2:
|
|
153
|
-
if (char === `"`) state = 0;
|
|
154
|
-
break;
|
|
154
|
+
case 2: if (char === `"`) state = 0;
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
157
|
return null;
|
|
@@ -183,11 +183,14 @@ const cssVarsPlugin = (opts) => {
|
|
|
183
183
|
};
|
|
184
184
|
cssVarsPlugin.postcss = true;
|
|
185
185
|
function genCssVarsCode(vars, bindings, id, isProd, vapor) {
|
|
186
|
-
const
|
|
186
|
+
const varsExp = genCssVarsFromList(vars, id, isProd);
|
|
187
|
+
const exp = (0, _vue_compiler_dom.createSimpleExpression)(varsExp, false);
|
|
188
|
+
const context = (0, _vue_compiler_dom.createTransformContext)((0, _vue_compiler_dom.createRoot)([]), {
|
|
187
189
|
prefixIdentifiers: true,
|
|
188
190
|
inline: true,
|
|
189
191
|
bindingMetadata: bindings.__isScriptSetup === false ? void 0 : bindings
|
|
190
|
-
})
|
|
192
|
+
});
|
|
193
|
+
const transformed = (0, _vue_compiler_dom.processExpression)(exp, context);
|
|
191
194
|
const transformedString = transformed.type === 4 ? transformed.content : transformed.children.map((c) => {
|
|
192
195
|
return typeof c === "string" ? c : c.content;
|
|
193
196
|
}).join("");
|
|
@@ -197,33 +200,71 @@ function genNormalScriptCssVarsCode(cssVars, bindings, id, isProd, defaultVar) {
|
|
|
197
200
|
return `\nimport { ${CSS_VARS_HELPER} as _${CSS_VARS_HELPER} } from 'vue'\nconst __injectCSSVars__ = () => {\n${genCssVarsCode(cssVars, bindings, id, isProd)}}\nconst __setup__ = ${defaultVar}.setup\n${defaultVar}.setup = __setup__\n ? (props, ctx) => { __injectCSSVars__();return __setup__(props, ctx) }\n : __injectCSSVars__\n`;
|
|
198
201
|
}
|
|
199
202
|
//#endregion
|
|
200
|
-
//#region \0@oxc-project+runtime@0.
|
|
203
|
+
//#region \0@oxc-project+runtime@0.146.0/helpers/esm/typeof.js
|
|
204
|
+
function _typeof(o) {
|
|
205
|
+
"@babel/helpers - typeof";
|
|
206
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
207
|
+
return typeof o;
|
|
208
|
+
} : function(o) {
|
|
209
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
210
|
+
}, _typeof(o);
|
|
211
|
+
}
|
|
212
|
+
//#endregion
|
|
213
|
+
//#region \0@oxc-project+runtime@0.146.0/helpers/esm/toPrimitive.js
|
|
214
|
+
function toPrimitive(t, r) {
|
|
215
|
+
if ("object" != _typeof(t) || !t) return t;
|
|
216
|
+
var e = t[Symbol.toPrimitive];
|
|
217
|
+
if (void 0 !== e) {
|
|
218
|
+
var i = e.call(t, r || "default");
|
|
219
|
+
if ("object" != _typeof(i)) return i;
|
|
220
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
221
|
+
}
|
|
222
|
+
return ("string" === r ? String : Number)(t);
|
|
223
|
+
}
|
|
224
|
+
//#endregion
|
|
225
|
+
//#region \0@oxc-project+runtime@0.146.0/helpers/esm/toPropertyKey.js
|
|
226
|
+
function toPropertyKey(t) {
|
|
227
|
+
var i = toPrimitive(t, "string");
|
|
228
|
+
return "symbol" == _typeof(i) ? i : i + "";
|
|
229
|
+
}
|
|
230
|
+
//#endregion
|
|
231
|
+
//#region \0@oxc-project+runtime@0.146.0/helpers/esm/defineProperty.js
|
|
232
|
+
function _defineProperty(e, r, t) {
|
|
233
|
+
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
234
|
+
value: t,
|
|
235
|
+
enumerable: !0,
|
|
236
|
+
configurable: !0,
|
|
237
|
+
writable: !0
|
|
238
|
+
}) : e[r] = t, e;
|
|
239
|
+
}
|
|
240
|
+
//#endregion
|
|
241
|
+
//#region \0@oxc-project+runtime@0.146.0/helpers/esm/checkPrivateRedeclaration.js
|
|
201
242
|
function _checkPrivateRedeclaration(e, t) {
|
|
202
243
|
if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object");
|
|
203
244
|
}
|
|
204
245
|
//#endregion
|
|
205
|
-
//#region \0@oxc-project+runtime@0.
|
|
246
|
+
//#region \0@oxc-project+runtime@0.146.0/helpers/esm/classPrivateMethodInitSpec.js
|
|
206
247
|
function _classPrivateMethodInitSpec(e, a) {
|
|
207
248
|
_checkPrivateRedeclaration(e, a), a.add(e);
|
|
208
249
|
}
|
|
209
250
|
//#endregion
|
|
210
|
-
//#region \0@oxc-project+runtime@0.
|
|
251
|
+
//#region \0@oxc-project+runtime@0.146.0/helpers/esm/classPrivateFieldInitSpec.js
|
|
211
252
|
function _classPrivateFieldInitSpec(e, t, a) {
|
|
212
253
|
_checkPrivateRedeclaration(e, t), t.set(e, a);
|
|
213
254
|
}
|
|
214
255
|
//#endregion
|
|
215
|
-
//#region \0@oxc-project+runtime@0.
|
|
256
|
+
//#region \0@oxc-project+runtime@0.146.0/helpers/esm/assertClassBrand.js
|
|
216
257
|
function _assertClassBrand(e, t, n) {
|
|
217
258
|
if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n;
|
|
218
259
|
throw new TypeError("Private element is not present on this object");
|
|
219
260
|
}
|
|
220
261
|
//#endregion
|
|
221
|
-
//#region \0@oxc-project+runtime@0.
|
|
262
|
+
//#region \0@oxc-project+runtime@0.146.0/helpers/esm/classPrivateFieldGet2.js
|
|
222
263
|
function _classPrivateFieldGet2(s, a) {
|
|
223
264
|
return s.get(_assertClassBrand(s, a));
|
|
224
265
|
}
|
|
225
266
|
//#endregion
|
|
226
|
-
//#region \0@oxc-project+runtime@0.
|
|
267
|
+
//#region \0@oxc-project+runtime@0.146.0/helpers/esm/classPrivateFieldSet2.js
|
|
227
268
|
function _classPrivateFieldSet2(s, a, r) {
|
|
228
269
|
return s.set(_assertClassBrand(s, a), r), r;
|
|
229
270
|
}
|
|
@@ -248,8 +289,10 @@ if (typeof AC === "undefined") {
|
|
|
248
289
|
var _PROCESS$env;
|
|
249
290
|
AS = class AbortSignal {
|
|
250
291
|
constructor() {
|
|
251
|
-
this
|
|
252
|
-
this
|
|
292
|
+
_defineProperty(this, "onabort", void 0);
|
|
293
|
+
_defineProperty(this, "_onabort", []);
|
|
294
|
+
_defineProperty(this, "reason", void 0);
|
|
295
|
+
_defineProperty(this, "aborted", false);
|
|
253
296
|
}
|
|
254
297
|
addEventListener(_, fn) {
|
|
255
298
|
this._onabort.push(fn);
|
|
@@ -257,7 +300,7 @@ if (typeof AC === "undefined") {
|
|
|
257
300
|
};
|
|
258
301
|
AC = class AbortController {
|
|
259
302
|
constructor() {
|
|
260
|
-
this
|
|
303
|
+
_defineProperty(this, "signal", new AS());
|
|
261
304
|
warnACPolyfill();
|
|
262
305
|
}
|
|
263
306
|
abort(reason) {
|
|
@@ -298,6 +341,8 @@ var Stack = class Stack {
|
|
|
298
341
|
return s;
|
|
299
342
|
}
|
|
300
343
|
constructor(max, HeapCls) {
|
|
344
|
+
_defineProperty(this, "heap", void 0);
|
|
345
|
+
_defineProperty(this, "length", void 0);
|
|
301
346
|
/* c8 ignore start */
|
|
302
347
|
if (!_constructing._) throw new TypeError("instantiate Stack using Stack.create(n)");
|
|
303
348
|
/* c8 ignore stop */
|
|
@@ -436,6 +481,126 @@ var LRUCache = class LRUCache {
|
|
|
436
481
|
_classPrivateFieldInitSpec(this, _dispose, void 0);
|
|
437
482
|
_classPrivateFieldInitSpec(this, _disposeAfter, void 0);
|
|
438
483
|
_classPrivateFieldInitSpec(this, _fetchMethod, void 0);
|
|
484
|
+
_defineProperty(
|
|
485
|
+
this,
|
|
486
|
+
/**
|
|
487
|
+
* {@link LRUCache.OptionsBase.ttl}
|
|
488
|
+
*/
|
|
489
|
+
"ttl",
|
|
490
|
+
void 0
|
|
491
|
+
);
|
|
492
|
+
_defineProperty(
|
|
493
|
+
this,
|
|
494
|
+
/**
|
|
495
|
+
* {@link LRUCache.OptionsBase.ttlResolution}
|
|
496
|
+
*/
|
|
497
|
+
"ttlResolution",
|
|
498
|
+
void 0
|
|
499
|
+
);
|
|
500
|
+
_defineProperty(
|
|
501
|
+
this,
|
|
502
|
+
/**
|
|
503
|
+
* {@link LRUCache.OptionsBase.ttlAutopurge}
|
|
504
|
+
*/
|
|
505
|
+
"ttlAutopurge",
|
|
506
|
+
void 0
|
|
507
|
+
);
|
|
508
|
+
_defineProperty(
|
|
509
|
+
this,
|
|
510
|
+
/**
|
|
511
|
+
* {@link LRUCache.OptionsBase.updateAgeOnGet}
|
|
512
|
+
*/
|
|
513
|
+
"updateAgeOnGet",
|
|
514
|
+
void 0
|
|
515
|
+
);
|
|
516
|
+
_defineProperty(
|
|
517
|
+
this,
|
|
518
|
+
/**
|
|
519
|
+
* {@link LRUCache.OptionsBase.updateAgeOnHas}
|
|
520
|
+
*/
|
|
521
|
+
"updateAgeOnHas",
|
|
522
|
+
void 0
|
|
523
|
+
);
|
|
524
|
+
_defineProperty(
|
|
525
|
+
this,
|
|
526
|
+
/**
|
|
527
|
+
* {@link LRUCache.OptionsBase.allowStale}
|
|
528
|
+
*/
|
|
529
|
+
"allowStale",
|
|
530
|
+
void 0
|
|
531
|
+
);
|
|
532
|
+
_defineProperty(
|
|
533
|
+
this,
|
|
534
|
+
/**
|
|
535
|
+
* {@link LRUCache.OptionsBase.noDisposeOnSet}
|
|
536
|
+
*/
|
|
537
|
+
"noDisposeOnSet",
|
|
538
|
+
void 0
|
|
539
|
+
);
|
|
540
|
+
_defineProperty(
|
|
541
|
+
this,
|
|
542
|
+
/**
|
|
543
|
+
* {@link LRUCache.OptionsBase.noUpdateTTL}
|
|
544
|
+
*/
|
|
545
|
+
"noUpdateTTL",
|
|
546
|
+
void 0
|
|
547
|
+
);
|
|
548
|
+
_defineProperty(
|
|
549
|
+
this,
|
|
550
|
+
/**
|
|
551
|
+
* {@link LRUCache.OptionsBase.maxEntrySize}
|
|
552
|
+
*/
|
|
553
|
+
"maxEntrySize",
|
|
554
|
+
void 0
|
|
555
|
+
);
|
|
556
|
+
_defineProperty(
|
|
557
|
+
this,
|
|
558
|
+
/**
|
|
559
|
+
* {@link LRUCache.OptionsBase.sizeCalculation}
|
|
560
|
+
*/
|
|
561
|
+
"sizeCalculation",
|
|
562
|
+
void 0
|
|
563
|
+
);
|
|
564
|
+
_defineProperty(
|
|
565
|
+
this,
|
|
566
|
+
/**
|
|
567
|
+
* {@link LRUCache.OptionsBase.noDeleteOnFetchRejection}
|
|
568
|
+
*/
|
|
569
|
+
"noDeleteOnFetchRejection",
|
|
570
|
+
void 0
|
|
571
|
+
);
|
|
572
|
+
_defineProperty(
|
|
573
|
+
this,
|
|
574
|
+
/**
|
|
575
|
+
* {@link LRUCache.OptionsBase.noDeleteOnStaleGet}
|
|
576
|
+
*/
|
|
577
|
+
"noDeleteOnStaleGet",
|
|
578
|
+
void 0
|
|
579
|
+
);
|
|
580
|
+
_defineProperty(
|
|
581
|
+
this,
|
|
582
|
+
/**
|
|
583
|
+
* {@link LRUCache.OptionsBase.allowStaleOnFetchAbort}
|
|
584
|
+
*/
|
|
585
|
+
"allowStaleOnFetchAbort",
|
|
586
|
+
void 0
|
|
587
|
+
);
|
|
588
|
+
_defineProperty(
|
|
589
|
+
this,
|
|
590
|
+
/**
|
|
591
|
+
* {@link LRUCache.OptionsBase.allowStaleOnFetchRejection}
|
|
592
|
+
*/
|
|
593
|
+
"allowStaleOnFetchRejection",
|
|
594
|
+
void 0
|
|
595
|
+
);
|
|
596
|
+
_defineProperty(
|
|
597
|
+
this,
|
|
598
|
+
/**
|
|
599
|
+
* {@link LRUCache.OptionsBase.ignoreFetchAbort}
|
|
600
|
+
*/
|
|
601
|
+
"ignoreFetchAbort",
|
|
602
|
+
void 0
|
|
603
|
+
);
|
|
439
604
|
_classPrivateFieldInitSpec(this, _size, void 0);
|
|
440
605
|
_classPrivateFieldInitSpec(this, _calculatedSize, void 0);
|
|
441
606
|
_classPrivateFieldInitSpec(this, _keyMap, void 0);
|
|
@@ -1131,11 +1296,13 @@ function _initializeSizeTracking() {
|
|
|
1131
1296
|
});
|
|
1132
1297
|
_classPrivateFieldSet2(_requireSize, this, (k, v, size, sizeCalculation) => {
|
|
1133
1298
|
if (_assertClassBrand(_LRUCache_brand, this, _isBackgroundFetch).call(this, v)) return 0;
|
|
1134
|
-
if (!isPosInt(size))
|
|
1135
|
-
if (
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1299
|
+
if (!isPosInt(size)) {
|
|
1300
|
+
if (sizeCalculation) {
|
|
1301
|
+
if (typeof sizeCalculation !== "function") throw new TypeError("sizeCalculation must be a function");
|
|
1302
|
+
size = sizeCalculation(v, k);
|
|
1303
|
+
if (!isPosInt(size)) throw new TypeError("sizeCalculation return invalid (expect positive integer)");
|
|
1304
|
+
} else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");
|
|
1305
|
+
}
|
|
1139
1306
|
return size;
|
|
1140
1307
|
});
|
|
1141
1308
|
_classPrivateFieldSet2(_addItemSize, this, (index, size, status) => {
|
|
@@ -1218,18 +1385,23 @@ function _backgroundFetch(k, index, options, context) {
|
|
|
1218
1385
|
const cb = (v, updateCache = false) => {
|
|
1219
1386
|
const { aborted } = ac.signal;
|
|
1220
1387
|
const ignoreAbort = options.ignoreFetchAbort && v !== void 0;
|
|
1221
|
-
if (options.status)
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1388
|
+
if (options.status) {
|
|
1389
|
+
if (aborted && !updateCache) {
|
|
1390
|
+
options.status.fetchAborted = true;
|
|
1391
|
+
options.status.fetchError = ac.signal.reason;
|
|
1392
|
+
if (ignoreAbort) options.status.fetchAbortIgnored = true;
|
|
1393
|
+
} else options.status.fetchResolved = true;
|
|
1394
|
+
}
|
|
1226
1395
|
if (aborted && !ignoreAbort && !updateCache) return fetchFail(ac.signal.reason);
|
|
1227
1396
|
const bf = p;
|
|
1228
|
-
if (_classPrivateFieldGet2(_valList, this)[index] === p)
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1397
|
+
if (_classPrivateFieldGet2(_valList, this)[index] === p) {
|
|
1398
|
+
if (v === void 0) {
|
|
1399
|
+
if (bf.__staleWhileFetching) _classPrivateFieldGet2(_valList, this)[index] = bf.__staleWhileFetching;
|
|
1400
|
+
else this.delete(k);
|
|
1401
|
+
} else {
|
|
1402
|
+
if (options.status) options.status.fetchUpdated = true;
|
|
1403
|
+
this.set(k, v, fetchOpts.options);
|
|
1404
|
+
}
|
|
1233
1405
|
}
|
|
1234
1406
|
return v;
|
|
1235
1407
|
};
|
|
@@ -1309,12 +1481,13 @@ function createCache(max = 500) {
|
|
|
1309
1481
|
function resolveTemplateAST(inAST, options) {
|
|
1310
1482
|
if (!(inAST === null || inAST === void 0 ? void 0 : inAST.transformed)) return inAST;
|
|
1311
1483
|
const { compiler = _vue_compiler_dom, compilerOptions, ssr, onError } = options;
|
|
1312
|
-
|
|
1484
|
+
const template = (ssr ? _vue_compiler_dom : compiler).parse(inAST.source, {
|
|
1313
1485
|
prefixIdentifiers: true,
|
|
1314
1486
|
...compilerOptions,
|
|
1315
1487
|
parseMode: "sfc",
|
|
1316
1488
|
onError
|
|
1317
|
-
}).children.find((node) => node.type === 1 && node.tag === "template")
|
|
1489
|
+
}).children.find((node) => node.type === 1 && node.tag === "template");
|
|
1490
|
+
return (0, _vue_compiler_core.createRoot)(template.children, inAST.source);
|
|
1318
1491
|
}
|
|
1319
1492
|
//#endregion
|
|
1320
1493
|
//#region packages/compiler-sfc/src/script/importUsageCheck.ts
|
|
@@ -1382,9 +1555,7 @@ function resolveTemplateAnalysisResult(sfc, collectUsedIds = true, options) {
|
|
|
1382
1555
|
}
|
|
1383
1556
|
node.children.forEach(walk);
|
|
1384
1557
|
break;
|
|
1385
|
-
case 5:
|
|
1386
|
-
if (ids) extractIdentifiers$2(ids, node.content);
|
|
1387
|
-
break;
|
|
1558
|
+
case 5: if (ids) extractIdentifiers$2(ids, node.content);
|
|
1388
1559
|
}
|
|
1389
1560
|
}
|
|
1390
1561
|
const result = {
|
|
@@ -1470,9 +1641,7 @@ function parse(source, options = {}) {
|
|
|
1470
1641
|
if (styleBlock.attrs.vars) errors.push(/* @__PURE__ */ new SyntaxError("<style vars> has been replaced by a new proposal: https://github.com/vuejs/rfcs/pull/231"));
|
|
1471
1642
|
descriptor.styles.push(styleBlock);
|
|
1472
1643
|
break;
|
|
1473
|
-
default:
|
|
1474
|
-
descriptor.customBlocks.push(createBlock(node, source, pad));
|
|
1475
|
-
break;
|
|
1644
|
+
default: descriptor.customBlocks.push(createBlock(node, source, pad));
|
|
1476
1645
|
}
|
|
1477
1646
|
});
|
|
1478
1647
|
if (!descriptor.template && !descriptor.script && !descriptor.scriptSetup) errors.push(/* @__PURE__ */ new SyntaxError(`At least one <template> or <script> is required in a single file component. ${descriptor.filename}`));
|
|
@@ -2035,9 +2204,10 @@ var require_consolidate$1 = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
2035
2204
|
var partialPath = options.partials[key];
|
|
2036
2205
|
if (partialPath === void 0 || partialPath === null || partialPath === false) return next(++index);
|
|
2037
2206
|
var file;
|
|
2038
|
-
if (isAbsolute(partialPath))
|
|
2039
|
-
|
|
2040
|
-
|
|
2207
|
+
if (isAbsolute(partialPath)) {
|
|
2208
|
+
if (extname(partialPath) !== "") file = partialPath;
|
|
2209
|
+
else file = join(partialPath + extname(path$9));
|
|
2210
|
+
} else file = join(dirname(path$9), partialPath + extname(path$9));
|
|
2041
2211
|
read(file, options, function(err, str) {
|
|
2042
2212
|
if (err) return cb(err);
|
|
2043
2213
|
partials[key] = str;
|
|
@@ -2931,8 +3101,10 @@ var require_consolidate$1 = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
2931
3101
|
else if (options.nunjucks && options.nunjucks.configure) env = engine.configure.apply(engine, options.nunjucks.configure);
|
|
2932
3102
|
if (options.loader) env = new engine.Environment(options.loader);
|
|
2933
3103
|
else if (options.settings && options.settings.views) env = new engine.Environment(new engine.FileSystemLoader(options.settings.views));
|
|
2934
|
-
else if (options.nunjucks && options.nunjucks.loader)
|
|
2935
|
-
|
|
3104
|
+
else if (options.nunjucks && options.nunjucks.loader) {
|
|
3105
|
+
if (typeof options.nunjucks.loader === "string") env = new engine.Environment(new engine.FileSystemLoader(options.nunjucks.loader));
|
|
3106
|
+
else env = new engine.Environment(new engine.FileSystemLoader(options.nunjucks.loader[0], options.nunjucks.loader[1]));
|
|
3107
|
+
}
|
|
2936
3108
|
env.renderString(str, options, cb);
|
|
2937
3109
|
} catch (err) {
|
|
2938
3110
|
throw cb(err);
|
|
@@ -4293,9 +4465,10 @@ var require_cssesc = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4293
4465
|
else counter--;
|
|
4294
4466
|
}
|
|
4295
4467
|
value = "\\" + codePoint.toString(16).toUpperCase() + " ";
|
|
4296
|
-
} else if (options.escapeEverything)
|
|
4297
|
-
|
|
4298
|
-
|
|
4468
|
+
} else if (options.escapeEverything) {
|
|
4469
|
+
if (regexAnySingleEscape.test(character)) value = "\\" + character;
|
|
4470
|
+
else value = "\\" + codePoint.toString(16).toUpperCase() + " ";
|
|
4471
|
+
} else if (/[\t\n\f\r\x0B]/.test(character)) value = "\\" + codePoint.toString(16).toUpperCase() + " ";
|
|
4299
4472
|
else if (character == "\\" || !isIdentifier && (character == "\"" && quote == character || character == "'" && quote == character) || isIdentifier && regexSingleEscape.test(character)) value = "\\" + character;
|
|
4300
4473
|
else value = character;
|
|
4301
4474
|
output += value;
|
|
@@ -5264,7 +5437,8 @@ var require_tokenize = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
5264
5437
|
return result;
|
|
5265
5438
|
};
|
|
5266
5439
|
})();
|
|
5267
|
-
var _a
|
|
5440
|
+
var _a;
|
|
5441
|
+
var _b;
|
|
5268
5442
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5269
5443
|
exports.FIELDS = void 0;
|
|
5270
5444
|
exports.default = tokenize;
|
|
@@ -5442,7 +5616,6 @@ var require_tokenize = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
5442
5616
|
endColumn = next - offset;
|
|
5443
5617
|
}
|
|
5444
5618
|
end = next + 1;
|
|
5445
|
-
break;
|
|
5446
5619
|
}
|
|
5447
5620
|
tokens.push([
|
|
5448
5621
|
tokenType,
|
|
@@ -5545,7 +5718,8 @@ var require_parser = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
5545
5718
|
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
5546
5719
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
5547
5720
|
};
|
|
5548
|
-
var _a
|
|
5721
|
+
var _a;
|
|
5722
|
+
var _b;
|
|
5549
5723
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5550
5724
|
var root_1 = __importDefault(require_root());
|
|
5551
5725
|
var selector_1 = __importDefault(require_selector());
|
|
@@ -5821,18 +5995,19 @@ var require_parser = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
5821
5995
|
spaceAfterMeaningfulToken = false;
|
|
5822
5996
|
break;
|
|
5823
5997
|
case tokens.comment:
|
|
5824
|
-
if (lastAdded)
|
|
5825
|
-
|
|
5826
|
-
|
|
5827
|
-
|
|
5828
|
-
|
|
5829
|
-
|
|
5830
|
-
|
|
5831
|
-
|
|
5832
|
-
|
|
5833
|
-
|
|
5834
|
-
|
|
5835
|
-
|
|
5998
|
+
if (lastAdded) {
|
|
5999
|
+
if (spaceAfterMeaningfulToken || next && next[tokenize_1.FIELDS.TYPE] === tokens.space || lastAdded === "insensitive") {
|
|
6000
|
+
var lastComment = (0, util_1.getProp)(node, "spaces", lastAdded, "after") || "";
|
|
6001
|
+
var rawLastComment = (0, util_1.getProp)(node, "raws", "spaces", lastAdded, "after") || lastComment;
|
|
6002
|
+
(0, util_1.ensureObject)(node, "raws", "spaces", lastAdded);
|
|
6003
|
+
node.raws.spaces[lastAdded].after = rawLastComment + content;
|
|
6004
|
+
} else {
|
|
6005
|
+
var lastValue = node[lastAdded] || "";
|
|
6006
|
+
var rawLastValue = (0, util_1.getProp)(node, "raws", lastAdded) || lastValue;
|
|
6007
|
+
(0, util_1.ensureObject)(node, "raws");
|
|
6008
|
+
node.raws[lastAdded] = rawLastValue + content;
|
|
6009
|
+
}
|
|
6010
|
+
} else commentBefore = commentBefore + content;
|
|
5836
6011
|
break;
|
|
5837
6012
|
default: return this.error("Unexpected \"".concat(content, "\" found."), { index: token[tokenize_1.FIELDS.START_POS] });
|
|
5838
6013
|
}
|
|
@@ -6851,15 +7026,17 @@ function rewriteSelector(id, rule, selector, selectorRoot, deep, slotted = false
|
|
|
6851
7026
|
if (n.type === "universal") {
|
|
6852
7027
|
const prev = selector.at(selector.index(n) - 1);
|
|
6853
7028
|
const next = selector.at(selector.index(n) + 1);
|
|
6854
|
-
if (!prev)
|
|
6855
|
-
if (next
|
|
6856
|
-
|
|
6857
|
-
|
|
6858
|
-
|
|
6859
|
-
|
|
6860
|
-
|
|
6861
|
-
|
|
6862
|
-
|
|
7029
|
+
if (!prev) {
|
|
7030
|
+
if (next) {
|
|
7031
|
+
if (next.type === "combinator" && next.value === " ") selector.removeChild(next);
|
|
7032
|
+
selector.removeChild(n);
|
|
7033
|
+
return;
|
|
7034
|
+
} else {
|
|
7035
|
+
node = import_dist.default.combinator({ value: "" });
|
|
7036
|
+
selector.insertBefore(n, node);
|
|
7037
|
+
selector.removeChild(n);
|
|
7038
|
+
return false;
|
|
7039
|
+
}
|
|
6863
7040
|
}
|
|
6864
7041
|
if (node) return;
|
|
6865
7042
|
}
|
|
@@ -7103,12 +7280,14 @@ var require_util = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
7103
7280
|
part = parts[i];
|
|
7104
7281
|
if (part === ".") parts.splice(i, 1);
|
|
7105
7282
|
else if (part === "..") up++;
|
|
7106
|
-
else if (up > 0)
|
|
7107
|
-
|
|
7108
|
-
|
|
7109
|
-
|
|
7110
|
-
|
|
7111
|
-
|
|
7283
|
+
else if (up > 0) {
|
|
7284
|
+
if (part === "") {
|
|
7285
|
+
parts.splice(i + 1, up);
|
|
7286
|
+
up = 0;
|
|
7287
|
+
} else {
|
|
7288
|
+
parts.splice(i, 2);
|
|
7289
|
+
up--;
|
|
7290
|
+
}
|
|
7112
7291
|
}
|
|
7113
7292
|
}
|
|
7114
7293
|
path = parts.join("/");
|
|
@@ -7360,8 +7539,10 @@ var require_array_set = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
7360
7539
|
var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);
|
|
7361
7540
|
var idx = this._array.length;
|
|
7362
7541
|
if (!isDuplicate || aAllowDuplicates) this._array.push(aStr);
|
|
7363
|
-
if (!isDuplicate)
|
|
7364
|
-
|
|
7542
|
+
if (!isDuplicate) {
|
|
7543
|
+
if (hasNativeMap) this._set.set(aStr, idx);
|
|
7544
|
+
else this._set[sStr] = idx;
|
|
7545
|
+
}
|
|
7365
7546
|
};
|
|
7366
7547
|
/**
|
|
7367
7548
|
* Is the given string a member of this set?
|
|
@@ -8677,18 +8858,20 @@ var require_source_node = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
8677
8858
|
var lastGeneratedLine = 1, lastGeneratedColumn = 0;
|
|
8678
8859
|
var lastMapping = null;
|
|
8679
8860
|
aSourceMapConsumer.eachMapping(function(mapping) {
|
|
8680
|
-
if (lastMapping !== null)
|
|
8681
|
-
|
|
8682
|
-
|
|
8683
|
-
|
|
8684
|
-
|
|
8685
|
-
|
|
8686
|
-
|
|
8687
|
-
|
|
8688
|
-
|
|
8689
|
-
|
|
8690
|
-
|
|
8691
|
-
|
|
8861
|
+
if (lastMapping !== null) {
|
|
8862
|
+
if (lastGeneratedLine < mapping.generatedLine) {
|
|
8863
|
+
addMappingWithCode(lastMapping, shiftNextLine());
|
|
8864
|
+
lastGeneratedLine++;
|
|
8865
|
+
lastGeneratedColumn = 0;
|
|
8866
|
+
} else {
|
|
8867
|
+
var nextLine = remainingLines[remainingLinesIndex] || "";
|
|
8868
|
+
var code = nextLine.substr(0, mapping.generatedColumn - lastGeneratedColumn);
|
|
8869
|
+
remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - lastGeneratedColumn);
|
|
8870
|
+
lastGeneratedColumn = mapping.generatedColumn;
|
|
8871
|
+
addMappingWithCode(lastMapping, code);
|
|
8872
|
+
lastMapping = mapping;
|
|
8873
|
+
return;
|
|
8874
|
+
}
|
|
8692
8875
|
}
|
|
8693
8876
|
while (lastGeneratedLine < mapping.generatedLine) {
|
|
8694
8877
|
node.add(shiftNextLine());
|
|
@@ -9349,16 +9532,6 @@ var require_saveJSON = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
9349
9532
|
//#endregion
|
|
9350
9533
|
//#region node_modules/.pnpm/lodash.camelcase@4.3.0/node_modules/lodash.camelcase/index.js
|
|
9351
9534
|
var require_lodash_camelcase = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
9352
|
-
/**
|
|
9353
|
-
* lodash (Custom Build) <https://lodash.com/>
|
|
9354
|
-
* Build: `lodash modularize exports="npm" -o ./`
|
|
9355
|
-
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
|
|
9356
|
-
* Released under MIT license <https://lodash.com/license>
|
|
9357
|
-
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
9358
|
-
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
9359
|
-
*/
|
|
9360
|
-
/** Used as references for various `Number` constants. */
|
|
9361
|
-
var INFINITY = Infinity;
|
|
9362
9535
|
/** `Object#toString` result references. */
|
|
9363
9536
|
var symbolTag = "[object Symbol]";
|
|
9364
9537
|
/** Used to match words composed of alphanumeric characters. */
|
|
@@ -9366,19 +9539,53 @@ var require_lodash_camelcase = /* @__PURE__ */ __commonJSMin(((exports, module)
|
|
|
9366
9539
|
/** Used to match Latin Unicode letters (excluding mathematical operators). */
|
|
9367
9540
|
var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
|
|
9368
9541
|
/** Used to compose unicode character classes. */
|
|
9369
|
-
var rsAstralRange = "\\ud800-\\udfff"
|
|
9542
|
+
var rsAstralRange = "\\ud800-\\udfff";
|
|
9543
|
+
var rsComboMarksRange = "\\u0300-\\u036f\\ufe20-\\ufe23";
|
|
9544
|
+
var rsComboSymbolsRange = "\\u20d0-\\u20f0";
|
|
9545
|
+
var rsDingbatRange = "\\u2700-\\u27bf";
|
|
9546
|
+
var rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff";
|
|
9547
|
+
var rsMathOpRange = "\\xac\\xb1\\xd7\\xf7";
|
|
9548
|
+
var rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf";
|
|
9549
|
+
var rsPunctuationRange = "\\u2000-\\u206f";
|
|
9550
|
+
var rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000";
|
|
9551
|
+
var rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde";
|
|
9552
|
+
var rsVarRange = "\\ufe0e\\ufe0f";
|
|
9553
|
+
var rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
|
|
9370
9554
|
/** Used to compose unicode capture groups. */
|
|
9371
|
-
var rsApos = "['’]"
|
|
9555
|
+
var rsApos = "['’]";
|
|
9556
|
+
var rsAstral = "[" + rsAstralRange + "]";
|
|
9557
|
+
var rsBreak = "[" + rsBreakRange + "]";
|
|
9558
|
+
var rsCombo = "[" + rsComboMarksRange + rsComboSymbolsRange + "]";
|
|
9559
|
+
var rsDigits = "\\d+";
|
|
9560
|
+
var rsDingbat = "[" + rsDingbatRange + "]";
|
|
9561
|
+
var rsLower = "[" + rsLowerRange + "]";
|
|
9562
|
+
var rsMisc = "[^" + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + "]";
|
|
9563
|
+
var rsFitz = "\\ud83c[\\udffb-\\udfff]";
|
|
9564
|
+
var rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")";
|
|
9565
|
+
var rsNonAstral = "[^" + rsAstralRange + "]";
|
|
9566
|
+
var rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}";
|
|
9567
|
+
var rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]";
|
|
9568
|
+
var rsUpper = "[" + rsUpperRange + "]";
|
|
9569
|
+
var rsZWJ = "\\u200d";
|
|
9372
9570
|
/** Used to compose unicode regexes. */
|
|
9373
|
-
var rsLowerMisc = "(?:" + rsLower + "|" + rsMisc + ")"
|
|
9571
|
+
var rsLowerMisc = "(?:" + rsLower + "|" + rsMisc + ")";
|
|
9572
|
+
var rsUpperMisc = "(?:" + rsUpper + "|" + rsMisc + ")";
|
|
9573
|
+
var rsOptLowerContr = "(?:" + rsApos + "(?:d|ll|m|re|s|t|ve))?";
|
|
9574
|
+
var rsOptUpperContr = "(?:" + rsApos + "(?:D|LL|M|RE|S|T|VE))?";
|
|
9575
|
+
var reOptMod = rsModifier + "?";
|
|
9576
|
+
var rsOptVar = "[" + rsVarRange + "]?";
|
|
9577
|
+
var rsOptJoin = "(?:" + rsZWJ + "(?:" + [
|
|
9374
9578
|
rsNonAstral,
|
|
9375
9579
|
rsRegional,
|
|
9376
9580
|
rsSurrPair
|
|
9377
|
-
].join("|") + ")" + rsOptVar + reOptMod + ")*"
|
|
9581
|
+
].join("|") + ")" + rsOptVar + reOptMod + ")*";
|
|
9582
|
+
var rsSeq = rsOptVar + reOptMod + rsOptJoin;
|
|
9583
|
+
var rsEmoji = "(?:" + [
|
|
9378
9584
|
rsDingbat,
|
|
9379
9585
|
rsRegional,
|
|
9380
9586
|
rsSurrPair
|
|
9381
|
-
].join("|") + ")" + rsSeq
|
|
9587
|
+
].join("|") + ")" + rsSeq;
|
|
9588
|
+
var rsSymbol = "(?:" + [
|
|
9382
9589
|
rsNonAstral + rsCombo + "?",
|
|
9383
9590
|
rsCombo,
|
|
9384
9591
|
rsRegional,
|
|
@@ -9732,7 +9939,8 @@ var require_lodash_camelcase = /* @__PURE__ */ __commonJSMin(((exports, module)
|
|
|
9732
9939
|
/** Built-in value references. */
|
|
9733
9940
|
var Symbol = root.Symbol;
|
|
9734
9941
|
/** Used to convert symbols to primitives and strings. */
|
|
9735
|
-
var symbolProto = Symbol ? Symbol.prototype : void 0
|
|
9942
|
+
var symbolProto = Symbol ? Symbol.prototype : void 0;
|
|
9943
|
+
var symbolToString = symbolProto ? symbolProto.toString : void 0;
|
|
9736
9944
|
/**
|
|
9737
9945
|
* The base implementation of `_.slice` without an iteratee call guard.
|
|
9738
9946
|
*
|
|
@@ -9765,7 +9973,7 @@ var require_lodash_camelcase = /* @__PURE__ */ __commonJSMin(((exports, module)
|
|
|
9765
9973
|
if (typeof value == "string") return value;
|
|
9766
9974
|
if (isSymbol(value)) return symbolToString ? symbolToString.call(value) : "";
|
|
9767
9975
|
var result = value + "";
|
|
9768
|
-
return result == "0" && 1 / value == -
|
|
9976
|
+
return result == "0" && 1 / value == -Infinity ? "-0" : result;
|
|
9769
9977
|
}
|
|
9770
9978
|
/**
|
|
9771
9979
|
* Casts `array` to a slice if it's needed.
|
|
@@ -10021,9 +10229,7 @@ var require_localsConvention = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
10021
10229
|
tokens[className] = value;
|
|
10022
10230
|
tokens[dashesCamelCase(className)] = value;
|
|
10023
10231
|
break;
|
|
10024
|
-
case "dashesOnly":
|
|
10025
|
-
tokens[dashesCamelCase(className)] = value;
|
|
10026
|
-
break;
|
|
10232
|
+
case "dashesOnly": tokens[dashesCamelCase(className)] = value;
|
|
10027
10233
|
}
|
|
10028
10234
|
return tokens;
|
|
10029
10235
|
};
|
|
@@ -10249,10 +10455,13 @@ var require_src$3 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
10249
10455
|
declaration.value = values.join(", ");
|
|
10250
10456
|
});
|
|
10251
10457
|
const importsOrder = topologicalSort(graph, failOnWrongOrder);
|
|
10252
|
-
if (importsOrder instanceof Error)
|
|
10253
|
-
|
|
10254
|
-
|
|
10255
|
-
|
|
10458
|
+
if (importsOrder instanceof Error) {
|
|
10459
|
+
const importPath = importsOrder.nodes.find((importPath) => importDecls.hasOwnProperty(importPath));
|
|
10460
|
+
throw importDecls[importPath].error("Failed to resolve order of composed modules " + importsOrder.nodes.map((importPath) => "`" + importPath + "`").join(", ") + ".", {
|
|
10461
|
+
plugin: "postcss-modules-extract-imports",
|
|
10462
|
+
word: "composes"
|
|
10463
|
+
});
|
|
10464
|
+
}
|
|
10256
10465
|
let lastImportRule;
|
|
10257
10466
|
importsOrder.forEach((path) => {
|
|
10258
10467
|
const importedSymbols = imports[path];
|
|
@@ -10284,7 +10493,7 @@ var require_src$3 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
10284
10493
|
//#endregion
|
|
10285
10494
|
//#region node_modules/.pnpm/loader-utils@3.3.1/node_modules/loader-utils/lib/hash/wasm-hash.js
|
|
10286
10495
|
var require_wasm_hash = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
10287
|
-
const MAX_SHORT_STRING = Math.floor(
|
|
10496
|
+
const MAX_SHORT_STRING = Math.floor(16368) & -4;
|
|
10288
10497
|
var WasmHash = class {
|
|
10289
10498
|
/**
|
|
10290
10499
|
* @param {WebAssembly.Instance} instance wasm instance
|
|
@@ -10331,28 +10540,29 @@ var require_wasm_hash = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
10331
10540
|
_updateWithShortString(data, encoding) {
|
|
10332
10541
|
const { exports: exports$3, buffered, mem, chunkSize } = this;
|
|
10333
10542
|
let endPos;
|
|
10334
|
-
if (data.length < 70)
|
|
10335
|
-
|
|
10336
|
-
|
|
10337
|
-
|
|
10338
|
-
|
|
10339
|
-
|
|
10340
|
-
|
|
10341
|
-
|
|
10342
|
-
|
|
10343
|
-
|
|
10344
|
-
|
|
10345
|
-
|
|
10543
|
+
if (data.length < 70) {
|
|
10544
|
+
if (!encoding || encoding === "utf-8" || encoding === "utf8") {
|
|
10545
|
+
endPos = buffered;
|
|
10546
|
+
for (let i = 0; i < data.length; i++) {
|
|
10547
|
+
const cc = data.charCodeAt(i);
|
|
10548
|
+
if (cc < 128) mem[endPos++] = cc;
|
|
10549
|
+
else if (cc < 2048) {
|
|
10550
|
+
mem[endPos] = cc >> 6 | 192;
|
|
10551
|
+
mem[endPos + 1] = cc & 63 | 128;
|
|
10552
|
+
endPos += 2;
|
|
10553
|
+
} else {
|
|
10554
|
+
endPos += mem.write(data.slice(i), endPos, encoding);
|
|
10555
|
+
break;
|
|
10556
|
+
}
|
|
10346
10557
|
}
|
|
10347
|
-
}
|
|
10348
|
-
|
|
10349
|
-
|
|
10350
|
-
|
|
10351
|
-
|
|
10352
|
-
|
|
10353
|
-
}
|
|
10558
|
+
} else if (encoding === "latin1") {
|
|
10559
|
+
endPos = buffered;
|
|
10560
|
+
for (let i = 0; i < data.length; i++) {
|
|
10561
|
+
const cc = data.charCodeAt(i);
|
|
10562
|
+
mem[endPos++] = cc;
|
|
10563
|
+
}
|
|
10564
|
+
} else endPos = buffered + mem.write(data, buffered, encoding);
|
|
10354
10565
|
} else endPos = buffered + mem.write(data, buffered, encoding);
|
|
10355
|
-
else endPos = buffered + mem.write(data, buffered, encoding);
|
|
10356
10566
|
if (endPos < chunkSize) this.buffered = endPos;
|
|
10357
10567
|
else {
|
|
10358
10568
|
const l = endPos & ~(this.chunkSize - 1);
|
|
@@ -10447,11 +10657,12 @@ var require_BatchedHash = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
10447
10657
|
this.hash.update(this.string, this.encoding);
|
|
10448
10658
|
this.string = void 0;
|
|
10449
10659
|
}
|
|
10450
|
-
if (typeof data === "string")
|
|
10451
|
-
|
|
10452
|
-
|
|
10453
|
-
|
|
10454
|
-
|
|
10660
|
+
if (typeof data === "string") {
|
|
10661
|
+
if (data.length < MAX_SHORT_STRING && (!inputEncoding || !inputEncoding.startsWith("ba"))) {
|
|
10662
|
+
this.string = data;
|
|
10663
|
+
this.encoding = inputEncoding;
|
|
10664
|
+
} else this.hash.update(data, inputEncoding);
|
|
10665
|
+
} else this.hash.update(data);
|
|
10455
10666
|
return this;
|
|
10456
10667
|
}
|
|
10457
10668
|
/**
|
|
@@ -11267,22 +11478,18 @@ var require_src$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
11267
11478
|
}
|
|
11268
11479
|
}
|
|
11269
11480
|
break;
|
|
11270
|
-
case "function":
|
|
11271
|
-
if (
|
|
11272
|
-
|
|
11273
|
-
|
|
11274
|
-
|
|
11275
|
-
|
|
11276
|
-
|
|
11277
|
-
|
|
11278
|
-
|
|
11279
|
-
|
|
11280
|
-
|
|
11281
|
-
|
|
11282
|
-
}
|
|
11283
|
-
nestedNode.value = newUrl;
|
|
11284
|
-
});
|
|
11285
|
-
break;
|
|
11481
|
+
case "function": if (context.options && context.options.rewriteUrl && node.value.toLowerCase() === "url") node.nodes.map((nestedNode) => {
|
|
11482
|
+
if (nestedNode.type !== "string" && nestedNode.type !== "word") return;
|
|
11483
|
+
let newUrl = context.options.rewriteUrl(context.global, nestedNode.value);
|
|
11484
|
+
switch (nestedNode.type) {
|
|
11485
|
+
case "string":
|
|
11486
|
+
if (nestedNode.quote === "'") newUrl = newUrl.replace(/(\\)/g, "\\$1").replace(/'/g, "\\'");
|
|
11487
|
+
if (nestedNode.quote === "\"") newUrl = newUrl.replace(/(\\)/g, "\\$1").replace(/"/g, "\\\"");
|
|
11488
|
+
break;
|
|
11489
|
+
case "word": newUrl = newUrl.replace(/("|'|\)|\\)/g, "\\$1");
|
|
11490
|
+
}
|
|
11491
|
+
nestedNode.value = newUrl;
|
|
11492
|
+
});
|
|
11286
11493
|
}
|
|
11287
11494
|
return node;
|
|
11288
11495
|
}
|
|
@@ -11359,10 +11566,12 @@ var require_src$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
11359
11566
|
} else if (node.type !== "word") return;
|
|
11360
11567
|
const value = node.type === "word" ? node.value.toLowerCase() : null;
|
|
11361
11568
|
let shouldParseAnimationName = false;
|
|
11362
|
-
if (value && validIdent.test(value))
|
|
11363
|
-
|
|
11364
|
-
|
|
11365
|
-
|
|
11569
|
+
if (value && validIdent.test(value)) {
|
|
11570
|
+
if ("$" + value in animationKeywords) {
|
|
11571
|
+
parsedAnimationKeywords["$" + value] = "$" + value in parsedAnimationKeywords ? parsedAnimationKeywords["$" + value] + 1 : 0;
|
|
11572
|
+
shouldParseAnimationName = parsedAnimationKeywords["$" + value] >= animationKeywords["$" + value];
|
|
11573
|
+
} else shouldParseAnimationName = true;
|
|
11574
|
+
}
|
|
11366
11575
|
return localizeDeclNode(node, {
|
|
11367
11576
|
options: context.options,
|
|
11368
11577
|
global: context.global,
|
|
@@ -11547,9 +11756,7 @@ var require_src$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
11547
11756
|
node.each((item) => traverseNode(item));
|
|
11548
11757
|
break;
|
|
11549
11758
|
case "id":
|
|
11550
|
-
case "class":
|
|
11551
|
-
if (exportGlobals) exports$1[node.value] = [node.value];
|
|
11552
|
-
break;
|
|
11759
|
+
case "class": if (exportGlobals) exports$1[node.value] = [node.value];
|
|
11553
11760
|
}
|
|
11554
11761
|
return node;
|
|
11555
11762
|
}
|
|
@@ -12190,25 +12397,28 @@ function rewriteDefaultAST(ast, s, as) {
|
|
|
12190
12397
|
return;
|
|
12191
12398
|
}
|
|
12192
12399
|
ast.forEach((node) => {
|
|
12193
|
-
if (node.type === "ExportDefaultDeclaration")
|
|
12194
|
-
|
|
12195
|
-
|
|
12196
|
-
|
|
12197
|
-
|
|
12198
|
-
|
|
12400
|
+
if (node.type === "ExportDefaultDeclaration") {
|
|
12401
|
+
if (node.declaration.type === "ClassDeclaration" && node.declaration.id) {
|
|
12402
|
+
const start = node.declaration.decorators && node.declaration.decorators.length > 0 ? node.declaration.decorators[node.declaration.decorators.length - 1].end : node.start;
|
|
12403
|
+
s.overwrite(start, node.declaration.id.start, ` class `);
|
|
12404
|
+
s.append(`\nconst ${as} = ${node.declaration.id.name}`);
|
|
12405
|
+
} else s.overwrite(node.start, node.declaration.start, `const ${as} = `);
|
|
12406
|
+
} else if (node.type === "ExportNamedDeclaration") {
|
|
12199
12407
|
for (const specifier of node.specifiers) if (specifier.type === "ExportSpecifier" && specifier.exported.type === "Identifier" && specifier.exported.name === "default") {
|
|
12200
|
-
if (node.source)
|
|
12201
|
-
|
|
12202
|
-
|
|
12203
|
-
|
|
12204
|
-
|
|
12205
|
-
|
|
12206
|
-
|
|
12207
|
-
|
|
12208
|
-
|
|
12209
|
-
|
|
12210
|
-
|
|
12211
|
-
|
|
12408
|
+
if (node.source) {
|
|
12409
|
+
if (specifier.local.name === "default") {
|
|
12410
|
+
s.prepend(`import { default as __VUE_DEFAULT__ } from '${node.source.value}'\n`);
|
|
12411
|
+
const end = specifierEnd(s, specifier.local.end, node.end);
|
|
12412
|
+
s.remove(specifier.start, end);
|
|
12413
|
+
s.append(`\nconst ${as} = __VUE_DEFAULT__`);
|
|
12414
|
+
continue;
|
|
12415
|
+
} else {
|
|
12416
|
+
s.prepend(`import { ${s.slice(specifier.local.start, specifier.local.end)} as __VUE_DEFAULT__ } from '${node.source.value}'\n`);
|
|
12417
|
+
const end = specifierEnd(s, specifier.exported.end, node.end);
|
|
12418
|
+
s.remove(specifier.start, end);
|
|
12419
|
+
s.append(`\nconst ${as} = __VUE_DEFAULT__`);
|
|
12420
|
+
continue;
|
|
12421
|
+
}
|
|
12212
12422
|
}
|
|
12213
12423
|
const end = specifierEnd(s, specifier.end, node.end);
|
|
12214
12424
|
s.remove(specifier.start, end);
|
|
@@ -12500,7 +12710,7 @@ function expand_(str, max, maxLength, isTop) {
|
|
|
12500
12710
|
}
|
|
12501
12711
|
//#endregion
|
|
12502
12712
|
//#region node_modules/.pnpm/minimatch@10.2.6/node_modules/minimatch/dist/esm/assert-valid-pattern.js
|
|
12503
|
-
const MAX_PATTERN_LENGTH =
|
|
12713
|
+
const MAX_PATTERN_LENGTH = 65536;
|
|
12504
12714
|
const assertValidPattern = (pattern) => {
|
|
12505
12715
|
if (typeof pattern !== "string") throw new TypeError("invalid pattern");
|
|
12506
12716
|
if (pattern.length > MAX_PATTERN_LENGTH) throw new TypeError("pattern is too long");
|
|
@@ -12611,12 +12821,15 @@ const parseClass = (glob, position) => {
|
|
|
12611
12821
|
glob.length - pos,
|
|
12612
12822
|
true
|
|
12613
12823
|
];
|
|
12614
|
-
if (negs.length === 0 && ranges.length === 1 && /^\\?.$/.test(ranges[0]) && !negate)
|
|
12615
|
-
|
|
12616
|
-
|
|
12617
|
-
|
|
12618
|
-
|
|
12619
|
-
|
|
12824
|
+
if (negs.length === 0 && ranges.length === 1 && /^\\?.$/.test(ranges[0]) && !negate) {
|
|
12825
|
+
const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0];
|
|
12826
|
+
return [
|
|
12827
|
+
regexpEscape(r),
|
|
12828
|
+
false,
|
|
12829
|
+
endPos - pos,
|
|
12830
|
+
false
|
|
12831
|
+
];
|
|
12832
|
+
}
|
|
12620
12833
|
const sranges = "[" + (negate ? "^" : "") + rangesToString(ranges) + "]";
|
|
12621
12834
|
const snegs = "[" + (negate ? "" : "^") + rangesToString(negs) + "]";
|
|
12622
12835
|
return [
|
|
@@ -12656,7 +12869,7 @@ const unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true } = {}
|
|
|
12656
12869
|
var _AST;
|
|
12657
12870
|
let _Symbol$for;
|
|
12658
12871
|
var _a;
|
|
12659
|
-
const types = new Set([
|
|
12872
|
+
const types = /* @__PURE__ */ new Set([
|
|
12660
12873
|
"!",
|
|
12661
12874
|
"?",
|
|
12662
12875
|
"+",
|
|
@@ -12665,7 +12878,7 @@ const types = new Set([
|
|
|
12665
12878
|
]);
|
|
12666
12879
|
const isExtglobType = (c) => types.has(c);
|
|
12667
12880
|
const isExtglobAST = (c) => isExtglobType(c.type);
|
|
12668
|
-
const adoptionMap = new Map([
|
|
12881
|
+
const adoptionMap = /* @__PURE__ */ new Map([
|
|
12669
12882
|
["!", ["@"]],
|
|
12670
12883
|
["?", ["?", "@"]],
|
|
12671
12884
|
["@", ["@"]],
|
|
@@ -12677,12 +12890,12 @@ const adoptionMap = new Map([
|
|
|
12677
12890
|
]],
|
|
12678
12891
|
["+", ["+", "@"]]
|
|
12679
12892
|
]);
|
|
12680
|
-
const adoptionWithSpaceMap = new Map([
|
|
12893
|
+
const adoptionWithSpaceMap = /* @__PURE__ */ new Map([
|
|
12681
12894
|
["!", ["?"]],
|
|
12682
12895
|
["@", ["?"]],
|
|
12683
12896
|
["+", ["?", "*"]]
|
|
12684
12897
|
]);
|
|
12685
|
-
const adoptionAnyMap = new Map([
|
|
12898
|
+
const adoptionAnyMap = /* @__PURE__ */ new Map([
|
|
12686
12899
|
["!", ["?", "@"]],
|
|
12687
12900
|
["?", ["?", "@"]],
|
|
12688
12901
|
["@", ["?", "@"]],
|
|
@@ -12699,27 +12912,27 @@ const adoptionAnyMap = new Map([
|
|
|
12699
12912
|
"*"
|
|
12700
12913
|
]]
|
|
12701
12914
|
]);
|
|
12702
|
-
const usurpMap = new Map([
|
|
12703
|
-
["!", new Map([["!", "@"]])],
|
|
12704
|
-
["?", new Map([["*", "*"], ["+", "*"]])],
|
|
12705
|
-
["@", new Map([
|
|
12915
|
+
const usurpMap = /* @__PURE__ */ new Map([
|
|
12916
|
+
["!", /* @__PURE__ */ new Map([["!", "@"]])],
|
|
12917
|
+
["?", /* @__PURE__ */ new Map([["*", "*"], ["+", "*"]])],
|
|
12918
|
+
["@", /* @__PURE__ */ new Map([
|
|
12706
12919
|
["!", "!"],
|
|
12707
12920
|
["?", "?"],
|
|
12708
12921
|
["@", "@"],
|
|
12709
12922
|
["*", "*"],
|
|
12710
12923
|
["+", "+"]
|
|
12711
12924
|
])],
|
|
12712
|
-
["+", new Map([["?", "*"], ["*", "*"]])]
|
|
12925
|
+
["+", /* @__PURE__ */ new Map([["?", "*"], ["*", "*"]])]
|
|
12713
12926
|
]);
|
|
12714
12927
|
const startNoTraversal = "(?!(?:^|/)\\.\\.?(?:$|/))";
|
|
12715
12928
|
const startNoDot = "(?!\\.)";
|
|
12716
|
-
const addPatternStart = new Set(["[", "."]);
|
|
12717
|
-
const justDots = new Set(["..", "."]);
|
|
12929
|
+
const addPatternStart = /* @__PURE__ */ new Set(["[", "."]);
|
|
12930
|
+
const justDots = /* @__PURE__ */ new Set(["..", "."]);
|
|
12718
12931
|
const reSpecials = /* @__PURE__ */ new Set("().*{}+?[]^$\\!");
|
|
12719
12932
|
const regExpEscape$1 = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
|
12720
12933
|
const qmark = "[^/]";
|
|
12721
|
-
const star$1 =
|
|
12722
|
-
const starNoEmpty =
|
|
12934
|
+
const star$1 = "[^/]*?";
|
|
12935
|
+
const starNoEmpty = "[^/]+?";
|
|
12723
12936
|
let ID = 0;
|
|
12724
12937
|
var _root = /* @__PURE__ */ new WeakMap();
|
|
12725
12938
|
var _hasMagic2 = /* @__PURE__ */ new WeakMap();
|
|
@@ -12754,6 +12967,7 @@ var AST = class AST {
|
|
|
12754
12967
|
}
|
|
12755
12968
|
constructor(type, parent, options = {}) {
|
|
12756
12969
|
_classPrivateMethodInitSpec(this, _AST_brand);
|
|
12970
|
+
_defineProperty(this, "type", void 0);
|
|
12757
12971
|
_classPrivateFieldInitSpec(this, _root, void 0);
|
|
12758
12972
|
_classPrivateFieldInitSpec(this, _hasMagic2, void 0);
|
|
12759
12973
|
_classPrivateFieldInitSpec(this, _uflag, false);
|
|
@@ -12765,7 +12979,7 @@ var AST = class AST {
|
|
|
12765
12979
|
_classPrivateFieldInitSpec(this, _options, void 0);
|
|
12766
12980
|
_classPrivateFieldInitSpec(this, _toString, void 0);
|
|
12767
12981
|
_classPrivateFieldInitSpec(this, _emptyExt, false);
|
|
12768
|
-
this
|
|
12982
|
+
_defineProperty(this, "id", ++ID);
|
|
12769
12983
|
this.type = type;
|
|
12770
12984
|
if (type) _classPrivateFieldSet2(_hasMagic2, this, true);
|
|
12771
12985
|
_classPrivateFieldSet2(_parent, this, parent);
|
|
@@ -12914,7 +13128,7 @@ var AST = class AST {
|
|
|
12914
13128
|
let final = "";
|
|
12915
13129
|
if (this.type === "!" && _classPrivateFieldGet2(_emptyExt, this)) final = (this.isStart() && !dot ? startNoDot : "") + starNoEmpty;
|
|
12916
13130
|
else {
|
|
12917
|
-
const close = this.type === "!" ? "))" + (this.isStart() && !dot && !allowDot ? startNoDot : "") +
|
|
13131
|
+
const close = this.type === "!" ? "))" + (this.isStart() && !dot && !allowDot ? startNoDot : "") + "[^/]*?)" : this.type === "@" ? ")" : this.type === "?" ? ")?" : this.type === "+" && bodyDotAllowed ? ")" : this.type === "*" && bodyDotAllowed ? `)?` : `)${this.type}`;
|
|
12918
13132
|
final = start + body + close;
|
|
12919
13133
|
}
|
|
12920
13134
|
return [
|
|
@@ -13330,6 +13544,24 @@ var Minimatch = class {
|
|
|
13330
13544
|
constructor(pattern, options = {}) {
|
|
13331
13545
|
var _options$maxGlobstarR;
|
|
13332
13546
|
_classPrivateMethodInitSpec(this, _Minimatch_brand);
|
|
13547
|
+
_defineProperty(this, "options", void 0);
|
|
13548
|
+
_defineProperty(this, "set", void 0);
|
|
13549
|
+
_defineProperty(this, "pattern", void 0);
|
|
13550
|
+
_defineProperty(this, "windowsPathsNoEscape", void 0);
|
|
13551
|
+
_defineProperty(this, "nonegate", void 0);
|
|
13552
|
+
_defineProperty(this, "negate", void 0);
|
|
13553
|
+
_defineProperty(this, "comment", void 0);
|
|
13554
|
+
_defineProperty(this, "empty", void 0);
|
|
13555
|
+
_defineProperty(this, "preserveMultipleSlashes", void 0);
|
|
13556
|
+
_defineProperty(this, "partial", void 0);
|
|
13557
|
+
_defineProperty(this, "globSet", void 0);
|
|
13558
|
+
_defineProperty(this, "globParts", void 0);
|
|
13559
|
+
_defineProperty(this, "nocase", void 0);
|
|
13560
|
+
_defineProperty(this, "isWindows", void 0);
|
|
13561
|
+
_defineProperty(this, "platform", void 0);
|
|
13562
|
+
_defineProperty(this, "windowsNoMagicRoot", void 0);
|
|
13563
|
+
_defineProperty(this, "maxGlobstarRecursion", void 0);
|
|
13564
|
+
_defineProperty(this, "regexp", void 0);
|
|
13333
13565
|
assertValidPattern(pattern);
|
|
13334
13566
|
options = options || {};
|
|
13335
13567
|
this.options = options;
|
|
@@ -13634,9 +13866,10 @@ var Minimatch = class {
|
|
|
13634
13866
|
const next = pp[i + 1];
|
|
13635
13867
|
const prev = pp[i - 1];
|
|
13636
13868
|
if (p !== GLOBSTAR || prev === GLOBSTAR) return;
|
|
13637
|
-
if (prev === void 0)
|
|
13638
|
-
|
|
13639
|
-
|
|
13869
|
+
if (prev === void 0) {
|
|
13870
|
+
if (next !== void 0 && next !== GLOBSTAR) pp[i + 1] = "(?:\\/|" + twoStar + "\\/)?" + next;
|
|
13871
|
+
else pp[i] = twoStar;
|
|
13872
|
+
} else if (next === void 0) pp[i - 1] = prev + "(?:\\/|\\/" + twoStar + ")?";
|
|
13640
13873
|
else if (next !== GLOBSTAR) {
|
|
13641
13874
|
pp[i - 1] = prev + "(?:\\/|\\/" + twoStar + "\\/)" + next;
|
|
13642
13875
|
pp[i + 1] = GLOBSTAR;
|
|
@@ -13897,12 +14130,10 @@ function innerResolveTypeElements(ctx, node, scope, typeParameters) {
|
|
|
13897
14130
|
if (resolved) return resolveTypeElements(ctx, resolved, resolved._ownerScope);
|
|
13898
14131
|
break;
|
|
13899
14132
|
}
|
|
13900
|
-
case "TSTypeQuery":
|
|
13901
|
-
|
|
13902
|
-
|
|
13903
|
-
|
|
13904
|
-
}
|
|
13905
|
-
break;
|
|
14133
|
+
case "TSTypeQuery": {
|
|
14134
|
+
const resolved = resolveTypeReference(ctx, node, scope);
|
|
14135
|
+
if (resolved) return resolveTypeElements(ctx, resolved, resolved._ownerScope);
|
|
14136
|
+
}
|
|
13906
14137
|
}
|
|
13907
14138
|
return ctx.error(`Unresolvable type: ${node.type}`, node, scope);
|
|
13908
14139
|
}
|
|
@@ -14006,10 +14237,12 @@ function resolveIndexType(ctx, node, scope) {
|
|
|
14006
14237
|
function resolveArrayElementType(ctx, node, scope) {
|
|
14007
14238
|
if (node.type === "TSArrayType") return [node.elementType];
|
|
14008
14239
|
if (node.type === "TSTupleType") return node.elementTypes.map((t) => t.type === "TSNamedTupleMember" ? t.elementType : t);
|
|
14009
|
-
if (node.type === "TSTypeReference")
|
|
14010
|
-
|
|
14011
|
-
|
|
14012
|
-
|
|
14240
|
+
if (node.type === "TSTypeReference") {
|
|
14241
|
+
if (getReferenceName(node) === "Array" && node.typeParameters) return node.typeParameters.params;
|
|
14242
|
+
else {
|
|
14243
|
+
const resolved = resolveTypeReference(ctx, node, scope);
|
|
14244
|
+
if (resolved) return resolveArrayElementType(ctx, resolved, scope);
|
|
14245
|
+
}
|
|
14013
14246
|
}
|
|
14014
14247
|
return ctx.error("Failed to resolve element type from target type", node, scope);
|
|
14015
14248
|
}
|
|
@@ -14058,7 +14291,7 @@ function resolveTemplateKeys(ctx, node, scope) {
|
|
|
14058
14291
|
for (const r of resolved) for (const rr of restResolved) res.push(leading + r + rr);
|
|
14059
14292
|
return res;
|
|
14060
14293
|
}
|
|
14061
|
-
const SupportedBuiltinsSet = new Set([
|
|
14294
|
+
const SupportedBuiltinsSet = /* @__PURE__ */ new Set([
|
|
14062
14295
|
"Partial",
|
|
14063
14296
|
"Required",
|
|
14064
14297
|
"Readonly",
|
|
@@ -14130,24 +14363,25 @@ function resolveTypeReference(ctx, node, scope, name, onlyExported = false) {
|
|
|
14130
14363
|
return resolved;
|
|
14131
14364
|
}
|
|
14132
14365
|
function innerResolveTypeReference(ctx, scope, name, node, onlyExported) {
|
|
14133
|
-
if (typeof name === "string")
|
|
14134
|
-
|
|
14135
|
-
const lookupSource = node.type === "TSTypeQuery" ? onlyExported ? scope.exportedDeclares : scope.declares : onlyExported ? scope.exportedTypes : scope.types;
|
|
14136
|
-
if (lookupSource[name]) return lookupSource[name];
|
|
14366
|
+
if (typeof name === "string") {
|
|
14367
|
+
if (scope.imports[name]) return resolveTypeFromImport(ctx, node, name, scope);
|
|
14137
14368
|
else {
|
|
14138
|
-
const
|
|
14139
|
-
if (
|
|
14140
|
-
|
|
14141
|
-
|
|
14142
|
-
|
|
14143
|
-
const
|
|
14144
|
-
if (
|
|
14145
|
-
|
|
14369
|
+
const lookupSource = node.type === "TSTypeQuery" ? onlyExported ? scope.exportedDeclares : scope.declares : onlyExported ? scope.exportedTypes : scope.types;
|
|
14370
|
+
if (lookupSource[name]) return lookupSource[name];
|
|
14371
|
+
else {
|
|
14372
|
+
const globalScopes = resolveGlobalScope(ctx);
|
|
14373
|
+
if (globalScopes) for (const s of globalScopes) {
|
|
14374
|
+
const src = node.type === "TSTypeQuery" ? s.declares : s.types;
|
|
14375
|
+
if (src[name]) {
|
|
14376
|
+
(ctx.deps || (ctx.deps = /* @__PURE__ */ new Set())).add(s.filename);
|
|
14377
|
+
const resolved = src[name];
|
|
14378
|
+
if (resolved._ownerScope && resolved._ownerScope !== s) ctx.deps.add(resolved._ownerScope.filename);
|
|
14379
|
+
return resolved;
|
|
14380
|
+
}
|
|
14146
14381
|
}
|
|
14147
14382
|
}
|
|
14148
14383
|
}
|
|
14149
|
-
}
|
|
14150
|
-
else {
|
|
14384
|
+
} else {
|
|
14151
14385
|
let ns = innerResolveTypeReference(ctx, scope, name[0], node, onlyExported);
|
|
14152
14386
|
if (ns) {
|
|
14153
14387
|
if (ns.type !== "TSModuleDeclaration") ns = ns._ns;
|
|
@@ -14488,24 +14722,23 @@ function recordType(node, types, declares, overwriteId) {
|
|
|
14488
14722
|
case "TSDeclareFunction":
|
|
14489
14723
|
if (node.id) declares[node.id.name] = node;
|
|
14490
14724
|
break;
|
|
14491
|
-
case "VariableDeclaration":
|
|
14492
|
-
|
|
14493
|
-
|
|
14494
|
-
}
|
|
14495
|
-
break;
|
|
14725
|
+
case "VariableDeclaration": if (node.declare) {
|
|
14726
|
+
for (const decl of node.declarations) if (decl.id.type === "Identifier" && decl.id.typeAnnotation) declares[decl.id.name] = decl.id.typeAnnotation.typeAnnotation;
|
|
14727
|
+
}
|
|
14496
14728
|
}
|
|
14497
14729
|
}
|
|
14498
14730
|
function mergeNamespaces(to, from) {
|
|
14499
14731
|
const toBody = to.body;
|
|
14500
14732
|
const fromBody = from.body;
|
|
14501
|
-
if (toBody.type === "TSModuleDeclaration")
|
|
14502
|
-
|
|
14503
|
-
|
|
14504
|
-
|
|
14505
|
-
|
|
14506
|
-
|
|
14507
|
-
|
|
14508
|
-
|
|
14733
|
+
if (toBody.type === "TSModuleDeclaration") {
|
|
14734
|
+
if (fromBody.type === "TSModuleDeclaration") mergeNamespaces(toBody, fromBody);
|
|
14735
|
+
else fromBody.body.push({
|
|
14736
|
+
type: "ExportNamedDeclaration",
|
|
14737
|
+
declaration: toBody,
|
|
14738
|
+
exportKind: "type",
|
|
14739
|
+
specifiers: []
|
|
14740
|
+
});
|
|
14741
|
+
} else if (fromBody.type === "TSModuleDeclaration") toBody.body.push({
|
|
14509
14742
|
type: "ExportNamedDeclaration",
|
|
14510
14743
|
declaration: fromBody,
|
|
14511
14744
|
exportKind: "type",
|
|
@@ -14544,16 +14777,17 @@ function inferRuntimeType(ctx, node, scope = node._ownerScope || ctxToScope(ctx)
|
|
|
14544
14777
|
case "TSInterfaceDeclaration": {
|
|
14545
14778
|
const types = /* @__PURE__ */ new Set();
|
|
14546
14779
|
const members = node.type === "TSTypeLiteral" ? node.members : node.body.body;
|
|
14547
|
-
for (const m of members) if (isKeyOf)
|
|
14548
|
-
|
|
14549
|
-
|
|
14550
|
-
|
|
14551
|
-
|
|
14552
|
-
|
|
14553
|
-
|
|
14554
|
-
|
|
14555
|
-
|
|
14556
|
-
|
|
14780
|
+
for (const m of members) if (isKeyOf) {
|
|
14781
|
+
if (m.type === "TSPropertySignature" && m.key.type === "NumericLiteral") types.add("Number");
|
|
14782
|
+
else if (m.type === "TSIndexSignature") {
|
|
14783
|
+
const annotation = m.parameters[0].typeAnnotation;
|
|
14784
|
+
if (annotation && annotation.type !== "Noop") {
|
|
14785
|
+
const type = inferRuntimeType(ctx, annotation.typeAnnotation, scope)[0];
|
|
14786
|
+
if (type === "Unknown") return [UNKNOWN_TYPE];
|
|
14787
|
+
types.add(type);
|
|
14788
|
+
}
|
|
14789
|
+
} else types.add("String");
|
|
14790
|
+
} else if (m.type === "TSCallSignatureDeclaration" || m.type === "TSConstructSignatureDeclaration") types.add("Function");
|
|
14557
14791
|
else types.add("Object");
|
|
14558
14792
|
return types.size ? Array.from(types) : [isKeyOf ? UNKNOWN_TYPE : "Object"];
|
|
14559
14793
|
}
|
|
@@ -14657,7 +14891,7 @@ function inferRuntimeType(ctx, node, scope = node._ownerScope || ctxToScope(ctx)
|
|
|
14657
14891
|
case "WritableComputedRef": return ["Object"];
|
|
14658
14892
|
case "MaybeRef":
|
|
14659
14893
|
case "MaybeRefOrGetter": {
|
|
14660
|
-
const types = new Set(["Object"]);
|
|
14894
|
+
const types = /* @__PURE__ */ new Set(["Object"]);
|
|
14661
14895
|
if (node.typeName.name === "MaybeRefOrGetter") types.add("Function");
|
|
14662
14896
|
if (node.typeParameters && node.typeParameters.params[0]) for (const t of inferRuntimeType(ctx, node.typeParameters.params[0], scope, false, typeParameters)) types.add(t);
|
|
14663
14897
|
return Array.from(types);
|
|
@@ -14669,9 +14903,7 @@ function inferRuntimeType(ctx, node, scope = node._ownerScope || ctxToScope(ctx)
|
|
|
14669
14903
|
if (node.typeParameters && node.typeParameters.params[1]) return inferRuntimeType(ctx, node.typeParameters.params[1], scope);
|
|
14670
14904
|
break;
|
|
14671
14905
|
case "Exclude":
|
|
14672
|
-
case "OmitThisParameter":
|
|
14673
|
-
if (node.typeParameters && node.typeParameters.params[0]) return inferRuntimeType(ctx, node.typeParameters.params[0], scope);
|
|
14674
|
-
break;
|
|
14906
|
+
case "OmitThisParameter": if (node.typeParameters && node.typeParameters.params[0]) return inferRuntimeType(ctx, node.typeParameters.params[0], scope);
|
|
14675
14907
|
}
|
|
14676
14908
|
}
|
|
14677
14909
|
break;
|
|
@@ -14713,13 +14945,11 @@ function inferRuntimeType(ctx, node, scope = node._ownerScope || ctxToScope(ctx)
|
|
|
14713
14945
|
break;
|
|
14714
14946
|
}
|
|
14715
14947
|
case "TSTypeOperator": return inferRuntimeType(ctx, node.typeAnnotation, scope, node.operator === "keyof");
|
|
14716
|
-
case "TSAnyKeyword":
|
|
14717
|
-
|
|
14718
|
-
|
|
14719
|
-
|
|
14720
|
-
|
|
14721
|
-
];
|
|
14722
|
-
break;
|
|
14948
|
+
case "TSAnyKeyword": if (isKeyOf) return [
|
|
14949
|
+
"String",
|
|
14950
|
+
"Number",
|
|
14951
|
+
"Symbol"
|
|
14952
|
+
];
|
|
14723
14953
|
}
|
|
14724
14954
|
} catch (e) {} finally {
|
|
14725
14955
|
ctx.silentOnExtendsFailure = prevSilent;
|
|
@@ -14736,9 +14966,7 @@ function inferEnumType(node) {
|
|
|
14736
14966
|
case "StringLiteral":
|
|
14737
14967
|
types.add("String");
|
|
14738
14968
|
break;
|
|
14739
|
-
case "NumericLiteral":
|
|
14740
|
-
types.add("Number");
|
|
14741
|
-
break;
|
|
14969
|
+
case "NumericLiteral": types.add("Number");
|
|
14742
14970
|
}
|
|
14743
14971
|
return types.size ? [...types] : ["Number"];
|
|
14744
14972
|
}
|
|
@@ -14882,10 +15110,12 @@ function genModelProps(ctx) {
|
|
|
14882
15110
|
if (runtimeTypes) {
|
|
14883
15111
|
const hasBoolean = runtimeTypes.includes("Boolean");
|
|
14884
15112
|
const hasFunction = runtimeTypes.includes("Function");
|
|
14885
|
-
if (runtimeTypes.includes("Unknown"))
|
|
14886
|
-
|
|
14887
|
-
|
|
14888
|
-
|
|
15113
|
+
if (runtimeTypes.includes("Unknown")) {
|
|
15114
|
+
if (hasBoolean || hasFunction) {
|
|
15115
|
+
runtimeTypes = runtimeTypes.filter((t) => t !== UNKNOWN_TYPE);
|
|
15116
|
+
skipCheck = true;
|
|
15117
|
+
} else runtimeTypes = ["null"];
|
|
15118
|
+
}
|
|
14889
15119
|
if (!isProd) codegenOptions = `type: ${toRuntimeTypeString(runtimeTypes)}` + (skipCheck ? ", skipCheck: true" : "");
|
|
14890
15120
|
else if (hasBoolean || runtimeOptions && hasFunction) codegenOptions = `type: ${toRuntimeTypeString(runtimeTypes)}`;
|
|
14891
15121
|
}
|
|
@@ -14971,10 +15201,12 @@ function resolveRuntimePropsFromType(ctx, node) {
|
|
|
14971
15201
|
const e = elements.props[key];
|
|
14972
15202
|
let type = inferRuntimeType(ctx, e);
|
|
14973
15203
|
let skipCheck = false;
|
|
14974
|
-
if (type.includes("Unknown"))
|
|
14975
|
-
type
|
|
14976
|
-
|
|
14977
|
-
|
|
15204
|
+
if (type.includes("Unknown")) {
|
|
15205
|
+
if (type.includes("Boolean") || type.includes("Function")) {
|
|
15206
|
+
type = type.filter((t) => t !== UNKNOWN_TYPE);
|
|
15207
|
+
skipCheck = true;
|
|
15208
|
+
} else type = ["null"];
|
|
15209
|
+
}
|
|
14978
15210
|
props.push({
|
|
14979
15211
|
key,
|
|
14980
15212
|
required: !e.optional,
|
|
@@ -14993,18 +15225,20 @@ function genRuntimePropFromType(ctx, { key, required, type, skipCheck }, hasStat
|
|
|
14993
15225
|
if (node.type === "SpreadElement") return false;
|
|
14994
15226
|
return resolveObjectKey(node.key, node.computed) === key;
|
|
14995
15227
|
});
|
|
14996
|
-
if (prop)
|
|
14997
|
-
|
|
14998
|
-
|
|
14999
|
-
|
|
15000
|
-
|
|
15001
|
-
|
|
15002
|
-
|
|
15003
|
-
|
|
15004
|
-
|
|
15005
|
-
|
|
15228
|
+
if (prop) {
|
|
15229
|
+
if (prop.type === "ObjectProperty") defaultString = `default: ${ctx.getString(prop.value)}`;
|
|
15230
|
+
else {
|
|
15231
|
+
let paramsString = "";
|
|
15232
|
+
if (prop.params.length) {
|
|
15233
|
+
const start = prop.params[0].start;
|
|
15234
|
+
const end = prop.params[prop.params.length - 1].end;
|
|
15235
|
+
paramsString = ctx.getString({
|
|
15236
|
+
start,
|
|
15237
|
+
end
|
|
15238
|
+
});
|
|
15239
|
+
}
|
|
15240
|
+
defaultString = `${prop.async ? "async " : ""}${prop.kind !== "method" ? `${prop.kind} ` : ""}default(${paramsString}) ${ctx.getString(prop.body)}`;
|
|
15006
15241
|
}
|
|
15007
|
-
defaultString = `${prop.async ? "async " : ""}${prop.kind !== "method" ? `${prop.kind} ` : ""}default(${paramsString}) ${ctx.getString(prop.body)}`;
|
|
15008
15242
|
}
|
|
15009
15243
|
}
|
|
15010
15244
|
const finalKey = getEscapedPropName(key);
|
|
@@ -15016,8 +15250,10 @@ function genRuntimePropFromType(ctx, { key, required, type, skipCheck }, hasStat
|
|
|
15016
15250
|
])} }`;
|
|
15017
15251
|
else if (type.some((el) => el === "Boolean" || (!hasStaticDefaults || defaultString) && el === "Function")) return `${finalKey}: { ${concatStrings([`type: ${toRuntimeTypeString(type)}`, defaultString])} }`;
|
|
15018
15252
|
else {
|
|
15019
|
-
if (ctx.isCE)
|
|
15020
|
-
|
|
15253
|
+
if (ctx.isCE) {
|
|
15254
|
+
if (defaultString) return `${finalKey}: ${`{ ${defaultString}, type: ${toRuntimeTypeString(type)} }`}`;
|
|
15255
|
+
else return `${finalKey}: {type: ${toRuntimeTypeString(type)}}`;
|
|
15256
|
+
}
|
|
15021
15257
|
return `${finalKey}: ${defaultString ? `{ ${defaultString} }` : `{}`}`;
|
|
15022
15258
|
}
|
|
15023
15259
|
}
|
|
@@ -15304,9 +15540,7 @@ function processDefineOptions(ctx, node) {
|
|
|
15304
15540
|
case "expose":
|
|
15305
15541
|
exposeOption = prop;
|
|
15306
15542
|
break;
|
|
15307
|
-
case "slots":
|
|
15308
|
-
slotsOption = prop;
|
|
15309
|
-
break;
|
|
15543
|
+
case "slots": slotsOption = prop;
|
|
15310
15544
|
}
|
|
15311
15545
|
}
|
|
15312
15546
|
if (propsOption) ctx.error(`${DEFINE_OPTIONS}() cannot be used to declare props. Use ${DEFINE_PROPS}() instead.`, propsOption);
|
|
@@ -15486,9 +15720,10 @@ function compileScript(sfc, options) {
|
|
|
15486
15720
|
if (local === imported) warnOnce(`\`${imported}\` is a compiler macro and no longer needs to be imported.`);
|
|
15487
15721
|
else ctx.error(`\`${imported}\` is a compiler macro and cannot be aliased to a different name.`, specifier);
|
|
15488
15722
|
removeSpecifier(i);
|
|
15489
|
-
} else if (existing)
|
|
15490
|
-
|
|
15491
|
-
|
|
15723
|
+
} else if (existing) {
|
|
15724
|
+
if (existing.source === source && existing.imported === imported) removeSpecifier(i);
|
|
15725
|
+
else ctx.error(`different imports aliased to same local name.`, specifier);
|
|
15726
|
+
} else registerUserImport(source, local, imported, node.importKind === "type" || specifier.type === "ImportSpecifier" && specifier.importKind === "type", true, !inlineMode);
|
|
15492
15727
|
}
|
|
15493
15728
|
if (node.specifiers.length && removed === node.specifiers.length) ctx.s.remove(node.start + startOffset, node.end + startOffset);
|
|
15494
15729
|
}
|
|
@@ -15548,16 +15783,17 @@ function compileScript(sfc, options) {
|
|
|
15548
15783
|
if (ctx.propsDestructureRestId) setupBindings[ctx.propsDestructureRestId] = "setup-reactive-const";
|
|
15549
15784
|
const isDefineEmits = !isDefineProps && processDefineEmits(ctx, init, decl.id);
|
|
15550
15785
|
!isDefineEmits && (processDefineSlots(ctx, init, decl.id) || processDefineModel(ctx, init, decl.id));
|
|
15551
|
-
if (isDefineProps && !ctx.propsDestructureRestId && ctx.propsDestructureDecl)
|
|
15552
|
-
|
|
15553
|
-
|
|
15554
|
-
|
|
15555
|
-
|
|
15556
|
-
|
|
15557
|
-
|
|
15558
|
-
|
|
15559
|
-
|
|
15560
|
-
|
|
15786
|
+
if (isDefineProps && !ctx.propsDestructureRestId && ctx.propsDestructureDecl) {
|
|
15787
|
+
if (left === 1) ctx.s.remove(node.start + startOffset, node.end + startOffset);
|
|
15788
|
+
else {
|
|
15789
|
+
let start = decl.start + startOffset;
|
|
15790
|
+
let end = decl.end + startOffset;
|
|
15791
|
+
if (i === total - 1) start = node.declarations[lastNonRemoved].end + startOffset;
|
|
15792
|
+
else end = node.declarations[i + 1].start + startOffset;
|
|
15793
|
+
ctx.s.remove(start, end);
|
|
15794
|
+
left--;
|
|
15795
|
+
}
|
|
15796
|
+
} else if (isDefineEmits) ctx.s.overwrite(startOffset + init.start, startOffset + init.end, "__emit");
|
|
15561
15797
|
else lastNonRemoved = i;
|
|
15562
15798
|
}
|
|
15563
15799
|
}
|
|
@@ -15573,9 +15809,10 @@ function compileScript(sfc, options) {
|
|
|
15573
15809
|
if (child.type === "BlockStatement") scope.push(child.body);
|
|
15574
15810
|
if (child.type === "AwaitExpression") {
|
|
15575
15811
|
hasAwait = true;
|
|
15576
|
-
|
|
15812
|
+
const needsSemi = scope[scope.length - 1].some((n, i) => {
|
|
15577
15813
|
return (scope.length === 1 || i > 0) && n.type === "ExpressionStatement" && n.start === child.start;
|
|
15578
|
-
})
|
|
15814
|
+
});
|
|
15815
|
+
processAwait(ctx, child, needsSemi, parent.type === "ExpressionStatement");
|
|
15579
15816
|
}
|
|
15580
15817
|
},
|
|
15581
15818
|
exit(node) {
|
|
@@ -15597,16 +15834,17 @@ function compileScript(sfc, options) {
|
|
|
15597
15834
|
checkInvalidScopeReference(ctx.emitsRuntimeDecl, DEFINE_EMITS);
|
|
15598
15835
|
checkInvalidScopeReference(ctx.optionsRuntimeDecl, DEFINE_OPTIONS);
|
|
15599
15836
|
for (const { runtimeOptionNodes } of Object.values(ctx.modelDecls)) for (const node of runtimeOptionNodes) checkInvalidScopeReference(node, DEFINE_MODEL);
|
|
15600
|
-
if (script)
|
|
15601
|
-
|
|
15602
|
-
|
|
15603
|
-
|
|
15837
|
+
if (script) {
|
|
15838
|
+
if (startOffset < scriptStartOffset) {
|
|
15839
|
+
ctx.s.remove(0, startOffset);
|
|
15840
|
+
ctx.s.remove(endOffset, scriptStartOffset);
|
|
15841
|
+
ctx.s.remove(scriptEndOffset, source.length);
|
|
15842
|
+
} else {
|
|
15843
|
+
ctx.s.remove(0, scriptStartOffset);
|
|
15844
|
+
ctx.s.remove(scriptEndOffset, startOffset);
|
|
15845
|
+
ctx.s.remove(endOffset, source.length);
|
|
15846
|
+
}
|
|
15604
15847
|
} else {
|
|
15605
|
-
ctx.s.remove(0, scriptStartOffset);
|
|
15606
|
-
ctx.s.remove(scriptEndOffset, startOffset);
|
|
15607
|
-
ctx.s.remove(endOffset, source.length);
|
|
15608
|
-
}
|
|
15609
|
-
else {
|
|
15610
15848
|
ctx.s.remove(0, startOffset);
|
|
15611
15849
|
ctx.s.remove(endOffset, source.length);
|
|
15612
15850
|
}
|
|
@@ -15787,9 +16025,10 @@ function walkDeclaration(from, node, bindings, userImportAliases, hoistStatic, i
|
|
|
15787
16025
|
if ((hoistStatic || from === "script") && (isAllLiteral || isConst && (0, _vue_compiler_dom.isStaticNode)(init))) bindingType = "literal-const";
|
|
15788
16026
|
else if (isCallOf(init, userReactiveBinding)) bindingType = isConst ? "setup-reactive-const" : "setup-let";
|
|
15789
16027
|
else if (isConstMacroCall || isConst && canNeverBeRef(init, userReactiveBinding)) bindingType = isCallOf(init, "defineProps") ? "setup-reactive-const" : "setup-const";
|
|
15790
|
-
else if (isConst)
|
|
15791
|
-
|
|
15792
|
-
|
|
16028
|
+
else if (isConst) {
|
|
16029
|
+
if (isCallOf(init, (m) => m === userImportAliases["ref"] || m === userImportAliases["computed"] || m === userImportAliases["shallowRef"] || m === userImportAliases["customRef"] || m === userImportAliases["toRef"] || m === userImportAliases["useTemplateRef"] || m === "defineModel")) bindingType = "setup-ref";
|
|
16030
|
+
else bindingType = "setup-maybe-ref";
|
|
16031
|
+
} else bindingType = "setup-let";
|
|
15793
16032
|
registerBinding(bindings, id, bindingType);
|
|
15794
16033
|
} else {
|
|
15795
16034
|
if (isCallOf(init, "defineProps") && isPropsDestructureEnabled) continue;
|
|
@@ -15804,11 +16043,12 @@ function walkDeclaration(from, node, bindings, userImportAliases, hoistStatic, i
|
|
|
15804
16043
|
return isAllLiteral;
|
|
15805
16044
|
}
|
|
15806
16045
|
function walkObjectPattern(node, bindings, isConst, isDefineCall = false) {
|
|
15807
|
-
for (const p of node.properties) if (p.type === "ObjectProperty")
|
|
15808
|
-
|
|
15809
|
-
|
|
15810
|
-
|
|
15811
|
-
|
|
16046
|
+
for (const p of node.properties) if (p.type === "ObjectProperty") {
|
|
16047
|
+
if (p.key.type === "Identifier" && p.key === p.value) {
|
|
16048
|
+
const type = isDefineCall ? "setup-const" : isConst ? "setup-maybe-ref" : "setup-let";
|
|
16049
|
+
registerBinding(bindings, p.key, type);
|
|
16050
|
+
} else walkPattern(p.value, bindings, isConst, isDefineCall);
|
|
16051
|
+
} else {
|
|
15812
16052
|
const type = isConst ? "setup-const" : "setup-let";
|
|
15813
16053
|
registerBinding(bindings, p.argument, type);
|
|
15814
16054
|
}
|
|
@@ -15823,10 +16063,12 @@ function walkPattern(node, bindings, isConst, isDefineCall = false) {
|
|
|
15823
16063
|
registerBinding(bindings, node.argument, type);
|
|
15824
16064
|
} else if (node.type === "ObjectPattern") walkObjectPattern(node, bindings, isConst);
|
|
15825
16065
|
else if (node.type === "ArrayPattern") walkArrayPattern(node, bindings, isConst);
|
|
15826
|
-
else if (node.type === "AssignmentPattern")
|
|
15827
|
-
|
|
15828
|
-
|
|
15829
|
-
|
|
16066
|
+
else if (node.type === "AssignmentPattern") {
|
|
16067
|
+
if (node.left.type === "Identifier") {
|
|
16068
|
+
const type = isDefineCall ? "setup-const" : isConst ? "setup-maybe-ref" : "setup-let";
|
|
16069
|
+
registerBinding(bindings, node.left, type);
|
|
16070
|
+
} else walkPattern(node.left, bindings, isConst);
|
|
16071
|
+
}
|
|
15830
16072
|
}
|
|
15831
16073
|
function canNeverBeRef(node, userReactiveImport) {
|
|
15832
16074
|
if (isCallOf(node, userReactiveImport)) return true;
|
|
@@ -15879,7 +16121,7 @@ function mergeSourceMaps(scriptMap, templateMap, templateLineOffset) {
|
|
|
15879
16121
|
}
|
|
15880
16122
|
//#endregion
|
|
15881
16123
|
//#region packages/compiler-sfc/src/index.ts
|
|
15882
|
-
const version = "3.6.0-rc.
|
|
16124
|
+
const version = "3.6.0-rc.7";
|
|
15883
16125
|
const parseCache = parseCache$1;
|
|
15884
16126
|
const errorMessages = {
|
|
15885
16127
|
..._vue_compiler_dom.errorMessages,
|