@angular/core 17.1.0-next.1 → 17.1.0-next.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/esm2022/src/application_init.mjs +2 -2
  2. package/esm2022/src/hydration/annotate.mjs +30 -20
  3. package/esm2022/src/hydration/interfaces.mjs +1 -1
  4. package/esm2022/src/hydration/node_lookup_utils.mjs +23 -2
  5. package/esm2022/src/render3/features/host_directives_feature.mjs +20 -13
  6. package/esm2022/src/render3/instructions/change_detection.mjs +3 -4
  7. package/esm2022/src/render3/node_manipulation.mjs +2 -2
  8. package/esm2022/src/render3/util/view_utils.mjs +11 -12
  9. package/esm2022/src/render3/view_manipulation.mjs +13 -5
  10. package/esm2022/src/version.mjs +1 -1
  11. package/esm2022/testing/src/logger.mjs +3 -3
  12. package/esm2022/testing/src/test_bed.mjs +3 -3
  13. package/esm2022/testing/src/test_bed_compiler.mjs +19 -10
  14. package/fesm2022/core.mjs +94 -50
  15. package/fesm2022/core.mjs.map +1 -1
  16. package/fesm2022/primitives/signals.mjs +1 -1
  17. package/fesm2022/rxjs-interop.mjs +1 -1
  18. package/fesm2022/testing.mjs +21 -12
  19. package/fesm2022/testing.mjs.map +1 -1
  20. package/index.d.ts +8 -3
  21. package/package.json +1 -1
  22. package/primitives/signals/index.d.ts +1 -1
  23. package/rxjs-interop/index.d.ts +1 -1
  24. package/schematics/migrations/block-template-entities/bundle.js +812 -457
  25. package/schematics/migrations/block-template-entities/bundle.js.map +4 -4
  26. package/schematics/migrations/compiler-options/bundle.js +13 -13
  27. package/schematics/migrations/transfer-state/bundle.js +13 -13
  28. package/schematics/ng-generate/control-flow-migration/bundle.js +1126 -557
  29. package/schematics/ng-generate/control-flow-migration/bundle.js.map +4 -4
  30. package/schematics/ng-generate/standalone-migration/bundle.js +1225 -744
  31. package/schematics/ng-generate/standalone-migration/bundle.js.map +4 -4
  32. 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/k8-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/index.mjs
66
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/index.mjs
67
67
  var control_flow_migration_exports = {};
