@angular/core 17.1.0-next.0 → 17.1.0-next.2

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/defer/instructions.mjs +3 -2
  3. package/esm2022/src/defer/utils.mjs +2 -2
  4. package/esm2022/src/image_performance_warning.mjs +14 -3
  5. package/esm2022/src/render3/features/host_directives_feature.mjs +20 -13
  6. package/esm2022/src/render3/instructions/change_detection.mjs +4 -5
  7. package/esm2022/src/render3/instructions/control_flow.mjs +9 -11
  8. package/esm2022/src/render3/util/view_utils.mjs +11 -12
  9. package/esm2022/src/version.mjs +1 -1
  10. package/esm2022/testing/src/logger.mjs +3 -3
  11. package/esm2022/testing/src/test_bed.mjs +3 -3
  12. package/esm2022/testing/src/test_bed_compiler.mjs +19 -10
  13. package/fesm2022/core.mjs +56 -41
  14. package/fesm2022/core.mjs.map +1 -1
  15. package/fesm2022/primitives/signals.mjs +1 -1
  16. package/fesm2022/rxjs-interop.mjs +1 -1
  17. package/fesm2022/testing.mjs +21 -12
  18. package/fesm2022/testing.mjs.map +1 -1
  19. package/index.d.ts +4 -7
  20. package/package.json +1 -1
  21. package/primitives/signals/index.d.ts +1 -1
  22. package/rxjs-interop/index.d.ts +1 -1
  23. package/schematics/migrations/block-template-entities/bundle.js +559 -415
  24. package/schematics/migrations/block-template-entities/bundle.js.map +4 -4
  25. package/schematics/migrations/compiler-options/bundle.js +13 -13
  26. package/schematics/migrations/transfer-state/bundle.js +13 -13
  27. package/schematics/ng-generate/control-flow-migration/bundle.js +908 -568
  28. package/schematics/ng-generate/control-flow-migration/bundle.js.map +4 -4
  29. package/schematics/ng-generate/control-flow-migration/schema.json +6 -0
  30. package/schematics/ng-generate/standalone-migration/bundle.js +982 -691
  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_arm64-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_arm64-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_arm64-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_arm64-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_arm64-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_arm64-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_arm64-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_arm64-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_arm64-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_arm64-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}]`);
@@ -540,6 +540,9 @@ var _SerializerVisitor = class {
540
540
  visitIcuPlaceholder(ph, context) {
541
541
  return `<ph icu name="${ph.name}">${ph.value.visit(this)}</ph>`;
542
542
  }
543
+ visitBlockPlaceholder(ph, context) {
544
+ return `<ph block name="${ph.startName}">${ph.children.map((child) => child.visit(this)).join(", ")}</ph name="${ph.closeName}">`;
545
+ }
543
546
  };
544
547
  var serializerVisitor = new _SerializerVisitor();
545
548
  function serializeNodes(nodes) {
@@ -744,7 +747,7 @@ function wordAt(bytes, index, endian) {
744
747
  return word;
745
748
  }
746
749
 
747
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/output/output_ast.mjs
750
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/output/output_ast.mjs
748
751
  var TypeModifier;
749
752
  (function(TypeModifier2) {
750
753
  TypeModifier2[TypeModifier2["None"] = 0] = "None";
@@ -1699,7 +1702,7 @@ function serializeTags(tags) {
1699
1702
  return out;
1700
1703
  }
1701
1704
 
1702
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/constant_pool.mjs
1705
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/constant_pool.mjs
1703
1706
  var CONSTANT_PREFIX = "_c";
1704
1707
  var UNKNOWN_VALUE_KEY = variable("<unknown>");
1705
1708
  var KEY_CONTEXT = {};
@@ -1882,7 +1885,7 @@ function isLongStringLiteral(expr) {
1882
1885
  return expr instanceof LiteralExpr && typeof expr.value === "string" && expr.value.length >= POOL_INCLUSION_LENGTH_THRESHOLD_FOR_STRINGS;
1883
1886
  }
1884
1887
 
1885
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/r3_identifiers.mjs
1888
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_identifiers.mjs
1886
1889
  var CORE = "@angular/core";
1887
1890
  var _Identifiers = class {
1888
1891
  };
@@ -2515,7 +2518,7 @@ var Identifiers = _Identifiers;
2515
2518
  _Identifiers.validateIframeAttribute = { name: "\u0275\u0275validateIframeAttribute", moduleName: CORE };
2516
2519
  })();
2517
2520
 
2518
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/util.mjs
2521
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/util.mjs
2519
2522
  var DASH_CASE_REGEXP = /-+([a-z0-9])/g;
2520
2523
  function dashCaseToCamelCase(input) {
2521
2524
  return input.replace(DASH_CASE_REGEXP, (...m) => m[1].toUpperCase());
@@ -2603,7 +2606,7 @@ function partitionArray(arr, conditionFn) {
2603
2606
  return [truthy, falsy];
2604
2607
  }
2605
2608
 
2606
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/output/source_map.mjs
2609
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/output/source_map.mjs
2607
2610
  var VERSION = 3;
2608
2611
  var JS_B64_PREFIX = "# sourceMappingURL=data:application/json;base64,";
2609
2612
  var SourceMapGenerator = class {
@@ -2732,7 +2735,7 @@ function toBase64Digit(value) {
2732
2735
  return B64_DIGITS[value];
2733
2736
  }
2734
2737
 
2735
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/output/abstract_emitter.mjs
2738
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/output/abstract_emitter.mjs
2736
2739
  var _SINGLE_QUOTE_ESCAPE_STRING_RE = /'|\\|\n|\r|\$/g;
2737
2740
  var _LEGAL_IDENTIFIER_RE = /^[$A-Z_][0-9A-Z_$]*$/i;
2738
2741
  var _INDENT_WITH = " ";
@@ -3217,7 +3220,7 @@ function _createIndent(count) {
3217
3220
  return res;
3218
3221
  }
3219
3222
 
3220
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/util.mjs
3223
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/util.mjs
3221
3224
  function typeWithParameters(type, numParams) {
3222
3225
  if (numParams === 0) {
3223
3226
  return expressionType(type);
@@ -3282,7 +3285,7 @@ function generateForwardRef(expr) {
3282
3285
  return importExpr(Identifiers.forwardRef).callFn([arrowFn([], expr)]);
3283
3286
  }
3284
3287
 
3285
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/r3_factory.mjs
3288
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_factory.mjs
3286
3289
  var R3FactoryDelegateType;
3287
3290
  (function(R3FactoryDelegateType2) {
3288
3291
  R3FactoryDelegateType2[R3FactoryDelegateType2["Class"] = 0] = "Class";
@@ -3427,7 +3430,40 @@ function getInjectFn(target) {
3427
3430
  }
3428
3431
  }
3429
3432
 
3430
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/r3_ast.mjs
3433
+ // bazel-out/darwin_arm64-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_arm64-fastbuild/bin/packages/compiler/src/render3/r3_ast.mjs
3431
3467
  var Comment = class {
3432
3468
  constructor(value, sourceSpan) {
3433
3469
  this.value = value;
@@ -3585,43 +3621,47 @@ var BlockNode = class {
3585
3621
  }
3586
3622
  };
3587
3623
  var DeferredBlockPlaceholder = class extends BlockNode {
3588
- constructor(children, minimumTime, nameSpan, sourceSpan, startSourceSpan, endSourceSpan) {
3624
+ constructor(children, minimumTime, nameSpan, sourceSpan, startSourceSpan, endSourceSpan, i18n2) {
3589
3625
  super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);
3590
3626
  this.children = children;
3591
3627
  this.minimumTime = minimumTime;
3628
+ this.i18n = i18n2;
3592
3629
  }
3593
3630
  visit(visitor) {
3594
3631
  return visitor.visitDeferredBlockPlaceholder(this);
3595
3632
  }
3596
3633
  };
3597
3634
  var DeferredBlockLoading = class extends BlockNode {
3598
- constructor(children, afterTime, minimumTime, nameSpan, sourceSpan, startSourceSpan, endSourceSpan) {
3635
+ constructor(children, afterTime, minimumTime, nameSpan, sourceSpan, startSourceSpan, endSourceSpan, i18n2) {
3599
3636
  super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);
3600
3637
  this.children = children;
3601
3638
  this.afterTime = afterTime;
3602
3639
  this.minimumTime = minimumTime;
3640
+ this.i18n = i18n2;
3603
3641
  }
3604
3642
  visit(visitor) {
3605
3643
  return visitor.visitDeferredBlockLoading(this);
3606
3644
  }
3607
3645
  };
3608
3646
  var DeferredBlockError = class extends BlockNode {
3609
- constructor(children, nameSpan, sourceSpan, startSourceSpan, endSourceSpan) {
3647
+ constructor(children, nameSpan, sourceSpan, startSourceSpan, endSourceSpan, i18n2) {
3610
3648
  super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);
3611
3649
  this.children = children;
3650
+ this.i18n = i18n2;
3612
3651
  }
3613
3652
  visit(visitor) {
3614
3653
  return visitor.visitDeferredBlockError(this);
3615
3654
  }
3616
3655
  };
3617
3656
  var DeferredBlock = class extends BlockNode {
3618
- constructor(children, triggers, prefetchTriggers, placeholder, loading, error2, nameSpan, sourceSpan, mainBlockSpan, startSourceSpan, endSourceSpan) {
3657
+ constructor(children, triggers, prefetchTriggers, placeholder, loading, error2, nameSpan, sourceSpan, mainBlockSpan, startSourceSpan, endSourceSpan, i18n2) {
3619
3658
  super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);
3620
3659
  this.children = children;
3621
3660
  this.placeholder = placeholder;
3622
3661
  this.loading = loading;
3623
3662
  this.error = error2;
3624
3663
  this.mainBlockSpan = mainBlockSpan;
3664
+ this.i18n = i18n2;
3625
3665
  this.triggers = triggers;
3626
3666
  this.prefetchTriggers = prefetchTriggers;
3627
3667
  this.definedTriggers = Object.keys(triggers);
@@ -3642,10 +3682,10 @@ var DeferredBlock = class extends BlockNode {
3642
3682
  }
3643
3683
  };
3644
3684
  var SwitchBlock = class extends BlockNode {
3645
- constructor(expression, cases, unknownBlocks, sourceSpan, startSourceSpan, endSourceSpan, nameSpan) {
3685
+ constructor(expression, cases2, unknownBlocks, sourceSpan, startSourceSpan, endSourceSpan, nameSpan) {
3646
3686
  super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);
3647
3687
  this.expression = expression;
3648
- this.cases = cases;
3688
+ this.cases = cases2;
3649
3689
  this.unknownBlocks = unknownBlocks;
3650
3690
  }
3651
3691
  visit(visitor) {
@@ -3653,17 +3693,18 @@ var SwitchBlock = class extends BlockNode {
3653
3693
  }
3654
3694
  };
3655
3695
  var SwitchBlockCase = class extends BlockNode {
3656
- constructor(expression, children, sourceSpan, startSourceSpan, endSourceSpan, nameSpan) {
3696
+ constructor(expression, children, sourceSpan, startSourceSpan, endSourceSpan, nameSpan, i18n2) {
3657
3697
  super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);
3658
3698
  this.expression = expression;
3659
3699
  this.children = children;
3700
+ this.i18n = i18n2;
3660
3701
  }
3661
3702
  visit(visitor) {
3662
3703
  return visitor.visitSwitchBlockCase(this);
3663
3704
  }
3664
3705
  };
3665
3706
  var ForLoopBlock = class extends BlockNode {
3666
- constructor(item, expression, trackBy, trackKeywordSpan, contextVariables, children, empty, sourceSpan, mainBlockSpan, startSourceSpan, endSourceSpan, nameSpan) {
3707
+ constructor(item, expression, trackBy, trackKeywordSpan, contextVariables, children, empty, sourceSpan, mainBlockSpan, startSourceSpan, endSourceSpan, nameSpan, i18n2) {
3667
3708
  super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);
3668
3709
  this.item = item;
3669
3710
  this.expression = expression;
@@ -3673,15 +3714,17 @@ var ForLoopBlock = class extends BlockNode {
3673
3714
  this.children = children;
3674
3715
  this.empty = empty;
3675
3716
  this.mainBlockSpan = mainBlockSpan;
3717
+ this.i18n = i18n2;
3676
3718
  }
3677
3719
  visit(visitor) {
3678
3720
  return visitor.visitForLoopBlock(this);
3679
3721
  }
3680
3722
  };
3681
3723
  var ForLoopBlockEmpty = class extends BlockNode {
3682
- constructor(children, sourceSpan, startSourceSpan, endSourceSpan, nameSpan) {
3724
+ constructor(children, sourceSpan, startSourceSpan, endSourceSpan, nameSpan, i18n2) {
3683
3725
  super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);
3684
3726
  this.children = children;
3727
+ this.i18n = i18n2;
3685
3728
  }
3686
3729
  visit(visitor) {
3687
3730
  return visitor.visitForLoopBlockEmpty(this);
@@ -3697,11 +3740,12 @@ var IfBlock = class extends BlockNode {
3697
3740
  }
3698
3741
  };
3699
3742
  var IfBlockBranch = class extends BlockNode {
3700
- constructor(expression, children, expressionAlias, sourceSpan, startSourceSpan, endSourceSpan, nameSpan) {
3743
+ constructor(expression, children, expressionAlias, sourceSpan, startSourceSpan, endSourceSpan, nameSpan, i18n2) {
3701
3744
  super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);
3702
3745
  this.expression = expression;
3703
3746
  this.children = children;
3704
3747
  this.expressionAlias = expressionAlias;
3748
+ this.i18n = i18n2;
3705
3749
  }
3706
3750
  visit(visitor) {
3707
3751
  return visitor.visitIfBlockBranch(this);
@@ -3800,7 +3844,7 @@ function visitAll(visitor, nodes) {
3800
3844
  return result;
3801
3845
  }
3802
3846
 
3803
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/i18n/i18n_ast.mjs
3847
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/i18n_ast.mjs
3804
3848
  var Message = class {
3805
3849
  constructor(nodes, placeholders, placeholderToMessage, meaning, description, customId) {
3806
3850
  this.nodes = nodes;
@@ -3844,10 +3888,10 @@ var Container = class {
3844
3888
  }
3845
3889
  };
3846
3890
  var Icu2 = class {
3847
- constructor(expression, type, cases, sourceSpan, expressionPlaceholder) {
3891
+ constructor(expression, type, cases2, sourceSpan, expressionPlaceholder) {
3848
3892
  this.expression = expression;
3849
3893
  this.type = type;
3850
- this.cases = cases;
3894
+ this.cases = cases2;
3851
3895
  this.sourceSpan = sourceSpan;
3852
3896
  this.expressionPlaceholder = expressionPlaceholder;
3853
3897
  }
@@ -3891,6 +3935,21 @@ var IcuPlaceholder = class {
3891
3935
  return visitor.visitIcuPlaceholder(this, context);
3892
3936
  }
3893
3937
  };
3938
+ var BlockPlaceholder = class {
3939
+ constructor(name, parameters, startName, closeName, children, sourceSpan, startSourceSpan, endSourceSpan) {
3940
+ this.name = name;
3941
+ this.parameters = parameters;
3942
+ this.startName = startName;
3943
+ this.closeName = closeName;
3944
+ this.children = children;
3945
+ this.sourceSpan = sourceSpan;
3946
+ this.startSourceSpan = startSourceSpan;
3947
+ this.endSourceSpan = endSourceSpan;
3948
+ }
3949
+ visit(visitor, context) {
3950
+ return visitor.visitBlockPlaceholder(this, context);
3951
+ }
3952
+ };
3894
3953
  var RecurseVisitor = class {
3895
3954
  visitText(text2, context) {
3896
3955
  }
@@ -3909,6 +3968,9 @@ var RecurseVisitor = class {
3909
3968
  }
3910
3969
  visitIcuPlaceholder(ph, context) {
3911
3970
  }
3971
+ visitBlockPlaceholder(ph, context) {
3972
+ ph.children.forEach((child) => child.visit(this));
3973
+ }
3912
3974
  };
3913
3975
  function serializeMessage(messageNodes) {
3914
3976
  const visitor = new LocalizeMessageStringVisitor();
@@ -3936,9 +3998,13 @@ var LocalizeMessageStringVisitor = class {
3936
3998
  visitIcuPlaceholder(ph) {
3937
3999
  return `{$${ph.name}}`;
3938
4000
  }
4001
+ visitBlockPlaceholder(ph) {
4002
+ const children = ph.children.map((child) => child.visit(this)).join("");
4003
+ return `{$${ph.startName}}${children}{$${ph.closeName}}`;
4004
+ }
3939
4005
  };
3940
4006
 
3941
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/i18n/serializers/xml_helper.mjs
4007
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/serializers/xml_helper.mjs
3942
4008
  var _Visitor = class {
3943
4009
  visitTag(tag) {
3944
4010
  const strAttrs = this._serializeAttributes(tag.attrs);
@@ -3966,12 +4032,12 @@ ${doctype.dtd}
3966
4032
  };
3967
4033
  var _visitor = new _Visitor();
3968
4034
 
3969
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/i18n/serializers/xmb.mjs
4035
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/serializers/xmb.mjs
3970
4036
  function toPublicName(internalName) {
3971
4037
  return internalName.toUpperCase().replace(/[^A-Z0-9_]/g, "_");
3972
4038
  }
3973
4039
 
3974
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/i18n/util.mjs
4040
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/i18n/util.mjs
3975
4041
  var CLOSURE_TRANSLATION_VAR_PREFIX = "MSG_";
3976
4042
  var TRANSLATION_VAR_PREFIX = "i18n_";
3977
4043
  var I18N_ATTR = "i18n";
@@ -4073,7 +4139,7 @@ function declareI18nVariable(variable2) {
4073
4139
  return new DeclareVarStmt(variable2.name, void 0, INFERRED_TYPE, void 0, variable2.sourceSpan);
4074
4140
  }
4075
4141
 
4076
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/util.mjs
4142
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/util.mjs
4077
4143
  var UNSAFE_OBJECT_KEY_NAME_REGEXP = /[-.]/;
4078
4144
  var TEMPORARY_NAME = "_t";
4079
4145
  var CONTEXT_NAME = "ctx";
@@ -4240,6 +4306,23 @@ var DefinitionMap = class {
4240
4306
  return literalMap(this.values);
4241
4307
  }
4242
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
+ }
4243
4326
  function getAttrsForDirectiveMatching(elOrTpl) {
4244
4327
  const attributesMap = {};
4245
4328
  if (elOrTpl instanceof Template && elOrTpl.tagName !== "ng-template") {
@@ -4296,7 +4379,7 @@ function getInstructionStatements(instructions) {
4296
4379
  return statements;
4297
4380
  }
4298
4381
 
4299
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/injectable_compiler_2.mjs
4382
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/injectable_compiler_2.mjs
4300
4383
  function compileInjectable(meta, resolveForwardRefs) {
4301
4384
  let result = null;
4302
4385
  const factoryMeta = {
@@ -4381,7 +4464,7 @@ function createFactoryFunction(type) {
4381
4464
  return arrowFn([new FnParam("t", DYNAMIC_TYPE)], type.prop("\u0275fac").callFn([variable("t")]));
4382
4465
  }
4383
4466
 
4384
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/assertions.mjs
4467
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/assertions.mjs
4385
4468
  var UNUSABLE_INTERPOLATION_REGEXPS = [
4386
4469
  /^\s*$/,
4387
4470
  /[<>]/,
@@ -4403,7 +4486,7 @@ function assertInterpolationSymbols(identifier, value) {
4403
4486
  }
4404
4487
  }
4405
4488
 
4406
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/ml_parser/interpolation_config.mjs
4489
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/defaults.mjs
4407
4490
  var InterpolationConfig = class {
4408
4491
  static fromArray(markers) {
4409
4492
  if (!markers) {
@@ -4418,8 +4501,9 @@ var InterpolationConfig = class {
4418
4501
  }
4419
4502
  };
4420
4503
  var DEFAULT_INTERPOLATION_CONFIG = new InterpolationConfig("{{", "}}");
4504
+ var DEFAULT_CONTAINER_BLOCKS = /* @__PURE__ */ new Set(["switch"]);
4421
4505
 
4422
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/chars.mjs
4506
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/chars.mjs
4423
4507
  var $EOF = 0;
4424
4508
  var $BSPACE = 8;
4425
4509
  var $TAB = 9;
@@ -4501,7 +4585,7 @@ function isQuote(code) {
4501
4585
  return code === $SQ || code === $DQ || code === $BT;
4502
4586
  }
4503
4587
 
4504
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/parse_util.mjs
4588
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/parse_util.mjs
4505
4589
  var ParseLocation = class {
4506
4590
  constructor(file, offset, line, col) {
4507
4591
  this.file = file;
@@ -4648,7 +4732,7 @@ function sanitizeIdentifier(name) {
4648
4732
  return name.replace(/\W/g, "_");
4649
4733
  }
4650
4734
 
4651
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/output/abstract_js_emitter.mjs
4735
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/output/abstract_js_emitter.mjs
4652
4736
  var makeTemplateObjectPolyfill = '(this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e})';
4653
4737
  var AbstractJsEmitterVisitor = class extends AbstractEmitterVisitor {
4654
4738
  constructor() {
@@ -4741,7 +4825,7 @@ var AbstractJsEmitterVisitor = class extends AbstractEmitterVisitor {
4741
4825
  }
4742
4826
  };
4743
4827
 
4744
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/output/output_jit_trusted_types.mjs
4828
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/output/output_jit_trusted_types.mjs
4745
4829
  var policy;
4746
4830
  function getPolicy() {
4747
4831
  if (policy === void 0) {
@@ -4779,7 +4863,7 @@ function newTrustedFunctionForJIT(...args) {
4779
4863
  return fn2.bind(_global);
4780
4864
  }
4781
4865
 
4782
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/output/output_jit.mjs
4866
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/output/output_jit.mjs
4783
4867
  var JitEvaluator = class {
4784
4868
  evaluateStatements(sourceUrl, statements, refResolver, createSourceMaps) {
4785
4869
  const converter = new JitEmitterVisitor(refResolver);
@@ -4870,7 +4954,7 @@ function isUseStrictStatement(statement) {
4870
4954
  return statement.isEquivalent(literal("use strict").toStmt());
4871
4955
  }
4872
4956
 
4873
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/r3_injector_compiler.mjs
4957
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_injector_compiler.mjs
4874
4958
  function compileInjector(meta) {
4875
4959
  const definitionMap = new DefinitionMap();
4876
4960
  if (meta.providers !== null) {
@@ -4887,7 +4971,7 @@ function createInjectorType(meta) {
4887
4971
  return new ExpressionType(importExpr(Identifiers.InjectorDeclaration, [new ExpressionType(meta.type.type)]));
4888
4972
  }
4889
4973
 
4890
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/r3_jit.mjs
4974
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_jit.mjs
4891
4975
  var R3JitReflector = class {
4892
4976
  constructor(context) {
4893
4977
  this.context = context;
@@ -4903,7 +4987,7 @@ var R3JitReflector = class {
4903
4987
  }
4904
4988
  };
4905
4989
 
4906
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/r3_module_compiler.mjs
4990
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_module_compiler.mjs
4907
4991
  var R3SelectorScopeMode;
4908
4992
  (function(R3SelectorScopeMode2) {
4909
4993
  R3SelectorScopeMode2[R3SelectorScopeMode2["Inline"] = 0] = "Inline";
@@ -5044,7 +5128,7 @@ function tupleOfTypes(types) {
5044
5128
  return types.length > 0 ? expressionType(literalArr(typeofTypes)) : NONE_TYPE;
5045
5129
  }
5046
5130
 
5047
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/r3_pipe_compiler.mjs
5131
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_pipe_compiler.mjs
5048
5132
  function compilePipeFromMetadata(metadata) {
5049
5133
  const definitionMapValues = [];
5050
5134
  definitionMapValues.push({ key: "name", value: literal(metadata.pipeName), quoted: false });
@@ -5065,7 +5149,7 @@ function createPipeType(metadata) {
5065
5149
  ]));
5066
5150
  }
5067
5151
 
5068
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/api.mjs
5152
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/api.mjs
5069
5153
  var R3TemplateDependencyKind;
5070
5154
  (function(R3TemplateDependencyKind2) {
5071
5155
  R3TemplateDependencyKind2[R3TemplateDependencyKind2["Directive"] = 0] = "Directive";
@@ -5073,7 +5157,7 @@ var R3TemplateDependencyKind;
5073
5157
  R3TemplateDependencyKind2[R3TemplateDependencyKind2["NgModule"] = 2] = "NgModule";
5074
5158
  })(R3TemplateDependencyKind || (R3TemplateDependencyKind = {}));
5075
5159
 
5076
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/expression_parser/ast.mjs
5160
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/expression_parser/ast.mjs
5077
5161
  var ParserError = class {
5078
5162
  constructor(message, input, errLocation, ctxLocation) {
5079
5163
  this.input = input;
@@ -5739,7 +5823,7 @@ var BoundElementProperty = class {
5739
5823
  }
5740
5824
  };
5741
5825
 
5742
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/compiler_util/expression_converter.mjs
5826
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/compiler_util/expression_converter.mjs
5743
5827
  var _EventHandlerVars = class {
5744
5828
  };
5745
5829
  var EventHandlerVars = _EventHandlerVars;
@@ -6380,7 +6464,7 @@ var BuiltinFunctionCall = class extends Call {
6380
6464
  }
6381
6465
  };
6382
6466
 
6383
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/schema/dom_security_schema.mjs
6467
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/schema/dom_security_schema.mjs
6384
6468
  var _SECURITY_SCHEMA;
6385
6469
  function SECURITY_SCHEMA() {
6386
6470
  if (!_SECURITY_SCHEMA) {
@@ -6438,7 +6522,7 @@ function isIframeSecuritySensitiveAttr(attrName) {
6438
6522
  return IFRAME_SECURITY_SENSITIVE_ATTRS.has(attrName.toLowerCase());
6439
6523
  }
6440
6524
 
6441
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/shadow_css.mjs
6525
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/shadow_css.mjs
6442
6526
  var animationKeywords = /* @__PURE__ */ new Set([
6443
6527
  "inherit",
6444
6528
  "initial",
@@ -6909,7 +6993,7 @@ function repeatGroups(groups, multiples) {
6909
6993
  }
6910
6994
  }
6911
6995
 
6912
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/enums.mjs
6996
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/enums.mjs
6913
6997
  var OpKind;
6914
6998
  (function(OpKind2) {
6915
6999
  OpKind2[OpKind2["ListEnd"] = 0] = "ListEnd";
@@ -7063,8 +7147,13 @@ var DerivedRepeaterVarIdentity;
7063
7147
  DerivedRepeaterVarIdentity2[DerivedRepeaterVarIdentity2["Even"] = 2] = "Even";
7064
7148
  DerivedRepeaterVarIdentity2[DerivedRepeaterVarIdentity2["Odd"] = 3] = "Odd";
7065
7149
  })(DerivedRepeaterVarIdentity || (DerivedRepeaterVarIdentity = {}));
7150
+ var I18nContextKind;
7151
+ (function(I18nContextKind2) {
7152
+ I18nContextKind2[I18nContextKind2["RootI18n"] = 0] = "RootI18n";
7153
+ I18nContextKind2[I18nContextKind2["Icu"] = 1] = "Icu";
7154
+ })(I18nContextKind || (I18nContextKind = {}));
7066
7155
 
7067
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/traits.mjs
7156
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/traits.mjs
7068
7157
  var ConsumesSlot = Symbol("ConsumesSlot");
7069
7158
  var DependsOnSlotContext = Symbol("DependsOnSlotContext");
7070
7159
  var ConsumesVarsTrait = Symbol("ConsumesVars");
@@ -7096,7 +7185,7 @@ function hasUsesVarOffsetTrait(expr) {
7096
7185
  return expr[UsesVarOffset] === true;
7097
7186
  }
7098
7187
 
7099
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/shared.mjs
7188
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/shared.mjs
7100
7189
  function createStatementOp(statement) {
7101
7190
  return __spreadValues({
7102
7191
  kind: OpKind.Statement,
@@ -7118,7 +7207,7 @@ var NEW_OP = {
7118
7207
  next: null
7119
7208
  };
7120
7209
 
7121
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/update.mjs
7210
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/update.mjs
7122
7211
  function createInterpolateTextOp(xref, interpolation, i18nPlaceholders, sourceSpan) {
7123
7212
  return __spreadValues(__spreadValues(__spreadValues({
7124
7213
  kind: OpKind.InterpolateText,
@@ -7229,13 +7318,13 @@ function createConditionalOp(target, targetSlot, test, conditions, sourceSpan) {
7229
7318
  }, NEW_OP), TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS);
7230
7319
  }
7231
7320
  function createRepeaterOp(repeaterCreate2, targetSlot, collection, sourceSpan) {
7232
- return __spreadValues({
7321
+ return __spreadValues(__spreadValues({
7233
7322
  kind: OpKind.Repeater,
7234
7323
  target: repeaterCreate2,
7235
7324
  targetSlot,
7236
7325
  collection,
7237
7326
  sourceSpan
7238
- }, NEW_OP);
7327
+ }, NEW_OP), TRAIT_DEPENDS_ON_SLOT_CONTEXT);
7239
7328
  }
7240
7329
  function createDeferWhenOp(target, expr, prefetch, sourceSpan) {
7241
7330
  return __spreadValues(__spreadValues({
@@ -7267,7 +7356,7 @@ function createI18nApplyOp(target, handle, sourceSpan) {
7267
7356
  }, NEW_OP);
7268
7357
  }
7269
7358
 
7270
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/expression.mjs
7359
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/expression.mjs
7271
7360
  var _a;
7272
7361
  var _b;
7273
7362
  var _c;
@@ -8118,7 +8207,7 @@ function isStringLiteral(expr) {
8118
8207
  return expr instanceof LiteralExpr && typeof expr.value === "string";
8119
8208
  }
8120
8209
 
8121
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/operations.mjs
8210
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/operations.mjs
8122
8211
  var _OpList = class {
8123
8212
  constructor() {
8124
8213
  this.debugListId = _OpList.nextListId++;
@@ -8309,14 +8398,14 @@ var OpList = _OpList;
8309
8398
  _OpList.nextListId = 0;
8310
8399
  })();
8311
8400
 
8312
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/handle.mjs
8401
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/handle.mjs
8313
8402
  var SlotHandle = class {
8314
8403
  constructor() {
8315
8404
  this.slot = null;
8316
8405
  }
8317
8406
  };
8318
8407
 
8319
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/create.mjs
8408
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/create.mjs
8320
8409
  var elementContainerOpKinds = /* @__PURE__ */ new Set([
8321
8410
  OpKind.Element,
8322
8411
  OpKind.ElementStart,
@@ -8548,9 +8637,10 @@ function createIcuEndOp(xref) {
8548
8637
  xref
8549
8638
  }, NEW_OP);
8550
8639
  }
8551
- function createI18nContextOp(xref, i18nBlock, message, sourceSpan) {
8640
+ function createI18nContextOp(contextKind, xref, i18nBlock, message, sourceSpan) {
8552
8641
  return __spreadValues({
8553
8642
  kind: OpKind.I18nContext,
8643
+ contextKind,
8554
8644
  xref,
8555
8645
  i18nBlock,
8556
8646
  message,
@@ -8560,7 +8650,7 @@ function createI18nContextOp(xref, i18nBlock, message, sourceSpan) {
8560
8650
  }, NEW_OP);
8561
8651
  }
8562
8652
 
8563
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/host.mjs
8653
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/host.mjs
8564
8654
  function createHostPropertyOp(name, expression, isAnimationTrigger, sourceSpan) {
8565
8655
  return __spreadValues(__spreadValues({
8566
8656
  kind: OpKind.HostProperty,
@@ -8571,10 +8661,10 @@ function createHostPropertyOp(name, expression, isAnimationTrigger, sourceSpan)
8571
8661
  }, TRAIT_CONSUMES_VARS), NEW_OP);
8572
8662
  }
8573
8663
 
8574
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/variable.mjs
8664
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/variable.mjs
8575
8665
  var CTX_REF = "CTX_REF_MARKER";
8576
8666
 
8577
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/compilation.mjs
8667
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/compilation.mjs
8578
8668
  var CompilationJobKind;
8579
8669
  (function(CompilationJobKind2) {
8580
8670
  CompilationJobKind2[CompilationJobKind2["Tmpl"] = 0] = "Tmpl";
@@ -8681,7 +8771,7 @@ var HostBindingCompilationUnit = class extends CompilationUnit {
8681
8771
  }
8682
8772
  };
8683
8773
 
8684
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/any_cast.mjs
8774
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/any_cast.mjs
8685
8775
  function deleteAnyCasts(job) {
8686
8776
  for (const unit of job.units) {
8687
8777
  for (const op of unit.ops()) {
@@ -8699,7 +8789,7 @@ function removeAnys(e) {
8699
8789
  return e;
8700
8790
  }
8701
8791
 
8702
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/apply_i18n_expressions.mjs
8792
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/apply_i18n_expressions.mjs
8703
8793
  function applyI18nExpressions(job) {
8704
8794
  const i18nContexts = /* @__PURE__ */ new Map();
8705
8795
  for (const unit of job.units) {
@@ -8730,10 +8820,9 @@ function needsApplication(i18nContexts, op) {
8730
8820
  return false;
8731
8821
  }
8732
8822
 
8733
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/assign_i18n_slot_dependencies.mjs
8823
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/assign_i18n_slot_dependencies.mjs
8734
8824
  function assignI18nSlotDependencies(job) {
8735
8825
  const i18nLastSlotConsumers = /* @__PURE__ */ new Map();
8736
- const i18nContexts = /* @__PURE__ */ new Map();
8737
8826
  let lastSlotConsumer = null;
8738
8827
  let currentI18nOp = null;
8739
8828
  for (const unit of job.units) {
@@ -8749,21 +8838,17 @@ function assignI18nSlotDependencies(job) {
8749
8838
  i18nLastSlotConsumers.set(currentI18nOp.xref, lastSlotConsumer);
8750
8839
  currentI18nOp = null;
8751
8840
  break;
8752
- case OpKind.I18nContext:
8753
- i18nContexts.set(op.xref, op);
8754
- break;
8755
8841
  }
8756
8842
  }
8757
8843
  for (const op of unit.update) {
8758
8844
  if (op.kind === OpKind.I18nExpression) {
8759
- const i18nContext = i18nContexts.get(op.context);
8760
- op.target = i18nLastSlotConsumers.get(i18nContext.i18nBlock);
8845
+ op.target = i18nLastSlotConsumers.get(op.target);
8761
8846
  }
8762
8847
  }
8763
8848
  }
8764
8849
  }
8765
8850
 
8766
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/util/elements.mjs
8851
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/util/elements.mjs
8767
8852
  function createOpXrefMap(unit) {
8768
8853
  const map = /* @__PURE__ */ new Map();
8769
8854
  for (const op of unit.create) {
@@ -8775,7 +8860,7 @@ function createOpXrefMap(unit) {
8775
8860
  return map;
8776
8861
  }
8777
8862
 
8778
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/attribute_extraction.mjs
8863
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/attribute_extraction.mjs
8779
8864
  function extractAttributes(job) {
8780
8865
  for (const unit of job.units) {
8781
8866
  const elements = createOpXrefMap(unit);
@@ -8842,7 +8927,7 @@ function extractAttributeOp(unit, op, elements) {
8842
8927
  }
8843
8928
  }
8844
8929
 
8845
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/binding_specialization.mjs
8930
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/binding_specialization.mjs
8846
8931
  function lookupElement2(elements, xref) {
8847
8932
  const el = elements.get(xref);
8848
8933
  if (el === void 0) {
@@ -8892,7 +8977,7 @@ function specializeBindings(job) {
8892
8977
  }
8893
8978
  }
8894
8979
 
8895
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/chaining.mjs
8980
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/chaining.mjs
8896
8981
  var CHAINABLE = /* @__PURE__ */ new Set([
8897
8982
  Identifiers.attribute,
8898
8983
  Identifiers.classProp,
@@ -8958,7 +9043,7 @@ function chainOperationsInList(opList) {
8958
9043
  }
8959
9044
  }
8960
9045
 
8961
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/collapse_singleton_interpolations.mjs
9046
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/collapse_singleton_interpolations.mjs
8962
9047
  function collapseSingletonInterpolations(job) {
8963
9048
  for (const unit of job.units) {
8964
9049
  for (const op of unit.update) {
@@ -8970,7 +9055,7 @@ function collapseSingletonInterpolations(job) {
8970
9055
  }
8971
9056
  }
8972
9057
 
8973
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/conditionals.mjs
9058
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/conditionals.mjs
8974
9059
  function generateConditionalExpressions(job) {
8975
9060
  for (const unit of job.units) {
8976
9061
  for (const op of unit.ops()) {
@@ -9007,40 +9092,7 @@ function generateConditionalExpressions(job) {
9007
9092
  }
9008
9093
  }
9009
9094
 
9010
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/ml_parser/tags.mjs
9011
- var TagContentType;
9012
- (function(TagContentType2) {
9013
- TagContentType2[TagContentType2["RAW_TEXT"] = 0] = "RAW_TEXT";
9014
- TagContentType2[TagContentType2["ESCAPABLE_RAW_TEXT"] = 1] = "ESCAPABLE_RAW_TEXT";
9015
- TagContentType2[TagContentType2["PARSABLE_DATA"] = 2] = "PARSABLE_DATA";
9016
- })(TagContentType || (TagContentType = {}));
9017
- function splitNsName(elementName) {
9018
- if (elementName[0] != ":") {
9019
- return [null, elementName];
9020
- }
9021
- const colonIndex = elementName.indexOf(":", 1);
9022
- if (colonIndex === -1) {
9023
- throw new Error(`Unsupported format "${elementName}" expecting ":namespace:name"`);
9024
- }
9025
- return [elementName.slice(1, colonIndex), elementName.slice(colonIndex + 1)];
9026
- }
9027
- function isNgContainer(tagName) {
9028
- return splitNsName(tagName)[1] === "ng-container";
9029
- }
9030
- function isNgContent(tagName) {
9031
- return splitNsName(tagName)[1] === "ng-content";
9032
- }
9033
- function isNgTemplate(tagName) {
9034
- return splitNsName(tagName)[1] === "ng-template";
9035
- }
9036
- function getNsPrefix(fullName) {
9037
- return fullName === null ? null : splitNsName(fullName)[0];
9038
- }
9039
- function mergeNsAndName(prefix, localName) {
9040
- return prefix ? `:${prefix}:${localName}` : localName;
9041
- }
9042
-
9043
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/conversion.mjs
9095
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/conversion.mjs
9044
9096
  var BINARY_OPERATORS = /* @__PURE__ */ new Map([
9045
9097
  ["&&", BinaryOperator.And],
9046
9098
  [">", BinaryOperator.Bigger],
@@ -9090,7 +9142,7 @@ function literalOrArrayLiteral(value) {
9090
9142
  return literal(value);
9091
9143
  }
9092
9144
 
9093
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/const_collection.mjs
9145
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/const_collection.mjs
9094
9146
  function collectElementConsts(job) {
9095
9147
  const allElementAttributes = /* @__PURE__ */ new Map();
9096
9148
  for (const unit of job.units) {
@@ -9224,7 +9276,7 @@ function serializeAttributes({ attributes, bindings, classes, i18n: i18n2, proje
9224
9276
  return literalArr(attrArray);
9225
9277
  }
9226
9278
 
9227
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/create_defer_deps_fns.mjs
9279
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/create_defer_deps_fns.mjs
9228
9280
  function createDeferDepsFns(job) {
9229
9281
  for (const unit of job.units) {
9230
9282
  for (const op of unit.create) {
@@ -9252,18 +9304,22 @@ function createDeferDepsFns(job) {
9252
9304
  }
9253
9305
  }
9254
9306
 
9255
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/create_i18n_contexts.mjs
9307
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/create_i18n_contexts.mjs
9256
9308
  function createI18nContexts(job) {
9309
+ const rootContexts = /* @__PURE__ */ new Map();
9257
9310
  let currentI18nOp = null;
9258
9311
  let xref;
9259
9312
  for (const unit of job.units) {
9260
9313
  for (const op of unit.create) {
9261
9314
  switch (op.kind) {
9262
9315
  case OpKind.I18nStart:
9263
- xref = job.allocateXrefId();
9264
- unit.create.push(createI18nContextOp(xref, op.xref, op.message, null));
9265
- op.context = xref;
9266
9316
  currentI18nOp = op;
9317
+ if (op.xref === op.root) {
9318
+ xref = job.allocateXrefId();
9319
+ unit.create.push(createI18nContextOp(I18nContextKind.RootI18n, xref, op.xref, op.message, null));
9320
+ op.context = xref;
9321
+ rootContexts.set(op.xref, xref);
9322
+ }
9267
9323
  break;
9268
9324
  case OpKind.I18nEnd:
9269
9325
  currentI18nOp = null;
@@ -9274,7 +9330,7 @@ function createI18nContexts(job) {
9274
9330
  }
9275
9331
  if (op.message.id !== currentI18nOp.message.id) {
9276
9332
  xref = job.allocateXrefId();
9277
- unit.create.push(createI18nContextOp(xref, currentI18nOp.xref, op.message, null));
9333
+ unit.create.push(createI18nContextOp(I18nContextKind.Icu, xref, currentI18nOp.xref, op.message, null));
9278
9334
  op.context = xref;
9279
9335
  } else {
9280
9336
  op.context = currentI18nOp.context;
@@ -9283,9 +9339,16 @@ function createI18nContexts(job) {
9283
9339
  }
9284
9340
  }
9285
9341
  }
9342
+ for (const unit of job.units) {
9343
+ for (const op of unit.create) {
9344
+ if (op.kind === OpKind.I18nStart && op.xref !== op.root) {
9345
+ op.context = rootContexts.get(op.root);
9346
+ }
9347
+ }
9348
+ }
9286
9349
  }
9287
9350
 
9288
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/defer_configs.mjs
9351
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/defer_configs.mjs
9289
9352
  function configureDeferInstructions(job) {
9290
9353
  for (const unit of job.units) {
9291
9354
  for (const op of unit.create) {
@@ -9302,7 +9365,7 @@ function configureDeferInstructions(job) {
9302
9365
  }
9303
9366
  }
9304
9367
 
9305
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/defer_resolve_targets.mjs
9368
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/defer_resolve_targets.mjs
9306
9369
  function resolveDeferTargetNames(job) {
9307
9370
  const scopes = /* @__PURE__ */ new Map();
9308
9371
  function getScopeForView2(view) {
@@ -9396,7 +9459,7 @@ var Scope = class {
9396
9459
  }
9397
9460
  };
9398
9461
 
9399
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/empty_elements.mjs
9462
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/empty_elements.mjs
9400
9463
  var REPLACEMENTS = /* @__PURE__ */ new Map([
9401
9464
  [OpKind.ElementEnd, [OpKind.ElementStart, OpKind.Element]],
9402
9465
  [OpKind.ContainerEnd, [OpKind.ContainerStart, OpKind.Container]],
@@ -9423,7 +9486,7 @@ function collapseEmptyInstructions(job) {
9423
9486
  }
9424
9487
  }
9425
9488
 
9426
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/expand_safe_reads.mjs
9489
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/expand_safe_reads.mjs
9427
9490
  function expandSafeReads(job) {
9428
9491
  for (const unit of job.units) {
9429
9492
  for (const op of unit.ops()) {
@@ -9559,7 +9622,7 @@ function ternaryTransform(e) {
9559
9622
  return new ConditionalExpr(new BinaryOperatorExpr(BinaryOperator.Equals, e.guard, NULL_EXPR), NULL_EXPR, e.expr);
9560
9623
  }
9561
9624
 
9562
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/extract_i18n_messages.mjs
9625
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/extract_i18n_messages.mjs
9563
9626
  var ESCAPE = "\uFFFD";
9564
9627
  var ELEMENT_MARKER = "#";
9565
9628
  var TEMPLATE_MARKER = "*";
@@ -9570,7 +9633,7 @@ var LIST_END_MARKER = "]";
9570
9633
  var LIST_DELIMITER = "|";
9571
9634
  function extractI18nMessages(job) {
9572
9635
  const i18nContexts = /* @__PURE__ */ new Map();
9573
- const i18nBlockContexts = /* @__PURE__ */ new Set();
9636
+ const i18nBlocks = /* @__PURE__ */ new Map();
9574
9637
  for (const unit of job.units) {
9575
9638
  for (const op of unit.create) {
9576
9639
  switch (op.kind) {
@@ -9578,7 +9641,7 @@ function extractI18nMessages(job) {
9578
9641
  i18nContexts.set(op.xref, op);
9579
9642
  break;
9580
9643
  case OpKind.I18nStart:
9581
- i18nBlockContexts.add(op.context);
9644
+ i18nBlocks.set(op.xref, op);
9582
9645
  break;
9583
9646
  }
9584
9647
  }
@@ -9603,11 +9666,12 @@ function extractI18nMessages(job) {
9603
9666
  if (!op.context) {
9604
9667
  throw Error("ICU op should have its context set.");
9605
9668
  }
9606
- if (!i18nBlockContexts.has(op.context)) {
9607
- const i18nContext = i18nContexts.get(op.context);
9669
+ const i18nContext = i18nContexts.get(op.context);
9670
+ if (i18nContext.contextKind === I18nContextKind.Icu) {
9608
9671
  const subMessage = createI18nMessage(job, i18nContext, op.messagePlaceholder);
9609
9672
  unit.create.push(subMessage);
9610
- const parentMessage = i18nBlockMessages.get(i18nContext.i18nBlock);
9673
+ const rootI18nId = i18nBlocks.get(i18nContext.i18nBlock).root;
9674
+ const parentMessage = i18nBlockMessages.get(rootI18nId);
9611
9675
  parentMessage == null ? void 0 : parentMessage.subMessages.push(subMessage.xref);
9612
9676
  }
9613
9677
  OpList.remove(op);
@@ -9620,30 +9684,67 @@ function extractI18nMessages(job) {
9620
9684
  }
9621
9685
  }
9622
9686
  function createI18nMessage(job, context, messagePlaceholder) {
9623
- let needsPostprocessing = context.postprocessingParams.size > 0;
9624
- for (const values of context.params.values()) {
9625
- if (values.length > 1) {
9626
- needsPostprocessing = true;
9627
- }
9628
- }
9629
- return createI18nMessageOp(job.allocateXrefId(), context.i18nBlock, context.message, messagePlaceholder != null ? messagePlaceholder : null, formatParams(context.params), formatParams(context.postprocessingParams), needsPostprocessing);
9687
+ let [formattedParams, needsPostprocessing] = formatParams(context.params);
9688
+ const [formattedPostprocessingParams] = formatParams(context.postprocessingParams);
9689
+ needsPostprocessing || (needsPostprocessing = formattedPostprocessingParams.size > 0);
9690
+ return createI18nMessageOp(job.allocateXrefId(), context.i18nBlock, context.message, messagePlaceholder != null ? messagePlaceholder : null, formattedParams, formattedPostprocessingParams, needsPostprocessing);
9630
9691
  }
9631
9692
  function formatParams(params) {
9632
- const result = /* @__PURE__ */ new Map();
9693
+ const formattedParams = /* @__PURE__ */ new Map();
9694
+ let needsPostprocessing = false;
9633
9695
  for (const [placeholder, placeholderValues] of params) {
9634
- const serializedValues = formatParamValues(placeholderValues);
9696
+ const [serializedValues, paramNeedsPostprocessing] = formatParamValues(placeholderValues);
9697
+ needsPostprocessing || (needsPostprocessing = paramNeedsPostprocessing);
9635
9698
  if (serializedValues !== null) {
9636
- result.set(placeholder, literal(formatParamValues(placeholderValues)));
9699
+ formattedParams.set(placeholder, literal(serializedValues));
9637
9700
  }
9638
9701
  }
9639
- return result;
9702
+ return [formattedParams, needsPostprocessing];
9640
9703
  }
9641
9704
  function formatParamValues(values) {
9642
9705
  if (values.length === 0) {
9643
- return null;
9706
+ return [null, false];
9644
9707
  }
9708
+ collapseElementTemplatePairs(values);
9645
9709
  const serializedValues = values.map((value) => formatValue(value));
9646
- return serializedValues.length === 1 ? serializedValues[0] : `${LIST_START_MARKER}${serializedValues.join(LIST_DELIMITER)}${LIST_END_MARKER}`;
9710
+ return serializedValues.length === 1 ? [serializedValues[0], false] : [`${LIST_START_MARKER}${serializedValues.join(LIST_DELIMITER)}${LIST_END_MARKER}`, true];
9711
+ }
9712
+ function collapseElementTemplatePairs(values) {
9713
+ var _a2;
9714
+ const valueIndiciesBySubTemplateIndex = /* @__PURE__ */ new Map();
9715
+ for (let i = 0; i < values.length; i++) {
9716
+ const value = values[i];
9717
+ if (value.subTemplateIndex !== null && value.flags & (I18nParamValueFlags.ElementTag | I18nParamValueFlags.TemplateTag)) {
9718
+ const valueIndicies = (_a2 = valueIndiciesBySubTemplateIndex.get(value.subTemplateIndex)) != null ? _a2 : [];
9719
+ valueIndicies.push(i);
9720
+ valueIndiciesBySubTemplateIndex.set(value.subTemplateIndex, valueIndicies);
9721
+ }
9722
+ }
9723
+ for (const [subTemplateIndex, valueIndicies] of valueIndiciesBySubTemplateIndex) {
9724
+ if (valueIndicies.length > 1) {
9725
+ const elementIndex = valueIndicies.find((index) => values[index].flags & I18nParamValueFlags.ElementTag);
9726
+ const templateIndex = valueIndicies.find((index) => values[index].flags & I18nParamValueFlags.TemplateTag);
9727
+ if (elementIndex !== void 0 && templateIndex !== void 0) {
9728
+ const elementValue = values[elementIndex];
9729
+ const templateValue = values[templateIndex];
9730
+ let compundValue;
9731
+ if (elementValue.flags & I18nParamValueFlags.OpenTag && elementValue.flags & I18nParamValueFlags.CloseTag) {
9732
+ compundValue = `${formatValue(templateValue)}${formatValue(elementValue)}${formatValue(templateValue)}`;
9733
+ } else if (elementValue.flags & I18nParamValueFlags.OpenTag) {
9734
+ compundValue = `${formatValue(templateValue)}${formatValue(elementValue)}`;
9735
+ } else {
9736
+ compundValue = `${formatValue(elementValue)}${formatValue(templateValue)}`;
9737
+ }
9738
+ values.splice(elementIndex, 1, { value: compundValue, subTemplateIndex, flags: I18nParamValueFlags.None });
9739
+ values.splice(templateIndex, 1, null);
9740
+ }
9741
+ }
9742
+ }
9743
+ for (let i = values.length - 1; i >= 0; i--) {
9744
+ if (values[i] === null) {
9745
+ values.splice(i, 1);
9746
+ }
9747
+ }
9647
9748
  }
9648
9749
  function formatValue(value) {
9649
9750
  if (value.flags === I18nParamValueFlags.None) {
@@ -9666,7 +9767,7 @@ function formatValue(value) {
9666
9767
  return `${ESCAPE}${closeMarker}${tagMarker}${value.value}${context}${ESCAPE}`;
9667
9768
  }
9668
9769
 
9669
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_advance.mjs
9770
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_advance.mjs
9670
9771
  function generateAdvance(job) {
9671
9772
  for (const unit of job.units) {
9672
9773
  const slotMap = /* @__PURE__ */ new Map();
@@ -9698,7 +9799,7 @@ function generateAdvance(job) {
9698
9799
  }
9699
9800
  }
9700
9801
 
9701
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_projection_def.mjs
9802
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_projection_def.mjs
9702
9803
  function generateProjectionDefs(job) {
9703
9804
  const share = job.compatibility === CompatibilityMode.TemplateDefinitionBuilder;
9704
9805
  const selectors = [];
@@ -9722,7 +9823,7 @@ function generateProjectionDefs(job) {
9722
9823
  }
9723
9824
  }
9724
9825
 
9725
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_variables.mjs
9826
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_variables.mjs
9726
9827
  function generateVariables(job) {
9727
9828
  recursivelyProcessView(job.root, null);
9728
9829
  }
@@ -9810,7 +9911,7 @@ function generateVariablesInScopeForView(view, scope) {
9810
9911
  return newOps;
9811
9912
  }
9812
9913
 
9813
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/has_const_expression_collection.mjs
9914
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/has_const_expression_collection.mjs
9814
9915
  function collectConstExpressions(job) {
9815
9916
  for (const unit of job.units) {
9816
9917
  for (const op of unit.ops()) {
@@ -9824,7 +9925,7 @@ function collectConstExpressions(job) {
9824
9925
  }
9825
9926
  }
9826
9927
 
9827
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/host_style_property_parsing.mjs
9928
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/host_style_property_parsing.mjs
9828
9929
  var STYLE_DOT = "style.";
9829
9930
  var CLASS_DOT = "class.";
9830
9931
  var STYLE_BANG = "style!";
@@ -9882,7 +9983,7 @@ function parseProperty(name) {
9882
9983
  return { property: property2, suffix };
9883
9984
  }
9884
9985
 
9885
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/output/map_util.mjs
9986
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/output/map_util.mjs
9886
9987
  function mapLiteral(obj, quoted = false) {
9887
9988
  return literalMap(Object.keys(obj).map((key) => ({
9888
9989
  key,
@@ -9891,7 +9992,7 @@ function mapLiteral(obj, quoted = false) {
9891
9992
  })));
9892
9993
  }
9893
9994
 
9894
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/i18n/icu_serializer.mjs
9995
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/i18n/icu_serializer.mjs
9895
9996
  var IcuSerializerVisitor = class {
9896
9997
  visitText(text2) {
9897
9998
  return text2.value;
@@ -9910,6 +10011,9 @@ var IcuSerializerVisitor = class {
9910
10011
  visitPlaceholder(ph) {
9911
10012
  return this.formatPh(ph.name);
9912
10013
  }
10014
+ visitBlockPlaceholder(ph) {
10015
+ return `${this.formatPh(ph.startName)}${ph.children.map((child) => child.visit(this)).join("")}${this.formatPh(ph.closeName)}`;
10016
+ }
9913
10017
  visitIcuPlaceholder(ph, context) {
9914
10018
  return this.formatPh(ph.name);
9915
10019
  }
@@ -9922,7 +10026,7 @@ function serializeIcuNode(icu) {
9922
10026
  return icu.visit(serializer);
9923
10027
  }
9924
10028
 
9925
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/expression_parser/lexer.mjs
10029
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/expression_parser/lexer.mjs
9926
10030
  var TokenType;
9927
10031
  (function(TokenType2) {
9928
10032
  TokenType2[TokenType2["Character"] = 0] = "Character";
@@ -10283,7 +10387,7 @@ function parseIntAutoRadix(text2) {
10283
10387
  return result;
10284
10388
  }
10285
10389
 
10286
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/expression_parser/parser.mjs
10390
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/expression_parser/parser.mjs
10287
10391
  var SplitInterpolation = class {
10288
10392
  constructor(strings, expressions, offsets) {
10289
10393
  this.strings = strings;
@@ -11177,7 +11281,7 @@ function getIndexMapForOriginalTemplate(interpolatedTokens) {
11177
11281
  return offsetMap;
11178
11282
  }
11179
11283
 
11180
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/ml_parser/ast.mjs
11284
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/ast.mjs
11181
11285
  var NodeWithI18n = class {
11182
11286
  constructor(sourceSpan, i18n2) {
11183
11287
  this.sourceSpan = sourceSpan;
@@ -11195,11 +11299,11 @@ var Text4 = class extends NodeWithI18n {
11195
11299
  }
11196
11300
  };
11197
11301
  var Expansion = class extends NodeWithI18n {
11198
- constructor(switchValue, type, cases, sourceSpan, switchValueSourceSpan, i18n2) {
11302
+ constructor(switchValue, type, cases2, sourceSpan, switchValueSourceSpan, i18n2) {
11199
11303
  super(sourceSpan, i18n2);
11200
11304
  this.switchValue = switchValue;
11201
11305
  this.type = type;
11202
- this.cases = cases;
11306
+ this.cases = cases2;
11203
11307
  this.switchValueSourceSpan = switchValueSourceSpan;
11204
11308
  }
11205
11309
  visit(visitor, context) {
@@ -11253,12 +11357,12 @@ var Comment2 = class {
11253
11357
  return visitor.visitComment(this, context);
11254
11358
  }
11255
11359
  };
11256
- var Block = class {
11257
- constructor(name, parameters, children, sourceSpan, nameSpan, startSourceSpan, endSourceSpan = null) {
11360
+ var Block = class extends NodeWithI18n {
11361
+ constructor(name, parameters, children, sourceSpan, nameSpan, startSourceSpan, endSourceSpan = null, i18n2) {
11362
+ super(sourceSpan, i18n2);
11258
11363
  this.name = name;
11259
11364
  this.parameters = parameters;
11260
11365
  this.children = children;
11261
- this.sourceSpan = sourceSpan;
11262
11366
  this.nameSpan = nameSpan;
11263
11367
  this.startSourceSpan = startSourceSpan;
11264
11368
  this.endSourceSpan = endSourceSpan;
@@ -11329,11 +11433,11 @@ var RecursiveVisitor = class {
11329
11433
  }
11330
11434
  };
11331
11435
 
11332
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/schema/element_schema_registry.mjs
11436
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/schema/element_schema_registry.mjs
11333
11437
  var ElementSchemaRegistry = class {
11334
11438
  };
11335
11439
 
11336
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/schema/dom_element_schema_registry.mjs
11440
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/schema/dom_element_schema_registry.mjs
11337
11441
  var BOOLEAN = "boolean";
11338
11442
  var NUMBER = "number";
11339
11443
  var STRING = "string";
@@ -11686,7 +11790,7 @@ function _isPixelDimensionStyle(prop) {
11686
11790
  }
11687
11791
  }
11688
11792
 
11689
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/ml_parser/html_tags.mjs
11793
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/html_tags.mjs
11690
11794
  var HtmlTagDefinition = class {
11691
11795
  constructor({ closedByChildren, implicitNamespacePrefix, contentType = TagContentType.PARSABLE_DATA, closedByParent = false, isVoid = false, ignoreFirstLf = false, preventNamespaceInheritance = false, canSelfClose = false } = {}) {
11692
11796
  this.closedByChildren = {};
@@ -11804,7 +11908,7 @@ function getHtmlTagDefinition(tagName) {
11804
11908
  return (_b2 = (_a2 = TAG_DEFINITIONS[tagName]) != null ? _a2 : TAG_DEFINITIONS[tagName.toLowerCase()]) != null ? _b2 : DEFAULT_TAG_DEFINITION;
11805
11909
  }
11806
11910
 
11807
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/i18n/serializers/placeholder.mjs
11911
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/serializers/placeholder.mjs
11808
11912
  var TAG_TO_PLACEHOLDER_NAMES = {
11809
11913
  "A": "LINK",
11810
11914
  "B": "BOLD_TEXT",
@@ -11877,6 +11981,24 @@ var PlaceholderRegistry = class {
11877
11981
  getUniquePlaceholder(name) {
11878
11982
  return this._generateUniqueName(name.toUpperCase());
11879
11983
  }
11984
+ getStartBlockPlaceholderName(name, parameters) {
11985
+ const signature = this._hashBlock(name, parameters);
11986
+ if (this._signatureToName[signature]) {
11987
+ return this._signatureToName[signature];
11988
+ }
11989
+ const placeholder = this._generateUniqueName(`START_BLOCK_${this._toSnakeCase(name)}`);
11990
+ this._signatureToName[signature] = placeholder;
11991
+ return placeholder;
11992
+ }
11993
+ getCloseBlockPlaceholderName(name) {
11994
+ const signature = this._hashClosingBlock(name);
11995
+ if (this._signatureToName[signature]) {
11996
+ return this._signatureToName[signature];
11997
+ }
11998
+ const placeholder = this._generateUniqueName(`CLOSE_BLOCK_${this._toSnakeCase(name)}`);
11999
+ this._signatureToName[signature] = placeholder;
12000
+ return placeholder;
12001
+ }
11880
12002
  _hashTag(tag, attrs, isVoid) {
11881
12003
  const start = `<${tag}`;
11882
12004
  const strAttrs = Object.keys(attrs).sort().map((name) => ` ${name}=${attrs[name]}`).join("");
@@ -11886,6 +12008,16 @@ var PlaceholderRegistry = class {
11886
12008
  _hashClosingTag(tag) {
11887
12009
  return this._hashTag(`/${tag}`, {}, false);
11888
12010
  }
12011
+ _hashBlock(name, parameters) {
12012
+ const params = parameters.length === 0 ? "" : ` (${parameters.sort().join("; ")})`;
12013
+ return `@${name}${params} {}`;
12014
+ }
12015
+ _hashClosingBlock(name) {
12016
+ return this._hashBlock(`close_${name}`, []);
12017
+ }
12018
+ _toSnakeCase(name) {
12019
+ return name.toUpperCase().replace(/[^A-Z0-9]/g, "_");
12020
+ }
11889
12021
  _generateUniqueName(base) {
11890
12022
  const seen = this._placeHolderNameCounts.hasOwnProperty(base);
11891
12023
  if (!seen) {
@@ -11898,19 +12030,20 @@ var PlaceholderRegistry = class {
11898
12030
  }
11899
12031
  };
11900
12032
 
11901
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/i18n/i18n_parser.mjs
12033
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/i18n_parser.mjs
11902
12034
  var _expParser = new Parser(new Lexer());
11903
- function createI18nMessageFactory(interpolationConfig) {
11904
- const visitor = new _I18nVisitor(_expParser, interpolationConfig);
12035
+ function createI18nMessageFactory(interpolationConfig, containerBlocks) {
12036
+ const visitor = new _I18nVisitor(_expParser, interpolationConfig, containerBlocks);
11905
12037
  return (nodes, meaning, description, customId, visitNodeFn) => visitor.toI18nMessage(nodes, meaning, description, customId, visitNodeFn);
11906
12038
  }
11907
12039
  function noopVisitNodeFn(_html, i18n2) {
11908
12040
  return i18n2;
11909
12041
  }
11910
12042
  var _I18nVisitor = class {
11911
- constructor(_expressionParser, _interpolationConfig) {
12043
+ constructor(_expressionParser, _interpolationConfig, _containerBlocks) {
11912
12044
  this._expressionParser = _expressionParser;
11913
12045
  this._interpolationConfig = _interpolationConfig;
12046
+ this._containerBlocks = _containerBlocks;
11914
12047
  }
11915
12048
  toI18nMessage(nodes, meaning = "", description = "", customId = "", visitNodeFn) {
11916
12049
  const context = {
@@ -11985,11 +12118,27 @@ var _I18nVisitor = class {
11985
12118
  throw new Error("Unreachable code");
11986
12119
  }
11987
12120
  visitBlock(block, context) {
12121
+ var _a2;
11988
12122
  const children = visitAll2(this, block.children, context);
11989
- const node = new Container(children, block.sourceSpan);
12123
+ if (this._containerBlocks.has(block.name)) {
12124
+ return new Container(children, block.sourceSpan);
12125
+ }
12126
+ const parameters = block.parameters.map((param) => param.expression);
12127
+ const startPhName = context.placeholderRegistry.getStartBlockPlaceholderName(block.name, parameters);
12128
+ const closePhName = context.placeholderRegistry.getCloseBlockPlaceholderName(block.name);
12129
+ context.placeholderToContent[startPhName] = {
12130
+ text: block.startSourceSpan.toString(),
12131
+ sourceSpan: block.startSourceSpan
12132
+ };
12133
+ context.placeholderToContent[closePhName] = {
12134
+ text: block.endSourceSpan ? block.endSourceSpan.toString() : "}",
12135
+ sourceSpan: (_a2 = block.endSourceSpan) != null ? _a2 : block.sourceSpan
12136
+ };
12137
+ const node = new BlockPlaceholder(block.name, parameters, startPhName, closePhName, children, block.sourceSpan, block.startSourceSpan, block.endSourceSpan);
11990
12138
  return context.visitNodeFn(block, node);
11991
12139
  }
11992
12140
  visitBlockParameter(_parameter, _context) {
12141
+ throw new Error("Unreachable code");
11993
12142
  }
11994
12143
  _visitTextWithInterpolation(tokens, sourceSpan, context, previousI18n) {
11995
12144
  const nodes = [];
@@ -12060,14 +12209,14 @@ function extractPlaceholderName(input) {
12060
12209
  return input.split(_CUSTOM_PH_EXP)[2];
12061
12210
  }
12062
12211
 
12063
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/i18n/parse_util.mjs
12212
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/parse_util.mjs
12064
12213
  var I18nError = class extends ParseError {
12065
12214
  constructor(span, msg) {
12066
12215
  super(span, msg);
12067
12216
  }
12068
12217
  };
12069
12218
 
12070
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/ml_parser/entities.mjs
12219
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/entities.mjs
12071
12220
  var NAMED_ENTITIES = {
12072
12221
  "AElig": "\xC6",
12073
12222
  "AMP": "&",
@@ -14198,7 +14347,7 @@ var NAMED_ENTITIES = {
14198
14347
  var NGSP_UNICODE = "\uE500";
14199
14348
  NAMED_ENTITIES["ngsp"] = NGSP_UNICODE;
14200
14349
 
14201
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/ml_parser/lexer.mjs
14350
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/lexer.mjs
14202
14351
  var TokenError = class extends ParseError {
14203
14352
  constructor(errorMsg, tokenType, span) {
14204
14353
  super(span, errorMsg);
@@ -15119,7 +15268,7 @@ var CursorError = class {
15119
15268
  }
15120
15269
  };
15121
15270
 
15122
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/ml_parser/parser.mjs
15271
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/parser.mjs
15123
15272
  var TreeError = class extends ParseError {
15124
15273
  static create(elementName, span, msg) {
15125
15274
  return new TreeError(elementName, span, msg);
@@ -15220,19 +15369,19 @@ var _TreeBuilder = class {
15220
15369
  _consumeExpansion(token) {
15221
15370
  const switchValue = this._advance();
15222
15371
  const type = this._advance();
15223
- const cases = [];
15372
+ const cases2 = [];
15224
15373
  while (this._peek.type === 20) {
15225
15374
  const expCase = this._parseExpansionCase();
15226
15375
  if (!expCase)
15227
15376
  return;
15228
- cases.push(expCase);
15377
+ cases2.push(expCase);
15229
15378
  }
15230
15379
  if (this._peek.type !== 23) {
15231
15380
  this.errors.push(TreeError.create(null, this._peek.sourceSpan, `Invalid ICU message. Missing '}'.`));
15232
15381
  return;
15233
15382
  }
15234
15383
  const sourceSpan = new ParseSourceSpan(token.sourceSpan.start, this._peek.sourceSpan.end, token.sourceSpan.fullStart);
15235
- this._addToParent(new Expansion(switchValue.parts[0], type.parts[0], cases, sourceSpan, switchValue.sourceSpan));
15384
+ this._addToParent(new Expansion(switchValue.parts[0], type.parts[0], cases2, sourceSpan, switchValue.sourceSpan));
15236
15385
  this._advance();
15237
15386
  }
15238
15387
  _parseExpansionCase() {
@@ -15503,7 +15652,7 @@ function decodeEntity(match, entity) {
15503
15652
  return match;
15504
15653
  }
15505
15654
 
15506
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/schema/trusted_types_sinks.mjs
15655
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/schema/trusted_types_sinks.mjs
15507
15656
  var TRUSTED_TYPES_SINKS = /* @__PURE__ */ new Set([
15508
15657
  "iframe|srcdoc",
15509
15658
  "*|innerhtml",
@@ -15518,7 +15667,7 @@ function isTrustedTypesSink(tagName, propName) {
15518
15667
  return TRUSTED_TYPES_SINKS.has(tagName + "|" + propName) || TRUSTED_TYPES_SINKS.has("*|" + propName);
15519
15668
  }
15520
15669
 
15521
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/i18n/meta.mjs
15670
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/i18n/meta.mjs
15522
15671
  var setI18nRefs = (htmlNode, i18nNode) => {
15523
15672
  if (htmlNode instanceof NodeWithI18n) {
15524
15673
  if (i18nNode instanceof IcuPlaceholder && htmlNode.i18n instanceof Message) {
@@ -15529,16 +15678,17 @@ var setI18nRefs = (htmlNode, i18nNode) => {
15529
15678
  return i18nNode;
15530
15679
  };
15531
15680
  var I18nMetaVisitor = class {
15532
- constructor(interpolationConfig = DEFAULT_INTERPOLATION_CONFIG, keepI18nAttrs = false, enableI18nLegacyMessageIdFormat = false) {
15681
+ constructor(interpolationConfig = DEFAULT_INTERPOLATION_CONFIG, keepI18nAttrs = false, enableI18nLegacyMessageIdFormat = false, containerBlocks = DEFAULT_CONTAINER_BLOCKS) {
15533
15682
  this.interpolationConfig = interpolationConfig;
15534
15683
  this.keepI18nAttrs = keepI18nAttrs;
15535
15684
  this.enableI18nLegacyMessageIdFormat = enableI18nLegacyMessageIdFormat;
15685
+ this.containerBlocks = containerBlocks;
15536
15686
  this.hasI18nMeta = false;
15537
15687
  this._errors = [];
15538
15688
  }
15539
15689
  _generateI18nMessage(nodes, meta = "", visitNodeFn) {
15540
15690
  const { meaning, description, customId } = this._parseMetadata(meta);
15541
- const createI18nMessage2 = createI18nMessageFactory(this.interpolationConfig);
15691
+ const createI18nMessage2 = createI18nMessageFactory(this.interpolationConfig, this.containerBlocks);
15542
15692
  const message = createI18nMessage2(nodes, meaning, description, customId, visitNodeFn);
15543
15693
  this._setMessageId(message, meta);
15544
15694
  this._setLegacyIds(message, meta);
@@ -15674,7 +15824,7 @@ function i18nMetaToJSDoc(meta) {
15674
15824
  return jsDocComment(tags);
15675
15825
  }
15676
15826
 
15677
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/i18n/get_msg_utils.mjs
15827
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/i18n/get_msg_utils.mjs
15678
15828
  var GOOG_GET_MSG = "goog.getMsg";
15679
15829
  function createGoogleGetMsgStatements(variable2, message, closureVar, placeholderValues) {
15680
15830
  const messageString = serializeI18nMessageForGetMsg(message);
@@ -15713,6 +15863,9 @@ var GetMsgSerializerVisitor = class {
15713
15863
  visitPlaceholder(ph) {
15714
15864
  return this.formatPh(ph.name);
15715
15865
  }
15866
+ visitBlockPlaceholder(ph) {
15867
+ return `${this.formatPh(ph.startName)}${ph.children.map((child) => child.visit(this)).join("")}${this.formatPh(ph.closeName)}`;
15868
+ }
15716
15869
  visitIcuPlaceholder(ph, context) {
15717
15870
  return this.formatPh(ph.name);
15718
15871
  }
@@ -15722,7 +15875,7 @@ function serializeI18nMessageForGetMsg(message) {
15722
15875
  return message.nodes.map((node) => node.visit(serializerVisitor2, null)).join("");
15723
15876
  }
15724
15877
 
15725
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/i18n/localize_utils.mjs
15878
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/i18n/localize_utils.mjs
15726
15879
  function createLocalizeStatements(variable2, message, params) {
15727
15880
  const { messageParts, placeHolders } = serializeI18nMessageForLocalize(message);
15728
15881
  const sourceSpan = getSourceSpan(message);
@@ -15761,6 +15914,12 @@ var LocalizeSerializerVisitor = class {
15761
15914
  visitPlaceholder(ph) {
15762
15915
  this.pieces.push(this.createPlaceholderPiece(ph.name, ph.sourceSpan));
15763
15916
  }
15917
+ visitBlockPlaceholder(ph) {
15918
+ var _a2, _b2;
15919
+ this.pieces.push(this.createPlaceholderPiece(ph.startName, (_a2 = ph.startSourceSpan) != null ? _a2 : ph.sourceSpan));
15920
+ ph.children.forEach((child) => child.visit(this));
15921
+ this.pieces.push(this.createPlaceholderPiece(ph.closeName, (_b2 = ph.endSourceSpan) != null ? _b2 : ph.sourceSpan));
15922
+ }
15764
15923
  visitIcuPlaceholder(ph) {
15765
15924
  this.pieces.push(this.createPlaceholderPiece(ph.name, ph.sourceSpan, this.placeholderToMessage[ph.name]));
15766
15925
  }
@@ -15805,7 +15964,7 @@ function createEmptyMessagePart(location) {
15805
15964
  return new LiteralPiece("", new ParseSourceSpan(location, location));
15806
15965
  }
15807
15966
 
15808
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/i18n_const_collection.mjs
15967
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/i18n_const_collection.mjs
15809
15968
  var NG_I18N_CLOSURE_MODE = "ngI18nClosureMode";
15810
15969
  var TRANSLATION_VAR_PREFIX2 = "i18n_";
15811
15970
  function collectI18nConsts(job) {
@@ -15900,7 +16059,7 @@ function assertAllParamsResolved(op) {
15900
16059
  }
15901
16060
  }
15902
16061
 
15903
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/i18n_text_extraction.mjs
16062
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/i18n_text_extraction.mjs
15904
16063
  function extractI18nText(job) {
15905
16064
  var _a2;
15906
16065
  for (const unit of job.units) {
@@ -15959,7 +16118,7 @@ function extractI18nText(job) {
15959
16118
  }
15960
16119
  }
15961
16120
 
15962
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/local_refs.mjs
16121
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/local_refs.mjs
15963
16122
  function liftLocalRefs(job) {
15964
16123
  for (const unit of job.units) {
15965
16124
  for (const op of unit.create) {
@@ -15989,48 +16148,7 @@ function serializeLocalRefs(refs) {
15989
16148
  return literalArr(constRefs);
15990
16149
  }
15991
16150
 
15992
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/merge_i18n_contexts.mjs
15993
- function mergeI18nContexts(job) {
15994
- const i18nOps = /* @__PURE__ */ new Map();
15995
- const i18nContexts = /* @__PURE__ */ new Map();
15996
- for (const unit of job.units) {
15997
- for (const op of unit.create) {
15998
- switch (op.kind) {
15999
- case OpKind.I18nStart:
16000
- if (!op.context) {
16001
- throw Error("I18n op should have its context set.");
16002
- }
16003
- i18nOps.set(op.xref, op);
16004
- break;
16005
- case OpKind.I18nContext:
16006
- i18nContexts.set(op.xref, op);
16007
- break;
16008
- }
16009
- }
16010
- }
16011
- for (const childI18nOp of i18nOps.values()) {
16012
- if (childI18nOp.xref !== childI18nOp.root) {
16013
- const childContext = i18nContexts.get(childI18nOp.context);
16014
- const rootI18nOp = i18nOps.get(childI18nOp.root);
16015
- const rootContext = i18nContexts.get(rootI18nOp.context);
16016
- mergeParams(rootContext.params, childContext.params);
16017
- mergeParams(rootContext.postprocessingParams, childContext.postprocessingParams);
16018
- }
16019
- }
16020
- }
16021
- function mergeParams(to, from) {
16022
- for (const [placeholder, fromValues] of from) {
16023
- const toValues = to.get(placeholder) || [];
16024
- const flags = fromValues[0].flags;
16025
- if (flags & I18nParamValueFlags.CloseTag && !(flags & I18nParamValueFlags.OpenTag)) {
16026
- to.set(placeholder, [...fromValues, ...toValues]);
16027
- } else {
16028
- to.set(placeholder, [...toValues, ...fromValues]);
16029
- }
16030
- }
16031
- }
16032
-
16033
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/namespace.mjs
16151
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/namespace.mjs
16034
16152
  function emitNamespaceChanges(job) {
16035
16153
  for (const unit of job.units) {
16036
16154
  let activeNamespace = Namespace.HTML;
@@ -16046,7 +16164,7 @@ function emitNamespaceChanges(job) {
16046
16164
  }
16047
16165
  }
16048
16166
 
16049
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/style_parser.mjs
16167
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/style_parser.mjs
16050
16168
  function parse(value) {
16051
16169
  const styles = [];
16052
16170
  let i = 0;
@@ -16107,7 +16225,7 @@ function hyphenate2(value) {
16107
16225
  }).toLowerCase();
16108
16226
  }
16109
16227
 
16110
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/naming.mjs
16228
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/naming.mjs
16111
16229
  function nameFunctionsAndVariables(job) {
16112
16230
  addNamesToView(job.root, job.componentName, { index: 0 }, job.compatibility === CompatibilityMode.TemplateDefinitionBuilder);
16113
16231
  }
@@ -16222,7 +16340,7 @@ function stripImportant(name) {
16222
16340
  return name;
16223
16341
  }
16224
16342
 
16225
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/next_context_merging.mjs
16343
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/next_context_merging.mjs
16226
16344
  function mergeNextContextExpressions(job) {
16227
16345
  for (const unit of job.units) {
16228
16346
  for (const op of unit.create) {
@@ -16268,7 +16386,7 @@ function mergeNextContextsInOps(ops) {
16268
16386
  }
16269
16387
  }
16270
16388
 
16271
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/ng_container.mjs
16389
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/ng_container.mjs
16272
16390
  var CONTAINER_TAG = "ng-container";
16273
16391
  function generateNgContainerOps(job) {
16274
16392
  for (const unit of job.units) {
@@ -16285,7 +16403,7 @@ function generateNgContainerOps(job) {
16285
16403
  }
16286
16404
  }
16287
16405
 
16288
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/nonbindable.mjs
16406
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/nonbindable.mjs
16289
16407
  function lookupElement3(elements, xref) {
16290
16408
  const el = elements.get(xref);
16291
16409
  if (el === void 0) {
@@ -16315,7 +16433,7 @@ function disableBindings(job) {
16315
16433
  }
16316
16434
  }
16317
16435
 
16318
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/nullish_coalescing.mjs
16436
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/nullish_coalescing.mjs
16319
16437
  function generateNullishCoalesceExpressions(job) {
16320
16438
  for (const unit of job.units) {
16321
16439
  for (const op of unit.ops()) {
@@ -16331,7 +16449,7 @@ function generateNullishCoalesceExpressions(job) {
16331
16449
  }
16332
16450
  }
16333
16451
 
16334
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/ordering.mjs
16452
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/ordering.mjs
16335
16453
  function kindTest(kind) {
16336
16454
  return (op) => op.kind === kind;
16337
16455
  }
@@ -16405,7 +16523,7 @@ function keepLast(ops) {
16405
16523
  return ops.slice(ops.length - 1);
16406
16524
  }
16407
16525
 
16408
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/parse_extracted_styles.mjs
16526
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/parse_extracted_styles.mjs
16409
16527
  function parseExtractedStyles(job) {
16410
16528
  for (const unit of job.units) {
16411
16529
  for (const op of unit.create) {
@@ -16428,7 +16546,7 @@ function parseExtractedStyles(job) {
16428
16546
  }
16429
16547
  }
16430
16548
 
16431
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/phase_remove_content_selectors.mjs
16549
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/phase_remove_content_selectors.mjs
16432
16550
  function removeContentSelectors(job) {
16433
16551
  for (const unit of job.units) {
16434
16552
  const elements = createOpXrefMap(unit);
@@ -16452,7 +16570,7 @@ function lookupInXrefMap(map, xref) {
16452
16570
  return el;
16453
16571
  }
16454
16572
 
16455
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pipe_creation.mjs
16573
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pipe_creation.mjs
16456
16574
  function createPipes(job) {
16457
16575
  for (const unit of job.units) {
16458
16576
  processPipeBindingsInView(unit);
@@ -16500,7 +16618,7 @@ function addPipeToCreationBlock(unit, afterTargetXref, binding) {
16500
16618
  throw new Error(`AssertionError: unable to find insertion point for pipe ${binding.name}`);
16501
16619
  }
16502
16620
 
16503
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pipe_variadic.mjs
16621
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pipe_variadic.mjs
16504
16622
  function createVariadicPipes(job) {
16505
16623
  for (const unit of job.units) {
16506
16624
  for (const op of unit.update) {
@@ -16517,7 +16635,7 @@ function createVariadicPipes(job) {
16517
16635
  }
16518
16636
  }
16519
16637
 
16520
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/propagate_i18n_blocks.mjs
16638
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/propagate_i18n_blocks.mjs
16521
16639
  function propagateI18nBlocks(job) {
16522
16640
  propagateI18nBlocksToTemplates(job.root, 0);
16523
16641
  }
@@ -16541,9 +16659,10 @@ function propagateI18nBlocksToTemplates(unit, subTemplateIndex) {
16541
16659
  subTemplateIndex++;
16542
16660
  wrapTemplateWithI18n(templateView, i18nBlock);
16543
16661
  }
16544
- propagateI18nBlocksToTemplates(templateView, subTemplateIndex);
16662
+ subTemplateIndex = propagateI18nBlocksToTemplates(templateView, subTemplateIndex);
16545
16663
  }
16546
16664
  }
16665
+ return subTemplateIndex;
16547
16666
  }
16548
16667
  function wrapTemplateWithI18n(unit, parentI18n) {
16549
16668
  var _a2;
@@ -16554,7 +16673,7 @@ function wrapTemplateWithI18n(unit, parentI18n) {
16554
16673
  }
16555
16674
  }
16556
16675
 
16557
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pure_function_extraction.mjs
16676
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pure_function_extraction.mjs
16558
16677
  function extractPureFunctions(job) {
16559
16678
  for (const view of job.units) {
16560
16679
  for (const op of view.ops()) {
@@ -16596,7 +16715,7 @@ var PureFunctionConstant = class extends GenericKeyFn {
16596
16715
  }
16597
16716
  };
16598
16717
 
16599
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pure_literal_structures.mjs
16718
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pure_literal_structures.mjs
16600
16719
  function generatePureLiteralStructures(job) {
16601
16720
  for (const unit of job.units) {
16602
16721
  for (const op of unit.update) {
@@ -16643,7 +16762,7 @@ function transformLiteralMap(expr) {
16643
16762
  return new PureFunctionExpr(literalMap(derivedEntries), nonConstantArgs);
16644
16763
  }
16645
16764
 
16646
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/instruction.mjs
16765
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/instruction.mjs
16647
16766
  function element(slot, tag, constIndex, localRefIndex, sourceSpan) {
16648
16767
  return elementOrContainerBase(Identifiers.element, slot, tag, constIndex, localRefIndex, sourceSpan);
16649
16768
  }
@@ -16842,8 +16961,8 @@ function repeaterCreate(slot, viewFnName, decls, vars, tag, constIndex, trackByF
16842
16961
  }
16843
16962
  return call(Identifiers.repeaterCreate, args, sourceSpan);
16844
16963
  }
16845
- function repeater(metadataSlot, collection, sourceSpan) {
16846
- return call(Identifiers.repeater, [literal(metadataSlot), collection], sourceSpan);
16964
+ function repeater(collection, sourceSpan) {
16965
+ return call(Identifiers.repeater, [collection], sourceSpan);
16847
16966
  }
16848
16967
  function deferWhen(prefetch, expr, sourceSpan) {
16849
16968
  return call(prefetch ? Identifiers.deferPrefetchWhen : Identifiers.deferWhen, [expr], sourceSpan);
@@ -17154,7 +17273,7 @@ function callVariadicInstruction(config, baseArgs, interpolationArgs, extraArgs,
17154
17273
  return createStatementOp(callVariadicInstructionExpr(config, baseArgs, interpolationArgs, extraArgs, sourceSpan).toStmt());
17155
17274
  }
17156
17275
 
17157
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/reify.mjs
17276
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/reify.mjs
17158
17277
  var sanitizerIdentifierMap = /* @__PURE__ */ new Map([
17159
17278
  [SanitizerFn.Html, Identifiers.sanitizeHtml],
17160
17279
  [SanitizerFn.IframeAttribute, Identifiers.validateIframeAttribute],
@@ -17401,7 +17520,7 @@ function reifyUpdateOperations(_unit, ops) {
17401
17520
  OpList.replace(op, conditional(op.targetSlot.slot, op.processed, op.contextValue, op.sourceSpan));
17402
17521
  break;
17403
17522
  case OpKind.Repeater:
17404
- OpList.replace(op, repeater(op.targetSlot.slot, op.collection, op.sourceSpan));
17523
+ OpList.replace(op, repeater(op.collection, op.sourceSpan));
17405
17524
  break;
17406
17525
  case OpKind.DeferWhen:
17407
17526
  OpList.replace(op, deferWhen(op.prefetch, op.expr, op.sourceSpan));
@@ -17483,7 +17602,7 @@ function reifyListenerHandler(unit, name, handlerOps, consumesDollarEvent) {
17483
17602
  return fn(params, handlerStmts, void 0, void 0, name);
17484
17603
  }
17485
17604
 
17486
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/remove_empty_bindings.mjs
17605
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/remove_empty_bindings.mjs
17487
17606
  function removeEmptyBindings(job) {
17488
17607
  for (const unit of job.units) {
17489
17608
  for (const op of unit.update) {
@@ -17504,7 +17623,7 @@ function removeEmptyBindings(job) {
17504
17623
  }
17505
17624
  }
17506
17625
 
17507
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/remove_i18n_contexts.mjs
17626
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/remove_i18n_contexts.mjs
17508
17627
  function removeI18nContexts(job) {
17509
17628
  for (const unit of job.units) {
17510
17629
  for (const op of unit.create) {
@@ -17520,7 +17639,7 @@ function removeI18nContexts(job) {
17520
17639
  }
17521
17640
  }
17522
17641
 
17523
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/repeater_derived_vars.mjs
17642
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/repeater_derived_vars.mjs
17524
17643
  function generateRepeaterDerivedVars(job) {
17525
17644
  const repeaters = /* @__PURE__ */ new Map();
17526
17645
  for (const unit of job.units) {
@@ -17552,7 +17671,7 @@ function generateRepeaterDerivedVars(job) {
17552
17671
  }
17553
17672
  }
17554
17673
 
17555
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_contexts.mjs
17674
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_contexts.mjs
17556
17675
  function resolveContexts(job) {
17557
17676
  for (const unit of job.units) {
17558
17677
  processLexicalScope(unit, unit.create);
@@ -17593,7 +17712,7 @@ function processLexicalScope(view, ops) {
17593
17712
  }
17594
17713
  }
17595
17714
 
17596
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_dollar_event.mjs
17715
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_dollar_event.mjs
17597
17716
  function resolveDollarEvent(job) {
17598
17717
  for (const unit of job.units) {
17599
17718
  transformDollarEvent(unit, unit.create);
@@ -17614,7 +17733,7 @@ function transformDollarEvent(unit, ops) {
17614
17733
  }
17615
17734
  }
17616
17735
 
17617
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_i18n_element_placeholders.mjs
17736
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_i18n_element_placeholders.mjs
17618
17737
  function resolveI18nElementPlaceholders(job) {
17619
17738
  const i18nContexts = /* @__PURE__ */ new Map();
17620
17739
  const elements = /* @__PURE__ */ new Map();
@@ -17630,55 +17749,67 @@ function resolveI18nElementPlaceholders(job) {
17630
17749
  }
17631
17750
  }
17632
17751
  }
17633
- for (const unit of job.units) {
17634
- let currentOps = null;
17635
- for (const op of unit.create) {
17636
- switch (op.kind) {
17637
- case OpKind.I18nStart:
17638
- if (!op.context) {
17639
- throw Error("Could not find i18n context for i18n op");
17752
+ resolvePlaceholdersForView(job, job.root, i18nContexts, elements);
17753
+ }
17754
+ function resolvePlaceholdersForView(job, unit, i18nContexts, elements) {
17755
+ let currentOps = null;
17756
+ for (const op of unit.create) {
17757
+ switch (op.kind) {
17758
+ case OpKind.I18nStart:
17759
+ if (!op.context) {
17760
+ throw Error("Could not find i18n context for i18n op");
17761
+ }
17762
+ currentOps = { i18nBlock: op, i18nContext: i18nContexts.get(op.context) };
17763
+ break;
17764
+ case OpKind.I18nEnd:
17765
+ currentOps = null;
17766
+ break;
17767
+ case OpKind.ElementStart:
17768
+ if (op.i18nPlaceholder !== void 0) {
17769
+ if (currentOps === null) {
17770
+ throw Error("i18n tag placeholder should only occur inside an i18n block");
17640
17771
  }
17641
- currentOps = { i18nBlock: op, i18nContext: i18nContexts.get(op.context) };
17642
- break;
17643
- case OpKind.I18nEnd:
17644
- currentOps = null;
17645
- break;
17646
- case OpKind.ElementStart:
17647
- if (op.i18nPlaceholder !== void 0) {
17648
- if (currentOps === null) {
17649
- throw Error("i18n tag placeholder should only occur inside an i18n block");
17650
- }
17651
- const { startName, closeName } = op.i18nPlaceholder;
17652
- let flags = I18nParamValueFlags.ElementTag | I18nParamValueFlags.OpenTag;
17653
- if (closeName === "") {
17654
- flags |= I18nParamValueFlags.CloseTag;
17655
- }
17656
- addParam(currentOps.i18nContext.params, startName, op.handle.slot, currentOps.i18nBlock.subTemplateIndex, flags);
17772
+ const { startName, closeName } = op.i18nPlaceholder;
17773
+ let flags = I18nParamValueFlags.ElementTag | I18nParamValueFlags.OpenTag;
17774
+ if (closeName === "") {
17775
+ flags |= I18nParamValueFlags.CloseTag;
17657
17776
  }
17658
- break;
17659
- case OpKind.ElementEnd:
17660
- const startOp = elements.get(op.xref);
17661
- if (startOp && startOp.i18nPlaceholder !== void 0) {
17662
- if (currentOps === null) {
17663
- throw Error("i18n tag placeholder should only occur inside an i18n block");
17664
- }
17665
- const { closeName } = startOp.i18nPlaceholder;
17666
- if (closeName !== "") {
17667
- addParam(currentOps.i18nContext.params, closeName, startOp.handle.slot, currentOps.i18nBlock.subTemplateIndex, I18nParamValueFlags.ElementTag | I18nParamValueFlags.CloseTag);
17668
- }
17777
+ addParam(currentOps.i18nContext.params, startName, op.handle.slot, currentOps.i18nBlock.subTemplateIndex, flags);
17778
+ }
17779
+ break;
17780
+ case OpKind.ElementEnd:
17781
+ const startOp = elements.get(op.xref);
17782
+ if (startOp && startOp.i18nPlaceholder !== void 0) {
17783
+ if (currentOps === null) {
17784
+ throw Error("i18n tag placeholder should only occur inside an i18n block");
17669
17785
  }
17670
- break;
17671
- case OpKind.Template:
17672
- if (op.i18nPlaceholder !== void 0) {
17673
- if (currentOps === null) {
17674
- throw Error("i18n tag placeholder should only occur inside an i18n block");
17675
- }
17676
- const subTemplateIndex = getSubTemplateIndexForTemplateTag(job, currentOps.i18nBlock, op);
17677
- addParam(currentOps.i18nContext.params, op.i18nPlaceholder.startName, op.handle.slot, subTemplateIndex, I18nParamValueFlags.TemplateTag);
17678
- addParam(currentOps.i18nContext.params, op.i18nPlaceholder.closeName, op.handle.slot, subTemplateIndex, I18nParamValueFlags.TemplateTag | I18nParamValueFlags.CloseTag);
17786
+ const { closeName } = startOp.i18nPlaceholder;
17787
+ if (closeName !== "") {
17788
+ addParam(currentOps.i18nContext.params, closeName, startOp.handle.slot, currentOps.i18nBlock.subTemplateIndex, I18nParamValueFlags.ElementTag | I18nParamValueFlags.CloseTag);
17679
17789
  }
17680
- break;
17681
- }
17790
+ }
17791
+ break;
17792
+ case OpKind.Template:
17793
+ if (op.i18nPlaceholder !== void 0) {
17794
+ if (currentOps === null) {
17795
+ throw Error("i18n tag placeholder should only occur inside an i18n block");
17796
+ }
17797
+ let startFlags = I18nParamValueFlags.TemplateTag | I18nParamValueFlags.OpenTag;
17798
+ const subTemplateIndex = getSubTemplateIndexForTemplateTag(job, currentOps.i18nBlock, op);
17799
+ const { startName, closeName } = op.i18nPlaceholder;
17800
+ const isSelfClosing = closeName === "";
17801
+ if (isSelfClosing) {
17802
+ startFlags |= I18nParamValueFlags.CloseTag;
17803
+ }
17804
+ addParam(currentOps.i18nContext.params, startName, op.handle.slot, subTemplateIndex, startFlags);
17805
+ resolvePlaceholdersForView(job, job.views.get(op.xref), i18nContexts, elements);
17806
+ if (!isSelfClosing) {
17807
+ addParam(currentOps.i18nContext.params, closeName, op.handle.slot, subTemplateIndex, I18nParamValueFlags.TemplateTag | I18nParamValueFlags.CloseTag);
17808
+ }
17809
+ } else {
17810
+ resolvePlaceholdersForView(job, job.views.get(op.xref), i18nContexts, elements);
17811
+ }
17812
+ break;
17682
17813
  }
17683
17814
  }
17684
17815
  }
@@ -17697,7 +17828,7 @@ function addParam(params, placeholder, value, subTemplateIndex, flags) {
17697
17828
  params.set(placeholder, values);
17698
17829
  }
17699
17830
 
17700
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_i18n_expression_placeholders.mjs
17831
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_i18n_expression_placeholders.mjs
17701
17832
  function resolveI18nExpressionPlaceholders(job) {
17702
17833
  const subTemplateIndicies = /* @__PURE__ */ new Map();
17703
17834
  const i18nContexts = /* @__PURE__ */ new Map();
@@ -17718,8 +17849,8 @@ function resolveI18nExpressionPlaceholders(job) {
17718
17849
  for (const op of unit.update) {
17719
17850
  if (op.kind === OpKind.I18nExpression) {
17720
17851
  const i18nContext = i18nContexts.get(op.context);
17721
- const index = expressionIndices.get(i18nContext.i18nBlock) || 0;
17722
- const subTemplateIndex = subTemplateIndicies.get(i18nContext.i18nBlock);
17852
+ const index = expressionIndices.get(op.target) || 0;
17853
+ const subTemplateIndex = subTemplateIndicies.get(op.target);
17723
17854
  const params = op.resolutionTime === I18nParamResolutionTime.Creation ? i18nContext.params : i18nContext.postprocessingParams;
17724
17855
  const values = params.get(op.i18nPlaceholder) || [];
17725
17856
  values.push({
@@ -17728,36 +17859,20 @@ function resolveI18nExpressionPlaceholders(job) {
17728
17859
  flags: I18nParamValueFlags.ExpressionIndex
17729
17860
  });
17730
17861
  params.set(op.i18nPlaceholder, values);
17731
- expressionIndices.set(i18nContext.i18nBlock, index + 1);
17862
+ expressionIndices.set(op.target, index + 1);
17732
17863
  }
17733
17864
  }
17734
17865
  }
17735
17866
  }
17736
17867
 
17737
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_i18n_icu_placeholders.mjs
17868
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_i18n_icu_placeholders.mjs
17738
17869
  function resolveI18nIcuPlaceholders(job) {
17739
- const contextOps = /* @__PURE__ */ new Map();
17740
17870
  for (const unit of job.units) {
17741
17871
  for (const op of unit.create) {
17742
- switch (op.kind) {
17743
- case OpKind.I18nContext:
17744
- contextOps.set(op.xref, op);
17745
- break;
17746
- }
17747
- }
17748
- }
17749
- for (const unit of job.units) {
17750
- for (const op of unit.create) {
17751
- switch (op.kind) {
17752
- case OpKind.IcuStart:
17753
- if (op.context === null) {
17754
- throw Error("Icu should have its i18n context set.");
17755
- }
17756
- const i18nContext = contextOps.get(op.context);
17757
- for (const node of op.message.nodes) {
17758
- node.visit(new ResolveIcuPlaceholdersVisitor(i18nContext.postprocessingParams));
17759
- }
17760
- break;
17872
+ if (op.kind === OpKind.I18nContext && op.contextKind === I18nContextKind.Icu) {
17873
+ for (const node of op.message.nodes) {
17874
+ node.visit(new ResolveIcuPlaceholdersVisitor(op.postprocessingParams));
17875
+ }
17761
17876
  }
17762
17877
  }
17763
17878
  }
@@ -17767,9 +17882,8 @@ var ResolveIcuPlaceholdersVisitor = class extends RecurseVisitor {
17767
17882
  super();
17768
17883
  this.params = params;
17769
17884
  }
17770
- visitTagPlaceholder(placeholder) {
17885
+ visitContainerPlaceholder(placeholder) {
17771
17886
  var _a2, _b2;
17772
- super.visitTagPlaceholder(placeholder);
17773
17887
  if (placeholder.startName && placeholder.startSourceSpan && !this.params.has(placeholder.startName)) {
17774
17888
  this.params.set(placeholder.startName, [{
17775
17889
  value: (_a2 = placeholder.startSourceSpan) == null ? void 0 : _a2.toString(),
@@ -17785,9 +17899,17 @@ var ResolveIcuPlaceholdersVisitor = class extends RecurseVisitor {
17785
17899
  }]);
17786
17900
  }
17787
17901
  }
17902
+ visitTagPlaceholder(placeholder) {
17903
+ super.visitTagPlaceholder(placeholder);
17904
+ this.visitContainerPlaceholder(placeholder);
17905
+ }
17906
+ visitBlockPlaceholder(placeholder) {
17907
+ super.visitBlockPlaceholder(placeholder);
17908
+ this.visitContainerPlaceholder(placeholder);
17909
+ }
17788
17910
  };
17789
17911
 
17790
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_names.mjs
17912
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_names.mjs
17791
17913
  function resolveNames(job) {
17792
17914
  for (const unit of job.units) {
17793
17915
  processLexicalScope2(unit, unit.create, null);
@@ -17851,7 +17973,7 @@ function processLexicalScope2(unit, ops, savedView) {
17851
17973
  }
17852
17974
  }
17853
17975
 
17854
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_sanitizers.mjs
17976
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_sanitizers.mjs
17855
17977
  var sanitizers = /* @__PURE__ */ new Map([
17856
17978
  [SecurityContext.HTML, SanitizerFn.Html],
17857
17979
  [SecurityContext.SCRIPT, SanitizerFn.Script],
@@ -17888,7 +18010,7 @@ function isIframeElement(op) {
17888
18010
  return op.kind === OpKind.ElementStart && ((_a2 = op.tag) == null ? void 0 : _a2.toLowerCase()) === "iframe";
17889
18011
  }
17890
18012
 
17891
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/save_restore_view.mjs
18013
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/save_restore_view.mjs
17892
18014
  function saveAndRestoreView(job) {
17893
18015
  for (const unit of job.units) {
17894
18016
  unit.create.prepend([
@@ -17933,7 +18055,7 @@ function addSaveRestoreViewOperationToListener(unit, op) {
17933
18055
  }
17934
18056
  }
17935
18057
 
17936
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/slot_allocation.mjs
18058
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/slot_allocation.mjs
17937
18059
  function allocateSlots(job) {
17938
18060
  const slotMap = /* @__PURE__ */ new Map();
17939
18061
  for (const unit of job.units) {
@@ -17958,7 +18080,7 @@ function allocateSlots(job) {
17958
18080
  }
17959
18081
  }
17960
18082
 
17961
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/style_binding_specialization.mjs
18083
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/style_binding_specialization.mjs
17962
18084
  function specializeStyleBindings(job) {
17963
18085
  for (const unit of job.units) {
17964
18086
  for (const op of unit.update) {
@@ -17988,7 +18110,7 @@ function specializeStyleBindings(job) {
17988
18110
  }
17989
18111
  }
17990
18112
 
17991
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/temporary_variables.mjs
18113
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/temporary_variables.mjs
17992
18114
  function generateTemporaryVariables(job) {
17993
18115
  for (const unit of job.units) {
17994
18116
  unit.create.prepend(generateTemporaries(unit.create));
@@ -18046,7 +18168,7 @@ function assignName(names, expr) {
18046
18168
  expr.name = name;
18047
18169
  }
18048
18170
 
18049
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/track_fn_generation.mjs
18171
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/track_fn_generation.mjs
18050
18172
  function generateTrackFns(job) {
18051
18173
  for (const unit of job.units) {
18052
18174
  for (const op of unit.create) {
@@ -18076,7 +18198,7 @@ function generateTrackFns(job) {
18076
18198
  }
18077
18199
  }
18078
18200
 
18079
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/track_fn_optimization.mjs
18201
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/track_fn_optimization.mjs
18080
18202
  function optimizeTrackFns(job) {
18081
18203
  for (const unit of job.units) {
18082
18204
  for (const op of unit.create) {
@@ -18123,7 +18245,7 @@ function isTrackByFunctionCall(rootView, expr) {
18123
18245
  return true;
18124
18246
  }
18125
18247
 
18126
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/track_variables.mjs
18248
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/track_variables.mjs
18127
18249
  function generateTrackVariables(job) {
18128
18250
  for (const unit of job.units) {
18129
18251
  for (const op of unit.create) {
@@ -18144,7 +18266,7 @@ function generateTrackVariables(job) {
18144
18266
  }
18145
18267
  }
18146
18268
 
18147
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/var_counting.mjs
18269
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/var_counting.mjs
18148
18270
  function countVariables(job) {
18149
18271
  for (const unit of job.units) {
18150
18272
  let varCount = 0;
@@ -18249,7 +18371,7 @@ function isSingletonInterpolation(expr) {
18249
18371
  return true;
18250
18372
  }
18251
18373
 
18252
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/variable_optimization.mjs
18374
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/variable_optimization.mjs
18253
18375
  function optimizeVariables(job) {
18254
18376
  for (const unit of job.units) {
18255
18377
  inlineAlwaysInlineVariables(unit.create);
@@ -18499,7 +18621,7 @@ function allowConservativeInlining(decl, target) {
18499
18621
  }
18500
18622
  }
18501
18623
 
18502
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/wrap_icus.mjs
18624
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/wrap_icus.mjs
18503
18625
  function wrapI18nIcus(job) {
18504
18626
  for (const unit of job.units) {
18505
18627
  let currentI18nOp = null;
@@ -18529,7 +18651,7 @@ function wrapI18nIcus(job) {
18529
18651
  }
18530
18652
  }
18531
18653
 
18532
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/emit.mjs
18654
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/emit.mjs
18533
18655
  var phases = [
18534
18656
  { kind: CompilationJobKind.Tmpl, fn: removeContentSelectors },
18535
18657
  { kind: CompilationJobKind.Host, fn: parseHostStyleProperties },
@@ -18572,7 +18694,6 @@ var phases = [
18572
18694
  { kind: CompilationJobKind.Tmpl, fn: resolveI18nElementPlaceholders },
18573
18695
  { kind: CompilationJobKind.Tmpl, fn: resolveI18nExpressionPlaceholders },
18574
18696
  { kind: CompilationJobKind.Tmpl, fn: resolveI18nIcuPlaceholders },
18575
- { kind: CompilationJobKind.Tmpl, fn: mergeI18nContexts },
18576
18697
  { kind: CompilationJobKind.Tmpl, fn: extractI18nMessages },
18577
18698
  { kind: CompilationJobKind.Tmpl, fn: generateTrackFns },
18578
18699
  { kind: CompilationJobKind.Tmpl, fn: collectI18nConsts },
@@ -18694,7 +18815,7 @@ function emitHostBindingFunction(job) {
18694
18815
  );
18695
18816
  }
18696
18817
 
18697
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/src/ingest.mjs
18818
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/ingest.mjs
18698
18819
  var compatibilityMode = CompatibilityMode.TemplateDefinitionBuilder;
18699
18820
  function ingestComponent(componentName, template2, constantPool, relativeContextFilePath, i18nUseExternalIds, deferBlocksMeta) {
18700
18821
  const job = new ComponentCompilationJob(componentName, constantPool, compatibilityMode, relativeContextFilePath, i18nUseExternalIds, deferBlocksMeta);
@@ -19275,10 +19396,10 @@ function ingestControlFlowInsertionPoint(unit, xref, node) {
19275
19396
  return null;
19276
19397
  }
19277
19398
 
19278
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template/pipeline/switch/index.mjs
19399
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/switch/index.mjs
19279
19400
  var USE_TEMPLATE_PIPELINE = false;
19280
19401
 
19281
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/styling_builder.mjs
19402
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/styling_builder.mjs
19282
19403
  var IMPORTANT_FLAG = "!important";
19283
19404
  var MIN_STYLING_BINDING_SLOTS_REQUIRED = 2;
19284
19405
  var StylingBuilder = class {
@@ -19611,7 +19732,7 @@ function isEmptyExpression(ast) {
19611
19732
  return ast instanceof EmptyExpr;
19612
19733
  }
19613
19734
 
19614
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/ml_parser/html_parser.mjs
19735
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/html_parser.mjs
19615
19736
  var HtmlParser = class extends Parser2 {
19616
19737
  constructor() {
19617
19738
  super(getHtmlTagDefinition);
@@ -19621,7 +19742,7 @@ var HtmlParser = class extends Parser2 {
19621
19742
  }
19622
19743
  };
19623
19744
 
19624
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/ml_parser/html_whitespaces.mjs
19745
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/html_whitespaces.mjs
19625
19746
  var PRESERVE_WS_ATTR_NAME = "ngPreserveWhitespaces";
19626
19747
  var SKIP_WS_TRIM_TAGS = /* @__PURE__ */ new Set(["pre", "template", "textarea", "script", "style"]);
19627
19748
  var WS_CHARS = " \f\n\r \v\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF";
@@ -19687,7 +19808,7 @@ function visitAllWithSiblings(visitor, nodes) {
19687
19808
  return result;
19688
19809
  }
19689
19810
 
19690
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template_parser/binding_parser.mjs
19811
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template_parser/binding_parser.mjs
19691
19812
  var PROPERTY_PARTS_SEPARATOR = ".";
19692
19813
  var ATTRIBUTE_PREFIX = "attr";
19693
19814
  var CLASS_PREFIX = "class";
@@ -20007,7 +20128,7 @@ function moveParseSourceSpan(sourceSpan, absoluteSpan) {
20007
20128
  return new ParseSourceSpan(sourceSpan.start.moveBy(startDiff), sourceSpan.end.moveBy(endDiff), sourceSpan.fullStart.moveBy(startDiff), sourceSpan.details);
20008
20129
  }
20009
20130
 
20010
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/style_url_resolver.mjs
20131
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/style_url_resolver.mjs
20011
20132
  function isStyleUrlResolvable(url) {
20012
20133
  if (url == null || url.length === 0 || url[0] == "/")
20013
20134
  return false;
@@ -20016,7 +20137,7 @@ function isStyleUrlResolvable(url) {
20016
20137
  }
20017
20138
  var URL_WITH_SCHEMA_REGEXP = /^([^:/?#]+):/;
20018
20139
 
20019
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/template_parser/template_preparser.mjs
20140
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template_parser/template_preparser.mjs
20020
20141
  var NG_CONTENT_SELECT_ATTR = "select";
20021
20142
  var LINK_ELEMENT = "link";
20022
20143
  var LINK_STYLE_REL_ATTR = "rel";
@@ -20086,7 +20207,7 @@ function normalizeNgContentSelect(selectAttr) {
20086
20207
  return selectAttr;
20087
20208
  }
20088
20209
 
20089
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/r3_control_flow.mjs
20210
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_control_flow.mjs
20090
20211
  var FOR_LOOP_EXPRESSION_PATTERN = /^\s*([0-9A-Za-z_$]*)\s+of\s+([\S\s]*)/;
20091
20212
  var FOR_LOOP_TRACK_PATTERN = /^track\s+([\S\s]*)/;
20092
20213
  var CONDITIONAL_ALIAS_PATTERN = /^as\s+(.*)/;
@@ -20104,18 +20225,18 @@ function createIfBlock(ast, connectedBlocks, visitor, bindingParser) {
20104
20225
  const branches = [];
20105
20226
  const mainBlockParams = parseConditionalBlockParameters(ast, errors, bindingParser);
20106
20227
  if (mainBlockParams !== null) {
20107
- branches.push(new IfBlockBranch(mainBlockParams.expression, visitAll2(visitor, ast.children, ast.children), mainBlockParams.expressionAlias, ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan, ast.nameSpan));
20228
+ branches.push(new IfBlockBranch(mainBlockParams.expression, visitAll2(visitor, ast.children, ast.children), mainBlockParams.expressionAlias, ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan, ast.nameSpan, ast.i18n));
20108
20229
  }
20109
20230
  for (const block of connectedBlocks) {
20110
20231
  if (ELSE_IF_PATTERN.test(block.name)) {
20111
20232
  const params = parseConditionalBlockParameters(block, errors, bindingParser);
20112
20233
  if (params !== null) {
20113
20234
  const children = visitAll2(visitor, block.children, block.children);
20114
- branches.push(new IfBlockBranch(params.expression, children, params.expressionAlias, block.sourceSpan, block.startSourceSpan, block.endSourceSpan, block.nameSpan));
20235
+ branches.push(new IfBlockBranch(params.expression, children, params.expressionAlias, block.sourceSpan, block.startSourceSpan, block.endSourceSpan, block.nameSpan, block.i18n));
20115
20236
  }
20116
20237
  } else if (block.name === "else") {
20117
20238
  const children = visitAll2(visitor, block.children, block.children);
20118
- branches.push(new IfBlockBranch(null, children, null, block.sourceSpan, block.startSourceSpan, block.endSourceSpan, block.nameSpan));
20239
+ branches.push(new IfBlockBranch(null, children, null, block.sourceSpan, block.startSourceSpan, block.endSourceSpan, block.nameSpan, block.i18n));
20119
20240
  }
20120
20241
  }
20121
20242
  const ifBlockStartSourceSpan = branches.length > 0 ? branches[0].startSourceSpan : ast.startSourceSpan;
@@ -20143,7 +20264,7 @@ function createForLoop(ast, connectedBlocks, visitor, bindingParser) {
20143
20264
  } else if (block.parameters.length > 0) {
20144
20265
  errors.push(new ParseError(block.sourceSpan, "@empty block cannot have parameters"));
20145
20266
  } else {
20146
- empty = new ForLoopBlockEmpty(visitAll2(visitor, block.children, block.children), block.sourceSpan, block.startSourceSpan, block.endSourceSpan, block.nameSpan);
20267
+ empty = new ForLoopBlockEmpty(visitAll2(visitor, block.children, block.children), block.sourceSpan, block.startSourceSpan, block.endSourceSpan, block.nameSpan, block.i18n);
20147
20268
  }
20148
20269
  } else {
20149
20270
  errors.push(new ParseError(block.sourceSpan, `Unrecognized @for loop block "${block.name}"`));
@@ -20155,7 +20276,7 @@ function createForLoop(ast, connectedBlocks, visitor, bindingParser) {
20155
20276
  } else {
20156
20277
  const endSpan = (_a2 = empty == null ? void 0 : empty.endSourceSpan) != null ? _a2 : ast.endSourceSpan;
20157
20278
  const sourceSpan = new ParseSourceSpan(ast.sourceSpan.start, (_b2 = endSpan == null ? void 0 : endSpan.end) != null ? _b2 : ast.sourceSpan.end);
20158
- node = new ForLoopBlock(params.itemName, params.expression, params.trackBy.expression, params.trackBy.keywordSpan, params.context, visitAll2(visitor, ast.children, ast.children), empty, sourceSpan, ast.sourceSpan, ast.startSourceSpan, endSpan, ast.nameSpan);
20279
+ node = new ForLoopBlock(params.itemName, params.expression, params.trackBy.expression, params.trackBy.keywordSpan, params.context, visitAll2(visitor, ast.children, ast.children), empty, sourceSpan, ast.sourceSpan, ast.startSourceSpan, endSpan, ast.nameSpan, ast.i18n);
20159
20280
  }
20160
20281
  }
20161
20282
  return { node, errors };
@@ -20163,7 +20284,7 @@ function createForLoop(ast, connectedBlocks, visitor, bindingParser) {
20163
20284
  function createSwitchBlock(ast, visitor, bindingParser) {
20164
20285
  const errors = validateSwitchBlock(ast);
20165
20286
  const primaryExpression = ast.parameters.length > 0 ? parseBlockParameterToBinding(ast.parameters[0], bindingParser) : bindingParser.parseBinding("", false, ast.sourceSpan, 0);
20166
- const cases = [];
20287
+ const cases2 = [];
20167
20288
  const unknownBlocks = [];
20168
20289
  let defaultCase = null;
20169
20290
  for (const node of ast.children) {
@@ -20175,18 +20296,18 @@ function createSwitchBlock(ast, visitor, bindingParser) {
20175
20296
  continue;
20176
20297
  }
20177
20298
  const expression = node.name === "case" ? parseBlockParameterToBinding(node.parameters[0], bindingParser) : null;
20178
- const ast2 = new SwitchBlockCase(expression, visitAll2(visitor, node.children, node.children), node.sourceSpan, node.startSourceSpan, node.endSourceSpan, node.nameSpan);
20299
+ const ast2 = new SwitchBlockCase(expression, visitAll2(visitor, node.children, node.children), node.sourceSpan, node.startSourceSpan, node.endSourceSpan, node.nameSpan, node.i18n);
20179
20300
  if (expression === null) {
20180
20301
  defaultCase = ast2;
20181
20302
  } else {
20182
- cases.push(ast2);
20303
+ cases2.push(ast2);
20183
20304
  }
20184
20305
  }
20185
20306
  if (defaultCase !== null) {
20186
- cases.push(defaultCase);
20307
+ cases2.push(defaultCase);
20187
20308
  }
20188
20309
  return {
20189
- node: new SwitchBlock(primaryExpression, cases, unknownBlocks, ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan, ast.nameSpan),
20310
+ node: new SwitchBlock(primaryExpression, cases2, unknownBlocks, ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan, ast.nameSpan),
20190
20311
  errors
20191
20312
  };
20192
20313
  }
@@ -20377,7 +20498,7 @@ function stripOptionalParentheses(param, errors) {
20377
20498
  return expression.slice(start, end);
20378
20499
  }
20379
20500
 
20380
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/r3_deferred_triggers.mjs
20501
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_deferred_triggers.mjs
20381
20502
  var TIME_PATTERN = /^\d+\.?\d*(ms|s)?$/;
20382
20503
  var SEPARATOR_PATTERN = /^\s$/;
20383
20504
  var COMMA_DELIMITED_SYNTAX = /* @__PURE__ */ new Map([
@@ -20641,7 +20762,7 @@ function parseDeferredTime(value) {
20641
20762
  return parseFloat(time) * (units === "s" ? 1e3 : 1);
20642
20763
  }
20643
20764
 
20644
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/r3_deferred_blocks.mjs
20765
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_deferred_blocks.mjs
20645
20766
  var PREFETCH_WHEN_PATTERN = /^prefetch\s+when\s/;
20646
20767
  var PREFETCH_ON_PATTERN = /^prefetch\s+on\s/;
20647
20768
  var MINIMUM_PARAMETER_PATTERN = /^minimum\s/;
@@ -20663,7 +20784,7 @@ function createDeferredBlock(ast, connectedBlocks, visitor, bindingParser) {
20663
20784
  endOfLastSourceSpan = lastConnectedBlock.sourceSpan.end;
20664
20785
  }
20665
20786
  const sourceSpanWithConnectedBlocks = new ParseSourceSpan(ast.sourceSpan.start, endOfLastSourceSpan);
20666
- const node = new DeferredBlock(visitAll2(visitor, ast.children, ast.children), triggers, prefetchTriggers, placeholder, loading, error2, ast.nameSpan, sourceSpanWithConnectedBlocks, ast.sourceSpan, ast.startSourceSpan, lastEndSourceSpan);
20787
+ const node = new DeferredBlock(visitAll2(visitor, ast.children, ast.children), triggers, prefetchTriggers, placeholder, loading, error2, ast.nameSpan, sourceSpanWithConnectedBlocks, ast.sourceSpan, ast.startSourceSpan, lastEndSourceSpan, ast.i18n);
20667
20788
  return { node, errors };
20668
20789
  }
20669
20790
  function parseConnectedBlocks(connectedBlocks, errors, visitor) {
@@ -20721,7 +20842,7 @@ function parsePlaceholderBlock(ast, visitor) {
20721
20842
  throw new Error(`Unrecognized parameter in @placeholder block: "${param.expression}"`);
20722
20843
  }
20723
20844
  }
20724
- return new DeferredBlockPlaceholder(visitAll2(visitor, ast.children, ast.children), minimumTime, ast.nameSpan, ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan);
20845
+ return new DeferredBlockPlaceholder(visitAll2(visitor, ast.children, ast.children), minimumTime, ast.nameSpan, ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan, ast.i18n);
20725
20846
  }
20726
20847
  function parseLoadingBlock(ast, visitor) {
20727
20848
  let afterTime = null;
@@ -20749,13 +20870,13 @@ function parseLoadingBlock(ast, visitor) {
20749
20870
  throw new Error(`Unrecognized parameter in @loading block: "${param.expression}"`);
20750
20871
  }
20751
20872
  }
20752
- return new DeferredBlockLoading(visitAll2(visitor, ast.children, ast.children), afterTime, minimumTime, ast.nameSpan, ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan);
20873
+ return new DeferredBlockLoading(visitAll2(visitor, ast.children, ast.children), afterTime, minimumTime, ast.nameSpan, ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan, ast.i18n);
20753
20874
  }
20754
20875
  function parseErrorBlock(ast, visitor) {
20755
20876
  if (ast.parameters.length > 0) {
20756
20877
  throw new Error(`@error block cannot have parameters`);
20757
20878
  }
20758
- return new DeferredBlockError(visitAll2(visitor, ast.children, ast.children), ast.nameSpan, ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan);
20879
+ return new DeferredBlockError(visitAll2(visitor, ast.children, ast.children), ast.nameSpan, ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan, ast.i18n);
20759
20880
  }
20760
20881
  function parsePrimaryTriggers(params, bindingParser, errors, placeholder) {
20761
20882
  const triggers = {};
@@ -20776,7 +20897,7 @@ function parsePrimaryTriggers(params, bindingParser, errors, placeholder) {
20776
20897
  return { triggers, prefetchTriggers };
20777
20898
  }
20778
20899
 
20779
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/r3_template_transform.mjs
20900
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_template_transform.mjs
20780
20901
  var BIND_NAME_REGEXP = /^(?:(bind-)|(let-)|(ref-|#)|(on-)|(bindon-)|(@))(.*)$/;
20781
20902
  var KW_BIND_IDX = 1;
20782
20903
  var KW_LET_IDX = 2;
@@ -21207,7 +21328,7 @@ function textContents(node) {
21207
21328
  }
21208
21329
  }
21209
21330
 
21210
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/i18n/context.mjs
21331
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/i18n/context.mjs
21211
21332
  var TagType;
21212
21333
  (function(TagType2) {
21213
21334
  TagType2[TagType2["ELEMENT"] = 0] = "ELEMENT";
@@ -21239,6 +21360,11 @@ var I18nContext = class {
21239
21360
  const content = { type, index, ctx: this.id, isVoid: node.isVoid, closed };
21240
21361
  updatePlaceholderMap(this.placeholders, ph, content);
21241
21362
  }
21363
+ appendBlockPart(node, index, closed) {
21364
+ const ph = closed ? node.closeName : node.startName;
21365
+ const content = { type: TagType.TEMPLATE, index, ctx: this.id, closed };
21366
+ updatePlaceholderMap(this.placeholders, ph, content);
21367
+ }
21242
21368
  get icus() {
21243
21369
  return this._registry.icus;
21244
21370
  }
@@ -21268,6 +21394,11 @@ var I18nContext = class {
21268
21394
  this.appendTag(TagType.TEMPLATE, node, index, true);
21269
21395
  this._unresolvedCtxCount++;
21270
21396
  }
21397
+ appendBlock(node, index) {
21398
+ this.appendBlockPart(node, index, false);
21399
+ this.appendBlockPart(node, index, true);
21400
+ this._unresolvedCtxCount++;
21401
+ }
21271
21402
  appendElement(node, index, closed) {
21272
21403
  this.appendTag(TagType.ELEMENT, node, index, closed);
21273
21404
  }
@@ -21342,7 +21473,7 @@ function serializePlaceholderValue(value) {
21342
21473
  }
21343
21474
  }
21344
21475
 
21345
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/template.mjs
21476
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/template.mjs
21346
21477
  var NG_CONTENT_SELECT_ATTR2 = "select";
21347
21478
  var NG_PROJECT_AS_ATTR_NAME = "ngProjectAs";
21348
21479
  var EVENT_BINDING_SCOPE_GLOBALS = /* @__PURE__ */ new Set(["$event"]);
@@ -21463,12 +21594,18 @@ var TemplateDefinitionBuilder = class {
21463
21594
  this.creationInstruction(null, Identifiers.pipe, [literal(slot), literal(name)]);
21464
21595
  });
21465
21596
  }
21466
- buildTemplateFunction(nodes, variables, ngContentSelectorsOffset = 0, i18n2) {
21597
+ buildTemplateFunction(nodes, variables, ngContentSelectorsOffset = 0, i18n2, variableAliases) {
21467
21598
  this._ngContentSelectorsOffset = ngContentSelectorsOffset;
21468
21599
  if (this._namespace !== Identifiers.namespaceHTML) {
21469
21600
  this.creationInstruction(null, this._namespace);
21470
21601
  }
21471
- variables.forEach((v) => this.registerContextVariables(v));
21602
+ variables.forEach((v) => {
21603
+ const alias = variableAliases == null ? void 0 : variableAliases[v.name];
21604
+ this.registerContextVariables(v.name, v.value);
21605
+ if (alias) {
21606
+ this.registerContextVariables(alias, v.value);
21607
+ }
21608
+ });
21472
21609
  const initI18nContext = this.i18nContext || isI18nRootNode(i18n2) && !isSingleI18nIcu(i18n2) && !(isSingleElementTemplate(nodes) && nodes[0].i18n === i18n2);
21473
21610
  const selfClosingI18nInstruction = hasTextChildrenOnly(nodes);
21474
21611
  if (initI18nContext) {
@@ -21523,12 +21660,12 @@ var TemplateDefinitionBuilder = class {
21523
21660
  this._constants.prepareStatements.push(...statements);
21524
21661
  return _ref;
21525
21662
  }
21526
- registerContextVariables(variable2) {
21663
+ registerContextVariables(name, value) {
21527
21664
  const scopedName = this._bindingScope.freshReferenceName();
21528
21665
  const retrievalLevel = this.level;
21529
- const isDirect = variable2.value === DIRECT_CONTEXT_REFERENCE;
21530
- const lhs = variable(variable2.name + scopedName);
21531
- this._bindingScope.set(retrievalLevel, variable2.name, (scope) => {
21666
+ const isDirect = value === DIRECT_CONTEXT_REFERENCE;
21667
+ const lhs = variable(name + scopedName);
21668
+ this._bindingScope.set(retrievalLevel, name, (scope) => {
21532
21669
  return isDirect && scope.bindingLevel === retrievalLevel && !scope.isListenerScope() ? variable(CONTEXT_NAME) : lhs;
21533
21670
  }, 1, (scope, relativeLevel) => {
21534
21671
  let rhs;
@@ -21546,7 +21683,7 @@ var TemplateDefinitionBuilder = class {
21546
21683
  rhs = sharedCtxVar ? sharedCtxVar : generateNextContextExpr(relativeLevel);
21547
21684
  }
21548
21685
  return [
21549
- lhs.set(isDirect ? rhs : rhs.prop(variable2.value || IMPLICIT_REFERENCE)).toConstDecl()
21686
+ lhs.set(isDirect ? rhs : rhs.prop(value || IMPLICIT_REFERENCE)).toConstDecl()
21550
21687
  ];
21551
21688
  });
21552
21689
  }
@@ -21885,16 +22022,20 @@ var TemplateDefinitionBuilder = class {
21885
22022
  this.creationInstruction(span, isNgContainer2 ? Identifiers.elementContainerEnd : Identifiers.elementEnd);
21886
22023
  }
21887
22024
  }
21888
- prepareEmbeddedTemplateFn(children, contextNameSuffix, variables = [], i18n2) {
22025
+ prepareEmbeddedTemplateFn(children, contextNameSuffix, variables = [], i18nMeta, variableAliases) {
21889
22026
  const index = this.allocateDataSlot();
21890
- if (this.i18n && i18n2) {
21891
- this.i18n.appendTemplate(i18n2, index);
22027
+ if (this.i18n && i18nMeta) {
22028
+ if (i18nMeta instanceof BlockPlaceholder) {
22029
+ this.i18n.appendBlock(i18nMeta, index);
22030
+ } else {
22031
+ this.i18n.appendTemplate(i18nMeta, index);
22032
+ }
21892
22033
  }
21893
22034
  const contextName = `${this.contextName}${contextNameSuffix}_${index}`;
21894
22035
  const name = `${contextName}_Template`;
21895
22036
  const visitor = new TemplateDefinitionBuilder(this.constantPool, this._bindingScope, this.level + 1, contextName, this.i18n, index, name, this._namespace, this.fileBasedI18nSuffix, this.i18nUseExternalIds, this.deferBlocks, this.elementLocations, this._constants);
21896
22037
  this._nestedTemplateFns.push(() => {
21897
- const templateFunctionExpr = visitor.buildTemplateFunction(children, variables, this._ngContentReservedSlots.length + this._ngContentSelectorsOffset, i18n2);
22038
+ const templateFunctionExpr = visitor.buildTemplateFunction(children, variables, this._ngContentReservedSlots.length + this._ngContentSelectorsOffset, i18nMeta, variableAliases);
21898
22039
  this.constantPool.statements.push(templateFunctionExpr.toDeclStmt(name));
21899
22040
  if (visitor._ngContentReservedSlots.length) {
21900
22041
  this._ngContentReservedSlots.push(...visitor._ngContentReservedSlots);
@@ -22004,7 +22145,7 @@ var TemplateDefinitionBuilder = class {
22004
22145
  tagName = inferredData.tagName;
22005
22146
  attrsExprs = inferredData.attrsExprs;
22006
22147
  }
22007
- const templateIndex = this.createEmbeddedTemplateFn(tagName, children, "_Conditional", sourceSpan, variables, attrsExprs);
22148
+ const templateIndex = this.createEmbeddedTemplateFn(tagName, children, "_Conditional", sourceSpan, variables, attrsExprs, void 0, branch.i18n);
22008
22149
  const processedExpression = expression === null ? null : expression.visit(this._valueConverter);
22009
22150
  return { index: templateIndex, expression: processedExpression, alias: expressionAlias };
22010
22151
  });
@@ -22038,7 +22179,7 @@ var TemplateDefinitionBuilder = class {
22038
22179
  }
22039
22180
  visitSwitchBlock(block) {
22040
22181
  const caseData = block.cases.map((currentCase) => {
22041
- const index = this.createEmbeddedTemplateFn(null, currentCase.children, "_Case", currentCase.sourceSpan);
22182
+ const index = this.createEmbeddedTemplateFn(null, currentCase.children, "_Case", currentCase.sourceSpan, void 0, void 0, void 0, currentCase.i18n);
22042
22183
  const expression = currentCase.expression === null ? null : currentCase.expression.visit(this._valueConverter);
22043
22184
  return { index, expression };
22044
22185
  });
@@ -22066,12 +22207,12 @@ var TemplateDefinitionBuilder = class {
22066
22207
  if (!metadata) {
22067
22208
  throw new Error("Could not resolve `defer` block metadata. Block may need to be analyzed.");
22068
22209
  }
22069
- const primaryTemplateIndex = this.createEmbeddedTemplateFn(null, deferred.children, "_Defer", deferred.sourceSpan);
22070
- const loadingIndex = loading ? this.createEmbeddedTemplateFn(null, loading.children, "_DeferLoading", loading.sourceSpan) : null;
22210
+ const primaryTemplateIndex = this.createEmbeddedTemplateFn(null, deferred.children, "_Defer", deferred.sourceSpan, void 0, void 0, void 0, deferred.i18n);
22211
+ const loadingIndex = loading ? this.createEmbeddedTemplateFn(null, loading.children, "_DeferLoading", loading.sourceSpan, void 0, void 0, void 0, loading.i18n) : null;
22071
22212
  const loadingConsts = loading ? trimTrailingNulls([literal(loading.minimumTime), literal(loading.afterTime)]) : null;
22072
- const placeholderIndex = placeholder ? this.createEmbeddedTemplateFn(null, placeholder.children, "_DeferPlaceholder", placeholder.sourceSpan) : null;
22213
+ const placeholderIndex = placeholder ? this.createEmbeddedTemplateFn(null, placeholder.children, "_DeferPlaceholder", placeholder.sourceSpan, void 0, void 0, void 0, placeholder.i18n) : null;
22073
22214
  const placeholderConsts = placeholder && placeholder.minimumTime !== null ? literalArr([literal(placeholder.minimumTime)]) : null;
22074
- const errorIndex = error2 ? this.createEmbeddedTemplateFn(null, error2.children, "_DeferError", error2.sourceSpan) : null;
22215
+ const errorIndex = error2 ? this.createEmbeddedTemplateFn(null, error2.children, "_DeferError", error2.sourceSpan, void 0, void 0, void 0, error2.i18n) : null;
22075
22216
  const deferredIndex = this.allocateDataSlot();
22076
22217
  const depsFnName = `${this.contextName}_Defer_${deferredIndex}_DepsFn`;
22077
22218
  this.creationInstruction(deferred.sourceSpan, Identifiers.defer, trimTrailingNulls([
@@ -22180,11 +22321,14 @@ var TemplateDefinitionBuilder = class {
22180
22321
  visitForLoopBlock(block) {
22181
22322
  const blockIndex = this.allocateDataSlot();
22182
22323
  const { tagName, attrsExprs } = this.inferProjectionDataFromInsertionPoint(block);
22183
- const primaryData = this.prepareEmbeddedTemplateFn(block.children, "_For", [block.item, block.contextVariables.$index, block.contextVariables.$count]);
22324
+ const primaryData = this.prepareEmbeddedTemplateFn(block.children, "_For", [block.item, block.contextVariables.$index, block.contextVariables.$count], block.i18n, {
22325
+ [block.contextVariables.$index.name]: this.getLevelSpecificVariableName("$index", this.level + 1),
22326
+ [block.contextVariables.$count.name]: this.getLevelSpecificVariableName("$count", this.level + 1)
22327
+ });
22184
22328
  const { expression: trackByExpression, usesComponentInstance: trackByUsesComponentInstance } = this.createTrackByFunction(block);
22185
22329
  let emptyData = null;
22186
22330
  if (block.empty !== null) {
22187
- emptyData = this.prepareEmbeddedTemplateFn(block.empty.children, "_ForEmpty");
22331
+ emptyData = this.prepareEmbeddedTemplateFn(block.empty.children, "_ForEmpty", void 0, block.empty.i18n);
22188
22332
  this.allocateBindingSlots(null);
22189
22333
  }
22190
22334
  this.registerComputedLoopVariables(block, primaryData.scope);
@@ -22206,16 +22350,31 @@ var TemplateDefinitionBuilder = class {
22206
22350
  return params;
22207
22351
  });
22208
22352
  const value = block.expression.visit(this._valueConverter);
22209
- this.updateInstruction(block.sourceSpan, Identifiers.repeater, () => [literal(blockIndex), this.convertPropertyBinding(value)]);
22353
+ this.updateInstructionWithAdvance(blockIndex, block.sourceSpan, Identifiers.repeater, () => [this.convertPropertyBinding(value)]);
22210
22354
  }
22211
22355
  registerComputedLoopVariables(block, bindingScope) {
22212
- const indexLocalName = block.contextVariables.$index.name;
22213
- const countLocalName = block.contextVariables.$count.name;
22214
22356
  const level = bindingScope.bindingLevel;
22215
- bindingScope.set(level, block.contextVariables.$odd.name, (scope) => scope.get(indexLocalName).modulo(literal(2)).notIdentical(literal(0)));
22216
- bindingScope.set(level, block.contextVariables.$even.name, (scope) => scope.get(indexLocalName).modulo(literal(2)).identical(literal(0)));
22217
- bindingScope.set(level, block.contextVariables.$first.name, (scope) => scope.get(indexLocalName).identical(literal(0)));
22218
- bindingScope.set(level, block.contextVariables.$last.name, (scope) => scope.get(indexLocalName).identical(scope.get(countLocalName).minus(literal(1))));
22357
+ bindingScope.set(level, block.contextVariables.$odd.name, (scope, retrievalLevel) => {
22358
+ return this.getLevelSpecificForLoopVariable(block, scope, retrievalLevel, "$index").modulo(literal(2)).notIdentical(literal(0));
22359
+ });
22360
+ bindingScope.set(level, block.contextVariables.$even.name, (scope, retrievalLevel) => {
22361
+ return this.getLevelSpecificForLoopVariable(block, scope, retrievalLevel, "$index").modulo(literal(2)).identical(literal(0));
22362
+ });
22363
+ bindingScope.set(level, block.contextVariables.$first.name, (scope, retrievalLevel) => {
22364
+ return this.getLevelSpecificForLoopVariable(block, scope, retrievalLevel, "$index").identical(literal(0));
22365
+ });
22366
+ bindingScope.set(level, block.contextVariables.$last.name, (scope, retrievalLevel) => {
22367
+ const index = this.getLevelSpecificForLoopVariable(block, scope, retrievalLevel, "$index");
22368
+ const count = this.getLevelSpecificForLoopVariable(block, scope, retrievalLevel, "$count");
22369
+ return index.identical(count.minus(literal(1)));
22370
+ });
22371
+ }
22372
+ getLevelSpecificVariableName(name, level) {
22373
+ return `\u0275${name}_${level}`;
22374
+ }
22375
+ getLevelSpecificForLoopVariable(block, scope, retrievalLevel, name) {
22376
+ const scopeName = scope.bindingLevel === retrievalLevel ? block.contextVariables[name].name : this.getLevelSpecificVariableName(name, retrievalLevel);
22377
+ return scope.get(scopeName);
22219
22378
  }
22220
22379
  optimizeTrackByFunction(block) {
22221
22380
  const indexLocalName = block.contextVariables.$index.name;
@@ -22625,7 +22784,7 @@ var BindingScope = class {
22625
22784
  if (value.declareLocalCallback && !value.declare) {
22626
22785
  value.declare = true;
22627
22786
  }
22628
- return typeof value.lhs === "function" ? value.lhs(this) : value.lhs;
22787
+ return typeof value.lhs === "function" ? value.lhs(this, value.retrievalLevel) : value.lhs;
22629
22788
  }
22630
22789
  current = current.parent;
22631
22790
  }
@@ -22701,7 +22860,7 @@ var BindingScope = class {
22701
22860
  const componentValue = this.map.get(SHARED_CONTEXT_KEY + 0);
22702
22861
  componentValue.declare = true;
22703
22862
  this.maybeRestoreView();
22704
- const lhs = typeof componentValue.lhs === "function" ? componentValue.lhs(this) : componentValue.lhs;
22863
+ const lhs = typeof componentValue.lhs === "function" ? componentValue.lhs(this, componentValue.retrievalLevel) : componentValue.lhs;
22705
22864
  return name === DIRECT_CONTEXT_REFERENCE ? lhs : lhs.prop(name);
22706
22865
  }
22707
22866
  maybeRestoreView() {
@@ -22774,21 +22933,6 @@ var TrackByBindingScope = class extends BindingScope {
22774
22933
  return this.componentAccessCount;
22775
22934
  }
22776
22935
  };
22777
- function createCssSelector(elementName, attributes) {
22778
- const cssSelector = new CssSelector();
22779
- const elementNameNoNs = splitNsName(elementName)[1];
22780
- cssSelector.setElement(elementNameNoNs);
22781
- Object.getOwnPropertyNames(attributes).forEach((name) => {
22782
- const nameNoNs = splitNsName(name)[1];
22783
- const value = attributes[name];
22784
- cssSelector.addAttribute(nameNoNs, value);
22785
- if (name.toLowerCase() === "class") {
22786
- const classes = value.trim().split(/\s+/);
22787
- classes.forEach((className) => cssSelector.addClassName(className));
22788
- }
22789
- });
22790
- return cssSelector;
22791
- }
22792
22936
  function getNgProjectAsLiteral(attribute2) {
22793
22937
  const parsedR3Selector = parseSelectorToR3Selector(attribute2.value)[0];
22794
22938
  return [literal(5), asLiteral(parsedR3Selector)];
@@ -23006,7 +23150,7 @@ function createClosureModeGuard2() {
23006
23150
  return typeofExpr(variable(NG_I18N_CLOSURE_MODE2)).notIdentical(literal("undefined", STRING_TYPE)).and(variable(NG_I18N_CLOSURE_MODE2));
23007
23151
  }
23008
23152
 
23009
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/compiler.mjs
23153
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/compiler.mjs
23010
23154
  var ATTR_REGEX = /attr\.([^\]]+)/;
23011
23155
  var COMPONENT_VARIABLE = "%COMP%";
23012
23156
  var HOST_ATTR = `_nghost-${COMPONENT_VARIABLE}`;
@@ -23057,6 +23201,9 @@ function addFeatures(definitionMap, meta) {
23057
23201
  break;
23058
23202
  }
23059
23203
  }
23204
+ if ((_a2 = meta.hostDirectives) == null ? void 0 : _a2.length) {
23205
+ features.push(importExpr(Identifiers.HostDirectivesFeature).callFn([createHostDirectivesFeatureArg(meta.hostDirectives)]));
23206
+ }
23060
23207
  if (meta.usesInheritance) {
23061
23208
  features.push(importExpr(Identifiers.InheritDefinitionFeature));
23062
23209
  }
@@ -23069,9 +23216,6 @@ function addFeatures(definitionMap, meta) {
23069
23216
  if (meta.hasOwnProperty("template") && meta.isStandalone) {
23070
23217
  features.push(importExpr(Identifiers.StandaloneFeature));
23071
23218
  }
23072
- if ((_a2 = meta.hostDirectives) == null ? void 0 : _a2.length) {
23073
- features.push(importExpr(Identifiers.HostDirectivesFeature).callFn([createHostDirectivesFeatureArg(meta.hostDirectives)]));
23074
- }
23075
23219
  if (features.length) {
23076
23220
  definitionMap.set("features", literalArr(features));
23077
23221
  }
@@ -23608,7 +23752,7 @@ function createHostDirectivesMappingArray(mapping) {
23608
23752
  return elements.length > 0 ? literalArr(elements) : null;
23609
23753
  }
23610
23754
 
23611
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/view/t2_binder.mjs
23755
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/t2_binder.mjs
23612
23756
  var R3TargetBinder = class {
23613
23757
  constructor(directiveMatcher) {
23614
23758
  this.directiveMatcher = directiveMatcher;
@@ -23776,13 +23920,13 @@ var DirectiveBinder = class {
23776
23920
  template2.forEach((node) => node.visit(this));
23777
23921
  }
23778
23922
  visitElement(element2) {
23779
- this.visitElementOrTemplate(element2.name, element2);
23923
+ this.visitElementOrTemplate(element2);
23780
23924
  }
23781
23925
  visitTemplate(template2) {
23782
- this.visitElementOrTemplate("ng-template", template2);
23926
+ this.visitElementOrTemplate(template2);
23783
23927
  }
23784
- visitElementOrTemplate(elementName, node) {
23785
- const cssSelector = createCssSelector(elementName, getAttrsForDirectiveMatching(node));
23928
+ visitElementOrTemplate(node) {
23929
+ const cssSelector = createCssSelectorFromNode(node);
23786
23930
  const directives = [];
23787
23931
  this.matcher.match(cssSelector, (_selector, results) => directives.push(...results));
23788
23932
  if (directives.length > 0) {
@@ -24213,11 +24357,11 @@ function extractScopedNodeEntities(rootScope) {
24213
24357
  return templateEntities;
24214
24358
  }
24215
24359
 
24216
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/resource_loader.mjs
24360
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/resource_loader.mjs
24217
24361
  var ResourceLoader = class {
24218
24362
  };
24219
24363
 
24220
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/jit_compiler_facade.mjs
24364
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/jit_compiler_facade.mjs
24221
24365
  var CompilerFacadeImpl = class {
24222
24366
  constructor(jitEvaluator = new JitEvaluator()) {
24223
24367
  this.jitEvaluator = jitEvaluator;
@@ -24769,17 +24913,17 @@ function publishFacade(global) {
24769
24913
  ng.\u0275compilerFacade = new CompilerFacadeImpl();
24770
24914
  }
24771
24915
 
24772
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/version.mjs
24773
- var VERSION2 = new Version("17.1.0-next.0");
24916
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/version.mjs
24917
+ var VERSION2 = new Version("17.1.0-next.2");
24774
24918
 
24775
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/i18n/extractor_merger.mjs
24919
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/extractor_merger.mjs
24776
24920
  var _VisitorMode;
24777
24921
  (function(_VisitorMode2) {
24778
24922
  _VisitorMode2[_VisitorMode2["Extract"] = 0] = "Extract";
24779
24923
  _VisitorMode2[_VisitorMode2["Merge"] = 1] = "Merge";
24780
24924
  })(_VisitorMode || (_VisitorMode = {}));
24781
24925
 
24782
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/ml_parser/xml_tags.mjs
24926
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/xml_tags.mjs
24783
24927
  var XmlTagDefinition = class {
24784
24928
  constructor() {
24785
24929
  this.closedByParent = false;
@@ -24801,7 +24945,7 @@ var XmlTagDefinition = class {
24801
24945
  };
24802
24946
  var _TAG_DEFINITION = new XmlTagDefinition();
24803
24947
 
24804
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/render3/partial/api.mjs
24948
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/partial/api.mjs
24805
24949
  var FactoryTarget2;
24806
24950
  (function(FactoryTarget3) {
24807
24951
  FactoryTarget3[FactoryTarget3["Directive"] = 0] = "Directive";
@@ -24811,13 +24955,14 @@ var FactoryTarget2;
24811
24955
  FactoryTarget3[FactoryTarget3["NgModule"] = 4] = "NgModule";
24812
24956
  })(FactoryTarget2 || (FactoryTarget2 = {}));
24813
24957
 
24814
- // bazel-out/k8-fastbuild/bin/packages/compiler/src/compiler.mjs
24958
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/compiler.mjs
24815
24959
  publishFacade(_global);
24816
24960
 
24817
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/types.mjs
24961
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/types.mjs
24818
24962
  var ngtemplate = "ng-template";
24819
24963
  var boundngifelse = "[ngIfElse]";
24820
24964
  var boundngifthenelse = "[ngIfThenElse]";
24965
+ var boundngifthen = "[ngIfThen]";
24821
24966
  var nakedngfor = "ngFor";
24822
24967
  function allFormsOf(selector) {
24823
24968
  return [
@@ -24874,17 +25019,44 @@ var ElementToMigrate = class {
24874
25019
  this.thenAttr = thenAttr;
24875
25020
  this.forAttrs = forAttrs;
24876
25021
  }
24877
- getCondition(targetStr) {
24878
- const targetLocation = this.attr.value.indexOf(targetStr);
24879
- return this.attr.value.slice(0, targetLocation);
25022
+ getCondition() {
25023
+ const chunks = this.attr.value.split(";");
25024
+ let condition = chunks[0];
25025
+ const elseIx = condition.indexOf(" else ");
25026
+ const thenIx = condition.indexOf(" then ");
25027
+ if (thenIx > -1) {
25028
+ condition = condition.slice(0, thenIx);
25029
+ } else if (elseIx > -1) {
25030
+ condition = condition.slice(0, elseIx);
25031
+ }
25032
+ let letVar = chunks.find((c) => c.search(/\s*let\s/) > -1);
25033
+ return condition + (letVar ? ";" + letVar : "");
24880
25034
  }
24881
25035
  getTemplateName(targetStr, secondStr) {
24882
25036
  const targetLocation = this.attr.value.indexOf(targetStr);
24883
- if (secondStr) {
24884
- const secondTargetLocation = this.attr.value.indexOf(secondStr);
24885
- return this.attr.value.slice(targetLocation + targetStr.length, secondTargetLocation).trim();
25037
+ const secondTargetLocation = secondStr ? this.attr.value.indexOf(secondStr) : void 0;
25038
+ return this.attr.value.slice(targetLocation + targetStr.length, secondTargetLocation).replace(":", "").trim().split(";")[0].trim();
25039
+ }
25040
+ getValueEnd(offset) {
25041
+ return (this.attr.valueSpan ? this.attr.valueSpan.end.offset + 1 : this.attr.keySpan.end.offset) - offset;
25042
+ }
25043
+ hasChildren() {
25044
+ return this.el.children.length > 0;
25045
+ }
25046
+ getChildSpan(offset) {
25047
+ const childStart = this.el.children[0].sourceSpan.start.offset - offset;
25048
+ const childEnd = this.el.children[this.el.children.length - 1].sourceSpan.end.offset - offset;
25049
+ return { childStart, childEnd };
25050
+ }
25051
+ shouldRemoveElseAttr() {
25052
+ return (this.el.name === "ng-template" || this.el.name === "ng-container") && this.elseAttr !== void 0;
25053
+ }
25054
+ getElseAttrStr() {
25055
+ if (this.elseAttr !== void 0) {
25056
+ const elseValStr = this.elseAttr.value !== "" ? `="${this.elseAttr.value}"` : "";
25057
+ return `${this.elseAttr.name}${elseValStr}`;
24886
25058
  }
24887
- return this.attr.value.slice(targetLocation + targetStr.length).trim();
25059
+ return "";
24888
25060
  }
24889
25061
  start(offset) {
24890
25062
  var _a2;
@@ -24900,17 +25072,34 @@ var ElementToMigrate = class {
24900
25072
  }
24901
25073
  };
24902
25074
  var Template2 = class {
24903
- constructor(el, i18n2) {
25075
+ constructor(el, name, i18n2) {
24904
25076
  __publicField(this, "el");
25077
+ __publicField(this, "name");
24905
25078
  __publicField(this, "count", 0);
24906
25079
  __publicField(this, "contents", "");
24907
25080
  __publicField(this, "children", "");
24908
25081
  __publicField(this, "i18n", null);
25082
+ __publicField(this, "attributes");
24909
25083
  this.el = el;
25084
+ this.name = name;
25085
+ this.attributes = el.attrs;
24910
25086
  this.i18n = i18n2;
24911
25087
  }
25088
+ get isNgTemplateOutlet() {
25089
+ return this.attributes.find((attr) => attr.name === "*ngTemplateOutlet") !== void 0;
25090
+ }
25091
+ get outletContext() {
25092
+ const letVar = this.attributes.find((attr) => attr.name.startsWith("let-"));
25093
+ return letVar ? `; context: {$implicit: ${letVar.name.split("-")[1]}}` : "";
25094
+ }
25095
+ generateTemplateOutlet() {
25096
+ var _a2;
25097
+ const attr = this.attributes.find((attr2) => attr2.name === "*ngTemplateOutlet");
25098
+ const outletValue = (_a2 = attr == null ? void 0 : attr.value) != null ? _a2 : this.name.slice(1);
25099
+ return `<ng-container *ngTemplateOutlet="${outletValue}${this.outletContext}"></ng-container>`;
25100
+ }
24912
25101
  generateContents(tmpl) {
24913
- this.contents = tmpl.slice(this.el.sourceSpan.start.offset, this.el.sourceSpan.end.offset + 1);
25102
+ this.contents = tmpl.slice(this.el.sourceSpan.start.offset, this.el.sourceSpan.end.offset);
24914
25103
  this.children = "";
24915
25104
  if (this.el.children.length > 0) {
24916
25105
  this.children = tmpl.slice(this.el.children[0].sourceSpan.start.offset, this.el.children[this.el.children.length - 1].sourceSpan.end.offset);
@@ -24921,16 +25110,18 @@ var AnalyzedFile = class {
24921
25110
  constructor() {
24922
25111
  __publicField(this, "ranges", []);
24923
25112
  __publicField(this, "removeCommonModule", false);
25113
+ __publicField(this, "sourceFilePath", "");
24924
25114
  }
24925
25115
  getSortedRanges() {
24926
- const templateRanges = this.ranges.slice().filter((x) => x.type === "template").sort((aStart, bStart) => bStart.start - aStart.start);
25116
+ const templateRanges = this.ranges.slice().filter((x) => x.type !== "import").sort((aStart, bStart) => bStart.start - aStart.start);
24927
25117
  const importRanges = this.ranges.slice().filter((x) => x.type === "import").sort((aStart, bStart) => bStart.start - aStart.start);
24928
25118
  return [...templateRanges, ...importRanges];
24929
25119
  }
24930
- static addRange(path2, analyzedFiles, range) {
25120
+ static addRange(path2, sourceFilePath, analyzedFiles, range) {
24931
25121
  let analysis = analyzedFiles.get(path2);
24932
25122
  if (!analysis) {
24933
25123
  analysis = new AnalyzedFile();
25124
+ analysis.sourceFilePath = sourceFilePath;
24934
25125
  analyzedFiles.set(path2, analysis);
24935
25126
  }
24936
25127
  const duplicate = analysis.ranges.find((current) => current.start === range.start && current.end === range.end);
@@ -24978,7 +25169,7 @@ var ElementCollector = class extends RecursiveVisitor {
24978
25169
  for (const attr of el.attrs) {
24979
25170
  if (this._attributes.includes(attr.name)) {
24980
25171
  const elseAttr = el.attrs.find((x) => x.name === boundngifelse);
24981
- const thenAttr = el.attrs.find((x) => x.name === boundngifthenelse);
25172
+ const thenAttr = el.attrs.find((x) => x.name === boundngifthenelse || x.name === boundngifthen);
24982
25173
  const forAttrs = attr.name === nakedngfor ? this.getForAttrs(el) : void 0;
24983
25174
  this.elements.push(new ElementToMigrate(el, attr, elseAttr, thenAttr, forAttrs));
24984
25175
  }
@@ -25027,16 +25218,18 @@ var TemplateCollector = class extends RecursiveVisitor {
25027
25218
  templateAttr = attr;
25028
25219
  }
25029
25220
  }
25030
- if (templateAttr !== null) {
25221
+ if (templateAttr !== null && !this.templates.has(templateAttr.name)) {
25222
+ this.templates.set(templateAttr.name, new Template2(el, templateAttr.name, i18n2));
25031
25223
  this.elements.push(new ElementToMigrate(el, templateAttr));
25032
- this.templates.set(templateAttr.name, new Template2(el, i18n2));
25224
+ } else if (templateAttr !== null) {
25225
+ throw new Error(`A duplicate ng-template name "${templateAttr.name}" was found. The control flow migration requires unique ng-template names within a component.`);
25033
25226
  }
25034
25227
  }
25035
25228
  super.visitElement(el, null);
25036
25229
  }
25037
25230
  };
25038
25231
 
25039
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/util.mjs
25232
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/util.mjs
25040
25233
  var import_path2 = require("path");
25041
25234
  var import_typescript5 = __toESM(require("typescript"), 1);
25042
25235
  var importRemovals = [
@@ -25060,13 +25253,19 @@ function analyze(sourceFile, analyzedFiles) {
25060
25253
  }
25061
25254
  });
25062
25255
  }
25256
+ function checkIfShouldChange(decl, removeCommonModule) {
25257
+ const clause = decl.getChildAt(1);
25258
+ return !(!removeCommonModule && clause.namedBindings && import_typescript5.default.isNamedImports(clause.namedBindings) && clause.namedBindings.elements.length === 1 && clause.namedBindings.elements[0].getText() === "CommonModule");
25259
+ }
25063
25260
  function updateImportDeclaration(decl, removeCommonModule) {
25064
25261
  const clause = decl.getChildAt(1);
25065
25262
  const updatedClause = updateImportClause(clause, removeCommonModule);
25066
25263
  if (updatedClause === null) {
25067
25264
  return "";
25068
25265
  }
25069
- const printer = import_typescript5.default.createPrinter();
25266
+ const printer = import_typescript5.default.createPrinter({
25267
+ removeComments: true
25268
+ });
25070
25269
  const updated = import_typescript5.default.factory.updateImportDeclaration(decl, decl.modifiers, updatedClause, decl.moduleSpecifier, void 0);
25071
25270
  return printer.printNode(import_typescript5.default.EmitHint.Unspecified, updated, clause.getSourceFile());
25072
25271
  }
@@ -25082,10 +25281,15 @@ function updateImportClause(clause, removeCommonModule) {
25082
25281
  return clause;
25083
25282
  }
25084
25283
  function updateClassImports(propAssignment, removeCommonModule) {
25085
- const printer = import_typescript5.default.createPrinter();
25284
+ const printer = import_typescript5.default.createPrinter({
25285
+ removeComments: true
25286
+ });
25086
25287
  const importList = propAssignment.initializer;
25087
25288
  const removals = removeCommonModule ? importWithCommonRemovals : importRemovals;
25088
25289
  const elements = importList.elements.filter((el) => !removals.includes(el.getText()));
25290
+ if (elements.length === importList.elements.length) {
25291
+ return null;
25292
+ }
25089
25293
  const updatedElements = import_typescript5.default.factory.updateArrayLiteralExpression(importList, elements);
25090
25294
  const updatedAssignment = import_typescript5.default.factory.updatePropertyAssignment(propAssignment, propAssignment.name, updatedElements);
25091
25295
  return printer.printNode(import_typescript5.default.EmitHint.Unspecified, updatedAssignment, updatedAssignment.getSourceFile());
@@ -25098,7 +25302,7 @@ function analyzeImportDeclarations(node, sourceFile, analyzedFiles) {
25098
25302
  if (clause.namedBindings && import_typescript5.default.isNamedImports(clause.namedBindings)) {
25099
25303
  const elements = clause.namedBindings.elements.filter((el) => importWithCommonRemovals.includes(el.getText()));
25100
25304
  if (elements.length > 0) {
25101
- AnalyzedFile.addRange(sourceFile.fileName, analyzedFiles, { start: node.getStart(), end: node.getEnd(), node, type: "import" });
25305
+ AnalyzedFile.addRange(sourceFile.fileName, sourceFile.fileName, analyzedFiles, { start: node.getStart(), end: node.getEnd(), node, type: "import" });
25102
25306
  }
25103
25307
  }
25104
25308
  }
@@ -25117,7 +25321,7 @@ function analyzeDecorators(node, sourceFile, analyzedFiles) {
25117
25321
  }
25118
25322
  switch (prop.name.text) {
25119
25323
  case "template":
25120
- AnalyzedFile.addRange(sourceFile.fileName, analyzedFiles, {
25324
+ AnalyzedFile.addRange(sourceFile.fileName, sourceFile.fileName, analyzedFiles, {
25121
25325
  start: prop.initializer.getStart() + 1,
25122
25326
  end: prop.initializer.getEnd() - 1,
25123
25327
  node: prop,
@@ -25125,7 +25329,7 @@ function analyzeDecorators(node, sourceFile, analyzedFiles) {
25125
25329
  });
25126
25330
  break;
25127
25331
  case "imports":
25128
- AnalyzedFile.addRange(sourceFile.fileName, analyzedFiles, {
25332
+ AnalyzedFile.addRange(sourceFile.fileName, sourceFile.fileName, analyzedFiles, {
25129
25333
  start: prop.name.getStart(),
25130
25334
  end: prop.initializer.getEnd(),
25131
25335
  node: prop,
@@ -25135,7 +25339,7 @@ function analyzeDecorators(node, sourceFile, analyzedFiles) {
25135
25339
  case "templateUrl":
25136
25340
  if (import_typescript5.default.isStringLiteralLike(prop.initializer)) {
25137
25341
  const path2 = (0, import_path2.join)((0, import_path2.dirname)(sourceFile.fileName), prop.initializer.text);
25138
- AnalyzedFile.addRange(path2, analyzedFiles, { start: 0, node: prop, type: "template" });
25342
+ AnalyzedFile.addRange(path2, sourceFile.fileName, analyzedFiles, { start: 0, node: prop, type: "templateUrl" });
25139
25343
  }
25140
25344
  break;
25141
25345
  }
@@ -25201,7 +25405,7 @@ function reduceNestingOffset(el, nestLevel, offset, postOffsets) {
25201
25405
  }
25202
25406
  return offset;
25203
25407
  }
25204
- function countTemplateUsage(template2) {
25408
+ function getTemplates(template2) {
25205
25409
  var _a2;
25206
25410
  const parsed = parseTemplate2(template2);
25207
25411
  if (parsed !== null) {
@@ -25209,7 +25413,7 @@ function countTemplateUsage(template2) {
25209
25413
  visitAll2(visitor, parsed.rootNodes);
25210
25414
  for (let [key, tmpl] of visitor.templates) {
25211
25415
  const escapeKey = escapeRegExp(key.slice(1));
25212
- const regex = new RegExp(`[^a-zA-Z0-9-<]${escapeKey}\\W`, "gm");
25416
+ const regex = new RegExp(`[^a-zA-Z0-9-<']${escapeKey}\\W`, "gm");
25213
25417
  const matches = template2.match(regex);
25214
25418
  tmpl.count = (_a2 = matches == null ? void 0 : matches.length) != null ? _a2 : 0;
25215
25419
  tmpl.generateContents(template2);
@@ -25219,27 +25423,47 @@ function countTemplateUsage(template2) {
25219
25423
  return /* @__PURE__ */ new Map();
25220
25424
  }
25221
25425
  function wrapIntoI18nContainer(i18nAttr, content) {
25426
+ const { start, middle, end } = generatei18nContainer(i18nAttr, content);
25427
+ return `${start}${middle}${end}`;
25428
+ }
25429
+ function generatei18nContainer(i18nAttr, middle) {
25222
25430
  const i18n2 = i18nAttr.value === "" ? "i18n" : `i18n="${i18nAttr.value}"`;
25223
- return `<ng-container ${i18n2}>${content}</ng-container>`;
25431
+ return { start: `<ng-container ${i18n2}>`, middle, end: `</ng-container>` };
25224
25432
  }
25225
25433
  function processNgTemplates(template2) {
25226
- const templates = countTemplateUsage(template2);
25227
- for (const [name, t] of templates) {
25228
- const replaceRegex = new RegExp(`${name}\\|`, "g");
25229
- const matches = [...template2.matchAll(replaceRegex)];
25230
- if (matches.length > 0) {
25231
- if (t.i18n !== null) {
25232
- const container = wrapIntoI18nContainer(t.i18n, t.children);
25233
- template2 = template2.replace(replaceRegex, container);
25234
- } else {
25235
- template2 = template2.replace(replaceRegex, t.children);
25236
- }
25237
- if (t.count === matches.length + 1) {
25238
- template2 = template2.replace(t.contents, "");
25434
+ try {
25435
+ const templates = getTemplates(template2);
25436
+ for (const [name, t] of templates) {
25437
+ const replaceRegex = new RegExp(`${name}\\|`, "g");
25438
+ const forRegex = new RegExp(`${name}\\#`, "g");
25439
+ const forMatches = [...template2.matchAll(forRegex)];
25440
+ const matches = [...forMatches, ...template2.matchAll(replaceRegex)];
25441
+ let safeToRemove = true;
25442
+ if (matches.length > 0) {
25443
+ if (t.i18n !== null) {
25444
+ const container = wrapIntoI18nContainer(t.i18n, t.children);
25445
+ template2 = template2.replace(replaceRegex, container);
25446
+ } else if (t.children.trim() === "" && t.isNgTemplateOutlet) {
25447
+ template2 = template2.replace(replaceRegex, t.generateTemplateOutlet());
25448
+ } else if (forMatches.length > 0) {
25449
+ if (t.count === 2) {
25450
+ template2 = template2.replace(forRegex, t.children);
25451
+ } else {
25452
+ template2 = template2.replace(forRegex, t.generateTemplateOutlet());
25453
+ safeToRemove = false;
25454
+ }
25455
+ } else {
25456
+ template2 = template2.replace(replaceRegex, t.children);
25457
+ }
25458
+ if (t.count === matches.length + 1 && safeToRemove) {
25459
+ template2 = template2.replace(t.contents, "");
25460
+ }
25239
25461
  }
25240
25462
  }
25463
+ return { migrated: template2, err: void 0 };
25464
+ } catch (err) {
25465
+ return { migrated: template2, err };
25241
25466
  }
25242
- return template2;
25243
25467
  }
25244
25468
  function canRemoveCommonModule(template2) {
25245
25469
  const parsed = parseTemplate2(template2);
@@ -25253,20 +25477,24 @@ function canRemoveCommonModule(template2) {
25253
25477
  }
25254
25478
  function removeImports(template2, node, removeCommonModule) {
25255
25479
  if (template2.startsWith("imports") && import_typescript5.default.isPropertyAssignment(node)) {
25256
- return updateClassImports(node, removeCommonModule);
25257
- } else if (import_typescript5.default.isImportDeclaration(node)) {
25480
+ const updatedImport = updateClassImports(node, removeCommonModule);
25481
+ return updatedImport != null ? updatedImport : template2;
25482
+ } else if (import_typescript5.default.isImportDeclaration(node) && checkIfShouldChange(node, removeCommonModule)) {
25258
25483
  return updateImportDeclaration(node, removeCommonModule);
25259
25484
  }
25260
25485
  return template2;
25261
25486
  }
25262
25487
  function getOriginals(etm, tmpl, offset) {
25263
25488
  if (etm.el.children.length > 0) {
25489
+ const childStart = etm.el.children[0].sourceSpan.start.offset - offset;
25490
+ const childEnd = etm.el.children[etm.el.children.length - 1].sourceSpan.end.offset - offset;
25264
25491
  const start2 = tmpl.slice(etm.el.sourceSpan.start.offset - offset, etm.el.children[0].sourceSpan.start.offset - offset);
25265
25492
  const end = tmpl.slice(etm.el.children[etm.el.children.length - 1].sourceSpan.end.offset - offset, etm.el.sourceSpan.end.offset - offset);
25266
- return { start: start2, end };
25493
+ const childLength = childEnd - childStart;
25494
+ return { start: start2, end, childLength };
25267
25495
  }
25268
25496
  const start = tmpl.slice(etm.el.sourceSpan.start.offset - offset, etm.el.sourceSpan.end.offset - offset);
25269
- return { start, end: "" };
25497
+ return { start, end: "", childLength: 0 };
25270
25498
  }
25271
25499
  function isI18nTemplate(etm, i18nAttr) {
25272
25500
  return etm.el.name === "ng-template" && i18nAttr !== void 0 && (etm.el.attrs.length === 2 || etm.el.attrs.length === 3 && etm.elseAttr !== void 0);
@@ -25277,30 +25505,78 @@ function isRemovableContainer(etm) {
25277
25505
  function getMainBlock(etm, tmpl, offset) {
25278
25506
  const i18nAttr = etm.el.attrs.find((x) => x.name === "i18n");
25279
25507
  if (isRemovableContainer(etm)) {
25280
- const childStart2 = etm.el.children[0].sourceSpan.start.offset - offset;
25281
- const childEnd2 = etm.el.children[etm.el.children.length - 1].sourceSpan.end.offset - offset;
25282
- const middle2 = tmpl.slice(childStart2, childEnd2);
25508
+ let middle2 = "";
25509
+ if (etm.hasChildren()) {
25510
+ const { childStart: childStart2, childEnd: childEnd2 } = etm.getChildSpan(offset);
25511
+ middle2 = tmpl.slice(childStart2, childEnd2);
25512
+ }
25283
25513
  return { start: "", middle: middle2, end: "" };
25284
25514
  } else if (isI18nTemplate(etm, i18nAttr)) {
25285
- const childStart2 = etm.el.children[0].sourceSpan.start.offset - offset;
25286
- const childEnd2 = etm.el.children[etm.el.children.length - 1].sourceSpan.end.offset - offset;
25287
- const middle2 = wrapIntoI18nContainer(i18nAttr, tmpl.slice(childStart2, childEnd2));
25288
- return { start: "", middle: middle2, end: "" };
25515
+ const { childStart: childStart2, childEnd: childEnd2 } = etm.getChildSpan(offset);
25516
+ return generatei18nContainer(i18nAttr, tmpl.slice(childStart2, childEnd2));
25289
25517
  }
25290
25518
  const attrStart = etm.attr.keySpan.start.offset - 1 - offset;
25291
- const valEnd = (etm.attr.valueSpan ? etm.attr.valueSpan.end.offset + 1 : etm.attr.keySpan.end.offset) - offset;
25292
- let childStart = valEnd;
25293
- let childEnd = valEnd;
25294
- if (etm.el.children.length > 0) {
25295
- childStart = etm.el.children[0].sourceSpan.start.offset - offset;
25296
- childEnd = etm.el.children[etm.el.children.length - 1].sourceSpan.end.offset - offset;
25519
+ const valEnd = etm.getValueEnd(offset);
25520
+ const { childStart, childEnd } = etm.hasChildren() ? etm.getChildSpan(offset) : { childStart: valEnd, childEnd: valEnd };
25521
+ let start = tmpl.slice(etm.start(offset), attrStart) + tmpl.slice(valEnd, childStart);
25522
+ if (etm.shouldRemoveElseAttr()) {
25523
+ start = start.replace(etm.getElseAttrStr(), "");
25297
25524
  }
25298
- let start = tmpl.slice(etm.start(offset), attrStart);
25299
- start += tmpl.slice(valEnd, childStart);
25300
25525
  const middle = tmpl.slice(childStart, childEnd);
25301
25526
  const end = tmpl.slice(childEnd, etm.end(offset));
25302
25527
  return { start, middle, end };
25303
25528
  }
25529
+ var selfClosingList = "input|br|img|base|wbr|area|col|embed|hr|link|meta|param|source|track";
25530
+ function formatTemplate(tmpl, templateType) {
25531
+ if (tmpl.indexOf("\n") > -1) {
25532
+ let openSelfClosingEl = false;
25533
+ const openBlockRegex = /^\s*\@(if|switch|case|default|for)|^\s*\}\s\@else/;
25534
+ const openElRegex = /^\s*<([a-z0-9]+)(?![^>]*\/>)[^>]*>?/;
25535
+ const selfClosingRegex = new RegExp(`^\\s*<(${selfClosingList}).+\\/?>`);
25536
+ const openSelfClosingRegex = new RegExp(`^\\s*<(${selfClosingList})(?![^>]*\\/>)[^>]*$`);
25537
+ const closeBlockRegex = /^\s*\}\s*$|^\s*\}\s\@else/;
25538
+ const closeElRegex = /\s*<\/([a-zA-Z0-9\-]+)*>/;
25539
+ const closeMultiLineElRegex = /^\s*([a-zA-Z0-9\-\[\]]+)?=?"?([^”<]+)?"?\s?\/>$/;
25540
+ const closeSelfClosingMultiLineRegex = /^\s*([a-zA-Z0-9\-\[\]]+)?=?"?([^”\/<]+)?"?\s?>$/;
25541
+ const singleLineElRegex = /\s*<([a-zA-Z0-9]+)(?![^>]*\/>)[^>]*>.*<\/([a-zA-Z0-9\-]+)*>/;
25542
+ const lines = tmpl.split("\n");
25543
+ const formatted = [];
25544
+ let indent = "";
25545
+ let mindent = "";
25546
+ for (let [index, line] of lines.entries()) {
25547
+ if (line.trim() === "" && index !== 0 && index !== lines.length - 1) {
25548
+ continue;
25549
+ }
25550
+ if (templateType === "template" && index <= 1) {
25551
+ const ind = line.search(/\S/);
25552
+ mindent = ind > -1 ? line.slice(0, ind) : "";
25553
+ }
25554
+ if ((closeBlockRegex.test(line) || closeElRegex.test(line) && (!singleLineElRegex.test(line) && !closeMultiLineElRegex.test(line))) && indent !== "") {
25555
+ indent = indent.slice(2);
25556
+ }
25557
+ formatted.push(mindent + indent + line.trim());
25558
+ if (closeMultiLineElRegex.test(line)) {
25559
+ indent = indent.slice(2);
25560
+ if (openSelfClosingEl) {
25561
+ openSelfClosingEl = false;
25562
+ }
25563
+ }
25564
+ if (closeSelfClosingMultiLineRegex.test(line) && openSelfClosingEl) {
25565
+ openSelfClosingEl = false;
25566
+ indent = indent.slice(2);
25567
+ }
25568
+ if ((openBlockRegex.test(line) || openElRegex.test(line)) && !singleLineElRegex.test(line) && !selfClosingRegex.test(line) && !openSelfClosingRegex.test(line)) {
25569
+ indent += " ";
25570
+ }
25571
+ if (openSelfClosingRegex.test(line)) {
25572
+ openSelfClosingEl = true;
25573
+ indent += " ";
25574
+ }
25575
+ }
25576
+ tmpl = formatted.join("\n");
25577
+ }
25578
+ return tmpl;
25579
+ }
25304
25580
  function forEachClass(sourceFile, callback) {
25305
25581
  sourceFile.forEachChild(function walk(node) {
25306
25582
  if (import_typescript5.default.isClassDeclaration(node) || import_typescript5.default.isImportDeclaration(node)) {
@@ -25310,7 +25586,85 @@ function forEachClass(sourceFile, callback) {
25310
25586
  });
25311
25587
  }
25312
25588
 
25313
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/fors.mjs
25589
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/cases.mjs
25590
+ var boundcase = "[ngSwitchCase]";
25591
+ var switchcase = "*ngSwitchCase";
25592
+ var nakedcase = "ngSwitchCase";
25593
+ var switchdefault = "*ngSwitchDefault";
25594
+ var nakeddefault = "ngSwitchDefault";
25595
+ var cases = [
25596
+ boundcase,
25597
+ switchcase,
25598
+ nakedcase,
25599
+ switchdefault,
25600
+ nakeddefault
25601
+ ];
25602
+ function migrateCase(template2) {
25603
+ let errors = [];
25604
+ let parsed = parseTemplate2(template2);
25605
+ if (parsed === null) {
25606
+ return { migrated: template2, errors, changed: false };
25607
+ }
25608
+ let result = template2;
25609
+ const visitor = new ElementCollector(cases);
25610
+ visitAll2(visitor, parsed.rootNodes);
25611
+ calculateNesting(visitor, hasLineBreaks(template2));
25612
+ let offset = 0;
25613
+ let nestLevel = -1;
25614
+ let postOffsets = [];
25615
+ for (const el of visitor.elements) {
25616
+ let migrateResult = { tmpl: result, offsets: { pre: 0, post: 0 } };
25617
+ offset = reduceNestingOffset(el, nestLevel, offset, postOffsets);
25618
+ if (el.attr.name === switchcase || el.attr.name === nakedcase || el.attr.name === boundcase) {
25619
+ try {
25620
+ migrateResult = migrateNgSwitchCase(el, result, offset);
25621
+ } catch (error2) {
25622
+ errors.push({ type: switchcase, error: error2 });
25623
+ }
25624
+ } else if (el.attr.name === switchdefault || el.attr.name === nakeddefault) {
25625
+ try {
25626
+ migrateResult = migrateNgSwitchDefault(el, result, offset);
25627
+ } catch (error2) {
25628
+ errors.push({ type: switchdefault, error: error2 });
25629
+ }
25630
+ }
25631
+ result = migrateResult.tmpl;
25632
+ offset += migrateResult.offsets.pre;
25633
+ postOffsets.push(migrateResult.offsets.post);
25634
+ nestLevel = el.nestCount;
25635
+ }
25636
+ const changed = visitor.elements.length > 0;
25637
+ return { migrated: result, errors, changed };
25638
+ }
25639
+ function migrateNgSwitchCase(etm, tmpl, offset) {
25640
+ const lbString = etm.hasLineBreaks ? "\n" : "";
25641
+ const leadingSpace = etm.hasLineBreaks ? "" : " ";
25642
+ const condition = etm.attr.value;
25643
+ const originals = getOriginals(etm, tmpl, offset);
25644
+ const { start, middle, end } = getMainBlock(etm, tmpl, offset);
25645
+ const startBlock = `${leadingSpace}@case (${condition}) {${leadingSpace}${lbString}${start}`;
25646
+ const endBlock = `${end}${lbString}${leadingSpace}}`;
25647
+ const defaultBlock = startBlock + middle + endBlock;
25648
+ const updatedTmpl = tmpl.slice(0, etm.start(offset)) + defaultBlock + tmpl.slice(etm.end(offset));
25649
+ const pre = originals.start.length - startBlock.length;
25650
+ const post = originals.end.length - endBlock.length;
25651
+ return { tmpl: updatedTmpl, offsets: { pre, post } };
25652
+ }
25653
+ function migrateNgSwitchDefault(etm, tmpl, offset) {
25654
+ const lbString = etm.hasLineBreaks ? "\n" : "";
25655
+ const leadingSpace = etm.hasLineBreaks ? "" : " ";
25656
+ const originals = getOriginals(etm, tmpl, offset);
25657
+ const { start, middle, end } = getMainBlock(etm, tmpl, offset);
25658
+ const startBlock = `${leadingSpace}@default {${leadingSpace}${lbString}${start}`;
25659
+ const endBlock = `${end}${lbString}${leadingSpace}}`;
25660
+ const defaultBlock = startBlock + middle + endBlock;
25661
+ const updatedTmpl = tmpl.slice(0, etm.start(offset)) + defaultBlock + tmpl.slice(etm.end(offset));
25662
+ const pre = originals.start.length - startBlock.length;
25663
+ const post = originals.end.length - endBlock.length;
25664
+ return { tmpl: updatedTmpl, offsets: { pre, post } };
25665
+ }
25666
+
25667
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/fors.mjs
25314
25668
  var ngfor = "*ngFor";
25315
25669
  var nakedngfor2 = "ngFor";
25316
25670
  var fors = [
@@ -25330,7 +25684,7 @@ function migrateFor(template2) {
25330
25684
  let errors = [];
25331
25685
  let parsed = parseTemplate2(template2);
25332
25686
  if (parsed === null) {
25333
- return { migrated: template2, errors };
25687
+ return { migrated: template2, errors, changed: false };
25334
25688
  }
25335
25689
  let result = template2;
25336
25690
  const visitor = new ElementCollector(fors);
@@ -25352,7 +25706,8 @@ function migrateFor(template2) {
25352
25706
  postOffsets.push(migrateResult.offsets.post);
25353
25707
  nestLevel = el.nestCount;
25354
25708
  }
25355
- return { migrated: result, errors };
25709
+ const changed = visitor.elements.length > 0;
25710
+ return { migrated: result, errors, changed };
25356
25711
  }
25357
25712
  function migrateNgFor(etm, tmpl, offset) {
25358
25713
  if (etm.forAttrs !== void 0) {
@@ -25365,20 +25720,26 @@ function migrateStandardNgFor(etm, tmpl, offset) {
25365
25720
  const aliasWithAsRegexp = /(count|index|first|last|even|odd)\s+as/gm;
25366
25721
  const aliases = [];
25367
25722
  const lbString = etm.hasLineBreaks ? "\n" : "";
25368
- const lbSpaces = etm.hasLineBreaks ? `
25369
- ` : "";
25370
25723
  const parts = getNgForParts(etm.attr.value);
25371
25724
  const originals = getOriginals(etm, tmpl, offset);
25372
25725
  const condition = parts[0].replace("let ", "");
25726
+ if (condition.indexOf(" as ") > -1) {
25727
+ 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.`;
25728
+ throw new Error(errorMessage);
25729
+ }
25373
25730
  const loopVar = condition.split(" of ")[0];
25374
25731
  let trackBy = loopVar;
25375
25732
  let aliasedIndex = null;
25733
+ let tmplPlaceholder = "";
25376
25734
  for (let i = 1; i < parts.length; i++) {
25377
25735
  const part = parts[i].trim();
25378
25736
  if (part.startsWith("trackBy:")) {
25379
25737
  const trackByFn = part.replace("trackBy:", "").trim();
25380
25738
  trackBy = `${trackByFn}($index, ${loopVar})`;
25381
25739
  }
25740
+ if (part.startsWith("template:")) {
25741
+ tmplPlaceholder = `#${part.split(":")[1].trim()}#`;
25742
+ }
25382
25743
  if (part.match(aliasWithEqualRegexp)) {
25383
25744
  const aliasParts = part.split("=");
25384
25745
  aliases.push(` ${aliasParts[0].trim()} = $${aliasParts[1].trim()}`);
@@ -25398,10 +25759,18 @@ function migrateStandardNgFor(etm, tmpl, offset) {
25398
25759
  trackBy = trackBy.replace("$index", aliasedIndex);
25399
25760
  }
25400
25761
  const aliasStr = aliases.length > 0 ? `;${aliases.join(";")}` : "";
25401
- const { start, middle, end } = getMainBlock(etm, tmpl, offset);
25402
- const startBlock = `@for (${condition}; track ${trackBy}${aliasStr}) {${lbSpaces}${start}`;
25403
- const endBlock = `${end}${lbString}}`;
25404
- const forBlock = startBlock + middle + endBlock;
25762
+ let startBlock = `@for (${condition}; track ${trackBy}${aliasStr}) {${lbString}`;
25763
+ let endBlock = `${lbString}}`;
25764
+ let forBlock = "";
25765
+ if (tmplPlaceholder !== "") {
25766
+ startBlock = startBlock + tmplPlaceholder;
25767
+ forBlock = startBlock + endBlock;
25768
+ } else {
25769
+ const { start, middle, end } = getMainBlock(etm, tmpl, offset);
25770
+ startBlock += start;
25771
+ endBlock = end + endBlock;
25772
+ forBlock = startBlock + middle + endBlock;
25773
+ }
25405
25774
  const updatedTmpl = tmpl.slice(0, etm.start(offset)) + forBlock + tmpl.slice(etm.end(offset));
25406
25775
  const pre = originals.start.length - startBlock.length;
25407
25776
  const post = originals.end.length - endBlock.length;
@@ -25427,7 +25796,7 @@ function migrateBoundNgFor(etm, tmpl, offset) {
25427
25796
  }
25428
25797
  const { start, middle, end } = getMainBlock(etm, tmpl, offset);
25429
25798
  const startBlock = `@for (${condition}; track ${trackBy}${aliasStr}) {
25430
- ${start}`;
25799
+ ${start}`;
25431
25800
  const endBlock = `${end}
25432
25801
  }`;
25433
25802
  const forBlock = startBlock + middle + endBlock;
@@ -25468,7 +25837,7 @@ function getNgForParts(expression) {
25468
25837
  return parts;
25469
25838
  }
25470
25839
 
25471
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/ifs.mjs
25840
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/ifs.mjs
25472
25841
  var ngif = "*ngIf";
25473
25842
  var boundngif = "[ngIf]";
25474
25843
  var nakedngif = "ngIf";
@@ -25481,7 +25850,7 @@ function migrateIf(template2) {
25481
25850
  let errors = [];
25482
25851
  let parsed = parseTemplate2(template2);
25483
25852
  if (parsed === null) {
25484
- return { migrated: template2, errors };
25853
+ return { migrated: template2, errors, changed: false };
25485
25854
  }
25486
25855
  let result = template2;
25487
25856
  const visitor = new ElementCollector(ifs);
@@ -25503,11 +25872,12 @@ function migrateIf(template2) {
25503
25872
  postOffsets.push(migrateResult.offsets.post);
25504
25873
  nestLevel = el.nestCount;
25505
25874
  }
25506
- return { migrated: result, errors };
25875
+ const changed = visitor.elements.length > 0;
25876
+ return { migrated: result, errors, changed };
25507
25877
  }
25508
25878
  function migrateNgIf(etm, tmpl, offset) {
25509
- const matchThen = etm.attr.value.match(/;\s*then/gm);
25510
- const matchElse = etm.attr.value.match(/;\s*else/gm);
25879
+ const matchThen = etm.attr.value.match(/;?\s*then/gm);
25880
+ const matchElse = etm.attr.value.match(/;?\s*else/gm);
25511
25881
  if (etm.thenAttr !== void 0 || etm.elseAttr !== void 0) {
25512
25882
  return buildBoundIfElseBlock(etm, tmpl, offset);
25513
25883
  } else if (matchThen && matchThen.length > 0) {
@@ -25519,7 +25889,7 @@ function migrateNgIf(etm, tmpl, offset) {
25519
25889
  }
25520
25890
  function buildIfBlock(etm, tmpl, offset) {
25521
25891
  const lbString = etm.hasLineBreaks ? "\n" : "";
25522
- const condition = etm.attr.value.replace(" as ", "; as ");
25892
+ const condition = etm.attr.value.replace(" as ", "; as ").replace(/;\s*let/g, "; as");
25523
25893
  const originals = getOriginals(etm, tmpl, offset);
25524
25894
  const { start, middle, end } = getMainBlock(etm, tmpl, offset);
25525
25895
  const startBlock = `@if (${condition}) {${lbString}${start}`;
@@ -25531,7 +25901,7 @@ function buildIfBlock(etm, tmpl, offset) {
25531
25901
  return { tmpl: updatedTmpl, offsets: { pre, post } };
25532
25902
  }
25533
25903
  function buildStandardIfElseBlock(etm, tmpl, elseString, offset) {
25534
- const condition = etm.getCondition(elseString).replace(" as ", "; as ");
25904
+ const condition = etm.getCondition().replace(" as ", "; as ").replace(/;\s*let/g, "; as");
25535
25905
  const elsePlaceholder = `#${etm.getTemplateName(elseString)}|`;
25536
25906
  return buildIfElseBlock(etm, tmpl, condition, elsePlaceholder, offset);
25537
25907
  }
@@ -25560,7 +25930,7 @@ function buildIfElseBlock(etm, tmpl, condition, elsePlaceholder, offset) {
25560
25930
  return { tmpl: updatedTmpl, offsets: { pre, post } };
25561
25931
  }
25562
25932
  function buildStandardIfThenElseBlock(etm, tmpl, thenString, elseString, offset) {
25563
- const condition = etm.getCondition(thenString).replace(" as ", "; as ");
25933
+ const condition = etm.getCondition().replace(" as ", "; as ").replace(/;\s*let/g, "; as");
25564
25934
  const thenPlaceholder = `#${etm.getTemplateName(thenString, elseString)}|`;
25565
25935
  const elsePlaceholder = `#${etm.getTemplateName(elseString)}|`;
25566
25936
  return buildIfThenElseBlock(etm, tmpl, condition, thenPlaceholder, elsePlaceholder, offset);
@@ -25575,31 +25945,21 @@ function buildIfThenElseBlock(etm, tmpl, condition, thenPlaceholder, elsePlaceho
25575
25945
  const tmplStart = tmpl.slice(0, etm.start(offset));
25576
25946
  const tmplEnd = tmpl.slice(etm.end(offset));
25577
25947
  const updatedTmpl = tmplStart + ifThenElseBlock + tmplEnd;
25578
- const pre = originals.start.length - startBlock.length;
25948
+ const pre = originals.start.length + originals.childLength - startBlock.length;
25579
25949
  const post = originals.end.length - postBlock.length;
25580
25950
  return { tmpl: updatedTmpl, offsets: { pre, post } };
25581
25951
  }
25582
25952
 
25583
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/switches.mjs
25953
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/switches.mjs
25584
25954
  var ngswitch = "[ngSwitch]";
25585
- var boundcase = "[ngSwitchCase]";
25586
- var switchcase = "*ngSwitchCase";
25587
- var nakedcase = "ngSwitchCase";
25588
- var switchdefault = "*ngSwitchDefault";
25589
- var nakeddefault = "ngSwitchDefault";
25590
25955
  var switches = [
25591
- ngswitch,
25592
- boundcase,
25593
- switchcase,
25594
- nakedcase,
25595
- switchdefault,
25596
- nakeddefault
25956
+ ngswitch
25597
25957
  ];
25598
25958
  function migrateSwitch(template2) {
25599
25959
  let errors = [];
25600
25960
  let parsed = parseTemplate2(template2);
25601
25961
  if (parsed === null) {
25602
- return { migrated: template2, errors };
25962
+ return { migrated: template2, errors, changed: false };
25603
25963
  }
25604
25964
  let result = template2;
25605
25965
  const visitor = new ElementCollector(switches);
@@ -25617,25 +25977,14 @@ function migrateSwitch(template2) {
25617
25977
  } catch (error2) {
25618
25978
  errors.push({ type: ngswitch, error: error2 });
25619
25979
  }
25620
- } else if (el.attr.name === switchcase || el.attr.name === nakedcase || el.attr.name === boundcase) {
25621
- try {
25622
- migrateResult = migrateNgSwitchCase(el, result, offset);
25623
- } catch (error2) {
25624
- errors.push({ type: ngswitch, error: error2 });
25625
- }
25626
- } else if (el.attr.name === switchdefault || el.attr.name === nakeddefault) {
25627
- try {
25628
- migrateResult = migrateNgSwitchDefault(el, result, offset);
25629
- } catch (error2) {
25630
- errors.push({ type: ngswitch, error: error2 });
25631
- }
25632
25980
  }
25633
25981
  result = migrateResult.tmpl;
25634
25982
  offset += migrateResult.offsets.pre;
25635
25983
  postOffsets.push(migrateResult.offsets.post);
25636
25984
  nestLevel = el.nestCount;
25637
25985
  }
25638
- return { migrated: result, errors };
25986
+ const changed = visitor.elements.length > 0;
25987
+ return { migrated: result, errors, changed };
25639
25988
  }
25640
25989
  function migrateNgSwitch(etm, tmpl, offset) {
25641
25990
  const lbString = etm.hasLineBreaks ? "\n" : "";
@@ -25650,50 +25999,35 @@ function migrateNgSwitch(etm, tmpl, offset) {
25650
25999
  const post = originals.end.length - endBlock.length;
25651
26000
  return { tmpl: updatedTmpl, offsets: { pre, post } };
25652
26001
  }
25653
- function migrateNgSwitchCase(etm, tmpl, offset) {
25654
- const lbString = etm.hasLineBreaks ? "\n" : "";
25655
- const lbSpaces = etm.hasLineBreaks ? " " : "";
25656
- const leadingSpace = etm.hasLineBreaks ? "" : " ";
25657
- const condition = etm.attr.value;
25658
- const originals = getOriginals(etm, tmpl, offset);
25659
- const { start, middle, end } = getMainBlock(etm, tmpl, offset);
25660
- const startBlock = `${leadingSpace}@case (${condition}) {${leadingSpace}${lbString}${lbSpaces}${start}`;
25661
- const endBlock = `${end}${lbString}${leadingSpace}}`;
25662
- const defaultBlock = startBlock + middle + endBlock;
25663
- const updatedTmpl = tmpl.slice(0, etm.start(offset)) + defaultBlock + tmpl.slice(etm.end(offset));
25664
- const pre = originals.start.length - startBlock.length;
25665
- const post = originals.end.length - endBlock.length;
25666
- return { tmpl: updatedTmpl, offsets: { pre, post } };
25667
- }
25668
- function migrateNgSwitchDefault(etm, tmpl, offset) {
25669
- const lbString = etm.hasLineBreaks ? "\n" : "";
25670
- const lbSpaces = etm.hasLineBreaks ? " " : "";
25671
- const leadingSpace = etm.hasLineBreaks ? "" : " ";
25672
- const originals = getOriginals(etm, tmpl, offset);
25673
- const { start, middle, end } = getMainBlock(etm, tmpl, offset);
25674
- const startBlock = `${leadingSpace}@default {${leadingSpace}${lbString}${lbSpaces}${start}`;
25675
- const endBlock = `${end}${lbString}${leadingSpace}}`;
25676
- const defaultBlock = startBlock + middle + endBlock;
25677
- const updatedTmpl = tmpl.slice(0, etm.start(offset)) + defaultBlock + tmpl.slice(etm.end(offset));
25678
- const pre = originals.start.length - startBlock.length;
25679
- const post = originals.end.length - endBlock.length;
25680
- return { tmpl: updatedTmpl, offsets: { pre, post } };
25681
- }
25682
26002
 
25683
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/migration.mjs
25684
- function migrateTemplate(template2, templateType, node, file) {
26003
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/migration.mjs
26004
+ function migrateTemplate(template2, templateType, node, file, format = true, analyzedFiles) {
25685
26005
  let errors = [];
25686
26006
  let migrated = template2;
25687
- if (templateType === "template") {
26007
+ if (templateType === "template" || templateType === "templateUrl") {
25688
26008
  const ifResult = migrateIf(template2);
25689
26009
  const forResult = migrateFor(ifResult.migrated);
25690
26010
  const switchResult = migrateSwitch(forResult.migrated);
25691
- migrated = processNgTemplates(switchResult.migrated);
26011
+ const caseResult = migrateCase(switchResult.migrated);
26012
+ const templateResult = processNgTemplates(caseResult.migrated);
26013
+ if (templateResult.err !== void 0) {
26014
+ return { migrated: template2, errors: [{ type: "template", error: templateResult.err }] };
26015
+ }
26016
+ migrated = templateResult.migrated;
26017
+ const changed = ifResult.changed || forResult.changed || switchResult.changed || caseResult.changed;
26018
+ if (format && changed) {
26019
+ migrated = formatTemplate(migrated, templateType);
26020
+ }
25692
26021
  file.removeCommonModule = canRemoveCommonModule(template2);
26022
+ if (templateType === "templateUrl" && analyzedFiles !== null && analyzedFiles.has(file.sourceFilePath)) {
26023
+ const componentFile = analyzedFiles.get(file.sourceFilePath);
26024
+ componentFile.removeCommonModule = file.removeCommonModule;
26025
+ }
25693
26026
  errors = [
25694
26027
  ...ifResult.errors,
25695
26028
  ...forResult.errors,
25696
- ...switchResult.errors
26029
+ ...switchResult.errors,
26030
+ ...caseResult.errors
25697
26031
  ];
25698
26032
  } else {
25699
26033
  migrated = removeImports(template2, node, file.removeCommonModule);
@@ -25701,7 +26035,7 @@ function migrateTemplate(template2, templateType, node, file) {
25701
26035
  return { migrated, errors };
25702
26036
  }
25703
26037
 
25704
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/index.mjs
26038
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/index.mjs
25705
26039
  function control_flow_migration_default(options) {
25706
26040
  return (tree, context) => __async(this, null, function* () {
25707
26041
  const basePath = process.cwd();
@@ -25742,7 +26076,9 @@ function runControlFlowMigration(tree, tsconfigPath, basePath, pathToMigrate, sc
25742
26076
  for (const sourceFile of sourceFiles) {
25743
26077
  analyze(sourceFile, analysis);
25744
26078
  }
25745
- for (const [path2, file] of analysis) {
26079
+ const paths = sortFilePaths([...analysis.keys()]);
26080
+ for (const path2 of paths) {
26081
+ const file = analysis.get(path2);
25746
26082
  const ranges = file.getSortedRanges();
25747
26083
  const relativePath = (0, import_path3.relative)(basePath, path2);
25748
26084
  const content = tree.readText(relativePath);
@@ -25750,7 +26086,7 @@ function runControlFlowMigration(tree, tsconfigPath, basePath, pathToMigrate, sc
25750
26086
  for (const { start, end, node, type } of ranges) {
25751
26087
  const template2 = content.slice(start, end);
25752
26088
  const length = (end != null ? end : content.length) - start;
25753
- const { migrated, errors } = migrateTemplate(template2, type, node, file);
26089
+ const { migrated, errors } = migrateTemplate(template2, type, node, file, schematicOptions.format, analysis);
25754
26090
  if (migrated !== null) {
25755
26091
  update.remove(start, length);
25756
26092
  update.insertLeft(start, migrated);
@@ -25767,6 +26103,10 @@ function runControlFlowMigration(tree, tsconfigPath, basePath, pathToMigrate, sc
25767
26103
  }
25768
26104
  return errorList;
25769
26105
  }
26106
+ function sortFilePaths(names) {
26107
+ names.sort((a, _) => a.endsWith(".html") ? -1 : 0);
26108
+ return names;
26109
+ }
25770
26110
  function generateErrorMessage(path2, errors) {
25771
26111
  let errorMessage = `Template "${path2}" encountered ${errors.length} errors during migration:
25772
26112
  `;