@angular/core 17.0.4 → 17.0.6
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/esm2022/src/application_init.mjs +2 -2
- package/esm2022/src/hydration/annotate.mjs +30 -20
- package/esm2022/src/hydration/interfaces.mjs +1 -1
- package/esm2022/src/hydration/node_lookup_utils.mjs +23 -2
- package/esm2022/src/render3/features/host_directives_feature.mjs +20 -13
- package/esm2022/src/render3/instructions/change_detection.mjs +3 -4
- package/esm2022/src/render3/node_manipulation.mjs +2 -2
- package/esm2022/src/render3/util/view_utils.mjs +11 -12
- package/esm2022/src/render3/view_manipulation.mjs +13 -5
- package/esm2022/src/version.mjs +1 -1
- package/esm2022/testing/src/logger.mjs +3 -3
- package/esm2022/testing/src/test_bed.mjs +3 -3
- package/esm2022/testing/src/test_bed_compiler.mjs +19 -10
- package/fesm2022/core.mjs +94 -50
- package/fesm2022/core.mjs.map +1 -1
- package/fesm2022/primitives/signals.mjs +1 -1
- package/fesm2022/rxjs-interop.mjs +1 -1
- package/fesm2022/testing.mjs +21 -12
- package/fesm2022/testing.mjs.map +1 -1
- package/index.d.ts +8 -3
- package/package.json +1 -1
- package/primitives/signals/index.d.ts +1 -1
- package/rxjs-interop/index.d.ts +1 -1
- package/schematics/migrations/block-template-entities/bundle.js +812 -457
- package/schematics/migrations/block-template-entities/bundle.js.map +4 -4
- package/schematics/migrations/compiler-options/bundle.js +13 -13
- package/schematics/migrations/transfer-state/bundle.js +13 -13
- package/schematics/ng-generate/control-flow-migration/bundle.js +1126 -557
- package/schematics/ng-generate/control-flow-migration/bundle.js.map +4 -4
- package/schematics/ng-generate/standalone-migration/bundle.js +1206 -735
- package/schematics/ng-generate/standalone-migration/bundle.js.map +4 -4
- package/testing/index.d.ts +1 -1
|
@@ -63,7 +63,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
63
63
|
});
|
|
64
64
|
};
|
|
65
65
|
|
|
66
|
-
// bazel-out/
|
|
66
|
+
// bazel-out/darwin-fastbuild/bin/packages/core/schematics/migrations/block-template-entities/index.mjs
|
|
67
67
|
var block_template_entities_exports = {};
|
|
68
68
|
__export(block_template_entities_exports, {
|
|
69
69
|
default: () => block_template_entities_default
|
|
@@ -72,7 +72,7 @@ module.exports = __toCommonJS(block_template_entities_exports);
|
|
|
72
72
|
var import_schematics = require("@angular-devkit/schematics");
|
|
73
73
|
var import_path3 = require("path");
|
|
74
74
|
|
|
75
|
-
// bazel-out/
|
|
75
|
+
// bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/project_tsconfig_paths.mjs
|
|
76
76
|
var import_core = require("@angular-devkit/core");
|
|
77
77
|
function getProjectTsConfigPaths(tree) {
|
|
78
78
|
return __async(this, null, function* () {
|
|
@@ -152,11 +152,11 @@ function getWorkspace(tree) {
|
|
|
152
152
|
});
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
-
// bazel-out/
|
|
155
|
+
// bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
|
|
156
156
|
var import_path = require("path");
|
|
157
157
|
var import_typescript2 = __toESM(require("typescript"), 1);
|
|
158
158
|
|
|
159
|
-
// bazel-out/
|
|
159
|
+
// bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/typescript/parse_tsconfig.mjs
|
|
160
160
|
var path = __toESM(require("path"), 1);
|
|
161
161
|
var import_typescript = __toESM(require("typescript"), 1);
|
|
162
162
|
function parseTsconfigFile(tsconfigPath, basePath) {
|
|
@@ -173,7 +173,7 @@ function parseTsconfigFile(tsconfigPath, basePath) {
|
|
|
173
173
|
return import_typescript.default.parseJsonConfigFileContent(config, parseConfigHost, basePath, {});
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
-
// bazel-out/
|
|
176
|
+
// bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
|
|
177
177
|
function createMigrationProgram(tree, tsconfigPath, basePath, fakeFileRead, additionalFiles) {
|
|
178
178
|
const { rootNames, options, host } = createProgramOptions(tree, tsconfigPath, basePath, fakeFileRead, additionalFiles);
|
|
179
179
|
return import_typescript2.default.createProgram(rootNames, options, host);
|
|
@@ -206,7 +206,7 @@ function canMigrateFile(basePath, sourceFile, program) {
|
|
|
206
206
|
return !(0, import_path.relative)(basePath, sourceFile.fileName).startsWith("..");
|
|
207
207
|
}
|
|
208
208
|
|
|
209
|
-
// bazel-out/
|
|
209
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/selector.mjs
|
|
210
210
|
var _SELECTOR_REGEXP = new RegExp(
|
|
211
211
|
`(\\:not\\()|(([\\.\\#]?)[-\\w]+)|(?:\\[([-.\\w*\\\\$]+)(?:=(["']?)([^\\]"']*)\\5)?\\])|(\\))|(\\s*,\\s*)`,
|
|
212
212
|
"g"
|
|
@@ -514,7 +514,7 @@ var SelectorContext = class {
|
|
|
514
514
|
}
|
|
515
515
|
};
|
|
516
516
|
|
|
517
|
-
// bazel-out/
|
|
517
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/core.mjs
|
|
518
518
|
var ViewEncapsulation;
|
|
519
519
|
(function(ViewEncapsulation2) {
|
|
520
520
|
ViewEncapsulation2[ViewEncapsulation2["Emulated"] = 0] = "Emulated";
|
|
@@ -576,7 +576,7 @@ function parseSelectorToR3Selector(selector) {
|
|
|
576
576
|
return selector ? CssSelector.parse(selector).map(parserSelectorToR3Selector) : [];
|
|
577
577
|
}
|
|
578
578
|
|
|
579
|
-
// bazel-out/
|
|
579
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/digest.mjs
|
|
580
580
|
var textEncoder;
|
|
581
581
|
function computeDigest(message) {
|
|
582
582
|
return sha1(serializeNodes(message.nodes).join("") + `[${message.meaning}]`);
|
|
@@ -816,7 +816,7 @@ function wordAt(bytes, index, endian) {
|
|
|
816
816
|
return word;
|
|
817
817
|
}
|
|
818
818
|
|
|
819
|
-
// bazel-out/
|
|
819
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/output_ast.mjs
|
|
820
820
|
var TypeModifier;
|
|
821
821
|
(function(TypeModifier2) {
|
|
822
822
|
TypeModifier2[TypeModifier2["None"] = 0] = "None";
|
|
@@ -1771,7 +1771,7 @@ function serializeTags(tags) {
|
|
|
1771
1771
|
return out;
|
|
1772
1772
|
}
|
|
1773
1773
|
|
|
1774
|
-
// bazel-out/
|
|
1774
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/constant_pool.mjs
|
|
1775
1775
|
var CONSTANT_PREFIX = "_c";
|
|
1776
1776
|
var UNKNOWN_VALUE_KEY = variable("<unknown>");
|
|
1777
1777
|
var KEY_CONTEXT = {};
|
|
@@ -1954,7 +1954,7 @@ function isLongStringLiteral(expr) {
|
|
|
1954
1954
|
return expr instanceof LiteralExpr && typeof expr.value === "string" && expr.value.length >= POOL_INCLUSION_LENGTH_THRESHOLD_FOR_STRINGS;
|
|
1955
1955
|
}
|
|
1956
1956
|
|
|
1957
|
-
// bazel-out/
|
|
1957
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_identifiers.mjs
|
|
1958
1958
|
var CORE = "@angular/core";
|
|
1959
1959
|
var _Identifiers = class {
|
|
1960
1960
|
};
|
|
@@ -2587,7 +2587,7 @@ var Identifiers = _Identifiers;
|
|
|
2587
2587
|
_Identifiers.validateIframeAttribute = { name: "\u0275\u0275validateIframeAttribute", moduleName: CORE };
|
|
2588
2588
|
})();
|
|
2589
2589
|
|
|
2590
|
-
// bazel-out/
|
|
2590
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/util.mjs
|
|
2591
2591
|
var DASH_CASE_REGEXP = /-+([a-z0-9])/g;
|
|
2592
2592
|
function dashCaseToCamelCase(input) {
|
|
2593
2593
|
return input.replace(DASH_CASE_REGEXP, (...m) => m[1].toUpperCase());
|
|
@@ -2675,7 +2675,7 @@ function partitionArray(arr, conditionFn) {
|
|
|
2675
2675
|
return [truthy, falsy];
|
|
2676
2676
|
}
|
|
2677
2677
|
|
|
2678
|
-
// bazel-out/
|
|
2678
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/source_map.mjs
|
|
2679
2679
|
var VERSION = 3;
|
|
2680
2680
|
var JS_B64_PREFIX = "# sourceMappingURL=data:application/json;base64,";
|
|
2681
2681
|
var SourceMapGenerator = class {
|
|
@@ -2804,7 +2804,7 @@ function toBase64Digit(value) {
|
|
|
2804
2804
|
return B64_DIGITS[value];
|
|
2805
2805
|
}
|
|
2806
2806
|
|
|
2807
|
-
// bazel-out/
|
|
2807
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/abstract_emitter.mjs
|
|
2808
2808
|
var _SINGLE_QUOTE_ESCAPE_STRING_RE = /'|\\|\n|\r|\$/g;
|
|
2809
2809
|
var _LEGAL_IDENTIFIER_RE = /^[$A-Z_][0-9A-Z_$]*$/i;
|
|
2810
2810
|
var _INDENT_WITH = " ";
|
|
@@ -3289,7 +3289,7 @@ function _createIndent(count) {
|
|
|
3289
3289
|
return res;
|
|
3290
3290
|
}
|
|
3291
3291
|
|
|
3292
|
-
// bazel-out/
|
|
3292
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/util.mjs
|
|
3293
3293
|
function typeWithParameters(type, numParams) {
|
|
3294
3294
|
if (numParams === 0) {
|
|
3295
3295
|
return expressionType(type);
|
|
@@ -3354,7 +3354,7 @@ function generateForwardRef(expr) {
|
|
|
3354
3354
|
return importExpr(Identifiers.forwardRef).callFn([arrowFn([], expr)]);
|
|
3355
3355
|
}
|
|
3356
3356
|
|
|
3357
|
-
// bazel-out/
|
|
3357
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_factory.mjs
|
|
3358
3358
|
var R3FactoryDelegateType;
|
|
3359
3359
|
(function(R3FactoryDelegateType2) {
|
|
3360
3360
|
R3FactoryDelegateType2[R3FactoryDelegateType2["Class"] = 0] = "Class";
|
|
@@ -3499,7 +3499,40 @@ function getInjectFn(target) {
|
|
|
3499
3499
|
}
|
|
3500
3500
|
}
|
|
3501
3501
|
|
|
3502
|
-
// bazel-out/
|
|
3502
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/tags.mjs
|
|
3503
|
+
var TagContentType;
|
|
3504
|
+
(function(TagContentType2) {
|
|
3505
|
+
TagContentType2[TagContentType2["RAW_TEXT"] = 0] = "RAW_TEXT";
|
|
3506
|
+
TagContentType2[TagContentType2["ESCAPABLE_RAW_TEXT"] = 1] = "ESCAPABLE_RAW_TEXT";
|
|
3507
|
+
TagContentType2[TagContentType2["PARSABLE_DATA"] = 2] = "PARSABLE_DATA";
|
|
3508
|
+
})(TagContentType || (TagContentType = {}));
|
|
3509
|
+
function splitNsName(elementName) {
|
|
3510
|
+
if (elementName[0] != ":") {
|
|
3511
|
+
return [null, elementName];
|
|
3512
|
+
}
|
|
3513
|
+
const colonIndex = elementName.indexOf(":", 1);
|
|
3514
|
+
if (colonIndex === -1) {
|
|
3515
|
+
throw new Error(`Unsupported format "${elementName}" expecting ":namespace:name"`);
|
|
3516
|
+
}
|
|
3517
|
+
return [elementName.slice(1, colonIndex), elementName.slice(colonIndex + 1)];
|
|
3518
|
+
}
|
|
3519
|
+
function isNgContainer(tagName) {
|
|
3520
|
+
return splitNsName(tagName)[1] === "ng-container";
|
|
3521
|
+
}
|
|
3522
|
+
function isNgContent(tagName) {
|
|
3523
|
+
return splitNsName(tagName)[1] === "ng-content";
|
|
3524
|
+
}
|
|
3525
|
+
function isNgTemplate(tagName) {
|
|
3526
|
+
return splitNsName(tagName)[1] === "ng-template";
|
|
3527
|
+
}
|
|
3528
|
+
function getNsPrefix(fullName) {
|
|
3529
|
+
return fullName === null ? null : splitNsName(fullName)[0];
|
|
3530
|
+
}
|
|
3531
|
+
function mergeNsAndName(prefix, localName) {
|
|
3532
|
+
return prefix ? `:${prefix}:${localName}` : localName;
|
|
3533
|
+
}
|
|
3534
|
+
|
|
3535
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_ast.mjs
|
|
3503
3536
|
var Comment = class {
|
|
3504
3537
|
constructor(value, sourceSpan) {
|
|
3505
3538
|
this.value = value;
|
|
@@ -3880,7 +3913,7 @@ function visitAll(visitor, nodes) {
|
|
|
3880
3913
|
return result;
|
|
3881
3914
|
}
|
|
3882
3915
|
|
|
3883
|
-
// bazel-out/
|
|
3916
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/i18n_ast.mjs
|
|
3884
3917
|
var Message = class {
|
|
3885
3918
|
constructor(nodes, placeholders, placeholderToMessage, meaning, description, customId) {
|
|
3886
3919
|
this.nodes = nodes;
|
|
@@ -4040,7 +4073,7 @@ var LocalizeMessageStringVisitor = class {
|
|
|
4040
4073
|
}
|
|
4041
4074
|
};
|
|
4042
4075
|
|
|
4043
|
-
// bazel-out/
|
|
4076
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/serializers/xml_helper.mjs
|
|
4044
4077
|
var _Visitor = class {
|
|
4045
4078
|
visitTag(tag) {
|
|
4046
4079
|
const strAttrs = this._serializeAttributes(tag.attrs);
|
|
@@ -4068,12 +4101,12 @@ ${doctype.dtd}
|
|
|
4068
4101
|
};
|
|
4069
4102
|
var _visitor = new _Visitor();
|
|
4070
4103
|
|
|
4071
|
-
// bazel-out/
|
|
4104
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/serializers/xmb.mjs
|
|
4072
4105
|
function toPublicName(internalName) {
|
|
4073
4106
|
return internalName.toUpperCase().replace(/[^A-Z0-9_]/g, "_");
|
|
4074
4107
|
}
|
|
4075
4108
|
|
|
4076
|
-
// bazel-out/
|
|
4109
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/i18n/util.mjs
|
|
4077
4110
|
var CLOSURE_TRANSLATION_VAR_PREFIX = "MSG_";
|
|
4078
4111
|
var TRANSLATION_VAR_PREFIX = "i18n_";
|
|
4079
4112
|
var I18N_ATTR = "i18n";
|
|
@@ -4175,7 +4208,7 @@ function declareI18nVariable(variable2) {
|
|
|
4175
4208
|
return new DeclareVarStmt(variable2.name, void 0, INFERRED_TYPE, void 0, variable2.sourceSpan);
|
|
4176
4209
|
}
|
|
4177
4210
|
|
|
4178
|
-
// bazel-out/
|
|
4211
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/util.mjs
|
|
4179
4212
|
var UNSAFE_OBJECT_KEY_NAME_REGEXP = /[-.]/;
|
|
4180
4213
|
var TEMPORARY_NAME = "_t";
|
|
4181
4214
|
var CONTEXT_NAME = "ctx";
|
|
@@ -4342,6 +4375,23 @@ var DefinitionMap = class {
|
|
|
4342
4375
|
return literalMap(this.values);
|
|
4343
4376
|
}
|
|
4344
4377
|
};
|
|
4378
|
+
function createCssSelectorFromNode(node) {
|
|
4379
|
+
const elementName = node instanceof Element ? node.name : "ng-template";
|
|
4380
|
+
const attributes = getAttrsForDirectiveMatching(node);
|
|
4381
|
+
const cssSelector = new CssSelector();
|
|
4382
|
+
const elementNameNoNs = splitNsName(elementName)[1];
|
|
4383
|
+
cssSelector.setElement(elementNameNoNs);
|
|
4384
|
+
Object.getOwnPropertyNames(attributes).forEach((name) => {
|
|
4385
|
+
const nameNoNs = splitNsName(name)[1];
|
|
4386
|
+
const value = attributes[name];
|
|
4387
|
+
cssSelector.addAttribute(nameNoNs, value);
|
|
4388
|
+
if (name.toLowerCase() === "class") {
|
|
4389
|
+
const classes = value.trim().split(/\s+/);
|
|
4390
|
+
classes.forEach((className) => cssSelector.addClassName(className));
|
|
4391
|
+
}
|
|
4392
|
+
});
|
|
4393
|
+
return cssSelector;
|
|
4394
|
+
}
|
|
4345
4395
|
function getAttrsForDirectiveMatching(elOrTpl) {
|
|
4346
4396
|
const attributesMap = {};
|
|
4347
4397
|
if (elOrTpl instanceof Template && elOrTpl.tagName !== "ng-template") {
|
|
@@ -4398,7 +4448,7 @@ function getInstructionStatements(instructions) {
|
|
|
4398
4448
|
return statements;
|
|
4399
4449
|
}
|
|
4400
4450
|
|
|
4401
|
-
// bazel-out/
|
|
4451
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/injectable_compiler_2.mjs
|
|
4402
4452
|
function compileInjectable(meta, resolveForwardRefs) {
|
|
4403
4453
|
let result = null;
|
|
4404
4454
|
const factoryMeta = {
|
|
@@ -4483,7 +4533,7 @@ function createFactoryFunction(type) {
|
|
|
4483
4533
|
return arrowFn([new FnParam("t", DYNAMIC_TYPE)], type.prop("\u0275fac").callFn([variable("t")]));
|
|
4484
4534
|
}
|
|
4485
4535
|
|
|
4486
|
-
// bazel-out/
|
|
4536
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/assertions.mjs
|
|
4487
4537
|
var UNUSABLE_INTERPOLATION_REGEXPS = [
|
|
4488
4538
|
/^\s*$/,
|
|
4489
4539
|
/[<>]/,
|
|
@@ -4505,7 +4555,7 @@ function assertInterpolationSymbols(identifier, value) {
|
|
|
4505
4555
|
}
|
|
4506
4556
|
}
|
|
4507
4557
|
|
|
4508
|
-
// bazel-out/
|
|
4558
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/defaults.mjs
|
|
4509
4559
|
var InterpolationConfig = class {
|
|
4510
4560
|
static fromArray(markers) {
|
|
4511
4561
|
if (!markers) {
|
|
@@ -4522,7 +4572,7 @@ var InterpolationConfig = class {
|
|
|
4522
4572
|
var DEFAULT_INTERPOLATION_CONFIG = new InterpolationConfig("{{", "}}");
|
|
4523
4573
|
var DEFAULT_CONTAINER_BLOCKS = /* @__PURE__ */ new Set(["switch"]);
|
|
4524
4574
|
|
|
4525
|
-
// bazel-out/
|
|
4575
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/chars.mjs
|
|
4526
4576
|
var $EOF = 0;
|
|
4527
4577
|
var $BSPACE = 8;
|
|
4528
4578
|
var $TAB = 9;
|
|
@@ -4604,7 +4654,7 @@ function isQuote(code) {
|
|
|
4604
4654
|
return code === $SQ || code === $DQ || code === $BT;
|
|
4605
4655
|
}
|
|
4606
4656
|
|
|
4607
|
-
// bazel-out/
|
|
4657
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/parse_util.mjs
|
|
4608
4658
|
var ParseLocation = class {
|
|
4609
4659
|
constructor(file, offset, line, col) {
|
|
4610
4660
|
this.file = file;
|
|
@@ -4751,7 +4801,7 @@ function sanitizeIdentifier(name) {
|
|
|
4751
4801
|
return name.replace(/\W/g, "_");
|
|
4752
4802
|
}
|
|
4753
4803
|
|
|
4754
|
-
// bazel-out/
|
|
4804
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/abstract_js_emitter.mjs
|
|
4755
4805
|
var makeTemplateObjectPolyfill = '(this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e})';
|
|
4756
4806
|
var AbstractJsEmitterVisitor = class extends AbstractEmitterVisitor {
|
|
4757
4807
|
constructor() {
|
|
@@ -4844,7 +4894,7 @@ var AbstractJsEmitterVisitor = class extends AbstractEmitterVisitor {
|
|
|
4844
4894
|
}
|
|
4845
4895
|
};
|
|
4846
4896
|
|
|
4847
|
-
// bazel-out/
|
|
4897
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/output_jit_trusted_types.mjs
|
|
4848
4898
|
var policy;
|
|
4849
4899
|
function getPolicy() {
|
|
4850
4900
|
if (policy === void 0) {
|
|
@@ -4882,7 +4932,7 @@ function newTrustedFunctionForJIT(...args) {
|
|
|
4882
4932
|
return fn2.bind(_global);
|
|
4883
4933
|
}
|
|
4884
4934
|
|
|
4885
|
-
// bazel-out/
|
|
4935
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/output_jit.mjs
|
|
4886
4936
|
var JitEvaluator = class {
|
|
4887
4937
|
evaluateStatements(sourceUrl, statements, refResolver, createSourceMaps) {
|
|
4888
4938
|
const converter = new JitEmitterVisitor(refResolver);
|
|
@@ -4973,7 +5023,7 @@ function isUseStrictStatement(statement) {
|
|
|
4973
5023
|
return statement.isEquivalent(literal("use strict").toStmt());
|
|
4974
5024
|
}
|
|
4975
5025
|
|
|
4976
|
-
// bazel-out/
|
|
5026
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_injector_compiler.mjs
|
|
4977
5027
|
function compileInjector(meta) {
|
|
4978
5028
|
const definitionMap = new DefinitionMap();
|
|
4979
5029
|
if (meta.providers !== null) {
|
|
@@ -4990,7 +5040,7 @@ function createInjectorType(meta) {
|
|
|
4990
5040
|
return new ExpressionType(importExpr(Identifiers.InjectorDeclaration, [new ExpressionType(meta.type.type)]));
|
|
4991
5041
|
}
|
|
4992
5042
|
|
|
4993
|
-
// bazel-out/
|
|
5043
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_jit.mjs
|
|
4994
5044
|
var R3JitReflector = class {
|
|
4995
5045
|
constructor(context) {
|
|
4996
5046
|
this.context = context;
|
|
@@ -5006,7 +5056,7 @@ var R3JitReflector = class {
|
|
|
5006
5056
|
}
|
|
5007
5057
|
};
|
|
5008
5058
|
|
|
5009
|
-
// bazel-out/
|
|
5059
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_module_compiler.mjs
|
|
5010
5060
|
var R3SelectorScopeMode;
|
|
5011
5061
|
(function(R3SelectorScopeMode2) {
|
|
5012
5062
|
R3SelectorScopeMode2[R3SelectorScopeMode2["Inline"] = 0] = "Inline";
|
|
@@ -5147,7 +5197,7 @@ function tupleOfTypes(types) {
|
|
|
5147
5197
|
return types.length > 0 ? expressionType(literalArr(typeofTypes)) : NONE_TYPE;
|
|
5148
5198
|
}
|
|
5149
5199
|
|
|
5150
|
-
// bazel-out/
|
|
5200
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_pipe_compiler.mjs
|
|
5151
5201
|
function compilePipeFromMetadata(metadata) {
|
|
5152
5202
|
const definitionMapValues = [];
|
|
5153
5203
|
definitionMapValues.push({ key: "name", value: literal(metadata.pipeName), quoted: false });
|
|
@@ -5168,7 +5218,7 @@ function createPipeType(metadata) {
|
|
|
5168
5218
|
]));
|
|
5169
5219
|
}
|
|
5170
5220
|
|
|
5171
|
-
// bazel-out/
|
|
5221
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/api.mjs
|
|
5172
5222
|
var R3TemplateDependencyKind;
|
|
5173
5223
|
(function(R3TemplateDependencyKind2) {
|
|
5174
5224
|
R3TemplateDependencyKind2[R3TemplateDependencyKind2["Directive"] = 0] = "Directive";
|
|
@@ -5176,7 +5226,7 @@ var R3TemplateDependencyKind;
|
|
|
5176
5226
|
R3TemplateDependencyKind2[R3TemplateDependencyKind2["NgModule"] = 2] = "NgModule";
|
|
5177
5227
|
})(R3TemplateDependencyKind || (R3TemplateDependencyKind = {}));
|
|
5178
5228
|
|
|
5179
|
-
// bazel-out/
|
|
5229
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/expression_parser/ast.mjs
|
|
5180
5230
|
var ParserError = class {
|
|
5181
5231
|
constructor(message, input, errLocation, ctxLocation) {
|
|
5182
5232
|
this.input = input;
|
|
@@ -5842,7 +5892,7 @@ var BoundElementProperty = class {
|
|
|
5842
5892
|
}
|
|
5843
5893
|
};
|
|
5844
5894
|
|
|
5845
|
-
// bazel-out/
|
|
5895
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/compiler_util/expression_converter.mjs
|
|
5846
5896
|
var _EventHandlerVars = class {
|
|
5847
5897
|
};
|
|
5848
5898
|
var EventHandlerVars = _EventHandlerVars;
|
|
@@ -6483,7 +6533,7 @@ var BuiltinFunctionCall = class extends Call {
|
|
|
6483
6533
|
}
|
|
6484
6534
|
};
|
|
6485
6535
|
|
|
6486
|
-
// bazel-out/
|
|
6536
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/schema/dom_security_schema.mjs
|
|
6487
6537
|
var _SECURITY_SCHEMA;
|
|
6488
6538
|
function SECURITY_SCHEMA() {
|
|
6489
6539
|
if (!_SECURITY_SCHEMA) {
|
|
@@ -6541,7 +6591,7 @@ function isIframeSecuritySensitiveAttr(attrName) {
|
|
|
6541
6591
|
return IFRAME_SECURITY_SENSITIVE_ATTRS.has(attrName.toLowerCase());
|
|
6542
6592
|
}
|
|
6543
6593
|
|
|
6544
|
-
// bazel-out/
|
|
6594
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/shadow_css.mjs
|
|
6545
6595
|
var animationKeywords = /* @__PURE__ */ new Set([
|
|
6546
6596
|
"inherit",
|
|
6547
6597
|
"initial",
|
|
@@ -7012,7 +7062,7 @@ function repeatGroups(groups, multiples) {
|
|
|
7012
7062
|
}
|
|
7013
7063
|
}
|
|
7014
7064
|
|
|
7015
|
-
// bazel-out/
|
|
7065
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/enums.mjs
|
|
7016
7066
|
var OpKind;
|
|
7017
7067
|
(function(OpKind2) {
|
|
7018
7068
|
OpKind2[OpKind2["ListEnd"] = 0] = "ListEnd";
|
|
@@ -7059,6 +7109,7 @@ var OpKind;
|
|
|
7059
7109
|
OpKind2[OpKind2["IcuStart"] = 41] = "IcuStart";
|
|
7060
7110
|
OpKind2[OpKind2["IcuEnd"] = 42] = "IcuEnd";
|
|
7061
7111
|
OpKind2[OpKind2["I18nContext"] = 43] = "I18nContext";
|
|
7112
|
+
OpKind2[OpKind2["I18nAttributes"] = 44] = "I18nAttributes";
|
|
7062
7113
|
})(OpKind || (OpKind = {}));
|
|
7063
7114
|
var ExpressionKind;
|
|
7064
7115
|
(function(ExpressionKind2) {
|
|
@@ -7135,6 +7186,11 @@ var I18nParamResolutionTime;
|
|
|
7135
7186
|
I18nParamResolutionTime2[I18nParamResolutionTime2["Creation"] = 0] = "Creation";
|
|
7136
7187
|
I18nParamResolutionTime2[I18nParamResolutionTime2["Postproccessing"] = 1] = "Postproccessing";
|
|
7137
7188
|
})(I18nParamResolutionTime || (I18nParamResolutionTime = {}));
|
|
7189
|
+
var I18nExpressionFor;
|
|
7190
|
+
(function(I18nExpressionFor2) {
|
|
7191
|
+
I18nExpressionFor2[I18nExpressionFor2["I18nText"] = 0] = "I18nText";
|
|
7192
|
+
I18nExpressionFor2[I18nExpressionFor2["I18nAttribute"] = 1] = "I18nAttribute";
|
|
7193
|
+
})(I18nExpressionFor || (I18nExpressionFor = {}));
|
|
7138
7194
|
var I18nParamValueFlags;
|
|
7139
7195
|
(function(I18nParamValueFlags2) {
|
|
7140
7196
|
I18nParamValueFlags2[I18nParamValueFlags2["None"] = 0] = "None";
|
|
@@ -7166,8 +7222,20 @@ var DerivedRepeaterVarIdentity;
|
|
|
7166
7222
|
DerivedRepeaterVarIdentity2[DerivedRepeaterVarIdentity2["Even"] = 2] = "Even";
|
|
7167
7223
|
DerivedRepeaterVarIdentity2[DerivedRepeaterVarIdentity2["Odd"] = 3] = "Odd";
|
|
7168
7224
|
})(DerivedRepeaterVarIdentity || (DerivedRepeaterVarIdentity = {}));
|
|
7225
|
+
var I18nContextKind;
|
|
7226
|
+
(function(I18nContextKind2) {
|
|
7227
|
+
I18nContextKind2[I18nContextKind2["RootI18n"] = 0] = "RootI18n";
|
|
7228
|
+
I18nContextKind2[I18nContextKind2["Icu"] = 1] = "Icu";
|
|
7229
|
+
I18nContextKind2[I18nContextKind2["Attr"] = 2] = "Attr";
|
|
7230
|
+
})(I18nContextKind || (I18nContextKind = {}));
|
|
7231
|
+
var TemplateKind;
|
|
7232
|
+
(function(TemplateKind2) {
|
|
7233
|
+
TemplateKind2[TemplateKind2["NgTemplate"] = 0] = "NgTemplate";
|
|
7234
|
+
TemplateKind2[TemplateKind2["Structural"] = 1] = "Structural";
|
|
7235
|
+
TemplateKind2[TemplateKind2["Block"] = 2] = "Block";
|
|
7236
|
+
})(TemplateKind || (TemplateKind = {}));
|
|
7169
7237
|
|
|
7170
|
-
// bazel-out/
|
|
7238
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/traits.mjs
|
|
7171
7239
|
var ConsumesSlot = Symbol("ConsumesSlot");
|
|
7172
7240
|
var DependsOnSlotContext = Symbol("DependsOnSlotContext");
|
|
7173
7241
|
var ConsumesVarsTrait = Symbol("ConsumesVars");
|
|
@@ -7199,7 +7267,7 @@ function hasUsesVarOffsetTrait(expr) {
|
|
|
7199
7267
|
return expr[UsesVarOffset] === true;
|
|
7200
7268
|
}
|
|
7201
7269
|
|
|
7202
|
-
// bazel-out/
|
|
7270
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/shared.mjs
|
|
7203
7271
|
function createStatementOp(statement) {
|
|
7204
7272
|
return __spreadValues({
|
|
7205
7273
|
kind: OpKind.Statement,
|
|
@@ -7221,23 +7289,26 @@ var NEW_OP = {
|
|
|
7221
7289
|
next: null
|
|
7222
7290
|
};
|
|
7223
7291
|
|
|
7224
|
-
// bazel-out/
|
|
7225
|
-
function createInterpolateTextOp(xref, interpolation,
|
|
7292
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/update.mjs
|
|
7293
|
+
function createInterpolateTextOp(xref, interpolation, sourceSpan) {
|
|
7226
7294
|
return __spreadValues(__spreadValues(__spreadValues({
|
|
7227
7295
|
kind: OpKind.InterpolateText,
|
|
7228
7296
|
target: xref,
|
|
7229
7297
|
interpolation,
|
|
7230
|
-
i18nPlaceholders,
|
|
7231
7298
|
sourceSpan
|
|
7232
7299
|
}, TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS), NEW_OP);
|
|
7233
7300
|
}
|
|
7234
7301
|
var Interpolation2 = class {
|
|
7235
|
-
constructor(strings, expressions) {
|
|
7302
|
+
constructor(strings, expressions, i18nPlaceholders) {
|
|
7236
7303
|
this.strings = strings;
|
|
7237
7304
|
this.expressions = expressions;
|
|
7305
|
+
this.i18nPlaceholders = i18nPlaceholders;
|
|
7306
|
+
if (i18nPlaceholders.length !== 0 && i18nPlaceholders.length !== expressions.length) {
|
|
7307
|
+
throw new Error(`Expected ${expressions.length} placeholders to match interpolation expression count, but got ${i18nPlaceholders.length}`);
|
|
7308
|
+
}
|
|
7238
7309
|
}
|
|
7239
7310
|
};
|
|
7240
|
-
function createBindingOp(target, kind, name, expression, unit, securityContext, isTextAttribute,
|
|
7311
|
+
function createBindingOp(target, kind, name, expression, unit, securityContext, isTextAttribute, isStructuralTemplate, i18nContext, sourceSpan) {
|
|
7241
7312
|
return __spreadValues({
|
|
7242
7313
|
kind: OpKind.Binding,
|
|
7243
7314
|
bindingKind: kind,
|
|
@@ -7247,11 +7318,12 @@ function createBindingOp(target, kind, name, expression, unit, securityContext,
|
|
|
7247
7318
|
unit,
|
|
7248
7319
|
securityContext,
|
|
7249
7320
|
isTextAttribute,
|
|
7250
|
-
|
|
7321
|
+
isStructuralTemplate,
|
|
7322
|
+
i18nContext,
|
|
7251
7323
|
sourceSpan
|
|
7252
7324
|
}, NEW_OP);
|
|
7253
7325
|
}
|
|
7254
|
-
function createPropertyOp(target, name, expression, isAnimationTrigger, securityContext,
|
|
7326
|
+
function createPropertyOp(target, name, expression, isAnimationTrigger, securityContext, isStructuralTemplate, i18nContext, sourceSpan) {
|
|
7255
7327
|
return __spreadValues(__spreadValues(__spreadValues({
|
|
7256
7328
|
kind: OpKind.Property,
|
|
7257
7329
|
target,
|
|
@@ -7260,7 +7332,8 @@ function createPropertyOp(target, name, expression, isAnimationTrigger, security
|
|
|
7260
7332
|
isAnimationTrigger,
|
|
7261
7333
|
securityContext,
|
|
7262
7334
|
sanitizer: null,
|
|
7263
|
-
|
|
7335
|
+
isStructuralTemplate,
|
|
7336
|
+
i18nContext,
|
|
7264
7337
|
sourceSpan
|
|
7265
7338
|
}, TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS), NEW_OP);
|
|
7266
7339
|
}
|
|
@@ -7299,7 +7372,7 @@ function createClassMapOp(xref, expression, sourceSpan) {
|
|
|
7299
7372
|
sourceSpan
|
|
7300
7373
|
}, TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS), NEW_OP);
|
|
7301
7374
|
}
|
|
7302
|
-
function createAttributeOp(target, name, expression, securityContext, isTextAttribute,
|
|
7375
|
+
function createAttributeOp(target, name, expression, securityContext, isTextAttribute, isStructuralTemplate, i18nContext, sourceSpan) {
|
|
7303
7376
|
return __spreadValues(__spreadValues(__spreadValues({
|
|
7304
7377
|
kind: OpKind.Attribute,
|
|
7305
7378
|
target,
|
|
@@ -7308,7 +7381,8 @@ function createAttributeOp(target, name, expression, securityContext, isTextAttr
|
|
|
7308
7381
|
securityContext,
|
|
7309
7382
|
sanitizer: null,
|
|
7310
7383
|
isTextAttribute,
|
|
7311
|
-
|
|
7384
|
+
isStructuralTemplate,
|
|
7385
|
+
i18nContext,
|
|
7312
7386
|
sourceSpan
|
|
7313
7387
|
}, TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS), NEW_OP);
|
|
7314
7388
|
}
|
|
@@ -7349,28 +7423,31 @@ function createDeferWhenOp(target, expr, prefetch, sourceSpan) {
|
|
|
7349
7423
|
sourceSpan
|
|
7350
7424
|
}, NEW_OP), TRAIT_DEPENDS_ON_SLOT_CONTEXT);
|
|
7351
7425
|
}
|
|
7352
|
-
function createI18nExpressionOp(context, target, handle, expression, i18nPlaceholder, resolutionTime, sourceSpan) {
|
|
7426
|
+
function createI18nExpressionOp(context, target, i18nOwner, handle, expression, i18nPlaceholder, resolutionTime, usage, name, sourceSpan) {
|
|
7353
7427
|
return __spreadValues(__spreadValues(__spreadValues({
|
|
7354
7428
|
kind: OpKind.I18nExpression,
|
|
7355
7429
|
context,
|
|
7356
7430
|
target,
|
|
7431
|
+
i18nOwner,
|
|
7357
7432
|
handle,
|
|
7358
7433
|
expression,
|
|
7359
7434
|
i18nPlaceholder,
|
|
7360
7435
|
resolutionTime,
|
|
7436
|
+
usage,
|
|
7437
|
+
name,
|
|
7361
7438
|
sourceSpan
|
|
7362
7439
|
}, NEW_OP), TRAIT_CONSUMES_VARS), TRAIT_DEPENDS_ON_SLOT_CONTEXT);
|
|
7363
7440
|
}
|
|
7364
|
-
function createI18nApplyOp(
|
|
7441
|
+
function createI18nApplyOp(owner, handle, sourceSpan) {
|
|
7365
7442
|
return __spreadValues({
|
|
7366
7443
|
kind: OpKind.I18nApply,
|
|
7367
|
-
|
|
7444
|
+
owner,
|
|
7368
7445
|
handle,
|
|
7369
7446
|
sourceSpan
|
|
7370
7447
|
}, NEW_OP);
|
|
7371
7448
|
}
|
|
7372
7449
|
|
|
7373
|
-
// bazel-out/
|
|
7450
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/expression.mjs
|
|
7374
7451
|
var _a;
|
|
7375
7452
|
var _b;
|
|
7376
7453
|
var _c;
|
|
@@ -8140,6 +8217,7 @@ function transformExpressionsInOp(op, transform2, flags) {
|
|
|
8140
8217
|
case OpKind.ProjectionDef:
|
|
8141
8218
|
case OpKind.Template:
|
|
8142
8219
|
case OpKind.Text:
|
|
8220
|
+
case OpKind.I18nAttributes:
|
|
8143
8221
|
break;
|
|
8144
8222
|
default:
|
|
8145
8223
|
throw new Error(`AssertionError: transformExpressionsInOp doesn't handle ${OpKind[op.kind]}`);
|
|
@@ -8151,6 +8229,8 @@ function transformExpressionsInExpression(expr, transform2, flags) {
|
|
|
8151
8229
|
} else if (expr instanceof BinaryOperatorExpr) {
|
|
8152
8230
|
expr.lhs = transformExpressionsInExpression(expr.lhs, transform2, flags);
|
|
8153
8231
|
expr.rhs = transformExpressionsInExpression(expr.rhs, transform2, flags);
|
|
8232
|
+
} else if (expr instanceof UnaryOperatorExpr) {
|
|
8233
|
+
expr.expr = transformExpressionsInExpression(expr.expr, transform2, flags);
|
|
8154
8234
|
} else if (expr instanceof ReadPropExpr) {
|
|
8155
8235
|
expr.receiver = transformExpressionsInExpression(expr.receiver, transform2, flags);
|
|
8156
8236
|
} else if (expr instanceof ReadKeyExpr) {
|
|
@@ -8190,6 +8270,8 @@ function transformExpressionsInExpression(expr, transform2, flags) {
|
|
|
8190
8270
|
for (let i = 0; i < expr.expressions.length; i++) {
|
|
8191
8271
|
expr.expressions[i] = transformExpressionsInExpression(expr.expressions[i], transform2, flags);
|
|
8192
8272
|
}
|
|
8273
|
+
} else if (expr instanceof NotExpr) {
|
|
8274
|
+
expr.condition = transformExpressionsInExpression(expr.condition, transform2, flags);
|
|
8193
8275
|
} else if (expr instanceof ReadVarExpr || expr instanceof ExternalExpr || expr instanceof LiteralExpr) {
|
|
8194
8276
|
} else {
|
|
8195
8277
|
throw new Error(`Unhandled expression kind: ${expr.constructor.name}`);
|
|
@@ -8221,7 +8303,7 @@ function isStringLiteral(expr) {
|
|
|
8221
8303
|
return expr instanceof LiteralExpr && typeof expr.value === "string";
|
|
8222
8304
|
}
|
|
8223
8305
|
|
|
8224
|
-
// bazel-out/
|
|
8306
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/operations.mjs
|
|
8225
8307
|
var _OpList = class {
|
|
8226
8308
|
constructor() {
|
|
8227
8309
|
this.debugListId = _OpList.nextListId++;
|
|
@@ -8412,14 +8494,14 @@ var OpList = _OpList;
|
|
|
8412
8494
|
_OpList.nextListId = 0;
|
|
8413
8495
|
})();
|
|
8414
8496
|
|
|
8415
|
-
// bazel-out/
|
|
8497
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/handle.mjs
|
|
8416
8498
|
var SlotHandle = class {
|
|
8417
8499
|
constructor() {
|
|
8418
8500
|
this.slot = null;
|
|
8419
8501
|
}
|
|
8420
8502
|
};
|
|
8421
8503
|
|
|
8422
|
-
// bazel-out/
|
|
8504
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/create.mjs
|
|
8423
8505
|
var elementContainerOpKinds = /* @__PURE__ */ new Set([
|
|
8424
8506
|
OpKind.Element,
|
|
8425
8507
|
OpKind.ElementStart,
|
|
@@ -8445,10 +8527,11 @@ function createElementStartOp(tag, xref, namespace, i18nPlaceholder, sourceSpan)
|
|
|
8445
8527
|
sourceSpan
|
|
8446
8528
|
}, TRAIT_CONSUMES_SLOT), NEW_OP);
|
|
8447
8529
|
}
|
|
8448
|
-
function createTemplateOp(xref, tag, functionNameSuffix, namespace, i18nPlaceholder, sourceSpan) {
|
|
8530
|
+
function createTemplateOp(xref, templateKind, tag, functionNameSuffix, namespace, i18nPlaceholder, sourceSpan) {
|
|
8449
8531
|
return __spreadValues(__spreadValues({
|
|
8450
8532
|
kind: OpKind.Template,
|
|
8451
8533
|
xref,
|
|
8534
|
+
templateKind,
|
|
8452
8535
|
attributes: null,
|
|
8453
8536
|
tag,
|
|
8454
8537
|
handle: new SlotHandle(),
|
|
@@ -8549,25 +8632,27 @@ function createProjectionDefOp(def) {
|
|
|
8549
8632
|
def
|
|
8550
8633
|
}, NEW_OP);
|
|
8551
8634
|
}
|
|
8552
|
-
function createProjectionOp(xref, selector, sourceSpan) {
|
|
8635
|
+
function createProjectionOp(xref, selector, i18nPlaceholder, attributes, sourceSpan) {
|
|
8553
8636
|
return __spreadValues(__spreadValues({
|
|
8554
8637
|
kind: OpKind.Projection,
|
|
8555
8638
|
xref,
|
|
8556
8639
|
handle: new SlotHandle(),
|
|
8557
8640
|
selector,
|
|
8641
|
+
i18nPlaceholder,
|
|
8558
8642
|
projectionSlotIndex: 0,
|
|
8559
|
-
attributes
|
|
8643
|
+
attributes,
|
|
8560
8644
|
localRefs: [],
|
|
8561
8645
|
sourceSpan
|
|
8562
8646
|
}, NEW_OP), TRAIT_CONSUMES_SLOT);
|
|
8563
8647
|
}
|
|
8564
|
-
function createExtractedAttributeOp(target, bindingKind, name, expression) {
|
|
8648
|
+
function createExtractedAttributeOp(target, bindingKind, name, expression, i18nContext) {
|
|
8565
8649
|
return __spreadValues({
|
|
8566
8650
|
kind: OpKind.ExtractedAttribute,
|
|
8567
8651
|
target,
|
|
8568
8652
|
bindingKind,
|
|
8569
8653
|
name,
|
|
8570
|
-
expression
|
|
8654
|
+
expression,
|
|
8655
|
+
i18nContext
|
|
8571
8656
|
}, NEW_OP);
|
|
8572
8657
|
}
|
|
8573
8658
|
function createDeferOp(xref, main, mainSlot, metadata, sourceSpan) {
|
|
@@ -8604,10 +8689,11 @@ function createDeferOnOp(defer2, trigger, prefetch, sourceSpan) {
|
|
|
8604
8689
|
sourceSpan
|
|
8605
8690
|
}, NEW_OP);
|
|
8606
8691
|
}
|
|
8607
|
-
function createI18nMessageOp(xref, i18nBlock, message, messagePlaceholder, params, postprocessingParams, needsPostprocessing) {
|
|
8692
|
+
function createI18nMessageOp(xref, i18nContext, i18nBlock, message, messagePlaceholder, params, postprocessingParams, needsPostprocessing) {
|
|
8608
8693
|
return __spreadValues({
|
|
8609
8694
|
kind: OpKind.I18nMessage,
|
|
8610
8695
|
xref,
|
|
8696
|
+
i18nContext,
|
|
8611
8697
|
i18nBlock,
|
|
8612
8698
|
message,
|
|
8613
8699
|
messagePlaceholder,
|
|
@@ -8651,9 +8737,13 @@ function createIcuEndOp(xref) {
|
|
|
8651
8737
|
xref
|
|
8652
8738
|
}, NEW_OP);
|
|
8653
8739
|
}
|
|
8654
|
-
function createI18nContextOp(xref, i18nBlock, message, sourceSpan) {
|
|
8740
|
+
function createI18nContextOp(contextKind, xref, i18nBlock, message, sourceSpan) {
|
|
8741
|
+
if (i18nBlock === null && contextKind !== I18nContextKind.Attr) {
|
|
8742
|
+
throw new Error("AssertionError: i18nBlock must be provided for non-attribute contexts.");
|
|
8743
|
+
}
|
|
8655
8744
|
return __spreadValues({
|
|
8656
8745
|
kind: OpKind.I18nContext,
|
|
8746
|
+
contextKind,
|
|
8657
8747
|
xref,
|
|
8658
8748
|
i18nBlock,
|
|
8659
8749
|
message,
|
|
@@ -8662,22 +8752,32 @@ function createI18nContextOp(xref, i18nBlock, message, sourceSpan) {
|
|
|
8662
8752
|
postprocessingParams: /* @__PURE__ */ new Map()
|
|
8663
8753
|
}, NEW_OP);
|
|
8664
8754
|
}
|
|
8755
|
+
function createI18nAttributesOp(xref, handle, target) {
|
|
8756
|
+
return __spreadValues(__spreadValues({
|
|
8757
|
+
kind: OpKind.I18nAttributes,
|
|
8758
|
+
xref,
|
|
8759
|
+
handle,
|
|
8760
|
+
target,
|
|
8761
|
+
i18nAttributesConfig: null
|
|
8762
|
+
}, NEW_OP), TRAIT_CONSUMES_SLOT);
|
|
8763
|
+
}
|
|
8665
8764
|
|
|
8666
|
-
// bazel-out/
|
|
8667
|
-
function createHostPropertyOp(name, expression, isAnimationTrigger, sourceSpan) {
|
|
8765
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/host.mjs
|
|
8766
|
+
function createHostPropertyOp(name, expression, isAnimationTrigger, i18nContext, sourceSpan) {
|
|
8668
8767
|
return __spreadValues(__spreadValues({
|
|
8669
8768
|
kind: OpKind.HostProperty,
|
|
8670
8769
|
name,
|
|
8671
8770
|
expression,
|
|
8672
8771
|
isAnimationTrigger,
|
|
8772
|
+
i18nContext,
|
|
8673
8773
|
sourceSpan
|
|
8674
8774
|
}, TRAIT_CONSUMES_VARS), NEW_OP);
|
|
8675
8775
|
}
|
|
8676
8776
|
|
|
8677
|
-
// bazel-out/
|
|
8777
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/variable.mjs
|
|
8678
8778
|
var CTX_REF = "CTX_REF_MARKER";
|
|
8679
8779
|
|
|
8680
|
-
// bazel-out/
|
|
8780
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/compilation.mjs
|
|
8681
8781
|
var CompilationJobKind;
|
|
8682
8782
|
(function(CompilationJobKind2) {
|
|
8683
8783
|
CompilationJobKind2[CompilationJobKind2["Tmpl"] = 0] = "Tmpl";
|
|
@@ -8784,7 +8884,7 @@ var HostBindingCompilationUnit = class extends CompilationUnit {
|
|
|
8784
8884
|
}
|
|
8785
8885
|
};
|
|
8786
8886
|
|
|
8787
|
-
// bazel-out/
|
|
8887
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/any_cast.mjs
|
|
8788
8888
|
function deleteAnyCasts(job) {
|
|
8789
8889
|
for (const unit of job.units) {
|
|
8790
8890
|
for (const op of unit.ops()) {
|
|
@@ -8802,7 +8902,7 @@ function removeAnys(e) {
|
|
|
8802
8902
|
return e;
|
|
8803
8903
|
}
|
|
8804
8904
|
|
|
8805
|
-
// bazel-out/
|
|
8905
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/apply_i18n_expressions.mjs
|
|
8806
8906
|
function applyI18nExpressions(job) {
|
|
8807
8907
|
const i18nContexts = /* @__PURE__ */ new Map();
|
|
8808
8908
|
for (const unit of job.units) {
|
|
@@ -8815,7 +8915,7 @@ function applyI18nExpressions(job) {
|
|
|
8815
8915
|
for (const unit of job.units) {
|
|
8816
8916
|
for (const op of unit.update) {
|
|
8817
8917
|
if (op.kind === OpKind.I18nExpression && needsApplication(i18nContexts, op)) {
|
|
8818
|
-
OpList.insertAfter(createI18nApplyOp(op.
|
|
8918
|
+
OpList.insertAfter(createI18nApplyOp(op.i18nOwner, op.handle, null), op);
|
|
8819
8919
|
}
|
|
8820
8920
|
}
|
|
8821
8921
|
}
|
|
@@ -8827,16 +8927,27 @@ function needsApplication(i18nContexts, op) {
|
|
|
8827
8927
|
}
|
|
8828
8928
|
const context = i18nContexts.get(op.context);
|
|
8829
8929
|
const nextContext2 = i18nContexts.get(op.next.context);
|
|
8830
|
-
if (context
|
|
8930
|
+
if (context === void 0) {
|
|
8931
|
+
throw new Error("AssertionError: expected an I18nContextOp to exist for the I18nExpressionOp's context");
|
|
8932
|
+
}
|
|
8933
|
+
if (nextContext2 === void 0) {
|
|
8934
|
+
throw new Error("AssertionError: expected an I18nContextOp to exist for the next I18nExpressionOp's context");
|
|
8935
|
+
}
|
|
8936
|
+
if (context.i18nBlock !== null) {
|
|
8937
|
+
if (context.i18nBlock !== nextContext2.i18nBlock) {
|
|
8938
|
+
return true;
|
|
8939
|
+
}
|
|
8940
|
+
return false;
|
|
8941
|
+
}
|
|
8942
|
+
if (op.i18nOwner !== op.next.i18nOwner) {
|
|
8831
8943
|
return true;
|
|
8832
8944
|
}
|
|
8833
8945
|
return false;
|
|
8834
8946
|
}
|
|
8835
8947
|
|
|
8836
|
-
// bazel-out/
|
|
8948
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/assign_i18n_slot_dependencies.mjs
|
|
8837
8949
|
function assignI18nSlotDependencies(job) {
|
|
8838
8950
|
const i18nLastSlotConsumers = /* @__PURE__ */ new Map();
|
|
8839
|
-
const i18nContexts = /* @__PURE__ */ new Map();
|
|
8840
8951
|
let lastSlotConsumer = null;
|
|
8841
8952
|
let currentI18nOp = null;
|
|
8842
8953
|
for (const unit of job.units) {
|
|
@@ -8849,24 +8960,47 @@ function assignI18nSlotDependencies(job) {
|
|
|
8849
8960
|
currentI18nOp = op;
|
|
8850
8961
|
break;
|
|
8851
8962
|
case OpKind.I18nEnd:
|
|
8963
|
+
if (currentI18nOp === null) {
|
|
8964
|
+
throw new Error("AssertionError: Expected an active I18n block while calculating last slot consumers");
|
|
8965
|
+
}
|
|
8966
|
+
if (lastSlotConsumer === null) {
|
|
8967
|
+
throw new Error("AssertionError: Expected a last slot consumer while calculating last slot consumers");
|
|
8968
|
+
}
|
|
8852
8969
|
i18nLastSlotConsumers.set(currentI18nOp.xref, lastSlotConsumer);
|
|
8853
8970
|
currentI18nOp = null;
|
|
8854
8971
|
break;
|
|
8855
|
-
case OpKind.I18nContext:
|
|
8856
|
-
i18nContexts.set(op.xref, op);
|
|
8857
|
-
break;
|
|
8858
8972
|
}
|
|
8859
8973
|
}
|
|
8974
|
+
let opsToMove = [];
|
|
8975
|
+
let moveAfterTarget = null;
|
|
8976
|
+
let previousTarget = null;
|
|
8860
8977
|
for (const op of unit.update) {
|
|
8861
|
-
if (op
|
|
8862
|
-
|
|
8863
|
-
|
|
8978
|
+
if (hasDependsOnSlotContextTrait(op)) {
|
|
8979
|
+
if (moveAfterTarget !== null && previousTarget === moveAfterTarget && op.target !== previousTarget) {
|
|
8980
|
+
OpList.insertBefore(opsToMove, op);
|
|
8981
|
+
moveAfterTarget = null;
|
|
8982
|
+
opsToMove = [];
|
|
8983
|
+
}
|
|
8984
|
+
previousTarget = op.target;
|
|
8985
|
+
}
|
|
8986
|
+
if (op.kind === OpKind.I18nExpression && op.usage === I18nExpressionFor.I18nText) {
|
|
8987
|
+
OpList.remove(op);
|
|
8988
|
+
opsToMove.push(op);
|
|
8989
|
+
const target = i18nLastSlotConsumers.get(op.i18nOwner);
|
|
8990
|
+
if (target === void 0) {
|
|
8991
|
+
throw new Error("AssertionError: Expected to find a last slot consumer for an I18nExpressionOp");
|
|
8992
|
+
}
|
|
8993
|
+
op.target = target;
|
|
8994
|
+
moveAfterTarget = op.target;
|
|
8864
8995
|
}
|
|
8865
8996
|
}
|
|
8997
|
+
if (moveAfterTarget !== null) {
|
|
8998
|
+
unit.update.push(opsToMove);
|
|
8999
|
+
}
|
|
8866
9000
|
}
|
|
8867
9001
|
}
|
|
8868
9002
|
|
|
8869
|
-
// bazel-out/
|
|
9003
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/util/elements.mjs
|
|
8870
9004
|
function createOpXrefMap(unit) {
|
|
8871
9005
|
const map = /* @__PURE__ */ new Map();
|
|
8872
9006
|
for (const op of unit.create) {
|
|
@@ -8878,7 +9012,7 @@ function createOpXrefMap(unit) {
|
|
|
8878
9012
|
return map;
|
|
8879
9013
|
}
|
|
8880
9014
|
|
|
8881
|
-
// bazel-out/
|
|
9015
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/attribute_extraction.mjs
|
|
8882
9016
|
function extractAttributes(job) {
|
|
8883
9017
|
for (const unit of job.units) {
|
|
8884
9018
|
const elements = createOpXrefMap(unit);
|
|
@@ -8889,18 +9023,26 @@ function extractAttributes(job) {
|
|
|
8889
9023
|
break;
|
|
8890
9024
|
case OpKind.Property:
|
|
8891
9025
|
if (!op.isAnimationTrigger) {
|
|
8892
|
-
|
|
9026
|
+
let bindingKind;
|
|
9027
|
+
if (op.i18nContext !== null) {
|
|
9028
|
+
bindingKind = BindingKind.I18n;
|
|
9029
|
+
} else if (op.isStructuralTemplate) {
|
|
9030
|
+
bindingKind = BindingKind.Template;
|
|
9031
|
+
} else {
|
|
9032
|
+
bindingKind = BindingKind.Property;
|
|
9033
|
+
}
|
|
9034
|
+
OpList.insertBefore(createExtractedAttributeOp(op.target, bindingKind, op.name, null, null), lookupElement(elements, op.target));
|
|
8893
9035
|
}
|
|
8894
9036
|
break;
|
|
8895
9037
|
case OpKind.StyleProp:
|
|
8896
9038
|
case OpKind.ClassProp:
|
|
8897
9039
|
if (unit.job.compatibility === CompatibilityMode.TemplateDefinitionBuilder && op.expression instanceof EmptyExpr2) {
|
|
8898
|
-
OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.Property, op.name, null), lookupElement(elements, op.target));
|
|
9040
|
+
OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.Property, op.name, null, null), lookupElement(elements, op.target));
|
|
8899
9041
|
}
|
|
8900
9042
|
break;
|
|
8901
9043
|
case OpKind.Listener:
|
|
8902
9044
|
if (!op.isAnimationListener) {
|
|
8903
|
-
const extractedAttributeOp = createExtractedAttributeOp(op.target, BindingKind.Property, op.name, null);
|
|
9045
|
+
const extractedAttributeOp = createExtractedAttributeOp(op.target, BindingKind.Property, op.name, null, null);
|
|
8904
9046
|
if (job.kind === CompilationJobKind.Host) {
|
|
8905
9047
|
unit.create.push(extractedAttributeOp);
|
|
8906
9048
|
} else {
|
|
@@ -8934,7 +9076,7 @@ function extractAttributeOp(unit, op, elements) {
|
|
|
8934
9076
|
}
|
|
8935
9077
|
}
|
|
8936
9078
|
if (extractable) {
|
|
8937
|
-
const extractedAttributeOp = createExtractedAttributeOp(op.target, op.
|
|
9079
|
+
const extractedAttributeOp = createExtractedAttributeOp(op.target, op.isStructuralTemplate ? BindingKind.Template : BindingKind.Attribute, op.name, op.expression, op.i18nContext);
|
|
8938
9080
|
if (unit.job.kind === CompilationJobKind.Host) {
|
|
8939
9081
|
unit.create.push(extractedAttributeOp);
|
|
8940
9082
|
} else {
|
|
@@ -8945,7 +9087,7 @@ function extractAttributeOp(unit, op, elements) {
|
|
|
8945
9087
|
}
|
|
8946
9088
|
}
|
|
8947
9089
|
|
|
8948
|
-
// bazel-out/
|
|
9090
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/binding_specialization.mjs
|
|
8949
9091
|
function lookupElement2(elements, xref) {
|
|
8950
9092
|
const el = elements.get(xref);
|
|
8951
9093
|
if (el === void 0) {
|
|
@@ -8975,15 +9117,15 @@ function specializeBindings(job) {
|
|
|
8975
9117
|
const target = lookupElement2(elements, op.target);
|
|
8976
9118
|
target.nonBindable = true;
|
|
8977
9119
|
} else {
|
|
8978
|
-
OpList.replace(op, createAttributeOp(op.target, op.name, op.expression, op.securityContext, op.isTextAttribute, op.
|
|
9120
|
+
OpList.replace(op, createAttributeOp(op.target, op.name, op.expression, op.securityContext, op.isTextAttribute, op.isStructuralTemplate, op.i18nContext, op.sourceSpan));
|
|
8979
9121
|
}
|
|
8980
9122
|
break;
|
|
8981
9123
|
case BindingKind.Property:
|
|
8982
9124
|
case BindingKind.Animation:
|
|
8983
9125
|
if (job.kind === CompilationJobKind.Host) {
|
|
8984
|
-
OpList.replace(op, createHostPropertyOp(op.name, op.expression, op.bindingKind === BindingKind.Animation, op.sourceSpan));
|
|
9126
|
+
OpList.replace(op, createHostPropertyOp(op.name, op.expression, op.bindingKind === BindingKind.Animation, op.i18nContext, op.sourceSpan));
|
|
8985
9127
|
} else {
|
|
8986
|
-
OpList.replace(op, createPropertyOp(op.target, op.name, op.expression, op.bindingKind === BindingKind.Animation, op.securityContext, op.
|
|
9128
|
+
OpList.replace(op, createPropertyOp(op.target, op.name, op.expression, op.bindingKind === BindingKind.Animation, op.securityContext, op.isStructuralTemplate, op.i18nContext, op.sourceSpan));
|
|
8987
9129
|
}
|
|
8988
9130
|
break;
|
|
8989
9131
|
case BindingKind.I18n:
|
|
@@ -8995,7 +9137,7 @@ function specializeBindings(job) {
|
|
|
8995
9137
|
}
|
|
8996
9138
|
}
|
|
8997
9139
|
|
|
8998
|
-
// bazel-out/
|
|
9140
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/chaining.mjs
|
|
8999
9141
|
var CHAINABLE = /* @__PURE__ */ new Set([
|
|
9000
9142
|
Identifiers.attribute,
|
|
9001
9143
|
Identifiers.classProp,
|
|
@@ -9061,7 +9203,7 @@ function chainOperationsInList(opList) {
|
|
|
9061
9203
|
}
|
|
9062
9204
|
}
|
|
9063
9205
|
|
|
9064
|
-
// bazel-out/
|
|
9206
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/collapse_singleton_interpolations.mjs
|
|
9065
9207
|
function collapseSingletonInterpolations(job) {
|
|
9066
9208
|
for (const unit of job.units) {
|
|
9067
9209
|
for (const op of unit.update) {
|
|
@@ -9073,7 +9215,7 @@ function collapseSingletonInterpolations(job) {
|
|
|
9073
9215
|
}
|
|
9074
9216
|
}
|
|
9075
9217
|
|
|
9076
|
-
// bazel-out/
|
|
9218
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/conditionals.mjs
|
|
9077
9219
|
function generateConditionalExpressions(job) {
|
|
9078
9220
|
for (const unit of job.units) {
|
|
9079
9221
|
for (const op of unit.ops()) {
|
|
@@ -9110,40 +9252,7 @@ function generateConditionalExpressions(job) {
|
|
|
9110
9252
|
}
|
|
9111
9253
|
}
|
|
9112
9254
|
|
|
9113
|
-
// bazel-out/
|
|
9114
|
-
var TagContentType;
|
|
9115
|
-
(function(TagContentType2) {
|
|
9116
|
-
TagContentType2[TagContentType2["RAW_TEXT"] = 0] = "RAW_TEXT";
|
|
9117
|
-
TagContentType2[TagContentType2["ESCAPABLE_RAW_TEXT"] = 1] = "ESCAPABLE_RAW_TEXT";
|
|
9118
|
-
TagContentType2[TagContentType2["PARSABLE_DATA"] = 2] = "PARSABLE_DATA";
|
|
9119
|
-
})(TagContentType || (TagContentType = {}));
|
|
9120
|
-
function splitNsName(elementName) {
|
|
9121
|
-
if (elementName[0] != ":") {
|
|
9122
|
-
return [null, elementName];
|
|
9123
|
-
}
|
|
9124
|
-
const colonIndex = elementName.indexOf(":", 1);
|
|
9125
|
-
if (colonIndex === -1) {
|
|
9126
|
-
throw new Error(`Unsupported format "${elementName}" expecting ":namespace:name"`);
|
|
9127
|
-
}
|
|
9128
|
-
return [elementName.slice(1, colonIndex), elementName.slice(colonIndex + 1)];
|
|
9129
|
-
}
|
|
9130
|
-
function isNgContainer(tagName) {
|
|
9131
|
-
return splitNsName(tagName)[1] === "ng-container";
|
|
9132
|
-
}
|
|
9133
|
-
function isNgContent(tagName) {
|
|
9134
|
-
return splitNsName(tagName)[1] === "ng-content";
|
|
9135
|
-
}
|
|
9136
|
-
function isNgTemplate(tagName) {
|
|
9137
|
-
return splitNsName(tagName)[1] === "ng-template";
|
|
9138
|
-
}
|
|
9139
|
-
function getNsPrefix(fullName) {
|
|
9140
|
-
return fullName === null ? null : splitNsName(fullName)[0];
|
|
9141
|
-
}
|
|
9142
|
-
function mergeNsAndName(prefix, localName) {
|
|
9143
|
-
return prefix ? `:${prefix}:${localName}` : localName;
|
|
9144
|
-
}
|
|
9145
|
-
|
|
9146
|
-
// bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/conversion.mjs
|
|
9255
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/conversion.mjs
|
|
9147
9256
|
var BINARY_OPERATORS = /* @__PURE__ */ new Map([
|
|
9148
9257
|
["&&", BinaryOperator.And],
|
|
9149
9258
|
[">", BinaryOperator.Bigger],
|
|
@@ -9193,7 +9302,7 @@ function literalOrArrayLiteral(value) {
|
|
|
9193
9302
|
return literal(value);
|
|
9194
9303
|
}
|
|
9195
9304
|
|
|
9196
|
-
// bazel-out/
|
|
9305
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/const_collection.mjs
|
|
9197
9306
|
function collectElementConsts(job) {
|
|
9198
9307
|
const allElementAttributes = /* @__PURE__ */ new Map();
|
|
9199
9308
|
for (const unit of job.units) {
|
|
@@ -9279,7 +9388,7 @@ var ElementAttributes = class {
|
|
|
9279
9388
|
array.push(...getAttributeNameLiterals(name));
|
|
9280
9389
|
if (kind === BindingKind.Attribute || kind === BindingKind.StyleProperty) {
|
|
9281
9390
|
if (value === null) {
|
|
9282
|
-
throw Error("Attribute & style element attributes must have a value");
|
|
9391
|
+
throw Error("Attribute, i18n attribute, & style element attributes must have a value");
|
|
9283
9392
|
}
|
|
9284
9393
|
array.push(value);
|
|
9285
9394
|
}
|
|
@@ -9327,7 +9436,48 @@ function serializeAttributes({ attributes, bindings, classes, i18n: i18n2, proje
|
|
|
9327
9436
|
return literalArr(attrArray);
|
|
9328
9437
|
}
|
|
9329
9438
|
|
|
9330
|
-
// bazel-out/
|
|
9439
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/convert_i18n_bindings.mjs
|
|
9440
|
+
function convertI18nBindings(job) {
|
|
9441
|
+
const i18nAttributesByElem = /* @__PURE__ */ new Map();
|
|
9442
|
+
for (const unit of job.units) {
|
|
9443
|
+
for (const op of unit.create) {
|
|
9444
|
+
if (op.kind === OpKind.I18nAttributes) {
|
|
9445
|
+
i18nAttributesByElem.set(op.target, op);
|
|
9446
|
+
}
|
|
9447
|
+
}
|
|
9448
|
+
for (const op of unit.update) {
|
|
9449
|
+
switch (op.kind) {
|
|
9450
|
+
case OpKind.Property:
|
|
9451
|
+
case OpKind.Attribute:
|
|
9452
|
+
if (op.i18nContext === null) {
|
|
9453
|
+
continue;
|
|
9454
|
+
}
|
|
9455
|
+
if (!(op.expression instanceof Interpolation2)) {
|
|
9456
|
+
continue;
|
|
9457
|
+
}
|
|
9458
|
+
const i18nAttributesForElem = i18nAttributesByElem.get(op.target);
|
|
9459
|
+
if (i18nAttributesForElem === void 0) {
|
|
9460
|
+
throw new Error("AssertionError: An i18n attribute binding instruction requires the owning element to have an I18nAttributes create instruction");
|
|
9461
|
+
}
|
|
9462
|
+
if (i18nAttributesForElem.target !== op.target) {
|
|
9463
|
+
throw new Error("AssertionError: Expected i18nAttributes target element to match binding target element");
|
|
9464
|
+
}
|
|
9465
|
+
const ops = [];
|
|
9466
|
+
for (let i = 0; i < op.expression.expressions.length; i++) {
|
|
9467
|
+
const expr = op.expression.expressions[i];
|
|
9468
|
+
if (op.expression.i18nPlaceholders.length !== op.expression.expressions.length) {
|
|
9469
|
+
throw new Error(`AssertionError: An i18n attribute binding instruction requires the same number of expressions and placeholders, but found ${op.expression.i18nPlaceholders.length} placeholders and ${op.expression.expressions.length} expressions`);
|
|
9470
|
+
}
|
|
9471
|
+
ops.push(createI18nExpressionOp(op.i18nContext, i18nAttributesForElem.target, i18nAttributesForElem.xref, i18nAttributesForElem.handle, expr, op.expression.i18nPlaceholders[i], I18nParamResolutionTime.Creation, I18nExpressionFor.I18nAttribute, op.name, op.sourceSpan));
|
|
9472
|
+
}
|
|
9473
|
+
OpList.replaceWithMany(op, ops);
|
|
9474
|
+
break;
|
|
9475
|
+
}
|
|
9476
|
+
}
|
|
9477
|
+
}
|
|
9478
|
+
}
|
|
9479
|
+
|
|
9480
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/create_defer_deps_fns.mjs
|
|
9331
9481
|
function createDeferDepsFns(job) {
|
|
9332
9482
|
for (const unit of job.units) {
|
|
9333
9483
|
for (const op of unit.create) {
|
|
@@ -9355,18 +9505,22 @@ function createDeferDepsFns(job) {
|
|
|
9355
9505
|
}
|
|
9356
9506
|
}
|
|
9357
9507
|
|
|
9358
|
-
// bazel-out/
|
|
9508
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/create_i18n_contexts.mjs
|
|
9359
9509
|
function createI18nContexts(job) {
|
|
9510
|
+
const rootContexts = /* @__PURE__ */ new Map();
|
|
9360
9511
|
let currentI18nOp = null;
|
|
9361
9512
|
let xref;
|
|
9362
9513
|
for (const unit of job.units) {
|
|
9363
9514
|
for (const op of unit.create) {
|
|
9364
9515
|
switch (op.kind) {
|
|
9365
9516
|
case OpKind.I18nStart:
|
|
9366
|
-
xref = job.allocateXrefId();
|
|
9367
|
-
unit.create.push(createI18nContextOp(xref, op.xref, op.message, null));
|
|
9368
|
-
op.context = xref;
|
|
9369
9517
|
currentI18nOp = op;
|
|
9518
|
+
if (op.xref === op.root) {
|
|
9519
|
+
xref = job.allocateXrefId();
|
|
9520
|
+
unit.create.push(createI18nContextOp(I18nContextKind.RootI18n, xref, op.xref, op.message, null));
|
|
9521
|
+
op.context = xref;
|
|
9522
|
+
rootContexts.set(op.xref, xref);
|
|
9523
|
+
}
|
|
9370
9524
|
break;
|
|
9371
9525
|
case OpKind.I18nEnd:
|
|
9372
9526
|
currentI18nOp = null;
|
|
@@ -9377,7 +9531,7 @@ function createI18nContexts(job) {
|
|
|
9377
9531
|
}
|
|
9378
9532
|
if (op.message.id !== currentI18nOp.message.id) {
|
|
9379
9533
|
xref = job.allocateXrefId();
|
|
9380
|
-
unit.create.push(createI18nContextOp(xref, currentI18nOp.xref, op.message, null));
|
|
9534
|
+
unit.create.push(createI18nContextOp(I18nContextKind.Icu, xref, currentI18nOp.xref, op.message, null));
|
|
9381
9535
|
op.context = xref;
|
|
9382
9536
|
} else {
|
|
9383
9537
|
op.context = currentI18nOp.context;
|
|
@@ -9386,9 +9540,16 @@ function createI18nContexts(job) {
|
|
|
9386
9540
|
}
|
|
9387
9541
|
}
|
|
9388
9542
|
}
|
|
9543
|
+
for (const unit of job.units) {
|
|
9544
|
+
for (const op of unit.create) {
|
|
9545
|
+
if (op.kind === OpKind.I18nStart && op.xref !== op.root) {
|
|
9546
|
+
op.context = rootContexts.get(op.root);
|
|
9547
|
+
}
|
|
9548
|
+
}
|
|
9549
|
+
}
|
|
9389
9550
|
}
|
|
9390
9551
|
|
|
9391
|
-
// bazel-out/
|
|
9552
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/defer_configs.mjs
|
|
9392
9553
|
function configureDeferInstructions(job) {
|
|
9393
9554
|
for (const unit of job.units) {
|
|
9394
9555
|
for (const op of unit.create) {
|
|
@@ -9405,7 +9566,7 @@ function configureDeferInstructions(job) {
|
|
|
9405
9566
|
}
|
|
9406
9567
|
}
|
|
9407
9568
|
|
|
9408
|
-
// bazel-out/
|
|
9569
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/defer_resolve_targets.mjs
|
|
9409
9570
|
function resolveDeferTargetNames(job) {
|
|
9410
9571
|
const scopes = /* @__PURE__ */ new Map();
|
|
9411
9572
|
function getScopeForView2(view) {
|
|
@@ -9499,7 +9660,7 @@ var Scope = class {
|
|
|
9499
9660
|
}
|
|
9500
9661
|
};
|
|
9501
9662
|
|
|
9502
|
-
// bazel-out/
|
|
9663
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/empty_elements.mjs
|
|
9503
9664
|
var REPLACEMENTS = /* @__PURE__ */ new Map([
|
|
9504
9665
|
[OpKind.ElementEnd, [OpKind.ElementStart, OpKind.Element]],
|
|
9505
9666
|
[OpKind.ContainerEnd, [OpKind.ContainerStart, OpKind.Container]],
|
|
@@ -9526,7 +9687,7 @@ function collapseEmptyInstructions(job) {
|
|
|
9526
9687
|
}
|
|
9527
9688
|
}
|
|
9528
9689
|
|
|
9529
|
-
// bazel-out/
|
|
9690
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/expand_safe_reads.mjs
|
|
9530
9691
|
function expandSafeReads(job) {
|
|
9531
9692
|
for (const unit of job.units) {
|
|
9532
9693
|
for (const op of unit.ops()) {
|
|
@@ -9662,7 +9823,7 @@ function ternaryTransform(e) {
|
|
|
9662
9823
|
return new ConditionalExpr(new BinaryOperatorExpr(BinaryOperator.Equals, e.guard, NULL_EXPR), NULL_EXPR, e.expr);
|
|
9663
9824
|
}
|
|
9664
9825
|
|
|
9665
|
-
// bazel-out/
|
|
9826
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/extract_i18n_messages.mjs
|
|
9666
9827
|
var ESCAPE = "\uFFFD";
|
|
9667
9828
|
var ELEMENT_MARKER = "#";
|
|
9668
9829
|
var TEMPLATE_MARKER = "*";
|
|
@@ -9673,7 +9834,7 @@ var LIST_END_MARKER = "]";
|
|
|
9673
9834
|
var LIST_DELIMITER = "|";
|
|
9674
9835
|
function extractI18nMessages(job) {
|
|
9675
9836
|
const i18nContexts = /* @__PURE__ */ new Map();
|
|
9676
|
-
const
|
|
9837
|
+
const i18nBlocks = /* @__PURE__ */ new Map();
|
|
9677
9838
|
for (const unit of job.units) {
|
|
9678
9839
|
for (const op of unit.create) {
|
|
9679
9840
|
switch (op.kind) {
|
|
@@ -9681,11 +9842,20 @@ function extractI18nMessages(job) {
|
|
|
9681
9842
|
i18nContexts.set(op.xref, op);
|
|
9682
9843
|
break;
|
|
9683
9844
|
case OpKind.I18nStart:
|
|
9684
|
-
|
|
9845
|
+
i18nBlocks.set(op.xref, op);
|
|
9685
9846
|
break;
|
|
9686
9847
|
}
|
|
9687
9848
|
}
|
|
9688
9849
|
}
|
|
9850
|
+
for (const unit of job.units) {
|
|
9851
|
+
for (const op of unit.create) {
|
|
9852
|
+
if (op.kind !== OpKind.I18nContext || op.contextKind !== I18nContextKind.Attr) {
|
|
9853
|
+
continue;
|
|
9854
|
+
}
|
|
9855
|
+
const i18nMessageOp = createI18nMessage(job, op);
|
|
9856
|
+
unit.create.push(i18nMessageOp);
|
|
9857
|
+
}
|
|
9858
|
+
}
|
|
9689
9859
|
const i18nBlockMessages = /* @__PURE__ */ new Map();
|
|
9690
9860
|
for (const unit of job.units) {
|
|
9691
9861
|
for (const op of unit.create) {
|
|
@@ -9706,11 +9876,15 @@ function extractI18nMessages(job) {
|
|
|
9706
9876
|
if (!op.context) {
|
|
9707
9877
|
throw Error("ICU op should have its context set.");
|
|
9708
9878
|
}
|
|
9709
|
-
|
|
9710
|
-
|
|
9879
|
+
const i18nContext = i18nContexts.get(op.context);
|
|
9880
|
+
if (i18nContext.contextKind === I18nContextKind.Icu) {
|
|
9881
|
+
if (i18nContext.i18nBlock === null) {
|
|
9882
|
+
throw Error("ICU context should have its i18n block set.");
|
|
9883
|
+
}
|
|
9711
9884
|
const subMessage = createI18nMessage(job, i18nContext, op.messagePlaceholder);
|
|
9712
9885
|
unit.create.push(subMessage);
|
|
9713
|
-
const
|
|
9886
|
+
const rootI18nId = i18nBlocks.get(i18nContext.i18nBlock).root;
|
|
9887
|
+
const parentMessage = i18nBlockMessages.get(rootI18nId);
|
|
9714
9888
|
parentMessage == null ? void 0 : parentMessage.subMessages.push(subMessage.xref);
|
|
9715
9889
|
}
|
|
9716
9890
|
OpList.remove(op);
|
|
@@ -9723,23 +9897,25 @@ function extractI18nMessages(job) {
|
|
|
9723
9897
|
}
|
|
9724
9898
|
}
|
|
9725
9899
|
function createI18nMessage(job, context, messagePlaceholder) {
|
|
9726
|
-
let
|
|
9900
|
+
let formattedParams = formatParams(context.params);
|
|
9901
|
+
const formattedPostprocessingParams = formatParams(context.postprocessingParams);
|
|
9902
|
+
let needsPostprocessing = formattedPostprocessingParams.size > 0;
|
|
9727
9903
|
for (const values of context.params.values()) {
|
|
9728
9904
|
if (values.length > 1) {
|
|
9729
9905
|
needsPostprocessing = true;
|
|
9730
9906
|
}
|
|
9731
9907
|
}
|
|
9732
|
-
return createI18nMessageOp(job.allocateXrefId(), context.i18nBlock, context.message, messagePlaceholder != null ? messagePlaceholder : null,
|
|
9908
|
+
return createI18nMessageOp(job.allocateXrefId(), context.xref, context.i18nBlock, context.message, messagePlaceholder != null ? messagePlaceholder : null, formattedParams, formattedPostprocessingParams, needsPostprocessing);
|
|
9733
9909
|
}
|
|
9734
9910
|
function formatParams(params) {
|
|
9735
|
-
const
|
|
9911
|
+
const formattedParams = /* @__PURE__ */ new Map();
|
|
9736
9912
|
for (const [placeholder, placeholderValues] of params) {
|
|
9737
9913
|
const serializedValues = formatParamValues(placeholderValues);
|
|
9738
9914
|
if (serializedValues !== null) {
|
|
9739
|
-
|
|
9915
|
+
formattedParams.set(placeholder, literal(serializedValues));
|
|
9740
9916
|
}
|
|
9741
9917
|
}
|
|
9742
|
-
return
|
|
9918
|
+
return formattedParams;
|
|
9743
9919
|
}
|
|
9744
9920
|
function formatParamValues(values) {
|
|
9745
9921
|
if (values.length === 0) {
|
|
@@ -9749,6 +9925,26 @@ function formatParamValues(values) {
|
|
|
9749
9925
|
return serializedValues.length === 1 ? serializedValues[0] : `${LIST_START_MARKER}${serializedValues.join(LIST_DELIMITER)}${LIST_END_MARKER}`;
|
|
9750
9926
|
}
|
|
9751
9927
|
function formatValue(value) {
|
|
9928
|
+
if (value.flags & I18nParamValueFlags.ElementTag && value.flags & I18nParamValueFlags.TemplateTag) {
|
|
9929
|
+
if (typeof value.value !== "object") {
|
|
9930
|
+
throw Error("AssertionError: Expected i18n param value to have an element and template slot");
|
|
9931
|
+
}
|
|
9932
|
+
const elementValue = formatValue(__spreadProps(__spreadValues({}, value), {
|
|
9933
|
+
value: value.value.element,
|
|
9934
|
+
flags: value.flags & ~I18nParamValueFlags.TemplateTag
|
|
9935
|
+
}));
|
|
9936
|
+
const templateValue = formatValue(__spreadProps(__spreadValues({}, value), {
|
|
9937
|
+
value: value.value.template,
|
|
9938
|
+
flags: value.flags & ~I18nParamValueFlags.ElementTag
|
|
9939
|
+
}));
|
|
9940
|
+
if (value.flags & I18nParamValueFlags.OpenTag && value.flags & I18nParamValueFlags.CloseTag) {
|
|
9941
|
+
return `${templateValue}${elementValue}${templateValue}`;
|
|
9942
|
+
}
|
|
9943
|
+
return value.flags & I18nParamValueFlags.CloseTag ? `${elementValue}${templateValue}` : `${templateValue}${elementValue}`;
|
|
9944
|
+
}
|
|
9945
|
+
if (value.flags & I18nParamValueFlags.OpenTag && value.flags & I18nParamValueFlags.CloseTag) {
|
|
9946
|
+
return `${formatValue(__spreadProps(__spreadValues({}, value), { flags: value.flags & ~I18nParamValueFlags.CloseTag }))}${formatValue(__spreadProps(__spreadValues({}, value), { flags: value.flags & ~I18nParamValueFlags.OpenTag }))}`;
|
|
9947
|
+
}
|
|
9752
9948
|
if (value.flags === I18nParamValueFlags.None) {
|
|
9753
9949
|
return `${value.value}`;
|
|
9754
9950
|
}
|
|
@@ -9763,13 +9959,10 @@ function formatValue(value) {
|
|
|
9763
9959
|
closeMarker = value.flags & I18nParamValueFlags.CloseTag ? TAG_CLOSE_MARKER : "";
|
|
9764
9960
|
}
|
|
9765
9961
|
const context = value.subTemplateIndex === null ? "" : `${CONTEXT_MARKER}${value.subTemplateIndex}`;
|
|
9766
|
-
if (value.flags & I18nParamValueFlags.OpenTag && value.flags & I18nParamValueFlags.CloseTag) {
|
|
9767
|
-
return `${ESCAPE}${tagMarker}${value.value}${context}${ESCAPE}${ESCAPE}${closeMarker}${tagMarker}${value.value}${context}${ESCAPE}`;
|
|
9768
|
-
}
|
|
9769
9962
|
return `${ESCAPE}${closeMarker}${tagMarker}${value.value}${context}${ESCAPE}`;
|
|
9770
9963
|
}
|
|
9771
9964
|
|
|
9772
|
-
// bazel-out/
|
|
9965
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_advance.mjs
|
|
9773
9966
|
function generateAdvance(job) {
|
|
9774
9967
|
for (const unit of job.units) {
|
|
9775
9968
|
const slotMap = /* @__PURE__ */ new Map();
|
|
@@ -9786,7 +9979,7 @@ function generateAdvance(job) {
|
|
|
9786
9979
|
if (!hasDependsOnSlotContextTrait(op)) {
|
|
9787
9980
|
continue;
|
|
9788
9981
|
} else if (!slotMap.has(op.target)) {
|
|
9789
|
-
throw new Error(`AssertionError: reference to unknown slot for
|
|
9982
|
+
throw new Error(`AssertionError: reference to unknown slot for target ${op.target}`);
|
|
9790
9983
|
}
|
|
9791
9984
|
const slot = slotMap.get(op.target);
|
|
9792
9985
|
if (slotContext !== slot) {
|
|
@@ -9801,7 +9994,7 @@ function generateAdvance(job) {
|
|
|
9801
9994
|
}
|
|
9802
9995
|
}
|
|
9803
9996
|
|
|
9804
|
-
// bazel-out/
|
|
9997
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_projection_def.mjs
|
|
9805
9998
|
function generateProjectionDefs(job) {
|
|
9806
9999
|
const share = job.compatibility === CompatibilityMode.TemplateDefinitionBuilder;
|
|
9807
10000
|
const selectors = [];
|
|
@@ -9825,7 +10018,7 @@ function generateProjectionDefs(job) {
|
|
|
9825
10018
|
}
|
|
9826
10019
|
}
|
|
9827
10020
|
|
|
9828
|
-
// bazel-out/
|
|
10021
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_variables.mjs
|
|
9829
10022
|
function generateVariables(job) {
|
|
9830
10023
|
recursivelyProcessView(job.root, null);
|
|
9831
10024
|
}
|
|
@@ -9913,7 +10106,7 @@ function generateVariablesInScopeForView(view, scope) {
|
|
|
9913
10106
|
return newOps;
|
|
9914
10107
|
}
|
|
9915
10108
|
|
|
9916
|
-
// bazel-out/
|
|
10109
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/has_const_expression_collection.mjs
|
|
9917
10110
|
function collectConstExpressions(job) {
|
|
9918
10111
|
for (const unit of job.units) {
|
|
9919
10112
|
for (const op of unit.ops()) {
|
|
@@ -9927,7 +10120,7 @@ function collectConstExpressions(job) {
|
|
|
9927
10120
|
}
|
|
9928
10121
|
}
|
|
9929
10122
|
|
|
9930
|
-
// bazel-out/
|
|
10123
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/host_style_property_parsing.mjs
|
|
9931
10124
|
var STYLE_DOT = "style.";
|
|
9932
10125
|
var CLASS_DOT = "class.";
|
|
9933
10126
|
var STYLE_BANG = "style!";
|
|
@@ -9985,7 +10178,7 @@ function parseProperty(name) {
|
|
|
9985
10178
|
return { property: property2, suffix };
|
|
9986
10179
|
}
|
|
9987
10180
|
|
|
9988
|
-
// bazel-out/
|
|
10181
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/map_util.mjs
|
|
9989
10182
|
function mapLiteral(obj, quoted = false) {
|
|
9990
10183
|
return literalMap(Object.keys(obj).map((key) => ({
|
|
9991
10184
|
key,
|
|
@@ -9994,7 +10187,7 @@ function mapLiteral(obj, quoted = false) {
|
|
|
9994
10187
|
})));
|
|
9995
10188
|
}
|
|
9996
10189
|
|
|
9997
|
-
// bazel-out/
|
|
10190
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/i18n/icu_serializer.mjs
|
|
9998
10191
|
var IcuSerializerVisitor = class {
|
|
9999
10192
|
visitText(text2) {
|
|
10000
10193
|
return text2.value;
|
|
@@ -10028,7 +10221,7 @@ function serializeIcuNode(icu) {
|
|
|
10028
10221
|
return icu.visit(serializer);
|
|
10029
10222
|
}
|
|
10030
10223
|
|
|
10031
|
-
// bazel-out/
|
|
10224
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/expression_parser/lexer.mjs
|
|
10032
10225
|
var TokenType;
|
|
10033
10226
|
(function(TokenType2) {
|
|
10034
10227
|
TokenType2[TokenType2["Character"] = 0] = "Character";
|
|
@@ -10389,7 +10582,7 @@ function parseIntAutoRadix(text2) {
|
|
|
10389
10582
|
return result;
|
|
10390
10583
|
}
|
|
10391
10584
|
|
|
10392
|
-
// bazel-out/
|
|
10585
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/expression_parser/parser.mjs
|
|
10393
10586
|
var SplitInterpolation = class {
|
|
10394
10587
|
constructor(strings, expressions, offsets) {
|
|
10395
10588
|
this.strings = strings;
|
|
@@ -11283,7 +11476,7 @@ function getIndexMapForOriginalTemplate(interpolatedTokens) {
|
|
|
11283
11476
|
return offsetMap;
|
|
11284
11477
|
}
|
|
11285
11478
|
|
|
11286
|
-
// bazel-out/
|
|
11479
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/ast.mjs
|
|
11287
11480
|
var NodeWithI18n = class {
|
|
11288
11481
|
constructor(sourceSpan, i18n2) {
|
|
11289
11482
|
this.sourceSpan = sourceSpan;
|
|
@@ -11435,11 +11628,11 @@ var RecursiveVisitor = class {
|
|
|
11435
11628
|
}
|
|
11436
11629
|
};
|
|
11437
11630
|
|
|
11438
|
-
// bazel-out/
|
|
11631
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/schema/element_schema_registry.mjs
|
|
11439
11632
|
var ElementSchemaRegistry = class {
|
|
11440
11633
|
};
|
|
11441
11634
|
|
|
11442
|
-
// bazel-out/
|
|
11635
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/schema/dom_element_schema_registry.mjs
|
|
11443
11636
|
var BOOLEAN = "boolean";
|
|
11444
11637
|
var NUMBER = "number";
|
|
11445
11638
|
var STRING = "string";
|
|
@@ -11792,7 +11985,7 @@ function _isPixelDimensionStyle(prop) {
|
|
|
11792
11985
|
}
|
|
11793
11986
|
}
|
|
11794
11987
|
|
|
11795
|
-
// bazel-out/
|
|
11988
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/html_tags.mjs
|
|
11796
11989
|
var HtmlTagDefinition = class {
|
|
11797
11990
|
constructor({ closedByChildren, implicitNamespacePrefix, contentType = TagContentType.PARSABLE_DATA, closedByParent = false, isVoid = false, ignoreFirstLf = false, preventNamespaceInheritance = false, canSelfClose = false } = {}) {
|
|
11798
11991
|
this.closedByChildren = {};
|
|
@@ -11910,7 +12103,7 @@ function getHtmlTagDefinition(tagName) {
|
|
|
11910
12103
|
return (_b2 = (_a2 = TAG_DEFINITIONS[tagName]) != null ? _a2 : TAG_DEFINITIONS[tagName.toLowerCase()]) != null ? _b2 : DEFAULT_TAG_DEFINITION;
|
|
11911
12104
|
}
|
|
11912
12105
|
|
|
11913
|
-
// bazel-out/
|
|
12106
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/serializers/placeholder.mjs
|
|
11914
12107
|
var TAG_TO_PLACEHOLDER_NAMES = {
|
|
11915
12108
|
"A": "LINK",
|
|
11916
12109
|
"B": "BOLD_TEXT",
|
|
@@ -12032,7 +12225,7 @@ var PlaceholderRegistry = class {
|
|
|
12032
12225
|
}
|
|
12033
12226
|
};
|
|
12034
12227
|
|
|
12035
|
-
// bazel-out/
|
|
12228
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/i18n_parser.mjs
|
|
12036
12229
|
var _expParser = new Parser(new Lexer());
|
|
12037
12230
|
function createI18nMessageFactory(interpolationConfig, containerBlocks) {
|
|
12038
12231
|
const visitor = new _I18nVisitor(_expParser, interpolationConfig, containerBlocks);
|
|
@@ -12211,14 +12404,14 @@ function extractPlaceholderName(input) {
|
|
|
12211
12404
|
return input.split(_CUSTOM_PH_EXP)[2];
|
|
12212
12405
|
}
|
|
12213
12406
|
|
|
12214
|
-
// bazel-out/
|
|
12407
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/parse_util.mjs
|
|
12215
12408
|
var I18nError = class extends ParseError {
|
|
12216
12409
|
constructor(span, msg) {
|
|
12217
12410
|
super(span, msg);
|
|
12218
12411
|
}
|
|
12219
12412
|
};
|
|
12220
12413
|
|
|
12221
|
-
// bazel-out/
|
|
12414
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/entities.mjs
|
|
12222
12415
|
var NAMED_ENTITIES = {
|
|
12223
12416
|
"AElig": "\xC6",
|
|
12224
12417
|
"AMP": "&",
|
|
@@ -14349,7 +14542,7 @@ var NAMED_ENTITIES = {
|
|
|
14349
14542
|
var NGSP_UNICODE = "\uE500";
|
|
14350
14543
|
NAMED_ENTITIES["ngsp"] = NGSP_UNICODE;
|
|
14351
14544
|
|
|
14352
|
-
// bazel-out/
|
|
14545
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/lexer.mjs
|
|
14353
14546
|
var TokenError = class extends ParseError {
|
|
14354
14547
|
constructor(errorMsg, tokenType, span) {
|
|
14355
14548
|
super(span, errorMsg);
|
|
@@ -15270,7 +15463,7 @@ var CursorError = class {
|
|
|
15270
15463
|
}
|
|
15271
15464
|
};
|
|
15272
15465
|
|
|
15273
|
-
// bazel-out/
|
|
15466
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/parser.mjs
|
|
15274
15467
|
var TreeError = class extends ParseError {
|
|
15275
15468
|
static create(elementName, span, msg) {
|
|
15276
15469
|
return new TreeError(elementName, span, msg);
|
|
@@ -15654,7 +15847,7 @@ function decodeEntity(match, entity) {
|
|
|
15654
15847
|
return match;
|
|
15655
15848
|
}
|
|
15656
15849
|
|
|
15657
|
-
// bazel-out/
|
|
15850
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/schema/trusted_types_sinks.mjs
|
|
15658
15851
|
var TRUSTED_TYPES_SINKS = /* @__PURE__ */ new Set([
|
|
15659
15852
|
"iframe|srcdoc",
|
|
15660
15853
|
"*|innerhtml",
|
|
@@ -15669,7 +15862,7 @@ function isTrustedTypesSink(tagName, propName) {
|
|
|
15669
15862
|
return TRUSTED_TYPES_SINKS.has(tagName + "|" + propName) || TRUSTED_TYPES_SINKS.has("*|" + propName);
|
|
15670
15863
|
}
|
|
15671
15864
|
|
|
15672
|
-
// bazel-out/
|
|
15865
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/i18n/meta.mjs
|
|
15673
15866
|
var setI18nRefs = (htmlNode, i18nNode) => {
|
|
15674
15867
|
if (htmlNode instanceof NodeWithI18n) {
|
|
15675
15868
|
if (i18nNode instanceof IcuPlaceholder && htmlNode.i18n instanceof Message) {
|
|
@@ -15826,7 +16019,7 @@ function i18nMetaToJSDoc(meta) {
|
|
|
15826
16019
|
return jsDocComment(tags);
|
|
15827
16020
|
}
|
|
15828
16021
|
|
|
15829
|
-
// bazel-out/
|
|
16022
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/i18n/get_msg_utils.mjs
|
|
15830
16023
|
var GOOG_GET_MSG = "goog.getMsg";
|
|
15831
16024
|
function createGoogleGetMsgStatements(variable2, message, closureVar, placeholderValues) {
|
|
15832
16025
|
const messageString = serializeI18nMessageForGetMsg(message);
|
|
@@ -15877,7 +16070,7 @@ function serializeI18nMessageForGetMsg(message) {
|
|
|
15877
16070
|
return message.nodes.map((node) => node.visit(serializerVisitor2, null)).join("");
|
|
15878
16071
|
}
|
|
15879
16072
|
|
|
15880
|
-
// bazel-out/
|
|
16073
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/i18n/localize_utils.mjs
|
|
15881
16074
|
function createLocalizeStatements(variable2, message, params) {
|
|
15882
16075
|
const { messageParts, placeHolders } = serializeI18nMessageForLocalize(message);
|
|
15883
16076
|
const sourceSpan = getSourceSpan(message);
|
|
@@ -15966,59 +16159,136 @@ function createEmptyMessagePart(location) {
|
|
|
15966
16159
|
return new LiteralPiece("", new ParseSourceSpan(location, location));
|
|
15967
16160
|
}
|
|
15968
16161
|
|
|
15969
|
-
// bazel-out/
|
|
16162
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/i18n_const_collection.mjs
|
|
15970
16163
|
var NG_I18N_CLOSURE_MODE = "ngI18nClosureMode";
|
|
15971
16164
|
var TRANSLATION_VAR_PREFIX2 = "i18n_";
|
|
16165
|
+
var I18N_ICU_MAPPING_PREFIX2 = "I18N_EXP_";
|
|
16166
|
+
var ESCAPE2 = "\uFFFD";
|
|
15972
16167
|
function collectI18nConsts(job) {
|
|
16168
|
+
var _a2;
|
|
15973
16169
|
const fileBasedI18nSuffix = job.relativeContextFilePath.replace(/[^A-Za-z0-9]/g, "_").toUpperCase() + "_";
|
|
15974
|
-
const
|
|
16170
|
+
const extractedAttributesByI18nContext = /* @__PURE__ */ new Map();
|
|
16171
|
+
const i18nAttributesByElement = /* @__PURE__ */ new Map();
|
|
16172
|
+
const i18nExpressionsByElement = /* @__PURE__ */ new Map();
|
|
15975
16173
|
const messages = /* @__PURE__ */ new Map();
|
|
16174
|
+
for (const unit of job.units) {
|
|
16175
|
+
for (const op of unit.ops()) {
|
|
16176
|
+
if (op.kind === OpKind.ExtractedAttribute && op.i18nContext !== null) {
|
|
16177
|
+
extractedAttributesByI18nContext.set(op.i18nContext, op);
|
|
16178
|
+
} else if (op.kind === OpKind.I18nAttributes) {
|
|
16179
|
+
i18nAttributesByElement.set(op.target, op);
|
|
16180
|
+
} else if (op.kind === OpKind.I18nExpression && op.usage === I18nExpressionFor.I18nAttribute) {
|
|
16181
|
+
const expressions = (_a2 = i18nExpressionsByElement.get(op.target)) != null ? _a2 : [];
|
|
16182
|
+
expressions.push(op);
|
|
16183
|
+
i18nExpressionsByElement.set(op.target, expressions);
|
|
16184
|
+
} else if (op.kind === OpKind.I18nMessage) {
|
|
16185
|
+
messages.set(op.xref, op);
|
|
16186
|
+
}
|
|
16187
|
+
}
|
|
16188
|
+
}
|
|
16189
|
+
const i18nValuesByContext = /* @__PURE__ */ new Map();
|
|
16190
|
+
const messageConstIndices = /* @__PURE__ */ new Map();
|
|
15976
16191
|
for (const unit of job.units) {
|
|
15977
16192
|
for (const op of unit.create) {
|
|
15978
16193
|
if (op.kind === OpKind.I18nMessage) {
|
|
15979
|
-
|
|
16194
|
+
if (op.messagePlaceholder === null) {
|
|
16195
|
+
const { mainVar, statements } = collectMessage(job, fileBasedI18nSuffix, messages, op);
|
|
16196
|
+
if (op.i18nBlock !== null) {
|
|
16197
|
+
const i18nConst = job.addConst(mainVar, statements);
|
|
16198
|
+
messageConstIndices.set(op.i18nBlock, i18nConst);
|
|
16199
|
+
} else {
|
|
16200
|
+
job.constsInitializers.push(...statements);
|
|
16201
|
+
i18nValuesByContext.set(op.i18nContext, mainVar);
|
|
16202
|
+
const attributeForMessage = extractedAttributesByI18nContext.get(op.i18nContext);
|
|
16203
|
+
if (attributeForMessage !== void 0) {
|
|
16204
|
+
attributeForMessage.expression = mainVar;
|
|
16205
|
+
}
|
|
16206
|
+
}
|
|
16207
|
+
}
|
|
15980
16208
|
OpList.remove(op);
|
|
15981
16209
|
}
|
|
15982
16210
|
}
|
|
15983
16211
|
}
|
|
15984
|
-
for (const
|
|
15985
|
-
|
|
15986
|
-
|
|
15987
|
-
|
|
16212
|
+
for (const unit of job.units) {
|
|
16213
|
+
for (const elem of unit.create) {
|
|
16214
|
+
if (isElementOrContainerOp(elem)) {
|
|
16215
|
+
const i18nAttributes2 = i18nAttributesByElement.get(elem.xref);
|
|
16216
|
+
if (i18nAttributes2 === void 0) {
|
|
16217
|
+
continue;
|
|
16218
|
+
}
|
|
16219
|
+
let i18nExpressions = i18nExpressionsByElement.get(elem.xref);
|
|
16220
|
+
if (i18nExpressions === void 0) {
|
|
16221
|
+
throw new Error("AssertionError: Could not find any i18n expressions associated with an I18nAttributes instruction");
|
|
16222
|
+
}
|
|
16223
|
+
const seenPropertyNames = /* @__PURE__ */ new Set();
|
|
16224
|
+
i18nExpressions = i18nExpressions.filter((i18nExpr) => {
|
|
16225
|
+
const seen = seenPropertyNames.has(i18nExpr.name);
|
|
16226
|
+
seenPropertyNames.add(i18nExpr.name);
|
|
16227
|
+
return !seen;
|
|
16228
|
+
});
|
|
16229
|
+
const i18nAttributeConfig = i18nExpressions.flatMap((i18nExpr) => {
|
|
16230
|
+
const i18nExprValue = i18nValuesByContext.get(i18nExpr.context);
|
|
16231
|
+
if (i18nExprValue === void 0) {
|
|
16232
|
+
throw new Error("AssertionError: Could not find i18n expression's value");
|
|
16233
|
+
}
|
|
16234
|
+
return [literal(i18nExpr.name), i18nExprValue];
|
|
16235
|
+
});
|
|
16236
|
+
i18nAttributes2.i18nAttributesConfig = job.addConst(new LiteralArrayExpr(i18nAttributeConfig));
|
|
16237
|
+
}
|
|
15988
16238
|
}
|
|
15989
16239
|
}
|
|
15990
16240
|
for (const unit of job.units) {
|
|
15991
16241
|
for (const op of unit.create) {
|
|
15992
16242
|
if (op.kind === OpKind.I18nStart) {
|
|
15993
|
-
|
|
16243
|
+
const msgIndex = messageConstIndices.get(op.root);
|
|
16244
|
+
if (msgIndex === void 0) {
|
|
16245
|
+
throw new Error("AssertionError: Could not find corresponding i18n block index for an i18n message op; was an i18n message incorrectly assumed to correspond to an attribute?");
|
|
16246
|
+
}
|
|
16247
|
+
op.messageIndex = msgIndex;
|
|
15994
16248
|
}
|
|
15995
16249
|
}
|
|
15996
16250
|
}
|
|
15997
16251
|
}
|
|
15998
16252
|
function collectMessage(job, fileBasedI18nSuffix, messages, messageOp) {
|
|
16253
|
+
var _a2;
|
|
15999
16254
|
const statements = [];
|
|
16255
|
+
const subMessagePlaceholders = /* @__PURE__ */ new Map();
|
|
16000
16256
|
for (const subMessageId of messageOp.subMessages) {
|
|
16001
16257
|
const subMessage = messages.get(subMessageId);
|
|
16002
16258
|
const { mainVar: subMessageVar, statements: subMessageStatements } = collectMessage(job, fileBasedI18nSuffix, messages, subMessage);
|
|
16003
16259
|
statements.push(...subMessageStatements);
|
|
16004
|
-
|
|
16260
|
+
const subMessages = (_a2 = subMessagePlaceholders.get(subMessage.messagePlaceholder)) != null ? _a2 : [];
|
|
16261
|
+
subMessages.push(subMessageVar);
|
|
16262
|
+
subMessagePlaceholders.set(subMessage.messagePlaceholder, subMessages);
|
|
16005
16263
|
}
|
|
16264
|
+
addSubMessageParams(messageOp, subMessagePlaceholders);
|
|
16006
16265
|
messageOp.params = new Map([...messageOp.params.entries()].sort());
|
|
16007
|
-
assertAllParamsResolved(messageOp);
|
|
16008
16266
|
const mainVar = variable(job.pool.uniqueName(TRANSLATION_VAR_PREFIX2));
|
|
16009
16267
|
const closureVar = i18nGenerateClosureVar(job.pool, messageOp.message.id, fileBasedI18nSuffix, job.i18nUseExternalIds);
|
|
16010
16268
|
let transformFn = void 0;
|
|
16011
16269
|
if (messageOp.needsPostprocessing) {
|
|
16012
|
-
|
|
16270
|
+
const postprocessingParams = Object.fromEntries([...messageOp.postprocessingParams.entries()].sort());
|
|
16271
|
+
const formattedPostprocessingParams = formatI18nPlaceholderNamesInMap(postprocessingParams, false);
|
|
16013
16272
|
const extraTransformFnParams = [];
|
|
16014
16273
|
if (messageOp.postprocessingParams.size > 0) {
|
|
16015
|
-
extraTransformFnParams.push(
|
|
16274
|
+
extraTransformFnParams.push(mapLiteral(formattedPostprocessingParams, true));
|
|
16016
16275
|
}
|
|
16017
16276
|
transformFn = (expr) => importExpr(Identifiers.i18nPostprocess).callFn([expr, ...extraTransformFnParams]);
|
|
16018
16277
|
}
|
|
16019
16278
|
statements.push(...getTranslationDeclStmts(messageOp.message, mainVar, closureVar, messageOp.params, transformFn));
|
|
16020
16279
|
return { mainVar, statements };
|
|
16021
16280
|
}
|
|
16281
|
+
function addSubMessageParams(messageOp, subMessagePlaceholders) {
|
|
16282
|
+
for (const [placeholder, subMessages] of subMessagePlaceholders) {
|
|
16283
|
+
if (subMessages.length === 1) {
|
|
16284
|
+
messageOp.params.set(placeholder, subMessages[0]);
|
|
16285
|
+
} else {
|
|
16286
|
+
messageOp.params.set(placeholder, literal(`${ESCAPE2}${I18N_ICU_MAPPING_PREFIX2}${placeholder}${ESCAPE2}`));
|
|
16287
|
+
messageOp.postprocessingParams.set(placeholder, literalArr(subMessages));
|
|
16288
|
+
messageOp.needsPostprocessing = true;
|
|
16289
|
+
}
|
|
16290
|
+
}
|
|
16291
|
+
}
|
|
16022
16292
|
function getTranslationDeclStmts(message, variable2, closureVar, params, transformFn) {
|
|
16023
16293
|
const paramsObject = Object.fromEntries(params);
|
|
16024
16294
|
const statements = [
|
|
@@ -16046,23 +16316,9 @@ function i18nGenerateClosureVar(pool, messageId, fileBasedI18nSuffix, useExterna
|
|
|
16046
16316
|
}
|
|
16047
16317
|
return variable(name);
|
|
16048
16318
|
}
|
|
16049
|
-
function assertAllParamsResolved(op) {
|
|
16050
|
-
for (let placeholder in op.message.placeholders) {
|
|
16051
|
-
placeholder = placeholder.trimEnd();
|
|
16052
|
-
if (!op.params.has(placeholder) && !op.postprocessingParams.has(placeholder)) {
|
|
16053
|
-
throw Error(`Failed to resolve i18n placeholder: ${placeholder}`);
|
|
16054
|
-
}
|
|
16055
|
-
}
|
|
16056
|
-
for (let placeholder in op.message.placeholderToMessage) {
|
|
16057
|
-
placeholder = placeholder.trimEnd();
|
|
16058
|
-
if (!op.params.has(placeholder) && !op.postprocessingParams.has(placeholder)) {
|
|
16059
|
-
throw Error(`Failed to resolve i18n message placeholder: ${placeholder}`);
|
|
16060
|
-
}
|
|
16061
|
-
}
|
|
16062
|
-
}
|
|
16063
16319
|
|
|
16064
|
-
// bazel-out/
|
|
16065
|
-
function
|
|
16320
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/i18n_text_extraction.mjs
|
|
16321
|
+
function convertI18nText(job) {
|
|
16066
16322
|
var _a2;
|
|
16067
16323
|
for (const unit of job.units) {
|
|
16068
16324
|
let currentI18n = null;
|
|
@@ -16111,7 +16367,7 @@ function extractI18nText(job) {
|
|
|
16111
16367
|
const ops = [];
|
|
16112
16368
|
for (let i = 0; i < op.interpolation.expressions.length; i++) {
|
|
16113
16369
|
const expr = op.interpolation.expressions[i];
|
|
16114
|
-
ops.push(createI18nExpressionOp(contextId, i18nOp.xref, i18nOp.handle, expr, op.i18nPlaceholders[i], resolutionTime, (_a2 = expr.sourceSpan) != null ? _a2 : op.sourceSpan));
|
|
16370
|
+
ops.push(createI18nExpressionOp(contextId, i18nOp.xref, i18nOp.xref, i18nOp.handle, expr, op.interpolation.i18nPlaceholders[i], resolutionTime, I18nExpressionFor.I18nText, "", (_a2 = expr.sourceSpan) != null ? _a2 : op.sourceSpan));
|
|
16115
16371
|
}
|
|
16116
16372
|
OpList.replaceWithMany(op, ops);
|
|
16117
16373
|
break;
|
|
@@ -16120,7 +16376,7 @@ function extractI18nText(job) {
|
|
|
16120
16376
|
}
|
|
16121
16377
|
}
|
|
16122
16378
|
|
|
16123
|
-
// bazel-out/
|
|
16379
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/local_refs.mjs
|
|
16124
16380
|
function liftLocalRefs(job) {
|
|
16125
16381
|
for (const unit of job.units) {
|
|
16126
16382
|
for (const op of unit.create) {
|
|
@@ -16150,48 +16406,7 @@ function serializeLocalRefs(refs) {
|
|
|
16150
16406
|
return literalArr(constRefs);
|
|
16151
16407
|
}
|
|
16152
16408
|
|
|
16153
|
-
// bazel-out/
|
|
16154
|
-
function mergeI18nContexts(job) {
|
|
16155
|
-
const i18nOps = /* @__PURE__ */ new Map();
|
|
16156
|
-
const i18nContexts = /* @__PURE__ */ new Map();
|
|
16157
|
-
for (const unit of job.units) {
|
|
16158
|
-
for (const op of unit.create) {
|
|
16159
|
-
switch (op.kind) {
|
|
16160
|
-
case OpKind.I18nStart:
|
|
16161
|
-
if (!op.context) {
|
|
16162
|
-
throw Error("I18n op should have its context set.");
|
|
16163
|
-
}
|
|
16164
|
-
i18nOps.set(op.xref, op);
|
|
16165
|
-
break;
|
|
16166
|
-
case OpKind.I18nContext:
|
|
16167
|
-
i18nContexts.set(op.xref, op);
|
|
16168
|
-
break;
|
|
16169
|
-
}
|
|
16170
|
-
}
|
|
16171
|
-
}
|
|
16172
|
-
for (const childI18nOp of i18nOps.values()) {
|
|
16173
|
-
if (childI18nOp.xref !== childI18nOp.root) {
|
|
16174
|
-
const childContext = i18nContexts.get(childI18nOp.context);
|
|
16175
|
-
const rootI18nOp = i18nOps.get(childI18nOp.root);
|
|
16176
|
-
const rootContext = i18nContexts.get(rootI18nOp.context);
|
|
16177
|
-
mergeParams(rootContext.params, childContext.params);
|
|
16178
|
-
mergeParams(rootContext.postprocessingParams, childContext.postprocessingParams);
|
|
16179
|
-
}
|
|
16180
|
-
}
|
|
16181
|
-
}
|
|
16182
|
-
function mergeParams(to, from) {
|
|
16183
|
-
for (const [placeholder, fromValues] of from) {
|
|
16184
|
-
const toValues = to.get(placeholder) || [];
|
|
16185
|
-
const flags = fromValues[0].flags;
|
|
16186
|
-
if (flags & I18nParamValueFlags.CloseTag && !(flags & I18nParamValueFlags.OpenTag)) {
|
|
16187
|
-
to.set(placeholder, [...fromValues, ...toValues]);
|
|
16188
|
-
} else {
|
|
16189
|
-
to.set(placeholder, [...toValues, ...fromValues]);
|
|
16190
|
-
}
|
|
16191
|
-
}
|
|
16192
|
-
}
|
|
16193
|
-
|
|
16194
|
-
// bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/namespace.mjs
|
|
16409
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/namespace.mjs
|
|
16195
16410
|
function emitNamespaceChanges(job) {
|
|
16196
16411
|
for (const unit of job.units) {
|
|
16197
16412
|
let activeNamespace = Namespace.HTML;
|
|
@@ -16207,7 +16422,7 @@ function emitNamespaceChanges(job) {
|
|
|
16207
16422
|
}
|
|
16208
16423
|
}
|
|
16209
16424
|
|
|
16210
|
-
// bazel-out/
|
|
16425
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/style_parser.mjs
|
|
16211
16426
|
function parse(value) {
|
|
16212
16427
|
const styles = [];
|
|
16213
16428
|
let i = 0;
|
|
@@ -16268,7 +16483,7 @@ function hyphenate2(value) {
|
|
|
16268
16483
|
}).toLowerCase();
|
|
16269
16484
|
}
|
|
16270
16485
|
|
|
16271
|
-
// bazel-out/
|
|
16486
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/naming.mjs
|
|
16272
16487
|
function nameFunctionsAndVariables(job) {
|
|
16273
16488
|
addNamesToView(job.root, job.componentName, { index: 0 }, job.compatibility === CompatibilityMode.TemplateDefinitionBuilder);
|
|
16274
16489
|
}
|
|
@@ -16383,7 +16598,7 @@ function stripImportant(name) {
|
|
|
16383
16598
|
return name;
|
|
16384
16599
|
}
|
|
16385
16600
|
|
|
16386
|
-
// bazel-out/
|
|
16601
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/next_context_merging.mjs
|
|
16387
16602
|
function mergeNextContextExpressions(job) {
|
|
16388
16603
|
for (const unit of job.units) {
|
|
16389
16604
|
for (const op of unit.create) {
|
|
@@ -16429,7 +16644,7 @@ function mergeNextContextsInOps(ops) {
|
|
|
16429
16644
|
}
|
|
16430
16645
|
}
|
|
16431
16646
|
|
|
16432
|
-
// bazel-out/
|
|
16647
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/ng_container.mjs
|
|
16433
16648
|
var CONTAINER_TAG = "ng-container";
|
|
16434
16649
|
function generateNgContainerOps(job) {
|
|
16435
16650
|
for (const unit of job.units) {
|
|
@@ -16446,7 +16661,7 @@ function generateNgContainerOps(job) {
|
|
|
16446
16661
|
}
|
|
16447
16662
|
}
|
|
16448
16663
|
|
|
16449
|
-
// bazel-out/
|
|
16664
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/nonbindable.mjs
|
|
16450
16665
|
function lookupElement3(elements, xref) {
|
|
16451
16666
|
const el = elements.get(xref);
|
|
16452
16667
|
if (el === void 0) {
|
|
@@ -16476,7 +16691,7 @@ function disableBindings(job) {
|
|
|
16476
16691
|
}
|
|
16477
16692
|
}
|
|
16478
16693
|
|
|
16479
|
-
// bazel-out/
|
|
16694
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/nullish_coalescing.mjs
|
|
16480
16695
|
function generateNullishCoalesceExpressions(job) {
|
|
16481
16696
|
for (const unit of job.units) {
|
|
16482
16697
|
for (const op of unit.ops()) {
|
|
@@ -16492,7 +16707,7 @@ function generateNullishCoalesceExpressions(job) {
|
|
|
16492
16707
|
}
|
|
16493
16708
|
}
|
|
16494
16709
|
|
|
16495
|
-
// bazel-out/
|
|
16710
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/ordering.mjs
|
|
16496
16711
|
function kindTest(kind) {
|
|
16497
16712
|
return (op) => op.kind === kind;
|
|
16498
16713
|
}
|
|
@@ -16566,7 +16781,7 @@ function keepLast(ops) {
|
|
|
16566
16781
|
return ops.slice(ops.length - 1);
|
|
16567
16782
|
}
|
|
16568
16783
|
|
|
16569
|
-
// bazel-out/
|
|
16784
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/parse_extracted_styles.mjs
|
|
16570
16785
|
function parseExtractedStyles(job) {
|
|
16571
16786
|
for (const unit of job.units) {
|
|
16572
16787
|
for (const op of unit.create) {
|
|
@@ -16574,13 +16789,13 @@ function parseExtractedStyles(job) {
|
|
|
16574
16789
|
if (op.name === "style") {
|
|
16575
16790
|
const parsedStyles = parse(op.expression.value);
|
|
16576
16791
|
for (let i = 0; i < parsedStyles.length - 1; i += 2) {
|
|
16577
|
-
OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.StyleProperty, parsedStyles[i], literal(parsedStyles[i + 1])), op);
|
|
16792
|
+
OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.StyleProperty, parsedStyles[i], literal(parsedStyles[i + 1]), null), op);
|
|
16578
16793
|
}
|
|
16579
16794
|
OpList.remove(op);
|
|
16580
16795
|
} else if (op.name === "class") {
|
|
16581
16796
|
const parsedClasses = op.expression.value.trim().split(/\s+/g);
|
|
16582
16797
|
for (const parsedClass of parsedClasses) {
|
|
16583
|
-
OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.ClassName, parsedClass, null), op);
|
|
16798
|
+
OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.ClassName, parsedClass, null, null), op);
|
|
16584
16799
|
}
|
|
16585
16800
|
OpList.remove(op);
|
|
16586
16801
|
}
|
|
@@ -16589,22 +16804,32 @@ function parseExtractedStyles(job) {
|
|
|
16589
16804
|
}
|
|
16590
16805
|
}
|
|
16591
16806
|
|
|
16592
|
-
// bazel-out/
|
|
16807
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/phase_remove_content_selectors.mjs
|
|
16593
16808
|
function removeContentSelectors(job) {
|
|
16594
16809
|
for (const unit of job.units) {
|
|
16595
16810
|
const elements = createOpXrefMap(unit);
|
|
16596
|
-
for (const op of unit.
|
|
16811
|
+
for (const op of unit.ops()) {
|
|
16597
16812
|
switch (op.kind) {
|
|
16598
16813
|
case OpKind.Binding:
|
|
16599
16814
|
const target = lookupInXrefMap(elements, op.target);
|
|
16600
|
-
if (op.name
|
|
16815
|
+
if (isSelectAttribute(op.name) && target.kind === OpKind.Projection) {
|
|
16601
16816
|
OpList.remove(op);
|
|
16602
16817
|
}
|
|
16603
16818
|
break;
|
|
16819
|
+
case OpKind.Projection:
|
|
16820
|
+
for (let i = op.attributes.length - 2; i >= 0; i -= 2) {
|
|
16821
|
+
if (isSelectAttribute(op.attributes[i])) {
|
|
16822
|
+
op.attributes.splice(i, 2);
|
|
16823
|
+
}
|
|
16824
|
+
}
|
|
16825
|
+
break;
|
|
16604
16826
|
}
|
|
16605
16827
|
}
|
|
16606
16828
|
}
|
|
16607
16829
|
}
|
|
16830
|
+
function isSelectAttribute(name) {
|
|
16831
|
+
return name.toLowerCase() === "select";
|
|
16832
|
+
}
|
|
16608
16833
|
function lookupInXrefMap(map, xref) {
|
|
16609
16834
|
const el = map.get(xref);
|
|
16610
16835
|
if (el === void 0) {
|
|
@@ -16613,7 +16838,7 @@ function lookupInXrefMap(map, xref) {
|
|
|
16613
16838
|
return el;
|
|
16614
16839
|
}
|
|
16615
16840
|
|
|
16616
|
-
// bazel-out/
|
|
16841
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pipe_creation.mjs
|
|
16617
16842
|
function createPipes(job) {
|
|
16618
16843
|
for (const unit of job.units) {
|
|
16619
16844
|
processPipeBindingsInView(unit);
|
|
@@ -16661,7 +16886,7 @@ function addPipeToCreationBlock(unit, afterTargetXref, binding) {
|
|
|
16661
16886
|
throw new Error(`AssertionError: unable to find insertion point for pipe ${binding.name}`);
|
|
16662
16887
|
}
|
|
16663
16888
|
|
|
16664
|
-
// bazel-out/
|
|
16889
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pipe_variadic.mjs
|
|
16665
16890
|
function createVariadicPipes(job) {
|
|
16666
16891
|
for (const unit of job.units) {
|
|
16667
16892
|
for (const op of unit.update) {
|
|
@@ -16678,7 +16903,7 @@ function createVariadicPipes(job) {
|
|
|
16678
16903
|
}
|
|
16679
16904
|
}
|
|
16680
16905
|
|
|
16681
|
-
// bazel-out/
|
|
16906
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/propagate_i18n_blocks.mjs
|
|
16682
16907
|
function propagateI18nBlocks(job) {
|
|
16683
16908
|
propagateI18nBlocksToTemplates(job.root, 0);
|
|
16684
16909
|
}
|
|
@@ -16691,6 +16916,9 @@ function propagateI18nBlocksToTemplates(unit, subTemplateIndex) {
|
|
|
16691
16916
|
i18nBlock = op;
|
|
16692
16917
|
break;
|
|
16693
16918
|
case OpKind.I18nEnd:
|
|
16919
|
+
if (i18nBlock.subTemplateIndex === null) {
|
|
16920
|
+
subTemplateIndex = 0;
|
|
16921
|
+
}
|
|
16694
16922
|
i18nBlock = null;
|
|
16695
16923
|
break;
|
|
16696
16924
|
case OpKind.Template:
|
|
@@ -16702,9 +16930,10 @@ function propagateI18nBlocksToTemplates(unit, subTemplateIndex) {
|
|
|
16702
16930
|
subTemplateIndex++;
|
|
16703
16931
|
wrapTemplateWithI18n(templateView, i18nBlock);
|
|
16704
16932
|
}
|
|
16705
|
-
propagateI18nBlocksToTemplates(templateView, subTemplateIndex);
|
|
16933
|
+
subTemplateIndex = propagateI18nBlocksToTemplates(templateView, subTemplateIndex);
|
|
16706
16934
|
}
|
|
16707
16935
|
}
|
|
16936
|
+
return subTemplateIndex;
|
|
16708
16937
|
}
|
|
16709
16938
|
function wrapTemplateWithI18n(unit, parentI18n) {
|
|
16710
16939
|
var _a2;
|
|
@@ -16715,7 +16944,7 @@ function wrapTemplateWithI18n(unit, parentI18n) {
|
|
|
16715
16944
|
}
|
|
16716
16945
|
}
|
|
16717
16946
|
|
|
16718
|
-
// bazel-out/
|
|
16947
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pure_function_extraction.mjs
|
|
16719
16948
|
function extractPureFunctions(job) {
|
|
16720
16949
|
for (const view of job.units) {
|
|
16721
16950
|
for (const op of view.ops()) {
|
|
@@ -16757,7 +16986,7 @@ var PureFunctionConstant = class extends GenericKeyFn {
|
|
|
16757
16986
|
}
|
|
16758
16987
|
};
|
|
16759
16988
|
|
|
16760
|
-
// bazel-out/
|
|
16989
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pure_literal_structures.mjs
|
|
16761
16990
|
function generatePureLiteralStructures(job) {
|
|
16762
16991
|
for (const unit of job.units) {
|
|
16763
16992
|
for (const op of unit.update) {
|
|
@@ -16804,7 +17033,7 @@ function transformLiteralMap(expr) {
|
|
|
16804
17033
|
return new PureFunctionExpr(literalMap(derivedEntries), nonConstantArgs);
|
|
16805
17034
|
}
|
|
16806
17035
|
|
|
16807
|
-
// bazel-out/
|
|
17036
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/instruction.mjs
|
|
16808
17037
|
function element(slot, tag, constIndex, localRefIndex, sourceSpan) {
|
|
16809
17038
|
return elementOrContainerBase(Identifiers.element, slot, tag, constIndex, localRefIndex, sourceSpan);
|
|
16810
17039
|
}
|
|
@@ -17019,6 +17248,10 @@ function i18n(slot, constIndex, subTemplateIndex) {
|
|
|
17019
17248
|
function i18nEnd() {
|
|
17020
17249
|
return call(Identifiers.i18nEnd, [], null);
|
|
17021
17250
|
}
|
|
17251
|
+
function i18nAttributes(slot, i18nAttributesConfig) {
|
|
17252
|
+
const args = [literal(slot), literal(i18nAttributesConfig)];
|
|
17253
|
+
return call(Identifiers.i18nAttributes, args, null);
|
|
17254
|
+
}
|
|
17022
17255
|
function property(name, expression, sanitizer, sourceSpan) {
|
|
17023
17256
|
const args = [literal(name), expression];
|
|
17024
17257
|
if (sanitizer !== null) {
|
|
@@ -17315,7 +17548,7 @@ function callVariadicInstruction(config, baseArgs, interpolationArgs, extraArgs,
|
|
|
17315
17548
|
return createStatementOp(callVariadicInstructionExpr(config, baseArgs, interpolationArgs, extraArgs, sourceSpan).toStmt());
|
|
17316
17549
|
}
|
|
17317
17550
|
|
|
17318
|
-
// bazel-out/
|
|
17551
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/reify.mjs
|
|
17319
17552
|
var sanitizerIdentifierMap = /* @__PURE__ */ new Map([
|
|
17320
17553
|
[SanitizerFn.Html, Identifiers.sanitizeHtml],
|
|
17321
17554
|
[SanitizerFn.IframeAttribute, Identifiers.validateIframeAttribute],
|
|
@@ -17365,6 +17598,12 @@ function reifyCreateOperations(unit, ops) {
|
|
|
17365
17598
|
case OpKind.I18n:
|
|
17366
17599
|
OpList.replace(op, i18n(op.handle.slot, op.messageIndex, op.subTemplateIndex));
|
|
17367
17600
|
break;
|
|
17601
|
+
case OpKind.I18nAttributes:
|
|
17602
|
+
if (op.i18nAttributesConfig === null) {
|
|
17603
|
+
throw new Error(`AssertionError: i18nAttributesConfig was not set`);
|
|
17604
|
+
}
|
|
17605
|
+
OpList.replace(op, i18nAttributes(op.handle.slot, op.i18nAttributesConfig));
|
|
17606
|
+
break;
|
|
17368
17607
|
case OpKind.Template:
|
|
17369
17608
|
if (!(unit instanceof ViewCompilationUnit)) {
|
|
17370
17609
|
throw new Error(`AssertionError: must be compiling a component`);
|
|
@@ -17644,7 +17883,7 @@ function reifyListenerHandler(unit, name, handlerOps, consumesDollarEvent) {
|
|
|
17644
17883
|
return fn(params, handlerStmts, void 0, void 0, name);
|
|
17645
17884
|
}
|
|
17646
17885
|
|
|
17647
|
-
// bazel-out/
|
|
17886
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/remove_empty_bindings.mjs
|
|
17648
17887
|
function removeEmptyBindings(job) {
|
|
17649
17888
|
for (const unit of job.units) {
|
|
17650
17889
|
for (const op of unit.update) {
|
|
@@ -17665,7 +17904,7 @@ function removeEmptyBindings(job) {
|
|
|
17665
17904
|
}
|
|
17666
17905
|
}
|
|
17667
17906
|
|
|
17668
|
-
// bazel-out/
|
|
17907
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/remove_i18n_contexts.mjs
|
|
17669
17908
|
function removeI18nContexts(job) {
|
|
17670
17909
|
for (const unit of job.units) {
|
|
17671
17910
|
for (const op of unit.create) {
|
|
@@ -17681,7 +17920,29 @@ function removeI18nContexts(job) {
|
|
|
17681
17920
|
}
|
|
17682
17921
|
}
|
|
17683
17922
|
|
|
17684
|
-
// bazel-out/
|
|
17923
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/remove_unused_i18n_attrs.mjs
|
|
17924
|
+
function removeUnusedI18nAttributesOps(job) {
|
|
17925
|
+
for (const unit of job.units) {
|
|
17926
|
+
const ownersWithI18nExpressions = /* @__PURE__ */ new Set();
|
|
17927
|
+
for (const op of unit.update) {
|
|
17928
|
+
switch (op.kind) {
|
|
17929
|
+
case OpKind.I18nExpression:
|
|
17930
|
+
ownersWithI18nExpressions.add(op.i18nOwner);
|
|
17931
|
+
}
|
|
17932
|
+
}
|
|
17933
|
+
for (const op of unit.create) {
|
|
17934
|
+
switch (op.kind) {
|
|
17935
|
+
case OpKind.I18nAttributes:
|
|
17936
|
+
if (ownersWithI18nExpressions.has(op.xref)) {
|
|
17937
|
+
continue;
|
|
17938
|
+
}
|
|
17939
|
+
OpList.remove(op);
|
|
17940
|
+
}
|
|
17941
|
+
}
|
|
17942
|
+
}
|
|
17943
|
+
}
|
|
17944
|
+
|
|
17945
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/repeater_derived_vars.mjs
|
|
17685
17946
|
function generateRepeaterDerivedVars(job) {
|
|
17686
17947
|
const repeaters = /* @__PURE__ */ new Map();
|
|
17687
17948
|
for (const unit of job.units) {
|
|
@@ -17713,7 +17974,7 @@ function generateRepeaterDerivedVars(job) {
|
|
|
17713
17974
|
}
|
|
17714
17975
|
}
|
|
17715
17976
|
|
|
17716
|
-
// bazel-out/
|
|
17977
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_contexts.mjs
|
|
17717
17978
|
function resolveContexts(job) {
|
|
17718
17979
|
for (const unit of job.units) {
|
|
17719
17980
|
processLexicalScope(unit, unit.create);
|
|
@@ -17754,7 +18015,7 @@ function processLexicalScope(view, ops) {
|
|
|
17754
18015
|
}
|
|
17755
18016
|
}
|
|
17756
18017
|
|
|
17757
|
-
// bazel-out/
|
|
18018
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_dollar_event.mjs
|
|
17758
18019
|
function resolveDollarEvent(job) {
|
|
17759
18020
|
for (const unit of job.units) {
|
|
17760
18021
|
transformDollarEvent(unit, unit.create);
|
|
@@ -17775,7 +18036,7 @@ function transformDollarEvent(unit, ops) {
|
|
|
17775
18036
|
}
|
|
17776
18037
|
}
|
|
17777
18038
|
|
|
17778
|
-
// bazel-out/
|
|
18039
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_i18n_element_placeholders.mjs
|
|
17779
18040
|
function resolveI18nElementPlaceholders(job) {
|
|
17780
18041
|
const i18nContexts = /* @__PURE__ */ new Map();
|
|
17781
18042
|
const elements = /* @__PURE__ */ new Map();
|
|
@@ -17791,55 +18052,117 @@ function resolveI18nElementPlaceholders(job) {
|
|
|
17791
18052
|
}
|
|
17792
18053
|
}
|
|
17793
18054
|
}
|
|
17794
|
-
|
|
17795
|
-
|
|
17796
|
-
|
|
17797
|
-
|
|
17798
|
-
|
|
17799
|
-
|
|
17800
|
-
|
|
18055
|
+
resolvePlaceholdersForView(job, job.root, i18nContexts, elements);
|
|
18056
|
+
}
|
|
18057
|
+
function resolvePlaceholdersForView(job, unit, i18nContexts, elements, pendingStructuralDirective) {
|
|
18058
|
+
let currentOps = null;
|
|
18059
|
+
let pendingStructuralDirectiveCloses = /* @__PURE__ */ new Map();
|
|
18060
|
+
for (const op of unit.create) {
|
|
18061
|
+
switch (op.kind) {
|
|
18062
|
+
case OpKind.I18nStart:
|
|
18063
|
+
if (!op.context) {
|
|
18064
|
+
throw Error("Could not find i18n context for i18n op");
|
|
18065
|
+
}
|
|
18066
|
+
currentOps = { i18nBlock: op, i18nContext: i18nContexts.get(op.context) };
|
|
18067
|
+
break;
|
|
18068
|
+
case OpKind.I18nEnd:
|
|
18069
|
+
currentOps = null;
|
|
18070
|
+
break;
|
|
18071
|
+
case OpKind.ElementStart:
|
|
18072
|
+
if (op.i18nPlaceholder !== void 0) {
|
|
18073
|
+
if (currentOps === null) {
|
|
18074
|
+
throw Error("i18n tag placeholder should only occur inside an i18n block");
|
|
17801
18075
|
}
|
|
17802
|
-
|
|
17803
|
-
|
|
17804
|
-
|
|
17805
|
-
currentOps = null;
|
|
17806
|
-
break;
|
|
17807
|
-
case OpKind.ElementStart:
|
|
17808
|
-
if (op.i18nPlaceholder !== void 0) {
|
|
17809
|
-
if (currentOps === null) {
|
|
17810
|
-
throw Error("i18n tag placeholder should only occur inside an i18n block");
|
|
17811
|
-
}
|
|
17812
|
-
const { startName, closeName } = op.i18nPlaceholder;
|
|
17813
|
-
let flags = I18nParamValueFlags.ElementTag | I18nParamValueFlags.OpenTag;
|
|
17814
|
-
if (closeName === "") {
|
|
17815
|
-
flags |= I18nParamValueFlags.CloseTag;
|
|
17816
|
-
}
|
|
17817
|
-
addParam(currentOps.i18nContext.params, startName, op.handle.slot, currentOps.i18nBlock.subTemplateIndex, flags);
|
|
18076
|
+
recordElementStart(op, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective);
|
|
18077
|
+
if (pendingStructuralDirective && op.i18nPlaceholder.closeName) {
|
|
18078
|
+
pendingStructuralDirectiveCloses.set(op.xref, pendingStructuralDirective);
|
|
17818
18079
|
}
|
|
17819
|
-
|
|
17820
|
-
|
|
17821
|
-
|
|
17822
|
-
|
|
17823
|
-
|
|
17824
|
-
|
|
17825
|
-
|
|
17826
|
-
|
|
17827
|
-
if (closeName !== "") {
|
|
17828
|
-
addParam(currentOps.i18nContext.params, closeName, startOp.handle.slot, currentOps.i18nBlock.subTemplateIndex, I18nParamValueFlags.ElementTag | I18nParamValueFlags.CloseTag);
|
|
17829
|
-
}
|
|
18080
|
+
pendingStructuralDirective = void 0;
|
|
18081
|
+
}
|
|
18082
|
+
break;
|
|
18083
|
+
case OpKind.ElementEnd:
|
|
18084
|
+
const startOp = elements.get(op.xref);
|
|
18085
|
+
if (startOp && startOp.i18nPlaceholder !== void 0) {
|
|
18086
|
+
if (currentOps === null) {
|
|
18087
|
+
throw Error("AssertionError: i18n tag placeholder should only occur inside an i18n block");
|
|
17830
18088
|
}
|
|
17831
|
-
|
|
17832
|
-
|
|
17833
|
-
|
|
17834
|
-
|
|
17835
|
-
|
|
17836
|
-
|
|
17837
|
-
|
|
17838
|
-
|
|
17839
|
-
addParam(currentOps.i18nContext.params, op.i18nPlaceholder.closeName, op.handle.slot, subTemplateIndex, I18nParamValueFlags.TemplateTag | I18nParamValueFlags.CloseTag);
|
|
18089
|
+
recordElementClose(startOp, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirectiveCloses.get(op.xref));
|
|
18090
|
+
pendingStructuralDirectiveCloses.delete(op.xref);
|
|
18091
|
+
}
|
|
18092
|
+
break;
|
|
18093
|
+
case OpKind.Projection:
|
|
18094
|
+
if (op.i18nPlaceholder !== void 0) {
|
|
18095
|
+
if (currentOps === null) {
|
|
18096
|
+
throw Error("i18n tag placeholder should only occur inside an i18n block");
|
|
17840
18097
|
}
|
|
17841
|
-
|
|
17842
|
-
|
|
18098
|
+
recordElementStart(op, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective);
|
|
18099
|
+
recordElementClose(op, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective);
|
|
18100
|
+
pendingStructuralDirective = void 0;
|
|
18101
|
+
}
|
|
18102
|
+
break;
|
|
18103
|
+
case OpKind.Template:
|
|
18104
|
+
if (op.i18nPlaceholder === void 0) {
|
|
18105
|
+
resolvePlaceholdersForView(job, job.views.get(op.xref), i18nContexts, elements);
|
|
18106
|
+
} else {
|
|
18107
|
+
if (currentOps === null) {
|
|
18108
|
+
throw Error("i18n tag placeholder should only occur inside an i18n block");
|
|
18109
|
+
}
|
|
18110
|
+
if (op.templateKind === TemplateKind.Structural) {
|
|
18111
|
+
resolvePlaceholdersForView(job, job.views.get(op.xref), i18nContexts, elements, op);
|
|
18112
|
+
} else {
|
|
18113
|
+
recordTemplateStart(job, op, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective);
|
|
18114
|
+
resolvePlaceholdersForView(job, job.views.get(op.xref), i18nContexts, elements);
|
|
18115
|
+
recordTemplateClose(job, op, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective);
|
|
18116
|
+
pendingStructuralDirective = void 0;
|
|
18117
|
+
}
|
|
18118
|
+
}
|
|
18119
|
+
break;
|
|
18120
|
+
}
|
|
18121
|
+
}
|
|
18122
|
+
}
|
|
18123
|
+
function recordElementStart(op, i18nContext, i18nBlock, structuralDirective) {
|
|
18124
|
+
const { startName, closeName } = op.i18nPlaceholder;
|
|
18125
|
+
let flags = I18nParamValueFlags.ElementTag | I18nParamValueFlags.OpenTag;
|
|
18126
|
+
let value = op.handle.slot;
|
|
18127
|
+
if (structuralDirective !== void 0) {
|
|
18128
|
+
flags |= I18nParamValueFlags.TemplateTag;
|
|
18129
|
+
value = { element: value, template: structuralDirective.handle.slot };
|
|
18130
|
+
}
|
|
18131
|
+
if (!closeName) {
|
|
18132
|
+
flags |= I18nParamValueFlags.CloseTag;
|
|
18133
|
+
}
|
|
18134
|
+
addParam(i18nContext.params, startName, value, i18nBlock.subTemplateIndex, flags);
|
|
18135
|
+
}
|
|
18136
|
+
function recordElementClose(op, i18nContext, i18nBlock, structuralDirective) {
|
|
18137
|
+
const { closeName } = op.i18nPlaceholder;
|
|
18138
|
+
if (closeName) {
|
|
18139
|
+
let flags = I18nParamValueFlags.ElementTag | I18nParamValueFlags.CloseTag;
|
|
18140
|
+
let value = op.handle.slot;
|
|
18141
|
+
if (structuralDirective !== void 0) {
|
|
18142
|
+
flags |= I18nParamValueFlags.TemplateTag;
|
|
18143
|
+
value = { element: value, template: structuralDirective.handle.slot };
|
|
18144
|
+
}
|
|
18145
|
+
addParam(i18nContext.params, closeName, value, i18nBlock.subTemplateIndex, flags);
|
|
18146
|
+
}
|
|
18147
|
+
}
|
|
18148
|
+
function recordTemplateStart(job, op, i18nContext, i18nBlock, structuralDirective) {
|
|
18149
|
+
let { startName, closeName } = op.i18nPlaceholder;
|
|
18150
|
+
let flags = I18nParamValueFlags.TemplateTag | I18nParamValueFlags.OpenTag;
|
|
18151
|
+
if (!closeName) {
|
|
18152
|
+
flags |= I18nParamValueFlags.CloseTag;
|
|
18153
|
+
}
|
|
18154
|
+
if (structuralDirective !== void 0) {
|
|
18155
|
+
addParam(i18nContext.params, startName, structuralDirective.handle.slot, i18nBlock.subTemplateIndex, flags);
|
|
18156
|
+
}
|
|
18157
|
+
addParam(i18nContext.params, startName, op.handle.slot, getSubTemplateIndexForTemplateTag(job, i18nBlock, op), flags);
|
|
18158
|
+
}
|
|
18159
|
+
function recordTemplateClose(job, op, i18nContext, i18nBlock, structuralDirective) {
|
|
18160
|
+
const { startName, closeName } = op.i18nPlaceholder;
|
|
18161
|
+
const flags = I18nParamValueFlags.TemplateTag | I18nParamValueFlags.CloseTag;
|
|
18162
|
+
if (closeName) {
|
|
18163
|
+
addParam(i18nContext.params, closeName, op.handle.slot, getSubTemplateIndexForTemplateTag(job, i18nBlock, op), flags);
|
|
18164
|
+
if (structuralDirective !== void 0) {
|
|
18165
|
+
addParam(i18nContext.params, closeName, structuralDirective.handle.slot, i18nBlock.subTemplateIndex, flags);
|
|
17843
18166
|
}
|
|
17844
18167
|
}
|
|
17845
18168
|
}
|
|
@@ -17858,8 +18181,9 @@ function addParam(params, placeholder, value, subTemplateIndex, flags) {
|
|
|
17858
18181
|
params.set(placeholder, values);
|
|
17859
18182
|
}
|
|
17860
18183
|
|
|
17861
|
-
// bazel-out/
|
|
18184
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_i18n_expression_placeholders.mjs
|
|
17862
18185
|
function resolveI18nExpressionPlaceholders(job) {
|
|
18186
|
+
var _a2;
|
|
17863
18187
|
const subTemplateIndicies = /* @__PURE__ */ new Map();
|
|
17864
18188
|
const i18nContexts = /* @__PURE__ */ new Map();
|
|
17865
18189
|
for (const unit of job.units) {
|
|
@@ -17875,12 +18199,13 @@ function resolveI18nExpressionPlaceholders(job) {
|
|
|
17875
18199
|
}
|
|
17876
18200
|
}
|
|
17877
18201
|
const expressionIndices = /* @__PURE__ */ new Map();
|
|
18202
|
+
const referenceIndex = (op) => op.usage === I18nExpressionFor.I18nText ? op.i18nOwner : op.context;
|
|
17878
18203
|
for (const unit of job.units) {
|
|
17879
18204
|
for (const op of unit.update) {
|
|
17880
18205
|
if (op.kind === OpKind.I18nExpression) {
|
|
17881
18206
|
const i18nContext = i18nContexts.get(op.context);
|
|
17882
|
-
const index = expressionIndices.get(
|
|
17883
|
-
const subTemplateIndex = subTemplateIndicies.get(
|
|
18207
|
+
const index = expressionIndices.get(referenceIndex(op)) || 0;
|
|
18208
|
+
const subTemplateIndex = (_a2 = subTemplateIndicies.get(op.i18nOwner)) != null ? _a2 : null;
|
|
17884
18209
|
const params = op.resolutionTime === I18nParamResolutionTime.Creation ? i18nContext.params : i18nContext.postprocessingParams;
|
|
17885
18210
|
const values = params.get(op.i18nPlaceholder) || [];
|
|
17886
18211
|
values.push({
|
|
@@ -17889,36 +18214,20 @@ function resolveI18nExpressionPlaceholders(job) {
|
|
|
17889
18214
|
flags: I18nParamValueFlags.ExpressionIndex
|
|
17890
18215
|
});
|
|
17891
18216
|
params.set(op.i18nPlaceholder, values);
|
|
17892
|
-
expressionIndices.set(
|
|
18217
|
+
expressionIndices.set(referenceIndex(op), index + 1);
|
|
17893
18218
|
}
|
|
17894
18219
|
}
|
|
17895
18220
|
}
|
|
17896
18221
|
}
|
|
17897
18222
|
|
|
17898
|
-
// bazel-out/
|
|
18223
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_i18n_icu_placeholders.mjs
|
|
17899
18224
|
function resolveI18nIcuPlaceholders(job) {
|
|
17900
|
-
const contextOps = /* @__PURE__ */ new Map();
|
|
17901
|
-
for (const unit of job.units) {
|
|
17902
|
-
for (const op of unit.create) {
|
|
17903
|
-
switch (op.kind) {
|
|
17904
|
-
case OpKind.I18nContext:
|
|
17905
|
-
contextOps.set(op.xref, op);
|
|
17906
|
-
break;
|
|
17907
|
-
}
|
|
17908
|
-
}
|
|
17909
|
-
}
|
|
17910
18225
|
for (const unit of job.units) {
|
|
17911
18226
|
for (const op of unit.create) {
|
|
17912
|
-
|
|
17913
|
-
|
|
17914
|
-
|
|
17915
|
-
|
|
17916
|
-
}
|
|
17917
|
-
const i18nContext = contextOps.get(op.context);
|
|
17918
|
-
for (const node of op.message.nodes) {
|
|
17919
|
-
node.visit(new ResolveIcuPlaceholdersVisitor(i18nContext.postprocessingParams));
|
|
17920
|
-
}
|
|
17921
|
-
break;
|
|
18227
|
+
if (op.kind === OpKind.I18nContext && op.contextKind === I18nContextKind.Icu) {
|
|
18228
|
+
for (const node of op.message.nodes) {
|
|
18229
|
+
node.visit(new ResolveIcuPlaceholdersVisitor(op.postprocessingParams));
|
|
18230
|
+
}
|
|
17922
18231
|
}
|
|
17923
18232
|
}
|
|
17924
18233
|
}
|
|
@@ -17955,7 +18264,7 @@ var ResolveIcuPlaceholdersVisitor = class extends RecurseVisitor {
|
|
|
17955
18264
|
}
|
|
17956
18265
|
};
|
|
17957
18266
|
|
|
17958
|
-
// bazel-out/
|
|
18267
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_names.mjs
|
|
17959
18268
|
function resolveNames(job) {
|
|
17960
18269
|
for (const unit of job.units) {
|
|
17961
18270
|
processLexicalScope2(unit, unit.create, null);
|
|
@@ -18019,7 +18328,7 @@ function processLexicalScope2(unit, ops, savedView) {
|
|
|
18019
18328
|
}
|
|
18020
18329
|
}
|
|
18021
18330
|
|
|
18022
|
-
// bazel-out/
|
|
18331
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_sanitizers.mjs
|
|
18023
18332
|
var sanitizers = /* @__PURE__ */ new Map([
|
|
18024
18333
|
[SecurityContext.HTML, SanitizerFn.Html],
|
|
18025
18334
|
[SecurityContext.SCRIPT, SanitizerFn.Script],
|
|
@@ -18056,7 +18365,7 @@ function isIframeElement(op) {
|
|
|
18056
18365
|
return op.kind === OpKind.ElementStart && ((_a2 = op.tag) == null ? void 0 : _a2.toLowerCase()) === "iframe";
|
|
18057
18366
|
}
|
|
18058
18367
|
|
|
18059
|
-
// bazel-out/
|
|
18368
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/save_restore_view.mjs
|
|
18060
18369
|
function saveAndRestoreView(job) {
|
|
18061
18370
|
for (const unit of job.units) {
|
|
18062
18371
|
unit.create.prepend([
|
|
@@ -18101,7 +18410,7 @@ function addSaveRestoreViewOperationToListener(unit, op) {
|
|
|
18101
18410
|
}
|
|
18102
18411
|
}
|
|
18103
18412
|
|
|
18104
|
-
// bazel-out/
|
|
18413
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/slot_allocation.mjs
|
|
18105
18414
|
function allocateSlots(job) {
|
|
18106
18415
|
const slotMap = /* @__PURE__ */ new Map();
|
|
18107
18416
|
for (const unit of job.units) {
|
|
@@ -18126,7 +18435,7 @@ function allocateSlots(job) {
|
|
|
18126
18435
|
}
|
|
18127
18436
|
}
|
|
18128
18437
|
|
|
18129
|
-
// bazel-out/
|
|
18438
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/style_binding_specialization.mjs
|
|
18130
18439
|
function specializeStyleBindings(job) {
|
|
18131
18440
|
for (const unit of job.units) {
|
|
18132
18441
|
for (const op of unit.update) {
|
|
@@ -18156,7 +18465,7 @@ function specializeStyleBindings(job) {
|
|
|
18156
18465
|
}
|
|
18157
18466
|
}
|
|
18158
18467
|
|
|
18159
|
-
// bazel-out/
|
|
18468
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/temporary_variables.mjs
|
|
18160
18469
|
function generateTemporaryVariables(job) {
|
|
18161
18470
|
for (const unit of job.units) {
|
|
18162
18471
|
unit.create.prepend(generateTemporaries(unit.create));
|
|
@@ -18214,7 +18523,7 @@ function assignName(names, expr) {
|
|
|
18214
18523
|
expr.name = name;
|
|
18215
18524
|
}
|
|
18216
18525
|
|
|
18217
|
-
// bazel-out/
|
|
18526
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/track_fn_generation.mjs
|
|
18218
18527
|
function generateTrackFns(job) {
|
|
18219
18528
|
for (const unit of job.units) {
|
|
18220
18529
|
for (const op of unit.create) {
|
|
@@ -18244,7 +18553,7 @@ function generateTrackFns(job) {
|
|
|
18244
18553
|
}
|
|
18245
18554
|
}
|
|
18246
18555
|
|
|
18247
|
-
// bazel-out/
|
|
18556
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/track_fn_optimization.mjs
|
|
18248
18557
|
function optimizeTrackFns(job) {
|
|
18249
18558
|
for (const unit of job.units) {
|
|
18250
18559
|
for (const op of unit.create) {
|
|
@@ -18291,7 +18600,7 @@ function isTrackByFunctionCall(rootView, expr) {
|
|
|
18291
18600
|
return true;
|
|
18292
18601
|
}
|
|
18293
18602
|
|
|
18294
|
-
// bazel-out/
|
|
18603
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/track_variables.mjs
|
|
18295
18604
|
function generateTrackVariables(job) {
|
|
18296
18605
|
for (const unit of job.units) {
|
|
18297
18606
|
for (const op of unit.create) {
|
|
@@ -18312,7 +18621,7 @@ function generateTrackVariables(job) {
|
|
|
18312
18621
|
}
|
|
18313
18622
|
}
|
|
18314
18623
|
|
|
18315
|
-
// bazel-out/
|
|
18624
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/var_counting.mjs
|
|
18316
18625
|
function countVariables(job) {
|
|
18317
18626
|
for (const unit of job.units) {
|
|
18318
18627
|
let varCount = 0;
|
|
@@ -18417,7 +18726,7 @@ function isSingletonInterpolation(expr) {
|
|
|
18417
18726
|
return true;
|
|
18418
18727
|
}
|
|
18419
18728
|
|
|
18420
|
-
// bazel-out/
|
|
18729
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/variable_optimization.mjs
|
|
18421
18730
|
function optimizeVariables(job) {
|
|
18422
18731
|
for (const unit of job.units) {
|
|
18423
18732
|
inlineAlwaysInlineVariables(unit.create);
|
|
@@ -18667,7 +18976,7 @@ function allowConservativeInlining(decl, target) {
|
|
|
18667
18976
|
}
|
|
18668
18977
|
}
|
|
18669
18978
|
|
|
18670
|
-
// bazel-out/
|
|
18979
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/wrap_icus.mjs
|
|
18671
18980
|
function wrapI18nIcus(job) {
|
|
18672
18981
|
for (const unit of job.units) {
|
|
18673
18982
|
let currentI18nOp = null;
|
|
@@ -18697,16 +19006,16 @@ function wrapI18nIcus(job) {
|
|
|
18697
19006
|
}
|
|
18698
19007
|
}
|
|
18699
19008
|
|
|
18700
|
-
// bazel-out/
|
|
19009
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/emit.mjs
|
|
18701
19010
|
var phases = [
|
|
18702
19011
|
{ kind: CompilationJobKind.Tmpl, fn: removeContentSelectors },
|
|
18703
19012
|
{ kind: CompilationJobKind.Host, fn: parseHostStyleProperties },
|
|
18704
19013
|
{ kind: CompilationJobKind.Tmpl, fn: emitNamespaceChanges },
|
|
18705
|
-
{ kind: CompilationJobKind.Both, fn: specializeStyleBindings },
|
|
18706
|
-
{ kind: CompilationJobKind.Both, fn: specializeBindings },
|
|
18707
19014
|
{ kind: CompilationJobKind.Tmpl, fn: propagateI18nBlocks },
|
|
18708
19015
|
{ kind: CompilationJobKind.Tmpl, fn: wrapI18nIcus },
|
|
18709
19016
|
{ kind: CompilationJobKind.Tmpl, fn: createI18nContexts },
|
|
19017
|
+
{ kind: CompilationJobKind.Both, fn: specializeStyleBindings },
|
|
19018
|
+
{ kind: CompilationJobKind.Both, fn: specializeBindings },
|
|
18710
19019
|
{ kind: CompilationJobKind.Both, fn: extractAttributes },
|
|
18711
19020
|
{ kind: CompilationJobKind.Both, fn: parseExtractedStyles },
|
|
18712
19021
|
{ kind: CompilationJobKind.Tmpl, fn: removeEmptyBindings },
|
|
@@ -18715,7 +19024,10 @@ var phases = [
|
|
|
18715
19024
|
{ kind: CompilationJobKind.Tmpl, fn: generateConditionalExpressions },
|
|
18716
19025
|
{ kind: CompilationJobKind.Tmpl, fn: createPipes },
|
|
18717
19026
|
{ kind: CompilationJobKind.Tmpl, fn: configureDeferInstructions },
|
|
18718
|
-
{ kind: CompilationJobKind.Tmpl, fn:
|
|
19027
|
+
{ kind: CompilationJobKind.Tmpl, fn: convertI18nText },
|
|
19028
|
+
{ kind: CompilationJobKind.Tmpl, fn: convertI18nBindings },
|
|
19029
|
+
{ kind: CompilationJobKind.Tmpl, fn: removeUnusedI18nAttributesOps },
|
|
19030
|
+
{ kind: CompilationJobKind.Tmpl, fn: assignI18nSlotDependencies },
|
|
18719
19031
|
{ kind: CompilationJobKind.Tmpl, fn: applyI18nExpressions },
|
|
18720
19032
|
{ kind: CompilationJobKind.Tmpl, fn: createVariadicPipes },
|
|
18721
19033
|
{ kind: CompilationJobKind.Both, fn: generatePureLiteralStructures },
|
|
@@ -18740,13 +19052,11 @@ var phases = [
|
|
|
18740
19052
|
{ kind: CompilationJobKind.Tmpl, fn: resolveI18nElementPlaceholders },
|
|
18741
19053
|
{ kind: CompilationJobKind.Tmpl, fn: resolveI18nExpressionPlaceholders },
|
|
18742
19054
|
{ kind: CompilationJobKind.Tmpl, fn: resolveI18nIcuPlaceholders },
|
|
18743
|
-
{ kind: CompilationJobKind.Tmpl, fn: mergeI18nContexts },
|
|
18744
19055
|
{ kind: CompilationJobKind.Tmpl, fn: extractI18nMessages },
|
|
18745
19056
|
{ kind: CompilationJobKind.Tmpl, fn: generateTrackFns },
|
|
18746
19057
|
{ kind: CompilationJobKind.Tmpl, fn: collectI18nConsts },
|
|
18747
19058
|
{ kind: CompilationJobKind.Tmpl, fn: collectConstExpressions },
|
|
18748
19059
|
{ kind: CompilationJobKind.Both, fn: collectElementConsts },
|
|
18749
|
-
{ kind: CompilationJobKind.Tmpl, fn: assignI18nSlotDependencies },
|
|
18750
19060
|
{ kind: CompilationJobKind.Tmpl, fn: removeI18nContexts },
|
|
18751
19061
|
{ kind: CompilationJobKind.Both, fn: countVariables },
|
|
18752
19062
|
{ kind: CompilationJobKind.Tmpl, fn: generateAdvance },
|
|
@@ -18862,7 +19172,7 @@ function emitHostBindingFunction(job) {
|
|
|
18862
19172
|
);
|
|
18863
19173
|
}
|
|
18864
19174
|
|
|
18865
|
-
// bazel-out/
|
|
19175
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/ingest.mjs
|
|
18866
19176
|
var compatibilityMode = CompatibilityMode.TemplateDefinitionBuilder;
|
|
18867
19177
|
function ingestComponent(componentName, template2, constantPool, relativeContextFilePath, i18nUseExternalIds, deferBlocksMeta) {
|
|
18868
19178
|
const job = new ComponentCompilationJob(componentName, constantPool, compatibilityMode, relativeContextFilePath, i18nUseExternalIds, deferBlocksMeta);
|
|
@@ -18887,7 +19197,7 @@ function ingestHostProperty(job, property2, isTextAttribute) {
|
|
|
18887
19197
|
let expression;
|
|
18888
19198
|
const ast = property2.expression.ast;
|
|
18889
19199
|
if (ast instanceof Interpolation) {
|
|
18890
|
-
expression = new Interpolation2(ast.strings, ast.expressions.map((expr) => convertAst(expr, job, property2.sourceSpan)));
|
|
19200
|
+
expression = new Interpolation2(ast.strings, ast.expressions.map((expr) => convertAst(expr, job, property2.sourceSpan)), []);
|
|
18891
19201
|
} else {
|
|
18892
19202
|
expression = convertAst(ast, job, property2.sourceSpan);
|
|
18893
19203
|
}
|
|
@@ -18899,7 +19209,7 @@ function ingestHostProperty(job, property2, isTextAttribute) {
|
|
|
18899
19209
|
if (property2.isAnimation) {
|
|
18900
19210
|
bindingKind = BindingKind.Animation;
|
|
18901
19211
|
}
|
|
18902
|
-
job.root.update.push(createBindingOp(job.root.xref, bindingKind, property2.name, expression, null, SecurityContext.NONE, isTextAttribute, false, property2.sourceSpan));
|
|
19212
|
+
job.root.update.push(createBindingOp(job.root.xref, bindingKind, property2.name, expression, null, SecurityContext.NONE, isTextAttribute, false, null, property2.sourceSpan));
|
|
18903
19213
|
}
|
|
18904
19214
|
function ingestHostAttribute(job, name, value) {
|
|
18905
19215
|
const attrBinding = createBindingOp(
|
|
@@ -18911,6 +19221,7 @@ function ingestHostAttribute(job, name, value) {
|
|
|
18911
19221
|
SecurityContext.NONE,
|
|
18912
19222
|
true,
|
|
18913
19223
|
false,
|
|
19224
|
+
null,
|
|
18914
19225
|
null
|
|
18915
19226
|
);
|
|
18916
19227
|
job.root.update.push(attrBinding);
|
|
@@ -18980,24 +19291,29 @@ function ingestTemplate(unit, tmpl) {
|
|
|
18980
19291
|
const i18nPlaceholder = tmpl.i18n instanceof TagPlaceholder ? tmpl.i18n : void 0;
|
|
18981
19292
|
const namespace = namespaceForKey(namespacePrefix);
|
|
18982
19293
|
const functionNameSuffix = tagNameWithoutNamespace === null ? "" : prefixWithNamespace(tagNameWithoutNamespace, namespace);
|
|
18983
|
-
const
|
|
18984
|
-
|
|
18985
|
-
|
|
18986
|
-
|
|
19294
|
+
const templateKind = isPlainTemplate(tmpl) ? TemplateKind.NgTemplate : TemplateKind.Structural;
|
|
19295
|
+
const templateOp = createTemplateOp(childView.xref, templateKind, tagNameWithoutNamespace, functionNameSuffix, namespace, i18nPlaceholder, tmpl.startSourceSpan);
|
|
19296
|
+
unit.create.push(templateOp);
|
|
19297
|
+
ingestBindings(unit, templateOp, tmpl);
|
|
19298
|
+
ingestReferences(templateOp, tmpl);
|
|
18987
19299
|
ingestNodes(childView, tmpl.children);
|
|
18988
19300
|
for (const { name, value } of tmpl.variables) {
|
|
18989
19301
|
childView.contextVariables.set(name, value !== "" ? value : "$implicit");
|
|
18990
19302
|
}
|
|
18991
|
-
if (
|
|
19303
|
+
if (templateKind === TemplateKind.NgTemplate && tmpl.i18n instanceof Message) {
|
|
18992
19304
|
const id = unit.job.allocateXrefId();
|
|
18993
19305
|
OpList.insertAfter(createI18nStartOp(id, tmpl.i18n), childView.create.head);
|
|
18994
19306
|
OpList.insertBefore(createI18nEndOp(id), childView.create.tail);
|
|
18995
19307
|
}
|
|
18996
19308
|
}
|
|
18997
19309
|
function ingestContent(unit, content) {
|
|
18998
|
-
|
|
19310
|
+
if (content.i18n !== void 0 && !(content.i18n instanceof TagPlaceholder)) {
|
|
19311
|
+
throw Error(`Unhandled i18n metadata type for element: ${content.i18n.constructor.name}`);
|
|
19312
|
+
}
|
|
19313
|
+
const attrs = content.attributes.flatMap((a) => [a.name, a.value]);
|
|
19314
|
+
const op = createProjectionOp(unit.job.allocateXrefId(), content.selector, content.i18n, attrs, content.sourceSpan);
|
|
18999
19315
|
for (const attr of content.attributes) {
|
|
19000
|
-
ingestBinding(unit, op.xref, attr.name, literal(attr.value), 1, null, SecurityContext.NONE, attr.sourceSpan, BindingFlags.TextValue);
|
|
19316
|
+
ingestBinding(unit, op.xref, attr.name, literal(attr.value), 1, null, SecurityContext.NONE, attr.sourceSpan, BindingFlags.TextValue, attr.i18n);
|
|
19001
19317
|
}
|
|
19002
19318
|
unit.create.push(op);
|
|
19003
19319
|
}
|
|
@@ -19025,9 +19341,10 @@ function ingestBoundText(unit, text2, i18nPlaceholders) {
|
|
|
19025
19341
|
const textXref = unit.job.allocateXrefId();
|
|
19026
19342
|
unit.create.push(createTextOp(textXref, "", text2.sourceSpan));
|
|
19027
19343
|
const baseSourceSpan = unit.job.compatibility ? null : text2.sourceSpan;
|
|
19028
|
-
unit.update.push(createInterpolateTextOp(textXref, new Interpolation2(value.strings, value.expressions.map((expr) => convertAst(expr, unit.job, baseSourceSpan))
|
|
19344
|
+
unit.update.push(createInterpolateTextOp(textXref, new Interpolation2(value.strings, value.expressions.map((expr) => convertAst(expr, unit.job, baseSourceSpan)), i18nPlaceholders), text2.sourceSpan));
|
|
19029
19345
|
}
|
|
19030
19346
|
function ingestIfBlock(unit, ifBlock) {
|
|
19347
|
+
var _a2;
|
|
19031
19348
|
let firstXref = null;
|
|
19032
19349
|
let firstSlotHandle = null;
|
|
19033
19350
|
let conditions = [];
|
|
@@ -19041,14 +19358,21 @@ function ingestIfBlock(unit, ifBlock) {
|
|
|
19041
19358
|
if (ifCase.expressionAlias !== null) {
|
|
19042
19359
|
cView.contextVariables.set(ifCase.expressionAlias.name, CTX_REF);
|
|
19043
19360
|
}
|
|
19044
|
-
|
|
19045
|
-
|
|
19361
|
+
let ifCaseI18nMeta = void 0;
|
|
19362
|
+
if (ifCase.i18n !== void 0) {
|
|
19363
|
+
if (!(ifCase.i18n instanceof BlockPlaceholder)) {
|
|
19364
|
+
throw Error(`Unhandled i18n metadata type for if block: ${(_a2 = ifCase.i18n) == null ? void 0 : _a2.constructor.name}`);
|
|
19365
|
+
}
|
|
19366
|
+
ifCaseI18nMeta = ifCase.i18n;
|
|
19367
|
+
}
|
|
19368
|
+
const templateOp = createTemplateOp(cView.xref, TemplateKind.Block, tagName, "Conditional", Namespace.HTML, ifCaseI18nMeta, ifCase.sourceSpan);
|
|
19369
|
+
unit.create.push(templateOp);
|
|
19046
19370
|
if (firstXref === null) {
|
|
19047
19371
|
firstXref = cView.xref;
|
|
19048
|
-
firstSlotHandle =
|
|
19372
|
+
firstSlotHandle = templateOp.handle;
|
|
19049
19373
|
}
|
|
19050
19374
|
const caseExpr = ifCase.expression ? convertAst(ifCase.expression, unit.job, null) : null;
|
|
19051
|
-
const conditionalCaseExpr = new ConditionalCaseExpr(caseExpr,
|
|
19375
|
+
const conditionalCaseExpr = new ConditionalCaseExpr(caseExpr, templateOp.xref, templateOp.handle, ifCase.expressionAlias);
|
|
19052
19376
|
conditions.push(conditionalCaseExpr);
|
|
19053
19377
|
ingestNodes(cView, ifCase.children);
|
|
19054
19378
|
}
|
|
@@ -19056,19 +19380,27 @@ function ingestIfBlock(unit, ifBlock) {
|
|
|
19056
19380
|
unit.update.push(conditional2);
|
|
19057
19381
|
}
|
|
19058
19382
|
function ingestSwitchBlock(unit, switchBlock) {
|
|
19383
|
+
var _a2;
|
|
19059
19384
|
let firstXref = null;
|
|
19060
19385
|
let firstSlotHandle = null;
|
|
19061
19386
|
let conditions = [];
|
|
19062
19387
|
for (const switchCase of switchBlock.cases) {
|
|
19063
19388
|
const cView = unit.job.allocateView(unit.xref);
|
|
19064
|
-
|
|
19065
|
-
|
|
19389
|
+
let switchCaseI18nMeta = void 0;
|
|
19390
|
+
if (switchCase.i18n !== void 0) {
|
|
19391
|
+
if (!(switchCase.i18n instanceof BlockPlaceholder)) {
|
|
19392
|
+
throw Error(`Unhandled i18n metadata type for switch block: ${(_a2 = switchCase.i18n) == null ? void 0 : _a2.constructor.name}`);
|
|
19393
|
+
}
|
|
19394
|
+
switchCaseI18nMeta = switchCase.i18n;
|
|
19395
|
+
}
|
|
19396
|
+
const templateOp = createTemplateOp(cView.xref, TemplateKind.Block, null, "Case", Namespace.HTML, switchCaseI18nMeta, switchCase.sourceSpan);
|
|
19397
|
+
unit.create.push(templateOp);
|
|
19066
19398
|
if (firstXref === null) {
|
|
19067
19399
|
firstXref = cView.xref;
|
|
19068
|
-
firstSlotHandle =
|
|
19400
|
+
firstSlotHandle = templateOp.handle;
|
|
19069
19401
|
}
|
|
19070
19402
|
const caseExpr = switchCase.expression ? convertAst(switchCase.expression, unit.job, switchBlock.startSourceSpan) : null;
|
|
19071
|
-
const conditionalCaseExpr = new ConditionalCaseExpr(caseExpr,
|
|
19403
|
+
const conditionalCaseExpr = new ConditionalCaseExpr(caseExpr, templateOp.xref, templateOp.handle);
|
|
19072
19404
|
conditions.push(conditionalCaseExpr);
|
|
19073
19405
|
ingestNodes(cView, switchCase.children);
|
|
19074
19406
|
}
|
|
@@ -19081,7 +19413,7 @@ function ingestDeferView(unit, suffix, children, sourceSpan) {
|
|
|
19081
19413
|
}
|
|
19082
19414
|
const secondaryView = unit.job.allocateView(unit.xref);
|
|
19083
19415
|
ingestNodes(secondaryView, children);
|
|
19084
|
-
const templateOp = createTemplateOp(secondaryView.xref, null, `Defer${suffix}`, Namespace.HTML, void 0, sourceSpan);
|
|
19416
|
+
const templateOp = createTemplateOp(secondaryView.xref, TemplateKind.Block, null, `Defer${suffix}`, Namespace.HTML, void 0, sourceSpan);
|
|
19085
19417
|
unit.create.push(templateOp);
|
|
19086
19418
|
return templateOp;
|
|
19087
19419
|
}
|
|
@@ -19167,17 +19499,12 @@ function ingestDeferBlock(unit, deferBlock) {
|
|
|
19167
19499
|
unit.update.push(deferWhenOps);
|
|
19168
19500
|
}
|
|
19169
19501
|
function ingestIcu(unit, icu) {
|
|
19170
|
-
var _a2
|
|
19502
|
+
var _a2;
|
|
19171
19503
|
if (icu.i18n instanceof Message && isSingleI18nIcu(icu.i18n)) {
|
|
19172
19504
|
const xref = unit.job.allocateXrefId();
|
|
19173
19505
|
const icuNode = icu.i18n.nodes[0];
|
|
19174
19506
|
unit.create.push(createIcuStartOp(xref, icu.i18n, icuFromI18nMessage(icu.i18n).name, null));
|
|
19175
|
-
const
|
|
19176
|
-
if (expressionPlaceholder === void 0 || icu.vars[expressionPlaceholder] === void 0) {
|
|
19177
|
-
throw Error("ICU should have a text binding");
|
|
19178
|
-
}
|
|
19179
|
-
ingestBoundText(unit, icu.vars[expressionPlaceholder], [expressionPlaceholder]);
|
|
19180
|
-
for (const [placeholder, text2] of Object.entries(icu.placeholders)) {
|
|
19507
|
+
for (const [placeholder, text2] of Object.entries(__spreadValues(__spreadValues({}, icu.vars), icu.placeholders))) {
|
|
19181
19508
|
if (text2 instanceof BoundText) {
|
|
19182
19509
|
ingestBoundText(unit, text2, [placeholder]);
|
|
19183
19510
|
} else {
|
|
@@ -19186,7 +19513,7 @@ function ingestIcu(unit, icu) {
|
|
|
19186
19513
|
}
|
|
19187
19514
|
unit.create.push(createIcuEndOp(xref));
|
|
19188
19515
|
} else {
|
|
19189
|
-
throw Error(`Unhandled i18n metadata type for ICU: ${(
|
|
19516
|
+
throw Error(`Unhandled i18n metadata type for ICU: ${(_a2 = icu.i18n) == null ? void 0 : _a2.constructor.name}`);
|
|
19190
19517
|
}
|
|
19191
19518
|
}
|
|
19192
19519
|
function ingestForBlock(unit, forBlock) {
|
|
@@ -19261,6 +19588,15 @@ function convertAst(ast, job, baseSourceSpan) {
|
|
|
19261
19588
|
}
|
|
19262
19589
|
} else if (ast instanceof LiteralPrimitive) {
|
|
19263
19590
|
return literal(ast.value, void 0, convertSourceSpan(ast.span, baseSourceSpan));
|
|
19591
|
+
} else if (ast instanceof Unary) {
|
|
19592
|
+
switch (ast.operator) {
|
|
19593
|
+
case "+":
|
|
19594
|
+
return new UnaryOperatorExpr(UnaryOperator.Plus, convertAst(ast.expr, job, baseSourceSpan), void 0, convertSourceSpan(ast.span, baseSourceSpan));
|
|
19595
|
+
case "-":
|
|
19596
|
+
return new UnaryOperatorExpr(UnaryOperator.Minus, convertAst(ast.expr, job, baseSourceSpan), void 0, convertSourceSpan(ast.span, baseSourceSpan));
|
|
19597
|
+
default:
|
|
19598
|
+
throw new Error(`AssertionError: unknown unary operator ${ast.operator}`);
|
|
19599
|
+
}
|
|
19264
19600
|
} else if (ast instanceof Binary) {
|
|
19265
19601
|
const operator = BINARY_OPERATORS.get(ast.operation);
|
|
19266
19602
|
if (operator === void 0) {
|
|
@@ -19298,6 +19634,8 @@ function convertAst(ast, job, baseSourceSpan) {
|
|
|
19298
19634
|
return new SafeInvokeFunctionExpr(convertAst(ast.receiver, job, baseSourceSpan), ast.args.map((a) => convertAst(a, job, baseSourceSpan)));
|
|
19299
19635
|
} else if (ast instanceof EmptyExpr) {
|
|
19300
19636
|
return new EmptyExpr2(convertSourceSpan(ast.span, baseSourceSpan));
|
|
19637
|
+
} else if (ast instanceof PrefixNot) {
|
|
19638
|
+
return not(convertAst(ast.expression, job, baseSourceSpan), convertSourceSpan(ast.span, baseSourceSpan));
|
|
19301
19639
|
} else {
|
|
19302
19640
|
throw new Error(`Unhandled expression type "${ast.constructor.name}" in file "${baseSourceSpan == null ? void 0 : baseSourceSpan.start.file.url}"`);
|
|
19303
19641
|
}
|
|
@@ -19308,6 +19646,7 @@ function isPlainTemplate(tmpl) {
|
|
|
19308
19646
|
}
|
|
19309
19647
|
function ingestBindings(unit, op, element2) {
|
|
19310
19648
|
let flags = BindingFlags.None;
|
|
19649
|
+
let hasI18nAttributes = false;
|
|
19311
19650
|
if (element2 instanceof Template) {
|
|
19312
19651
|
flags |= BindingFlags.OnNgTemplateElement;
|
|
19313
19652
|
if (element2 instanceof Template && isPlainTemplate(element2)) {
|
|
@@ -19316,17 +19655,21 @@ function ingestBindings(unit, op, element2) {
|
|
|
19316
19655
|
const templateAttrFlags = flags | BindingFlags.BindingTargetsTemplate | BindingFlags.IsStructuralTemplateAttribute;
|
|
19317
19656
|
for (const attr of element2.templateAttrs) {
|
|
19318
19657
|
if (attr instanceof TextAttribute) {
|
|
19319
|
-
ingestBinding(unit, op.xref, attr.name, literal(attr.value), 1, null, SecurityContext.NONE, attr.sourceSpan, templateAttrFlags | BindingFlags.TextValue);
|
|
19658
|
+
ingestBinding(unit, op.xref, attr.name, literal(attr.value), 1, null, SecurityContext.NONE, attr.sourceSpan, templateAttrFlags | BindingFlags.TextValue, attr.i18n);
|
|
19659
|
+
hasI18nAttributes || (hasI18nAttributes = attr.i18n !== void 0);
|
|
19320
19660
|
} else {
|
|
19321
|
-
ingestBinding(unit, op.xref, attr.name, attr.value, attr.type, attr.unit, attr.securityContext, attr.sourceSpan, templateAttrFlags);
|
|
19661
|
+
ingestBinding(unit, op.xref, attr.name, attr.value, attr.type, attr.unit, attr.securityContext, attr.sourceSpan, templateAttrFlags, attr.i18n);
|
|
19662
|
+
hasI18nAttributes || (hasI18nAttributes = attr.i18n !== void 0);
|
|
19322
19663
|
}
|
|
19323
19664
|
}
|
|
19324
19665
|
}
|
|
19325
19666
|
for (const attr of element2.attributes) {
|
|
19326
|
-
ingestBinding(unit, op.xref, attr.name, literal(attr.value), 1, null, SecurityContext.NONE, attr.sourceSpan, flags | BindingFlags.TextValue);
|
|
19667
|
+
ingestBinding(unit, op.xref, attr.name, literal(attr.value), 1, null, SecurityContext.NONE, attr.sourceSpan, flags | BindingFlags.TextValue, attr.i18n);
|
|
19668
|
+
hasI18nAttributes || (hasI18nAttributes = attr.i18n !== void 0);
|
|
19327
19669
|
}
|
|
19328
19670
|
for (const input of element2.inputs) {
|
|
19329
|
-
ingestBinding(unit, op.xref, input.name, input.value, input.type, input.unit, input.securityContext, input.sourceSpan, flags);
|
|
19671
|
+
ingestBinding(unit, op.xref, input.name, input.value, input.type, input.unit, input.securityContext, input.sourceSpan, flags, input.i18n);
|
|
19672
|
+
hasI18nAttributes || (hasI18nAttributes = input.i18n !== void 0);
|
|
19330
19673
|
}
|
|
19331
19674
|
for (const output of element2.outputs) {
|
|
19332
19675
|
let listenerOp;
|
|
@@ -19336,7 +19679,7 @@ function ingestBindings(unit, op, element2) {
|
|
|
19336
19679
|
}
|
|
19337
19680
|
}
|
|
19338
19681
|
if (element2 instanceof Template && !isPlainTemplate(element2)) {
|
|
19339
|
-
unit.create.push(createExtractedAttributeOp(op.xref, BindingKind.Property, output.name, null));
|
|
19682
|
+
unit.create.push(createExtractedAttributeOp(op.xref, BindingKind.Property, output.name, null, null));
|
|
19340
19683
|
continue;
|
|
19341
19684
|
}
|
|
19342
19685
|
listenerOp = createListenerOp(op.xref, op.handle, output.name, op.tag, output.phase, false, output.sourceSpan);
|
|
@@ -19362,6 +19705,9 @@ function ingestBindings(unit, op, element2) {
|
|
|
19362
19705
|
listenerOp.handlerOps.push(createStatementOp(new ReturnStatement(returnExpr, returnExpr.sourceSpan)));
|
|
19363
19706
|
unit.create.push(listenerOp);
|
|
19364
19707
|
}
|
|
19708
|
+
if (hasI18nAttributes) {
|
|
19709
|
+
unit.create.push(createI18nAttributesOp(unit.job.allocateXrefId(), new SlotHandle(), op.xref));
|
|
19710
|
+
}
|
|
19365
19711
|
}
|
|
19366
19712
|
var BINDING_KINDS = /* @__PURE__ */ new Map([
|
|
19367
19713
|
[0, BindingKind.Property],
|
|
@@ -19378,24 +19724,36 @@ var BindingFlags;
|
|
|
19378
19724
|
BindingFlags2[BindingFlags2["IsStructuralTemplateAttribute"] = 4] = "IsStructuralTemplateAttribute";
|
|
19379
19725
|
BindingFlags2[BindingFlags2["OnNgTemplateElement"] = 8] = "OnNgTemplateElement";
|
|
19380
19726
|
})(BindingFlags || (BindingFlags = {}));
|
|
19381
|
-
function ingestBinding(view, xref, name, value, type, unit, securityContext, sourceSpan, flags) {
|
|
19727
|
+
function ingestBinding(view, xref, name, value, type, unit, securityContext, sourceSpan, flags, i18nMeta) {
|
|
19382
19728
|
if (value instanceof ASTWithSource) {
|
|
19383
19729
|
value = value.ast;
|
|
19384
19730
|
}
|
|
19731
|
+
let i18nContext = null;
|
|
19732
|
+
if (i18nMeta !== void 0) {
|
|
19733
|
+
if (!(i18nMeta instanceof Message)) {
|
|
19734
|
+
throw Error(`Unhandled i18n metadata type for binding: ${i18nMeta.constructor.name}`);
|
|
19735
|
+
}
|
|
19736
|
+
i18nContext = view.job.allocateXrefId();
|
|
19737
|
+
view.create.push(createI18nContextOp(I18nContextKind.Attr, i18nContext, null, i18nMeta, null));
|
|
19738
|
+
}
|
|
19385
19739
|
if (flags & BindingFlags.OnNgTemplateElement && !(flags & BindingFlags.BindingTargetsTemplate) && type === 0) {
|
|
19386
|
-
view.create.push(createExtractedAttributeOp(xref, BindingKind.Property, name, null));
|
|
19740
|
+
view.create.push(createExtractedAttributeOp(xref, BindingKind.Property, name, null, i18nContext));
|
|
19387
19741
|
return;
|
|
19388
19742
|
}
|
|
19389
19743
|
let expression;
|
|
19390
19744
|
if (value instanceof Interpolation) {
|
|
19391
|
-
|
|
19745
|
+
let i18nPlaceholders = [];
|
|
19746
|
+
if (i18nMeta !== void 0) {
|
|
19747
|
+
i18nPlaceholders = Object.keys(i18nMeta.placeholders);
|
|
19748
|
+
}
|
|
19749
|
+
expression = new Interpolation2(value.strings, value.expressions.map((expr) => convertAst(expr, view.job, null)), i18nPlaceholders);
|
|
19392
19750
|
} else if (value instanceof AST) {
|
|
19393
19751
|
expression = convertAst(value, view.job, null);
|
|
19394
19752
|
} else {
|
|
19395
19753
|
expression = value;
|
|
19396
19754
|
}
|
|
19397
19755
|
const kind = BINDING_KINDS.get(type);
|
|
19398
|
-
view.update.push(createBindingOp(xref, kind, name, expression, unit, securityContext, !!(flags & BindingFlags.TextValue), !!(flags & BindingFlags.IsStructuralTemplateAttribute), sourceSpan));
|
|
19756
|
+
view.update.push(createBindingOp(xref, kind, name, expression, unit, securityContext, !!(flags & BindingFlags.TextValue), !!(flags & BindingFlags.IsStructuralTemplateAttribute), i18nContext, sourceSpan));
|
|
19399
19757
|
}
|
|
19400
19758
|
function ingestReferences(op, element2) {
|
|
19401
19759
|
assertIsArray(op.localRefs);
|
|
@@ -19435,7 +19793,7 @@ function ingestControlFlowInsertionPoint(unit, xref, node) {
|
|
|
19435
19793
|
}
|
|
19436
19794
|
if (root !== null) {
|
|
19437
19795
|
for (const attr of root.attributes) {
|
|
19438
|
-
ingestBinding(unit, xref, attr.name, literal(attr.value), 1, null, SecurityContext.NONE, attr.sourceSpan, BindingFlags.TextValue);
|
|
19796
|
+
ingestBinding(unit, xref, attr.name, literal(attr.value), 1, null, SecurityContext.NONE, attr.sourceSpan, BindingFlags.TextValue, attr.i18n);
|
|
19439
19797
|
}
|
|
19440
19798
|
const tagName = root instanceof Element ? root.name : root.tagName;
|
|
19441
19799
|
return tagName === "ng-template" ? null : tagName;
|
|
@@ -19443,10 +19801,10 @@ function ingestControlFlowInsertionPoint(unit, xref, node) {
|
|
|
19443
19801
|
return null;
|
|
19444
19802
|
}
|
|
19445
19803
|
|
|
19446
|
-
// bazel-out/
|
|
19804
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/switch/index.mjs
|
|
19447
19805
|
var USE_TEMPLATE_PIPELINE = false;
|
|
19448
19806
|
|
|
19449
|
-
// bazel-out/
|
|
19807
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/styling_builder.mjs
|
|
19450
19808
|
var IMPORTANT_FLAG = "!important";
|
|
19451
19809
|
var MIN_STYLING_BINDING_SLOTS_REQUIRED = 2;
|
|
19452
19810
|
var StylingBuilder = class {
|
|
@@ -19779,7 +20137,7 @@ function isEmptyExpression(ast) {
|
|
|
19779
20137
|
return ast instanceof EmptyExpr;
|
|
19780
20138
|
}
|
|
19781
20139
|
|
|
19782
|
-
// bazel-out/
|
|
20140
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/html_parser.mjs
|
|
19783
20141
|
var HtmlParser = class extends Parser2 {
|
|
19784
20142
|
constructor() {
|
|
19785
20143
|
super(getHtmlTagDefinition);
|
|
@@ -19789,7 +20147,7 @@ var HtmlParser = class extends Parser2 {
|
|
|
19789
20147
|
}
|
|
19790
20148
|
};
|
|
19791
20149
|
|
|
19792
|
-
// bazel-out/
|
|
20150
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/html_whitespaces.mjs
|
|
19793
20151
|
var PRESERVE_WS_ATTR_NAME = "ngPreserveWhitespaces";
|
|
19794
20152
|
var SKIP_WS_TRIM_TAGS = /* @__PURE__ */ new Set(["pre", "template", "textarea", "script", "style"]);
|
|
19795
20153
|
var WS_CHARS = " \f\n\r \v\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF";
|
|
@@ -19855,7 +20213,7 @@ function visitAllWithSiblings(visitor, nodes) {
|
|
|
19855
20213
|
return result;
|
|
19856
20214
|
}
|
|
19857
20215
|
|
|
19858
|
-
// bazel-out/
|
|
20216
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template_parser/binding_parser.mjs
|
|
19859
20217
|
var PROPERTY_PARTS_SEPARATOR = ".";
|
|
19860
20218
|
var ATTRIBUTE_PREFIX = "attr";
|
|
19861
20219
|
var CLASS_PREFIX = "class";
|
|
@@ -20175,7 +20533,7 @@ function moveParseSourceSpan(sourceSpan, absoluteSpan) {
|
|
|
20175
20533
|
return new ParseSourceSpan(sourceSpan.start.moveBy(startDiff), sourceSpan.end.moveBy(endDiff), sourceSpan.fullStart.moveBy(startDiff), sourceSpan.details);
|
|
20176
20534
|
}
|
|
20177
20535
|
|
|
20178
|
-
// bazel-out/
|
|
20536
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/style_url_resolver.mjs
|
|
20179
20537
|
function isStyleUrlResolvable(url) {
|
|
20180
20538
|
if (url == null || url.length === 0 || url[0] == "/")
|
|
20181
20539
|
return false;
|
|
@@ -20184,7 +20542,7 @@ function isStyleUrlResolvable(url) {
|
|
|
20184
20542
|
}
|
|
20185
20543
|
var URL_WITH_SCHEMA_REGEXP = /^([^:/?#]+):/;
|
|
20186
20544
|
|
|
20187
|
-
// bazel-out/
|
|
20545
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/template_parser/template_preparser.mjs
|
|
20188
20546
|
var NG_CONTENT_SELECT_ATTR = "select";
|
|
20189
20547
|
var LINK_ELEMENT = "link";
|
|
20190
20548
|
var LINK_STYLE_REL_ATTR = "rel";
|
|
@@ -20254,7 +20612,7 @@ function normalizeNgContentSelect(selectAttr) {
|
|
|
20254
20612
|
return selectAttr;
|
|
20255
20613
|
}
|
|
20256
20614
|
|
|
20257
|
-
// bazel-out/
|
|
20615
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_control_flow.mjs
|
|
20258
20616
|
var FOR_LOOP_EXPRESSION_PATTERN = /^\s*([0-9A-Za-z_$]*)\s+of\s+([\S\s]*)/;
|
|
20259
20617
|
var FOR_LOOP_TRACK_PATTERN = /^track\s+([\S\s]*)/;
|
|
20260
20618
|
var CONDITIONAL_ALIAS_PATTERN = /^as\s+(.*)/;
|
|
@@ -20545,7 +20903,7 @@ function stripOptionalParentheses(param, errors) {
|
|
|
20545
20903
|
return expression.slice(start, end);
|
|
20546
20904
|
}
|
|
20547
20905
|
|
|
20548
|
-
// bazel-out/
|
|
20906
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_deferred_triggers.mjs
|
|
20549
20907
|
var TIME_PATTERN = /^\d+\.?\d*(ms|s)?$/;
|
|
20550
20908
|
var SEPARATOR_PATTERN = /^\s$/;
|
|
20551
20909
|
var COMMA_DELIMITED_SYNTAX = /* @__PURE__ */ new Map([
|
|
@@ -20809,7 +21167,7 @@ function parseDeferredTime(value) {
|
|
|
20809
21167
|
return parseFloat(time) * (units === "s" ? 1e3 : 1);
|
|
20810
21168
|
}
|
|
20811
21169
|
|
|
20812
|
-
// bazel-out/
|
|
21170
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_deferred_blocks.mjs
|
|
20813
21171
|
var PREFETCH_WHEN_PATTERN = /^prefetch\s+when\s/;
|
|
20814
21172
|
var PREFETCH_ON_PATTERN = /^prefetch\s+on\s/;
|
|
20815
21173
|
var MINIMUM_PARAMETER_PATTERN = /^minimum\s/;
|
|
@@ -20944,7 +21302,7 @@ function parsePrimaryTriggers(params, bindingParser, errors, placeholder) {
|
|
|
20944
21302
|
return { triggers, prefetchTriggers };
|
|
20945
21303
|
}
|
|
20946
21304
|
|
|
20947
|
-
// bazel-out/
|
|
21305
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_template_transform.mjs
|
|
20948
21306
|
var BIND_NAME_REGEXP = /^(?:(bind-)|(let-)|(ref-|#)|(on-)|(bindon-)|(@))(.*)$/;
|
|
20949
21307
|
var KW_BIND_IDX = 1;
|
|
20950
21308
|
var KW_LET_IDX = 2;
|
|
@@ -21375,7 +21733,7 @@ function textContents(node) {
|
|
|
21375
21733
|
}
|
|
21376
21734
|
}
|
|
21377
21735
|
|
|
21378
|
-
// bazel-out/
|
|
21736
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/i18n/context.mjs
|
|
21379
21737
|
var TagType;
|
|
21380
21738
|
(function(TagType2) {
|
|
21381
21739
|
TagType2[TagType2["ELEMENT"] = 0] = "ELEMENT";
|
|
@@ -21520,7 +21878,7 @@ function serializePlaceholderValue(value) {
|
|
|
21520
21878
|
}
|
|
21521
21879
|
}
|
|
21522
21880
|
|
|
21523
|
-
// bazel-out/
|
|
21881
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/template.mjs
|
|
21524
21882
|
var NG_CONTENT_SELECT_ATTR2 = "select";
|
|
21525
21883
|
var NG_PROJECT_AS_ATTR_NAME = "ngProjectAs";
|
|
21526
21884
|
var EVENT_BINDING_SCOPE_GLOBALS = /* @__PURE__ */ new Set(["$event"]);
|
|
@@ -22980,21 +23338,6 @@ var TrackByBindingScope = class extends BindingScope {
|
|
|
22980
23338
|
return this.componentAccessCount;
|
|
22981
23339
|
}
|
|
22982
23340
|
};
|
|
22983
|
-
function createCssSelector(elementName, attributes) {
|
|
22984
|
-
const cssSelector = new CssSelector();
|
|
22985
|
-
const elementNameNoNs = splitNsName(elementName)[1];
|
|
22986
|
-
cssSelector.setElement(elementNameNoNs);
|
|
22987
|
-
Object.getOwnPropertyNames(attributes).forEach((name) => {
|
|
22988
|
-
const nameNoNs = splitNsName(name)[1];
|
|
22989
|
-
const value = attributes[name];
|
|
22990
|
-
cssSelector.addAttribute(nameNoNs, value);
|
|
22991
|
-
if (name.toLowerCase() === "class") {
|
|
22992
|
-
const classes = value.trim().split(/\s+/);
|
|
22993
|
-
classes.forEach((className) => cssSelector.addClassName(className));
|
|
22994
|
-
}
|
|
22995
|
-
});
|
|
22996
|
-
return cssSelector;
|
|
22997
|
-
}
|
|
22998
23341
|
function getNgProjectAsLiteral(attribute2) {
|
|
22999
23342
|
const parsedR3Selector = parseSelectorToR3Selector(attribute2.value)[0];
|
|
23000
23343
|
return [literal(5), asLiteral(parsedR3Selector)];
|
|
@@ -23212,7 +23555,7 @@ function createClosureModeGuard2() {
|
|
|
23212
23555
|
return typeofExpr(variable(NG_I18N_CLOSURE_MODE2)).notIdentical(literal("undefined", STRING_TYPE)).and(variable(NG_I18N_CLOSURE_MODE2));
|
|
23213
23556
|
}
|
|
23214
23557
|
|
|
23215
|
-
// bazel-out/
|
|
23558
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/compiler.mjs
|
|
23216
23559
|
var ATTR_REGEX = /attr\.([^\]]+)/;
|
|
23217
23560
|
var COMPONENT_VARIABLE = "%COMP%";
|
|
23218
23561
|
var HOST_ATTR = `_nghost-${COMPONENT_VARIABLE}`;
|
|
@@ -23263,6 +23606,9 @@ function addFeatures(definitionMap, meta) {
|
|
|
23263
23606
|
break;
|
|
23264
23607
|
}
|
|
23265
23608
|
}
|
|
23609
|
+
if ((_a2 = meta.hostDirectives) == null ? void 0 : _a2.length) {
|
|
23610
|
+
features.push(importExpr(Identifiers.HostDirectivesFeature).callFn([createHostDirectivesFeatureArg(meta.hostDirectives)]));
|
|
23611
|
+
}
|
|
23266
23612
|
if (meta.usesInheritance) {
|
|
23267
23613
|
features.push(importExpr(Identifiers.InheritDefinitionFeature));
|
|
23268
23614
|
}
|
|
@@ -23275,9 +23621,6 @@ function addFeatures(definitionMap, meta) {
|
|
|
23275
23621
|
if (meta.hasOwnProperty("template") && meta.isStandalone) {
|
|
23276
23622
|
features.push(importExpr(Identifiers.StandaloneFeature));
|
|
23277
23623
|
}
|
|
23278
|
-
if ((_a2 = meta.hostDirectives) == null ? void 0 : _a2.length) {
|
|
23279
|
-
features.push(importExpr(Identifiers.HostDirectivesFeature).callFn([createHostDirectivesFeatureArg(meta.hostDirectives)]));
|
|
23280
|
-
}
|
|
23281
23624
|
if (features.length) {
|
|
23282
23625
|
definitionMap.set("features", literalArr(features));
|
|
23283
23626
|
}
|
|
@@ -23545,6 +23888,8 @@ function createHostBindingsFunction(hostBindingsMetadata, typeSourceSpan, bindin
|
|
|
23545
23888
|
}
|
|
23546
23889
|
return emitHostBindingFunction(hostJob);
|
|
23547
23890
|
}
|
|
23891
|
+
let bindingId = 0;
|
|
23892
|
+
const getNextBindingId = () => `${bindingId++}`;
|
|
23548
23893
|
const bindingContext = variable(CONTEXT_NAME);
|
|
23549
23894
|
const styleBuilder = new StylingBuilder(bindingContext);
|
|
23550
23895
|
const { styleAttr, classAttr } = hostBindingsMetadata.specialAttributes;
|
|
@@ -23594,7 +23939,7 @@ function createHostBindingsFunction(hostBindingsMetadata, typeSourceSpan, bindin
|
|
|
23594
23939
|
const syntheticHostBindings = [];
|
|
23595
23940
|
for (const binding of allOtherBindings) {
|
|
23596
23941
|
const value = binding.expression.visit(getValueConverter());
|
|
23597
|
-
const bindingExpr = bindingFn(bindingContext, value);
|
|
23942
|
+
const bindingExpr = bindingFn(bindingContext, value, getNextBindingId);
|
|
23598
23943
|
const { bindingName, instruction, isAttribute } = getBindingNameAndInstruction(binding);
|
|
23599
23944
|
const securityContexts = bindingParser.calcPossibleSecurityContexts(selector, bindingName, isAttribute).filter((context) => context !== SecurityContext.NONE);
|
|
23600
23945
|
let sanitizerFn = null;
|
|
@@ -23639,9 +23984,11 @@ function createHostBindingsFunction(hostBindingsMetadata, typeSourceSpan, bindin
|
|
|
23639
23984
|
styleBuilder.buildUpdateLevelInstructions(getValueConverter()).forEach((instruction) => {
|
|
23640
23985
|
for (const call2 of instruction.calls) {
|
|
23641
23986
|
totalHostVarsCount += Math.max(call2.allocateBindingSlots - MIN_STYLING_BINDING_SLOTS_REQUIRED, 0);
|
|
23987
|
+
const { params, stmts } = convertStylingCall(call2, bindingContext, bindingFn, getNextBindingId);
|
|
23988
|
+
updateVariables.push(...stmts);
|
|
23642
23989
|
updateInstructions.push({
|
|
23643
23990
|
reference: instruction.reference,
|
|
23644
|
-
paramsOrFn:
|
|
23991
|
+
paramsOrFn: params,
|
|
23645
23992
|
span: null
|
|
23646
23993
|
});
|
|
23647
23994
|
}
|
|
@@ -23663,11 +24010,19 @@ function createHostBindingsFunction(hostBindingsMetadata, typeSourceSpan, bindin
|
|
|
23663
24010
|
}
|
|
23664
24011
|
return null;
|
|
23665
24012
|
}
|
|
23666
|
-
function bindingFn(implicit, value) {
|
|
23667
|
-
return convertPropertyBinding(null, implicit, value,
|
|
24013
|
+
function bindingFn(implicit, value, getNextBindingIdFn) {
|
|
24014
|
+
return convertPropertyBinding(null, implicit, value, getNextBindingIdFn());
|
|
23668
24015
|
}
|
|
23669
|
-
function convertStylingCall(call2, bindingContext, bindingFn2) {
|
|
23670
|
-
|
|
24016
|
+
function convertStylingCall(call2, bindingContext, bindingFn2, getNextBindingIdFn) {
|
|
24017
|
+
const stmts = [];
|
|
24018
|
+
const params = call2.params((value) => {
|
|
24019
|
+
const result = bindingFn2(bindingContext, value, getNextBindingIdFn);
|
|
24020
|
+
if (Array.isArray(result.stmts) && result.stmts.length > 0) {
|
|
24021
|
+
stmts.push(...result.stmts);
|
|
24022
|
+
}
|
|
24023
|
+
return result.currValExpr;
|
|
24024
|
+
});
|
|
24025
|
+
return { params, stmts };
|
|
23671
24026
|
}
|
|
23672
24027
|
function getBindingNameAndInstruction(binding) {
|
|
23673
24028
|
let bindingName = binding.name;
|
|
@@ -23814,7 +24169,7 @@ function createHostDirectivesMappingArray(mapping) {
|
|
|
23814
24169
|
return elements.length > 0 ? literalArr(elements) : null;
|
|
23815
24170
|
}
|
|
23816
24171
|
|
|
23817
|
-
// bazel-out/
|
|
24172
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/t2_binder.mjs
|
|
23818
24173
|
var R3TargetBinder = class {
|
|
23819
24174
|
constructor(directiveMatcher) {
|
|
23820
24175
|
this.directiveMatcher = directiveMatcher;
|
|
@@ -23982,13 +24337,13 @@ var DirectiveBinder = class {
|
|
|
23982
24337
|
template2.forEach((node) => node.visit(this));
|
|
23983
24338
|
}
|
|
23984
24339
|
visitElement(element2) {
|
|
23985
|
-
this.visitElementOrTemplate(element2
|
|
24340
|
+
this.visitElementOrTemplate(element2);
|
|
23986
24341
|
}
|
|
23987
24342
|
visitTemplate(template2) {
|
|
23988
|
-
this.visitElementOrTemplate(
|
|
24343
|
+
this.visitElementOrTemplate(template2);
|
|
23989
24344
|
}
|
|
23990
|
-
visitElementOrTemplate(
|
|
23991
|
-
const cssSelector =
|
|
24345
|
+
visitElementOrTemplate(node) {
|
|
24346
|
+
const cssSelector = createCssSelectorFromNode(node);
|
|
23992
24347
|
const directives = [];
|
|
23993
24348
|
this.matcher.match(cssSelector, (_selector, results) => directives.push(...results));
|
|
23994
24349
|
if (directives.length > 0) {
|
|
@@ -24419,11 +24774,11 @@ function extractScopedNodeEntities(rootScope) {
|
|
|
24419
24774
|
return templateEntities;
|
|
24420
24775
|
}
|
|
24421
24776
|
|
|
24422
|
-
// bazel-out/
|
|
24777
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/resource_loader.mjs
|
|
24423
24778
|
var ResourceLoader = class {
|
|
24424
24779
|
};
|
|
24425
24780
|
|
|
24426
|
-
// bazel-out/
|
|
24781
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/jit_compiler_facade.mjs
|
|
24427
24782
|
var CompilerFacadeImpl = class {
|
|
24428
24783
|
constructor(jitEvaluator = new JitEvaluator()) {
|
|
24429
24784
|
this.jitEvaluator = jitEvaluator;
|
|
@@ -24975,17 +25330,17 @@ function publishFacade(global) {
|
|
|
24975
25330
|
ng.\u0275compilerFacade = new CompilerFacadeImpl();
|
|
24976
25331
|
}
|
|
24977
25332
|
|
|
24978
|
-
// bazel-out/
|
|
24979
|
-
var VERSION2 = new Version("17.0.
|
|
25333
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/version.mjs
|
|
25334
|
+
var VERSION2 = new Version("17.0.6");
|
|
24980
25335
|
|
|
24981
|
-
// bazel-out/
|
|
25336
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/extractor_merger.mjs
|
|
24982
25337
|
var _VisitorMode;
|
|
24983
25338
|
(function(_VisitorMode2) {
|
|
24984
25339
|
_VisitorMode2[_VisitorMode2["Extract"] = 0] = "Extract";
|
|
24985
25340
|
_VisitorMode2[_VisitorMode2["Merge"] = 1] = "Merge";
|
|
24986
25341
|
})(_VisitorMode || (_VisitorMode = {}));
|
|
24987
25342
|
|
|
24988
|
-
// bazel-out/
|
|
25343
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/xml_tags.mjs
|
|
24989
25344
|
var XmlTagDefinition = class {
|
|
24990
25345
|
constructor() {
|
|
24991
25346
|
this.closedByParent = false;
|
|
@@ -25007,7 +25362,7 @@ var XmlTagDefinition = class {
|
|
|
25007
25362
|
};
|
|
25008
25363
|
var _TAG_DEFINITION = new XmlTagDefinition();
|
|
25009
25364
|
|
|
25010
|
-
// bazel-out/
|
|
25365
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/partial/api.mjs
|
|
25011
25366
|
var FactoryTarget2;
|
|
25012
25367
|
(function(FactoryTarget3) {
|
|
25013
25368
|
FactoryTarget3[FactoryTarget3["Directive"] = 0] = "Directive";
|
|
@@ -25017,10 +25372,10 @@ var FactoryTarget2;
|
|
|
25017
25372
|
FactoryTarget3[FactoryTarget3["NgModule"] = 4] = "NgModule";
|
|
25018
25373
|
})(FactoryTarget2 || (FactoryTarget2 = {}));
|
|
25019
25374
|
|
|
25020
|
-
// bazel-out/
|
|
25375
|
+
// bazel-out/darwin-fastbuild/bin/packages/compiler/src/compiler.mjs
|
|
25021
25376
|
publishFacade(_global);
|
|
25022
25377
|
|
|
25023
|
-
// bazel-out/
|
|
25378
|
+
// bazel-out/darwin-fastbuild/bin/packages/core/schematics/migrations/block-template-entities/util.mjs
|
|
25024
25379
|
var import_path2 = require("path");
|
|
25025
25380
|
var import_typescript3 = __toESM(require("typescript"), 1);
|
|
25026
25381
|
var REPLACEMENTS2 = {
|
|
@@ -25128,7 +25483,7 @@ function forEachClass(sourceFile, callback) {
|
|
|
25128
25483
|
});
|
|
25129
25484
|
}
|
|
25130
25485
|
|
|
25131
|
-
// bazel-out/
|
|
25486
|
+
// bazel-out/darwin-fastbuild/bin/packages/core/schematics/migrations/block-template-entities/index.mjs
|
|
25132
25487
|
function block_template_entities_default() {
|
|
25133
25488
|
return (tree) => __async(this, null, function* () {
|
|
25134
25489
|
const { buildPaths, testPaths } = yield getProjectTsConfigPaths(tree);
|