68
68
  __export(control_flow_migration_exports, {
69
69
  default: () => control_flow_migration_default
@@ -72,22 +72,22 @@ module.exports = __toCommonJS(control_flow_migration_exports);
72
72
  var import_schematics = require("@angular-devkit/schematics");
73
73
  var import_path3 = require("path");
74
74
 
75
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/utils/change_tracker.mjs
75
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/change_tracker.mjs
76
76
  var import_typescript2 = __toESM(require("typescript"), 1);
77
77
 
78
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/utils/import_manager.mjs
78
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/import_manager.mjs
79
79
  var import_typescript = __toESM(require("typescript"), 1);
80
80
 
81
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/utils/change_tracker.mjs
81
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/change_tracker.mjs
82
82
  function normalizePath(path2) {
83
83
  return path2.replace(/\\/g, "/");
84
84
  }
85
85
 
86
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
86
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
87
87
  var import_path = require("path");
88
88
  var import_typescript4 = __toESM(require("typescript"), 1);
89
89
 
90
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/utils/typescript/parse_tsconfig.mjs
90
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/typescript/parse_tsconfig.mjs
91
91
  var path = __toESM(require("path"), 1);
92
92
  var import_typescript3 = __toESM(require("typescript"), 1);
93
93
  function parseTsconfigFile(tsconfigPath, basePath) {
@@ -104,7 +104,7 @@ function parseTsconfigFile(tsconfigPath, basePath) {
104
104
  return import_typescript3.default.parseJsonConfigFileContent(config, parseConfigHost, basePath, {});
105
105
  }
106
106
 
107
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
107
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
108
108
  function createMigrationProgram(tree, tsconfigPath, basePath, fakeFileRead, additionalFiles) {
109
109
  const { rootNames, options, host } = createProgramOptions(tree, tsconfigPath, basePath, fakeFileRead, additionalFiles);
110
110
  return import_typescript4.default.createProgram(rootNames, options, host);
@@ -137,7 +137,7 @@ function canMigrateFile(basePath, sourceFile, program) {
137
137
  return !(0, import_path.relative)(basePath, sourceFile.fileName).startsWith("..");
138
138
  }
139
139
 
140
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/selector.mjs
140
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/selector.mjs
141
141
  var _SELECTOR_REGEXP = new RegExp(
142
142
  `(\\:not\\()|(([\\.\\#]?)[-\\w]+)|(?:\\[([-.\\w*\\\\$]+)(?:=(["']?)([^\\]"']*)\\5)?\\])|(\\))|(\\s*,\\s*)`,
143
143
  "g"
@@ -445,7 +445,7 @@ var SelectorContext = class {
445
445
  }
446
446
  };
447
447
 
448
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/core.mjs
448
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/core.mjs
449
449
  var ViewEncapsulation;
450
450
  (function(ViewEncapsulation2) {
451
451
  ViewEncapsulation2[ViewEncapsulation2["Emulated"] = 0] = "Emulated";
@@ -507,7 +507,7 @@ function parseSelectorToR3Selector(selector) {
507
507
  return selector ? CssSelector.parse(selector).map(parserSelectorToR3Selector) : [];
508
508
  }
509
509
 
510
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/i18n/digest.mjs
510
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/digest.mjs
511
511
  var textEncoder;
512
512
  function computeDigest(message) {
513
513
  return sha1(serializeNodes(message.nodes).join("") + `[${message.meaning}]`);
@@ -747,7 +747,7 @@ function wordAt(bytes, index, endian) {
747
747
  return word;
748
748
  }
749
749
 
750
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/output/output_ast.mjs
750
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/output_ast.mjs
751
751
  var TypeModifier;
752
752
  (function(TypeModifier2) {
753
753
  TypeModifier2[TypeModifier2["None"] = 0] = "None";
@@ -1702,7 +1702,7 @@ function serializeTags(tags) {
1702
1702
  return out;
1703
1703
  }
1704
1704
 
1705
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/constant_pool.mjs
1705
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/constant_pool.mjs
1706
1706
  var CONSTANT_PREFIX = "_c";
1707
1707
  var UNKNOWN_VALUE_KEY = variable("<unknown>");
1708
1708
  var KEY_CONTEXT = {};
@@ -1885,7 +1885,7 @@ function isLongStringLiteral(expr) {
1885
1885
  return expr instanceof LiteralExpr && typeof expr.value === "string" && expr.value.length >= POOL_INCLUSION_LENGTH_THRESHOLD_FOR_STRINGS;
1886
1886
  }
1887
1887
 
1888
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/r3_identifiers.mjs
1888
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_identifiers.mjs
1889
1889
  var CORE = "@angular/core";
1890
1890
  var _Identifiers = class {
1891
1891
  };
@@ -2518,7 +2518,7 @@ var Identifiers = _Identifiers;
2518
2518
  _Identifiers.validateIframeAttribute = { name: "\u0275\u0275validateIframeAttribute", moduleName: CORE };
2519
2519
  })();
2520
2520
 
2521
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/util.mjs
2521
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/util.mjs
2522
2522
  var DASH_CASE_REGEXP = /-+([a-z0-9])/g;
2523
2523
  function dashCaseToCamelCase(input) {
2524
2524
  return input.replace(DASH_CASE_REGEXP, (...m) => m[1].toUpperCase());
@@ -2606,7 +2606,7 @@ function partitionArray(arr, conditionFn) {
2606
2606
  return [truthy, falsy];
2607
2607
  }
2608
2608
 
2609
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/output/source_map.mjs
2609
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/source_map.mjs
2610
2610
  var VERSION = 3;
2611
2611
  var JS_B64_PREFIX = "# sourceMappingURL=data:application/json;base64,";
2612
2612
  var SourceMapGenerator = class {
@@ -2735,7 +2735,7 @@ function toBase64Digit(value) {
2735
2735
  return B64_DIGITS[value];
2736
2736
  }
2737
2737
 
2738
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/output/abstract_emitter.mjs
2738
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/abstract_emitter.mjs
2739
2739
  var _SINGLE_QUOTE_ESCAPE_STRING_RE = /'|\\|\n|\r|\$/g;
2740
2740
  var _LEGAL_IDENTIFIER_RE = /^[$A-Z_][0-9A-Z_$]*$/i;
2741
2741
  var _INDENT_WITH = " ";
@@ -3220,7 +3220,7 @@ function _createIndent(count) {
3220
3220
  return res;
3221
3221
  }
3222
3222
 
3223
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/util.mjs
3223
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/util.mjs
3224
3224
  function typeWithParameters(type, numParams) {
3225
3225
  if (numParams === 0) {
3226
3226
  return expressionType(type);
@@ -3285,7 +3285,7 @@ function generateForwardRef(expr) {
3285
3285
  return importExpr(Identifiers.forwardRef).callFn([arrowFn([], expr)]);
3286
3286
  }
3287
3287
 
3288
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/r3_factory.mjs
3288
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_factory.mjs
3289
3289
  var R3FactoryDelegateType;
3290
3290
  (function(R3FactoryDelegateType2) {
3291
3291
  R3FactoryDelegateType2[R3FactoryDelegateType2["Class"] = 0] = "Class";
@@ -3430,7 +3430,40 @@ function getInjectFn(target) {
3430
3430
  }
3431
3431
  }
3432
3432
 
3433
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/r3_ast.mjs
3433
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/tags.mjs
3434
+ var TagContentType;
3435
+ (function(TagContentType2) {
3436
+ TagContentType2[TagContentType2["RAW_TEXT"] = 0] = "RAW_TEXT";
3437
+ TagContentType2[TagContentType2["ESCAPABLE_RAW_TEXT"] = 1] = "ESCAPABLE_RAW_TEXT";
3438
+ TagContentType2[TagContentType2["PARSABLE_DATA"] = 2] = "PARSABLE_DATA";
3439
+ })(TagContentType || (TagContentType = {}));
3440
+ function splitNsName(elementName) {
3441
+ if (elementName[0] != ":") {
3442
+ return [null, elementName];
3443
+ }
3444
+ const colonIndex = elementName.indexOf(":", 1);
3445
+ if (colonIndex === -1) {
3446
+ throw new Error(`Unsupported format "${elementName}" expecting ":namespace:name"`);
3447
+ }
3448
+ return [elementName.slice(1, colonIndex), elementName.slice(colonIndex + 1)];
3449
+ }
3450
+ function isNgContainer(tagName) {
3451
+ return splitNsName(tagName)[1] === "ng-container";
3452
+ }
3453
+ function isNgContent(tagName) {
3454
+ return splitNsName(tagName)[1] === "ng-content";
3455
+ }
3456
+ function isNgTemplate(tagName) {
3457
+ return splitNsName(tagName)[1] === "ng-template";
3458
+ }
3459
+ function getNsPrefix(fullName) {
3460
+ return fullName === null ? null : splitNsName(fullName)[0];
3461
+ }
3462
+ function mergeNsAndName(prefix, localName) {
3463
+ return prefix ? `:${prefix}:${localName}` : localName;
3464
+ }
3465
+
3466
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_ast.mjs
3434
3467
  var Comment = class {
3435
3468
  constructor(value, sourceSpan) {
3436
3469
  this.value = value;
@@ -3811,7 +3844,7 @@ function visitAll(visitor, nodes) {
3811
3844
  return result;
3812
3845
  }
3813
3846
 
3814
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/i18n/i18n_ast.mjs
3847
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/i18n_ast.mjs
3815
3848
  var Message = class {
3816
3849
  constructor(nodes, placeholders, placeholderToMessage, meaning, description, customId) {
3817
3850
  this.nodes = nodes;
@@ -3971,7 +4004,7 @@ var LocalizeMessageStringVisitor = class {
3971
4004
  }
3972
4005
  };
3973
4006
 
3974
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/i18n/serializers/xml_helper.mjs
4007
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/serializers/xml_helper.mjs
3975
4008
  var _Visitor = class {
3976
4009
  visitTag(tag) {
3977
4010
  const strAttrs = this._serializeAttributes(tag.attrs);
@@ -3999,12 +4032,12 @@ ${doctype.dtd}
3999
4032
  };
4000
4033
  var _visitor = new _Visitor();
4001
4034
 
4002
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/i18n/serializers/xmb.mjs
4035
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/serializers/xmb.mjs
4003
4036
  function toPublicName(internalName) {
4004
4037
  return internalName.toUpperCase().replace(/[^A-Z0-9_]/g, "_");
4005
4038
  }
4006
4039
 
4007
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/i18n/util.mjs
4040
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/i18n/util.mjs
4008
4041
  var CLOSURE_TRANSLATION_VAR_PREFIX = "MSG_";
4009
4042
  var TRANSLATION_VAR_PREFIX = "i18n_";
4010
4043
  var I18N_ATTR = "i18n";
@@ -4106,7 +4139,7 @@ function declareI18nVariable(variable2) {
4106
4139
  return new DeclareVarStmt(variable2.name, void 0, INFERRED_TYPE, void 0, variable2.sourceSpan);
4107
4140
  }
4108
4141
 
4109
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/util.mjs
4142
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/util.mjs
4110
4143
  var UNSAFE_OBJECT_KEY_NAME_REGEXP = /[-.]/;
4111
4144
  var TEMPORARY_NAME = "_t";
4112
4145
  var CONTEXT_NAME = "ctx";
@@ -4273,6 +4306,23 @@ var DefinitionMap = class {
4273
4306
  return literalMap(this.values);
4274
4307
  }
4275
4308
  };
4309
+ function createCssSelectorFromNode(node) {
4310
+ const elementName = node instanceof Element ? node.name : "ng-template";
4311
+ const attributes = getAttrsForDirectiveMatching(node);
4312
+ const cssSelector = new CssSelector();
4313
+ const elementNameNoNs = splitNsName(elementName)[1];
4314
+ cssSelector.setElement(elementNameNoNs);
4315
+ Object.getOwnPropertyNames(attributes).forEach((name) => {
4316
+ const nameNoNs = splitNsName(name)[1];
4317
+ const value = attributes[name];
4318
+ cssSelector.addAttribute(nameNoNs, value);
4319
+ if (name.toLowerCase() === "class") {
4320
+ const classes = value.trim().split(/\s+/);
4321
+ classes.forEach((className) => cssSelector.addClassName(className));
4322
+ }
4323
+ });
4324
+ return cssSelector;
4325
+ }
4276
4326
  function getAttrsForDirectiveMatching(elOrTpl) {
4277
4327
  const attributesMap = {};
4278
4328
  if (elOrTpl instanceof Template && elOrTpl.tagName !== "ng-template") {
@@ -4329,7 +4379,7 @@ function getInstructionStatements(instructions) {
4329
4379
  return statements;
4330
4380
  }
4331
4381
 
4332
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/injectable_compiler_2.mjs
4382
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/injectable_compiler_2.mjs
4333
4383
  function compileInjectable(meta, resolveForwardRefs) {
4334
4384
  let result = null;
4335
4385
  const factoryMeta = {
@@ -4414,7 +4464,7 @@ function createFactoryFunction(type) {
4414
4464
  return arrowFn([new FnParam("t", DYNAMIC_TYPE)], type.prop("\u0275fac").callFn([variable("t")]));
4415
4465
  }
4416
4466
 
4417
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/assertions.mjs
4467
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/assertions.mjs
4418
4468
  var UNUSABLE_INTERPOLATION_REGEXPS = [
4419
4469
  /^\s*$/,
4420
4470
  /[<>]/,
@@ -4436,7 +4486,7 @@ function assertInterpolationSymbols(identifier, value) {
4436
4486
  }
4437
4487
  }
4438
4488
 
4439
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/ml_parser/defaults.mjs
4489
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/defaults.mjs
4440
4490
  var InterpolationConfig = class {
4441
4491
  static fromArray(markers) {
4442
4492
  if (!markers) {
@@ -4453,7 +4503,7 @@ var InterpolationConfig = class {
4453
4503
  var DEFAULT_INTERPOLATION_CONFIG = new InterpolationConfig("{{", "}}");
4454
4504
  var DEFAULT_CONTAINER_BLOCKS = /* @__PURE__ */ new Set(["switch"]);
4455
4505
 
4456
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/chars.mjs
4506
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/chars.mjs
4457
4507
  var $EOF = 0;
4458
4508
  var $BSPACE = 8;
4459
4509
  var $TAB = 9;
@@ -4535,7 +4585,7 @@ function isQuote(code) {
4535
4585
  return code === $SQ || code === $DQ || code === $BT;
4536
4586
  }
4537
4587
 
4538
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/parse_util.mjs
4588
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/parse_util.mjs
4539
4589
  var ParseLocation = class {
4540
4590
  constructor(file, offset, line, col) {
4541
4591
  this.file = file;
@@ -4682,7 +4732,7 @@ function sanitizeIdentifier(name) {
4682
4732
  return name.replace(/\W/g, "_");
4683
4733
  }
4684
4734
 
4685
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/output/abstract_js_emitter.mjs
4735
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/abstract_js_emitter.mjs
4686
4736
  var makeTemplateObjectPolyfill = '(this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e})';
4687
4737
  var AbstractJsEmitterVisitor = class extends AbstractEmitterVisitor {
4688
4738
  constructor() {
@@ -4775,7 +4825,7 @@ var AbstractJsEmitterVisitor = class extends AbstractEmitterVisitor {
4775
4825
  }
4776
4826
  };
4777
4827
 
4778
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/output/output_jit_trusted_types.mjs
4828
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/output_jit_trusted_types.mjs
4779
4829
  var policy;
4780
4830
  function getPolicy() {
4781
4831
  if (policy === void 0) {
@@ -4813,7 +4863,7 @@ function newTrustedFunctionForJIT(...args) {
4813
4863
  return fn2.bind(_global);
4814
4864
  }
4815
4865
 
4816
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/output/output_jit.mjs
4866
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/output_jit.mjs
4817
4867
  var JitEvaluator = class {
4818
4868
  evaluateStatements(sourceUrl, statements, refResolver, createSourceMaps) {
4819
4869
  const converter = new JitEmitterVisitor(refResolver);
@@ -4904,7 +4954,7 @@ function isUseStrictStatement(statement) {
4904
4954
  return statement.isEquivalent(literal("use strict").toStmt());
4905
4955
  }
4906
4956
 
4907
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/r3_injector_compiler.mjs
4957
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_injector_compiler.mjs
4908
4958
  function compileInjector(meta) {
4909
4959
  const definitionMap = new DefinitionMap();
4910
4960
  if (meta.providers !== null) {
@@ -4921,7 +4971,7 @@ function createInjectorType(meta) {
4921
4971
  return new ExpressionType(importExpr(Identifiers.InjectorDeclaration, [new ExpressionType(meta.type.type)]));
4922
4972
  }
4923
4973
 
4924
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/r3_jit.mjs
4974
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_jit.mjs
4925
4975
  var R3JitReflector = class {
4926
4976
  constructor(context) {
4927
4977
  this.context = context;
@@ -4937,7 +4987,7 @@ var R3JitReflector = class {
4937
4987
  }
4938
4988
  };
4939
4989
 
4940
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/r3_module_compiler.mjs
4990
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_module_compiler.mjs
4941
4991
  var R3SelectorScopeMode;
4942
4992
  (function(R3SelectorScopeMode2) {
4943
4993
  R3SelectorScopeMode2[R3SelectorScopeMode2["Inline"] = 0] = "Inline";
@@ -5078,7 +5128,7 @@ function tupleOfTypes(types) {
5078
5128
  return types.length > 0 ? expressionType(literalArr(typeofTypes)) : NONE_TYPE;
5079
5129
  }
5080
5130
 
5081
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/r3_pipe_compiler.mjs
5131
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_pipe_compiler.mjs
5082
5132
  function compilePipeFromMetadata(metadata) {
5083
5133
  const definitionMapValues = [];
5084
5134
  definitionMapValues.push({ key: "name", value: literal(metadata.pipeName), quoted: false });
@@ -5099,7 +5149,7 @@ function createPipeType(metadata) {
5099
5149
  ]));
5100
5150
  }
5101
5151
 
5102
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/api.mjs
5152
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/api.mjs
5103
5153
  var R3TemplateDependencyKind;
5104
5154
  (function(R3TemplateDependencyKind2) {
5105
5155
  R3TemplateDependencyKind2[R3TemplateDependencyKind2["Directive"] = 0] = "Directive";
@@ -5107,7 +5157,7 @@ var R3TemplateDependencyKind;
5107
5157
  R3TemplateDependencyKind2[R3TemplateDependencyKind2["NgModule"] = 2] = "NgModule";
5108
5158
  })(R3TemplateDependencyKind || (R3TemplateDependencyKind = {}));
5109
5159
 
5110
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/expression_parser/ast.mjs
5160
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/expression_parser/ast.mjs
5111
5161
  var ParserError = class {
5112
5162
  constructor(message, input, errLocation, ctxLocation) {
5113
5163
  this.input = input;
@@ -5773,7 +5823,7 @@ var BoundElementProperty = class {
5773
5823
  }
5774
5824
  };
5775
5825
 
5776
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/compiler_util/expression_converter.mjs
5826
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/compiler_util/expression_converter.mjs
5777
5827
  var _EventHandlerVars = class {
5778
5828
  };
5779
5829
  var EventHandlerVars = _EventHandlerVars;
@@ -6414,7 +6464,7 @@ var BuiltinFunctionCall = class extends Call {
6414
6464
  }
6415
6465
  };
6416
6466
 
6417
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/schema/dom_security_schema.mjs
6467
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/schema/dom_security_schema.mjs
6418
6468
  var _SECURITY_SCHEMA;
6419
6469
  function SECURITY_SCHEMA() {
6420
6470
  if (!_SECURITY_SCHEMA) {
@@ -6472,7 +6522,7 @@ function isIframeSecuritySensitiveAttr(attrName) {
6472
6522
  return IFRAME_SECURITY_SENSITIVE_ATTRS.has(attrName.toLowerCase());
6473
6523
  }
6474
6524
 
6475
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/shadow_css.mjs
6525
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/shadow_css.mjs
6476
6526
  var animationKeywords = /* @__PURE__ */ new Set([
6477
6527
  "inherit",
6478
6528
  "initial",
@@ -6943,7 +6993,7 @@ function repeatGroups(groups, multiples) {
6943
6993
  }
6944
6994
  }
6945
6995
 
6946
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/enums.mjs
6996
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/enums.mjs
6947
6997
  var OpKind;
6948
6998
  (function(OpKind2) {
6949
6999
  OpKind2[OpKind2["ListEnd"] = 0] = "ListEnd";
@@ -6990,6 +7040,7 @@ var OpKind;
6990
7040
  OpKind2[OpKind2["IcuStart"] = 41] = "IcuStart";
6991
7041
  OpKind2[OpKind2["IcuEnd"] = 42] = "IcuEnd";
6992
7042
  OpKind2[OpKind2["I18nContext"] = 43] = "I18nContext";
7043
+ OpKind2[OpKind2["I18nAttributes"] = 44] = "I18nAttributes";
6993
7044
  })(OpKind || (OpKind = {}));
6994
7045
  var ExpressionKind;
6995
7046
  (function(ExpressionKind2) {
@@ -7066,6 +7117,11 @@ var I18nParamResolutionTime;
7066
7117
  I18nParamResolutionTime2[I18nParamResolutionTime2["Creation"] = 0] = "Creation";
7067
7118
  I18nParamResolutionTime2[I18nParamResolutionTime2["Postproccessing"] = 1] = "Postproccessing";
7068
7119
  })(I18nParamResolutionTime || (I18nParamResolutionTime = {}));
7120
+ var I18nExpressionFor;
7121
+ (function(I18nExpressionFor2) {
7122
+ I18nExpressionFor2[I18nExpressionFor2["I18nText"] = 0] = "I18nText";
7123
+ I18nExpressionFor2[I18nExpressionFor2["I18nAttribute"] = 1] = "I18nAttribute";
7124
+ })(I18nExpressionFor || (I18nExpressionFor = {}));
7069
7125
  var I18nParamValueFlags;
7070
7126
  (function(I18nParamValueFlags2) {
7071
7127
  I18nParamValueFlags2[I18nParamValueFlags2["None"] = 0] = "None";
@@ -7097,8 +7153,20 @@ var DerivedRepeaterVarIdentity;
7097
7153
  DerivedRepeaterVarIdentity2[DerivedRepeaterVarIdentity2["Even"] = 2] = "Even";
7098
7154
  DerivedRepeaterVarIdentity2[DerivedRepeaterVarIdentity2["Odd"] = 3] = "Odd";
7099
7155
  })(DerivedRepeaterVarIdentity || (DerivedRepeaterVarIdentity = {}));
7156
+ var I18nContextKind;
7157
+ (function(I18nContextKind2) {
7158
+ I18nContextKind2[I18nContextKind2["RootI18n"] = 0] = "RootI18n";
7159
+ I18nContextKind2[I18nContextKind2["Icu"] = 1] = "Icu";
7160
+ I18nContextKind2[I18nContextKind2["Attr"] = 2] = "Attr";
7161
+ })(I18nContextKind || (I18nContextKind = {}));
7162
+ var TemplateKind;
7163
+ (function(TemplateKind2) {
7164
+ TemplateKind2[TemplateKind2["NgTemplate"] = 0] = "NgTemplate";
7165
+ TemplateKind2[TemplateKind2["Structural"] = 1] = "Structural";
7166
+ TemplateKind2[TemplateKind2["Block"] = 2] = "Block";
7167
+ })(TemplateKind || (TemplateKind = {}));
7100
7168
 
7101
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/traits.mjs
7169
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/traits.mjs
7102
7170
  var ConsumesSlot = Symbol("ConsumesSlot");
7103
7171
  var DependsOnSlotContext = Symbol("DependsOnSlotContext");
7104
7172
  var ConsumesVarsTrait = Symbol("ConsumesVars");
@@ -7130,7 +7198,7 @@ function hasUsesVarOffsetTrait(expr) {
7130
7198
  return expr[UsesVarOffset] === true;
7131
7199
  }
7132
7200
 
7133
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/shared.mjs
7201
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/shared.mjs
7134
7202
  function createStatementOp(statement) {
7135
7203
  return __spreadValues({
7136
7204
  kind: OpKind.Statement,
@@ -7152,23 +7220,26 @@ var NEW_OP = {
7152
7220
  next: null
7153
7221
  };
7154
7222
 
7155
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/update.mjs
7156
- function createInterpolateTextOp(xref, interpolation, i18nPlaceholders, sourceSpan) {
7223
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/update.mjs
7224
+ function createInterpolateTextOp(xref, interpolation, sourceSpan) {
7157
7225
  return __spreadValues(__spreadValues(__spreadValues({
7158
7226
  kind: OpKind.InterpolateText,
7159
7227
  target: xref,
7160
7228
  interpolation,
7161
- i18nPlaceholders,
7162
7229
  sourceSpan
7163
7230
  }, TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS), NEW_OP);
7164
7231
  }
7165
7232
  var Interpolation2 = class {
7166
- constructor(strings, expressions) {
7233
+ constructor(strings, expressions, i18nPlaceholders) {
7167
7234
  this.strings = strings;
7168
7235
  this.expressions = expressions;
7236
+ this.i18nPlaceholders = i18nPlaceholders;
7237
+ if (i18nPlaceholders.length !== 0 && i18nPlaceholders.length !== expressions.length) {
7238
+ throw new Error(`Expected ${expressions.length} placeholders to match interpolation expression count, but got ${i18nPlaceholders.length}`);
7239
+ }
7169
7240
  }
7170
7241
  };
7171
- function createBindingOp(target, kind, name, expression, unit, securityContext, isTextAttribute, isTemplate, sourceSpan) {
7242
+ function createBindingOp(target, kind, name, expression, unit, securityContext, isTextAttribute, isStructuralTemplate, i18nContext, sourceSpan) {
7172
7243
  return __spreadValues({
7173
7244
  kind: OpKind.Binding,
7174
7245
  bindingKind: kind,
@@ -7178,11 +7249,12 @@ function createBindingOp(target, kind, name, expression, unit, securityContext,
7178
7249
  unit,
7179
7250
  securityContext,
7180
7251
  isTextAttribute,
7181
- isTemplate,
7252
+ isStructuralTemplate,
7253
+ i18nContext,
7182
7254
  sourceSpan
7183
7255
  }, NEW_OP);
7184
7256
  }
7185
- function createPropertyOp(target, name, expression, isAnimationTrigger, securityContext, isTemplate, sourceSpan) {
7257
+ function createPropertyOp(target, name, expression, isAnimationTrigger, securityContext, isStructuralTemplate, i18nContext, sourceSpan) {
7186
7258
  return __spreadValues(__spreadValues(__spreadValues({
7187
7259
  kind: OpKind.Property,
7188
7260
  target,
@@ -7191,7 +7263,8 @@ function createPropertyOp(target, name, expression, isAnimationTrigger, security
7191
7263
  isAnimationTrigger,
7192
7264
  securityContext,
7193
7265
  sanitizer: null,
7194
- isTemplate,
7266
+ isStructuralTemplate,
7267
+ i18nContext,
7195
7268
  sourceSpan
7196
7269
  }, TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS), NEW_OP);
7197
7270
  }
@@ -7230,7 +7303,7 @@ function createClassMapOp(xref, expression, sourceSpan) {
7230
7303
  sourceSpan
7231
7304
  }, TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS), NEW_OP);
7232
7305
  }
7233
- function createAttributeOp(target, name, expression, securityContext, isTextAttribute, isTemplate, sourceSpan) {
7306
+ function createAttributeOp(target, name, expression, securityContext, isTextAttribute, isStructuralTemplate, i18nContext, sourceSpan) {
7234
7307
  return __spreadValues(__spreadValues(__spreadValues({
7235
7308
  kind: OpKind.Attribute,
7236
7309
  target,
@@ -7239,7 +7312,8 @@ function createAttributeOp(target, name, expression, securityContext, isTextAttr
7239
7312
  securityContext,
7240
7313
  sanitizer: null,
7241
7314
  isTextAttribute,
7242
- isTemplate,
7315
+ isStructuralTemplate,
7316
+ i18nContext,
7243
7317
  sourceSpan
7244
7318
  }, TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS), NEW_OP);
7245
7319
  }
@@ -7280,28 +7354,31 @@ function createDeferWhenOp(target, expr, prefetch, sourceSpan) {
7280
7354
  sourceSpan
7281
7355
  }, NEW_OP), TRAIT_DEPENDS_ON_SLOT_CONTEXT);
7282
7356
  }
7283
- function createI18nExpressionOp(context, target, handle, expression, i18nPlaceholder, resolutionTime, sourceSpan) {
7357
+ function createI18nExpressionOp(context, target, i18nOwner, handle, expression, i18nPlaceholder, resolutionTime, usage, name, sourceSpan) {
7284
7358
  return __spreadValues(__spreadValues(__spreadValues({
7285
7359
  kind: OpKind.I18nExpression,
7286
7360
  context,
7287
7361
  target,
7362
+ i18nOwner,
7288
7363
  handle,
7289
7364
  expression,
7290
7365
  i18nPlaceholder,
7291
7366
  resolutionTime,
7367
+ usage,
7368
+ name,
7292
7369
  sourceSpan
7293
7370
  }, NEW_OP), TRAIT_CONSUMES_VARS), TRAIT_DEPENDS_ON_SLOT_CONTEXT);
7294
7371
  }
7295
- function createI18nApplyOp(target, handle, sourceSpan) {
7372
+ function createI18nApplyOp(owner, handle, sourceSpan) {
7296
7373
  return __spreadValues({
7297
7374
  kind: OpKind.I18nApply,
7298
- target,
7375
+ owner,
7299
7376
  handle,
7300
7377
  sourceSpan
7301
7378
  }, NEW_OP);
7302
7379
  }
7303
7380
 
7304
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/expression.mjs
7381
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/expression.mjs
7305
7382
  var _a;
7306
7383
  var _b;
7307
7384
  var _c;
@@ -8071,6 +8148,7 @@ function transformExpressionsInOp(op, transform2, flags) {
8071
8148
  case OpKind.ProjectionDef:
8072
8149
  case OpKind.Template:
8073
8150
  case OpKind.Text:
8151
+ case OpKind.I18nAttributes:
8074
8152
  break;
8075
8153
  default:
8076
8154
  throw new Error(`AssertionError: transformExpressionsInOp doesn't handle ${OpKind[op.kind]}`);
@@ -8082,6 +8160,8 @@ function transformExpressionsInExpression(expr, transform2, flags) {
8082
8160
  } else if (expr instanceof BinaryOperatorExpr) {
8083
8161
  expr.lhs = transformExpressionsInExpression(expr.lhs, transform2, flags);
8084
8162
  expr.rhs = transformExpressionsInExpression(expr.rhs, transform2, flags);
8163
+ } else if (expr instanceof UnaryOperatorExpr) {
8164
+ expr.expr = transformExpressionsInExpression(expr.expr, transform2, flags);
8085
8165
  } else if (expr instanceof ReadPropExpr) {
8086
8166
  expr.receiver = transformExpressionsInExpression(expr.receiver, transform2, flags);
8087
8167
  } else if (expr instanceof ReadKeyExpr) {
@@ -8121,6 +8201,8 @@ function transformExpressionsInExpression(expr, transform2, flags) {
8121
8201
  for (let i = 0; i < expr.expressions.length; i++) {
8122
8202
  expr.expressions[i] = transformExpressionsInExpression(expr.expressions[i], transform2, flags);
8123
8203
  }
8204
+ } else if (expr instanceof NotExpr) {
8205
+ expr.condition = transformExpressionsInExpression(expr.condition, transform2, flags);
8124
8206
  } else if (expr instanceof ReadVarExpr || expr instanceof ExternalExpr || expr instanceof LiteralExpr) {
8125
8207
  } else {
8126
8208
  throw new Error(`Unhandled expression kind: ${expr.constructor.name}`);
@@ -8152,7 +8234,7 @@ function isStringLiteral(expr) {
8152
8234
  return expr instanceof LiteralExpr && typeof expr.value === "string";
8153
8235
  }
8154
8236
 
8155
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/operations.mjs
8237
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/operations.mjs
8156
8238
  var _OpList = class {
8157
8239
  constructor() {
8158
8240
  this.debugListId = _OpList.nextListId++;
@@ -8343,14 +8425,14 @@ var OpList = _OpList;
8343
8425
  _OpList.nextListId = 0;
8344
8426
  })();
8345
8427
 
8346
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/handle.mjs
8428
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/handle.mjs
8347
8429
  var SlotHandle = class {
8348
8430
  constructor() {
8349
8431
  this.slot = null;
8350
8432
  }
8351
8433
  };
8352
8434
 
8353
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/create.mjs
8435
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/create.mjs
8354
8436
  var elementContainerOpKinds = /* @__PURE__ */ new Set([
8355
8437
  OpKind.Element,
8356
8438
  OpKind.ElementStart,
@@ -8376,10 +8458,11 @@ function createElementStartOp(tag, xref, namespace, i18nPlaceholder, sourceSpan)
8376
8458
  sourceSpan
8377
8459
  }, TRAIT_CONSUMES_SLOT), NEW_OP);
8378
8460
  }
8379
- function createTemplateOp(xref, tag, functionNameSuffix, namespace, i18nPlaceholder, sourceSpan) {
8461
+ function createTemplateOp(xref, templateKind, tag, functionNameSuffix, namespace, i18nPlaceholder, sourceSpan) {
8380
8462
  return __spreadValues(__spreadValues({
8381
8463
  kind: OpKind.Template,
8382
8464
  xref,
8465
+ templateKind,
8383
8466
  attributes: null,
8384
8467
  tag,
8385
8468
  handle: new SlotHandle(),
@@ -8480,25 +8563,27 @@ function createProjectionDefOp(def) {
8480
8563
  def
8481
8564
  }, NEW_OP);
8482
8565
  }
8483
- function createProjectionOp(xref, selector, sourceSpan) {
8566
+ function createProjectionOp(xref, selector, i18nPlaceholder, attributes, sourceSpan) {
8484
8567
  return __spreadValues(__spreadValues({
8485
8568
  kind: OpKind.Projection,
8486
8569
  xref,
8487
8570
  handle: new SlotHandle(),
8488
8571
  selector,
8572
+ i18nPlaceholder,
8489
8573
  projectionSlotIndex: 0,
8490
- attributes: [],
8574
+ attributes,
8491
8575
  localRefs: [],
8492
8576
  sourceSpan
8493
8577
  }, NEW_OP), TRAIT_CONSUMES_SLOT);
8494
8578
  }
8495
- function createExtractedAttributeOp(target, bindingKind, name, expression) {
8579
+ function createExtractedAttributeOp(target, bindingKind, name, expression, i18nContext) {
8496
8580
  return __spreadValues({
8497
8581
  kind: OpKind.ExtractedAttribute,
8498
8582
  target,
8499
8583
  bindingKind,
8500
8584
  name,
8501
- expression
8585
+ expression,
8586
+ i18nContext
8502
8587
  }, NEW_OP);
8503
8588
  }
8504
8589
  function createDeferOp(xref, main, mainSlot, metadata, sourceSpan) {
@@ -8535,10 +8620,11 @@ function createDeferOnOp(defer2, trigger, prefetch, sourceSpan) {
8535
8620
  sourceSpan
8536
8621
  }, NEW_OP);
8537
8622
  }
8538
- function createI18nMessageOp(xref, i18nBlock, message, messagePlaceholder, params, postprocessingParams, needsPostprocessing) {
8623
+ function createI18nMessageOp(xref, i18nContext, i18nBlock, message, messagePlaceholder, params, postprocessingParams, needsPostprocessing) {
8539
8624
  return __spreadValues({
8540
8625
  kind: OpKind.I18nMessage,
8541
8626
  xref,
8627
+ i18nContext,
8542
8628
  i18nBlock,
8543
8629
  message,
8544
8630
  messagePlaceholder,
@@ -8582,9 +8668,13 @@ function createIcuEndOp(xref) {
8582
8668
  xref
8583
8669
  }, NEW_OP);
8584
8670
  }
8585
- function createI18nContextOp(xref, i18nBlock, message, sourceSpan) {
8671
+ function createI18nContextOp(contextKind, xref, i18nBlock, message, sourceSpan) {
8672
+ if (i18nBlock === null && contextKind !== I18nContextKind.Attr) {
8673
+ throw new Error("AssertionError: i18nBlock must be provided for non-attribute contexts.");
8674
+ }
8586
8675
  return __spreadValues({
8587
8676
  kind: OpKind.I18nContext,
8677
+ contextKind,
8588
8678
  xref,
8589
8679
  i18nBlock,
8590
8680
  message,
@@ -8593,22 +8683,32 @@ function createI18nContextOp(xref, i18nBlock, message, sourceSpan) {
8593
8683
  postprocessingParams: /* @__PURE__ */ new Map()
8594
8684
  }, NEW_OP);
8595
8685
  }
8686
+ function createI18nAttributesOp(xref, handle, target) {
8687
+ return __spreadValues(__spreadValues({
8688
+ kind: OpKind.I18nAttributes,
8689
+ xref,
8690
+ handle,
8691
+ target,
8692
+ i18nAttributesConfig: null
8693
+ }, NEW_OP), TRAIT_CONSUMES_SLOT);
8694
+ }
8596
8695
 
8597
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/host.mjs
8598
- function createHostPropertyOp(name, expression, isAnimationTrigger, sourceSpan) {
8696
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/host.mjs
8697
+ function createHostPropertyOp(name, expression, isAnimationTrigger, i18nContext, sourceSpan) {
8599
8698
  return __spreadValues(__spreadValues({
8600
8699
  kind: OpKind.HostProperty,
8601
8700
  name,
8602
8701
  expression,
8603
8702
  isAnimationTrigger,
8703
+ i18nContext,
8604
8704
  sourceSpan
8605
8705
  }, TRAIT_CONSUMES_VARS), NEW_OP);
8606
8706
  }
8607
8707
 
8608
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/variable.mjs
8708
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/variable.mjs
8609
8709
  var CTX_REF = "CTX_REF_MARKER";
8610
8710
 
8611
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/compilation.mjs
8711
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/compilation.mjs
8612
8712
  var CompilationJobKind;
8613
8713
  (function(CompilationJobKind2) {
8614
8714
  CompilationJobKind2[CompilationJobKind2["Tmpl"] = 0] = "Tmpl";
@@ -8715,7 +8815,7 @@ var HostBindingCompilationUnit = class extends CompilationUnit {
8715
8815
  }
8716
8816
  };
8717
8817
 
8718
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/any_cast.mjs
8818
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/any_cast.mjs
8719
8819
  function deleteAnyCasts(job) {
8720
8820
  for (const unit of job.units) {
8721
8821
  for (const op of unit.ops()) {
@@ -8733,7 +8833,7 @@ function removeAnys(e) {
8733
8833
  return e;
8734
8834
  }
8735
8835
 
8736
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/apply_i18n_expressions.mjs
8836
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/apply_i18n_expressions.mjs
8737
8837
  function applyI18nExpressions(job) {
8738
8838
  const i18nContexts = /* @__PURE__ */ new Map();
8739
8839
  for (const unit of job.units) {
@@ -8746,7 +8846,7 @@ function applyI18nExpressions(job) {
8746
8846
  for (const unit of job.units) {
8747
8847
  for (const op of unit.update) {
8748
8848
  if (op.kind === OpKind.I18nExpression && needsApplication(i18nContexts, op)) {
8749
- OpList.insertAfter(createI18nApplyOp(op.target, op.handle, null), op);
8849
+ OpList.insertAfter(createI18nApplyOp(op.i18nOwner, op.handle, null), op);
8750
8850
  }
8751
8851
  }
8752
8852
  }
@@ -8758,16 +8858,27 @@ function needsApplication(i18nContexts, op) {
8758
8858
  }
8759
8859
  const context = i18nContexts.get(op.context);
8760
8860
  const nextContext2 = i18nContexts.get(op.next.context);
8761
- if (context.i18nBlock !== nextContext2.i18nBlock) {
8861
+ if (context === void 0) {
8862
+ throw new Error("AssertionError: expected an I18nContextOp to exist for the I18nExpressionOp's context");
8863
+ }
8864
+ if (nextContext2 === void 0) {
8865
+ throw new Error("AssertionError: expected an I18nContextOp to exist for the next I18nExpressionOp's context");
8866
+ }
8867
+ if (context.i18nBlock !== null) {
8868
+ if (context.i18nBlock !== nextContext2.i18nBlock) {
8869
+ return true;
8870
+ }
8871
+ return false;
8872
+ }
8873
+ if (op.i18nOwner !== op.next.i18nOwner) {
8762
8874
  return true;
8763
8875
  }
8764
8876
  return false;
8765
8877
  }
8766
8878
 
8767
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/assign_i18n_slot_dependencies.mjs
8879
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/assign_i18n_slot_dependencies.mjs
8768
8880
  function assignI18nSlotDependencies(job) {
8769
8881
  const i18nLastSlotConsumers = /* @__PURE__ */ new Map();
8770
- const i18nContexts = /* @__PURE__ */ new Map();
8771
8882
  let lastSlotConsumer = null;
8772
8883
  let currentI18nOp = null;
8773
8884
  for (const unit of job.units) {
@@ -8780,24 +8891,47 @@ function assignI18nSlotDependencies(job) {
8780
8891
  currentI18nOp = op;
8781
8892
  break;
8782
8893
  case OpKind.I18nEnd:
8894
+ if (currentI18nOp === null) {
8895
+ throw new Error("AssertionError: Expected an active I18n block while calculating last slot consumers");
8896
+ }
8897
+ if (lastSlotConsumer === null) {
8898
+ throw new Error("AssertionError: Expected a last slot consumer while calculating last slot consumers");
8899
+ }
8783
8900
  i18nLastSlotConsumers.set(currentI18nOp.xref, lastSlotConsumer);
8784
8901
  currentI18nOp = null;
8785
8902
  break;
8786
- case OpKind.I18nContext:
8787
- i18nContexts.set(op.xref, op);
8788
- break;
8789
8903
  }
8790
8904
  }
8905
+ let opsToMove = [];
8906
+ let moveAfterTarget = null;
8907
+ let previousTarget = null;
8791
8908
  for (const op of unit.update) {
8792
- if (op.kind === OpKind.I18nExpression) {
8793
- const i18nContext = i18nContexts.get(op.context);
8794
- op.target = i18nLastSlotConsumers.get(i18nContext.i18nBlock);
8909
+ if (hasDependsOnSlotContextTrait(op)) {
8910
+ if (moveAfterTarget !== null && previousTarget === moveAfterTarget && op.target !== previousTarget) {
8911
+ OpList.insertBefore(opsToMove, op);
8912
+ moveAfterTarget = null;
8913
+ opsToMove = [];
8914
+ }
8915
+ previousTarget = op.target;
8916
+ }
8917
+ if (op.kind === OpKind.I18nExpression && op.usage === I18nExpressionFor.I18nText) {
8918
+ OpList.remove(op);
8919
+ opsToMove.push(op);
8920
+ const target = i18nLastSlotConsumers.get(op.i18nOwner);
8921
+ if (target === void 0) {
8922
+ throw new Error("AssertionError: Expected to find a last slot consumer for an I18nExpressionOp");
8923
+ }
8924
+ op.target = target;
8925
+ moveAfterTarget = op.target;
8795
8926
  }
8796
8927
  }
8928
+ if (moveAfterTarget !== null) {
8929
+ unit.update.push(opsToMove);
8930
+ }
8797
8931
  }
8798
8932
  }
8799
8933
 
8800
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/util/elements.mjs
8934
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/util/elements.mjs
8801
8935
  function createOpXrefMap(unit) {
8802
8936
  const map = /* @__PURE__ */ new Map();
8803
8937
  for (const op of unit.create) {
@@ -8809,7 +8943,7 @@ function createOpXrefMap(unit) {
8809
8943
  return map;
8810
8944
  }
8811
8945
 
8812
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/attribute_extraction.mjs
8946
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/attribute_extraction.mjs
8813
8947
  function extractAttributes(job) {
8814
8948
  for (const unit of job.units) {
8815
8949
  const elements = createOpXrefMap(unit);
@@ -8820,18 +8954,26 @@ function extractAttributes(job) {
8820
8954
  break;
8821
8955
  case OpKind.Property:
8822
8956
  if (!op.isAnimationTrigger) {
8823
- OpList.insertBefore(createExtractedAttributeOp(op.target, op.isTemplate ? BindingKind.Template : BindingKind.Property, op.name, null), lookupElement(elements, op.target));
8957
+ let bindingKind;
8958
+ if (op.i18nContext !== null) {
8959
+ bindingKind = BindingKind.I18n;
8960
+ } else if (op.isStructuralTemplate) {
8961
+ bindingKind = BindingKind.Template;
8962
+ } else {
8963
+ bindingKind = BindingKind.Property;
8964
+ }
8965
+ OpList.insertBefore(createExtractedAttributeOp(op.target, bindingKind, op.name, null, null), lookupElement(elements, op.target));
8824
8966
  }
8825
8967
  break;
8826
8968
  case OpKind.StyleProp:
8827
8969
  case OpKind.ClassProp:
8828
8970
  if (unit.job.compatibility === CompatibilityMode.TemplateDefinitionBuilder && op.expression instanceof EmptyExpr2) {
8829
- OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.Property, op.name, null), lookupElement(elements, op.target));
8971
+ OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.Property, op.name, null, null), lookupElement(elements, op.target));
8830
8972
  }
8831
8973
  break;
8832
8974
  case OpKind.Listener:
8833
8975
  if (!op.isAnimationListener) {
8834
- const extractedAttributeOp = createExtractedAttributeOp(op.target, BindingKind.Property, op.name, null);
8976
+ const extractedAttributeOp = createExtractedAttributeOp(op.target, BindingKind.Property, op.name, null, null);
8835
8977
  if (job.kind === CompilationJobKind.Host) {
8836
8978
  unit.create.push(extractedAttributeOp);
8837
8979
  } else {
@@ -8865,7 +9007,7 @@ function extractAttributeOp(unit, op, elements) {
8865
9007
  }
8866
9008
  }
8867
9009
  if (extractable) {
8868
- const extractedAttributeOp = createExtractedAttributeOp(op.target, op.isTemplate ? BindingKind.Template : BindingKind.Attribute, op.name, op.expression);
9010
+ const extractedAttributeOp = createExtractedAttributeOp(op.target, op.isStructuralTemplate ? BindingKind.Template : BindingKind.Attribute, op.name, op.expression, op.i18nContext);
8869
9011
  if (unit.job.kind === CompilationJobKind.Host) {
8870
9012
  unit.create.push(extractedAttributeOp);
8871
9013
  } else {
@@ -8876,7 +9018,7 @@ function extractAttributeOp(unit, op, elements) {
8876
9018
  }
8877
9019
  }
8878
9020
 
8879
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/binding_specialization.mjs
9021
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/binding_specialization.mjs
8880
9022
  function lookupElement2(elements, xref) {
8881
9023
  const el = elements.get(xref);
8882
9024
  if (el === void 0) {
@@ -8906,15 +9048,15 @@ function specializeBindings(job) {
8906
9048
  const target = lookupElement2(elements, op.target);
8907
9049
  target.nonBindable = true;
8908
9050
  } else {
8909
- OpList.replace(op, createAttributeOp(op.target, op.name, op.expression, op.securityContext, op.isTextAttribute, op.isTemplate, op.sourceSpan));
9051
+ OpList.replace(op, createAttributeOp(op.target, op.name, op.expression, op.securityContext, op.isTextAttribute, op.isStructuralTemplate, op.i18nContext, op.sourceSpan));
8910
9052
  }
8911
9053
  break;
8912
9054
  case BindingKind.Property:
8913
9055
  case BindingKind.Animation:
8914
9056
  if (job.kind === CompilationJobKind.Host) {
8915
- OpList.replace(op, createHostPropertyOp(op.name, op.expression, op.bindingKind === BindingKind.Animation, op.sourceSpan));
9057
+ OpList.replace(op, createHostPropertyOp(op.name, op.expression, op.bindingKind === BindingKind.Animation, op.i18nContext, op.sourceSpan));
8916
9058
  } else {
8917
- OpList.replace(op, createPropertyOp(op.target, op.name, op.expression, op.bindingKind === BindingKind.Animation, op.securityContext, op.isTemplate, op.sourceSpan));
9059
+ OpList.replace(op, createPropertyOp(op.target, op.name, op.expression, op.bindingKind === BindingKind.Animation, op.securityContext, op.isStructuralTemplate, op.i18nContext, op.sourceSpan));
8918
9060
  }
8919
9061
  break;
8920
9062
  case BindingKind.I18n:
@@ -8926,7 +9068,7 @@ function specializeBindings(job) {
8926
9068
  }
8927
9069
  }
8928
9070
 
8929
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/chaining.mjs
9071
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/chaining.mjs
8930
9072
  var CHAINABLE = /* @__PURE__ */ new Set([
8931
9073
  Identifiers.attribute,
8932
9074
  Identifiers.classProp,
@@ -8992,7 +9134,7 @@ function chainOperationsInList(opList) {
8992
9134
  }
8993
9135
  }
8994
9136
 
8995
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/collapse_singleton_interpolations.mjs
9137
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/collapse_singleton_interpolations.mjs
8996
9138
  function collapseSingletonInterpolations(job) {
8997
9139
  for (const unit of job.units) {
8998
9140
  for (const op of unit.update) {
@@ -9004,7 +9146,7 @@ function collapseSingletonInterpolations(job) {
9004
9146
  }
9005
9147
  }
9006
9148
 
9007
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/conditionals.mjs
9149
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/conditionals.mjs
9008
9150
  function generateConditionalExpressions(job) {
9009
9151
  for (const unit of job.units) {
9010
9152
  for (const op of unit.ops()) {
@@ -9041,40 +9183,7 @@ function generateConditionalExpressions(job) {
9041
9183
  }
9042
9184
  }
9043
9185
 
9044
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/ml_parser/tags.mjs
9045
- var TagContentType;
9046
- (function(TagContentType2) {
9047
- TagContentType2[TagContentType2["RAW_TEXT"] = 0] = "RAW_TEXT";
9048
- TagContentType2[TagContentType2["ESCAPABLE_RAW_TEXT"] = 1] = "ESCAPABLE_RAW_TEXT";
9049
- TagContentType2[TagContentType2["PARSABLE_DATA"] = 2] = "PARSABLE_DATA";
9050
- })(TagContentType || (TagContentType = {}));
9051
- function splitNsName(elementName) {
9052
- if (elementName[0] != ":") {
9053
- return [null, elementName];
9054
- }
9055
- const colonIndex = elementName.indexOf(":", 1);
9056
- if (colonIndex === -1) {
9057
- throw new Error(`Unsupported format "${elementName}" expecting ":namespace:name"`);
9058
- }
9059
- return [elementName.slice(1, colonIndex), elementName.slice(colonIndex + 1)];
9060
- }
9061
- function isNgContainer(tagName) {
9062
- return splitNsName(tagName)[1] === "ng-container";
9063
- }
9064
- function isNgContent(tagName) {
9065
- return splitNsName(tagName)[1] === "ng-content";
9066
- }
9067
- function isNgTemplate(tagName) {
9068
- return splitNsName(tagName)[1] === "ng-template";
9069
- }
9070
- function getNsPrefix(fullName) {
9071
- return fullName === null ? null : splitNsName(fullName)[0];
9072
- }
9073
- function mergeNsAndName(prefix, localName) {
9074
- return prefix ? `:${prefix}:${localName}` : localName;
9075
- }
9076
-
9077
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/conversion.mjs
9186
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/conversion.mjs
9078
9187
  var BINARY_OPERATORS = /* @__PURE__ */ new Map([
9079
9188
  ["&&", BinaryOperator.And],
9080
9189
  [">", BinaryOperator.Bigger],
@@ -9124,7 +9233,7 @@ function literalOrArrayLiteral(value) {
9124
9233
  return literal(value);
9125
9234
  }
9126
9235
 
9127
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/const_collection.mjs
9236
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/const_collection.mjs
9128
9237
  function collectElementConsts(job) {
9129
9238
  const allElementAttributes = /* @__PURE__ */ new Map();
9130
9239
  for (const unit of job.units) {
@@ -9210,7 +9319,7 @@ var ElementAttributes = class {
9210
9319
  array.push(...getAttributeNameLiterals(name));
9211
9320
  if (kind === BindingKind.Attribute || kind === BindingKind.StyleProperty) {
9212
9321
  if (value === null) {
9213
- throw Error("Attribute & style element attributes must have a value");
9322
+ throw Error("Attribute, i18n attribute, & style element attributes must have a value");
9214
9323
  }
9215
9324
  array.push(value);
9216
9325
  }
@@ -9258,7 +9367,48 @@ function serializeAttributes({ attributes, bindings, classes, i18n: i18n2, proje
9258
9367
  return literalArr(attrArray);
9259
9368
  }
9260
9369
 
9261
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/create_defer_deps_fns.mjs
9370
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/convert_i18n_bindings.mjs
9371
+ function convertI18nBindings(job) {
9372
+ const i18nAttributesByElem = /* @__PURE__ */ new Map();
9373
+ for (const unit of job.units) {
9374
+ for (const op of unit.create) {
9375
+ if (op.kind === OpKind.I18nAttributes) {
9376
+ i18nAttributesByElem.set(op.target, op);
9377
+ }
9378
+ }
9379
+ for (const op of unit.update) {
9380
+ switch (op.kind) {
9381
+ case OpKind.Property:
9382
+ case OpKind.Attribute:
9383
+ if (op.i18nContext === null) {
9384
+ continue;
9385
+ }
9386
+ if (!(op.expression instanceof Interpolation2)) {
9387
+ continue;
9388
+ }
9389
+ const i18nAttributesForElem = i18nAttributesByElem.get(op.target);
9390
+ if (i18nAttributesForElem === void 0) {
9391
+ throw new Error("AssertionError: An i18n attribute binding instruction requires the owning element to have an I18nAttributes create instruction");
9392
+ }
9393
+ if (i18nAttributesForElem.target !== op.target) {
9394
+ throw new Error("AssertionError: Expected i18nAttributes target element to match binding target element");
9395
+ }
9396
+ const ops = [];
9397
+ for (let i = 0; i < op.expression.expressions.length; i++) {
9398
+ const expr = op.expression.expressions[i];
9399
+ if (op.expression.i18nPlaceholders.length !== op.expression.expressions.length) {
9400
+ 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`);
9401
+ }
9402
+ ops.push(createI18nExpressionOp(op.i18nContext, i18nAttributesForElem.target, i18nAttributesForElem.xref, i18nAttributesForElem.handle, expr, op.expression.i18nPlaceholders[i], I18nParamResolutionTime.Creation, I18nExpressionFor.I18nAttribute, op.name, op.sourceSpan));
9403
+ }
9404
+ OpList.replaceWithMany(op, ops);
9405
+ break;
9406
+ }
9407
+ }
9408
+ }
9409
+ }
9410
+
9411
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/create_defer_deps_fns.mjs
9262
9412
  function createDeferDepsFns(job) {
9263
9413
  for (const unit of job.units) {
9264
9414
  for (const op of unit.create) {
@@ -9286,18 +9436,22 @@ function createDeferDepsFns(job) {
9286
9436
  }
9287
9437
  }
9288
9438
 
9289
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/create_i18n_contexts.mjs
9439
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/create_i18n_contexts.mjs
9290
9440
  function createI18nContexts(job) {
9441
+ const rootContexts = /* @__PURE__ */ new Map();
9291
9442
  let currentI18nOp = null;
9292
9443
  let xref;
9293
9444
  for (const unit of job.units) {
9294
9445
  for (const op of unit.create) {
9295
9446
  switch (op.kind) {
9296
9447
  case OpKind.I18nStart:
9297
- xref = job.allocateXrefId();
9298
- unit.create.push(createI18nContextOp(xref, op.xref, op.message, null));
9299
- op.context = xref;
9300
9448
  currentI18nOp = op;
9449
+ if (op.xref === op.root) {
9450
+ xref = job.allocateXrefId();
9451
+ unit.create.push(createI18nContextOp(I18nContextKind.RootI18n, xref, op.xref, op.message, null));
9452
+ op.context = xref;
9453
+ rootContexts.set(op.xref, xref);
9454
+ }
9301
9455
  break;
9302
9456
  case OpKind.I18nEnd:
9303
9457
  currentI18nOp = null;
@@ -9308,7 +9462,7 @@ function createI18nContexts(job) {
9308
9462
  }
9309
9463
  if (op.message.id !== currentI18nOp.message.id) {
9310
9464
  xref = job.allocateXrefId();
9311
- unit.create.push(createI18nContextOp(xref, currentI18nOp.xref, op.message, null));
9465
+ unit.create.push(createI18nContextOp(I18nContextKind.Icu, xref, currentI18nOp.xref, op.message, null));
9312
9466
  op.context = xref;
9313
9467
  } else {
9314
9468
  op.context = currentI18nOp.context;
@@ -9317,9 +9471,16 @@ function createI18nContexts(job) {
9317
9471
  }
9318
9472
  }
9319
9473
  }
9474
+ for (const unit of job.units) {
9475
+ for (const op of unit.create) {
9476
+ if (op.kind === OpKind.I18nStart && op.xref !== op.root) {
9477
+ op.context = rootContexts.get(op.root);
9478
+ }
9479
+ }
9480
+ }
9320
9481
  }
9321
9482
 
9322
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/defer_configs.mjs
9483
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/defer_configs.mjs
9323
9484
  function configureDeferInstructions(job) {
9324
9485
  for (const unit of job.units) {
9325
9486
  for (const op of unit.create) {
@@ -9336,7 +9497,7 @@ function configureDeferInstructions(job) {
9336
9497
  }
9337
9498
  }
9338
9499
 
9339
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/defer_resolve_targets.mjs
9500
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/defer_resolve_targets.mjs
9340
9501
  function resolveDeferTargetNames(job) {
9341
9502
  const scopes = /* @__PURE__ */ new Map();
9342
9503
  function getScopeForView2(view) {
@@ -9430,7 +9591,7 @@ var Scope = class {
9430
9591
  }
9431
9592
  };
9432
9593
 
9433
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/empty_elements.mjs
9594
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/empty_elements.mjs
9434
9595
  var REPLACEMENTS = /* @__PURE__ */ new Map([
9435
9596
  [OpKind.ElementEnd, [OpKind.ElementStart, OpKind.Element]],
9436
9597
  [OpKind.ContainerEnd, [OpKind.ContainerStart, OpKind.Container]],
@@ -9457,7 +9618,7 @@ function collapseEmptyInstructions(job) {
9457
9618
  }
9458
9619
  }
9459
9620
 
9460
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/expand_safe_reads.mjs
9621
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/expand_safe_reads.mjs
9461
9622
  function expandSafeReads(job) {
9462
9623
  for (const unit of job.units) {
9463
9624
  for (const op of unit.ops()) {
@@ -9593,7 +9754,7 @@ function ternaryTransform(e) {
9593
9754
  return new ConditionalExpr(new BinaryOperatorExpr(BinaryOperator.Equals, e.guard, NULL_EXPR), NULL_EXPR, e.expr);
9594
9755
  }
9595
9756
 
9596
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/extract_i18n_messages.mjs
9757
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/extract_i18n_messages.mjs
9597
9758
  var ESCAPE = "\uFFFD";
9598
9759
  var ELEMENT_MARKER = "#";
9599
9760
  var TEMPLATE_MARKER = "*";
@@ -9604,7 +9765,7 @@ var LIST_END_MARKER = "]";
9604
9765
  var LIST_DELIMITER = "|";
9605
9766
  function extractI18nMessages(job) {
9606
9767
  const i18nContexts = /* @__PURE__ */ new Map();
9607
- const i18nBlockContexts = /* @__PURE__ */ new Set();
9768
+ const i18nBlocks = /* @__PURE__ */ new Map();
9608
9769
  for (const unit of job.units) {
9609
9770
  for (const op of unit.create) {
9610
9771
  switch (op.kind) {
@@ -9612,11 +9773,20 @@ function extractI18nMessages(job) {
9612
9773
  i18nContexts.set(op.xref, op);
9613
9774
  break;
9614
9775
  case OpKind.I18nStart:
9615
- i18nBlockContexts.add(op.context);
9776
+ i18nBlocks.set(op.xref, op);
9616
9777
  break;
9617
9778
  }
9618
9779
  }
9619
9780
  }
9781
+ for (const unit of job.units) {
9782
+ for (const op of unit.create) {
9783
+ if (op.kind !== OpKind.I18nContext || op.contextKind !== I18nContextKind.Attr) {
9784
+ continue;
9785
+ }
9786
+ const i18nMessageOp = createI18nMessage(job, op);
9787
+ unit.create.push(i18nMessageOp);
9788
+ }
9789
+ }
9620
9790
  const i18nBlockMessages = /* @__PURE__ */ new Map();
9621
9791
  for (const unit of job.units) {
9622
9792
  for (const op of unit.create) {
@@ -9637,11 +9807,15 @@ function extractI18nMessages(job) {
9637
9807
  if (!op.context) {
9638
9808
  throw Error("ICU op should have its context set.");
9639
9809
  }
9640
- if (!i18nBlockContexts.has(op.context)) {
9641
- const i18nContext = i18nContexts.get(op.context);
9810
+ const i18nContext = i18nContexts.get(op.context);
9811
+ if (i18nContext.contextKind === I18nContextKind.Icu) {
9812
+ if (i18nContext.i18nBlock === null) {
9813
+ throw Error("ICU context should have its i18n block set.");
9814
+ }
9642
9815
  const subMessage = createI18nMessage(job, i18nContext, op.messagePlaceholder);
9643
9816
  unit.create.push(subMessage);
9644
- const parentMessage = i18nBlockMessages.get(i18nContext.i18nBlock);
9817
+ const rootI18nId = i18nBlocks.get(i18nContext.i18nBlock).root;
9818
+ const parentMessage = i18nBlockMessages.get(rootI18nId);
9645
9819
  parentMessage == null ? void 0 : parentMessage.subMessages.push(subMessage.xref);
9646
9820
  }
9647
9821
  OpList.remove(op);
@@ -9654,23 +9828,25 @@ function extractI18nMessages(job) {
9654
9828
  }
9655
9829
  }
9656
9830
  function createI18nMessage(job, context, messagePlaceholder) {
9657
- let needsPostprocessing = context.postprocessingParams.size > 0;
9831
+ let formattedParams = formatParams(context.params);
9832
+ const formattedPostprocessingParams = formatParams(context.postprocessingParams);
9833
+ let needsPostprocessing = formattedPostprocessingParams.size > 0;
9658
9834
  for (const values of context.params.values()) {
9659
9835
  if (values.length > 1) {
9660
9836
  needsPostprocessing = true;
9661
9837
  }
9662
9838
  }
9663
- return createI18nMessageOp(job.allocateXrefId(), context.i18nBlock, context.message, messagePlaceholder != null ? messagePlaceholder : null, formatParams(context.params), formatParams(context.postprocessingParams), needsPostprocessing);
9839
+ return createI18nMessageOp(job.allocateXrefId(), context.xref, context.i18nBlock, context.message, messagePlaceholder != null ? messagePlaceholder : null, formattedParams, formattedPostprocessingParams, needsPostprocessing);
9664
9840
  }
9665
9841
  function formatParams(params) {
9666
- const result = /* @__PURE__ */ new Map();
9842
+ const formattedParams = /* @__PURE__ */ new Map();
9667
9843
  for (const [placeholder, placeholderValues] of params) {
9668
9844
  const serializedValues = formatParamValues(placeholderValues);
9669
9845
  if (serializedValues !== null) {
9670
- result.set(placeholder, literal(formatParamValues(placeholderValues)));
9846
+ formattedParams.set(placeholder, literal(serializedValues));
9671
9847
  }
9672
9848
  }
9673
- return result;
9849
+ return formattedParams;
9674
9850
  }
9675
9851
  function formatParamValues(values) {
9676
9852
  if (values.length === 0) {
@@ -9680,6 +9856,26 @@ function formatParamValues(values) {
9680
9856
  return serializedValues.length === 1 ? serializedValues[0] : `${LIST_START_MARKER}${serializedValues.join(LIST_DELIMITER)}${LIST_END_MARKER}`;
9681
9857
  }
9682
9858
  function formatValue(value) {
9859
+ if (value.flags & I18nParamValueFlags.ElementTag && value.flags & I18nParamValueFlags.TemplateTag) {
9860
+ if (typeof value.value !== "object") {
9861
+ throw Error("AssertionError: Expected i18n param value to have an element and template slot");
9862
+ }
9863
+ const elementValue = formatValue(__spreadProps(__spreadValues({}, value), {
9864
+ value: value.value.element,
9865
+ flags: value.flags & ~I18nParamValueFlags.TemplateTag
9866
+ }));
9867
+ const templateValue = formatValue(__spreadProps(__spreadValues({}, value), {
9868
+ value: value.value.template,
9869
+ flags: value.flags & ~I18nParamValueFlags.ElementTag
9870
+ }));
9871
+ if (value.flags & I18nParamValueFlags.OpenTag && value.flags & I18nParamValueFlags.CloseTag) {
9872
+ return `${templateValue}${elementValue}${templateValue}`;
9873
+ }
9874
+ return value.flags & I18nParamValueFlags.CloseTag ? `${elementValue}${templateValue}` : `${templateValue}${elementValue}`;
9875
+ }
9876
+ if (value.flags & I18nParamValueFlags.OpenTag && value.flags & I18nParamValueFlags.CloseTag) {
9877
+ return `${formatValue(__spreadProps(__spreadValues({}, value), { flags: value.flags & ~I18nParamValueFlags.CloseTag }))}${formatValue(__spreadProps(__spreadValues({}, value), { flags: value.flags & ~I18nParamValueFlags.OpenTag }))}`;
9878
+ }
9683
9879
  if (value.flags === I18nParamValueFlags.None) {
9684
9880
  return `${value.value}`;
9685
9881
  }
@@ -9694,13 +9890,10 @@ function formatValue(value) {
9694
9890
  closeMarker = value.flags & I18nParamValueFlags.CloseTag ? TAG_CLOSE_MARKER : "";
9695
9891
  }
9696
9892
  const context = value.subTemplateIndex === null ? "" : `${CONTEXT_MARKER}${value.subTemplateIndex}`;
9697
- if (value.flags & I18nParamValueFlags.OpenTag && value.flags & I18nParamValueFlags.CloseTag) {
9698
- return `${ESCAPE}${tagMarker}${value.value}${context}${ESCAPE}${ESCAPE}${closeMarker}${tagMarker}${value.value}${context}${ESCAPE}`;
9699
- }
9700
9893
  return `${ESCAPE}${closeMarker}${tagMarker}${value.value}${context}${ESCAPE}`;
9701
9894
  }
9702
9895
 
9703
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_advance.mjs
9896
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_advance.mjs
9704
9897
  function generateAdvance(job) {
9705
9898
  for (const unit of job.units) {
9706
9899
  const slotMap = /* @__PURE__ */ new Map();
@@ -9717,7 +9910,7 @@ function generateAdvance(job) {
9717
9910
  if (!hasDependsOnSlotContextTrait(op)) {
9718
9911
  continue;
9719
9912
  } else if (!slotMap.has(op.target)) {
9720
- throw new Error(`AssertionError: reference to unknown slot for var ${op.target}`);
9913
+ throw new Error(`AssertionError: reference to unknown slot for target ${op.target}`);
9721
9914
  }
9722
9915
  const slot = slotMap.get(op.target);
9723
9916
  if (slotContext !== slot) {
@@ -9732,7 +9925,7 @@ function generateAdvance(job) {
9732
9925
  }
9733
9926
  }
9734
9927
 
9735
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_projection_def.mjs
9928
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_projection_def.mjs
9736
9929
  function generateProjectionDefs(job) {
9737
9930
  const share = job.compatibility === CompatibilityMode.TemplateDefinitionBuilder;
9738
9931
  const selectors = [];
@@ -9756,7 +9949,7 @@ function generateProjectionDefs(job) {
9756
9949
  }
9757
9950
  }
9758
9951
 
9759
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_variables.mjs
9952
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_variables.mjs
9760
9953
  function generateVariables(job) {
9761
9954
  recursivelyProcessView(job.root, null);
9762
9955
  }
@@ -9844,7 +10037,7 @@ function generateVariablesInScopeForView(view, scope) {
9844
10037
  return newOps;
9845
10038
  }
9846
10039
 
9847
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/has_const_expression_collection.mjs
10040
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/has_const_expression_collection.mjs
9848
10041
  function collectConstExpressions(job) {
9849
10042
  for (const unit of job.units) {
9850
10043
  for (const op of unit.ops()) {
@@ -9858,7 +10051,7 @@ function collectConstExpressions(job) {
9858
10051
  }
9859
10052
  }
9860
10053
 
9861
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/host_style_property_parsing.mjs
10054
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/host_style_property_parsing.mjs
9862
10055
  var STYLE_DOT = "style.";
9863
10056
  var CLASS_DOT = "class.";
9864
10057
  var STYLE_BANG = "style!";
@@ -9916,7 +10109,7 @@ function parseProperty(name) {
9916
10109
  return { property: property2, suffix };
9917
10110
  }
9918
10111
 
9919
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/output/map_util.mjs
10112
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/map_util.mjs
9920
10113
  function mapLiteral(obj, quoted = false) {
9921
10114
  return literalMap(Object.keys(obj).map((key) => ({
9922
10115
  key,
@@ -9925,7 +10118,7 @@ function mapLiteral(obj, quoted = false) {
9925
10118
  })));
9926
10119
  }
9927
10120
 
9928
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/i18n/icu_serializer.mjs
10121
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/i18n/icu_serializer.mjs
9929
10122
  var IcuSerializerVisitor = class {
9930
10123
  visitText(text2) {
9931
10124
  return text2.value;
@@ -9959,7 +10152,7 @@ function serializeIcuNode(icu) {
9959
10152
  return icu.visit(serializer);
9960
10153
  }
9961
10154
 
9962
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/expression_parser/lexer.mjs
10155
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/expression_parser/lexer.mjs
9963
10156
  var TokenType;
9964
10157
  (function(TokenType2) {
9965
10158
  TokenType2[TokenType2["Character"] = 0] = "Character";
@@ -10320,7 +10513,7 @@ function parseIntAutoRadix(text2) {
10320
10513
  return result;
10321
10514
  }
10322
10515
 
10323
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/expression_parser/parser.mjs
10516
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/expression_parser/parser.mjs
10324
10517
  var SplitInterpolation = class {
10325
10518
  constructor(strings, expressions, offsets) {
10326
10519
  this.strings = strings;
@@ -11214,7 +11407,7 @@ function getIndexMapForOriginalTemplate(interpolatedTokens) {
11214
11407
  return offsetMap;
11215
11408
  }
11216
11409
 
11217
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/ml_parser/ast.mjs
11410
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/ast.mjs
11218
11411
  var NodeWithI18n = class {
11219
11412
  constructor(sourceSpan, i18n2) {
11220
11413
  this.sourceSpan = sourceSpan;
@@ -11366,11 +11559,11 @@ var RecursiveVisitor = class {
11366
11559
  }
11367
11560
  };
11368
11561
 
11369
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/schema/element_schema_registry.mjs
11562
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/schema/element_schema_registry.mjs
11370
11563
  var ElementSchemaRegistry = class {
11371
11564
  };
11372
11565
 
11373
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/schema/dom_element_schema_registry.mjs
11566
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/schema/dom_element_schema_registry.mjs
11374
11567
  var BOOLEAN = "boolean";
11375
11568
  var NUMBER = "number";
11376
11569
  var STRING = "string";
@@ -11723,7 +11916,7 @@ function _isPixelDimensionStyle(prop) {
11723
11916
  }
11724
11917
  }
11725
11918
 
11726
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/ml_parser/html_tags.mjs
11919
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/html_tags.mjs
11727
11920
  var HtmlTagDefinition = class {
11728
11921
  constructor({ closedByChildren, implicitNamespacePrefix, contentType = TagContentType.PARSABLE_DATA, closedByParent = false, isVoid = false, ignoreFirstLf = false, preventNamespaceInheritance = false, canSelfClose = false } = {}) {
11729
11922
  this.closedByChildren = {};
@@ -11841,7 +12034,7 @@ function getHtmlTagDefinition(tagName) {
11841
12034
  return (_b2 = (_a2 = TAG_DEFINITIONS[tagName]) != null ? _a2 : TAG_DEFINITIONS[tagName.toLowerCase()]) != null ? _b2 : DEFAULT_TAG_DEFINITION;
11842
12035
  }
11843
12036
 
11844
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/i18n/serializers/placeholder.mjs
12037
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/serializers/placeholder.mjs
11845
12038
  var TAG_TO_PLACEHOLDER_NAMES = {
11846
12039
  "A": "LINK",
11847
12040
  "B": "BOLD_TEXT",
@@ -11963,7 +12156,7 @@ var PlaceholderRegistry = class {
11963
12156
  }
11964
12157
  };
11965
12158
 
11966
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/i18n/i18n_parser.mjs
12159
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/i18n_parser.mjs
11967
12160
  var _expParser = new Parser(new Lexer());
11968
12161
  function createI18nMessageFactory(interpolationConfig, containerBlocks) {
11969
12162
  const visitor = new _I18nVisitor(_expParser, interpolationConfig, containerBlocks);
@@ -12142,14 +12335,14 @@ function extractPlaceholderName(input) {
12142
12335
  return input.split(_CUSTOM_PH_EXP)[2];
12143
12336
  }
12144
12337
 
12145
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/i18n/parse_util.mjs
12338
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/parse_util.mjs
12146
12339
  var I18nError = class extends ParseError {
12147
12340
  constructor(span, msg) {
12148
12341
  super(span, msg);
12149
12342
  }
12150
12343
  };
12151
12344
 
12152
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/ml_parser/entities.mjs
12345
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/entities.mjs
12153
12346
  var NAMED_ENTITIES = {
12154
12347
  "AElig": "\xC6",
12155
12348
  "AMP": "&",
@@ -14280,7 +14473,7 @@ var NAMED_ENTITIES = {
14280
14473
  var NGSP_UNICODE = "\uE500";
14281
14474
  NAMED_ENTITIES["ngsp"] = NGSP_UNICODE;
14282
14475
 
14283
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/ml_parser/lexer.mjs
14476
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/lexer.mjs
14284
14477
  var TokenError = class extends ParseError {
14285
14478
  constructor(errorMsg, tokenType, span) {
14286
14479
  super(span, errorMsg);
@@ -15201,7 +15394,7 @@ var CursorError = class {
15201
15394
  }
15202
15395
  };
15203
15396
 
15204
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/ml_parser/parser.mjs
15397
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/parser.mjs
15205
15398
  var TreeError = class extends ParseError {
15206
15399
  static create(elementName, span, msg) {
15207
15400
  return new TreeError(elementName, span, msg);
@@ -15585,7 +15778,7 @@ function decodeEntity(match, entity) {
15585
15778
  return match;
15586
15779
  }
15587
15780
 
15588
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/schema/trusted_types_sinks.mjs
15781
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/schema/trusted_types_sinks.mjs
15589
15782
  var TRUSTED_TYPES_SINKS = /* @__PURE__ */ new Set([
15590
15783
  "iframe|srcdoc",
15591
15784
  "*|innerhtml",
@@ -15600,7 +15793,7 @@ function isTrustedTypesSink(tagName, propName) {
15600
15793
  return TRUSTED_TYPES_SINKS.has(tagName + "|" + propName) || TRUSTED_TYPES_SINKS.has("*|" + propName);
15601
15794
  }
15602
15795
 
15603
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/i18n/meta.mjs
15796
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/i18n/meta.mjs
15604
15797
  var setI18nRefs = (htmlNode, i18nNode) => {
15605
15798
  if (htmlNode instanceof NodeWithI18n) {
15606
15799
  if (i18nNode instanceof IcuPlaceholder && htmlNode.i18n instanceof Message) {
@@ -15757,7 +15950,7 @@ function i18nMetaToJSDoc(meta) {
15757
15950
  return jsDocComment(tags);
15758
15951
  }
15759
15952
 
15760
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/i18n/get_msg_utils.mjs
15953
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/i18n/get_msg_utils.mjs
15761
15954
  var GOOG_GET_MSG = "goog.getMsg";
15762
15955
  function createGoogleGetMsgStatements(variable2, message, closureVar, placeholderValues) {
15763
15956
  const messageString = serializeI18nMessageForGetMsg(message);
@@ -15808,7 +16001,7 @@ function serializeI18nMessageForGetMsg(message) {
15808
16001
  return message.nodes.map((node) => node.visit(serializerVisitor2, null)).join("");
15809
16002
  }
15810
16003
 
15811
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/i18n/localize_utils.mjs
16004
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/i18n/localize_utils.mjs
15812
16005
  function createLocalizeStatements(variable2, message, params) {
15813
16006
  const { messageParts, placeHolders } = serializeI18nMessageForLocalize(message);
15814
16007
  const sourceSpan = getSourceSpan(message);
@@ -15897,59 +16090,136 @@ function createEmptyMessagePart(location) {
15897
16090
  return new LiteralPiece("", new ParseSourceSpan(location, location));
15898
16091
  }
15899
16092
 
15900
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/i18n_const_collection.mjs
16093
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/i18n_const_collection.mjs
15901
16094
  var NG_I18N_CLOSURE_MODE = "ngI18nClosureMode";
15902
16095
  var TRANSLATION_VAR_PREFIX2 = "i18n_";
16096
+ var I18N_ICU_MAPPING_PREFIX2 = "I18N_EXP_";
16097
+ var ESCAPE2 = "\uFFFD";
15903
16098
  function collectI18nConsts(job) {
16099
+ var _a2;
15904
16100
  const fileBasedI18nSuffix = job.relativeContextFilePath.replace(/[^A-Za-z0-9]/g, "_").toUpperCase() + "_";
15905
- const messageConstIndices = /* @__PURE__ */ new Map();
16101
+ const extractedAttributesByI18nContext = /* @__PURE__ */ new Map();
16102
+ const i18nAttributesByElement = /* @__PURE__ */ new Map();
16103
+ const i18nExpressionsByElement = /* @__PURE__ */ new Map();
15906
16104
  const messages = /* @__PURE__ */ new Map();
16105
+ for (const unit of job.units) {
16106
+ for (const op of unit.ops()) {
16107
+ if (op.kind === OpKind.ExtractedAttribute && op.i18nContext !== null) {
16108
+ extractedAttributesByI18nContext.set(op.i18nContext, op);
16109
+ } else if (op.kind === OpKind.I18nAttributes) {
16110
+ i18nAttributesByElement.set(op.target, op);
16111
+ } else if (op.kind === OpKind.I18nExpression && op.usage === I18nExpressionFor.I18nAttribute) {
16112
+ const expressions = (_a2 = i18nExpressionsByElement.get(op.target)) != null ? _a2 : [];
16113
+ expressions.push(op);
16114
+ i18nExpressionsByElement.set(op.target, expressions);
16115
+ } else if (op.kind === OpKind.I18nMessage) {
16116
+ messages.set(op.xref, op);
16117
+ }
16118
+ }
16119
+ }
16120
+ const i18nValuesByContext = /* @__PURE__ */ new Map();
16121
+ const messageConstIndices = /* @__PURE__ */ new Map();
15907
16122
  for (const unit of job.units) {
15908
16123
  for (const op of unit.create) {
15909
16124
  if (op.kind === OpKind.I18nMessage) {
15910
- messages.set(op.xref, op);
16125
+ if (op.messagePlaceholder === null) {
16126
+ const { mainVar, statements } = collectMessage(job, fileBasedI18nSuffix, messages, op);
16127
+ if (op.i18nBlock !== null) {
16128
+ const i18nConst = job.addConst(mainVar, statements);
16129
+ messageConstIndices.set(op.i18nBlock, i18nConst);
16130
+ } else {
16131
+ job.constsInitializers.push(...statements);
16132
+ i18nValuesByContext.set(op.i18nContext, mainVar);
16133
+ const attributeForMessage = extractedAttributesByI18nContext.get(op.i18nContext);
16134
+ if (attributeForMessage !== void 0) {
16135
+ attributeForMessage.expression = mainVar;
16136
+ }
16137
+ }
16138
+ }
15911
16139
  OpList.remove(op);
15912
16140
  }
15913
16141
  }
15914
16142
  }
15915
- for (const op of messages.values()) {
15916
- if (op.kind === OpKind.I18nMessage && op.messagePlaceholder === null) {
15917
- const { mainVar, statements } = collectMessage(job, fileBasedI18nSuffix, messages, op);
15918
- messageConstIndices.set(op.i18nBlock, job.addConst(mainVar, statements));
16143
+ for (const unit of job.units) {
16144
+ for (const elem of unit.create) {
16145
+ if (isElementOrContainerOp(elem)) {
16146
+ const i18nAttributes2 = i18nAttributesByElement.get(elem.xref);
16147
+ if (i18nAttributes2 === void 0) {
16148
+ continue;
16149
+ }
16150
+ let i18nExpressions = i18nExpressionsByElement.get(elem.xref);
16151
+ if (i18nExpressions === void 0) {
16152
+ throw new Error("AssertionError: Could not find any i18n expressions associated with an I18nAttributes instruction");
16153
+ }
16154
+ const seenPropertyNames = /* @__PURE__ */ new Set();
16155
+ i18nExpressions = i18nExpressions.filter((i18nExpr) => {
16156
+ const seen = seenPropertyNames.has(i18nExpr.name);
16157
+ seenPropertyNames.add(i18nExpr.name);
16158
+ return !seen;
16159
+ });
16160
+ const i18nAttributeConfig = i18nExpressions.flatMap((i18nExpr) => {
16161
+ const i18nExprValue = i18nValuesByContext.get(i18nExpr.context);
16162
+ if (i18nExprValue === void 0) {
16163
+ throw new Error("AssertionError: Could not find i18n expression's value");
16164
+ }
16165
+ return [literal(i18nExpr.name), i18nExprValue];
16166
+ });
16167
+ i18nAttributes2.i18nAttributesConfig = job.addConst(new LiteralArrayExpr(i18nAttributeConfig));
16168
+ }
15919
16169
  }
15920
16170
  }
15921
16171
  for (const unit of job.units) {
15922
16172
  for (const op of unit.create) {
15923
16173
  if (op.kind === OpKind.I18nStart) {
15924
- op.messageIndex = messageConstIndices.get(op.root);
16174
+ const msgIndex = messageConstIndices.get(op.root);
16175
+ if (msgIndex === void 0) {
16176
+ 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?");
16177
+ }
16178
+ op.messageIndex = msgIndex;
15925
16179
  }
15926
16180
  }
15927
16181
  }
15928
16182
  }
15929
16183
  function collectMessage(job, fileBasedI18nSuffix, messages, messageOp) {
16184
+ var _a2;
15930
16185
  const statements = [];
16186
+ const subMessagePlaceholders = /* @__PURE__ */ new Map();
15931
16187
  for (const subMessageId of messageOp.subMessages) {
15932
16188
  const subMessage = messages.get(subMessageId);
15933
16189
  const { mainVar: subMessageVar, statements: subMessageStatements } = collectMessage(job, fileBasedI18nSuffix, messages, subMessage);
15934
16190
  statements.push(...subMessageStatements);
15935
- messageOp.params.set(subMessage.messagePlaceholder, subMessageVar);
16191
+ const subMessages = (_a2 = subMessagePlaceholders.get(subMessage.messagePlaceholder)) != null ? _a2 : [];
16192
+ subMessages.push(subMessageVar);
16193
+ subMessagePlaceholders.set(subMessage.messagePlaceholder, subMessages);
15936
16194
  }
16195
+ addSubMessageParams(messageOp, subMessagePlaceholders);
15937
16196
  messageOp.params = new Map([...messageOp.params.entries()].sort());
15938
- assertAllParamsResolved(messageOp);
15939
16197
  const mainVar = variable(job.pool.uniqueName(TRANSLATION_VAR_PREFIX2));
15940
16198
  const closureVar = i18nGenerateClosureVar(job.pool, messageOp.message.id, fileBasedI18nSuffix, job.i18nUseExternalIds);
15941
16199
  let transformFn = void 0;
15942
16200
  if (messageOp.needsPostprocessing) {
15943
- messageOp.postprocessingParams = new Map([...messageOp.postprocessingParams.entries()].sort());
16201
+ const postprocessingParams = Object.fromEntries([...messageOp.postprocessingParams.entries()].sort());
16202
+ const formattedPostprocessingParams = formatI18nPlaceholderNamesInMap(postprocessingParams, false);
15944
16203
  const extraTransformFnParams = [];
15945
16204
  if (messageOp.postprocessingParams.size > 0) {
15946
- extraTransformFnParams.push(literalMap([...messageOp.postprocessingParams].map(([key, value]) => ({ key, value, quoted: true }))));
16205
+ extraTransformFnParams.push(mapLiteral(formattedPostprocessingParams, true));
15947
16206
  }
15948
16207
  transformFn = (expr) => importExpr(Identifiers.i18nPostprocess).callFn([expr, ...extraTransformFnParams]);
15949
16208
  }
15950
16209
  statements.push(...getTranslationDeclStmts(messageOp.message, mainVar, closureVar, messageOp.params, transformFn));
15951
16210
  return { mainVar, statements };
15952
16211
  }
16212
+ function addSubMessageParams(messageOp, subMessagePlaceholders) {
16213
+ for (const [placeholder, subMessages] of subMessagePlaceholders) {
16214
+ if (subMessages.length === 1) {
16215
+ messageOp.params.set(placeholder, subMessages[0]);
16216
+ } else {
16217
+ messageOp.params.set(placeholder, literal(`${ESCAPE2}${I18N_ICU_MAPPING_PREFIX2}${placeholder}${ESCAPE2}`));
16218
+ messageOp.postprocessingParams.set(placeholder, literalArr(subMessages));
16219
+ messageOp.needsPostprocessing = true;
16220
+ }
16221
+ }
16222
+ }
15953
16223
  function getTranslationDeclStmts(message, variable2, closureVar, params, transformFn) {
15954
16224
  const paramsObject = Object.fromEntries(params);
15955
16225
  const statements = [
@@ -15977,23 +16247,9 @@ function i18nGenerateClosureVar(pool, messageId, fileBasedI18nSuffix, useExterna
15977
16247
  }
15978
16248
  return variable(name);
15979
16249
  }
15980
- function assertAllParamsResolved(op) {
15981
- for (let placeholder in op.message.placeholders) {
15982
- placeholder = placeholder.trimEnd();
15983
- if (!op.params.has(placeholder) && !op.postprocessingParams.has(placeholder)) {
15984
- throw Error(`Failed to resolve i18n placeholder: ${placeholder}`);
15985
- }
15986
- }
15987
- for (let placeholder in op.message.placeholderToMessage) {
15988
- placeholder = placeholder.trimEnd();
15989
- if (!op.params.has(placeholder) && !op.postprocessingParams.has(placeholder)) {
15990
- throw Error(`Failed to resolve i18n message placeholder: ${placeholder}`);
15991
- }
15992
- }
15993
- }
15994
16250
 
15995
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/i18n_text_extraction.mjs
15996
- function extractI18nText(job) {
16251
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/i18n_text_extraction.mjs
16252
+ function convertI18nText(job) {
15997
16253
  var _a2;
15998
16254
  for (const unit of job.units) {
15999
16255
  let currentI18n = null;
@@ -16042,7 +16298,7 @@ function extractI18nText(job) {
16042
16298
  const ops = [];
16043
16299
  for (let i = 0; i < op.interpolation.expressions.length; i++) {
16044
16300
  const expr = op.interpolation.expressions[i];
16045
- ops.push(createI18nExpressionOp(contextId, i18nOp.xref, i18nOp.handle, expr, op.i18nPlaceholders[i], resolutionTime, (_a2 = expr.sourceSpan) != null ? _a2 : op.sourceSpan));
16301
+ 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));
16046
16302
  }
16047
16303
  OpList.replaceWithMany(op, ops);
16048
16304
  break;
@@ -16051,7 +16307,7 @@ function extractI18nText(job) {
16051
16307
  }
16052
16308
  }
16053
16309
 
16054
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/local_refs.mjs
16310
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/local_refs.mjs
16055
16311
  function liftLocalRefs(job) {
16056
16312
  for (const unit of job.units) {
16057
16313
  for (const op of unit.create) {
@@ -16081,48 +16337,7 @@ function serializeLocalRefs(refs) {
16081
16337
  return literalArr(constRefs);
16082
16338
  }
16083
16339
 
16084
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/merge_i18n_contexts.mjs
16085
- function mergeI18nContexts(job) {
16086
- const i18nOps = /* @__PURE__ */ new Map();
16087
- const i18nContexts = /* @__PURE__ */ new Map();
16088
- for (const unit of job.units) {
16089
- for (const op of unit.create) {
16090
- switch (op.kind) {
16091
- case OpKind.I18nStart:
16092
- if (!op.context) {
16093
- throw Error("I18n op should have its context set.");
16094
- }
16095
- i18nOps.set(op.xref, op);
16096
- break;
16097
- case OpKind.I18nContext:
16098
- i18nContexts.set(op.xref, op);
16099
- break;
16100
- }
16101
- }
16102
- }
16103
- for (const childI18nOp of i18nOps.values()) {
16104
- if (childI18nOp.xref !== childI18nOp.root) {
16105
- const childContext = i18nContexts.get(childI18nOp.context);
16106
- const rootI18nOp = i18nOps.get(childI18nOp.root);
16107
- const rootContext = i18nContexts.get(rootI18nOp.context);
16108
- mergeParams(rootContext.params, childContext.params);
16109
- mergeParams(rootContext.postprocessingParams, childContext.postprocessingParams);
16110
- }
16111
- }
16112
- }
16113
- function mergeParams(to, from) {
16114
- for (const [placeholder, fromValues] of from) {
16115
- const toValues = to.get(placeholder) || [];
16116
- const flags = fromValues[0].flags;
16117
- if (flags & I18nParamValueFlags.CloseTag && !(flags & I18nParamValueFlags.OpenTag)) {
16118
- to.set(placeholder, [...fromValues, ...toValues]);
16119
- } else {
16120
- to.set(placeholder, [...toValues, ...fromValues]);
16121
- }
16122
- }
16123
- }
16124
-
16125
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/namespace.mjs
16340
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/namespace.mjs
16126
16341
  function emitNamespaceChanges(job) {
16127
16342
  for (const unit of job.units) {
16128
16343
  let activeNamespace = Namespace.HTML;
@@ -16138,7 +16353,7 @@ function emitNamespaceChanges(job) {
16138
16353
  }
16139
16354
  }
16140
16355
 
16141
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/style_parser.mjs
16356
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/style_parser.mjs
16142
16357
  function parse(value) {
16143
16358
  const styles = [];
16144
16359
  let i = 0;
@@ -16199,7 +16414,7 @@ function hyphenate2(value) {
16199
16414
  }).toLowerCase();
16200
16415
  }
16201
16416
 
16202
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/naming.mjs
16417
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/naming.mjs
16203
16418
  function nameFunctionsAndVariables(job) {
16204
16419
  addNamesToView(job.root, job.componentName, { index: 0 }, job.compatibility === CompatibilityMode.TemplateDefinitionBuilder);
16205
16420
  }
@@ -16314,7 +16529,7 @@ function stripImportant(name) {
16314
16529
  return name;
16315
16530
  }
16316
16531
 
16317
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/next_context_merging.mjs
16532
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/next_context_merging.mjs
16318
16533
  function mergeNextContextExpressions(job) {
16319
16534
  for (const unit of job.units) {
16320
16535
  for (const op of unit.create) {
@@ -16360,7 +16575,7 @@ function mergeNextContextsInOps(ops) {
16360
16575
  }
16361
16576
  }
16362
16577
 
16363
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/ng_container.mjs
16578
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/ng_container.mjs
16364
16579
  var CONTAINER_TAG = "ng-container";
16365
16580
  function generateNgContainerOps(job) {
16366
16581
  for (const unit of job.units) {
@@ -16377,7 +16592,7 @@ function generateNgContainerOps(job) {
16377
16592
  }
16378
16593
  }
16379
16594
 
16380
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/nonbindable.mjs
16595
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/nonbindable.mjs
16381
16596
  function lookupElement3(elements, xref) {
16382
16597
  const el = elements.get(xref);
16383
16598
  if (el === void 0) {
@@ -16407,7 +16622,7 @@ function disableBindings(job) {
16407
16622
  }
16408
16623
  }
16409
16624
 
16410
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/nullish_coalescing.mjs
16625
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/nullish_coalescing.mjs
16411
16626
  function generateNullishCoalesceExpressions(job) {
16412
16627
  for (const unit of job.units) {
16413
16628
  for (const op of unit.ops()) {
@@ -16423,7 +16638,7 @@ function generateNullishCoalesceExpressions(job) {
16423
16638
  }
16424
16639
  }
16425
16640
 
16426
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/ordering.mjs
16641
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/ordering.mjs
16427
16642
  function kindTest(kind) {
16428
16643
  return (op) => op.kind === kind;
16429
16644
  }
@@ -16497,7 +16712,7 @@ function keepLast(ops) {
16497
16712
  return ops.slice(ops.length - 1);
16498
16713
  }
16499
16714
 
16500
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/parse_extracted_styles.mjs
16715
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/parse_extracted_styles.mjs
16501
16716
  function parseExtractedStyles(job) {
16502
16717
  for (const unit of job.units) {
16503
16718
  for (const op of unit.create) {
@@ -16505,13 +16720,13 @@ function parseExtractedStyles(job) {
16505
16720
  if (op.name === "style") {
16506
16721
  const parsedStyles = parse(op.expression.value);
16507
16722
  for (let i = 0; i < parsedStyles.length - 1; i += 2) {
16508
- OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.StyleProperty, parsedStyles[i], literal(parsedStyles[i + 1])), op);
16723
+ OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.StyleProperty, parsedStyles[i], literal(parsedStyles[i + 1]), null), op);
16509
16724
  }
16510
16725
  OpList.remove(op);
16511
16726
  } else if (op.name === "class") {
16512
16727
  const parsedClasses = op.expression.value.trim().split(/\s+/g);
16513
16728
  for (const parsedClass of parsedClasses) {
16514
- OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.ClassName, parsedClass, null), op);
16729
+ OpList.insertBefore(createExtractedAttributeOp(op.target, BindingKind.ClassName, parsedClass, null, null), op);
16515
16730
  }
16516
16731
  OpList.remove(op);
16517
16732
  }
@@ -16520,22 +16735,32 @@ function parseExtractedStyles(job) {
16520
16735
  }
16521
16736
  }
16522
16737
 
16523
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/phase_remove_content_selectors.mjs
16738
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/phase_remove_content_selectors.mjs
16524
16739
  function removeContentSelectors(job) {
16525
16740
  for (const unit of job.units) {
16526
16741
  const elements = createOpXrefMap(unit);
16527
- for (const op of unit.update) {
16742
+ for (const op of unit.ops()) {
16528
16743
  switch (op.kind) {
16529
16744
  case OpKind.Binding:
16530
16745
  const target = lookupInXrefMap(elements, op.target);
16531
- if (op.name.toLowerCase() === "select" && target.kind === OpKind.Projection) {
16746
+ if (isSelectAttribute(op.name) && target.kind === OpKind.Projection) {
16532
16747
  OpList.remove(op);
16533
16748
  }
16534
16749
  break;
16750
+ case OpKind.Projection:
16751
+ for (let i = op.attributes.length - 2; i >= 0; i -= 2) {
16752
+ if (isSelectAttribute(op.attributes[i])) {
16753
+ op.attributes.splice(i, 2);
16754
+ }
16755
+ }
16756
+ break;
16535
16757
  }
16536
16758
  }
16537
16759
  }
16538
16760
  }
16761
+ function isSelectAttribute(name) {
16762
+ return name.toLowerCase() === "select";
16763
+ }
16539
16764
  function lookupInXrefMap(map, xref) {
16540
16765
  const el = map.get(xref);
16541
16766
  if (el === void 0) {
@@ -16544,7 +16769,7 @@ function lookupInXrefMap(map, xref) {
16544
16769
  return el;
16545
16770
  }
16546
16771
 
16547
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pipe_creation.mjs
16772
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pipe_creation.mjs
16548
16773
  function createPipes(job) {
16549
16774
  for (const unit of job.units) {
16550
16775
  processPipeBindingsInView(unit);
@@ -16592,7 +16817,7 @@ function addPipeToCreationBlock(unit, afterTargetXref, binding) {
16592
16817
  throw new Error(`AssertionError: unable to find insertion point for pipe ${binding.name}`);
16593
16818
  }
16594
16819
 
16595
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pipe_variadic.mjs
16820
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pipe_variadic.mjs
16596
16821
  function createVariadicPipes(job) {
16597
16822
  for (const unit of job.units) {
16598
16823
  for (const op of unit.update) {
@@ -16609,7 +16834,7 @@ function createVariadicPipes(job) {
16609
16834
  }
16610
16835
  }
16611
16836
 
16612
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/propagate_i18n_blocks.mjs
16837
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/propagate_i18n_blocks.mjs
16613
16838
  function propagateI18nBlocks(job) {
16614
16839
  propagateI18nBlocksToTemplates(job.root, 0);
16615
16840
  }
@@ -16622,6 +16847,9 @@ function propagateI18nBlocksToTemplates(unit, subTemplateIndex) {
16622
16847
  i18nBlock = op;
16623
16848
  break;
16624
16849
  case OpKind.I18nEnd:
16850
+ if (i18nBlock.subTemplateIndex === null) {
16851
+ subTemplateIndex = 0;
16852
+ }
16625
16853
  i18nBlock = null;
16626
16854
  break;
16627
16855
  case OpKind.Template:
@@ -16633,9 +16861,10 @@ function propagateI18nBlocksToTemplates(unit, subTemplateIndex) {
16633
16861
  subTemplateIndex++;
16634
16862
  wrapTemplateWithI18n(templateView, i18nBlock);
16635
16863
  }
16636
- propagateI18nBlocksToTemplates(templateView, subTemplateIndex);
16864
+ subTemplateIndex = propagateI18nBlocksToTemplates(templateView, subTemplateIndex);
16637
16865
  }
16638
16866
  }
16867
+ return subTemplateIndex;
16639
16868
  }
16640
16869
  function wrapTemplateWithI18n(unit, parentI18n) {
16641
16870
  var _a2;
@@ -16646,7 +16875,7 @@ function wrapTemplateWithI18n(unit, parentI18n) {
16646
16875
  }
16647
16876
  }
16648
16877
 
16649
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pure_function_extraction.mjs
16878
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pure_function_extraction.mjs
16650
16879
  function extractPureFunctions(job) {
16651
16880
  for (const view of job.units) {
16652
16881
  for (const op of view.ops()) {
@@ -16688,7 +16917,7 @@ var PureFunctionConstant = class extends GenericKeyFn {
16688
16917
  }
16689
16918
  };
16690
16919
 
16691
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pure_literal_structures.mjs
16920
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pure_literal_structures.mjs
16692
16921
  function generatePureLiteralStructures(job) {
16693
16922
  for (const unit of job.units) {
16694
16923
  for (const op of unit.update) {
@@ -16735,7 +16964,7 @@ function transformLiteralMap(expr) {
16735
16964
  return new PureFunctionExpr(literalMap(derivedEntries), nonConstantArgs);
16736
16965
  }
16737
16966
 
16738
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/instruction.mjs
16967
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/instruction.mjs
16739
16968
  function element(slot, tag, constIndex, localRefIndex, sourceSpan) {
16740
16969
  return elementOrContainerBase(Identifiers.element, slot, tag, constIndex, localRefIndex, sourceSpan);
16741
16970
  }
@@ -16950,6 +17179,10 @@ function i18n(slot, constIndex, subTemplateIndex) {
16950
17179
  function i18nEnd() {
16951
17180
  return call(Identifiers.i18nEnd, [], null);
16952
17181
  }
17182
+ function i18nAttributes(slot, i18nAttributesConfig) {
17183
+ const args = [literal(slot), literal(i18nAttributesConfig)];
17184
+ return call(Identifiers.i18nAttributes, args, null);
17185
+ }
16953
17186
  function property(name, expression, sanitizer, sourceSpan) {
16954
17187
  const args = [literal(name), expression];
16955
17188
  if (sanitizer !== null) {
@@ -17246,7 +17479,7 @@ function callVariadicInstruction(config, baseArgs, interpolationArgs, extraArgs,
17246
17479
  return createStatementOp(callVariadicInstructionExpr(config, baseArgs, interpolationArgs, extraArgs, sourceSpan).toStmt());
17247
17480
  }
17248
17481
 
17249
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/reify.mjs
17482
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/reify.mjs
17250
17483
  var sanitizerIdentifierMap = /* @__PURE__ */ new Map([
17251
17484
  [SanitizerFn.Html, Identifiers.sanitizeHtml],
17252
17485
  [SanitizerFn.IframeAttribute, Identifiers.validateIframeAttribute],
@@ -17296,6 +17529,12 @@ function reifyCreateOperations(unit, ops) {
17296
17529
  case OpKind.I18n:
17297
17530
  OpList.replace(op, i18n(op.handle.slot, op.messageIndex, op.subTemplateIndex));
17298
17531
  break;
17532
+ case OpKind.I18nAttributes:
17533
+ if (op.i18nAttributesConfig === null) {
17534
+ throw new Error(`AssertionError: i18nAttributesConfig was not set`);
17535
+ }
17536
+ OpList.replace(op, i18nAttributes(op.handle.slot, op.i18nAttributesConfig));
17537
+ break;
17299
17538
  case OpKind.Template:
17300
17539
  if (!(unit instanceof ViewCompilationUnit)) {
17301
17540
  throw new Error(`AssertionError: must be compiling a component`);
@@ -17575,7 +17814,7 @@ function reifyListenerHandler(unit, name, handlerOps, consumesDollarEvent) {
17575
17814
  return fn(params, handlerStmts, void 0, void 0, name);
17576
17815
  }
17577
17816
 
17578
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/remove_empty_bindings.mjs
17817
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/remove_empty_bindings.mjs
17579
17818
  function removeEmptyBindings(job) {
17580
17819
  for (const unit of job.units) {
17581
17820
  for (const op of unit.update) {
@@ -17596,7 +17835,7 @@ function removeEmptyBindings(job) {
17596
17835
  }
17597
17836
  }
17598
17837
 
17599
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/remove_i18n_contexts.mjs
17838
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/remove_i18n_contexts.mjs
17600
17839
  function removeI18nContexts(job) {
17601
17840
  for (const unit of job.units) {
17602
17841
  for (const op of unit.create) {
@@ -17612,7 +17851,29 @@ function removeI18nContexts(job) {
17612
17851
  }
17613
17852
  }
17614
17853
 
17615
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/repeater_derived_vars.mjs
17854
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/remove_unused_i18n_attrs.mjs
17855
+ function removeUnusedI18nAttributesOps(job) {
17856
+ for (const unit of job.units) {
17857
+ const ownersWithI18nExpressions = /* @__PURE__ */ new Set();
17858
+ for (const op of unit.update) {
17859
+ switch (op.kind) {
17860
+ case OpKind.I18nExpression:
17861
+ ownersWithI18nExpressions.add(op.i18nOwner);
17862
+ }
17863
+ }
17864
+ for (const op of unit.create) {
17865
+ switch (op.kind) {
17866
+ case OpKind.I18nAttributes:
17867
+ if (ownersWithI18nExpressions.has(op.xref)) {
17868
+ continue;
17869
+ }
17870
+ OpList.remove(op);
17871
+ }
17872
+ }
17873
+ }
17874
+ }
17875
+
17876
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/repeater_derived_vars.mjs
17616
17877
  function generateRepeaterDerivedVars(job) {
17617
17878
  const repeaters = /* @__PURE__ */ new Map();
17618
17879
  for (const unit of job.units) {
@@ -17644,7 +17905,7 @@ function generateRepeaterDerivedVars(job) {
17644
17905
  }
17645
17906
  }
17646
17907
 
17647
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_contexts.mjs
17908
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_contexts.mjs
17648
17909
  function resolveContexts(job) {
17649
17910
  for (const unit of job.units) {
17650
17911
  processLexicalScope(unit, unit.create);
@@ -17685,7 +17946,7 @@ function processLexicalScope(view, ops) {
17685
17946
  }
17686
17947
  }
17687
17948
 
17688
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_dollar_event.mjs
17949
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_dollar_event.mjs
17689
17950
  function resolveDollarEvent(job) {
17690
17951
  for (const unit of job.units) {
17691
17952
  transformDollarEvent(unit, unit.create);
@@ -17706,7 +17967,7 @@ function transformDollarEvent(unit, ops) {
17706
17967
  }
17707
17968
  }
17708
17969
 
17709
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_i18n_element_placeholders.mjs
17970
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_i18n_element_placeholders.mjs
17710
17971
  function resolveI18nElementPlaceholders(job) {
17711
17972
  const i18nContexts = /* @__PURE__ */ new Map();
17712
17973
  const elements = /* @__PURE__ */ new Map();
@@ -17722,55 +17983,117 @@ function resolveI18nElementPlaceholders(job) {
17722
17983
  }
17723
17984
  }
17724
17985
  }
17725
- for (const unit of job.units) {
17726
- let currentOps = null;
17727
- for (const op of unit.create) {
17728
- switch (op.kind) {
17729
- case OpKind.I18nStart:
17730
- if (!op.context) {
17731
- throw Error("Could not find i18n context for i18n op");
17986
+ resolvePlaceholdersForView(job, job.root, i18nContexts, elements);
17987
+ }
17988
+ function resolvePlaceholdersForView(job, unit, i18nContexts, elements, pendingStructuralDirective) {
17989
+ let currentOps = null;
17990
+ let pendingStructuralDirectiveCloses = /* @__PURE__ */ new Map();
17991
+ for (const op of unit.create) {
17992
+ switch (op.kind) {
17993
+ case OpKind.I18nStart:
17994
+ if (!op.context) {
17995
+ throw Error("Could not find i18n context for i18n op");
17996
+ }
17997
+ currentOps = { i18nBlock: op, i18nContext: i18nContexts.get(op.context) };
17998
+ break;
17999
+ case OpKind.I18nEnd:
18000
+ currentOps = null;
18001
+ break;
18002
+ case OpKind.ElementStart:
18003
+ if (op.i18nPlaceholder !== void 0) {
18004
+ if (currentOps === null) {
18005
+ throw Error("i18n tag placeholder should only occur inside an i18n block");
17732
18006
  }
17733
- currentOps = { i18nBlock: op, i18nContext: i18nContexts.get(op.context) };
17734
- break;
17735
- case OpKind.I18nEnd:
17736
- currentOps = null;
17737
- break;
17738
- case OpKind.ElementStart:
17739
- if (op.i18nPlaceholder !== void 0) {
17740
- if (currentOps === null) {
17741
- throw Error("i18n tag placeholder should only occur inside an i18n block");
17742
- }
17743
- const { startName, closeName } = op.i18nPlaceholder;
17744
- let flags = I18nParamValueFlags.ElementTag | I18nParamValueFlags.OpenTag;
17745
- if (closeName === "") {
17746
- flags |= I18nParamValueFlags.CloseTag;
17747
- }
17748
- addParam(currentOps.i18nContext.params, startName, op.handle.slot, currentOps.i18nBlock.subTemplateIndex, flags);
18007
+ recordElementStart(op, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective);
18008
+ if (pendingStructuralDirective && op.i18nPlaceholder.closeName) {
18009
+ pendingStructuralDirectiveCloses.set(op.xref, pendingStructuralDirective);
17749
18010
  }
17750
- break;
17751
- case OpKind.ElementEnd:
17752
- const startOp = elements.get(op.xref);
17753
- if (startOp && startOp.i18nPlaceholder !== void 0) {
17754
- if (currentOps === null) {
17755
- throw Error("i18n tag placeholder should only occur inside an i18n block");
17756
- }
17757
- const { closeName } = startOp.i18nPlaceholder;
17758
- if (closeName !== "") {
17759
- addParam(currentOps.i18nContext.params, closeName, startOp.handle.slot, currentOps.i18nBlock.subTemplateIndex, I18nParamValueFlags.ElementTag | I18nParamValueFlags.CloseTag);
17760
- }
18011
+ pendingStructuralDirective = void 0;
18012
+ }
18013
+ break;
18014
+ case OpKind.ElementEnd:
18015
+ const startOp = elements.get(op.xref);
18016
+ if (startOp && startOp.i18nPlaceholder !== void 0) {
18017
+ if (currentOps === null) {
18018
+ throw Error("AssertionError: i18n tag placeholder should only occur inside an i18n block");
17761
18019
  }
17762
- break;
17763
- case OpKind.Template:
17764
- if (op.i18nPlaceholder !== void 0) {
17765
- if (currentOps === null) {
17766
- throw Error("i18n tag placeholder should only occur inside an i18n block");
17767
- }
17768
- const subTemplateIndex = getSubTemplateIndexForTemplateTag(job, currentOps.i18nBlock, op);
17769
- addParam(currentOps.i18nContext.params, op.i18nPlaceholder.startName, op.handle.slot, subTemplateIndex, I18nParamValueFlags.TemplateTag);
17770
- addParam(currentOps.i18nContext.params, op.i18nPlaceholder.closeName, op.handle.slot, subTemplateIndex, I18nParamValueFlags.TemplateTag | I18nParamValueFlags.CloseTag);
18020
+ recordElementClose(startOp, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirectiveCloses.get(op.xref));
18021
+ pendingStructuralDirectiveCloses.delete(op.xref);
18022
+ }
18023
+ break;
18024
+ case OpKind.Projection:
18025
+ if (op.i18nPlaceholder !== void 0) {
18026
+ if (currentOps === null) {
18027
+ throw Error("i18n tag placeholder should only occur inside an i18n block");
17771
18028
  }
17772
- break;
17773
- }
18029
+ recordElementStart(op, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective);
18030
+ recordElementClose(op, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective);
18031
+ pendingStructuralDirective = void 0;
18032
+ }
18033
+ break;
18034
+ case OpKind.Template:
18035
+ if (op.i18nPlaceholder === void 0) {
18036
+ resolvePlaceholdersForView(job, job.views.get(op.xref), i18nContexts, elements);
18037
+ } else {
18038
+ if (currentOps === null) {
18039
+ throw Error("i18n tag placeholder should only occur inside an i18n block");
18040
+ }
18041
+ if (op.templateKind === TemplateKind.Structural) {
18042
+ resolvePlaceholdersForView(job, job.views.get(op.xref), i18nContexts, elements, op);
18043
+ } else {
18044
+ recordTemplateStart(job, op, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective);
18045
+ resolvePlaceholdersForView(job, job.views.get(op.xref), i18nContexts, elements);
18046
+ recordTemplateClose(job, op, currentOps.i18nContext, currentOps.i18nBlock, pendingStructuralDirective);
18047
+ pendingStructuralDirective = void 0;
18048
+ }
18049
+ }
18050
+ break;
18051
+ }
18052
+ }
18053
+ }
18054
+ function recordElementStart(op, i18nContext, i18nBlock, structuralDirective) {
18055
+ const { startName, closeName } = op.i18nPlaceholder;
18056
+ let flags = I18nParamValueFlags.ElementTag | I18nParamValueFlags.OpenTag;
18057
+ let value = op.handle.slot;
18058
+ if (structuralDirective !== void 0) {
18059
+ flags |= I18nParamValueFlags.TemplateTag;
18060
+ value = { element: value, template: structuralDirective.handle.slot };
18061
+ }
18062
+ if (!closeName) {
18063
+ flags |= I18nParamValueFlags.CloseTag;
18064
+ }
18065
+ addParam(i18nContext.params, startName, value, i18nBlock.subTemplateIndex, flags);
18066
+ }
18067
+ function recordElementClose(op, i18nContext, i18nBlock, structuralDirective) {
18068
+ const { closeName } = op.i18nPlaceholder;
18069
+ if (closeName) {
18070
+ let flags = I18nParamValueFlags.ElementTag | I18nParamValueFlags.CloseTag;
18071
+ let value = op.handle.slot;
18072
+ if (structuralDirective !== void 0) {
18073
+ flags |= I18nParamValueFlags.TemplateTag;
18074
+ value = { element: value, template: structuralDirective.handle.slot };
18075
+ }
18076
+ addParam(i18nContext.params, closeName, value, i18nBlock.subTemplateIndex, flags);
18077
+ }
18078
+ }
18079
+ function recordTemplateStart(job, op, i18nContext, i18nBlock, structuralDirective) {
18080
+ let { startName, closeName } = op.i18nPlaceholder;
18081
+ let flags = I18nParamValueFlags.TemplateTag | I18nParamValueFlags.OpenTag;
18082
+ if (!closeName) {
18083
+ flags |= I18nParamValueFlags.CloseTag;
18084
+ }
18085
+ if (structuralDirective !== void 0) {
18086
+ addParam(i18nContext.params, startName, structuralDirective.handle.slot, i18nBlock.subTemplateIndex, flags);
18087
+ }
18088
+ addParam(i18nContext.params, startName, op.handle.slot, getSubTemplateIndexForTemplateTag(job, i18nBlock, op), flags);
18089
+ }
18090
+ function recordTemplateClose(job, op, i18nContext, i18nBlock, structuralDirective) {
18091
+ const { startName, closeName } = op.i18nPlaceholder;
18092
+ const flags = I18nParamValueFlags.TemplateTag | I18nParamValueFlags.CloseTag;
18093
+ if (closeName) {
18094
+ addParam(i18nContext.params, closeName, op.handle.slot, getSubTemplateIndexForTemplateTag(job, i18nBlock, op), flags);
18095
+ if (structuralDirective !== void 0) {
18096
+ addParam(i18nContext.params, closeName, structuralDirective.handle.slot, i18nBlock.subTemplateIndex, flags);
17774
18097
  }
17775
18098
  }
17776
18099
  }
@@ -17789,8 +18112,9 @@ function addParam(params, placeholder, value, subTemplateIndex, flags) {
17789
18112
  params.set(placeholder, values);
17790
18113
  }
17791
18114
 
17792
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_i18n_expression_placeholders.mjs
18115
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_i18n_expression_placeholders.mjs
17793
18116
  function resolveI18nExpressionPlaceholders(job) {
18117
+ var _a2;
17794
18118
  const subTemplateIndicies = /* @__PURE__ */ new Map();
17795
18119
  const i18nContexts = /* @__PURE__ */ new Map();
17796
18120
  for (const unit of job.units) {
@@ -17806,12 +18130,13 @@ function resolveI18nExpressionPlaceholders(job) {
17806
18130
  }
17807
18131
  }
17808
18132
  const expressionIndices = /* @__PURE__ */ new Map();
18133
+ const referenceIndex = (op) => op.usage === I18nExpressionFor.I18nText ? op.i18nOwner : op.context;
17809
18134
  for (const unit of job.units) {
17810
18135
  for (const op of unit.update) {
17811
18136
  if (op.kind === OpKind.I18nExpression) {
17812
18137
  const i18nContext = i18nContexts.get(op.context);
17813
- const index = expressionIndices.get(i18nContext.i18nBlock) || 0;
17814
- const subTemplateIndex = subTemplateIndicies.get(i18nContext.i18nBlock);
18138
+ const index = expressionIndices.get(referenceIndex(op)) || 0;
18139
+ const subTemplateIndex = (_a2 = subTemplateIndicies.get(op.i18nOwner)) != null ? _a2 : null;
17815
18140
  const params = op.resolutionTime === I18nParamResolutionTime.Creation ? i18nContext.params : i18nContext.postprocessingParams;
17816
18141
  const values = params.get(op.i18nPlaceholder) || [];
17817
18142
  values.push({
@@ -17820,36 +18145,20 @@ function resolveI18nExpressionPlaceholders(job) {
17820
18145
  flags: I18nParamValueFlags.ExpressionIndex
17821
18146
  });
17822
18147
  params.set(op.i18nPlaceholder, values);
17823
- expressionIndices.set(i18nContext.i18nBlock, index + 1);
18148
+ expressionIndices.set(referenceIndex(op), index + 1);
17824
18149
  }
17825
18150
  }
17826
18151
  }
17827
18152
  }
17828
18153
 
17829
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_i18n_icu_placeholders.mjs
18154
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_i18n_icu_placeholders.mjs
17830
18155
  function resolveI18nIcuPlaceholders(job) {
17831
- const contextOps = /* @__PURE__ */ new Map();
17832
- for (const unit of job.units) {
17833
- for (const op of unit.create) {
17834
- switch (op.kind) {
17835
- case OpKind.I18nContext:
17836
- contextOps.set(op.xref, op);
17837
- break;
17838
- }
17839
- }
17840
- }
17841
18156
  for (const unit of job.units) {
17842
18157
  for (const op of unit.create) {
17843
- switch (op.kind) {
17844
- case OpKind.IcuStart:
17845
- if (op.context === null) {
17846
- throw Error("Icu should have its i18n context set.");
17847
- }
17848
- const i18nContext = contextOps.get(op.context);
17849
- for (const node of op.message.nodes) {
17850
- node.visit(new ResolveIcuPlaceholdersVisitor(i18nContext.postprocessingParams));
17851
- }
17852
- break;
18158
+ if (op.kind === OpKind.I18nContext && op.contextKind === I18nContextKind.Icu) {
18159
+ for (const node of op.message.nodes) {
18160
+ node.visit(new ResolveIcuPlaceholdersVisitor(op.postprocessingParams));
18161
+ }
17853
18162
  }
17854
18163
  }
17855
18164
  }
@@ -17886,7 +18195,7 @@ var ResolveIcuPlaceholdersVisitor = class extends RecurseVisitor {
17886
18195
  }
17887
18196
  };
17888
18197
 
17889
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_names.mjs
18198
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_names.mjs
17890
18199
  function resolveNames(job) {
17891
18200
  for (const unit of job.units) {
17892
18201
  processLexicalScope2(unit, unit.create, null);
@@ -17950,7 +18259,7 @@ function processLexicalScope2(unit, ops, savedView) {
17950
18259
  }
17951
18260
  }
17952
18261
 
17953
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_sanitizers.mjs
18262
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_sanitizers.mjs
17954
18263
  var sanitizers = /* @__PURE__ */ new Map([
17955
18264
  [SecurityContext.HTML, SanitizerFn.Html],
17956
18265
  [SecurityContext.SCRIPT, SanitizerFn.Script],
@@ -17987,7 +18296,7 @@ function isIframeElement(op) {
17987
18296
  return op.kind === OpKind.ElementStart && ((_a2 = op.tag) == null ? void 0 : _a2.toLowerCase()) === "iframe";
17988
18297
  }
17989
18298
 
17990
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/save_restore_view.mjs
18299
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/save_restore_view.mjs
17991
18300
  function saveAndRestoreView(job) {
17992
18301
  for (const unit of job.units) {
17993
18302
  unit.create.prepend([
@@ -18032,7 +18341,7 @@ function addSaveRestoreViewOperationToListener(unit, op) {
18032
18341
  }
18033
18342
  }
18034
18343
 
18035
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/slot_allocation.mjs
18344
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/slot_allocation.mjs
18036
18345
  function allocateSlots(job) {
18037
18346
  const slotMap = /* @__PURE__ */ new Map();
18038
18347
  for (const unit of job.units) {
@@ -18057,7 +18366,7 @@ function allocateSlots(job) {
18057
18366
  }
18058
18367
  }
18059
18368
 
18060
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/style_binding_specialization.mjs
18369
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/style_binding_specialization.mjs
18061
18370
  function specializeStyleBindings(job) {
18062
18371
  for (const unit of job.units) {
18063
18372
  for (const op of unit.update) {
@@ -18087,7 +18396,7 @@ function specializeStyleBindings(job) {
18087
18396
  }
18088
18397
  }
18089
18398
 
18090
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/temporary_variables.mjs
18399
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/temporary_variables.mjs
18091
18400
  function generateTemporaryVariables(job) {
18092
18401
  for (const unit of job.units) {
18093
18402
  unit.create.prepend(generateTemporaries(unit.create));
@@ -18145,7 +18454,7 @@ function assignName(names, expr) {
18145
18454
  expr.name = name;
18146
18455
  }
18147
18456
 
18148
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/track_fn_generation.mjs
18457
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/track_fn_generation.mjs
18149
18458
  function generateTrackFns(job) {
18150
18459
  for (const unit of job.units) {
18151
18460
  for (const op of unit.create) {
@@ -18175,7 +18484,7 @@ function generateTrackFns(job) {
18175
18484
  }
18176
18485
  }
18177
18486
 
18178
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/track_fn_optimization.mjs
18487
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/track_fn_optimization.mjs
18179
18488
  function optimizeTrackFns(job) {
18180
18489
  for (const unit of job.units) {
18181
18490
  for (const op of unit.create) {
@@ -18222,7 +18531,7 @@ function isTrackByFunctionCall(rootView, expr) {
18222
18531
  return true;
18223
18532
  }
18224
18533
 
18225
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/track_variables.mjs
18534
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/track_variables.mjs
18226
18535
  function generateTrackVariables(job) {
18227
18536
  for (const unit of job.units) {
18228
18537
  for (const op of unit.create) {
@@ -18243,7 +18552,7 @@ function generateTrackVariables(job) {
18243
18552
  }
18244
18553
  }
18245
18554
 
18246
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/var_counting.mjs
18555
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/var_counting.mjs
18247
18556
  function countVariables(job) {
18248
18557
  for (const unit of job.units) {
18249
18558
  let varCount = 0;
@@ -18348,7 +18657,7 @@ function isSingletonInterpolation(expr) {
18348
18657
  return true;
18349
18658
  }
18350
18659
 
18351
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/variable_optimization.mjs
18660
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/variable_optimization.mjs
18352
18661
  function optimizeVariables(job) {
18353
18662
  for (const unit of job.units) {
18354
18663
  inlineAlwaysInlineVariables(unit.create);
@@ -18598,7 +18907,7 @@ function allowConservativeInlining(decl, target) {
18598
18907
  }
18599
18908
  }
18600
18909
 
18601
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/wrap_icus.mjs
18910
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/wrap_icus.mjs
18602
18911
  function wrapI18nIcus(job) {
18603
18912
  for (const unit of job.units) {
18604
18913
  let currentI18nOp = null;
@@ -18628,16 +18937,16 @@ function wrapI18nIcus(job) {
18628
18937
  }
18629
18938
  }
18630
18939
 
18631
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/emit.mjs
18940
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/emit.mjs
18632
18941
  var phases = [
18633
18942
  { kind: CompilationJobKind.Tmpl, fn: removeContentSelectors },
18634
18943
  { kind: CompilationJobKind.Host, fn: parseHostStyleProperties },
18635
18944
  { kind: CompilationJobKind.Tmpl, fn: emitNamespaceChanges },
18636
- { kind: CompilationJobKind.Both, fn: specializeStyleBindings },
18637
- { kind: CompilationJobKind.Both, fn: specializeBindings },
18638
18945
  { kind: CompilationJobKind.Tmpl, fn: propagateI18nBlocks },
18639
18946
  { kind: CompilationJobKind.Tmpl, fn: wrapI18nIcus },
18640
18947
  { kind: CompilationJobKind.Tmpl, fn: createI18nContexts },
18948
+ { kind: CompilationJobKind.Both, fn: specializeStyleBindings },
18949
+ { kind: CompilationJobKind.Both, fn: specializeBindings },
18641
18950
  { kind: CompilationJobKind.Both, fn: extractAttributes },
18642
18951
  { kind: CompilationJobKind.Both, fn: parseExtractedStyles },
18643
18952
  { kind: CompilationJobKind.Tmpl, fn: removeEmptyBindings },
@@ -18646,7 +18955,10 @@ var phases = [
18646
18955
  { kind: CompilationJobKind.Tmpl, fn: generateConditionalExpressions },
18647
18956
  { kind: CompilationJobKind.Tmpl, fn: createPipes },
18648
18957
  { kind: CompilationJobKind.Tmpl, fn: configureDeferInstructions },
18649
- { kind: CompilationJobKind.Tmpl, fn: extractI18nText },
18958
+ { kind: CompilationJobKind.Tmpl, fn: convertI18nText },
18959
+ { kind: CompilationJobKind.Tmpl, fn: convertI18nBindings },
18960
+ { kind: CompilationJobKind.Tmpl, fn: removeUnusedI18nAttributesOps },
18961
+ { kind: CompilationJobKind.Tmpl, fn: assignI18nSlotDependencies },
18650
18962
  { kind: CompilationJobKind.Tmpl, fn: applyI18nExpressions },
18651
18963
  { kind: CompilationJobKind.Tmpl, fn: createVariadicPipes },
18652
18964
  { kind: CompilationJobKind.Both, fn: generatePureLiteralStructures },
@@ -18671,13 +18983,11 @@ var phases = [
18671
18983
  { kind: CompilationJobKind.Tmpl, fn: resolveI18nElementPlaceholders },
18672
18984
  { kind: CompilationJobKind.Tmpl, fn: resolveI18nExpressionPlaceholders },
18673
18985
  { kind: CompilationJobKind.Tmpl, fn: resolveI18nIcuPlaceholders },
18674
- { kind: CompilationJobKind.Tmpl, fn: mergeI18nContexts },
18675
18986
  { kind: CompilationJobKind.Tmpl, fn: extractI18nMessages },
18676
18987
  { kind: CompilationJobKind.Tmpl, fn: generateTrackFns },
18677
18988
  { kind: CompilationJobKind.Tmpl, fn: collectI18nConsts },
18678
18989
  { kind: CompilationJobKind.Tmpl, fn: collectConstExpressions },
18679
18990
  { kind: CompilationJobKind.Both, fn: collectElementConsts },
18680
- { kind: CompilationJobKind.Tmpl, fn: assignI18nSlotDependencies },
18681
18991
  { kind: CompilationJobKind.Tmpl, fn: removeI18nContexts },
18682
18992
  { kind: CompilationJobKind.Both, fn: countVariables },
18683
18993
  { kind: CompilationJobKind.Tmpl, fn: generateAdvance },
@@ -18793,7 +19103,7 @@ function emitHostBindingFunction(job) {
18793
19103
  );
18794
19104
  }
18795
19105
 
18796
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/ingest.mjs
19106
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/ingest.mjs
18797
19107
  var compatibilityMode = CompatibilityMode.TemplateDefinitionBuilder;
18798
19108
  function ingestComponent(componentName, template2, constantPool, relativeContextFilePath, i18nUseExternalIds, deferBlocksMeta) {
18799
19109
  const job = new ComponentCompilationJob(componentName, constantPool, compatibilityMode, relativeContextFilePath, i18nUseExternalIds, deferBlocksMeta);
@@ -18818,7 +19128,7 @@ function ingestHostProperty(job, property2, isTextAttribute) {
18818
19128
  let expression;
18819
19129
  const ast = property2.expression.ast;
18820
19130
  if (ast instanceof Interpolation) {
18821
- expression = new Interpolation2(ast.strings, ast.expressions.map((expr) => convertAst(expr, job, property2.sourceSpan)));
19131
+ expression = new Interpolation2(ast.strings, ast.expressions.map((expr) => convertAst(expr, job, property2.sourceSpan)), []);
18822
19132
  } else {
18823
19133
  expression = convertAst(ast, job, property2.sourceSpan);
18824
19134
  }
@@ -18830,7 +19140,7 @@ function ingestHostProperty(job, property2, isTextAttribute) {
18830
19140
  if (property2.isAnimation) {
18831
19141
  bindingKind = BindingKind.Animation;
18832
19142
  }
18833
- job.root.update.push(createBindingOp(job.root.xref, bindingKind, property2.name, expression, null, SecurityContext.NONE, isTextAttribute, false, property2.sourceSpan));
19143
+ job.root.update.push(createBindingOp(job.root.xref, bindingKind, property2.name, expression, null, SecurityContext.NONE, isTextAttribute, false, null, property2.sourceSpan));
18834
19144
  }
18835
19145
  function ingestHostAttribute(job, name, value) {
18836
19146
  const attrBinding = createBindingOp(
@@ -18842,6 +19152,7 @@ function ingestHostAttribute(job, name, value) {
18842
19152
  SecurityContext.NONE,
18843
19153
  true,
18844
19154
  false,
19155
+ null,
18845
19156
  null
18846
19157
  );
18847
19158
  job.root.update.push(attrBinding);
@@ -18911,24 +19222,29 @@ function ingestTemplate(unit, tmpl) {
18911
19222
  const i18nPlaceholder = tmpl.i18n instanceof TagPlaceholder ? tmpl.i18n : void 0;
18912
19223
  const namespace = namespaceForKey(namespacePrefix);
18913
19224
  const functionNameSuffix = tagNameWithoutNamespace === null ? "" : prefixWithNamespace(tagNameWithoutNamespace, namespace);
18914
- const tplOp = createTemplateOp(childView.xref, tagNameWithoutNamespace, functionNameSuffix, namespace, i18nPlaceholder, tmpl.startSourceSpan);
18915
- unit.create.push(tplOp);
18916
- ingestBindings(unit, tplOp, tmpl);
18917
- ingestReferences(tplOp, tmpl);
19225
+ const templateKind = isPlainTemplate(tmpl) ? TemplateKind.NgTemplate : TemplateKind.Structural;
19226
+ const templateOp = createTemplateOp(childView.xref, templateKind, tagNameWithoutNamespace, functionNameSuffix, namespace, i18nPlaceholder, tmpl.startSourceSpan);
19227
+ unit.create.push(templateOp);
19228
+ ingestBindings(unit, templateOp, tmpl);
19229
+ ingestReferences(templateOp, tmpl);
18918
19230
  ingestNodes(childView, tmpl.children);
18919
19231
  for (const { name, value } of tmpl.variables) {
18920
19232
  childView.contextVariables.set(name, value !== "" ? value : "$implicit");
18921
19233
  }
18922
- if (isPlainTemplate(tmpl) && tmpl.i18n instanceof Message) {
19234
+ if (templateKind === TemplateKind.NgTemplate && tmpl.i18n instanceof Message) {
18923
19235
  const id = unit.job.allocateXrefId();
18924
19236
  OpList.insertAfter(createI18nStartOp(id, tmpl.i18n), childView.create.head);
18925
19237
  OpList.insertBefore(createI18nEndOp(id), childView.create.tail);
18926
19238
  }
18927
19239
  }
18928
19240
  function ingestContent(unit, content) {
18929
- const op = createProjectionOp(unit.job.allocateXrefId(), content.selector, content.sourceSpan);
19241
+ if (content.i18n !== void 0 && !(content.i18n instanceof TagPlaceholder)) {
19242
+ throw Error(`Unhandled i18n metadata type for element: ${content.i18n.constructor.name}`);
19243
+ }
19244
+ const attrs = content.attributes.flatMap((a) => [a.name, a.value]);
19245
+ const op = createProjectionOp(unit.job.allocateXrefId(), content.selector, content.i18n, attrs, content.sourceSpan);
18930
19246
  for (const attr of content.attributes) {
18931
- ingestBinding(unit, op.xref, attr.name, literal(attr.value), 1, null, SecurityContext.NONE, attr.sourceSpan, BindingFlags.TextValue);
19247
+ ingestBinding(unit, op.xref, attr.name, literal(attr.value), 1, null, SecurityContext.NONE, attr.sourceSpan, BindingFlags.TextValue, attr.i18n);
18932
19248
  }
18933
19249
  unit.create.push(op);
18934
19250
  }
@@ -18956,9 +19272,10 @@ function ingestBoundText(unit, text2, i18nPlaceholders) {
18956
19272
  const textXref = unit.job.allocateXrefId();
18957
19273
  unit.create.push(createTextOp(textXref, "", text2.sourceSpan));
18958
19274
  const baseSourceSpan = unit.job.compatibility ? null : text2.sourceSpan;
18959
- unit.update.push(createInterpolateTextOp(textXref, new Interpolation2(value.strings, value.expressions.map((expr) => convertAst(expr, unit.job, baseSourceSpan))), i18nPlaceholders, text2.sourceSpan));
19275
+ unit.update.push(createInterpolateTextOp(textXref, new Interpolation2(value.strings, value.expressions.map((expr) => convertAst(expr, unit.job, baseSourceSpan)), i18nPlaceholders), text2.sourceSpan));
18960
19276
  }
18961
19277
  function ingestIfBlock(unit, ifBlock) {
19278
+ var _a2;
18962
19279
  let firstXref = null;
18963
19280
  let firstSlotHandle = null;
18964
19281
  let conditions = [];
@@ -18972,14 +19289,21 @@ function ingestIfBlock(unit, ifBlock) {
18972
19289
  if (ifCase.expressionAlias !== null) {
18973
19290
  cView.contextVariables.set(ifCase.expressionAlias.name, CTX_REF);
18974
19291
  }
18975
- const tmplOp = createTemplateOp(cView.xref, tagName, "Conditional", Namespace.HTML, void 0, ifCase.sourceSpan);
18976
- unit.create.push(tmplOp);
19292
+ let ifCaseI18nMeta = void 0;
19293
+ if (ifCase.i18n !== void 0) {
19294
+ if (!(ifCase.i18n instanceof BlockPlaceholder)) {
19295
+ throw Error(`Unhandled i18n metadata type for if block: ${(_a2 = ifCase.i18n) == null ? void 0 : _a2.constructor.name}`);
19296
+ }
19297
+ ifCaseI18nMeta = ifCase.i18n;
19298
+ }
19299
+ const templateOp = createTemplateOp(cView.xref, TemplateKind.Block, tagName, "Conditional", Namespace.HTML, ifCaseI18nMeta, ifCase.sourceSpan);
19300
+ unit.create.push(templateOp);
18977
19301
  if (firstXref === null) {
18978
19302
  firstXref = cView.xref;
18979
- firstSlotHandle = tmplOp.handle;
19303
+ firstSlotHandle = templateOp.handle;
18980
19304
  }
18981
19305
  const caseExpr = ifCase.expression ? convertAst(ifCase.expression, unit.job, null) : null;
18982
- const conditionalCaseExpr = new ConditionalCaseExpr(caseExpr, tmplOp.xref, tmplOp.handle, ifCase.expressionAlias);
19306
+ const conditionalCaseExpr = new ConditionalCaseExpr(caseExpr, templateOp.xref, templateOp.handle, ifCase.expressionAlias);
18983
19307
  conditions.push(conditionalCaseExpr);
18984
19308
  ingestNodes(cView, ifCase.children);
18985
19309
  }
@@ -18987,19 +19311,27 @@ function ingestIfBlock(unit, ifBlock) {
18987
19311
  unit.update.push(conditional2);
18988
19312
  }
18989
19313
  function ingestSwitchBlock(unit, switchBlock) {
19314
+ var _a2;
18990
19315
  let firstXref = null;
18991
19316
  let firstSlotHandle = null;
18992
19317
  let conditions = [];
18993
19318
  for (const switchCase of switchBlock.cases) {
18994
19319
  const cView = unit.job.allocateView(unit.xref);
18995
- const tmplOp = createTemplateOp(cView.xref, null, "Case", Namespace.HTML, void 0, switchCase.sourceSpan);
18996
- unit.create.push(tmplOp);
19320
+ let switchCaseI18nMeta = void 0;
19321
+ if (switchCase.i18n !== void 0) {
19322
+ if (!(switchCase.i18n instanceof BlockPlaceholder)) {
19323
+ throw Error(`Unhandled i18n metadata type for switch block: ${(_a2 = switchCase.i18n) == null ? void 0 : _a2.constructor.name}`);
19324
+ }
19325
+ switchCaseI18nMeta = switchCase.i18n;
19326
+ }
19327
+ const templateOp = createTemplateOp(cView.xref, TemplateKind.Block, null, "Case", Namespace.HTML, switchCaseI18nMeta, switchCase.sourceSpan);
19328
+ unit.create.push(templateOp);
18997
19329
  if (firstXref === null) {
18998
19330
  firstXref = cView.xref;
18999
- firstSlotHandle = tmplOp.handle;
19331
+ firstSlotHandle = templateOp.handle;
19000
19332
  }
19001
19333
  const caseExpr = switchCase.expression ? convertAst(switchCase.expression, unit.job, switchBlock.startSourceSpan) : null;
19002
- const conditionalCaseExpr = new ConditionalCaseExpr(caseExpr, tmplOp.xref, tmplOp.handle);
19334
+ const conditionalCaseExpr = new ConditionalCaseExpr(caseExpr, templateOp.xref, templateOp.handle);
19003
19335
  conditions.push(conditionalCaseExpr);
19004
19336
  ingestNodes(cView, switchCase.children);
19005
19337
  }
@@ -19012,7 +19344,7 @@ function ingestDeferView(unit, suffix, children, sourceSpan) {
19012
19344
  }
19013
19345
  const secondaryView = unit.job.allocateView(unit.xref);
19014
19346
  ingestNodes(secondaryView, children);
19015
- const templateOp = createTemplateOp(secondaryView.xref, null, `Defer${suffix}`, Namespace.HTML, void 0, sourceSpan);
19347
+ const templateOp = createTemplateOp(secondaryView.xref, TemplateKind.Block, null, `Defer${suffix}`, Namespace.HTML, void 0, sourceSpan);
19016
19348
  unit.create.push(templateOp);
19017
19349
  return templateOp;
19018
19350
  }
@@ -19098,17 +19430,12 @@ function ingestDeferBlock(unit, deferBlock) {
19098
19430
  unit.update.push(deferWhenOps);
19099
19431
  }
19100
19432
  function ingestIcu(unit, icu) {
19101
- var _a2, _b2;
19433
+ var _a2;
19102
19434
  if (icu.i18n instanceof Message && isSingleI18nIcu(icu.i18n)) {
19103
19435
  const xref = unit.job.allocateXrefId();
19104
19436
  const icuNode = icu.i18n.nodes[0];
19105
19437
  unit.create.push(createIcuStartOp(xref, icu.i18n, icuFromI18nMessage(icu.i18n).name, null));
19106
- const expressionPlaceholder = (_a2 = icuNode.expressionPlaceholder) == null ? void 0 : _a2.trimEnd();
19107
- if (expressionPlaceholder === void 0 || icu.vars[expressionPlaceholder] === void 0) {
19108
- throw Error("ICU should have a text binding");
19109
- }
19110
- ingestBoundText(unit, icu.vars[expressionPlaceholder], [expressionPlaceholder]);
19111
- for (const [placeholder, text2] of Object.entries(icu.placeholders)) {
19438
+ for (const [placeholder, text2] of Object.entries(__spreadValues(__spreadValues({}, icu.vars), icu.placeholders))) {
19112
19439
  if (text2 instanceof BoundText) {
19113
19440
  ingestBoundText(unit, text2, [placeholder]);
19114
19441
  } else {
@@ -19117,7 +19444,7 @@ function ingestIcu(unit, icu) {
19117
19444
  }
19118
19445
  unit.create.push(createIcuEndOp(xref));
19119
19446
  } else {
19120
- throw Error(`Unhandled i18n metadata type for ICU: ${(_b2 = icu.i18n) == null ? void 0 : _b2.constructor.name}`);
19447
+ throw Error(`Unhandled i18n metadata type for ICU: ${(_a2 = icu.i18n) == null ? void 0 : _a2.constructor.name}`);
19121
19448
  }
19122
19449
  }
19123
19450
  function ingestForBlock(unit, forBlock) {
@@ -19192,6 +19519,15 @@ function convertAst(ast, job, baseSourceSpan) {
19192
19519
  }
19193
19520
  } else if (ast instanceof LiteralPrimitive) {
19194
19521
  return literal(ast.value, void 0, convertSourceSpan(ast.span, baseSourceSpan));
19522
+ } else if (ast instanceof Unary) {
19523
+ switch (ast.operator) {
19524
+ case "+":
19525
+ return new UnaryOperatorExpr(UnaryOperator.Plus, convertAst(ast.expr, job, baseSourceSpan), void 0, convertSourceSpan(ast.span, baseSourceSpan));
19526
+ case "-":
19527
+ return new UnaryOperatorExpr(UnaryOperator.Minus, convertAst(ast.expr, job, baseSourceSpan), void 0, convertSourceSpan(ast.span, baseSourceSpan));
19528
+ default:
19529
+ throw new Error(`AssertionError: unknown unary operator ${ast.operator}`);
19530
+ }
19195
19531
  } else if (ast instanceof Binary) {
19196
19532
  const operator = BINARY_OPERATORS.get(ast.operation);
19197
19533
  if (operator === void 0) {
@@ -19229,6 +19565,8 @@ function convertAst(ast, job, baseSourceSpan) {
19229
19565
  return new SafeInvokeFunctionExpr(convertAst(ast.receiver, job, baseSourceSpan), ast.args.map((a) => convertAst(a, job, baseSourceSpan)));
19230
19566
  } else if (ast instanceof EmptyExpr) {
19231
19567
  return new EmptyExpr2(convertSourceSpan(ast.span, baseSourceSpan));
19568
+ } else if (ast instanceof PrefixNot) {
19569
+ return not(convertAst(ast.expression, job, baseSourceSpan), convertSourceSpan(ast.span, baseSourceSpan));
19232
19570
  } else {
19233
19571
  throw new Error(`Unhandled expression type "${ast.constructor.name}" in file "${baseSourceSpan == null ? void 0 : baseSourceSpan.start.file.url}"`);
19234
19572
  }
@@ -19239,6 +19577,7 @@ function isPlainTemplate(tmpl) {
19239
19577
  }
19240
19578
  function ingestBindings(unit, op, element2) {
19241
19579
  let flags = BindingFlags.None;
19580
+ let hasI18nAttributes = false;
19242
19581
  if (element2 instanceof Template) {
19243
19582
  flags |= BindingFlags.OnNgTemplateElement;
19244
19583
  if (element2 instanceof Template && isPlainTemplate(element2)) {
@@ -19247,17 +19586,21 @@ function ingestBindings(unit, op, element2) {
19247
19586
  const templateAttrFlags = flags | BindingFlags.BindingTargetsTemplate | BindingFlags.IsStructuralTemplateAttribute;
19248
19587
  for (const attr of element2.templateAttrs) {
19249
19588
  if (attr instanceof TextAttribute) {
19250
- ingestBinding(unit, op.xref, attr.name, literal(attr.value), 1, null, SecurityContext.NONE, attr.sourceSpan, templateAttrFlags | BindingFlags.TextValue);
19589
+ ingestBinding(unit, op.xref, attr.name, literal(attr.value), 1, null, SecurityContext.NONE, attr.sourceSpan, templateAttrFlags | BindingFlags.TextValue, attr.i18n);
19590
+ hasI18nAttributes || (hasI18nAttributes = attr.i18n !== void 0);
19251
19591
  } else {
19252
- ingestBinding(unit, op.xref, attr.name, attr.value, attr.type, attr.unit, attr.securityContext, attr.sourceSpan, templateAttrFlags);
19592
+ ingestBinding(unit, op.xref, attr.name, attr.value, attr.type, attr.unit, attr.securityContext, attr.sourceSpan, templateAttrFlags, attr.i18n);
19593
+ hasI18nAttributes || (hasI18nAttributes = attr.i18n !== void 0);
19253
19594
  }
19254
19595
  }
19255
19596
  }
19256
19597
  for (const attr of element2.attributes) {
19257
- ingestBinding(unit, op.xref, attr.name, literal(attr.value), 1, null, SecurityContext.NONE, attr.sourceSpan, flags | BindingFlags.TextValue);
19598
+ ingestBinding(unit, op.xref, attr.name, literal(attr.value), 1, null, SecurityContext.NONE, attr.sourceSpan, flags | BindingFlags.TextValue, attr.i18n);
19599
+ hasI18nAttributes || (hasI18nAttributes = attr.i18n !== void 0);
19258
19600
  }
19259
19601
  for (const input of element2.inputs) {
19260
- ingestBinding(unit, op.xref, input.name, input.value, input.type, input.unit, input.securityContext, input.sourceSpan, flags);
19602
+ ingestBinding(unit, op.xref, input.name, input.value, input.type, input.unit, input.securityContext, input.sourceSpan, flags, input.i18n);
19603
+ hasI18nAttributes || (hasI18nAttributes = input.i18n !== void 0);
19261
19604
  }
19262
19605
  for (const output of element2.outputs) {
19263
19606
  let listenerOp;
@@ -19267,7 +19610,7 @@ function ingestBindings(unit, op, element2) {
19267
19610
  }
19268
19611
  }
19269
19612
  if (element2 instanceof Template && !isPlainTemplate(element2)) {
19270
- unit.create.push(createExtractedAttributeOp(op.xref, BindingKind.Property, output.name, null));
19613
+ unit.create.push(createExtractedAttributeOp(op.xref, BindingKind.Property, output.name, null, null));
19271
19614
  continue;
19272
19615
  }
19273
19616
  listenerOp = createListenerOp(op.xref, op.handle, output.name, op.tag, output.phase, false, output.sourceSpan);
@@ -19293,6 +19636,9 @@ function ingestBindings(unit, op, element2) {
19293
19636
  listenerOp.handlerOps.push(createStatementOp(new ReturnStatement(returnExpr, returnExpr.sourceSpan)));
19294
19637
  unit.create.push(listenerOp);
19295
19638
  }
19639
+ if (hasI18nAttributes) {
19640
+ unit.create.push(createI18nAttributesOp(unit.job.allocateXrefId(), new SlotHandle(), op.xref));
19641
+ }
19296
19642
  }
19297
19643
  var BINDING_KINDS = /* @__PURE__ */ new Map([
19298
19644
  [0, BindingKind.Property],
@@ -19309,24 +19655,36 @@ var BindingFlags;
19309
19655
  BindingFlags2[BindingFlags2["IsStructuralTemplateAttribute"] = 4] = "IsStructuralTemplateAttribute";
19310
19656
  BindingFlags2[BindingFlags2["OnNgTemplateElement"] = 8] = "OnNgTemplateElement";
19311
19657
  })(BindingFlags || (BindingFlags = {}));
19312
- function ingestBinding(view, xref, name, value, type, unit, securityContext, sourceSpan, flags) {
19658
+ function ingestBinding(view, xref, name, value, type, unit, securityContext, sourceSpan, flags, i18nMeta) {
19313
19659
  if (value instanceof ASTWithSource) {
19314
19660
  value = value.ast;
19315
19661
  }
19662
+ let i18nContext = null;
19663
+ if (i18nMeta !== void 0) {
19664
+ if (!(i18nMeta instanceof Message)) {
19665
+ throw Error(`Unhandled i18n metadata type for binding: ${i18nMeta.constructor.name}`);
19666
+ }
19667
+ i18nContext = view.job.allocateXrefId();
19668
+ view.create.push(createI18nContextOp(I18nContextKind.Attr, i18nContext, null, i18nMeta, null));
19669
+ }
19316
19670
  if (flags & BindingFlags.OnNgTemplateElement && !(flags & BindingFlags.BindingTargetsTemplate) && type === 0) {
19317
- view.create.push(createExtractedAttributeOp(xref, BindingKind.Property, name, null));
19671
+ view.create.push(createExtractedAttributeOp(xref, BindingKind.Property, name, null, i18nContext));
19318
19672
  return;
19319
19673
  }
19320
19674
  let expression;
19321
19675
  if (value instanceof Interpolation) {
19322
- expression = new Interpolation2(value.strings, value.expressions.map((expr) => convertAst(expr, view.job, null)));
19676
+ let i18nPlaceholders = [];
19677
+ if (i18nMeta !== void 0) {
19678
+ i18nPlaceholders = Object.keys(i18nMeta.placeholders);
19679
+ }
19680
+ expression = new Interpolation2(value.strings, value.expressions.map((expr) => convertAst(expr, view.job, null)), i18nPlaceholders);
19323
19681
  } else if (value instanceof AST) {
19324
19682
  expression = convertAst(value, view.job, null);
19325
19683
  } else {
19326
19684
  expression = value;
19327
19685
  }
19328
19686
  const kind = BINDING_KINDS.get(type);
19329
- view.update.push(createBindingOp(xref, kind, name, expression, unit, securityContext, !!(flags & BindingFlags.TextValue), !!(flags & BindingFlags.IsStructuralTemplateAttribute), sourceSpan));
19687
+ view.update.push(createBindingOp(xref, kind, name, expression, unit, securityContext, !!(flags & BindingFlags.TextValue), !!(flags & BindingFlags.IsStructuralTemplateAttribute), i18nContext, sourceSpan));
19330
19688
  }
19331
19689
  function ingestReferences(op, element2) {
19332
19690
  assertIsArray(op.localRefs);
@@ -19366,7 +19724,7 @@ function ingestControlFlowInsertionPoint(unit, xref, node) {
19366
19724
  }
19367
19725
  if (root !== null) {
19368
19726
  for (const attr of root.attributes) {
19369
- ingestBinding(unit, xref, attr.name, literal(attr.value), 1, null, SecurityContext.NONE, attr.sourceSpan, BindingFlags.TextValue);
19727
+ ingestBinding(unit, xref, attr.name, literal(attr.value), 1, null, SecurityContext.NONE, attr.sourceSpan, BindingFlags.TextValue, attr.i18n);
19370
19728
  }
19371
19729
  const tagName = root instanceof Element ? root.name : root.tagName;
19372
19730
  return tagName === "ng-template" ? null : tagName;
@@ -19374,10 +19732,10 @@ function ingestControlFlowInsertionPoint(unit, xref, node) {
19374
19732
  return null;
19375
19733
  }
19376
19734
 
19377
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/switch/index.mjs
19735
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/switch/index.mjs
19378
19736
  var USE_TEMPLATE_PIPELINE = false;
19379
19737
 
19380
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/styling_builder.mjs
19738
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/styling_builder.mjs
19381
19739
  var IMPORTANT_FLAG = "!important";
19382
19740
  var MIN_STYLING_BINDING_SLOTS_REQUIRED = 2;
19383
19741
  var StylingBuilder = class {
@@ -19710,7 +20068,7 @@ function isEmptyExpression(ast) {
19710
20068
  return ast instanceof EmptyExpr;
19711
20069
  }
19712
20070
 
19713
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/ml_parser/html_parser.mjs
20071
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/html_parser.mjs
19714
20072
  var HtmlParser = class extends Parser2 {
19715
20073
  constructor() {
19716
20074
  super(getHtmlTagDefinition);
@@ -19720,7 +20078,7 @@ var HtmlParser = class extends Parser2 {
19720
20078
  }
19721
20079
  };
19722
20080
 
19723
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/ml_parser/html_whitespaces.mjs
20081
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/html_whitespaces.mjs
19724
20082
  var PRESERVE_WS_ATTR_NAME = "ngPreserveWhitespaces";
19725
20083
  var SKIP_WS_TRIM_TAGS = /* @__PURE__ */ new Set(["pre", "template", "textarea", "script", "style"]);
19726
20084
  var WS_CHARS = " \f\n\r \v\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF";
@@ -19786,7 +20144,7 @@ function visitAllWithSiblings(visitor, nodes) {
19786
20144
  return result;
19787
20145
  }
19788
20146
 
19789
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template_parser/binding_parser.mjs
20147
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template_parser/binding_parser.mjs
19790
20148
  var PROPERTY_PARTS_SEPARATOR = ".";
19791
20149
  var ATTRIBUTE_PREFIX = "attr";
19792
20150
  var CLASS_PREFIX = "class";
@@ -20106,7 +20464,7 @@ function moveParseSourceSpan(sourceSpan, absoluteSpan) {
20106
20464
  return new ParseSourceSpan(sourceSpan.start.moveBy(startDiff), sourceSpan.end.moveBy(endDiff), sourceSpan.fullStart.moveBy(startDiff), sourceSpan.details);
20107
20465
  }
20108
20466
 
20109
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/style_url_resolver.mjs
20467
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/style_url_resolver.mjs
20110
20468
  function isStyleUrlResolvable(url) {
20111
20469
  if (url == null || url.length === 0 || url[0] == "/")
20112
20470
  return false;
@@ -20115,7 +20473,7 @@ function isStyleUrlResolvable(url) {
20115
20473
  }
20116
20474
  var URL_WITH_SCHEMA_REGEXP = /^([^:/?#]+):/;
20117
20475
 
20118
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template_parser/template_preparser.mjs
20476
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template_parser/template_preparser.mjs
20119
20477
  var NG_CONTENT_SELECT_ATTR = "select";
20120
20478
  var LINK_ELEMENT = "link";
20121
20479
  var LINK_STYLE_REL_ATTR = "rel";
@@ -20185,7 +20543,7 @@ function normalizeNgContentSelect(selectAttr) {
20185
20543
  return selectAttr;
20186
20544
  }
20187
20545
 
20188
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/r3_control_flow.mjs
20546
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_control_flow.mjs
20189
20547
  var FOR_LOOP_EXPRESSION_PATTERN = /^\s*([0-9A-Za-z_$]*)\s+of\s+([\S\s]*)/;
20190
20548
  var FOR_LOOP_TRACK_PATTERN = /^track\s+([\S\s]*)/;
20191
20549
  var CONDITIONAL_ALIAS_PATTERN = /^as\s+(.*)/;
@@ -20476,7 +20834,7 @@ function stripOptionalParentheses(param, errors) {
20476
20834
  return expression.slice(start, end);
20477
20835
  }
20478
20836
 
20479
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/r3_deferred_triggers.mjs
20837
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_deferred_triggers.mjs
20480
20838
  var TIME_PATTERN = /^\d+\.?\d*(ms|s)?$/;
20481
20839
  var SEPARATOR_PATTERN = /^\s$/;
20482
20840
  var COMMA_DELIMITED_SYNTAX = /* @__PURE__ */ new Map([
@@ -20740,7 +21098,7 @@ function parseDeferredTime(value) {
20740
21098
  return parseFloat(time) * (units === "s" ? 1e3 : 1);
20741
21099
  }
20742
21100
 
20743
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/r3_deferred_blocks.mjs
21101
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_deferred_blocks.mjs
20744
21102
  var PREFETCH_WHEN_PATTERN = /^prefetch\s+when\s/;
20745
21103
  var PREFETCH_ON_PATTERN = /^prefetch\s+on\s/;
20746
21104
  var MINIMUM_PARAMETER_PATTERN = /^minimum\s/;
@@ -20875,7 +21233,7 @@ function parsePrimaryTriggers(params, bindingParser, errors, placeholder) {
20875
21233
  return { triggers, prefetchTriggers };
20876
21234
  }
20877
21235
 
20878
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/r3_template_transform.mjs
21236
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_template_transform.mjs
20879
21237
  var BIND_NAME_REGEXP = /^(?:(bind-)|(let-)|(ref-|#)|(on-)|(bindon-)|(@))(.*)$/;
20880
21238
  var KW_BIND_IDX = 1;
20881
21239
  var KW_LET_IDX = 2;
@@ -21306,7 +21664,7 @@ function textContents(node) {
21306
21664
  }
21307
21665
  }
21308
21666
 
21309
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/i18n/context.mjs
21667
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/i18n/context.mjs
21310
21668
  var TagType;
21311
21669
  (function(TagType2) {
21312
21670
  TagType2[TagType2["ELEMENT"] = 0] = "ELEMENT";
@@ -21451,7 +21809,7 @@ function serializePlaceholderValue(value) {
21451
21809
  }
21452
21810
  }
21453
21811
 
21454
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/template.mjs
21812
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/template.mjs
21455
21813
  var NG_CONTENT_SELECT_ATTR2 = "select";
21456
21814
  var NG_PROJECT_AS_ATTR_NAME = "ngProjectAs";
21457
21815
  var EVENT_BINDING_SCOPE_GLOBALS = /* @__PURE__ */ new Set(["$event"]);
@@ -22911,21 +23269,6 @@ var TrackByBindingScope = class extends BindingScope {
22911
23269
  return this.componentAccessCount;
22912
23270
  }
22913
23271
  };
22914
- function createCssSelector(elementName, attributes) {
22915
- const cssSelector = new CssSelector();
22916
- const elementNameNoNs = splitNsName(elementName)[1];
22917
- cssSelector.setElement(elementNameNoNs);
22918
- Object.getOwnPropertyNames(attributes).forEach((name) => {
22919
- const nameNoNs = splitNsName(name)[1];
22920
- const value = attributes[name];
22921
- cssSelector.addAttribute(nameNoNs, value);
22922
- if (name.toLowerCase() === "class") {
22923
- const classes = value.trim().split(/\s+/);
22924
- classes.forEach((className) => cssSelector.addClassName(className));
22925
- }
22926
- });
22927
- return cssSelector;
22928
- }
22929
23272
  function getNgProjectAsLiteral(attribute2) {
22930
23273
  const parsedR3Selector = parseSelectorToR3Selector(attribute2.value)[0];
22931
23274
  return [literal(5), asLiteral(parsedR3Selector)];
@@ -23143,7 +23486,7 @@ function createClosureModeGuard2() {
23143
23486
  return typeofExpr(variable(NG_I18N_CLOSURE_MODE2)).notIdentical(literal("undefined", STRING_TYPE)).and(variable(NG_I18N_CLOSURE_MODE2));
23144
23487
  }
23145
23488
 
23146
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/compiler.mjs
23489
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/compiler.mjs
23147
23490
  var ATTR_REGEX = /attr\.([^\]]+)/;
23148
23491
  var COMPONENT_VARIABLE = "%COMP%";
23149
23492
  var HOST_ATTR = `_nghost-${COMPONENT_VARIABLE}`;
@@ -23194,6 +23537,9 @@ function addFeatures(definitionMap, meta) {
23194
23537
  break;
23195
23538
  }
23196
23539
  }
23540
+ if ((_a2 = meta.hostDirectives) == null ? void 0 : _a2.length) {
23541
+ features.push(importExpr(Identifiers.HostDirectivesFeature).callFn([createHostDirectivesFeatureArg(meta.hostDirectives)]));
23542
+ }
23197
23543
  if (meta.usesInheritance) {
23198
23544
  features.push(importExpr(Identifiers.InheritDefinitionFeature));
23199
23545
  }
@@ -23206,9 +23552,6 @@ function addFeatures(definitionMap, meta) {
23206
23552
  if (meta.hasOwnProperty("template") && meta.isStandalone) {
23207
23553
  features.push(importExpr(Identifiers.StandaloneFeature));
23208
23554
  }
23209
- if ((_a2 = meta.hostDirectives) == null ? void 0 : _a2.length) {
23210
- features.push(importExpr(Identifiers.HostDirectivesFeature).callFn([createHostDirectivesFeatureArg(meta.hostDirectives)]));
23211
- }
23212
23555
  if (features.length) {
23213
23556
  definitionMap.set("features", literalArr(features));
23214
23557
  }
@@ -23476,6 +23819,8 @@ function createHostBindingsFunction(hostBindingsMetadata, typeSourceSpan, bindin
23476
23819
  }
23477
23820
  return emitHostBindingFunction(hostJob);
23478
23821
  }
23822
+ let bindingId = 0;
23823
+ const getNextBindingId = () => `${bindingId++}`;
23479
23824
  const bindingContext = variable(CONTEXT_NAME);
23480
23825
  const styleBuilder = new StylingBuilder(bindingContext);
23481
23826
  const { styleAttr, classAttr } = hostBindingsMetadata.specialAttributes;
@@ -23525,7 +23870,7 @@ function createHostBindingsFunction(hostBindingsMetadata, typeSourceSpan, bindin
23525
23870
  const syntheticHostBindings = [];
23526
23871
  for (const binding of allOtherBindings) {
23527
23872
  const value = binding.expression.visit(getValueConverter());
23528
- const bindingExpr = bindingFn(bindingContext, value);
23873
+ const bindingExpr = bindingFn(bindingContext, value, getNextBindingId);
23529
23874
  const { bindingName, instruction, isAttribute } = getBindingNameAndInstruction(binding);
23530
23875
  const securityContexts = bindingParser.calcPossibleSecurityContexts(selector, bindingName, isAttribute).filter((context) => context !== SecurityContext.NONE);
23531
23876
  let sanitizerFn = null;
@@ -23570,9 +23915,11 @@ function createHostBindingsFunction(hostBindingsMetadata, typeSourceSpan, bindin
23570
23915
  styleBuilder.buildUpdateLevelInstructions(getValueConverter()).forEach((instruction) => {
23571
23916
  for (const call2 of instruction.calls) {
23572
23917
  totalHostVarsCount += Math.max(call2.allocateBindingSlots - MIN_STYLING_BINDING_SLOTS_REQUIRED, 0);
23918
+ const { params, stmts } = convertStylingCall(call2, bindingContext, bindingFn, getNextBindingId);
23919
+ updateVariables.push(...stmts);
23573
23920
  updateInstructions.push({
23574
23921
  reference: instruction.reference,
23575
- paramsOrFn: convertStylingCall(call2, bindingContext, bindingFn),
23922
+ paramsOrFn: params,
23576
23923
  span: null
23577
23924
  });
23578
23925
  }
@@ -23594,11 +23941,19 @@ function createHostBindingsFunction(hostBindingsMetadata, typeSourceSpan, bindin
23594
23941
  }
23595
23942
  return null;
23596
23943
  }
23597
- function bindingFn(implicit, value) {
23598
- return convertPropertyBinding(null, implicit, value, "b");
23944
+ function bindingFn(implicit, value, getNextBindingIdFn) {
23945
+ return convertPropertyBinding(null, implicit, value, getNextBindingIdFn());
23599
23946
  }
23600
- function convertStylingCall(call2, bindingContext, bindingFn2) {
23601
- return call2.params((value) => bindingFn2(bindingContext, value).currValExpr);
23947
+ function convertStylingCall(call2, bindingContext, bindingFn2, getNextBindingIdFn) {
23948
+ const stmts = [];
23949
+ const params = call2.params((value) => {
23950
+ const result = bindingFn2(bindingContext, value, getNextBindingIdFn);
23951
+ if (Array.isArray(result.stmts) && result.stmts.length > 0) {
23952
+ stmts.push(...result.stmts);
23953
+ }
23954
+ return result.currValExpr;
23955
+ });
23956
+ return { params, stmts };
23602
23957
  }
23603
23958
  function getBindingNameAndInstruction(binding) {
23604
23959
  let bindingName = binding.name;
@@ -23745,7 +24100,7 @@ function createHostDirectivesMappingArray(mapping) {
23745
24100
  return elements.length > 0 ? literalArr(elements) : null;
23746
24101
  }
23747
24102
 
23748
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/t2_binder.mjs
24103
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/t2_binder.mjs
23749
24104
  var R3TargetBinder = class {
23750
24105
  constructor(directiveMatcher) {
23751
24106
  this.directiveMatcher = directiveMatcher;
@@ -23913,13 +24268,13 @@ var DirectiveBinder = class {
23913
24268
  template2.forEach((node) => node.visit(this));
23914
24269
  }
23915
24270
  visitElement(element2) {
23916
- this.visitElementOrTemplate(element2.name, element2);
24271
+ this.visitElementOrTemplate(element2);
23917
24272
  }
23918
24273
  visitTemplate(template2) {
23919
- this.visitElementOrTemplate("ng-template", template2);
24274
+ this.visitElementOrTemplate(template2);
23920
24275
  }
23921
- visitElementOrTemplate(elementName, node) {
23922
- const cssSelector = createCssSelector(elementName, getAttrsForDirectiveMatching(node));
24276
+ visitElementOrTemplate(node) {
24277
+ const cssSelector = createCssSelectorFromNode(node);
23923
24278
  const directives = [];
23924
24279
  this.matcher.match(cssSelector, (_selector, results) => directives.push(...results));
23925
24280
  if (directives.length > 0) {
@@ -24350,11 +24705,11 @@ function extractScopedNodeEntities(rootScope) {
24350
24705
  return templateEntities;
24351
24706
  }
24352
24707
 
24353
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/resource_loader.mjs
24708
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/resource_loader.mjs
24354
24709
  var ResourceLoader = class {
24355
24710
  };
24356
24711
 
24357
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/jit_compiler_facade.mjs
24712
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/jit_compiler_facade.mjs
24358
24713
  var CompilerFacadeImpl = class {
24359
24714
  constructor(jitEvaluator = new JitEvaluator()) {
24360
24715
  this.jitEvaluator = jitEvaluator;
@@ -24906,17 +25261,17 @@ function publishFacade(global) {
24906
25261
  ng.\u0275compilerFacade = new CompilerFacadeImpl();
24907
25262
  }
24908
25263
 
24909
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/version.mjs
24910
- var VERSION2 = new Version("17.1.0-next.1");
25264
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/version.mjs
25265
+ var VERSION2 = new Version("17.1.0-next.3");
24911
25266
 
24912
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/i18n/extractor_merger.mjs
25267
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/extractor_merger.mjs
24913
25268
  var _VisitorMode;
24914
25269
  (function(_VisitorMode2) {
24915
25270
  _VisitorMode2[_VisitorMode2["Extract"] = 0] = "Extract";
24916
25271
  _VisitorMode2[_VisitorMode2["Merge"] = 1] = "Merge";
24917
25272
  })(_VisitorMode || (_VisitorMode = {}));
24918
25273
 
24919
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/ml_parser/xml_tags.mjs
25274
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/xml_tags.mjs
24920
25275
  var XmlTagDefinition = class {
24921
25276
  constructor() {
24922
25277
  this.closedByParent = false;
@@ -24938,7 +25293,7 @@ var XmlTagDefinition = class {
24938
25293
  };
24939
25294
  var _TAG_DEFINITION = new XmlTagDefinition();
24940
25295
 
24941
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/partial/api.mjs
25296
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/partial/api.mjs
24942
25297
  var FactoryTarget2;
24943
25298
  (function(FactoryTarget3) {
24944
25299
  FactoryTarget3[FactoryTarget3["Directive"] = 0] = "Directive";
@@ -24948,13 +25303,14 @@ var FactoryTarget2;
24948
25303
  FactoryTarget3[FactoryTarget3["NgModule"] = 4] = "NgModule";
24949
25304
  })(FactoryTarget2 || (FactoryTarget2 = {}));
24950
25305
 
24951
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/compiler.mjs
25306
+ // bazel-out/darwin-fastbuild/bin/packages/compiler/src/compiler.mjs
24952
25307
  publishFacade(_global);
24953
25308
 
24954
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/types.mjs
25309
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/types.mjs
24955
25310
  var ngtemplate = "ng-template";
24956
25311
  var boundngifelse = "[ngIfElse]";
24957
25312
  var boundngifthenelse = "[ngIfThenElse]";
25313
+ var boundngifthen = "[ngIfThen]";
24958
25314
  var nakedngfor = "ngFor";
24959
25315
  function allFormsOf(selector) {
24960
25316
  return [
@@ -24997,12 +25353,13 @@ var commonModulePipes = [
24997
25353
  "titlecase"
24998
25354
  ].map((name) => pipeMatchRegExpFor(name));
24999
25355
  var ElementToMigrate = class {
25000
- constructor(el, attr, elseAttr = void 0, thenAttr = void 0, forAttrs = void 0) {
25356
+ constructor(el, attr, elseAttr = void 0, thenAttr = void 0, forAttrs = void 0, aliasAttrs = void 0) {
25001
25357
  __publicField(this, "el");
25002
25358
  __publicField(this, "attr");
25003
25359
  __publicField(this, "elseAttr");
25004
25360
  __publicField(this, "thenAttr");
25005
25361
  __publicField(this, "forAttrs");
25362
+ __publicField(this, "aliasAttrs");
25006
25363
  __publicField(this, "nestCount", 0);
25007
25364
  __publicField(this, "hasLineBreaks", false);
25008
25365
  this.el = el;
@@ -25010,18 +25367,50 @@ var ElementToMigrate = class {
25010
25367
  this.elseAttr = elseAttr;
25011
25368
  this.thenAttr = thenAttr;
25012
25369
  this.forAttrs = forAttrs;
25370
+ this.aliasAttrs = aliasAttrs;
25013
25371
  }
25014
- getCondition(targetStr) {
25015
- const targetLocation = this.attr.value.indexOf(targetStr);
25016
- return this.attr.value.slice(0, targetLocation);
25372
+ getCondition() {
25373
+ const chunks = this.attr.value.split(";");
25374
+ let condition = chunks[0];
25375
+ const elseIx = condition.indexOf(" else ");
25376
+ const thenIx = condition.indexOf(" then ");
25377
+ if (thenIx > -1) {
25378
+ condition = condition.slice(0, thenIx);
25379
+ } else if (elseIx > -1) {
25380
+ condition = condition.slice(0, elseIx);
25381
+ }
25382
+ let letVar = chunks.find((c) => c.search(/\s*let\s/) > -1);
25383
+ return condition + (letVar ? ";" + letVar : "");
25017
25384
  }
25018
25385
  getTemplateName(targetStr, secondStr) {
25019
25386
  const targetLocation = this.attr.value.indexOf(targetStr);
25020
- if (secondStr) {
25021
- const secondTargetLocation = this.attr.value.indexOf(secondStr);
25022
- return this.attr.value.slice(targetLocation + targetStr.length, secondTargetLocation).trim();
25387
+ const secondTargetLocation = secondStr ? this.attr.value.indexOf(secondStr) : void 0;
25388
+ let templateName = this.attr.value.slice(targetLocation + targetStr.length, secondTargetLocation);
25389
+ if (templateName.startsWith(":")) {
25390
+ templateName = templateName.slice(1).trim();
25023
25391
  }
25024
- return this.attr.value.slice(targetLocation + targetStr.length).trim();
25392
+ return templateName.split(";")[0].trim();
25393
+ }
25394
+ getValueEnd(offset) {
25395
+ return (this.attr.valueSpan ? this.attr.valueSpan.end.offset + 1 : this.attr.keySpan.end.offset) - offset;
25396
+ }
25397
+ hasChildren() {
25398
+ return this.el.children.length > 0;
25399
+ }
25400
+ getChildSpan(offset) {
25401
+ const childStart = this.el.children[0].sourceSpan.start.offset - offset;
25402
+ const childEnd = this.el.children[this.el.children.length - 1].sourceSpan.end.offset - offset;
25403
+ return { childStart, childEnd };
25404
+ }
25405
+ shouldRemoveElseAttr() {
25406
+ return (this.el.name === "ng-template" || this.el.name === "ng-container") && this.elseAttr !== void 0;
25407
+ }
25408
+ getElseAttrStr() {
25409
+ if (this.elseAttr !== void 0) {
25410
+ const elseValStr = this.elseAttr.value !== "" ? `="${this.elseAttr.value}"` : "";
25411
+ return `${this.elseAttr.name}${elseValStr}`;
25412
+ }
25413
+ return "";
25025
25414
  }
25026
25415
  start(offset) {
25027
25416
  var _a2;
@@ -25037,17 +25426,34 @@ var ElementToMigrate = class {
25037
25426
  }
25038
25427
  };
25039
25428
  var Template2 = class {
25040
- constructor(el, i18n2) {
25429
+ constructor(el, name, i18n2) {
25041
25430
  __publicField(this, "el");
25431
+ __publicField(this, "name");
25042
25432
  __publicField(this, "count", 0);
25043
25433
  __publicField(this, "contents", "");
25044
25434
  __publicField(this, "children", "");
25045
25435
  __publicField(this, "i18n", null);
25436
+ __publicField(this, "attributes");
25046
25437
  this.el = el;
25438
+ this.name = name;
25439
+ this.attributes = el.attrs;
25047
25440
  this.i18n = i18n2;
25048
25441
  }
25442
+ get isNgTemplateOutlet() {
25443
+ return this.attributes.find((attr) => attr.name === "*ngTemplateOutlet") !== void 0;
25444
+ }
25445
+ get outletContext() {
25446
+ const letVar = this.attributes.find((attr) => attr.name.startsWith("let-"));
25447
+ return letVar ? `; context: {$implicit: ${letVar.name.split("-")[1]}}` : "";
25448
+ }
25449
+ generateTemplateOutlet() {
25450
+ var _a2;
25451
+ const attr = this.attributes.find((attr2) => attr2.name === "*ngTemplateOutlet");
25452
+ const outletValue = (_a2 = attr == null ? void 0 : attr.value) != null ? _a2 : this.name.slice(1);
25453
+ return `<ng-container *ngTemplateOutlet="${outletValue}${this.outletContext}"></ng-container>`;
25454
+ }
25049
25455
  generateContents(tmpl) {
25050
- this.contents = tmpl.slice(this.el.sourceSpan.start.offset, this.el.sourceSpan.end.offset + 1);
25456
+ this.contents = tmpl.slice(this.el.sourceSpan.start.offset, this.el.sourceSpan.end.offset);
25051
25457
  this.children = "";
25052
25458
  if (this.el.children.length > 0) {
25053
25459
  this.children = tmpl.slice(this.el.children[0].sourceSpan.start.offset, this.el.children[this.el.children.length - 1].sourceSpan.end.offset);
@@ -25058,16 +25464,18 @@ var AnalyzedFile = class {
25058
25464
  constructor() {
25059
25465
  __publicField(this, "ranges", []);
25060
25466
  __publicField(this, "removeCommonModule", false);
25467
+ __publicField(this, "sourceFilePath", "");
25061
25468
  }
25062
25469
  getSortedRanges() {
25063
- const templateRanges = this.ranges.slice().filter((x) => x.type === "template").sort((aStart, bStart) => bStart.start - aStart.start);
25470
+ const templateRanges = this.ranges.slice().filter((x) => x.type !== "import").sort((aStart, bStart) => bStart.start - aStart.start);
25064
25471
  const importRanges = this.ranges.slice().filter((x) => x.type === "import").sort((aStart, bStart) => bStart.start - aStart.start);
25065
25472
  return [...templateRanges, ...importRanges];
25066
25473
  }
25067
- static addRange(path2, analyzedFiles, range) {
25474
+ static addRange(path2, sourceFilePath, analyzedFiles, range) {
25068
25475
  let analysis = analyzedFiles.get(path2);
25069
25476
  if (!analysis) {
25070
25477
  analysis = new AnalyzedFile();
25478
+ analysis.sourceFilePath = sourceFilePath;
25071
25479
  analyzedFiles.set(path2, analysis);
25072
25480
  }
25073
25481
  const duplicate = analysis.ranges.find((current) => current.start === range.start && current.end === range.end);
@@ -25115,17 +25523,16 @@ var ElementCollector = class extends RecursiveVisitor {
25115
25523
  for (const attr of el.attrs) {
25116
25524
  if (this._attributes.includes(attr.name)) {
25117
25525
  const elseAttr = el.attrs.find((x) => x.name === boundngifelse);
25118
- const thenAttr = el.attrs.find((x) => x.name === boundngifthenelse);
25526
+ const thenAttr = el.attrs.find((x) => x.name === boundngifthenelse || x.name === boundngifthen);
25119
25527
  const forAttrs = attr.name === nakedngfor ? this.getForAttrs(el) : void 0;
25120
- this.elements.push(new ElementToMigrate(el, attr, elseAttr, thenAttr, forAttrs));
25528
+ const aliasAttrs = this.getAliasAttrs(el);
25529
+ this.elements.push(new ElementToMigrate(el, attr, elseAttr, thenAttr, forAttrs, aliasAttrs));
25121
25530
  }
25122
25531
  }
25123
25532
  }
25124
25533
  super.visitElement(el, null);
25125
25534
  }
25126
25535
  getForAttrs(el) {
25127
- const aliases = /* @__PURE__ */ new Map();
25128
- let item = "";
25129
25536
  let trackBy = "";
25130
25537
  let forOf = "";
25131
25538
  for (const attr of el.attrs) {
@@ -25135,6 +25542,13 @@ var ElementCollector = class extends RecursiveVisitor {
25135
25542
  if (attr.name === "[ngForOf]") {
25136
25543
  forOf = attr.value;
25137
25544
  }
25545
+ }
25546
+ return { forOf, trackBy };
25547
+ }
25548
+ getAliasAttrs(el) {
25549
+ const aliases = /* @__PURE__ */ new Map();
25550
+ let item = "";
25551
+ for (const attr of el.attrs) {
25138
25552
  if (attr.name.startsWith("let-")) {
25139
25553
  if (attr.value === "") {
25140
25554
  item = attr.name.replace("let-", "");
@@ -25143,7 +25557,7 @@ var ElementCollector = class extends RecursiveVisitor {
25143
25557
  }
25144
25558
  }
25145
25559
  }
25146
- return { forOf, trackBy, item, aliases };
25560
+ return { item, aliases };
25147
25561
  }
25148
25562
  };
25149
25563
  var TemplateCollector = class extends RecursiveVisitor {
@@ -25164,16 +25578,18 @@ var TemplateCollector = class extends RecursiveVisitor {
25164
25578
  templateAttr = attr;
25165
25579
  }
25166
25580
  }
25167
- if (templateAttr !== null) {
25581
+ if (templateAttr !== null && !this.templates.has(templateAttr.name)) {
25582
+ this.templates.set(templateAttr.name, new Template2(el, templateAttr.name, i18n2));
25168
25583
  this.elements.push(new ElementToMigrate(el, templateAttr));
25169
- this.templates.set(templateAttr.name, new Template2(el, i18n2));
25584
+ } else if (templateAttr !== null) {
25585
+ throw new Error(`A duplicate ng-template name "${templateAttr.name}" was found. The control flow migration requires unique ng-template names within a component.`);
25170
25586
  }
25171
25587
  }
25172
25588
  super.visitElement(el, null);
25173
25589
  }
25174
25590
  };
25175
25591
 
25176
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/util.mjs
25592
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/util.mjs
25177
25593
  var import_path2 = require("path");
25178
25594
  var import_typescript5 = __toESM(require("typescript"), 1);
25179
25595
  var importRemovals = [
@@ -25229,6 +25645,9 @@ function updateClassImports(propAssignment, removeCommonModule) {
25229
25645
  const importList = propAssignment.initializer;
25230
25646
  const removals = removeCommonModule ? importWithCommonRemovals : importRemovals;
25231
25647
  const elements = importList.elements.filter((el) => !removals.includes(el.getText()));
25648
+ if (elements.length === importList.elements.length) {
25649
+ return null;
25650
+ }
25232
25651
  const updatedElements = import_typescript5.default.factory.updateArrayLiteralExpression(importList, elements);
25233
25652
  const updatedAssignment = import_typescript5.default.factory.updatePropertyAssignment(propAssignment, propAssignment.name, updatedElements);
25234
25653
  return printer.printNode(import_typescript5.default.EmitHint.Unspecified, updatedAssignment, updatedAssignment.getSourceFile());
@@ -25241,7 +25660,7 @@ function analyzeImportDeclarations(node, sourceFile, analyzedFiles) {
25241
25660
  if (clause.namedBindings && import_typescript5.default.isNamedImports(clause.namedBindings)) {
25242
25661
  const elements = clause.namedBindings.elements.filter((el) => importWithCommonRemovals.includes(el.getText()));
25243
25662
  if (elements.length > 0) {
25244
- AnalyzedFile.addRange(sourceFile.fileName, analyzedFiles, { start: node.getStart(), end: node.getEnd(), node, type: "import" });
25663
+ AnalyzedFile.addRange(sourceFile.fileName, sourceFile.fileName, analyzedFiles, { start: node.getStart(), end: node.getEnd(), node, type: "import" });
25245
25664
  }
25246
25665
  }
25247
25666
  }
@@ -25260,7 +25679,7 @@ function analyzeDecorators(node, sourceFile, analyzedFiles) {
25260
25679
  }
25261
25680
  switch (prop.name.text) {
25262
25681
  case "template":
25263
- AnalyzedFile.addRange(sourceFile.fileName, analyzedFiles, {
25682
+ AnalyzedFile.addRange(sourceFile.fileName, sourceFile.fileName, analyzedFiles, {
25264
25683
  start: prop.initializer.getStart() + 1,
25265
25684
  end: prop.initializer.getEnd() - 1,
25266
25685
  node: prop,
@@ -25268,7 +25687,7 @@ function analyzeDecorators(node, sourceFile, analyzedFiles) {
25268
25687
  });
25269
25688
  break;
25270
25689
  case "imports":
25271
- AnalyzedFile.addRange(sourceFile.fileName, analyzedFiles, {
25690
+ AnalyzedFile.addRange(sourceFile.fileName, sourceFile.fileName, analyzedFiles, {
25272
25691
  start: prop.name.getStart(),
25273
25692
  end: prop.initializer.getEnd(),
25274
25693
  node: prop,
@@ -25278,7 +25697,7 @@ function analyzeDecorators(node, sourceFile, analyzedFiles) {
25278
25697
  case "templateUrl":
25279
25698
  if (import_typescript5.default.isStringLiteralLike(prop.initializer)) {
25280
25699
  const path2 = (0, import_path2.join)((0, import_path2.dirname)(sourceFile.fileName), prop.initializer.text);
25281
- AnalyzedFile.addRange(path2, analyzedFiles, { start: 0, node: prop, type: "template" });
25700
+ AnalyzedFile.addRange(path2, sourceFile.fileName, analyzedFiles, { start: 0, node: prop, type: "templateUrl" });
25282
25701
  }
25283
25702
  break;
25284
25703
  }
@@ -25344,7 +25763,7 @@ function reduceNestingOffset(el, nestLevel, offset, postOffsets) {
25344
25763
  }
25345
25764
  return offset;
25346
25765
  }
25347
- function countTemplateUsage(template2) {
25766
+ function getTemplates(template2) {
25348
25767
  var _a2;
25349
25768
  const parsed = parseTemplate2(template2);
25350
25769
  if (parsed !== null) {
@@ -25352,7 +25771,7 @@ function countTemplateUsage(template2) {
25352
25771
  visitAll2(visitor, parsed.rootNodes);
25353
25772
  for (let [key, tmpl] of visitor.templates) {
25354
25773
  const escapeKey = escapeRegExp(key.slice(1));
25355
- const regex = new RegExp(`[^a-zA-Z0-9-<]${escapeKey}\\W`, "gm");
25774
+ const regex = new RegExp(`[^a-zA-Z0-9-<(']${escapeKey}\\W`, "gm");
25356
25775
  const matches = template2.match(regex);
25357
25776
  tmpl.count = (_a2 = matches == null ? void 0 : matches.length) != null ? _a2 : 0;
25358
25777
  tmpl.generateContents(template2);
@@ -25361,28 +25780,68 @@ function countTemplateUsage(template2) {
25361
25780
  }
25362
25781
  return /* @__PURE__ */ new Map();
25363
25782
  }
25783
+ function updateTemplates(template2, templates) {
25784
+ const updatedTemplates = getTemplates(template2);
25785
+ for (let [key, tmpl] of updatedTemplates) {
25786
+ templates.set(key, tmpl);
25787
+ }
25788
+ return templates;
25789
+ }
25364
25790
  function wrapIntoI18nContainer(i18nAttr, content) {
25791
+ const { start, middle, end } = generatei18nContainer(i18nAttr, content);
25792
+ return `${start}${middle}${end}`;
25793
+ }
25794
+ function generatei18nContainer(i18nAttr, middle) {
25365
25795
  const i18n2 = i18nAttr.value === "" ? "i18n" : `i18n="${i18nAttr.value}"`;
25366
- return `<ng-container ${i18n2}>${content}</ng-container>`;
25796
+ return { start: `<ng-container ${i18n2}>`, middle, end: `</ng-container>` };
25367
25797
  }
25368
25798
  function processNgTemplates(template2) {
25369
- const templates = countTemplateUsage(template2);
25370
- for (const [name, t] of templates) {
25371
- const replaceRegex = new RegExp(`${name}\\|`, "g");
25372
- const matches = [...template2.matchAll(replaceRegex)];
25373
- if (matches.length > 0) {
25374
- if (t.i18n !== null) {
25375
- const container = wrapIntoI18nContainer(t.i18n, t.children);
25376
- template2 = template2.replace(replaceRegex, container);
25377
- } else {
25378
- template2 = template2.replace(replaceRegex, t.children);
25379
- }
25380
- if (t.count === matches.length + 1) {
25381
- template2 = template2.replace(t.contents, "");
25799
+ try {
25800
+ const templates = getTemplates(template2);
25801
+ for (const [name, t] of templates) {
25802
+ const replaceRegex = new RegExp(`\u03B8${name.slice(1)}\\\u03B4`, "g");
25803
+ const forRegex = new RegExp(`\u03B8${name.slice(1)}\\\u03C6`, "g");
25804
+ const forMatches = [...template2.matchAll(forRegex)];
25805
+ const matches = [...forMatches, ...template2.matchAll(replaceRegex)];
25806
+ let safeToRemove = true;
25807
+ if (matches.length > 0) {
25808
+ if (t.i18n !== null) {
25809
+ const container = wrapIntoI18nContainer(t.i18n, t.children);
25810
+ template2 = template2.replace(replaceRegex, container);
25811
+ } else if (t.children.trim() === "" && t.isNgTemplateOutlet) {
25812
+ template2 = template2.replace(replaceRegex, t.generateTemplateOutlet());
25813
+ } else if (forMatches.length > 0) {
25814
+ if (t.count === 2) {
25815
+ template2 = template2.replace(forRegex, t.children);
25816
+ } else {
25817
+ template2 = template2.replace(forRegex, t.generateTemplateOutlet());
25818
+ safeToRemove = false;
25819
+ }
25820
+ } else {
25821
+ template2 = template2.replace(replaceRegex, t.children);
25822
+ }
25823
+ if (t.count === matches.length + 1 && safeToRemove) {
25824
+ template2 = template2.replace(t.contents, "");
25825
+ }
25826
+ updateTemplates(template2, templates);
25382
25827
  }
25383
25828
  }
25829
+ template2 = replaceRemainingPlaceholders(template2);
25830
+ return { migrated: template2, err: void 0 };
25831
+ } catch (err) {
25832
+ return { migrated: template2, err };
25384
25833
  }
25385
- return template2;
25834
+ }
25835
+ function replaceRemainingPlaceholders(template2) {
25836
+ const replaceRegex = new RegExp(`\u03B8.*\u03B4`, "g");
25837
+ const placeholders = [...template2.matchAll(replaceRegex)];
25838
+ let migrated = template2;
25839
+ for (let ph of placeholders) {
25840
+ const placeholder = ph[0];
25841
+ const name = placeholder.slice(1, placeholder.length - 1);
25842
+ migrated = template2.replace(placeholder, `<ng-template [ngTemplateOutlet]="${name}"></ng-template>`);
25843
+ }
25844
+ return migrated;
25386
25845
  }
25387
25846
  function canRemoveCommonModule(template2) {
25388
25847
  const parsed = parseTemplate2(template2);
@@ -25396,7 +25855,8 @@ function canRemoveCommonModule(template2) {
25396
25855
  }
25397
25856
  function removeImports(template2, node, removeCommonModule) {
25398
25857
  if (template2.startsWith("imports") && import_typescript5.default.isPropertyAssignment(node)) {
25399
- return updateClassImports(node, removeCommonModule);
25858
+ const updatedImport = updateClassImports(node, removeCommonModule);
25859
+ return updatedImport != null ? updatedImport : template2;
25400
25860
  } else if (import_typescript5.default.isImportDeclaration(node) && checkIfShouldChange(node, removeCommonModule)) {
25401
25861
  return updateImportDeclaration(node, removeCommonModule);
25402
25862
  }
@@ -25415,61 +25875,99 @@ function getOriginals(etm, tmpl, offset) {
25415
25875
  return { start, end: "", childLength: 0 };
25416
25876
  }
25417
25877
  function isI18nTemplate(etm, i18nAttr) {
25418
- return etm.el.name === "ng-template" && i18nAttr !== void 0 && (etm.el.attrs.length === 2 || etm.el.attrs.length === 3 && etm.elseAttr !== void 0);
25878
+ let attrCount = countAttributes(etm);
25879
+ const safeToRemove = etm.el.attrs.length === attrCount + (i18nAttr !== void 0 ? 1 : 0);
25880
+ return etm.el.name === "ng-template" && i18nAttr !== void 0 && safeToRemove;
25419
25881
  }
25420
25882
  function isRemovableContainer(etm) {
25421
- return (etm.el.name === "ng-container" || etm.el.name === "ng-template") && (etm.el.attrs.length === 1 || etm.forAttrs !== void 0 || etm.el.attrs.length === 2 && etm.elseAttr !== void 0 || etm.el.attrs.length === 3 && etm.elseAttr !== void 0 && etm.thenAttr !== void 0);
25883
+ let attrCount = countAttributes(etm);
25884
+ const safeToRemove = etm.el.attrs.length === attrCount;
25885
+ return (etm.el.name === "ng-container" || etm.el.name === "ng-template") && safeToRemove;
25886
+ }
25887
+ function countAttributes(etm) {
25888
+ var _a2, _b2, _c2, _d2, _e2;
25889
+ let attrCount = 1;
25890
+ if (etm.elseAttr !== void 0) {
25891
+ attrCount++;
25892
+ }
25893
+ if (etm.thenAttr !== void 0) {
25894
+ attrCount++;
25895
+ }
25896
+ attrCount += (_b2 = (_a2 = etm.aliasAttrs) == null ? void 0 : _a2.aliases.size) != null ? _b2 : 0;
25897
+ attrCount += ((_c2 = etm.aliasAttrs) == null ? void 0 : _c2.item) ? 1 : 0;
25898
+ attrCount += ((_d2 = etm.forAttrs) == null ? void 0 : _d2.trackBy) ? 1 : 0;
25899
+ attrCount += ((_e2 = etm.forAttrs) == null ? void 0 : _e2.forOf) ? 1 : 0;
25900
+ return attrCount;
25422
25901
  }
25423
25902
  function getMainBlock(etm, tmpl, offset) {
25424
25903
  const i18nAttr = etm.el.attrs.find((x) => x.name === "i18n");
25425
25904
  if (isRemovableContainer(etm)) {
25426
- const childStart2 = etm.el.children[0].sourceSpan.start.offset - offset;
25427
- const childEnd2 = etm.el.children[etm.el.children.length - 1].sourceSpan.end.offset - offset;
25428
- const middle2 = tmpl.slice(childStart2, childEnd2);
25905
+ let middle2 = "";
25906
+ if (etm.hasChildren()) {
25907
+ const { childStart: childStart2, childEnd: childEnd2 } = etm.getChildSpan(offset);
25908
+ middle2 = tmpl.slice(childStart2, childEnd2);
25909
+ }
25429
25910
  return { start: "", middle: middle2, end: "" };
25430
25911
  } else if (isI18nTemplate(etm, i18nAttr)) {
25431
- const childStart2 = etm.el.children[0].sourceSpan.start.offset - offset;
25432
- const childEnd2 = etm.el.children[etm.el.children.length - 1].sourceSpan.end.offset - offset;
25433
- const middle2 = wrapIntoI18nContainer(i18nAttr, tmpl.slice(childStart2, childEnd2));
25434
- return { start: "", middle: middle2, end: "" };
25912
+ const { childStart: childStart2, childEnd: childEnd2 } = etm.getChildSpan(offset);
25913
+ return generatei18nContainer(i18nAttr, tmpl.slice(childStart2, childEnd2));
25435
25914
  }
25436
25915
  const attrStart = etm.attr.keySpan.start.offset - 1 - offset;
25437
- const valEnd = (etm.attr.valueSpan ? etm.attr.valueSpan.end.offset + 1 : etm.attr.keySpan.end.offset) - offset;
25438
- let childStart = valEnd;
25439
- let childEnd = valEnd;
25440
- if (etm.el.children.length > 0) {
25441
- childStart = etm.el.children[0].sourceSpan.start.offset - offset;
25442
- childEnd = etm.el.children[etm.el.children.length - 1].sourceSpan.end.offset - offset;
25443
- }
25444
- let start = tmpl.slice(etm.start(offset), attrStart);
25445
- start += tmpl.slice(valEnd, childStart);
25916
+ const valEnd = etm.getValueEnd(offset);
25917
+ const { childStart, childEnd } = etm.hasChildren() ? etm.getChildSpan(offset) : { childStart: valEnd, childEnd: valEnd };
25918
+ let start = tmpl.slice(etm.start(offset), attrStart) + tmpl.slice(valEnd, childStart);
25446
25919
  const middle = tmpl.slice(childStart, childEnd);
25447
- const end = tmpl.slice(childEnd, etm.end(offset));
25920
+ let end = tmpl.slice(childEnd, etm.end(offset));
25921
+ if (etm.shouldRemoveElseAttr()) {
25922
+ start = start.replace(etm.getElseAttrStr(), "");
25923
+ end = end.replace(etm.getElseAttrStr(), "");
25924
+ }
25448
25925
  return { start, middle, end };
25449
25926
  }
25450
- function formatTemplate(tmpl) {
25927
+ var selfClosingList = "input|br|img|base|wbr|area|col|embed|hr|link|meta|param|source|track";
25928
+ function formatTemplate(tmpl, templateType) {
25451
25929
  if (tmpl.indexOf("\n") > -1) {
25930
+ let openSelfClosingEl = false;
25452
25931
  const openBlockRegex = /^\s*\@(if|switch|case|default|for)|^\s*\}\s\@else/;
25453
25932
  const openElRegex = /^\s*<([a-z0-9]+)(?![^>]*\/>)[^>]*>?/;
25933
+ const selfClosingRegex = new RegExp(`^\\s*<(${selfClosingList}).+\\/?>`);
25934
+ const openSelfClosingRegex = new RegExp(`^\\s*<(${selfClosingList})(?![^>]*\\/>)[^>]*$`);
25454
25935
  const closeBlockRegex = /^\s*\}\s*$|^\s*\}\s\@else/;
25455
- const closeElRegex = /\s*<\/([a-z0-9\-]+)*>/;
25456
- const closeMultiLineElRegex = /^\s*([a-z0-9\-\[\]]+)?=?"?([^”<]+)?"?\s?\/>$/;
25457
- const singleLineElRegex = /^\s*<([a-z0-9]+)(?![^>]*\/>)[^>]*>.*<\/([a-z0-9\-]+)*>/;
25936
+ const closeElRegex = /\s*<\/([a-zA-Z0-9\-]+)*>/;
25937
+ const closeMultiLineElRegex = /^\s*([a-zA-Z0-9\-\[\]]+)?=?"?([^”<]+)?"?\s?\/>$/;
25938
+ const closeSelfClosingMultiLineRegex = /^\s*([a-zA-Z0-9\-\[\]]+)?=?"?([^”\/<]+)?"?\s?>$/;
25939
+ const singleLineElRegex = /\s*<([a-zA-Z0-9]+)(?![^>]*\/>)[^>]*>.*<\/([a-zA-Z0-9\-]+)*>/;
25458
25940
  const lines = tmpl.split("\n");
25459
25941
  const formatted = [];
25460
25942
  let indent = "";
25943
+ let mindent = "";
25461
25944
  for (let [index, line] of lines.entries()) {
25462
25945
  if (line.trim() === "" && index !== 0 && index !== lines.length - 1) {
25463
25946
  continue;
25464
25947
  }
25948
+ if (templateType === "template" && index <= 1) {
25949
+ const ind = line.search(/\S/);
25950
+ mindent = ind > -1 ? line.slice(0, ind) : "";
25951
+ }
25465
25952
  if ((closeBlockRegex.test(line) || closeElRegex.test(line) && (!singleLineElRegex.test(line) && !closeMultiLineElRegex.test(line))) && indent !== "") {
25466
25953
  indent = indent.slice(2);
25467
25954
  }
25468
- formatted.push(indent + line.trim());
25955
+ formatted.push(mindent + indent + line.trim());
25469
25956
  if (closeMultiLineElRegex.test(line)) {
25470
25957
  indent = indent.slice(2);
25958
+ if (openSelfClosingEl) {
25959
+ openSelfClosingEl = false;
25960
+ }
25471
25961
  }
25472
- if ((openBlockRegex.test(line) || openElRegex.test(line)) && !singleLineElRegex.test(line)) {
25962
+ if (closeSelfClosingMultiLineRegex.test(line) && openSelfClosingEl) {
25963
+ openSelfClosingEl = false;
25964
+ indent = indent.slice(2);
25965
+ }
25966
+ if ((openBlockRegex.test(line) || openElRegex.test(line)) && !singleLineElRegex.test(line) && !selfClosingRegex.test(line) && !openSelfClosingRegex.test(line)) {
25967
+ indent += " ";
25968
+ }
25969
+ if (openSelfClosingRegex.test(line)) {
25970
+ openSelfClosingEl = true;
25473
25971
  indent += " ";
25474
25972
  }
25475
25973
  }
@@ -25486,7 +25984,7 @@ function forEachClass(sourceFile, callback) {
25486
25984
  });
25487
25985
  }
25488
25986
 
25489
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/cases.mjs
25987
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/cases.mjs
25490
25988
  var boundcase = "[ngSwitchCase]";
25491
25989
  var switchcase = "*ngSwitchCase";
25492
25990
  var nakedcase = "ngSwitchCase";
@@ -25564,7 +26062,7 @@ function migrateNgSwitchDefault(etm, tmpl, offset) {
25564
26062
  return { tmpl: updatedTmpl, offsets: { pre, post } };
25565
26063
  }
25566
26064
 
25567
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/fors.mjs
26065
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/fors.mjs
25568
26066
  var ngfor = "*ngFor";
25569
26067
  var nakedngfor2 = "ngFor";
25570
26068
  var fors = [
@@ -25623,15 +26121,23 @@ function migrateStandardNgFor(etm, tmpl, offset) {
25623
26121
  const parts = getNgForParts(etm.attr.value);
25624
26122
  const originals = getOriginals(etm, tmpl, offset);
25625
26123
  const condition = parts[0].replace("let ", "");
26124
+ if (condition.indexOf(" as ") > -1) {
26125
+ let errorMessage = `Found an aliased collection on an ngFor: "${condition}". Collection aliasing is not supported with @for. Refactor the code to remove the \`as\` alias and re-run the migration.`;
26126
+ throw new Error(errorMessage);
26127
+ }
25626
26128
  const loopVar = condition.split(" of ")[0];
25627
26129
  let trackBy = loopVar;
25628
26130
  let aliasedIndex = null;
26131
+ let tmplPlaceholder = "";
25629
26132
  for (let i = 1; i < parts.length; i++) {
25630
26133
  const part = parts[i].trim();
25631
26134
  if (part.startsWith("trackBy:")) {
25632
26135
  const trackByFn = part.replace("trackBy:", "").trim();
25633
26136
  trackBy = `${trackByFn}($index, ${loopVar})`;
25634
26137
  }
26138
+ if (part.startsWith("template:")) {
26139
+ tmplPlaceholder = `\u03B8${part.split(":")[1].trim()}\u03C6`;
26140
+ }
25635
26141
  if (part.match(aliasWithEqualRegexp)) {
25636
26142
  const aliasParts = part.split("=");
25637
26143
  aliases.push(` ${aliasParts[0].trim()} = $${aliasParts[1].trim()}`);
@@ -25651,10 +26157,18 @@ function migrateStandardNgFor(etm, tmpl, offset) {
25651
26157
  trackBy = trackBy.replace("$index", aliasedIndex);
25652
26158
  }
25653
26159
  const aliasStr = aliases.length > 0 ? `;${aliases.join(";")}` : "";
25654
- const { start, middle, end } = getMainBlock(etm, tmpl, offset);
25655
- const startBlock = `@for (${condition}; track ${trackBy}${aliasStr}) {${lbString}${start}`;
25656
- const endBlock = `${end}${lbString}}`;
25657
- const forBlock = startBlock + middle + endBlock;
26160
+ let startBlock = `@for (${condition}; track ${trackBy}${aliasStr}) {${lbString}`;
26161
+ let endBlock = `${lbString}}`;
26162
+ let forBlock = "";
26163
+ if (tmplPlaceholder !== "") {
26164
+ startBlock = startBlock + tmplPlaceholder;
26165
+ forBlock = startBlock + endBlock;
26166
+ } else {
26167
+ const { start, middle, end } = getMainBlock(etm, tmpl, offset);
26168
+ startBlock += start;
26169
+ endBlock = end + endBlock;
26170
+ forBlock = startBlock + middle + endBlock;
26171
+ }
25658
26172
  const updatedTmpl = tmpl.slice(0, etm.start(offset)) + forBlock + tmpl.slice(etm.end(offset));
25659
26173
  const pre = originals.start.length - startBlock.length;
25660
26174
  const post = originals.end.length - endBlock.length;
@@ -25662,9 +26176,10 @@ function migrateStandardNgFor(etm, tmpl, offset) {
25662
26176
  }
25663
26177
  function migrateBoundNgFor(etm, tmpl, offset) {
25664
26178
  const forAttrs = etm.forAttrs;
25665
- const aliasMap = forAttrs.aliases;
26179
+ const aliasAttrs = etm.aliasAttrs;
26180
+ const aliasMap = aliasAttrs.aliases;
25666
26181
  const originals = getOriginals(etm, tmpl, offset);
25667
- const condition = `${forAttrs.item} of ${forAttrs.forOf}`;
26182
+ const condition = `${aliasAttrs.item} of ${forAttrs.forOf}`;
25668
26183
  const aliases = [];
25669
26184
  let aliasedIndex = "$index";
25670
26185
  for (const [key, val] of aliasMap) {
@@ -25674,9 +26189,9 @@ function migrateBoundNgFor(etm, tmpl, offset) {
25674
26189
  }
25675
26190
  }
25676
26191
  const aliasStr = aliases.length > 0 ? `;${aliases.join(";")}` : "";
25677
- let trackBy = forAttrs.item;
26192
+ let trackBy = aliasAttrs.item;
25678
26193
  if (forAttrs.trackBy !== "") {
25679
- trackBy = `${forAttrs.trackBy.trim()}(${aliasedIndex}, ${forAttrs.item})`;
26194
+ trackBy = `${forAttrs.trackBy.trim()}(${aliasedIndex}, ${aliasAttrs.item})`;
25680
26195
  }
25681
26196
  const { start, middle, end } = getMainBlock(etm, tmpl, offset);
25682
26197
  const startBlock = `@for (${condition}; track ${trackBy}${aliasStr}) {
@@ -25721,7 +26236,7 @@ function getNgForParts(expression) {
25721
26236
  return parts;
25722
26237
  }
25723
26238
 
25724
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/ifs.mjs
26239
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/ifs.mjs
25725
26240
  var ngif = "*ngIf";
25726
26241
  var boundngif = "[ngIf]";
25727
26242
  var nakedngif = "ngIf";
@@ -25760,20 +26275,32 @@ function migrateIf(template2) {
25760
26275
  return { migrated: result, errors, changed };
25761
26276
  }
25762
26277
  function migrateNgIf(etm, tmpl, offset) {
25763
- const matchThen = etm.attr.value.match(/;\s*then/gm);
25764
- const matchElse = etm.attr.value.match(/;\s*else/gm);
26278
+ const matchThen = etm.attr.value.match(/[^\w\d];?\s*then/gm);
26279
+ const matchElse = etm.attr.value.match(/[^\w\d];?\s*else/gm);
25765
26280
  if (etm.thenAttr !== void 0 || etm.elseAttr !== void 0) {
25766
26281
  return buildBoundIfElseBlock(etm, tmpl, offset);
25767
- } else if (matchThen && matchThen.length > 0) {
26282
+ } else if (matchThen && matchThen.length > 0 && matchElse && matchElse.length > 0) {
25768
26283
  return buildStandardIfThenElseBlock(etm, tmpl, matchThen[0], matchElse[0], offset);
26284
+ } else if (matchThen && matchThen.length > 0) {
26285
+ return buildStandardIfThenBlock(etm, tmpl, matchThen[0], offset);
25769
26286
  } else if (matchElse && matchElse.length > 0) {
25770
26287
  return buildStandardIfElseBlock(etm, tmpl, matchElse[0], offset);
25771
26288
  }
25772
26289
  return buildIfBlock(etm, tmpl, offset);
25773
26290
  }
25774
26291
  function buildIfBlock(etm, tmpl, offset) {
26292
+ const aliasAttrs = etm.aliasAttrs;
26293
+ const aliases = [...aliasAttrs.aliases.keys()];
26294
+ if (aliasAttrs.item) {
26295
+ aliases.push(aliasAttrs.item);
26296
+ }
25775
26297
  const lbString = etm.hasLineBreaks ? "\n" : "";
25776
- const condition = etm.attr.value.replace(" as ", "; as ").replace(/;\s*let/g, "; as");
26298
+ let condition = etm.attr.value.replace(" as ", "; as ").replace(/;\s*let/g, "; as");
26299
+ if (aliases.length > 1 || aliases.length === 1 && condition.indexOf("; as") > -1) {
26300
+ throw new Error("Found more than one alias on your ngIf. Remove one of them and re-run the migration.");
26301
+ } else if (aliases.length === 1) {
26302
+ condition += `; as ${aliases[0]}`;
26303
+ }
25777
26304
  const originals = getOriginals(etm, tmpl, offset);
25778
26305
  const { start, middle, end } = getMainBlock(etm, tmpl, offset);
25779
26306
  const startBlock = `@if (${condition}) {${lbString}${start}`;
@@ -25785,15 +26312,25 @@ function buildIfBlock(etm, tmpl, offset) {
25785
26312
  return { tmpl: updatedTmpl, offsets: { pre, post } };
25786
26313
  }
25787
26314
  function buildStandardIfElseBlock(etm, tmpl, elseString, offset) {
25788
- const condition = etm.getCondition(elseString).replace(" as ", "; as ").replace(/;\s*let/g, "; as");
25789
- const elsePlaceholder = `#${etm.getTemplateName(elseString)}|`;
26315
+ const condition = etm.getCondition().replace(" as ", "; as ").replace(/;\s*let/g, "; as");
26316
+ const elsePlaceholder = `\u03B8${etm.getTemplateName(elseString)}\u03B4`;
25790
26317
  return buildIfElseBlock(etm, tmpl, condition, elsePlaceholder, offset);
25791
26318
  }
25792
26319
  function buildBoundIfElseBlock(etm, tmpl, offset) {
25793
- const condition = etm.attr.value.replace(" as ", "; as ");
25794
- const elsePlaceholder = `#${etm.elseAttr.value}|`;
26320
+ const aliasAttrs = etm.aliasAttrs;
26321
+ const aliases = [...aliasAttrs.aliases.keys()];
26322
+ if (aliasAttrs.item) {
26323
+ aliases.push(aliasAttrs.item);
26324
+ }
26325
+ let condition = etm.attr.value.replace(" as ", "; as ");
26326
+ if (aliases.length > 1 || aliases.length === 1 && condition.indexOf("; as") > -1) {
26327
+ throw new Error("Found more than one alias on your ngIf. Remove one of them and re-run the migration.");
26328
+ } else if (aliases.length === 1) {
26329
+ condition += `; as ${aliases[0]}`;
26330
+ }
26331
+ const elsePlaceholder = `\u03B8${etm.elseAttr.value}\u03B4`;
25795
26332
  if (etm.thenAttr !== void 0) {
25796
- const thenPlaceholder = `#${etm.thenAttr.value}|`;
26333
+ const thenPlaceholder = `\u03B8${etm.thenAttr.value}\u03B4`;
25797
26334
  return buildIfThenElseBlock(etm, tmpl, condition, thenPlaceholder, elsePlaceholder, offset);
25798
26335
  }
25799
26336
  return buildIfElseBlock(etm, tmpl, condition, elsePlaceholder, offset);
@@ -25814,11 +26351,16 @@ function buildIfElseBlock(etm, tmpl, condition, elsePlaceholder, offset) {
25814
26351
  return { tmpl: updatedTmpl, offsets: { pre, post } };
25815
26352
  }
25816
26353
  function buildStandardIfThenElseBlock(etm, tmpl, thenString, elseString, offset) {
25817
- const condition = etm.getCondition(thenString).replace(" as ", "; as ").replace(/;\s*let/g, "; as");
25818
- const thenPlaceholder = `#${etm.getTemplateName(thenString, elseString)}|`;
25819
- const elsePlaceholder = `#${etm.getTemplateName(elseString)}|`;
26354
+ const condition = etm.getCondition().replace(" as ", "; as ").replace(/;\s*let/g, "; as");
26355
+ const thenPlaceholder = `\u03B8${etm.getTemplateName(thenString, elseString)}\u03B4`;
26356
+ const elsePlaceholder = `\u03B8${etm.getTemplateName(elseString)}\u03B4`;
25820
26357
  return buildIfThenElseBlock(etm, tmpl, condition, thenPlaceholder, elsePlaceholder, offset);
25821
26358
  }
26359
+ function buildStandardIfThenBlock(etm, tmpl, thenString, offset) {
26360
+ const condition = etm.getCondition().replace(" as ", "; as ").replace(/;\s*let/g, "; as");
26361
+ const thenPlaceholder = `\u03B8${etm.getTemplateName(thenString)}\u03B4`;
26362
+ return buildIfThenBlock(etm, tmpl, condition, thenPlaceholder, offset);
26363
+ }
25822
26364
  function buildIfThenElseBlock(etm, tmpl, condition, thenPlaceholder, elsePlaceholder, offset) {
25823
26365
  const lbString = etm.hasLineBreaks ? "\n" : "";
25824
26366
  const originals = getOriginals(etm, tmpl, offset);
@@ -25833,8 +26375,21 @@ function buildIfThenElseBlock(etm, tmpl, condition, thenPlaceholder, elsePlaceho
25833
26375
  const post = originals.end.length - postBlock.length;
25834
26376
  return { tmpl: updatedTmpl, offsets: { pre, post } };
25835
26377
  }
26378
+ function buildIfThenBlock(etm, tmpl, condition, thenPlaceholder, offset) {
26379
+ const lbString = etm.hasLineBreaks ? "\n" : "";
26380
+ const originals = getOriginals(etm, tmpl, offset);
26381
+ const startBlock = `@if (${condition}) {${lbString}`;
26382
+ const postBlock = thenPlaceholder + `${lbString}}`;
26383
+ const ifThenBlock = startBlock + postBlock;
26384
+ const tmplStart = tmpl.slice(0, etm.start(offset));
26385
+ const tmplEnd = tmpl.slice(etm.end(offset));
26386
+ const updatedTmpl = tmplStart + ifThenBlock + tmplEnd;
26387
+ const pre = originals.start.length + originals.childLength - startBlock.length;
26388
+ const post = originals.end.length - postBlock.length;
26389
+ return { tmpl: updatedTmpl, offsets: { pre, post } };
26390
+ }
25836
26391
 
25837
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/switches.mjs
26392
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/switches.mjs
25838
26393
  var ngswitch = "[ngSwitch]";
25839
26394
  var switches = [
25840
26395
  ngswitch
@@ -25884,21 +26439,29 @@ function migrateNgSwitch(etm, tmpl, offset) {
25884
26439
  return { tmpl: updatedTmpl, offsets: { pre, post } };
25885
26440
  }
25886
26441
 
25887
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/migration.mjs
25888
- function migrateTemplate(template2, templateType, node, file, format = true) {
26442
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/migration.mjs
26443
+ function migrateTemplate(template2, templateType, node, file, format = true, analyzedFiles) {
25889
26444
  let errors = [];
25890
26445
  let migrated = template2;
25891
- if (templateType === "template") {
26446
+ if (templateType === "template" || templateType === "templateUrl") {
25892
26447
  const ifResult = migrateIf(template2);
25893
26448
  const forResult = migrateFor(ifResult.migrated);
25894
26449
  const switchResult = migrateSwitch(forResult.migrated);
25895
26450
  const caseResult = migrateCase(switchResult.migrated);
25896
- migrated = processNgTemplates(caseResult.migrated);
26451
+ const templateResult = processNgTemplates(caseResult.migrated);
26452
+ if (templateResult.err !== void 0) {
26453
+ return { migrated: template2, errors: [{ type: "template", error: templateResult.err }] };
26454
+ }
26455
+ migrated = templateResult.migrated;
25897
26456
  const changed = ifResult.changed || forResult.changed || switchResult.changed || caseResult.changed;
25898
26457
  if (format && changed) {
25899
- migrated = formatTemplate(migrated);
26458
+ migrated = formatTemplate(migrated, templateType);
25900
26459
  }
25901
26460
  file.removeCommonModule = canRemoveCommonModule(template2);
26461
+ if (templateType === "templateUrl" && analyzedFiles !== null && analyzedFiles.has(file.sourceFilePath)) {
26462
+ const componentFile = analyzedFiles.get(file.sourceFilePath);
26463
+ componentFile.removeCommonModule = file.removeCommonModule;
26464
+ }
25902
26465
  errors = [
25903
26466
  ...ifResult.errors,
25904
26467
  ...forResult.errors,
@@ -25911,7 +26474,7 @@ function migrateTemplate(template2, templateType, node, file, format = true) {
25911
26474
  return { migrated, errors };
25912
26475
  }
25913
26476
 
25914
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/index.mjs
26477
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/index.mjs
25915
26478
  function control_flow_migration_default(options) {
25916
26479
  return (tree, context) => __async(this, null, function* () {
25917
26480
  const basePath = process.cwd();
@@ -25952,7 +26515,9 @@ function runControlFlowMigration(tree, tsconfigPath, basePath, pathToMigrate, sc
25952
26515
  for (const sourceFile of sourceFiles) {
25953
26516
  analyze(sourceFile, analysis);
25954
26517
  }
25955
- for (const [path2, file] of analysis) {
26518
+ const paths = sortFilePaths([...analysis.keys()]);
26519
+ for (const path2 of paths) {
26520
+ const file = analysis.get(path2);
25956
26521
  const ranges = file.getSortedRanges();
25957
26522
  const relativePath = (0, import_path3.relative)(basePath, path2);
25958
26523
  const content = tree.readText(relativePath);
@@ -25960,7 +26525,7 @@ function runControlFlowMigration(tree, tsconfigPath, basePath, pathToMigrate, sc
25960
26525
  for (const { start, end, node, type } of ranges) {
25961
26526
  const template2 = content.slice(start, end);
25962
26527
  const length = (end != null ? end : content.length) - start;
25963
- const { migrated, errors } = migrateTemplate(template2, type, node, file, schematicOptions.format);
26528
+ const { migrated, errors } = migrateTemplate(template2, type, node, file, schematicOptions.format, analysis);
25964
26529
  if (migrated !== null) {
25965
26530
  update.remove(start, length);
25966
26531
  update.insertLeft(start, migrated);
@@ -25977,6 +26542,10 @@ function runControlFlowMigration(tree, tsconfigPath, basePath, pathToMigrate, sc
25977
26542
  }
25978
26543
  return errorList;
25979
26544
  }
26545
+ function sortFilePaths(names) {
26546
+ names.sort((a, _) => a.endsWith(".html") ? -1 : 0);
26547
+ return names;
26548
+ }
25980
26549
  function generateErrorMessage(path2, errors) {
25981
26550
  let errorMessage = `Template "${path2}" encountered ${errors.length} errors during migration:
25982
26551
  `;