@stencil/core 4.33.0 → 4.33.1
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/cli/index.cjs +162 -11
- package/cli/index.js +162 -11
- package/cli/package.json +1 -1
- package/compiler/package.json +1 -1
- package/compiler/stencil.js +674 -561
- package/dev-server/client/index.js +1 -1
- package/dev-server/client/package.json +1 -1
- package/dev-server/connector.html +2 -2
- package/dev-server/index.js +1 -1
- package/dev-server/package.json +1 -1
- package/dev-server/server-process.js +159 -8
- package/internal/app-data/package.json +1 -1
- package/internal/app-globals/package.json +1 -1
- package/internal/client/index.js +6 -4
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +1 -1
- package/internal/hydrate/index.js +6 -4
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/runner.js +1 -1
- package/internal/package.json +1 -1
- package/internal/testing/index.js +5 -3
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +1 -1
- package/mock-doc/index.js +1 -1
- package/mock-doc/package.json +1 -1
- package/package.json +1 -1
- package/screenshot/index.js +152 -1
- package/screenshot/package.json +1 -1
- package/screenshot/pixel-match.js +1 -1
- package/sys/node/index.js +58 -48
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +2 -1
- package/testing/package.json +1 -1
package/compiler/stencil.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
Stencil Compiler v4.33.
|
|
2
|
+
Stencil Compiler v4.33.1 | MIT Licensed | https://stenciljs.com
|
|
3
3
|
*/
|
|
4
4
|
"use strict";
|
|
5
5
|
var __create = Object.create;
|
|
@@ -21012,12 +21012,12 @@ ${lanes.join("\n")}
|
|
|
21012
21012
|
function classElementOrClassElementParameterIsDecorated(useLegacyDecorators, node, parent2) {
|
|
21013
21013
|
let parameters;
|
|
21014
21014
|
if (isAccessor(node)) {
|
|
21015
|
-
const { firstAccessor, secondAccessor, setAccessor } = getAllAccessorDeclarations(parent2.members, node);
|
|
21015
|
+
const { firstAccessor, secondAccessor, setAccessor: setAccessor2 } = getAllAccessorDeclarations(parent2.members, node);
|
|
21016
21016
|
const firstAccessorWithDecorators = hasDecorators(firstAccessor) ? firstAccessor : secondAccessor && hasDecorators(secondAccessor) ? secondAccessor : void 0;
|
|
21017
21017
|
if (!firstAccessorWithDecorators || node !== firstAccessorWithDecorators) {
|
|
21018
21018
|
return false;
|
|
21019
21019
|
}
|
|
21020
|
-
parameters =
|
|
21020
|
+
parameters = setAccessor2 == null ? void 0 : setAccessor2.parameters;
|
|
21021
21021
|
} else if (isMethodDeclaration(node)) {
|
|
21022
21022
|
parameters = node.parameters;
|
|
21023
21023
|
}
|
|
@@ -23211,13 +23211,13 @@ ${lanes.join("\n")}
|
|
|
23211
23211
|
let firstAccessor;
|
|
23212
23212
|
let secondAccessor;
|
|
23213
23213
|
let getAccessor;
|
|
23214
|
-
let
|
|
23214
|
+
let setAccessor2;
|
|
23215
23215
|
if (hasDynamicName(accessor)) {
|
|
23216
23216
|
firstAccessor = accessor;
|
|
23217
23217
|
if (accessor.kind === 177) {
|
|
23218
23218
|
getAccessor = accessor;
|
|
23219
23219
|
} else if (accessor.kind === 178) {
|
|
23220
|
-
|
|
23220
|
+
setAccessor2 = accessor;
|
|
23221
23221
|
} else {
|
|
23222
23222
|
Debug.fail("Accessor has wrong kind");
|
|
23223
23223
|
}
|
|
@@ -23235,8 +23235,8 @@ ${lanes.join("\n")}
|
|
|
23235
23235
|
if (member2.kind === 177 && !getAccessor) {
|
|
23236
23236
|
getAccessor = member2;
|
|
23237
23237
|
}
|
|
23238
|
-
if (member2.kind === 178 && !
|
|
23239
|
-
|
|
23238
|
+
if (member2.kind === 178 && !setAccessor2) {
|
|
23239
|
+
setAccessor2 = member2;
|
|
23240
23240
|
}
|
|
23241
23241
|
}
|
|
23242
23242
|
}
|
|
@@ -23246,7 +23246,7 @@ ${lanes.join("\n")}
|
|
|
23246
23246
|
firstAccessor,
|
|
23247
23247
|
secondAccessor,
|
|
23248
23248
|
getAccessor,
|
|
23249
|
-
setAccessor
|
|
23249
|
+
setAccessor: setAccessor2
|
|
23250
23250
|
};
|
|
23251
23251
|
}
|
|
23252
23252
|
function getEffectiveTypeAnnotationNode(node) {
|
|
@@ -25578,12 +25578,12 @@ ${lanes.join("\n")}
|
|
|
25578
25578
|
diagnostic.relatedInformation.push(...relatedInformation);
|
|
25579
25579
|
return diagnostic;
|
|
25580
25580
|
}
|
|
25581
|
-
function minAndMax(arr,
|
|
25581
|
+
function minAndMax(arr, getValue2) {
|
|
25582
25582
|
Debug.assert(arr.length !== 0);
|
|
25583
|
-
let min2 =
|
|
25583
|
+
let min2 = getValue2(arr[0]);
|
|
25584
25584
|
let max = min2;
|
|
25585
25585
|
for (let i = 1; i < arr.length; i++) {
|
|
25586
|
-
const value =
|
|
25586
|
+
const value = getValue2(arr[i]);
|
|
25587
25587
|
if (value < min2) {
|
|
25588
25588
|
min2 = value;
|
|
25589
25589
|
} else if (value > max) {
|
|
@@ -34767,7 +34767,7 @@ ${lanes.join("\n")}
|
|
|
34767
34767
|
}
|
|
34768
34768
|
}
|
|
34769
34769
|
function createExpressionForAccessorDeclaration(factory2, properties, property3, receiver, multiLine) {
|
|
34770
|
-
const { firstAccessor, getAccessor, setAccessor } = getAllAccessorDeclarations(properties, property3);
|
|
34770
|
+
const { firstAccessor, getAccessor, setAccessor: setAccessor2 } = getAllAccessorDeclarations(properties, property3);
|
|
34771
34771
|
if (property3 === firstAccessor) {
|
|
34772
34772
|
return setTextRange(
|
|
34773
34773
|
factory2.createObjectDefinePropertyCall(
|
|
@@ -34796,25 +34796,25 @@ ${lanes.join("\n")}
|
|
|
34796
34796
|
),
|
|
34797
34797
|
getAccessor
|
|
34798
34798
|
),
|
|
34799
|
-
set:
|
|
34799
|
+
set: setAccessor2 && setTextRange(
|
|
34800
34800
|
setOriginalNode(
|
|
34801
34801
|
factory2.createFunctionExpression(
|
|
34802
|
-
getModifiers(
|
|
34802
|
+
getModifiers(setAccessor2),
|
|
34803
34803
|
/*asteriskToken*/
|
|
34804
34804
|
void 0,
|
|
34805
34805
|
/*name*/
|
|
34806
34806
|
void 0,
|
|
34807
34807
|
/*typeParameters*/
|
|
34808
34808
|
void 0,
|
|
34809
|
-
|
|
34809
|
+
setAccessor2.parameters,
|
|
34810
34810
|
/*type*/
|
|
34811
34811
|
void 0,
|
|
34812
|
-
|
|
34812
|
+
setAccessor2.body
|
|
34813
34813
|
// TODO: GH#18217
|
|
34814
34814
|
),
|
|
34815
|
-
|
|
34815
|
+
setAccessor2
|
|
34816
34816
|
),
|
|
34817
|
-
|
|
34817
|
+
setAccessor2
|
|
34818
34818
|
)
|
|
34819
34819
|
}, !multiLine)
|
|
34820
34820
|
),
|
|
@@ -99322,12 +99322,12 @@ ${lanes.join("\n")}
|
|
|
99322
99322
|
const otherAccessor = getDeclarationOfKind(getSymbolOfDeclaration(accessor), otherKind);
|
|
99323
99323
|
const firstAccessor = otherAccessor && otherAccessor.pos < accessor.pos ? otherAccessor : accessor;
|
|
99324
99324
|
const secondAccessor = otherAccessor && otherAccessor.pos < accessor.pos ? accessor : otherAccessor;
|
|
99325
|
-
const
|
|
99325
|
+
const setAccessor2 = accessor.kind === 178 ? accessor : otherAccessor;
|
|
99326
99326
|
const getAccessor = accessor.kind === 177 ? accessor : otherAccessor;
|
|
99327
99327
|
return {
|
|
99328
99328
|
firstAccessor,
|
|
99329
99329
|
secondAccessor,
|
|
99330
|
-
setAccessor,
|
|
99330
|
+
setAccessor: setAccessor2,
|
|
99331
99331
|
getAccessor
|
|
99332
99332
|
};
|
|
99333
99333
|
}
|
|
@@ -104391,13 +104391,13 @@ ${lanes.join("\n")}
|
|
|
104391
104391
|
if (!accessor.body) {
|
|
104392
104392
|
return void 0;
|
|
104393
104393
|
}
|
|
104394
|
-
const { firstAccessor, secondAccessor, getAccessor, setAccessor } = getAllAccessorDeclarations(parent2.members, accessor);
|
|
104394
|
+
const { firstAccessor, secondAccessor, getAccessor, setAccessor: setAccessor2 } = getAllAccessorDeclarations(parent2.members, accessor);
|
|
104395
104395
|
const firstAccessorWithDecorators = hasDecorators(firstAccessor) ? firstAccessor : secondAccessor && hasDecorators(secondAccessor) ? secondAccessor : void 0;
|
|
104396
104396
|
if (!firstAccessorWithDecorators || accessor !== firstAccessorWithDecorators) {
|
|
104397
104397
|
return void 0;
|
|
104398
104398
|
}
|
|
104399
104399
|
const decorators = getDecorators(firstAccessorWithDecorators);
|
|
104400
|
-
const parameters = getDecoratorsOfParameters(
|
|
104400
|
+
const parameters = getDecoratorsOfParameters(setAccessor2);
|
|
104401
104401
|
if (!some(decorators) && !some(parameters)) {
|
|
104402
104402
|
return void 0;
|
|
104403
104403
|
}
|
|
@@ -104405,7 +104405,7 @@ ${lanes.join("\n")}
|
|
|
104405
104405
|
decorators,
|
|
104406
104406
|
parameters,
|
|
104407
104407
|
getDecorators: getAccessor && getDecorators(getAccessor),
|
|
104408
|
-
setDecorators:
|
|
104408
|
+
setDecorators: setAccessor2 && getDecorators(setAccessor2)
|
|
104409
104409
|
};
|
|
104410
104410
|
}
|
|
104411
104411
|
function getAllDecoratorsOfMethod(method) {
|
|
@@ -109602,9 +109602,9 @@ ${lanes.join("\n")}
|
|
|
109602
109602
|
}
|
|
109603
109603
|
function getParametersOfDecoratedDeclaration(node, container) {
|
|
109604
109604
|
if (container && node.kind === 177) {
|
|
109605
|
-
const { setAccessor } = getAllAccessorDeclarations(container.members, node);
|
|
109606
|
-
if (
|
|
109607
|
-
return
|
|
109605
|
+
const { setAccessor: setAccessor2 } = getAllAccessorDeclarations(container.members, node);
|
|
109606
|
+
if (setAccessor2) {
|
|
109607
|
+
return setAccessor2.parameters;
|
|
109608
109608
|
}
|
|
109609
109609
|
}
|
|
109610
109610
|
return node.parameters;
|
|
@@ -114089,7 +114089,7 @@ ${lanes.join("\n")}
|
|
|
114089
114089
|
[]
|
|
114090
114090
|
);
|
|
114091
114091
|
const getDone = factory2.createPropertyAccessExpression(result2, "done");
|
|
114092
|
-
const
|
|
114092
|
+
const getValue2 = factory2.createPropertyAccessExpression(result2, "value");
|
|
114093
114093
|
const callReturn = factory2.createFunctionCallCall(returnMethod, iterator, []);
|
|
114094
114094
|
hoistVariableDeclaration(errorRecord);
|
|
114095
114095
|
hoistVariableDeclaration(returnMethod);
|
|
@@ -114133,7 +114133,7 @@ ${lanes.join("\n")}
|
|
|
114133
114133
|
/*incrementor*/
|
|
114134
114134
|
factory2.createAssignment(nonUserCode, factory2.createTrue()),
|
|
114135
114135
|
/*statement*/
|
|
114136
|
-
convertForOfStatementHead(node,
|
|
114136
|
+
convertForOfStatementHead(node, getValue2, nonUserCode)
|
|
114137
114137
|
),
|
|
114138
114138
|
/*location*/
|
|
114139
114139
|
node
|
|
@@ -118258,7 +118258,7 @@ ${lanes.join("\n")}
|
|
|
118258
118258
|
setSourceMapRange(statement, getSourceMapRange(accessors.firstAccessor));
|
|
118259
118259
|
return statement;
|
|
118260
118260
|
}
|
|
118261
|
-
function transformAccessorsToExpression(receiver, { firstAccessor, getAccessor, setAccessor }, container, startsOnNewLine) {
|
|
118261
|
+
function transformAccessorsToExpression(receiver, { firstAccessor, getAccessor, setAccessor: setAccessor2 }, container, startsOnNewLine) {
|
|
118262
118262
|
const target = setParent(setTextRange(factory2.cloneNode(receiver), receiver), receiver.parent);
|
|
118263
118263
|
setEmitFlags(
|
|
118264
118264
|
target,
|
|
@@ -118298,27 +118298,27 @@ ${lanes.join("\n")}
|
|
|
118298
118298
|
setCommentRange(getter, getCommentRange(getAccessor));
|
|
118299
118299
|
properties.push(getter);
|
|
118300
118300
|
}
|
|
118301
|
-
if (
|
|
118301
|
+
if (setAccessor2) {
|
|
118302
118302
|
const setterFunction = transformFunctionLikeToExpression(
|
|
118303
|
-
|
|
118303
|
+
setAccessor2,
|
|
118304
118304
|
/*location*/
|
|
118305
118305
|
void 0,
|
|
118306
118306
|
/*name*/
|
|
118307
118307
|
void 0,
|
|
118308
118308
|
container
|
|
118309
118309
|
);
|
|
118310
|
-
setSourceMapRange(setterFunction, getSourceMapRange(
|
|
118310
|
+
setSourceMapRange(setterFunction, getSourceMapRange(setAccessor2));
|
|
118311
118311
|
setEmitFlags(
|
|
118312
118312
|
setterFunction,
|
|
118313
118313
|
1024
|
|
118314
118314
|
/* NoLeadingComments */
|
|
118315
118315
|
);
|
|
118316
118316
|
const setter = factory2.createPropertyAssignment("set", setterFunction);
|
|
118317
|
-
setCommentRange(setter, getCommentRange(
|
|
118317
|
+
setCommentRange(setter, getCommentRange(setAccessor2));
|
|
118318
118318
|
properties.push(setter);
|
|
118319
118319
|
}
|
|
118320
118320
|
properties.push(
|
|
118321
|
-
factory2.createPropertyAssignment("enumerable", getAccessor ||
|
|
118321
|
+
factory2.createPropertyAssignment("enumerable", getAccessor || setAccessor2 ? factory2.createFalse() : factory2.createTrue()),
|
|
118322
118322
|
factory2.createPropertyAssignment("configurable", factory2.createTrue())
|
|
118323
118323
|
);
|
|
118324
118324
|
const call = factory2.createCallExpression(
|
|
@@ -126766,11 +126766,11 @@ ${lanes.join("\n")}
|
|
|
126766
126766
|
}
|
|
126767
126767
|
function createAccessorTypeError(node) {
|
|
126768
126768
|
var _a3;
|
|
126769
|
-
const { getAccessor, setAccessor } = getAllAccessorDeclarations(node.symbol.declarations, node);
|
|
126769
|
+
const { getAccessor, setAccessor: setAccessor2 } = getAllAccessorDeclarations(node.symbol.declarations, node);
|
|
126770
126770
|
const targetNode = (_a3 = isSetAccessor(node) ? node.parameters[0] : node) != null ? _a3 : node;
|
|
126771
126771
|
const diag2 = createDiagnosticForNode(targetNode, errorByDeclarationKind[node.kind]);
|
|
126772
|
-
if (
|
|
126773
|
-
addRelatedInfo(diag2, createDiagnosticForNode(
|
|
126772
|
+
if (setAccessor2) {
|
|
126773
|
+
addRelatedInfo(diag2, createDiagnosticForNode(setAccessor2, relatedSuggestionByDeclarationKind[setAccessor2.kind]));
|
|
126774
126774
|
}
|
|
126775
126775
|
if (getAccessor) {
|
|
126776
126776
|
addRelatedInfo(diag2, createDiagnosticForNode(getAccessor, relatedSuggestionByDeclarationKind[getAccessor.kind]));
|
|
@@ -129023,8 +129023,8 @@ ${lanes.join("\n")}
|
|
|
129023
129023
|
Debug.assert(state < 2, "Cannot modify the transformation context after transformation has completed.");
|
|
129024
129024
|
Debug.assert(!helper.scoped, "Cannot request a scoped emit helper.");
|
|
129025
129025
|
if (helper.dependencies) {
|
|
129026
|
-
for (const
|
|
129027
|
-
requestEmitHelper(
|
|
129026
|
+
for (const h2 of helper.dependencies) {
|
|
129027
|
+
requestEmitHelper(h2);
|
|
129028
129028
|
}
|
|
129029
129029
|
}
|
|
129030
129030
|
emitHelpers = append2(emitHelpers, helper);
|
|
@@ -172325,35 +172325,35 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
172325
172325
|
if (!containingFunction) {
|
|
172326
172326
|
return;
|
|
172327
172327
|
}
|
|
172328
|
-
let
|
|
172328
|
+
let insertBefore2;
|
|
172329
172329
|
switch (containingFunction.kind) {
|
|
172330
172330
|
case 174:
|
|
172331
|
-
|
|
172331
|
+
insertBefore2 = containingFunction.name;
|
|
172332
172332
|
break;
|
|
172333
172333
|
case 262:
|
|
172334
172334
|
case 218:
|
|
172335
|
-
|
|
172335
|
+
insertBefore2 = findChildOfKind(containingFunction, 100, sourceFile);
|
|
172336
172336
|
break;
|
|
172337
172337
|
case 219:
|
|
172338
172338
|
const kind = containingFunction.typeParameters ? 30 : 21;
|
|
172339
|
-
|
|
172339
|
+
insertBefore2 = findChildOfKind(containingFunction, kind, sourceFile) || first(containingFunction.parameters);
|
|
172340
172340
|
break;
|
|
172341
172341
|
default:
|
|
172342
172342
|
return;
|
|
172343
172343
|
}
|
|
172344
|
-
return
|
|
172345
|
-
insertBefore,
|
|
172344
|
+
return insertBefore2 && {
|
|
172345
|
+
insertBefore: insertBefore2,
|
|
172346
172346
|
returnType: getReturnType(containingFunction)
|
|
172347
172347
|
};
|
|
172348
172348
|
}
|
|
172349
|
-
function doChange31(changes, sourceFile, { insertBefore, returnType }) {
|
|
172349
|
+
function doChange31(changes, sourceFile, { insertBefore: insertBefore2, returnType }) {
|
|
172350
172350
|
if (returnType) {
|
|
172351
172351
|
const entityName = getEntityNameFromTypeNode(returnType);
|
|
172352
172352
|
if (!entityName || entityName.kind !== 80 || entityName.text !== "Promise") {
|
|
172353
172353
|
changes.replaceNode(sourceFile, returnType, factory.createTypeReferenceNode("Promise", factory.createNodeArray([returnType])));
|
|
172354
172354
|
}
|
|
172355
172355
|
}
|
|
172356
|
-
changes.insertModifierBefore(sourceFile, 134,
|
|
172356
|
+
changes.insertModifierBefore(sourceFile, 134, insertBefore2);
|
|
172357
172357
|
}
|
|
172358
172358
|
var errorCodes49 = [
|
|
172359
172359
|
Diagnostics._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property.code,
|
|
@@ -174289,9 +174289,9 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
174289
174289
|
updateReadonlyPropertyInitializerStatementConstructor(changeTracker, file, constructor, fieldName.text, originalName);
|
|
174290
174290
|
}
|
|
174291
174291
|
} else {
|
|
174292
|
-
const
|
|
174293
|
-
suppressLeadingAndTrailingTrivia(
|
|
174294
|
-
insertAccessor(changeTracker, file,
|
|
174292
|
+
const setAccessor2 = generateSetAccessor(fieldName, accessorName, type, accessorModifiers, isStatic2, container);
|
|
174293
|
+
suppressLeadingAndTrailingTrivia(setAccessor2);
|
|
174294
|
+
insertAccessor(changeTracker, file, setAccessor2, declaration, container);
|
|
174295
174295
|
}
|
|
174296
174296
|
return changeTracker.getChanges();
|
|
174297
174297
|
}
|
|
@@ -203228,11 +203228,11 @@ ${json2}${newLine}`;
|
|
|
203228
203228
|
body
|
|
203229
203229
|
};
|
|
203230
203230
|
}
|
|
203231
|
-
function combineProjectOutput(defaultValue,
|
|
203231
|
+
function combineProjectOutput(defaultValue, getValue2, projects, action) {
|
|
203232
203232
|
const outputs = flatMapToMutable(isArray2(projects) ? projects : projects.projects, (project) => action(project, defaultValue));
|
|
203233
203233
|
if (!isArray2(projects) && projects.symLinkedProjects) {
|
|
203234
203234
|
projects.symLinkedProjects.forEach((projects2, path7) => {
|
|
203235
|
-
const value =
|
|
203235
|
+
const value = getValue2(path7);
|
|
203236
203236
|
outputs.push(...flatMap(projects2, (project) => action(project, value)));
|
|
203237
203237
|
});
|
|
203238
203238
|
}
|
|
@@ -232674,7 +232674,7 @@ module.exports = __toCommonJS(index_exports);
|
|
|
232674
232674
|
var import_typescript70 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
232675
232675
|
|
|
232676
232676
|
// src/version.ts
|
|
232677
|
-
var buildId = "
|
|
232677
|
+
var buildId = "1748987389";
|
|
232678
232678
|
var minfyJsId = "terser5.37.0_7";
|
|
232679
232679
|
var optimizeCssId = "autoprefixer10.4.19_postcss8.5.3_7";
|
|
232680
232680
|
var parse5Version = "7.2.1";
|
|
@@ -232682,8 +232682,8 @@ var rollupVersion = "4.34.9";
|
|
|
232682
232682
|
var jqueryVersion = "4.0.0-pre";
|
|
232683
232683
|
var terserVersion = "5.37.0";
|
|
232684
232684
|
var typescriptVersion = "5.5.4";
|
|
232685
|
-
var vermoji = "\u{
|
|
232686
|
-
var version = "4.33.
|
|
232685
|
+
var vermoji = "\u{1F943}";
|
|
232686
|
+
var version = "4.33.1";
|
|
232687
232687
|
var versions = {
|
|
232688
232688
|
stencil: version,
|
|
232689
232689
|
parse5: parse5Version,
|
|
@@ -233730,6 +233730,489 @@ var unwrapErr = (result2) => {
|
|
|
233730
233730
|
}
|
|
233731
233731
|
};
|
|
233732
233732
|
|
|
233733
|
+
// src/app-data/index.ts
|
|
233734
|
+
var BUILD = {
|
|
233735
|
+
allRenderFn: false,
|
|
233736
|
+
element: true,
|
|
233737
|
+
event: true,
|
|
233738
|
+
hasRenderFn: true,
|
|
233739
|
+
hostListener: true,
|
|
233740
|
+
hostListenerTargetWindow: true,
|
|
233741
|
+
hostListenerTargetDocument: true,
|
|
233742
|
+
hostListenerTargetBody: true,
|
|
233743
|
+
hostListenerTargetParent: false,
|
|
233744
|
+
hostListenerTarget: true,
|
|
233745
|
+
member: true,
|
|
233746
|
+
method: true,
|
|
233747
|
+
mode: true,
|
|
233748
|
+
observeAttribute: true,
|
|
233749
|
+
prop: true,
|
|
233750
|
+
propMutable: true,
|
|
233751
|
+
reflect: true,
|
|
233752
|
+
scoped: true,
|
|
233753
|
+
shadowDom: true,
|
|
233754
|
+
slot: true,
|
|
233755
|
+
cssAnnotations: true,
|
|
233756
|
+
state: true,
|
|
233757
|
+
style: true,
|
|
233758
|
+
formAssociated: false,
|
|
233759
|
+
svg: true,
|
|
233760
|
+
updatable: true,
|
|
233761
|
+
vdomAttribute: true,
|
|
233762
|
+
vdomXlink: true,
|
|
233763
|
+
vdomClass: true,
|
|
233764
|
+
vdomFunctional: true,
|
|
233765
|
+
vdomKey: true,
|
|
233766
|
+
vdomListener: true,
|
|
233767
|
+
vdomRef: true,
|
|
233768
|
+
vdomPropOrAttr: true,
|
|
233769
|
+
vdomRender: true,
|
|
233770
|
+
vdomStyle: true,
|
|
233771
|
+
vdomText: true,
|
|
233772
|
+
watchCallback: true,
|
|
233773
|
+
taskQueue: true,
|
|
233774
|
+
hotModuleReplacement: false,
|
|
233775
|
+
isDebug: false,
|
|
233776
|
+
isDev: false,
|
|
233777
|
+
isTesting: false,
|
|
233778
|
+
hydrateServerSide: false,
|
|
233779
|
+
hydrateClientSide: false,
|
|
233780
|
+
lifecycleDOMEvents: false,
|
|
233781
|
+
lazyLoad: false,
|
|
233782
|
+
profile: false,
|
|
233783
|
+
slotRelocation: true,
|
|
233784
|
+
// TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior
|
|
233785
|
+
appendChildSlotFix: false,
|
|
233786
|
+
// TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior
|
|
233787
|
+
cloneNodeFix: false,
|
|
233788
|
+
hydratedAttribute: false,
|
|
233789
|
+
hydratedClass: true,
|
|
233790
|
+
// TODO(STENCIL-1305): remove this option
|
|
233791
|
+
scriptDataOpts: false,
|
|
233792
|
+
// TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior
|
|
233793
|
+
scopedSlotTextContentFix: false,
|
|
233794
|
+
// TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
|
|
233795
|
+
shadowDomShim: false,
|
|
233796
|
+
// TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior
|
|
233797
|
+
slotChildNodesFix: false,
|
|
233798
|
+
invisiblePrehydration: true,
|
|
233799
|
+
propBoolean: true,
|
|
233800
|
+
propNumber: true,
|
|
233801
|
+
propString: true,
|
|
233802
|
+
constructableCSS: true,
|
|
233803
|
+
devTools: false,
|
|
233804
|
+
shadowDelegatesFocus: true,
|
|
233805
|
+
initializeNextTick: false,
|
|
233806
|
+
asyncLoading: true,
|
|
233807
|
+
asyncQueue: false,
|
|
233808
|
+
transformTagName: false,
|
|
233809
|
+
attachStyles: true,
|
|
233810
|
+
// TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior
|
|
233811
|
+
experimentalSlotFixes: false
|
|
233812
|
+
};
|
|
233813
|
+
|
|
233814
|
+
// src/client/client-build.ts
|
|
233815
|
+
var Build = {
|
|
233816
|
+
isDev: BUILD.isDev ? true : false,
|
|
233817
|
+
isBrowser: true,
|
|
233818
|
+
isServer: false,
|
|
233819
|
+
isTesting: BUILD.isTesting ? true : false
|
|
233820
|
+
};
|
|
233821
|
+
|
|
233822
|
+
// src/client/client-log.ts
|
|
233823
|
+
var STENCIL_DEV_MODE = BUILD.isTesting ? ["STENCIL:"] : [
|
|
233824
|
+
"%cstencil",
|
|
233825
|
+
"color: white;background:#4c47ff;font-weight: bold; font-size:10px; padding:2px 6px; border-radius: 5px"
|
|
233826
|
+
];
|
|
233827
|
+
|
|
233828
|
+
// src/runtime/runtime-constants.ts
|
|
233829
|
+
var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
|
|
233830
|
+
|
|
233831
|
+
// src/client/client-window.ts
|
|
233832
|
+
var win = typeof window !== "undefined" ? window : {};
|
|
233833
|
+
var H = win.HTMLElement || class {
|
|
233834
|
+
};
|
|
233835
|
+
var supportsShadow = BUILD.shadowDom;
|
|
233836
|
+
var supportsConstructableStylesheets = BUILD.constructableCSS ? /* @__PURE__ */ (() => {
|
|
233837
|
+
try {
|
|
233838
|
+
new CSSStyleSheet();
|
|
233839
|
+
return typeof new CSSStyleSheet().replaceSync === "function";
|
|
233840
|
+
} catch (e) {
|
|
233841
|
+
}
|
|
233842
|
+
return false;
|
|
233843
|
+
})() : false;
|
|
233844
|
+
|
|
233845
|
+
// src/utils/shadow-css.ts
|
|
233846
|
+
/**
|
|
233847
|
+
* @license
|
|
233848
|
+
* Copyright Google Inc. All Rights Reserved.
|
|
233849
|
+
*
|
|
233850
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
233851
|
+
* found in the LICENSE file at https://angular.io/license
|
|
233852
|
+
*
|
|
233853
|
+
* This file is a port of shadowCSS from `webcomponents.js` to TypeScript.
|
|
233854
|
+
* https://github.com/webcomponents/webcomponentsjs/blob/4efecd7e0e/src/ShadowCSS/ShadowCSS.js
|
|
233855
|
+
* https://github.com/angular/angular/blob/master/packages/compiler/src/shadow_css.ts
|
|
233856
|
+
*/
|
|
233857
|
+
var safeSelector = (selector) => {
|
|
233858
|
+
const placeholders = [];
|
|
233859
|
+
let index2 = 0;
|
|
233860
|
+
selector = selector.replace(/(\[[^\]]*\])/g, (_, keep) => {
|
|
233861
|
+
const replaceBy = `__ph-${index2}__`;
|
|
233862
|
+
placeholders.push(keep);
|
|
233863
|
+
index2++;
|
|
233864
|
+
return replaceBy;
|
|
233865
|
+
});
|
|
233866
|
+
const content = selector.replace(/(:nth-[-\w]+)(\([^)]+\))/g, (_, pseudo, exp) => {
|
|
233867
|
+
const replaceBy = `__ph-${index2}__`;
|
|
233868
|
+
placeholders.push(exp);
|
|
233869
|
+
index2++;
|
|
233870
|
+
return pseudo + replaceBy;
|
|
233871
|
+
});
|
|
233872
|
+
const ss = {
|
|
233873
|
+
content,
|
|
233874
|
+
placeholders
|
|
233875
|
+
};
|
|
233876
|
+
return ss;
|
|
233877
|
+
};
|
|
233878
|
+
var restoreSafeSelector = (placeholders, content) => {
|
|
233879
|
+
return content.replace(/__ph-(\d+)__/g, (_, index2) => placeholders[+index2]);
|
|
233880
|
+
};
|
|
233881
|
+
var _polyfillHost = "-shadowcsshost";
|
|
233882
|
+
var _polyfillSlotted = "-shadowcssslotted";
|
|
233883
|
+
var _polyfillHostContext = "-shadowcsscontext";
|
|
233884
|
+
var _parenSuffix = ")(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))?([^,{]*)";
|
|
233885
|
+
var _cssColonHostRe = new RegExp("(" + _polyfillHost + _parenSuffix, "gim");
|
|
233886
|
+
var _cssColonHostContextRe = new RegExp("(" + _polyfillHostContext + _parenSuffix, "gim");
|
|
233887
|
+
var _cssColonSlottedRe = new RegExp("(" + _polyfillSlotted + _parenSuffix, "gim");
|
|
233888
|
+
var _polyfillHostNoCombinator = _polyfillHost + "-no-combinator";
|
|
233889
|
+
var _polyfillHostNoCombinatorRe = /-shadowcsshost-no-combinator([^\s]*)/;
|
|
233890
|
+
var _shadowDOMSelectorsRe = [/::shadow/g, /::content/g];
|
|
233891
|
+
var _selectorReSuffix = "([>\\s~+[.,{:][\\s\\S]*)?$";
|
|
233892
|
+
var _polyfillHostRe = /-shadowcsshost/gim;
|
|
233893
|
+
var createSupportsRuleRe = (selector) => {
|
|
233894
|
+
const safeSelector2 = escapeRegExpSpecialCharacters(selector);
|
|
233895
|
+
return new RegExp(
|
|
233896
|
+
// First capture group: match any context before the selector that's not inside @supports selector()
|
|
233897
|
+
// Using negative lookahead to avoid matching inside @supports selector(...) condition
|
|
233898
|
+
`(^|[^@]|@(?!supports\\s+selector\\s*\\([^{]*?${safeSelector2}))(${safeSelector2}\\b)`,
|
|
233899
|
+
"g"
|
|
233900
|
+
);
|
|
233901
|
+
};
|
|
233902
|
+
var _colonSlottedRe = createSupportsRuleRe("::slotted");
|
|
233903
|
+
var _colonHostRe = createSupportsRuleRe(":host");
|
|
233904
|
+
var _colonHostContextRe = createSupportsRuleRe(":host-context");
|
|
233905
|
+
var _commentRe = /\/\*\s*[\s\S]*?\*\//g;
|
|
233906
|
+
var stripComments = (input) => {
|
|
233907
|
+
return input.replace(_commentRe, "");
|
|
233908
|
+
};
|
|
233909
|
+
var _commentWithHashRe = /\/\*\s*#\s*source(Mapping)?URL=[\s\S]+?\*\//g;
|
|
233910
|
+
var extractCommentsWithHash = (input) => {
|
|
233911
|
+
return input.match(_commentWithHashRe) || [];
|
|
233912
|
+
};
|
|
233913
|
+
var _ruleRe = /(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g;
|
|
233914
|
+
var _curlyRe = /([{}])/g;
|
|
233915
|
+
var _selectorPartsRe = /(^.*?[^\\])??((:+)(.*)|$)/;
|
|
233916
|
+
var OPEN_CURLY = "{";
|
|
233917
|
+
var CLOSE_CURLY = "}";
|
|
233918
|
+
var BLOCK_PLACEHOLDER = "%BLOCK%";
|
|
233919
|
+
var processRules = (input, ruleCallback) => {
|
|
233920
|
+
const inputWithEscapedBlocks = escapeBlocks(input);
|
|
233921
|
+
let nextBlockIndex = 0;
|
|
233922
|
+
return inputWithEscapedBlocks.escapedString.replace(_ruleRe, (...m) => {
|
|
233923
|
+
const selector = m[2];
|
|
233924
|
+
let content = "";
|
|
233925
|
+
let suffix = m[4];
|
|
233926
|
+
let contentPrefix = "";
|
|
233927
|
+
if (suffix && suffix.startsWith("{" + BLOCK_PLACEHOLDER)) {
|
|
233928
|
+
content = inputWithEscapedBlocks.blocks[nextBlockIndex++];
|
|
233929
|
+
suffix = suffix.substring(BLOCK_PLACEHOLDER.length + 1);
|
|
233930
|
+
contentPrefix = "{";
|
|
233931
|
+
}
|
|
233932
|
+
const cssRule = {
|
|
233933
|
+
selector,
|
|
233934
|
+
content
|
|
233935
|
+
};
|
|
233936
|
+
const rule = ruleCallback(cssRule);
|
|
233937
|
+
return `${m[1]}${rule.selector}${m[3]}${contentPrefix}${rule.content}${suffix}`;
|
|
233938
|
+
});
|
|
233939
|
+
};
|
|
233940
|
+
var escapeBlocks = (input) => {
|
|
233941
|
+
const inputParts = input.split(_curlyRe);
|
|
233942
|
+
const resultParts = [];
|
|
233943
|
+
const escapedBlocks = [];
|
|
233944
|
+
let bracketCount = 0;
|
|
233945
|
+
let currentBlockParts = [];
|
|
233946
|
+
for (let partIndex = 0; partIndex < inputParts.length; partIndex++) {
|
|
233947
|
+
const part = inputParts[partIndex];
|
|
233948
|
+
if (part === CLOSE_CURLY) {
|
|
233949
|
+
bracketCount--;
|
|
233950
|
+
}
|
|
233951
|
+
if (bracketCount > 0) {
|
|
233952
|
+
currentBlockParts.push(part);
|
|
233953
|
+
} else {
|
|
233954
|
+
if (currentBlockParts.length > 0) {
|
|
233955
|
+
escapedBlocks.push(currentBlockParts.join(""));
|
|
233956
|
+
resultParts.push(BLOCK_PLACEHOLDER);
|
|
233957
|
+
currentBlockParts = [];
|
|
233958
|
+
}
|
|
233959
|
+
resultParts.push(part);
|
|
233960
|
+
}
|
|
233961
|
+
if (part === OPEN_CURLY) {
|
|
233962
|
+
bracketCount++;
|
|
233963
|
+
}
|
|
233964
|
+
}
|
|
233965
|
+
if (currentBlockParts.length > 0) {
|
|
233966
|
+
escapedBlocks.push(currentBlockParts.join(""));
|
|
233967
|
+
resultParts.push(BLOCK_PLACEHOLDER);
|
|
233968
|
+
}
|
|
233969
|
+
const strEscapedBlocks = {
|
|
233970
|
+
escapedString: resultParts.join(""),
|
|
233971
|
+
blocks: escapedBlocks
|
|
233972
|
+
};
|
|
233973
|
+
return strEscapedBlocks;
|
|
233974
|
+
};
|
|
233975
|
+
var insertPolyfillHostInCssText = (cssText) => {
|
|
233976
|
+
const supportsBlocks = [];
|
|
233977
|
+
cssText = cssText.replace(/@supports\s+selector\s*\(\s*([^)]*)\s*\)/g, (_, selectorContent) => {
|
|
233978
|
+
const placeholder = `__supports_${supportsBlocks.length}__`;
|
|
233979
|
+
supportsBlocks.push(selectorContent);
|
|
233980
|
+
return `@supports selector(${placeholder})`;
|
|
233981
|
+
});
|
|
233982
|
+
cssText = cssText.replace(_colonHostContextRe, `$1${_polyfillHostContext}`).replace(_colonHostRe, `$1${_polyfillHost}`).replace(_colonSlottedRe, `$1${_polyfillSlotted}`);
|
|
233983
|
+
supportsBlocks.forEach((originalSelector, index2) => {
|
|
233984
|
+
cssText = cssText.replace(`__supports_${index2}__`, originalSelector);
|
|
233985
|
+
});
|
|
233986
|
+
return cssText;
|
|
233987
|
+
};
|
|
233988
|
+
var convertColonRule = (cssText, regExp, partReplacer) => {
|
|
233989
|
+
return cssText.replace(regExp, (...m) => {
|
|
233990
|
+
if (m[2]) {
|
|
233991
|
+
const parts = m[2].split(",");
|
|
233992
|
+
const r = [];
|
|
233993
|
+
for (let i = 0; i < parts.length; i++) {
|
|
233994
|
+
const p = parts[i].trim();
|
|
233995
|
+
if (!p) break;
|
|
233996
|
+
r.push(partReplacer(_polyfillHostNoCombinator, p, m[3]));
|
|
233997
|
+
}
|
|
233998
|
+
return r.join(",");
|
|
233999
|
+
} else {
|
|
234000
|
+
return _polyfillHostNoCombinator + m[3];
|
|
234001
|
+
}
|
|
234002
|
+
});
|
|
234003
|
+
};
|
|
234004
|
+
var colonHostPartReplacer = (host, part, suffix) => {
|
|
234005
|
+
return host + part.replace(_polyfillHost, "") + suffix;
|
|
234006
|
+
};
|
|
234007
|
+
var convertColonHost = (cssText) => {
|
|
234008
|
+
return convertColonRule(cssText, _cssColonHostRe, colonHostPartReplacer);
|
|
234009
|
+
};
|
|
234010
|
+
var colonHostContextPartReplacer = (host, part, suffix) => {
|
|
234011
|
+
if (part.indexOf(_polyfillHost) > -1) {
|
|
234012
|
+
return colonHostPartReplacer(host, part, suffix);
|
|
234013
|
+
} else {
|
|
234014
|
+
return host + part + suffix + ", " + part + " " + host + suffix;
|
|
234015
|
+
}
|
|
234016
|
+
};
|
|
234017
|
+
var convertColonSlotted = (cssText, slotScopeId) => {
|
|
234018
|
+
const slotClass = "." + slotScopeId + " > ";
|
|
234019
|
+
const selectors = [];
|
|
234020
|
+
cssText = cssText.replace(_cssColonSlottedRe, (...m) => {
|
|
234021
|
+
if (m[2]) {
|
|
234022
|
+
const compound = m[2].trim();
|
|
234023
|
+
const suffix = m[3];
|
|
234024
|
+
const slottedSelector = slotClass + compound + suffix;
|
|
234025
|
+
let prefixSelector = "";
|
|
234026
|
+
for (let i = m[4] - 1; i >= 0; i--) {
|
|
234027
|
+
const char = m[5][i];
|
|
234028
|
+
if (char === "}" || char === ",") {
|
|
234029
|
+
break;
|
|
234030
|
+
}
|
|
234031
|
+
prefixSelector = char + prefixSelector;
|
|
234032
|
+
}
|
|
234033
|
+
const orgSelector = (prefixSelector + slottedSelector).trim();
|
|
234034
|
+
const addedSelector = `${prefixSelector.trimEnd()}${slottedSelector.trim()}`.trim();
|
|
234035
|
+
if (orgSelector !== addedSelector) {
|
|
234036
|
+
const updatedSelector = `${addedSelector}, ${orgSelector}`;
|
|
234037
|
+
selectors.push({
|
|
234038
|
+
orgSelector,
|
|
234039
|
+
updatedSelector
|
|
234040
|
+
});
|
|
234041
|
+
}
|
|
234042
|
+
return slottedSelector;
|
|
234043
|
+
} else {
|
|
234044
|
+
return _polyfillHostNoCombinator + m[3];
|
|
234045
|
+
}
|
|
234046
|
+
});
|
|
234047
|
+
return {
|
|
234048
|
+
selectors,
|
|
234049
|
+
cssText
|
|
234050
|
+
};
|
|
234051
|
+
};
|
|
234052
|
+
var convertColonHostContext = (cssText) => {
|
|
234053
|
+
return convertColonRule(cssText, _cssColonHostContextRe, colonHostContextPartReplacer);
|
|
234054
|
+
};
|
|
234055
|
+
var convertShadowDOMSelectors = (cssText) => {
|
|
234056
|
+
return _shadowDOMSelectorsRe.reduce((result2, pattern) => result2.replace(pattern, " "), cssText);
|
|
234057
|
+
};
|
|
234058
|
+
var makeScopeMatcher = (scopeSelector2) => {
|
|
234059
|
+
const lre = /\[/g;
|
|
234060
|
+
const rre = /\]/g;
|
|
234061
|
+
scopeSelector2 = scopeSelector2.replace(lre, "\\[").replace(rre, "\\]");
|
|
234062
|
+
return new RegExp("^(" + scopeSelector2 + ")" + _selectorReSuffix, "m");
|
|
234063
|
+
};
|
|
234064
|
+
var selectorNeedsScoping = (selector, scopeSelector2) => {
|
|
234065
|
+
const re = makeScopeMatcher(scopeSelector2);
|
|
234066
|
+
return !re.test(selector);
|
|
234067
|
+
};
|
|
234068
|
+
var injectScopingSelector = (selector, scopingSelector) => {
|
|
234069
|
+
return selector.replace(_selectorPartsRe, (_, before = "", _colonGroup, colon = "", after = "") => {
|
|
234070
|
+
return before + scopingSelector + colon + after;
|
|
234071
|
+
});
|
|
234072
|
+
};
|
|
234073
|
+
var applySimpleSelectorScope = (selector, scopeSelector2, hostSelector) => {
|
|
234074
|
+
_polyfillHostRe.lastIndex = 0;
|
|
234075
|
+
if (_polyfillHostRe.test(selector)) {
|
|
234076
|
+
const replaceBy = `.${hostSelector}`;
|
|
234077
|
+
return selector.replace(_polyfillHostNoCombinatorRe, (_, selector2) => injectScopingSelector(selector2, replaceBy)).replace(_polyfillHostRe, replaceBy + " ");
|
|
234078
|
+
}
|
|
234079
|
+
return scopeSelector2 + " " + selector;
|
|
234080
|
+
};
|
|
234081
|
+
var applyStrictSelectorScope = (selector, scopeSelector2, hostSelector) => {
|
|
234082
|
+
const isRe = /\[is=([^\]]*)\]/g;
|
|
234083
|
+
scopeSelector2 = scopeSelector2.replace(isRe, (_, ...parts) => parts[0]);
|
|
234084
|
+
const className = "." + scopeSelector2;
|
|
234085
|
+
const _scopeSelectorPart = (p) => {
|
|
234086
|
+
let scopedP = p.trim();
|
|
234087
|
+
if (!scopedP) {
|
|
234088
|
+
return "";
|
|
234089
|
+
}
|
|
234090
|
+
if (p.indexOf(_polyfillHostNoCombinator) > -1) {
|
|
234091
|
+
scopedP = applySimpleSelectorScope(p, scopeSelector2, hostSelector);
|
|
234092
|
+
} else {
|
|
234093
|
+
const t = p.replace(_polyfillHostRe, "");
|
|
234094
|
+
if (t.length > 0) {
|
|
234095
|
+
scopedP = injectScopingSelector(t, className);
|
|
234096
|
+
}
|
|
234097
|
+
}
|
|
234098
|
+
return scopedP;
|
|
234099
|
+
};
|
|
234100
|
+
const safeContent = safeSelector(selector);
|
|
234101
|
+
selector = safeContent.content;
|
|
234102
|
+
let scopedSelector = "";
|
|
234103
|
+
let startIndex = 0;
|
|
234104
|
+
let res;
|
|
234105
|
+
const sep4 = /( |>|\+|~(?!=))\s*/g;
|
|
234106
|
+
const hasHost = selector.indexOf(_polyfillHostNoCombinator) > -1;
|
|
234107
|
+
let shouldScope = !hasHost;
|
|
234108
|
+
while ((res = sep4.exec(selector)) !== null) {
|
|
234109
|
+
const separator = res[1];
|
|
234110
|
+
const part2 = selector.slice(startIndex, res.index).trim();
|
|
234111
|
+
shouldScope = shouldScope || part2.indexOf(_polyfillHostNoCombinator) > -1;
|
|
234112
|
+
const scopedPart = shouldScope ? _scopeSelectorPart(part2) : part2;
|
|
234113
|
+
scopedSelector += `${scopedPart} ${separator} `;
|
|
234114
|
+
startIndex = sep4.lastIndex;
|
|
234115
|
+
}
|
|
234116
|
+
const part = selector.substring(startIndex);
|
|
234117
|
+
shouldScope = shouldScope || part.indexOf(_polyfillHostNoCombinator) > -1;
|
|
234118
|
+
scopedSelector += shouldScope ? _scopeSelectorPart(part) : part;
|
|
234119
|
+
return restoreSafeSelector(safeContent.placeholders, scopedSelector);
|
|
234120
|
+
};
|
|
234121
|
+
var scopeSelector = (selector, scopeSelectorText, hostSelector, slotSelector) => {
|
|
234122
|
+
return selector.split(",").map((shallowPart) => {
|
|
234123
|
+
if (slotSelector && shallowPart.indexOf("." + slotSelector) > -1) {
|
|
234124
|
+
return shallowPart.trim();
|
|
234125
|
+
}
|
|
234126
|
+
if (selectorNeedsScoping(shallowPart, scopeSelectorText)) {
|
|
234127
|
+
return applyStrictSelectorScope(shallowPart, scopeSelectorText, hostSelector).trim();
|
|
234128
|
+
} else {
|
|
234129
|
+
return shallowPart.trim();
|
|
234130
|
+
}
|
|
234131
|
+
}).join(", ");
|
|
234132
|
+
};
|
|
234133
|
+
var scopeSelectors = (cssText, scopeSelectorText, hostSelector, slotSelector, commentOriginalSelector) => {
|
|
234134
|
+
return processRules(cssText, (rule) => {
|
|
234135
|
+
let selector = rule.selector;
|
|
234136
|
+
let content = rule.content;
|
|
234137
|
+
if (rule.selector[0] !== "@") {
|
|
234138
|
+
selector = scopeSelector(rule.selector, scopeSelectorText, hostSelector, slotSelector);
|
|
234139
|
+
} else if (rule.selector.startsWith("@media") || rule.selector.startsWith("@supports") || rule.selector.startsWith("@page") || rule.selector.startsWith("@document")) {
|
|
234140
|
+
content = scopeSelectors(rule.content, scopeSelectorText, hostSelector, slotSelector, commentOriginalSelector);
|
|
234141
|
+
}
|
|
234142
|
+
const cssRule = {
|
|
234143
|
+
selector: selector.replace(/\s{2,}/g, " ").trim(),
|
|
234144
|
+
content
|
|
234145
|
+
};
|
|
234146
|
+
return cssRule;
|
|
234147
|
+
});
|
|
234148
|
+
};
|
|
234149
|
+
var scopeCssText = (cssText, scopeId, hostScopeId, slotScopeId, commentOriginalSelector) => {
|
|
234150
|
+
cssText = insertPolyfillHostInCssText(cssText);
|
|
234151
|
+
cssText = convertColonHost(cssText);
|
|
234152
|
+
cssText = convertColonHostContext(cssText);
|
|
234153
|
+
const slotted = convertColonSlotted(cssText, slotScopeId);
|
|
234154
|
+
cssText = slotted.cssText;
|
|
234155
|
+
cssText = convertShadowDOMSelectors(cssText);
|
|
234156
|
+
if (scopeId) {
|
|
234157
|
+
cssText = scopeSelectors(cssText, scopeId, hostScopeId, slotScopeId, commentOriginalSelector);
|
|
234158
|
+
}
|
|
234159
|
+
cssText = replaceShadowCssHost(cssText, hostScopeId);
|
|
234160
|
+
cssText = cssText.replace(/>\s*\*\s+([^{, ]+)/gm, " $1 ");
|
|
234161
|
+
return {
|
|
234162
|
+
cssText: cssText.trim(),
|
|
234163
|
+
// We need to replace the shadow CSS host string in each of these selectors since we created
|
|
234164
|
+
// them prior to the replacement happening in the components CSS text.
|
|
234165
|
+
slottedSelectors: slotted.selectors.map((ref) => ({
|
|
234166
|
+
orgSelector: replaceShadowCssHost(ref.orgSelector, hostScopeId),
|
|
234167
|
+
updatedSelector: replaceShadowCssHost(ref.updatedSelector, hostScopeId)
|
|
234168
|
+
}))
|
|
234169
|
+
};
|
|
234170
|
+
};
|
|
234171
|
+
var replaceShadowCssHost = (cssText, hostScopeId) => {
|
|
234172
|
+
return cssText.replace(/-shadowcsshost-no-combinator/g, `.${hostScopeId}`);
|
|
234173
|
+
};
|
|
234174
|
+
var scopeCss = (cssText, scopeId, commentOriginalSelector) => {
|
|
234175
|
+
const hostScopeId = scopeId + "-h";
|
|
234176
|
+
const slotScopeId = scopeId + "-s";
|
|
234177
|
+
const commentsWithHash = extractCommentsWithHash(cssText);
|
|
234178
|
+
cssText = stripComments(cssText);
|
|
234179
|
+
const orgSelectors = [];
|
|
234180
|
+
if (commentOriginalSelector) {
|
|
234181
|
+
const processCommentedSelector = (rule) => {
|
|
234182
|
+
const placeholder = `/*!@___${orgSelectors.length}___*/`;
|
|
234183
|
+
const comment = `/*!@${rule.selector}*/`;
|
|
234184
|
+
orgSelectors.push({ placeholder, comment });
|
|
234185
|
+
rule.selector = placeholder + rule.selector;
|
|
234186
|
+
return rule;
|
|
234187
|
+
};
|
|
234188
|
+
cssText = processRules(cssText, (rule) => {
|
|
234189
|
+
if (rule.selector[0] !== "@") {
|
|
234190
|
+
return processCommentedSelector(rule);
|
|
234191
|
+
} else if (rule.selector.startsWith("@media") || rule.selector.startsWith("@supports") || rule.selector.startsWith("@page") || rule.selector.startsWith("@document")) {
|
|
234192
|
+
rule.content = processRules(rule.content, processCommentedSelector);
|
|
234193
|
+
return rule;
|
|
234194
|
+
}
|
|
234195
|
+
return rule;
|
|
234196
|
+
});
|
|
234197
|
+
}
|
|
234198
|
+
const scoped = scopeCssText(cssText, scopeId, hostScopeId, slotScopeId, commentOriginalSelector);
|
|
234199
|
+
cssText = [scoped.cssText, ...commentsWithHash].join("\n");
|
|
234200
|
+
if (commentOriginalSelector) {
|
|
234201
|
+
orgSelectors.forEach(({ placeholder, comment }) => {
|
|
234202
|
+
cssText = cssText.replace(placeholder, comment);
|
|
234203
|
+
});
|
|
234204
|
+
}
|
|
234205
|
+
scoped.slottedSelectors.forEach((slottedSelector) => {
|
|
234206
|
+
const regex = new RegExp(escapeRegExpSpecialCharacters(slottedSelector.orgSelector), "g");
|
|
234207
|
+
cssText = cssText.replace(regex, slottedSelector.updatedSelector);
|
|
234208
|
+
});
|
|
234209
|
+
return cssText;
|
|
234210
|
+
};
|
|
234211
|
+
|
|
234212
|
+
// src/runtime/vdom/set-accessor.ts
|
|
234213
|
+
var CAPTURE_EVENT_SUFFIX = "Capture";
|
|
234214
|
+
var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
|
|
234215
|
+
|
|
233733
234216
|
// src/utils/sourcemaps.ts
|
|
233734
234217
|
function rollupToStencilSourceMap(rollupSourceMap) {
|
|
233735
234218
|
if (!rollupSourceMap || !rollupSourceMap.file) {
|
|
@@ -238508,11 +238991,11 @@ function getUnknownRequireProxy(id, requireReturnsDefault) {
|
|
|
238508
238991
|
const exported = requireReturnsDefault === "auto" ? `import { getDefaultExportFromNamespaceIfNotNamed } from "${HELPERS_ID}"; export default /*@__PURE__*/getDefaultExportFromNamespaceIfNotNamed(${name});` : requireReturnsDefault === "preferred" ? `import { getDefaultExportFromNamespaceIfPresent } from "${HELPERS_ID}"; export default /*@__PURE__*/getDefaultExportFromNamespaceIfPresent(${name});` : !requireReturnsDefault ? `import { getAugmentedNamespace } from "${HELPERS_ID}"; export default /*@__PURE__*/getAugmentedNamespace(${name});` : `export default ${name};`;
|
|
238509
238992
|
return `import * as ${name} from ${JSON.stringify(id)}; ${exported}`;
|
|
238510
238993
|
}
|
|
238511
|
-
async function getStaticRequireProxy(id, requireReturnsDefault,
|
|
238994
|
+
async function getStaticRequireProxy(id, requireReturnsDefault, loadModule2) {
|
|
238512
238995
|
const name = getName(id);
|
|
238513
238996
|
const {
|
|
238514
238997
|
meta: { commonjs: commonjsMeta }
|
|
238515
|
-
} = await
|
|
238998
|
+
} = await loadModule2({ id });
|
|
238516
238999
|
if (!commonjsMeta) {
|
|
238517
239000
|
return getUnknownRequireProxy(id, requireReturnsDefault);
|
|
238518
239001
|
}
|
|
@@ -238707,7 +239190,7 @@ function getRequireResolver(extensions, detectCyclesAndConditional, currentlyRes
|
|
|
238707
239190
|
knownCjsModuleTypes[id] = IS_WRAPPED_COMMONJS;
|
|
238708
239191
|
}
|
|
238709
239192
|
};
|
|
238710
|
-
const analyzeRequiredModule = async (parentId, resolved, isConditional,
|
|
239193
|
+
const analyzeRequiredModule = async (parentId, resolved, isConditional, loadModule2) => {
|
|
238711
239194
|
const childId = resolved.id;
|
|
238712
239195
|
requiredIds[childId] = true;
|
|
238713
239196
|
if (!(isConditional || knownCjsModuleTypes[parentId] === IS_WRAPPED_COMMONJS)) {
|
|
@@ -238715,16 +239198,16 @@ function getRequireResolver(extensions, detectCyclesAndConditional, currentlyRes
|
|
|
238715
239198
|
}
|
|
238716
239199
|
getDependencies2(parentId).add(childId);
|
|
238717
239200
|
if (!isCyclic(childId)) {
|
|
238718
|
-
await
|
|
239201
|
+
await loadModule2(resolved);
|
|
238719
239202
|
}
|
|
238720
239203
|
};
|
|
238721
|
-
const getTypeForImportedModule = async (resolved,
|
|
239204
|
+
const getTypeForImportedModule = async (resolved, loadModule2) => {
|
|
238722
239205
|
if (resolved.id in knownCjsModuleTypes) {
|
|
238723
239206
|
return knownCjsModuleTypes[resolved.id];
|
|
238724
239207
|
}
|
|
238725
239208
|
const {
|
|
238726
239209
|
meta: { commonjs: commonjs2 }
|
|
238727
|
-
} = await
|
|
239210
|
+
} = await loadModule2(resolved);
|
|
238728
239211
|
return commonjs2 && commonjs2.isCommonJS || false;
|
|
238729
239212
|
};
|
|
238730
239213
|
return {
|
|
@@ -241378,9 +241861,6 @@ var appendNamespace = (config, s) => {
|
|
|
241378
241861
|
// src/compiler/bundle/core-resolve-plugin.ts
|
|
241379
241862
|
var import_path14 = require("path");
|
|
241380
241863
|
|
|
241381
|
-
// src/runtime/runtime-constants.ts
|
|
241382
|
-
var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
|
|
241383
|
-
|
|
241384
241864
|
// src/compiler/sys/resolve/resolve-utils.ts
|
|
241385
241865
|
var COMMON_DIR_MODULE_EXTS = [".tsx", ".ts", ".mts", ".cts", ".mjs", ".js", ".cjs", ".jsx", ".json", ".md"];
|
|
241386
241866
|
var isCommonDirModuleFile = (p) => COMMON_DIR_MODULE_EXTS.some((ext2) => p.endsWith(ext2));
|
|
@@ -241646,19 +242126,19 @@ var getStencilInternalModule = (config, compilerExe, internalModule) => {
|
|
|
241646
242126
|
const compilerExeDir = (0, import_path14.dirname)(compilerExe);
|
|
241647
242127
|
return normalizePath(join(compilerExeDir, "..", "internal", internalModule));
|
|
241648
242128
|
};
|
|
241649
|
-
var getHydratedFlagHead = (
|
|
242129
|
+
var getHydratedFlagHead = (h2) => {
|
|
241650
242130
|
let initial;
|
|
241651
242131
|
let hydrated;
|
|
241652
|
-
if (!String(
|
|
242132
|
+
if (!String(h2.initialValue) || h2.initialValue === "" || h2.initialValue == null) {
|
|
241653
242133
|
initial = "";
|
|
241654
242134
|
} else {
|
|
241655
|
-
initial = `{${
|
|
242135
|
+
initial = `{${h2.property}:${h2.initialValue}}`;
|
|
241656
242136
|
}
|
|
241657
|
-
const selector =
|
|
241658
|
-
if (!String(
|
|
242137
|
+
const selector = h2.selector === "attribute" ? `[${h2.name}]` : `.${h2.name}`;
|
|
242138
|
+
if (!String(h2.hydratedValue) || h2.hydratedValue === "" || h2.hydratedValue == null) {
|
|
241659
242139
|
hydrated = "";
|
|
241660
242140
|
} else {
|
|
241661
|
-
hydrated = `${selector}{${
|
|
242141
|
+
hydrated = `${selector}{${h2.property}:${h2.hydratedValue}}`;
|
|
241662
242142
|
}
|
|
241663
242143
|
return initial + hydrated;
|
|
241664
242144
|
};
|
|
@@ -242326,7 +242806,7 @@ var runPluginTransformsEsmImports = async (config, compilerCtx, buildCtx, code,
|
|
|
242326
242806
|
};
|
|
242327
242807
|
|
|
242328
242808
|
// src/compiler/style/scope-css.ts
|
|
242329
|
-
var
|
|
242809
|
+
var getScopeId2 = (tagName, mode) => {
|
|
242330
242810
|
return "sc-" + tagName + (mode && mode !== DEFAULT_STYLE_MODE ? "-" + mode : "");
|
|
242331
242811
|
};
|
|
242332
242812
|
|
|
@@ -242449,7 +242929,7 @@ var extTransformsPlugin = (config, compilerCtx, buildCtx) => {
|
|
|
242449
242929
|
})
|
|
242450
242930
|
);
|
|
242451
242931
|
}
|
|
242452
|
-
const scopeId =
|
|
242932
|
+
const scopeId = getScopeId2(data.tag, data.mode);
|
|
242453
242933
|
if (!allCmpStyles.has(scopeId)) {
|
|
242454
242934
|
allCmpStyles.set(scopeId, /* @__PURE__ */ new Map());
|
|
242455
242935
|
}
|
|
@@ -244138,7 +244618,7 @@ function tokenizer(e, t, n3, i) {
|
|
|
244138
244618
|
function S(e2) {
|
|
244139
244619
|
js_error(e2, t, o.tokline, o.tokcol, o.tokpos);
|
|
244140
244620
|
}
|
|
244141
|
-
function
|
|
244621
|
+
function h2(e2) {
|
|
244142
244622
|
var t2 = false, n4 = false, i2 = false, o2 = "." == e2, a2 = false, u2 = false, c2 = function(e3) {
|
|
244143
244623
|
for (var t3, n5 = "", i3 = 0; (t3 = r()) && e3(t3, i3++); ) n5 += s();
|
|
244144
244624
|
return n5;
|
|
@@ -244336,7 +244816,7 @@ function tokenizer(e, t, n3, i) {
|
|
|
244336
244816
|
case 39:
|
|
244337
244817
|
return E();
|
|
244338
244818
|
case 46:
|
|
244339
|
-
return s(), is_digit(r().charCodeAt(0)) ?
|
|
244819
|
+
return s(), is_digit(r().charCodeAt(0)) ? h2(".") : "." === r() ? (s(), s(), d("expand", "...")) : d("punc", ".");
|
|
244340
244820
|
case 47:
|
|
244341
244821
|
var p2 = R();
|
|
244342
244822
|
if (p2 === F) continue;
|
|
@@ -244354,7 +244834,7 @@ function tokenizer(e, t, n3, i) {
|
|
|
244354
244834
|
case 125:
|
|
244355
244835
|
if (o.brace_counter--, o.template_braces.length > 0 && o.template_braces[o.template_braces.length - 1] === o.brace_counter) return b(false);
|
|
244356
244836
|
}
|
|
244357
|
-
if (is_digit(l2)) return
|
|
244837
|
+
if (is_digit(l2)) return h2();
|
|
244358
244838
|
if (PUNC_CHARS.has(t2)) return d("punc", s());
|
|
244359
244839
|
if (OPERATOR_CHARS.has(t2)) return k();
|
|
244360
244840
|
if (92 == l2 || is_identifier_start(t2)) return void 0, A2 = v(), f ? d("name", A2) : KEYWORDS_ATOM.has(A2) ? d("atom", A2) : KEYWORDS.has(A2) ? OPERATORS.has(A2) ? d("operator", A2) : d("keyword", A2) : d("name", A2);
|
|
@@ -244431,7 +244911,7 @@ function parse3(e, t) {
|
|
|
244431
244911
|
function S() {
|
|
244432
244912
|
return i.in_async === i.in_function || 0 === i.in_function && i.input.has_directive("use strict");
|
|
244433
244913
|
}
|
|
244434
|
-
function
|
|
244914
|
+
function h2(e2) {
|
|
244435
244915
|
o("punc", ";") ? a() : e2 || d() || l();
|
|
244436
244916
|
}
|
|
244437
244917
|
function A() {
|
|
@@ -244478,7 +244958,7 @@ function parse3(e, t) {
|
|
|
244478
244958
|
const u2 = Z();
|
|
244479
244959
|
return new AST_Import({ start: n5, imported_name: e3, imported_names: t2, module_name: new AST_String({ start: r2, value: r2.value, quote: r2.quote, end: r2 }), attributes: u2, end: i.token });
|
|
244480
244960
|
}();
|
|
244481
|
-
return
|
|
244961
|
+
return h2(), M2;
|
|
244482
244962
|
}
|
|
244483
244963
|
return is_token(r(), "punc", ":") ? b() : y();
|
|
244484
244964
|
case "punc":
|
|
@@ -244500,13 +244980,13 @@ function parse3(e, t) {
|
|
|
244500
244980
|
case "continue":
|
|
244501
244981
|
return a(), D(AST_Continue);
|
|
244502
244982
|
case "debugger":
|
|
244503
|
-
return a(),
|
|
244983
|
+
return a(), h2(), new AST_Debugger();
|
|
244504
244984
|
case "do":
|
|
244505
244985
|
a();
|
|
244506
244986
|
var x2 = Te(e2);
|
|
244507
244987
|
_("keyword", "while");
|
|
244508
244988
|
var B2 = A();
|
|
244509
|
-
return
|
|
244989
|
+
return h2(true), new AST_Do({ body: x2, condition: B2 });
|
|
244510
244990
|
case "while":
|
|
244511
244991
|
return a(), new AST_While({ condition: A(), body: Te(function() {
|
|
244512
244992
|
return e2(false, true);
|
|
@@ -244533,11 +245013,11 @@ function parse3(e, t) {
|
|
|
244533
245013
|
case "return":
|
|
244534
245014
|
0 != i.in_function || t.bare_returns || u("'return' outside of function"), a();
|
|
244535
245015
|
var G2 = null;
|
|
244536
|
-
return o("punc", ";") ? a() : d() || (G2 = Ae(true),
|
|
245016
|
+
return o("punc", ";") ? a() : d() || (G2 = Ae(true), h2()), new AST_Return({ value: G2 });
|
|
244537
245017
|
case "switch":
|
|
244538
245018
|
return a(), new AST_Switch({ expression: A(), body: Te(P) });
|
|
244539
245019
|
case "throw":
|
|
244540
|
-
return a(), p(i.token) && u("Illegal newline after 'throw'"), G2 = Ae(true),
|
|
245020
|
+
return a(), p(i.token) && u("Illegal newline after 'throw'"), G2 = Ae(true), h2(), new AST_Throw({ value: G2 });
|
|
244541
245021
|
case "try":
|
|
244542
245022
|
return a(), function() {
|
|
244543
245023
|
var e3, t2 = null, n5 = null;
|
|
@@ -244550,15 +245030,15 @@ function parse3(e, t) {
|
|
|
244550
245030
|
return o("keyword", "finally") && (r2 = i.token, a(), n5 = new AST_Finally({ start: r2, body: I(), end: s() })), t2 || n5 || u("Missing catch/finally blocks"), new AST_Try({ body: e3, bcatch: t2, bfinally: n5 });
|
|
244551
245031
|
}();
|
|
244552
245032
|
case "var":
|
|
244553
|
-
return a(), M2 = L(),
|
|
245033
|
+
return a(), M2 = L(), h2(), M2;
|
|
244554
245034
|
case "let":
|
|
244555
|
-
return a(), M2 = V(),
|
|
245035
|
+
return a(), M2 = V(), h2(), M2;
|
|
244556
245036
|
case "const":
|
|
244557
|
-
return a(), M2 = U(),
|
|
245037
|
+
return a(), M2 = U(), h2(), M2;
|
|
244558
245038
|
case "with":
|
|
244559
245039
|
return i.input.has_directive("use strict") && u("Strict mode may not include a with statement"), a(), new AST_With({ expression: A(), body: e2() });
|
|
244560
245040
|
case "export":
|
|
244561
|
-
if (!is_token(r(), "punc", "(")) return a(), M2 = te(), o("punc", ";") &&
|
|
245041
|
+
if (!is_token(r(), "punc", "(")) return a(), M2 = te(), o("punc", ";") && h2(), M2;
|
|
244562
245042
|
}
|
|
244563
245043
|
}
|
|
244564
245044
|
l();
|
|
@@ -244572,11 +245052,11 @@ function parse3(e, t) {
|
|
|
244572
245052
|
}), new AST_LabeledStatement({ body: t2, label: e2 });
|
|
244573
245053
|
}
|
|
244574
245054
|
function y(e2) {
|
|
244575
|
-
return new AST_SimpleStatement({ body: (e2 = Ae(true),
|
|
245055
|
+
return new AST_SimpleStatement({ body: (e2 = Ae(true), h2(), e2) });
|
|
244576
245056
|
}
|
|
244577
245057
|
function D(e2) {
|
|
244578
245058
|
var t2, n4 = null;
|
|
244579
|
-
d() || (n4 = ae(AST_LabelRef, true)), null != n4 ? ((t2 = i.labels.find((e3) => e3.name === n4.name)) || u("Undefined label " + n4.name), n4.thedef = t2) : 0 == i.in_loop && u(e2.TYPE + " not inside a loop or switch"),
|
|
245059
|
+
d() || (n4 = ae(AST_LabelRef, true)), null != n4 ? ((t2 = i.labels.find((e3) => e3.name === n4.name)) || u("Undefined label " + n4.name), n4.thedef = t2) : 0 == i.in_loop && u(e2.TYPE + " not inside a loop or switch"), h2();
|
|
244580
245060
|
var o2 = new e2({ label: n4 });
|
|
244581
245061
|
return t2 && t2.references.push(o2), o2;
|
|
244582
245062
|
}
|
|
@@ -244683,8 +245163,8 @@ function parse3(e, t) {
|
|
|
244683
245163
|
p2 ? c2.push(new AST_Expansion({ start: n4, expression: S2, end: S2.end })) : c2.push(new AST_ObjectKeyVal({ start: m2, key: S2.name, value: S2, end: S2.end }));
|
|
244684
245164
|
} else {
|
|
244685
245165
|
if (o("punc", "}")) continue;
|
|
244686
|
-
var
|
|
244687
|
-
null === A2 ? l(s()) : "name" !== s().type || o("punc", ":") ? (f(":"), c2.push(new AST_ObjectKeyVal({ start:
|
|
245166
|
+
var h3 = i.token, A2 = ne();
|
|
245167
|
+
null === A2 ? l(s()) : "name" !== s().type || o("punc", ":") ? (f(":"), c2.push(new AST_ObjectKeyVal({ start: h3, quote: h3.quote, key: A2, value: M(e2, t2), end: s() }))) : c2.push(new AST_ObjectKeyVal({ start: s(), key: A2, value: new t2({ start: s(), name: A2, end: s() }), end: s() }));
|
|
244688
245168
|
}
|
|
244689
245169
|
p2 ? o("punc", "}") || u("Rest element must be last element") : o("operator", "=") && (e2.mark_default_assignment(i.token), a(), c2[c2.length - 1].value = new AST_DefaultAssign({ start: c2[c2.length - 1].value.start, left: c2[c2.length - 1].value, operator: "=", right: Ae(false), end: i.token }));
|
|
244690
245170
|
}
|
|
@@ -244777,11 +245257,11 @@ function parse3(e, t) {
|
|
|
244777
245257
|
};
|
|
244778
245258
|
return e2 instanceof AST_Object ? n4(new AST_Destructuring({ start: e2.start, end: e2.end, is_array: false, names: e2.properties.map((e3) => K(e3)) }), t2) : e2 instanceof AST_ObjectKeyVal ? (e2.value = K(e2.value), n4(e2, t2)) : e2 instanceof AST_Hole ? e2 : e2 instanceof AST_Destructuring ? (e2.names = e2.names.map((e3) => K(e3)), n4(e2, t2)) : e2 instanceof AST_SymbolRef ? n4(new AST_SymbolFunarg({ name: e2.name, start: e2.start, end: e2.end }), t2) : e2 instanceof AST_Expansion ? (e2.expression = K(e2.expression), n4(e2, t2)) : e2 instanceof AST_Array ? n4(new AST_Destructuring({ start: e2.start, end: e2.end, is_array: true, names: e2.elements.map((e3) => K(e3)) }), t2) : e2 instanceof AST_Assign ? n4(K(e2.left, e2.right), t2) : e2 instanceof AST_DefaultAssign ? (e2.left = K(e2.left), e2) : void u("Invalid function parameter", e2.start.line, e2.start.col);
|
|
244779
245259
|
}
|
|
244780
|
-
var
|
|
245260
|
+
var H3 = function(e2, t2) {
|
|
244781
245261
|
if (o("operator", "new")) return function(e3) {
|
|
244782
245262
|
var t3 = i.token;
|
|
244783
245263
|
if (_("operator", "new"), o("punc", ".")) return a(), _("name", "target"), ue(new AST_NewTarget({ start: t3, end: s() }), e3);
|
|
244784
|
-
var n4, r2 =
|
|
245264
|
+
var n4, r2 = H3(false);
|
|
244785
245265
|
o("punc", "(") ? (a(), n4 = X(")", true)) : n4 = [];
|
|
244786
245266
|
var u3 = new AST_New({ start: t3, expression: r2, args: n4, end: s() });
|
|
244787
245267
|
return se(u3), ue(u3, e3);
|
|
@@ -244811,8 +245291,8 @@ function parse3(e, t) {
|
|
|
244811
245291
|
c2.comments_after = m2.start.comments_after;
|
|
244812
245292
|
}
|
|
244813
245293
|
m2.start = c2;
|
|
244814
|
-
var
|
|
244815
|
-
return m2.end && (
|
|
245294
|
+
var h3 = s();
|
|
245295
|
+
return m2.end && (h3.comments_before = m2.end.comments_before, m2.end.comments_after.push(...h3.comments_after), h3.comments_after = m2.end.comments_after), m2.end = h3, m2 instanceof AST_Call && se(m2), ue(m2, e2);
|
|
244816
245296
|
case "[":
|
|
244817
245297
|
return ue(W(), e2);
|
|
244818
245298
|
case "{":
|
|
@@ -244955,7 +245435,7 @@ function parse3(e, t) {
|
|
|
244955
245435
|
}
|
|
244956
245436
|
return new AST_Export({ start: _2, is_default: e2, exported_names: t2, end: s() });
|
|
244957
245437
|
}
|
|
244958
|
-
return o("punc", "{") || e2 && (o("keyword", "class") || o("keyword", "function")) && is_token(r(), "punc") ? (u2 = Ae(false),
|
|
245438
|
+
return o("punc", "{") || e2 && (o("keyword", "class") || o("keyword", "function")) && is_token(r(), "punc") ? (u2 = Ae(false), h2()) : (n4 = E(e2)) instanceof AST_Definitions && e2 ? l(n4.start) : n4 instanceof AST_Definitions || n4 instanceof AST_Defun || n4 instanceof AST_DefClass ? c2 = n4 : n4 instanceof AST_ClassExpression || n4 instanceof AST_Function ? u2 = n4 : n4 instanceof AST_SimpleStatement ? u2 = n4.body : l(n4.start), new AST_Export({ start: _2, is_default: e2, exported_value: u2, exported_definition: c2, end: s(), attributes: null });
|
|
244959
245439
|
}
|
|
244960
245440
|
function ne() {
|
|
244961
245441
|
var e2 = i.token;
|
|
@@ -245077,7 +245557,7 @@ function parse3(e, t) {
|
|
|
245077
245557
|
var r2 = _e(AST_UnaryPrefix, n4, le(e2));
|
|
245078
245558
|
return r2.start = n4, r2.end = s(), r2;
|
|
245079
245559
|
}
|
|
245080
|
-
for (var c2 =
|
|
245560
|
+
for (var c2 = H3(e2, t2); o("operator") && UNARY_POSTFIX.has(i.token.value) && !p(i.token); ) c2 instanceof AST_Arrow && l(), (c2 = _e(AST_UnaryPostfix, i.token, c2)).start = n4, c2.end = i.token, a();
|
|
245081
245561
|
return c2;
|
|
245082
245562
|
};
|
|
245083
245563
|
function _e(e2, t2, n4) {
|
|
@@ -246751,7 +247231,7 @@ function OutputStream(e) {
|
|
|
246751
247231
|
}(t2, n4);
|
|
246752
247232
|
return e.inline_script && (i2 = (i2 = (i2 = i2.replace(/<\x2f(script)([>\/\t\n\f\r ])/gi, "<\\/$1$2")).replace(/\x3c!--/g, "\\x3c!--")).replace(/--\x3e/g, "--\\x3e")), i2;
|
|
246753
247233
|
}
|
|
246754
|
-
var f, p, d = false, m = false, S = false,
|
|
247234
|
+
var f, p, d = false, m = false, S = false, h2 = 0, A = false, T = false, g = -1, E = "", b = e.source_map && [], y = b ? function() {
|
|
246755
247235
|
b.forEach(function(t2) {
|
|
246756
247236
|
try {
|
|
246757
247237
|
let { name: n4, token: i2 } = t2;
|
|
@@ -246760,9 +247240,9 @@ function OutputStream(e) {
|
|
|
246760
247240
|
}
|
|
246761
247241
|
}), b = [];
|
|
246762
247242
|
} : noop2, D = e.max_line_len ? function() {
|
|
246763
|
-
if (r > e.max_line_len &&
|
|
246764
|
-
u.insertAt("\n",
|
|
246765
|
-
const e2 = u.length() -
|
|
247243
|
+
if (r > e.max_line_len && h2) {
|
|
247244
|
+
u.insertAt("\n", h2);
|
|
247245
|
+
const e2 = u.length() - h2 - 1;
|
|
246766
247246
|
if (b) {
|
|
246767
247247
|
var t2 = e2 - r;
|
|
246768
247248
|
b.forEach(function(e3) {
|
|
@@ -246771,13 +247251,13 @@ function OutputStream(e) {
|
|
|
246771
247251
|
}
|
|
246772
247252
|
a++, s++, r = e2;
|
|
246773
247253
|
}
|
|
246774
|
-
|
|
247254
|
+
h2 && (h2 = 0, y());
|
|
246775
247255
|
} : noop2, v = makePredicate("( [ + * / - , . `");
|
|
246776
247256
|
function C2(t2) {
|
|
246777
247257
|
var n4 = get_full_char(t2 = String(t2), 0);
|
|
246778
247258
|
A && n4 && (A = false, "\n" !== n4 && (C2("\n"), R())), T && n4 && (T = false, /[\s;})]/.test(n4) || k()), g = -1;
|
|
246779
247259
|
var i2 = E.charAt(E.length - 1);
|
|
246780
|
-
S && (S = false, (":" !== i2 || "}" !== n4) && (n4 && ";}".includes(n4) || ";" === i2) || (e.semicolons || v.has(n4) ? (u.append(";"), r++, s++) : (D(), r > 0 && (u.append("\n"), s++, a++, r = 0), /^\s+$/.test(t2) && (S = true)), e.beautify || (m = false))), m && ((is_identifier_char(i2) && (is_identifier_char(n4) || "\\" == n4) || "/" == n4 && n4 == i2 || ("+" == n4 || "-" == n4) && n4 == E) && (u.append(" "), r++, s++), m = false), f && (b.push({ token: f, name: p, line: a, col: r }), f = false,
|
|
247260
|
+
S && (S = false, (":" !== i2 || "}" !== n4) && (n4 && ";}".includes(n4) || ";" === i2) || (e.semicolons || v.has(n4) ? (u.append(";"), r++, s++) : (D(), r > 0 && (u.append("\n"), s++, a++, r = 0), /^\s+$/.test(t2) && (S = true)), e.beautify || (m = false))), m && ((is_identifier_char(i2) && (is_identifier_char(n4) || "\\" == n4) || "/" == n4 && n4 == i2 || ("+" == n4 || "-" == n4) && n4 == E) && (u.append(" "), r++, s++), m = false), f && (b.push({ token: f, name: p, line: a, col: r }), f = false, h2 || y()), u.append(t2), d = "(" == t2[t2.length - 1], s += t2.length;
|
|
246781
247261
|
var o2 = t2.split(/\r?\n/), c2 = o2.length - 1;
|
|
246782
247262
|
a += c2, r += o2[0].length, c2 > 0 && (D(), r = o2[c2].length), E = t2;
|
|
246783
247263
|
}
|
|
@@ -246800,7 +247280,7 @@ function OutputStream(e) {
|
|
|
246800
247280
|
if (g < 0) return C2("\n");
|
|
246801
247281
|
"\n" != u.charAt(g) && (u.insertAt("\n", g), s++, a++), g++;
|
|
246802
247282
|
} : e.max_line_len ? function() {
|
|
246803
|
-
D(),
|
|
247283
|
+
D(), h2 = u.length();
|
|
246804
247284
|
} : noop2, N = e.beautify ? function() {
|
|
246805
247285
|
C2(";");
|
|
246806
247286
|
} : function() {
|
|
@@ -246816,7 +247296,7 @@ function OutputStream(e) {
|
|
|
246816
247296
|
f = e2, p = t2;
|
|
246817
247297
|
} : noop2;
|
|
246818
247298
|
function I() {
|
|
246819
|
-
return
|
|
247299
|
+
return h2 && D(), u.toString();
|
|
246820
247300
|
}
|
|
246821
247301
|
function P(t2) {
|
|
246822
247302
|
return e.preserve_annotations || (t2 = t2.replace(r_annotation, " ")), /^\s*$/.test(t2) ? "" : t2.replace(/(<\s*\/\s*)(script)/i, "<\\/$2");
|
|
@@ -248992,9 +249472,9 @@ AST_Scope.DEFMETHOD("drop_unused", function(e) {
|
|
|
248992
249472
|
}
|
|
248993
249473
|
}
|
|
248994
249474
|
if (c === t) {
|
|
248995
|
-
if (u2.name && (u2 instanceof AST_ClassExpression && !keep_name(e.option("keep_classnames"), (d = u2.name.definition()).name) || u2 instanceof AST_Function && !keep_name(e.option("keep_fnames"), (d = u2.name.definition()).name)) && (!r.has(d.id) || d.orig.length > 1) && (u2.name = null), u2 instanceof AST_Lambda && !(u2 instanceof AST_Accessor)) for (var S = !e.option("keep_fargs") || p instanceof AST_Call && p.expression === u2 && !u2.pinned() && (!u2.name || u2.name.unreferenced()),
|
|
248996
|
-
var T =
|
|
248997
|
-
T instanceof AST_Expansion && (T = T.expression), T instanceof AST_DefaultAssign && (T = T.left), T instanceof AST_Destructuring || r.has(T.definition().id) ? S = false : (set_flag(T, 1), S &&
|
|
249475
|
+
if (u2.name && (u2 instanceof AST_ClassExpression && !keep_name(e.option("keep_classnames"), (d = u2.name.definition()).name) || u2 instanceof AST_Function && !keep_name(e.option("keep_fnames"), (d = u2.name.definition()).name)) && (!r.has(d.id) || d.orig.length > 1) && (u2.name = null), u2 instanceof AST_Lambda && !(u2 instanceof AST_Accessor)) for (var S = !e.option("keep_fargs") || p instanceof AST_Call && p.expression === u2 && !u2.pinned() && (!u2.name || u2.name.unreferenced()), h2 = u2.argnames, A = h2.length; --A >= 0; ) {
|
|
249476
|
+
var T = h2[A];
|
|
249477
|
+
T instanceof AST_Expansion && (T = T.expression), T instanceof AST_DefaultAssign && (T = T.left), T instanceof AST_Destructuring || r.has(T.definition().id) ? S = false : (set_flag(T, 1), S && h2.pop());
|
|
248998
249478
|
}
|
|
248999
249479
|
if (u2 instanceof AST_DefClass && u2 !== t) {
|
|
249000
249480
|
const t2 = u2.name.definition();
|
|
@@ -249181,7 +249661,7 @@ function tighten_body(e, t) {
|
|
|
249181
249661
|
}();
|
|
249182
249662
|
var a, s = 10;
|
|
249183
249663
|
do {
|
|
249184
|
-
a = false, c(e), t.option("dead_code") && _(e, t), t.option("if_return") && l(e, t), t.sequences_limit > 0 && (p(e, t), m(e, t)), t.option("join_vars") &&
|
|
249664
|
+
a = false, c(e), t.option("dead_code") && _(e, t), t.option("if_return") && l(e, t), t.sequences_limit > 0 && (p(e, t), m(e, t)), t.option("join_vars") && h2(e), t.option("collapse_vars") && u(e, t);
|
|
249185
249665
|
} while (a && s-- > 0);
|
|
249186
249666
|
function u(e2, t2) {
|
|
249187
249667
|
if (n3.pinned() || i.pinned()) return e2;
|
|
@@ -249190,7 +249670,7 @@ function tighten_body(e, t) {
|
|
|
249190
249670
|
if (!v) return e3 !== f2[p2] ? e3 : ++p2 < f2.length ? M(e3) : (v = true, (S2 = B(e3, 0)) === e3 && (C2 = true), e3);
|
|
249191
249671
|
var i2, o2 = l2.parent();
|
|
249192
249672
|
if (e3 instanceof AST_Assign && (e3.logical || "=" != e3.operator && A.equivalent_to(e3.left)) || e3 instanceof AST_Await || e3 instanceof AST_Call && A instanceof AST_PropAccess && A.equivalent_to(e3.expression) || (e3 instanceof AST_Call || e3 instanceof AST_PropAccess) && e3.optional || e3 instanceof AST_Debugger || e3 instanceof AST_Destructuring || e3 instanceof AST_Expansion && e3.expression instanceof AST_Symbol && (e3.expression instanceof AST_This || e3.expression.definition().references.length > 1) || e3 instanceof AST_IterationStatement && !(e3 instanceof AST_For) || e3 instanceof AST_LoopControl || e3 instanceof AST_Try || e3 instanceof AST_With || e3 instanceof AST_Yield || e3 instanceof AST_Export || e3 instanceof AST_Class || o2 instanceof AST_For && e3 !== o2.init || !b && e3 instanceof AST_SymbolRef && !e3.is_declared(t2) && !pure_prop_access_globals.has(e3) || e3 instanceof AST_SymbolRef && o2 instanceof AST_Call && has_annotation(o2, _NOINLINE) || e3 instanceof AST_ObjectProperty && e3.key instanceof AST_Node) return C2 = true, e3;
|
|
249193
|
-
if (
|
|
249673
|
+
if (h3 || g && b || !(o2 instanceof AST_Binary && lazy_op.has(o2.operator) && o2.left !== e3 || o2 instanceof AST_Conditional && o2.condition !== e3 || o2 instanceof AST_If && o2.condition !== e3) || (h3 = o2), R && !(e3 instanceof AST_SymbolDeclaration) && A.equivalent_to(e3) && !function(e4, t3) {
|
|
249194
249674
|
for (const { def: n4 } of t3.values()) {
|
|
249195
249675
|
const t4 = e4.find_variable(n4.name);
|
|
249196
249676
|
if (t4) {
|
|
@@ -249200,7 +249680,7 @@ function tighten_body(e, t) {
|
|
|
249200
249680
|
}
|
|
249201
249681
|
return false;
|
|
249202
249682
|
}(l2.find_scope() || n3, T)) {
|
|
249203
|
-
if (
|
|
249683
|
+
if (h3) return C2 = true, e3;
|
|
249204
249684
|
if (is_lhs(e3, o2)) return m2 && k++, e3;
|
|
249205
249685
|
if (k++, m2 && d2 instanceof AST_VarDef) return e3;
|
|
249206
249686
|
if (a = C2 = true, d2 instanceof AST_UnaryPostfix) return make_node(AST_UnaryPrefix, d2, d2);
|
|
@@ -249212,7 +249692,7 @@ function tighten_body(e, t) {
|
|
|
249212
249692
|
}
|
|
249213
249693
|
return (e3 instanceof AST_Call || e3 instanceof AST_Exit && (E || A instanceof AST_PropAccess || z(A)) || e3 instanceof AST_PropAccess && (E || e3.expression.may_throw_on_access(t2)) || e3 instanceof AST_SymbolRef && (T.has(e3.name) && T.get(e3.name).modified || E && z(e3)) || e3 instanceof AST_VarDef && e3.value && (T.has(e3.name.name) || E && z(e3.name)) || (i2 = is_lhs(e3.left, e3)) && (i2 instanceof AST_PropAccess || T.has(i2.name)) || y && (r ? e3.has_side_effects(t2) : X(e3))) && (S2 = e3, e3 instanceof AST_Scope && (C2 = true)), M(e3);
|
|
249214
249694
|
}, function(e3) {
|
|
249215
|
-
C2 || (S2 === e3 && (C2 = true),
|
|
249695
|
+
C2 || (S2 === e3 && (C2 = true), h3 === e3 && (h3 = null));
|
|
249216
249696
|
}), _2 = new TreeTransformer(function(e3) {
|
|
249217
249697
|
if (C2) return e3;
|
|
249218
249698
|
if (!v) {
|
|
@@ -249226,11 +249706,11 @@ function tighten_body(e, t) {
|
|
|
249226
249706
|
var f2 = [];
|
|
249227
249707
|
for (P(e2[c2]); u2.length > 0; ) {
|
|
249228
249708
|
f2 = u2.pop();
|
|
249229
|
-
var p2 = 0, d2 = f2[f2.length - 1], m2 = null, S2 = null,
|
|
249709
|
+
var p2 = 0, d2 = f2[f2.length - 1], m2 = null, S2 = null, h3 = null, A = L(d2);
|
|
249230
249710
|
if (A && !is_lhs_read_only(A) && !A.has_side_effects(t2)) {
|
|
249231
249711
|
var T = U(d2), g = K(A);
|
|
249232
249712
|
A instanceof AST_SymbolRef && T.set(A.name, { def: A.definition(), modified: false });
|
|
249233
|
-
var E = (N = d2) instanceof AST_Unary ? unary_side_effects.has(N.operator) : V(N).has_side_effects(t2), b =
|
|
249713
|
+
var E = (N = d2) instanceof AST_Unary ? unary_side_effects.has(N.operator) : V(N).has_side_effects(t2), b = H3(), y = d2.may_throw(t2), D = d2.name instanceof AST_SymbolFunarg, v = D, C2 = false, k = 0, R = !s2 || !v;
|
|
249234
249714
|
if (!R) {
|
|
249235
249715
|
for (let e3 = t2.self().argnames.lastIndexOf(d2.name) + 1; !C2 && e3 < s2.length; e3++) s2[e3].transform(l2);
|
|
249236
249716
|
R = true;
|
|
@@ -249389,7 +249869,7 @@ function tighten_body(e, t) {
|
|
|
249389
249869
|
for (; e3 instanceof AST_PropAccess; ) e3 = e3.expression;
|
|
249390
249870
|
return e3 instanceof AST_SymbolRef && e3.definition().scope.get_defun_scope() === i && !(o && (T.has(e3.name) || d2 instanceof AST_Unary || d2 instanceof AST_Assign && !d2.logical && "=" != d2.operator));
|
|
249391
249871
|
}
|
|
249392
|
-
function
|
|
249872
|
+
function H3() {
|
|
249393
249873
|
if (E) return false;
|
|
249394
249874
|
if (m2) return true;
|
|
249395
249875
|
if (A instanceof AST_SymbolRef) {
|
|
@@ -249465,7 +249945,7 @@ function tighten_body(e, t) {
|
|
|
249465
249945
|
a = true, (s2 = s2.clone()).alternative = c2 || make_node(AST_Return, s2, { value: null }), e2[r2] = s2.transform(t2), c2 && e2.splice(u2, 1);
|
|
249466
249946
|
continue;
|
|
249467
249947
|
}
|
|
249468
|
-
var _2 = e2[
|
|
249948
|
+
var _2 = e2[h3(r2)];
|
|
249469
249949
|
if (t2.option("sequences") && o2 && !s2.alternative && _2 instanceof AST_If && _2.body instanceof AST_Return && S2(u2) == e2.length && c2 instanceof AST_SimpleStatement) {
|
|
249470
249950
|
a = true, (s2 = s2.clone()).alternative = make_node(AST_BlockStatement, c2, { body: [c2, make_node(AST_Return, c2, { value: null })] }), e2[r2] = s2.transform(t2), e2.splice(u2, 1);
|
|
249471
249951
|
continue;
|
|
@@ -249500,7 +249980,7 @@ function tighten_body(e, t) {
|
|
|
249500
249980
|
}
|
|
249501
249981
|
return n5;
|
|
249502
249982
|
}
|
|
249503
|
-
function
|
|
249983
|
+
function h3(t3) {
|
|
249504
249984
|
for (var n5 = t3; --n5 >= 0; ) {
|
|
249505
249985
|
var i3 = e2[n5];
|
|
249506
249986
|
if (!(i3 instanceof AST_Var && f(i3))) break;
|
|
@@ -249610,7 +250090,7 @@ function tighten_body(e, t) {
|
|
|
249610
250090
|
}
|
|
249611
250091
|
}
|
|
249612
250092
|
}
|
|
249613
|
-
function
|
|
250093
|
+
function h2(e2) {
|
|
249614
250094
|
for (var t2, n4 = 0, i2 = -1, o2 = e2.length; n4 < o2; n4++) {
|
|
249615
250095
|
var r2 = e2[n4], s2 = e2[i2];
|
|
249616
250096
|
if (r2 instanceof AST_Definitions) s2 && s2.TYPE == r2.TYPE ? (s2.definitions = s2.definitions.concat(r2.definitions), a = true) : t2 && t2.TYPE == r2.TYPE && f(r2) ? (t2.definitions = t2.definitions.concat(r2.definitions), a = true) : (e2[++i2] = r2, t2 = r2);
|
|
@@ -250401,7 +250881,7 @@ def_optimize(AST_Directive, function(e, t) {
|
|
|
250401
250881
|
let n4, i2 = u.findIndex((e2) => !T(e2));
|
|
250402
250882
|
if (i2 === u.length - 1) {
|
|
250403
250883
|
let t2 = u[i2];
|
|
250404
|
-
if (
|
|
250884
|
+
if (h2(e)) break e;
|
|
250405
250885
|
n4 = make_node(AST_BlockStatement, t2, { body: t2.body }), t2.body = [];
|
|
250406
250886
|
} else if (-1 !== i2) break e;
|
|
250407
250887
|
let o2 = u.find((e2) => e2 !== p && e2.expression.has_side_effects(t));
|
|
@@ -250410,11 +250890,11 @@ def_optimize(AST_Directive, function(e, t) {
|
|
|
250410
250890
|
if (u.splice(r2, 1), p = null, n4) return make_node(AST_BlockStatement, e, { body: s.concat(e, n4) }).optimize(t);
|
|
250411
250891
|
}
|
|
250412
250892
|
if (u.length > 0 && (u[0].body = s.concat(u[0].body)), 0 == u.length) return make_node(AST_BlockStatement, e, { body: s.concat(S(e.expression)) }).optimize(t);
|
|
250413
|
-
if (1 == u.length && !
|
|
250893
|
+
if (1 == u.length && !h2(e)) {
|
|
250414
250894
|
let n4 = u[0];
|
|
250415
250895
|
return make_node(AST_If, e, { condition: make_node(AST_Binary, e, { operator: "===", left: e.expression, right: n4.expression }), body: make_node(AST_BlockStatement, n4, { body: n4.body }), alternative: null }).optimize(t);
|
|
250416
250896
|
}
|
|
250417
|
-
if (2 === u.length && p && !
|
|
250897
|
+
if (2 === u.length && p && !h2(e)) {
|
|
250418
250898
|
let n4 = u[0] === p ? u[1] : u[0], i2 = p.expression && S(p.expression);
|
|
250419
250899
|
if (aborts(u[0])) {
|
|
250420
250900
|
let o3 = u[0];
|
|
@@ -250441,7 +250921,7 @@ def_optimize(AST_Directive, function(e, t) {
|
|
|
250441
250921
|
function S(e2) {
|
|
250442
250922
|
return make_node(AST_SimpleStatement, e2, { body: e2 });
|
|
250443
250923
|
}
|
|
250444
|
-
function
|
|
250924
|
+
function h2(e2) {
|
|
250445
250925
|
let t2 = false, n4 = new TreeWalker((e3) => {
|
|
250446
250926
|
if (t2) return true;
|
|
250447
250927
|
if (e3 instanceof AST_Lambda) return true;
|
|
@@ -250562,10 +251042,10 @@ def_optimize(AST_Directive, function(e, t) {
|
|
|
250562
251042
|
if (!(e.args.length > 0 && (f = e.args[0].evaluate(t)) === e.args[0])) {
|
|
250563
251043
|
var p, d, m = [], S = [];
|
|
250564
251044
|
for (u = 0, c = n3.expression.elements.length; u < c; u++) {
|
|
250565
|
-
var
|
|
250566
|
-
if (
|
|
250567
|
-
var A =
|
|
250568
|
-
A !==
|
|
251045
|
+
var h2 = n3.expression.elements[u];
|
|
251046
|
+
if (h2 instanceof AST_Expansion) break e;
|
|
251047
|
+
var A = h2.evaluate(t);
|
|
251048
|
+
A !== h2 ? S.push(A) : (S.length > 0 && (m.push(make_node(AST_String, e, { value: S.join(f) })), S.length = 0), m.push(h2));
|
|
250569
251049
|
}
|
|
250570
251050
|
return S.length > 0 && m.push(make_node(AST_String, e, { value: S.join(f) })), 0 == m.length ? make_node(AST_String, e, { value: "" }) : 1 == m.length ? m[0].is_string(t) ? m[0] : make_node(AST_Binary, m[0], { operator: "+", left: make_node(AST_String, e, { value: "" }), right: m[0] }) : "" == f ? (p = m[0].is_string(t) || m[1].is_string(t) ? m.shift() : make_node(AST_String, e, { value: "" }), m.reduce(function(e2, t2) {
|
|
250571
251051
|
return make_node(AST_Binary, t2, { operator: "+", left: e2, right: t2 });
|
|
@@ -250798,15 +251278,15 @@ def_optimize(AST_Binary, function(e, t) {
|
|
|
250798
251278
|
break;
|
|
250799
251279
|
}
|
|
250800
251280
|
if (e.left instanceof AST_TemplateString) {
|
|
250801
|
-
var
|
|
250802
|
-
if ((d = e.right.evaluate(t)) != e.right) return
|
|
251281
|
+
var h2 = e.left;
|
|
251282
|
+
if ((d = e.right.evaluate(t)) != e.right) return h2.segments[h2.segments.length - 1].value += String(d), h2;
|
|
250803
251283
|
}
|
|
250804
|
-
if (e.right instanceof AST_TemplateString && (d = e.right, (
|
|
251284
|
+
if (e.right instanceof AST_TemplateString && (d = e.right, (h2 = e.left.evaluate(t)) != e.left)) return d.segments[0].value = String(h2) + d.segments[0].value, d;
|
|
250805
251285
|
if (e.left instanceof AST_TemplateString && e.right instanceof AST_TemplateString) {
|
|
250806
|
-
var A = (
|
|
251286
|
+
var A = (h2 = e.left).segments;
|
|
250807
251287
|
d = e.right, A[A.length - 1].value += d.segments[0].value;
|
|
250808
251288
|
for (var T = 1; T < d.segments.length; T++) A.push(d.segments[T]);
|
|
250809
|
-
return
|
|
251289
|
+
return h2;
|
|
250810
251290
|
}
|
|
250811
251291
|
case "*":
|
|
250812
251292
|
p = t.option("unsafe_math");
|
|
@@ -251095,16 +251575,16 @@ def_optimize(AST_Assign, function(e, t) {
|
|
|
251095
251575
|
}
|
|
251096
251576
|
if (t.option("properties") && t.option("side_effects") && o instanceof AST_Number && i instanceof AST_Array) {
|
|
251097
251577
|
s = o.getValue();
|
|
251098
|
-
var S = i.elements,
|
|
251099
|
-
e: if (safe_to_flatten(
|
|
251578
|
+
var S = i.elements, h2 = S[s];
|
|
251579
|
+
e: if (safe_to_flatten(h2, t)) {
|
|
251100
251580
|
for (var A = true, T = [], g = S.length; --g > s; ) (E = S[g].drop_side_effect_free(t)) && (T.unshift(E), A && E.has_side_effects(t) && (A = false));
|
|
251101
|
-
if (
|
|
251102
|
-
for (
|
|
251581
|
+
if (h2 instanceof AST_Expansion) break e;
|
|
251582
|
+
for (h2 = h2 instanceof AST_Hole ? make_node(AST_Undefined, h2) : h2, A || T.unshift(h2); --g >= 0; ) {
|
|
251103
251583
|
var E;
|
|
251104
251584
|
if ((E = S[g]) instanceof AST_Expansion) break e;
|
|
251105
251585
|
(E = E.drop_side_effect_free(t)) ? T.unshift(E) : s--;
|
|
251106
251586
|
}
|
|
251107
|
-
return A ? (T.push(
|
|
251587
|
+
return A ? (T.push(h2), make_sequence(e, T).optimize(t)) : make_node(AST_Sub, e, { expression: make_node(AST_Array, i, { elements: T }), property: make_node(AST_Number, o, { value: s }) });
|
|
251108
251588
|
}
|
|
251109
251589
|
}
|
|
251110
251590
|
var b = e.evaluate(t);
|
|
@@ -251290,16 +251770,16 @@ function mangle_properties(e, t, n3 = find_annotated_props(e)) {
|
|
|
251290
251770
|
var d = !!t.keep_quoted;
|
|
251291
251771
|
return e.walk(new TreeWalker(function(e2) {
|
|
251292
251772
|
if (e2 instanceof AST_ClassPrivateProperty || e2 instanceof AST_PrivateMethod || e2 instanceof AST_PrivateGetter || e2 instanceof AST_PrivateSetter || e2 instanceof AST_DotHash) ;
|
|
251293
|
-
else if (e2 instanceof AST_ObjectKeyVal) "string" != typeof e2.key || d && e2.quote ||
|
|
251294
|
-
else if (e2 instanceof AST_ObjectProperty) d && e2.quote ||
|
|
251773
|
+
else if (e2 instanceof AST_ObjectKeyVal) "string" != typeof e2.key || d && e2.quote || h2(e2.key);
|
|
251774
|
+
else if (e2 instanceof AST_ObjectProperty) d && e2.quote || h2(e2.key.name);
|
|
251295
251775
|
else if (e2 instanceof AST_Dot) {
|
|
251296
251776
|
var n4 = !!t.undeclared;
|
|
251297
251777
|
if (!n4) {
|
|
251298
251778
|
for (var i2 = e2; i2.expression; ) i2 = i2.expression;
|
|
251299
251779
|
n4 = !(i2.thedef && i2.thedef.undeclared);
|
|
251300
251780
|
}
|
|
251301
|
-
!n4 || d && e2.quote ||
|
|
251302
|
-
} else e2 instanceof AST_Sub ? d || addStrings(e2.property,
|
|
251781
|
+
!n4 || d && e2.quote || h2(e2.property);
|
|
251782
|
+
} else e2 instanceof AST_Sub ? d || addStrings(e2.property, h2) : e2 instanceof AST_Call && "Object.defineProperty" == e2.expression.print_to_string() ? addStrings(e2.args[1], h2) : e2 instanceof AST_Binary && "in" === e2.operator ? addStrings(e2.left, h2) : e2 instanceof AST_String && has_annotation(e2, _KEY) && h2(e2.value);
|
|
251303
251783
|
})), e.transform(new TreeTransformer(function(e2) {
|
|
251304
251784
|
e2 instanceof AST_ClassPrivateProperty || e2 instanceof AST_PrivateMethod || e2 instanceof AST_PrivateGetter || e2 instanceof AST_PrivateSetter || e2 instanceof AST_DotHash || (e2 instanceof AST_ObjectKeyVal ? "string" != typeof e2.key || d && e2.quote || (e2.key = A(e2.key)) : e2 instanceof AST_ObjectProperty ? d && e2.quote || e2.computed_key() || (e2.key.name = A(e2.key.name)) : e2 instanceof AST_Dot ? d && e2.quote || (e2.property = A(e2.property)) : !d && e2 instanceof AST_Sub ? e2.property = T(e2.property) : e2 instanceof AST_Call && "Object.defineProperty" == e2.expression.print_to_string() ? e2.args[1] = T(e2.args[1]) : e2 instanceof AST_Binary && "in" === e2.operator ? e2.left = T(e2.left) : e2 instanceof AST_String && has_annotation(e2, _KEY) && (clear_annotation(e2), e2.value = A(e2.value)));
|
|
251305
251785
|
}));
|
|
@@ -251309,7 +251789,7 @@ function mangle_properties(e, t, n3 = find_annotated_props(e)) {
|
|
|
251309
251789
|
function S(e2) {
|
|
251310
251790
|
return !(c && !n3.has(e2)) && (l && !l.test(e2) ? n3.has(e2) : !r.has(e2) && (a.has(e2) || f.has(e2)));
|
|
251311
251791
|
}
|
|
251312
|
-
function
|
|
251792
|
+
function h2(e2) {
|
|
251313
251793
|
m(e2) && f.add(e2), S(e2) || p.add(e2);
|
|
251314
251794
|
}
|
|
251315
251795
|
function A(e2) {
|
|
@@ -252376,12 +252856,12 @@ var HTML_ELEMENT = "HTMLElement";
|
|
|
252376
252856
|
var PROXY_CUSTOM_ELEMENT = "__stencil_proxyCustomElement";
|
|
252377
252857
|
var REGISTER_INSTANCE = "__stencil_registerInstance";
|
|
252378
252858
|
var REGISTER_HOST = "__stencil_registerHost";
|
|
252379
|
-
var
|
|
252859
|
+
var H2 = "__stencil_h";
|
|
252380
252860
|
var RUNTIME_APIS = {
|
|
252381
252861
|
createEvent: `createEvent as ${CREATE_EVENT}`,
|
|
252382
252862
|
defineCustomElement: `defineCustomElement as ${DEFINE_CUSTOM_ELEMENT}`,
|
|
252383
252863
|
getElement: `getElement as ${GET_ELEMENT}`,
|
|
252384
|
-
h: `h as ${
|
|
252864
|
+
h: `h as ${H2}`,
|
|
252385
252865
|
legacyH: `h`,
|
|
252386
252866
|
Host: `Host as ${HOST}`,
|
|
252387
252867
|
HTMLElement: HTML_ELEMENT,
|
|
@@ -252450,7 +252930,7 @@ var addImports = (transformOpts, tsSourceFile, importFnNames, importPath) => {
|
|
|
252450
252930
|
};
|
|
252451
252931
|
|
|
252452
252932
|
// src/compiler/transformers/component-native/proxy-custom-element-function.ts
|
|
252453
|
-
var
|
|
252933
|
+
var proxyCustomElement2 = (compilerCtx, transformOpts) => {
|
|
252454
252934
|
return () => {
|
|
252455
252935
|
return (tsSourceFile) => {
|
|
252456
252936
|
const moduleFile = getModuleFromSourceFile(compilerCtx, tsSourceFile);
|
|
@@ -252519,7 +252999,7 @@ var import_typescript30 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
|
252519
252999
|
|
|
252520
253000
|
// src/compiler/transformers/define-custom-element.ts
|
|
252521
253001
|
var import_typescript17 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
252522
|
-
var
|
|
253002
|
+
var defineCustomElement2 = (tsSourceFile, moduleFile, transformOpts) => {
|
|
252523
253003
|
let statements = tsSourceFile.statements.slice();
|
|
252524
253004
|
statements.push(
|
|
252525
253005
|
...moduleFile.cmps.map((cmp) => {
|
|
@@ -252768,7 +253248,7 @@ var syntheticRender = (moduleFile, hasRender) => {
|
|
|
252768
253248
|
void 0,
|
|
252769
253249
|
import_typescript19.default.factory.createBlock([
|
|
252770
253250
|
import_typescript19.default.factory.createReturnStatement(
|
|
252771
|
-
import_typescript19.default.factory.createCallExpression(import_typescript19.default.factory.createIdentifier(
|
|
253251
|
+
import_typescript19.default.factory.createCallExpression(import_typescript19.default.factory.createIdentifier(H2), void 0, hArguments)
|
|
252772
253252
|
)
|
|
252773
253253
|
])
|
|
252774
253254
|
);
|
|
@@ -252897,10 +253377,10 @@ var addNativeConnectedCallback = (classMembers, cmp) => {
|
|
|
252897
253377
|
)
|
|
252898
253378
|
)
|
|
252899
253379
|
);
|
|
252900
|
-
const
|
|
253380
|
+
const connectedCallback2 = classMembers.find((classMember) => {
|
|
252901
253381
|
return import_typescript22.default.isMethodDeclaration(classMember) && classMember.name.escapedText === CONNECTED_CALLBACK;
|
|
252902
253382
|
});
|
|
252903
|
-
if (
|
|
253383
|
+
if (connectedCallback2 != null) {
|
|
252904
253384
|
const callbackMethod = import_typescript22.default.factory.createMethodDeclaration(
|
|
252905
253385
|
void 0,
|
|
252906
253386
|
void 0,
|
|
@@ -252909,9 +253389,9 @@ var addNativeConnectedCallback = (classMembers, cmp) => {
|
|
|
252909
253389
|
void 0,
|
|
252910
253390
|
[],
|
|
252911
253391
|
void 0,
|
|
252912
|
-
import_typescript22.default.factory.createBlock([fnCall, ...
|
|
253392
|
+
import_typescript22.default.factory.createBlock([fnCall, ...connectedCallback2.body.statements], true)
|
|
252913
253393
|
);
|
|
252914
|
-
const index2 = classMembers.indexOf(
|
|
253394
|
+
const index2 = classMembers.indexOf(connectedCallback2);
|
|
252915
253395
|
classMembers[index2] = callbackMethod;
|
|
252916
253396
|
} else {
|
|
252917
253397
|
const callbackMethod = import_typescript22.default.factory.createMethodDeclaration(
|
|
@@ -253062,373 +253542,6 @@ var addNativeComponentMeta = (classMembers, cmp) => {
|
|
|
253062
253542
|
classMembers.push(createStaticGetter("is", convertValueToLiteral(cmp.tagName)));
|
|
253063
253543
|
};
|
|
253064
253544
|
|
|
253065
|
-
// src/utils/shadow-css.ts
|
|
253066
|
-
/**
|
|
253067
|
-
* @license
|
|
253068
|
-
* Copyright Google Inc. All Rights Reserved.
|
|
253069
|
-
*
|
|
253070
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
253071
|
-
* found in the LICENSE file at https://angular.io/license
|
|
253072
|
-
*
|
|
253073
|
-
* This file is a port of shadowCSS from `webcomponents.js` to TypeScript.
|
|
253074
|
-
* https://github.com/webcomponents/webcomponentsjs/blob/4efecd7e0e/src/ShadowCSS/ShadowCSS.js
|
|
253075
|
-
* https://github.com/angular/angular/blob/master/packages/compiler/src/shadow_css.ts
|
|
253076
|
-
*/
|
|
253077
|
-
var safeSelector = (selector) => {
|
|
253078
|
-
const placeholders = [];
|
|
253079
|
-
let index2 = 0;
|
|
253080
|
-
selector = selector.replace(/(\[[^\]]*\])/g, (_, keep) => {
|
|
253081
|
-
const replaceBy = `__ph-${index2}__`;
|
|
253082
|
-
placeholders.push(keep);
|
|
253083
|
-
index2++;
|
|
253084
|
-
return replaceBy;
|
|
253085
|
-
});
|
|
253086
|
-
const content = selector.replace(/(:nth-[-\w]+)(\([^)]+\))/g, (_, pseudo, exp) => {
|
|
253087
|
-
const replaceBy = `__ph-${index2}__`;
|
|
253088
|
-
placeholders.push(exp);
|
|
253089
|
-
index2++;
|
|
253090
|
-
return pseudo + replaceBy;
|
|
253091
|
-
});
|
|
253092
|
-
const ss = {
|
|
253093
|
-
content,
|
|
253094
|
-
placeholders
|
|
253095
|
-
};
|
|
253096
|
-
return ss;
|
|
253097
|
-
};
|
|
253098
|
-
var restoreSafeSelector = (placeholders, content) => {
|
|
253099
|
-
return content.replace(/__ph-(\d+)__/g, (_, index2) => placeholders[+index2]);
|
|
253100
|
-
};
|
|
253101
|
-
var _polyfillHost = "-shadowcsshost";
|
|
253102
|
-
var _polyfillSlotted = "-shadowcssslotted";
|
|
253103
|
-
var _polyfillHostContext = "-shadowcsscontext";
|
|
253104
|
-
var _parenSuffix = ")(?:\\(((?:\\([^)(]*\\)|[^)(]*)+?)\\))?([^,{]*)";
|
|
253105
|
-
var _cssColonHostRe = new RegExp("(" + _polyfillHost + _parenSuffix, "gim");
|
|
253106
|
-
var _cssColonHostContextRe = new RegExp("(" + _polyfillHostContext + _parenSuffix, "gim");
|
|
253107
|
-
var _cssColonSlottedRe = new RegExp("(" + _polyfillSlotted + _parenSuffix, "gim");
|
|
253108
|
-
var _polyfillHostNoCombinator = _polyfillHost + "-no-combinator";
|
|
253109
|
-
var _polyfillHostNoCombinatorRe = /-shadowcsshost-no-combinator([^\s]*)/;
|
|
253110
|
-
var _shadowDOMSelectorsRe = [/::shadow/g, /::content/g];
|
|
253111
|
-
var _selectorReSuffix = "([>\\s~+[.,{:][\\s\\S]*)?$";
|
|
253112
|
-
var _polyfillHostRe = /-shadowcsshost/gim;
|
|
253113
|
-
var createSupportsRuleRe = (selector) => {
|
|
253114
|
-
const safeSelector2 = escapeRegExpSpecialCharacters(selector);
|
|
253115
|
-
return new RegExp(
|
|
253116
|
-
// First capture group: match any context before the selector that's not inside @supports selector()
|
|
253117
|
-
// Using negative lookahead to avoid matching inside @supports selector(...) condition
|
|
253118
|
-
`(^|[^@]|@(?!supports\\s+selector\\s*\\([^{]*?${safeSelector2}))(${safeSelector2}\\b)`,
|
|
253119
|
-
"g"
|
|
253120
|
-
);
|
|
253121
|
-
};
|
|
253122
|
-
var _colonSlottedRe = createSupportsRuleRe("::slotted");
|
|
253123
|
-
var _colonHostRe = createSupportsRuleRe(":host");
|
|
253124
|
-
var _colonHostContextRe = createSupportsRuleRe(":host-context");
|
|
253125
|
-
var _commentRe = /\/\*\s*[\s\S]*?\*\//g;
|
|
253126
|
-
var stripComments = (input) => {
|
|
253127
|
-
return input.replace(_commentRe, "");
|
|
253128
|
-
};
|
|
253129
|
-
var _commentWithHashRe = /\/\*\s*#\s*source(Mapping)?URL=[\s\S]+?\*\//g;
|
|
253130
|
-
var extractCommentsWithHash = (input) => {
|
|
253131
|
-
return input.match(_commentWithHashRe) || [];
|
|
253132
|
-
};
|
|
253133
|
-
var _ruleRe = /(\s*)([^;\{\}]+?)(\s*)((?:{%BLOCK%}?\s*;?)|(?:\s*;))/g;
|
|
253134
|
-
var _curlyRe = /([{}])/g;
|
|
253135
|
-
var _selectorPartsRe = /(^.*?[^\\])??((:+)(.*)|$)/;
|
|
253136
|
-
var OPEN_CURLY = "{";
|
|
253137
|
-
var CLOSE_CURLY = "}";
|
|
253138
|
-
var BLOCK_PLACEHOLDER = "%BLOCK%";
|
|
253139
|
-
var processRules = (input, ruleCallback) => {
|
|
253140
|
-
const inputWithEscapedBlocks = escapeBlocks(input);
|
|
253141
|
-
let nextBlockIndex = 0;
|
|
253142
|
-
return inputWithEscapedBlocks.escapedString.replace(_ruleRe, (...m) => {
|
|
253143
|
-
const selector = m[2];
|
|
253144
|
-
let content = "";
|
|
253145
|
-
let suffix = m[4];
|
|
253146
|
-
let contentPrefix = "";
|
|
253147
|
-
if (suffix && suffix.startsWith("{" + BLOCK_PLACEHOLDER)) {
|
|
253148
|
-
content = inputWithEscapedBlocks.blocks[nextBlockIndex++];
|
|
253149
|
-
suffix = suffix.substring(BLOCK_PLACEHOLDER.length + 1);
|
|
253150
|
-
contentPrefix = "{";
|
|
253151
|
-
}
|
|
253152
|
-
const cssRule = {
|
|
253153
|
-
selector,
|
|
253154
|
-
content
|
|
253155
|
-
};
|
|
253156
|
-
const rule = ruleCallback(cssRule);
|
|
253157
|
-
return `${m[1]}${rule.selector}${m[3]}${contentPrefix}${rule.content}${suffix}`;
|
|
253158
|
-
});
|
|
253159
|
-
};
|
|
253160
|
-
var escapeBlocks = (input) => {
|
|
253161
|
-
const inputParts = input.split(_curlyRe);
|
|
253162
|
-
const resultParts = [];
|
|
253163
|
-
const escapedBlocks = [];
|
|
253164
|
-
let bracketCount = 0;
|
|
253165
|
-
let currentBlockParts = [];
|
|
253166
|
-
for (let partIndex = 0; partIndex < inputParts.length; partIndex++) {
|
|
253167
|
-
const part = inputParts[partIndex];
|
|
253168
|
-
if (part === CLOSE_CURLY) {
|
|
253169
|
-
bracketCount--;
|
|
253170
|
-
}
|
|
253171
|
-
if (bracketCount > 0) {
|
|
253172
|
-
currentBlockParts.push(part);
|
|
253173
|
-
} else {
|
|
253174
|
-
if (currentBlockParts.length > 0) {
|
|
253175
|
-
escapedBlocks.push(currentBlockParts.join(""));
|
|
253176
|
-
resultParts.push(BLOCK_PLACEHOLDER);
|
|
253177
|
-
currentBlockParts = [];
|
|
253178
|
-
}
|
|
253179
|
-
resultParts.push(part);
|
|
253180
|
-
}
|
|
253181
|
-
if (part === OPEN_CURLY) {
|
|
253182
|
-
bracketCount++;
|
|
253183
|
-
}
|
|
253184
|
-
}
|
|
253185
|
-
if (currentBlockParts.length > 0) {
|
|
253186
|
-
escapedBlocks.push(currentBlockParts.join(""));
|
|
253187
|
-
resultParts.push(BLOCK_PLACEHOLDER);
|
|
253188
|
-
}
|
|
253189
|
-
const strEscapedBlocks = {
|
|
253190
|
-
escapedString: resultParts.join(""),
|
|
253191
|
-
blocks: escapedBlocks
|
|
253192
|
-
};
|
|
253193
|
-
return strEscapedBlocks;
|
|
253194
|
-
};
|
|
253195
|
-
var insertPolyfillHostInCssText = (cssText) => {
|
|
253196
|
-
const supportsBlocks = [];
|
|
253197
|
-
cssText = cssText.replace(/@supports\s+selector\s*\(\s*([^)]*)\s*\)/g, (_, selectorContent) => {
|
|
253198
|
-
const placeholder = `__supports_${supportsBlocks.length}__`;
|
|
253199
|
-
supportsBlocks.push(selectorContent);
|
|
253200
|
-
return `@supports selector(${placeholder})`;
|
|
253201
|
-
});
|
|
253202
|
-
cssText = cssText.replace(_colonHostContextRe, `$1${_polyfillHostContext}`).replace(_colonHostRe, `$1${_polyfillHost}`).replace(_colonSlottedRe, `$1${_polyfillSlotted}`);
|
|
253203
|
-
supportsBlocks.forEach((originalSelector, index2) => {
|
|
253204
|
-
cssText = cssText.replace(`__supports_${index2}__`, originalSelector);
|
|
253205
|
-
});
|
|
253206
|
-
return cssText;
|
|
253207
|
-
};
|
|
253208
|
-
var convertColonRule = (cssText, regExp, partReplacer) => {
|
|
253209
|
-
return cssText.replace(regExp, (...m) => {
|
|
253210
|
-
if (m[2]) {
|
|
253211
|
-
const parts = m[2].split(",");
|
|
253212
|
-
const r = [];
|
|
253213
|
-
for (let i = 0; i < parts.length; i++) {
|
|
253214
|
-
const p = parts[i].trim();
|
|
253215
|
-
if (!p) break;
|
|
253216
|
-
r.push(partReplacer(_polyfillHostNoCombinator, p, m[3]));
|
|
253217
|
-
}
|
|
253218
|
-
return r.join(",");
|
|
253219
|
-
} else {
|
|
253220
|
-
return _polyfillHostNoCombinator + m[3];
|
|
253221
|
-
}
|
|
253222
|
-
});
|
|
253223
|
-
};
|
|
253224
|
-
var colonHostPartReplacer = (host, part, suffix) => {
|
|
253225
|
-
return host + part.replace(_polyfillHost, "") + suffix;
|
|
253226
|
-
};
|
|
253227
|
-
var convertColonHost = (cssText) => {
|
|
253228
|
-
return convertColonRule(cssText, _cssColonHostRe, colonHostPartReplacer);
|
|
253229
|
-
};
|
|
253230
|
-
var colonHostContextPartReplacer = (host, part, suffix) => {
|
|
253231
|
-
if (part.indexOf(_polyfillHost) > -1) {
|
|
253232
|
-
return colonHostPartReplacer(host, part, suffix);
|
|
253233
|
-
} else {
|
|
253234
|
-
return host + part + suffix + ", " + part + " " + host + suffix;
|
|
253235
|
-
}
|
|
253236
|
-
};
|
|
253237
|
-
var convertColonSlotted = (cssText, slotScopeId) => {
|
|
253238
|
-
const slotClass = "." + slotScopeId + " > ";
|
|
253239
|
-
const selectors = [];
|
|
253240
|
-
cssText = cssText.replace(_cssColonSlottedRe, (...m) => {
|
|
253241
|
-
if (m[2]) {
|
|
253242
|
-
const compound = m[2].trim();
|
|
253243
|
-
const suffix = m[3];
|
|
253244
|
-
const slottedSelector = slotClass + compound + suffix;
|
|
253245
|
-
let prefixSelector = "";
|
|
253246
|
-
for (let i = m[4] - 1; i >= 0; i--) {
|
|
253247
|
-
const char = m[5][i];
|
|
253248
|
-
if (char === "}" || char === ",") {
|
|
253249
|
-
break;
|
|
253250
|
-
}
|
|
253251
|
-
prefixSelector = char + prefixSelector;
|
|
253252
|
-
}
|
|
253253
|
-
const orgSelector = (prefixSelector + slottedSelector).trim();
|
|
253254
|
-
const addedSelector = `${prefixSelector.trimEnd()}${slottedSelector.trim()}`.trim();
|
|
253255
|
-
if (orgSelector !== addedSelector) {
|
|
253256
|
-
const updatedSelector = `${addedSelector}, ${orgSelector}`;
|
|
253257
|
-
selectors.push({
|
|
253258
|
-
orgSelector,
|
|
253259
|
-
updatedSelector
|
|
253260
|
-
});
|
|
253261
|
-
}
|
|
253262
|
-
return slottedSelector;
|
|
253263
|
-
} else {
|
|
253264
|
-
return _polyfillHostNoCombinator + m[3];
|
|
253265
|
-
}
|
|
253266
|
-
});
|
|
253267
|
-
return {
|
|
253268
|
-
selectors,
|
|
253269
|
-
cssText
|
|
253270
|
-
};
|
|
253271
|
-
};
|
|
253272
|
-
var convertColonHostContext = (cssText) => {
|
|
253273
|
-
return convertColonRule(cssText, _cssColonHostContextRe, colonHostContextPartReplacer);
|
|
253274
|
-
};
|
|
253275
|
-
var convertShadowDOMSelectors = (cssText) => {
|
|
253276
|
-
return _shadowDOMSelectorsRe.reduce((result2, pattern) => result2.replace(pattern, " "), cssText);
|
|
253277
|
-
};
|
|
253278
|
-
var makeScopeMatcher = (scopeSelector2) => {
|
|
253279
|
-
const lre = /\[/g;
|
|
253280
|
-
const rre = /\]/g;
|
|
253281
|
-
scopeSelector2 = scopeSelector2.replace(lre, "\\[").replace(rre, "\\]");
|
|
253282
|
-
return new RegExp("^(" + scopeSelector2 + ")" + _selectorReSuffix, "m");
|
|
253283
|
-
};
|
|
253284
|
-
var selectorNeedsScoping = (selector, scopeSelector2) => {
|
|
253285
|
-
const re = makeScopeMatcher(scopeSelector2);
|
|
253286
|
-
return !re.test(selector);
|
|
253287
|
-
};
|
|
253288
|
-
var injectScopingSelector = (selector, scopingSelector) => {
|
|
253289
|
-
return selector.replace(_selectorPartsRe, (_, before = "", _colonGroup, colon = "", after = "") => {
|
|
253290
|
-
return before + scopingSelector + colon + after;
|
|
253291
|
-
});
|
|
253292
|
-
};
|
|
253293
|
-
var applySimpleSelectorScope = (selector, scopeSelector2, hostSelector) => {
|
|
253294
|
-
_polyfillHostRe.lastIndex = 0;
|
|
253295
|
-
if (_polyfillHostRe.test(selector)) {
|
|
253296
|
-
const replaceBy = `.${hostSelector}`;
|
|
253297
|
-
return selector.replace(_polyfillHostNoCombinatorRe, (_, selector2) => injectScopingSelector(selector2, replaceBy)).replace(_polyfillHostRe, replaceBy + " ");
|
|
253298
|
-
}
|
|
253299
|
-
return scopeSelector2 + " " + selector;
|
|
253300
|
-
};
|
|
253301
|
-
var applyStrictSelectorScope = (selector, scopeSelector2, hostSelector) => {
|
|
253302
|
-
const isRe = /\[is=([^\]]*)\]/g;
|
|
253303
|
-
scopeSelector2 = scopeSelector2.replace(isRe, (_, ...parts) => parts[0]);
|
|
253304
|
-
const className = "." + scopeSelector2;
|
|
253305
|
-
const _scopeSelectorPart = (p) => {
|
|
253306
|
-
let scopedP = p.trim();
|
|
253307
|
-
if (!scopedP) {
|
|
253308
|
-
return "";
|
|
253309
|
-
}
|
|
253310
|
-
if (p.indexOf(_polyfillHostNoCombinator) > -1) {
|
|
253311
|
-
scopedP = applySimpleSelectorScope(p, scopeSelector2, hostSelector);
|
|
253312
|
-
} else {
|
|
253313
|
-
const t = p.replace(_polyfillHostRe, "");
|
|
253314
|
-
if (t.length > 0) {
|
|
253315
|
-
scopedP = injectScopingSelector(t, className);
|
|
253316
|
-
}
|
|
253317
|
-
}
|
|
253318
|
-
return scopedP;
|
|
253319
|
-
};
|
|
253320
|
-
const safeContent = safeSelector(selector);
|
|
253321
|
-
selector = safeContent.content;
|
|
253322
|
-
let scopedSelector = "";
|
|
253323
|
-
let startIndex = 0;
|
|
253324
|
-
let res;
|
|
253325
|
-
const sep4 = /( |>|\+|~(?!=))\s*/g;
|
|
253326
|
-
const hasHost = selector.indexOf(_polyfillHostNoCombinator) > -1;
|
|
253327
|
-
let shouldScope = !hasHost;
|
|
253328
|
-
while ((res = sep4.exec(selector)) !== null) {
|
|
253329
|
-
const separator = res[1];
|
|
253330
|
-
const part2 = selector.slice(startIndex, res.index).trim();
|
|
253331
|
-
shouldScope = shouldScope || part2.indexOf(_polyfillHostNoCombinator) > -1;
|
|
253332
|
-
const scopedPart = shouldScope ? _scopeSelectorPart(part2) : part2;
|
|
253333
|
-
scopedSelector += `${scopedPart} ${separator} `;
|
|
253334
|
-
startIndex = sep4.lastIndex;
|
|
253335
|
-
}
|
|
253336
|
-
const part = selector.substring(startIndex);
|
|
253337
|
-
shouldScope = shouldScope || part.indexOf(_polyfillHostNoCombinator) > -1;
|
|
253338
|
-
scopedSelector += shouldScope ? _scopeSelectorPart(part) : part;
|
|
253339
|
-
return restoreSafeSelector(safeContent.placeholders, scopedSelector);
|
|
253340
|
-
};
|
|
253341
|
-
var scopeSelector = (selector, scopeSelectorText, hostSelector, slotSelector) => {
|
|
253342
|
-
return selector.split(",").map((shallowPart) => {
|
|
253343
|
-
if (slotSelector && shallowPart.indexOf("." + slotSelector) > -1) {
|
|
253344
|
-
return shallowPart.trim();
|
|
253345
|
-
}
|
|
253346
|
-
if (selectorNeedsScoping(shallowPart, scopeSelectorText)) {
|
|
253347
|
-
return applyStrictSelectorScope(shallowPart, scopeSelectorText, hostSelector).trim();
|
|
253348
|
-
} else {
|
|
253349
|
-
return shallowPart.trim();
|
|
253350
|
-
}
|
|
253351
|
-
}).join(", ");
|
|
253352
|
-
};
|
|
253353
|
-
var scopeSelectors = (cssText, scopeSelectorText, hostSelector, slotSelector, commentOriginalSelector) => {
|
|
253354
|
-
return processRules(cssText, (rule) => {
|
|
253355
|
-
let selector = rule.selector;
|
|
253356
|
-
let content = rule.content;
|
|
253357
|
-
if (rule.selector[0] !== "@") {
|
|
253358
|
-
selector = scopeSelector(rule.selector, scopeSelectorText, hostSelector, slotSelector);
|
|
253359
|
-
} else if (rule.selector.startsWith("@media") || rule.selector.startsWith("@supports") || rule.selector.startsWith("@page") || rule.selector.startsWith("@document")) {
|
|
253360
|
-
content = scopeSelectors(rule.content, scopeSelectorText, hostSelector, slotSelector, commentOriginalSelector);
|
|
253361
|
-
}
|
|
253362
|
-
const cssRule = {
|
|
253363
|
-
selector: selector.replace(/\s{2,}/g, " ").trim(),
|
|
253364
|
-
content
|
|
253365
|
-
};
|
|
253366
|
-
return cssRule;
|
|
253367
|
-
});
|
|
253368
|
-
};
|
|
253369
|
-
var scopeCssText = (cssText, scopeId, hostScopeId, slotScopeId, commentOriginalSelector) => {
|
|
253370
|
-
cssText = insertPolyfillHostInCssText(cssText);
|
|
253371
|
-
cssText = convertColonHost(cssText);
|
|
253372
|
-
cssText = convertColonHostContext(cssText);
|
|
253373
|
-
const slotted = convertColonSlotted(cssText, slotScopeId);
|
|
253374
|
-
cssText = slotted.cssText;
|
|
253375
|
-
cssText = convertShadowDOMSelectors(cssText);
|
|
253376
|
-
if (scopeId) {
|
|
253377
|
-
cssText = scopeSelectors(cssText, scopeId, hostScopeId, slotScopeId, commentOriginalSelector);
|
|
253378
|
-
}
|
|
253379
|
-
cssText = replaceShadowCssHost(cssText, hostScopeId);
|
|
253380
|
-
cssText = cssText.replace(/>\s*\*\s+([^{, ]+)/gm, " $1 ");
|
|
253381
|
-
return {
|
|
253382
|
-
cssText: cssText.trim(),
|
|
253383
|
-
// We need to replace the shadow CSS host string in each of these selectors since we created
|
|
253384
|
-
// them prior to the replacement happening in the components CSS text.
|
|
253385
|
-
slottedSelectors: slotted.selectors.map((ref) => ({
|
|
253386
|
-
orgSelector: replaceShadowCssHost(ref.orgSelector, hostScopeId),
|
|
253387
|
-
updatedSelector: replaceShadowCssHost(ref.updatedSelector, hostScopeId)
|
|
253388
|
-
}))
|
|
253389
|
-
};
|
|
253390
|
-
};
|
|
253391
|
-
var replaceShadowCssHost = (cssText, hostScopeId) => {
|
|
253392
|
-
return cssText.replace(/-shadowcsshost-no-combinator/g, `.${hostScopeId}`);
|
|
253393
|
-
};
|
|
253394
|
-
var scopeCss = (cssText, scopeId, commentOriginalSelector) => {
|
|
253395
|
-
const hostScopeId = scopeId + "-h";
|
|
253396
|
-
const slotScopeId = scopeId + "-s";
|
|
253397
|
-
const commentsWithHash = extractCommentsWithHash(cssText);
|
|
253398
|
-
cssText = stripComments(cssText);
|
|
253399
|
-
const orgSelectors = [];
|
|
253400
|
-
if (commentOriginalSelector) {
|
|
253401
|
-
const processCommentedSelector = (rule) => {
|
|
253402
|
-
const placeholder = `/*!@___${orgSelectors.length}___*/`;
|
|
253403
|
-
const comment = `/*!@${rule.selector}*/`;
|
|
253404
|
-
orgSelectors.push({ placeholder, comment });
|
|
253405
|
-
rule.selector = placeholder + rule.selector;
|
|
253406
|
-
return rule;
|
|
253407
|
-
};
|
|
253408
|
-
cssText = processRules(cssText, (rule) => {
|
|
253409
|
-
if (rule.selector[0] !== "@") {
|
|
253410
|
-
return processCommentedSelector(rule);
|
|
253411
|
-
} else if (rule.selector.startsWith("@media") || rule.selector.startsWith("@supports") || rule.selector.startsWith("@page") || rule.selector.startsWith("@document")) {
|
|
253412
|
-
rule.content = processRules(rule.content, processCommentedSelector);
|
|
253413
|
-
return rule;
|
|
253414
|
-
}
|
|
253415
|
-
return rule;
|
|
253416
|
-
});
|
|
253417
|
-
}
|
|
253418
|
-
const scoped = scopeCssText(cssText, scopeId, hostScopeId, slotScopeId, commentOriginalSelector);
|
|
253419
|
-
cssText = [scoped.cssText, ...commentsWithHash].join("\n");
|
|
253420
|
-
if (commentOriginalSelector) {
|
|
253421
|
-
orgSelectors.forEach(({ placeholder, comment }) => {
|
|
253422
|
-
cssText = cssText.replace(placeholder, comment);
|
|
253423
|
-
});
|
|
253424
|
-
}
|
|
253425
|
-
scoped.slottedSelectors.forEach((slottedSelector) => {
|
|
253426
|
-
const regex = new RegExp(escapeRegExpSpecialCharacters(slottedSelector.orgSelector), "g");
|
|
253427
|
-
cssText = cssText.replace(regex, slottedSelector.updatedSelector);
|
|
253428
|
-
});
|
|
253429
|
-
return cssText;
|
|
253430
|
-
};
|
|
253431
|
-
|
|
253432
253545
|
// src/compiler/transformers/component-native/native-static-style.ts
|
|
253433
253546
|
var import_typescript28 = __toESM(require_typescript_5_5_4_bundle_cache_min());
|
|
253434
253547
|
|
|
@@ -253462,9 +253575,9 @@ var getStyleLiteral = (cmp) => {
|
|
|
253462
253575
|
}
|
|
253463
253576
|
return null;
|
|
253464
253577
|
};
|
|
253465
|
-
var getMultipleModeStyle = (cmp,
|
|
253578
|
+
var getMultipleModeStyle = (cmp, styles2) => {
|
|
253466
253579
|
const styleModes = [];
|
|
253467
|
-
|
|
253580
|
+
styles2.forEach((style) => {
|
|
253468
253581
|
if (typeof style.styleStr === "string") {
|
|
253469
253582
|
const styleLiteral = createStyleLiteral(cmp, style);
|
|
253470
253583
|
const propStr = import_typescript27.default.factory.createPropertyAssignment(style.modeName, styleLiteral);
|
|
@@ -253495,7 +253608,7 @@ var getSingleStyle = (cmp, style) => {
|
|
|
253495
253608
|
};
|
|
253496
253609
|
var createStyleLiteral = (cmp, style) => {
|
|
253497
253610
|
if (cmp.encapsulation === "scoped") {
|
|
253498
|
-
const scopeId =
|
|
253611
|
+
const scopeId = getScopeId2(cmp.tagName, style.modeName);
|
|
253499
253612
|
return import_typescript27.default.factory.createStringLiteral(scopeCss(style.styleStr, scopeId, false));
|
|
253500
253613
|
}
|
|
253501
253614
|
return import_typescript27.default.factory.createStringLiteral(style.styleStr);
|
|
@@ -253531,9 +253644,9 @@ var addNativeStaticStyle = (classMembers, cmp) => {
|
|
|
253531
253644
|
}
|
|
253532
253645
|
}
|
|
253533
253646
|
};
|
|
253534
|
-
var addMultipleModeStyleGetter = (classMembers, cmp,
|
|
253647
|
+
var addMultipleModeStyleGetter = (classMembers, cmp, styles2) => {
|
|
253535
253648
|
const styleModes = [];
|
|
253536
|
-
|
|
253649
|
+
styles2.forEach((style) => {
|
|
253537
253650
|
if (typeof style.styleStr === "string") {
|
|
253538
253651
|
const styleLiteral = createStyleLiteral2(cmp, style);
|
|
253539
253652
|
const propStr = import_typescript28.default.factory.createPropertyAssignment(style.modeName, styleLiteral);
|
|
@@ -253565,7 +253678,7 @@ var addSingleStyleGetter = (classMembers, cmp, style) => {
|
|
|
253565
253678
|
};
|
|
253566
253679
|
var createStyleLiteral2 = (cmp, style) => {
|
|
253567
253680
|
if (cmp.encapsulation === "scoped") {
|
|
253568
|
-
const scopeId =
|
|
253681
|
+
const scopeId = getScopeId2(cmp.tagName, style.modeName);
|
|
253569
253682
|
return import_typescript28.default.factory.createStringLiteral(scopeCss(style.styleStr, scopeId, false));
|
|
253570
253683
|
}
|
|
253571
253684
|
return import_typescript28.default.factory.createStringLiteral(style.styleStr);
|
|
@@ -253630,7 +253743,7 @@ var nativeComponentTransform = (compilerCtx, transformOpts) => {
|
|
|
253630
253743
|
tsSourceFile = import_typescript30.default.visitEachChild(tsSourceFile, visitNode, transformCtx);
|
|
253631
253744
|
if (moduleFile.cmps.length > 0) {
|
|
253632
253745
|
if (transformOpts.componentExport === "customelement") {
|
|
253633
|
-
tsSourceFile =
|
|
253746
|
+
tsSourceFile = defineCustomElement2(tsSourceFile, moduleFile, transformOpts);
|
|
253634
253747
|
} else if (transformOpts.proxy === "defineproperty") {
|
|
253635
253748
|
tsSourceFile = addModuleMetadataProxies(tsSourceFile, moduleFile);
|
|
253636
253749
|
}
|
|
@@ -254140,7 +254253,7 @@ var getCustomBeforeTransformers = (config, compilerCtx, components, outputTarget
|
|
|
254140
254253
|
}
|
|
254141
254254
|
customBeforeTransformers.push(
|
|
254142
254255
|
nativeComponentTransform(compilerCtx, transformOpts),
|
|
254143
|
-
|
|
254256
|
+
proxyCustomElement2(compilerCtx, transformOpts),
|
|
254144
254257
|
removeCollectionImports(compilerCtx)
|
|
254145
254258
|
);
|
|
254146
254259
|
return customBeforeTransformers;
|
|
@@ -255003,7 +255116,7 @@ var generateModuleGraph = (cmps, bundleModules) => {
|
|
|
255003
255116
|
cmps.forEach((cmp) => {
|
|
255004
255117
|
const bundle = bundleModules.find((b) => b.cmps.includes(cmp));
|
|
255005
255118
|
if (bundle) {
|
|
255006
|
-
cmpMap.set(
|
|
255119
|
+
cmpMap.set(getScopeId2(cmp.tagName), bundle.rollupResult.imports);
|
|
255007
255120
|
}
|
|
255008
255121
|
});
|
|
255009
255122
|
return cmpMap;
|
|
@@ -257866,16 +257979,16 @@ var writeDocsOutput = async (compilerCtx, jsonOutput, jsonContent, typesContent)
|
|
|
257866
257979
|
};
|
|
257867
257980
|
|
|
257868
257981
|
// src/compiler/docs/readme/markdown-css-props.ts
|
|
257869
|
-
var stylesToMarkdown = (
|
|
257982
|
+
var stylesToMarkdown = (styles2) => {
|
|
257870
257983
|
const content = [];
|
|
257871
|
-
if (
|
|
257984
|
+
if (styles2.length === 0) {
|
|
257872
257985
|
return content;
|
|
257873
257986
|
}
|
|
257874
257987
|
content.push(`## CSS Custom Properties`);
|
|
257875
257988
|
content.push(``);
|
|
257876
257989
|
const table = new MarkdownTable();
|
|
257877
257990
|
table.addHeader(["Name", "Description"]);
|
|
257878
|
-
|
|
257991
|
+
styles2.forEach((style) => {
|
|
257879
257992
|
table.addRow([`\`${style.name}\``, style.docs]);
|
|
257880
257993
|
});
|
|
257881
257994
|
content.push(...table.toMarkdown());
|
|
@@ -259480,12 +259593,12 @@ var inlineStyleSheets = (compilerCtx, doc, maxSize, outputTarget) => {
|
|
|
259480
259593
|
}
|
|
259481
259594
|
try {
|
|
259482
259595
|
const fsPath = join(outputTarget.dir, href);
|
|
259483
|
-
const
|
|
259484
|
-
if (
|
|
259596
|
+
const styles2 = await compilerCtx.fs.readFile(fsPath);
|
|
259597
|
+
if (styles2.length > maxSize) {
|
|
259485
259598
|
return;
|
|
259486
259599
|
}
|
|
259487
259600
|
const inlinedStyles = doc.createElement("style");
|
|
259488
|
-
inlinedStyles.innerHTML =
|
|
259601
|
+
inlinedStyles.innerHTML = styles2;
|
|
259489
259602
|
link.parentNode.insertBefore(inlinedStyles, link);
|
|
259490
259603
|
link.remove();
|
|
259491
259604
|
} catch (e) {
|
|
@@ -259538,7 +259651,7 @@ var getCriticalPath = (buildCtx) => {
|
|
|
259538
259651
|
}
|
|
259539
259652
|
return unique(
|
|
259540
259653
|
flatOne(
|
|
259541
|
-
getUsedComponents(buildCtx.indexDoc, buildCtx.components).map((tagName) =>
|
|
259654
|
+
getUsedComponents(buildCtx.indexDoc, buildCtx.components).map((tagName) => getScopeId2(tagName)).map((scopeId) => buildCtx.componentGraph.get(scopeId) || [])
|
|
259542
259655
|
)
|
|
259543
259656
|
).sort();
|
|
259544
259657
|
};
|
|
@@ -260051,9 +260164,9 @@ var styleToStatic = (newMembers, componentOptions) => {
|
|
|
260051
260164
|
newMembers.push(createStaticGetter("styleUrls", normalizedStyleExp));
|
|
260052
260165
|
}
|
|
260053
260166
|
if (typeof componentOptions.styles === "string") {
|
|
260054
|
-
const
|
|
260055
|
-
if (
|
|
260056
|
-
newMembers.push(createStaticGetter("styles", import_typescript44.default.factory.createStringLiteral(
|
|
260167
|
+
const styles2 = componentOptions.styles.trim();
|
|
260168
|
+
if (styles2.length > 0) {
|
|
260169
|
+
newMembers.push(createStaticGetter("styles", import_typescript44.default.factory.createStringLiteral(styles2)));
|
|
260057
260170
|
}
|
|
260058
260171
|
} else if (componentOptions.styles) {
|
|
260059
260172
|
const convertIdentifier = componentOptions.styles;
|
|
@@ -261547,9 +261660,9 @@ var parseCallExpression = (m, node) => {
|
|
|
261547
261660
|
};
|
|
261548
261661
|
var visitCallExpressionArgs = (m, callExpressionName, args) => {
|
|
261549
261662
|
const fnName = callExpressionName.escapedText;
|
|
261550
|
-
if (fnName === "h" || fnName ===
|
|
261663
|
+
if (fnName === "h" || fnName === H2 || fnName === "createElement") {
|
|
261551
261664
|
visitCallExpressionArg(m, args[0]);
|
|
261552
|
-
if (fnName === "h" || fnName ===
|
|
261665
|
+
if (fnName === "h" || fnName === H2) {
|
|
261553
261666
|
gatherVdomMeta(m, args);
|
|
261554
261667
|
}
|
|
261555
261668
|
} else if (args.length > 1 && fnName === "createElementNS") {
|
|
@@ -261860,8 +261973,8 @@ var parseStringLiteral = (m, node) => {
|
|
|
261860
261973
|
|
|
261861
261974
|
// src/compiler/style/normalize-styles.ts
|
|
261862
261975
|
var import_path46 = require("path");
|
|
261863
|
-
var normalizeStyles = (tagName, componentFilePath,
|
|
261864
|
-
|
|
261976
|
+
var normalizeStyles = (tagName, componentFilePath, styles2) => {
|
|
261977
|
+
styles2.forEach((style) => {
|
|
261865
261978
|
if (style.modeName === DEFAULT_STYLE_MODE) {
|
|
261866
261979
|
style.styleId = tagName.toUpperCase();
|
|
261867
261980
|
} else {
|
|
@@ -261890,7 +262003,7 @@ var normalizeExternalStyle = (componentFilePath, externalStyle) => {
|
|
|
261890
262003
|
|
|
261891
262004
|
// src/compiler/transformers/static-to-meta/styles.ts
|
|
261892
262005
|
var parseStaticStyles = (compilerCtx, tagName, componentFilePath, isCollectionDependency, staticMembers) => {
|
|
261893
|
-
const
|
|
262006
|
+
const styles2 = [];
|
|
261894
262007
|
const styleUrlsProp = isCollectionDependency ? "styleUrls" : "originalStyleUrls";
|
|
261895
262008
|
const parsedStyleUrls = getStaticValue(staticMembers, styleUrlsProp);
|
|
261896
262009
|
let parsedStyle = getStaticValue(staticMembers, "styles");
|
|
@@ -261898,7 +262011,7 @@ var parseStaticStyles = (compilerCtx, tagName, componentFilePath, isCollectionDe
|
|
|
261898
262011
|
if (typeof parsedStyle === "string") {
|
|
261899
262012
|
parsedStyle = parsedStyle.trim();
|
|
261900
262013
|
if (parsedStyle.length > 0) {
|
|
261901
|
-
|
|
262014
|
+
styles2.push({
|
|
261902
262015
|
modeName: DEFAULT_STYLE_MODE,
|
|
261903
262016
|
styleId: null,
|
|
261904
262017
|
styleStr: parsedStyle,
|
|
@@ -261908,13 +262021,13 @@ var parseStaticStyles = (compilerCtx, tagName, componentFilePath, isCollectionDe
|
|
|
261908
262021
|
compilerCtx.styleModeNames.add(DEFAULT_STYLE_MODE);
|
|
261909
262022
|
}
|
|
261910
262023
|
} else if (parsedStyle.__identifier) {
|
|
261911
|
-
|
|
262024
|
+
styles2.push(parseStyleIdentifier(parsedStyle, DEFAULT_STYLE_MODE));
|
|
261912
262025
|
compilerCtx.styleModeNames.add(DEFAULT_STYLE_MODE);
|
|
261913
262026
|
} else if (typeof parsedStyle === "object") {
|
|
261914
262027
|
Object.keys(parsedStyle).forEach((modeName) => {
|
|
261915
262028
|
const parsedStyleMode = parsedStyle[modeName];
|
|
261916
262029
|
if (typeof parsedStyleMode === "string") {
|
|
261917
|
-
|
|
262030
|
+
styles2.push({
|
|
261918
262031
|
modeName,
|
|
261919
262032
|
styleId: null,
|
|
261920
262033
|
styleStr: parsedStyleMode,
|
|
@@ -261922,7 +262035,7 @@ var parseStaticStyles = (compilerCtx, tagName, componentFilePath, isCollectionDe
|
|
|
261922
262035
|
externalStyles: []
|
|
261923
262036
|
});
|
|
261924
262037
|
} else {
|
|
261925
|
-
|
|
262038
|
+
styles2.push(parseStyleIdentifier(parsedStyleMode, modeName));
|
|
261926
262039
|
}
|
|
261927
262040
|
compilerCtx.styleModeNames.add(modeName);
|
|
261928
262041
|
});
|
|
@@ -261949,13 +262062,13 @@ var parseStaticStyles = (compilerCtx, tagName, componentFilePath, isCollectionDe
|
|
|
261949
262062
|
styleIdentifier: null,
|
|
261950
262063
|
externalStyles
|
|
261951
262064
|
};
|
|
261952
|
-
|
|
262065
|
+
styles2.push(style);
|
|
261953
262066
|
compilerCtx.styleModeNames.add(modeName);
|
|
261954
262067
|
}
|
|
261955
262068
|
});
|
|
261956
262069
|
}
|
|
261957
|
-
normalizeStyles(tagName, componentFilePath,
|
|
261958
|
-
return sortBy(
|
|
262070
|
+
normalizeStyles(tagName, componentFilePath, styles2);
|
|
262071
|
+
return sortBy(styles2, (s) => s.modeName);
|
|
261959
262072
|
};
|
|
261960
262073
|
var parseStyleIdentifier = (parsedStyle, modeName) => {
|
|
261961
262074
|
const style = {
|
|
@@ -262564,7 +262677,7 @@ var generateHmr = (config, compilerCtx, buildCtx) => {
|
|
|
262564
262677
|
hmr.inlineStylesUpdated = sortBy(
|
|
262565
262678
|
buildCtx.stylesUpdated.map((s) => {
|
|
262566
262679
|
return {
|
|
262567
|
-
styleId:
|
|
262680
|
+
styleId: getScopeId2(s.styleTag, s.styleMode),
|
|
262568
262681
|
styleTag: s.styleTag,
|
|
262569
262682
|
styleText: s.styleText
|
|
262570
262683
|
};
|
|
@@ -265911,13 +266024,13 @@ var inlineExternalStyleSheets = async (sys, appDir, doc) => {
|
|
|
265911
266024
|
}
|
|
265912
266025
|
const fsPath = join(appDir, href);
|
|
265913
266026
|
try {
|
|
265914
|
-
let
|
|
266027
|
+
let styles2 = await sys.readFile(fsPath);
|
|
265915
266028
|
const optimizeResults = await optimizeCss2({
|
|
265916
|
-
input:
|
|
266029
|
+
input: styles2
|
|
265917
266030
|
});
|
|
265918
|
-
|
|
266031
|
+
styles2 = optimizeResults.output;
|
|
265919
266032
|
const inlinedStyles = doc.createElement("style");
|
|
265920
|
-
inlinedStyles.innerHTML =
|
|
266033
|
+
inlinedStyles.innerHTML = styles2;
|
|
265921
266034
|
link.parentNode.insertBefore(inlinedStyles, link);
|
|
265922
266035
|
link.remove();
|
|
265923
266036
|
inlinedStyles.setAttribute("data-styles", "");
|
|
@@ -266028,7 +266141,7 @@ var addModulePreloads = (doc, hydrateOpts, hydrateResults, componentGraph) => {
|
|
|
266028
266141
|
const staticComponents = hydrateOpts.staticComponents || [];
|
|
266029
266142
|
const cmpTags = hydrateResults.components.filter((cmp) => !staticComponents.includes(cmp.tag));
|
|
266030
266143
|
const modulePreloads = unique(
|
|
266031
|
-
flatOne(cmpTags.map((cmp) =>
|
|
266144
|
+
flatOne(cmpTags.map((cmp) => getScopeId2(cmp.tag, cmp.mode)).map((scopeId) => componentGraph.get(scopeId) || []))
|
|
266032
266145
|
);
|
|
266033
266146
|
injectModulePreloads(doc, modulePreloads);
|
|
266034
266147
|
return true;
|
|
@@ -266242,13 +266355,13 @@ var prerenderWorker = async (sys, prerenderRequest) => {
|
|
|
266242
266355
|
if (prerenderCtx2.templateHtml == null) {
|
|
266243
266356
|
prerenderCtx2.templateHtml = sys.readFileSync(prerenderRequest.templateId);
|
|
266244
266357
|
}
|
|
266245
|
-
const
|
|
266246
|
-
const doc =
|
|
266247
|
-
|
|
266358
|
+
const win2 = hydrateApp.createWindowFromHtml(prerenderCtx2.templateHtml, prerenderRequest.templateId);
|
|
266359
|
+
const doc = win2.document;
|
|
266360
|
+
win2.location.href = url.href;
|
|
266248
266361
|
if (isFunction(sys.applyPrerenderGlobalPatch)) {
|
|
266249
266362
|
sys.applyPrerenderGlobalPatch({
|
|
266250
266363
|
devServerHostUrl: prerenderRequest.devServerHostUrl,
|
|
266251
|
-
window:
|
|
266364
|
+
window: win2
|
|
266252
266365
|
});
|
|
266253
266366
|
}
|
|
266254
266367
|
if (prerenderCtx2.prerenderConfig == null) {
|
|
@@ -266334,7 +266447,7 @@ var prerenderWorker = async (sys, prerenderRequest) => {
|
|
|
266334
266447
|
}
|
|
266335
266448
|
if (typeof hydrateResults.httpStatus === "number" && hydrateResults.httpStatus >= 400) {
|
|
266336
266449
|
try {
|
|
266337
|
-
|
|
266450
|
+
win2.close();
|
|
266338
266451
|
} catch (e) {
|
|
266339
266452
|
}
|
|
266340
266453
|
return results;
|
|
@@ -266364,7 +266477,7 @@ var prerenderWorker = async (sys, prerenderRequest) => {
|
|
|
266364
266477
|
}
|
|
266365
266478
|
await writePromise;
|
|
266366
266479
|
try {
|
|
266367
|
-
|
|
266480
|
+
win2.close();
|
|
266368
266481
|
} catch (e) {
|
|
266369
266482
|
}
|
|
266370
266483
|
} catch (e) {
|
|
@@ -266441,7 +266554,7 @@ var transformCssToEsmModule = (input) => {
|
|
|
266441
266554
|
try {
|
|
266442
266555
|
const varNames = /* @__PURE__ */ new Set([results.defaultVarName]);
|
|
266443
266556
|
if (isString(input.tag) && input.encapsulation === "scoped") {
|
|
266444
|
-
const scopeId =
|
|
266557
|
+
const scopeId = getScopeId2(input.tag, input.mode);
|
|
266445
266558
|
results.styleText = scopeCss(results.styleText, scopeId, false);
|
|
266446
266559
|
}
|
|
266447
266560
|
const cssImports = getCssToEsmImports(varNames, results.styleText, input.file, input.mode);
|
|
@@ -267873,7 +267986,7 @@ var createSystem = (c) => {
|
|
|
267873
267986
|
const writeFile2 = async (p, data) => writeFileSync(p, data);
|
|
267874
267987
|
const tmpDirSync = () => "/.tmp";
|
|
267875
267988
|
const tick = Promise.resolve();
|
|
267876
|
-
const
|
|
267989
|
+
const nextTick2 = (cb) => tick.then(cb);
|
|
267877
267990
|
const generateContentHash = async (content, hashLength) => {
|
|
267878
267991
|
const arrayBuffer = await crypto.subtle.digest("SHA-256", new TextEncoder().encode(content));
|
|
267879
267992
|
const hashArray = Array.from(new Uint8Array(arrayBuffer));
|
|
@@ -267925,7 +268038,7 @@ var createSystem = (c) => {
|
|
|
267925
268038
|
getRemoteModuleUrl,
|
|
267926
268039
|
hardwareConcurrency,
|
|
267927
268040
|
isSymbolicLink,
|
|
267928
|
-
nextTick,
|
|
268041
|
+
nextTick: nextTick2,
|
|
267929
268042
|
normalizePath: normalize3,
|
|
267930
268043
|
platformPath: import_path66.default,
|
|
267931
268044
|
readDir,
|