@angular/core 17.0.0-rc.1 → 17.0.0-rc.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 (48) hide show
  1. package/esm2022/primitives/signals/index.mjs +2 -2
  2. package/esm2022/primitives/signals/src/graph.mjs +22 -1
  3. package/esm2022/primitives/signals/src/signal.mjs +7 -3
  4. package/esm2022/rxjs-interop/src/to_signal.mjs +9 -2
  5. package/esm2022/src/change_detection/change_detector_ref.mjs +1 -1
  6. package/esm2022/src/defer/instructions.mjs +35 -22
  7. package/esm2022/src/errors.mjs +1 -1
  8. package/esm2022/src/image_performance_warning.mjs +9 -3
  9. package/esm2022/src/metadata/do_bootstrap.mjs +9 -0
  10. package/esm2022/src/metadata.mjs +1 -1
  11. package/esm2022/src/render3/assert.mjs +2 -2
  12. package/esm2022/src/render3/features/standalone_feature.mjs +5 -1
  13. package/esm2022/src/render3/instructions/change_detection.mjs +68 -8
  14. package/esm2022/src/render3/instructions/change_detection_flags.mjs +12 -0
  15. package/esm2022/src/render3/instructions/control_flow.mjs +65 -45
  16. package/esm2022/src/render3/instructions/shared.mjs +22 -42
  17. package/esm2022/src/render3/interfaces/view.mjs +2 -2
  18. package/esm2022/src/render3/node_manipulation.mjs +2 -3
  19. package/esm2022/src/render3/reactive_lview_consumer.mjs +20 -33
  20. package/esm2022/src/render3/reactivity/effect.mjs +22 -6
  21. package/esm2022/src/render3/reactivity/signal.mjs +1 -1
  22. package/esm2022/src/render3/util/injector_discovery_utils.mjs +32 -25
  23. package/esm2022/src/version.mjs +1 -1
  24. package/esm2022/testing/src/component_fixture.mjs +4 -1
  25. package/esm2022/testing/src/logger.mjs +3 -3
  26. package/fesm2022/core.mjs +18287 -18174
  27. package/fesm2022/core.mjs.map +1 -1
  28. package/fesm2022/primitives/signals.mjs +28 -3
  29. package/fesm2022/primitives/signals.mjs.map +1 -1
  30. package/fesm2022/rxjs-interop.mjs +9 -2
  31. package/fesm2022/rxjs-interop.mjs.map +1 -1
  32. package/fesm2022/testing.mjs +4 -1
  33. package/fesm2022/testing.mjs.map +1 -1
  34. package/index.d.ts +17 -10
  35. package/package.json +2 -2
  36. package/primitives/signals/index.d.ts +14 -1
  37. package/rxjs-interop/index.d.ts +10 -1
  38. package/schematics/migrations/block-template-entities/bundle.js +1348 -1013
  39. package/schematics/migrations/block-template-entities/bundle.js.map +4 -4
  40. package/schematics/migrations/compiler-options/bundle.js +13 -13
  41. package/schematics/migrations/transfer-state/bundle.js +13 -13
  42. package/schematics/ng-generate/control-flow-migration/bundle.js +1439 -1077
  43. package/schematics/ng-generate/control-flow-migration/bundle.js.map +4 -4
  44. package/schematics/ng-generate/control-flow-migration/schema.json +9 -2
  45. package/schematics/ng-generate/standalone-migration/bundle.js +2851 -2403
  46. package/schematics/ng-generate/standalone-migration/bundle.js.map +4 -4
  47. package/testing/index.d.ts +1 -1
  48. package/esm2022/src/metadata/do_boostrap.mjs +0 -9
@@ -63,7 +63,7 @@ var __async = (__this, __arguments, generator) => {
63
63
  });
64
64
  };
65
65
 
66
- // bazel-out/darwin-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,7 +72,18 @@ 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/darwin-fastbuild/bin/packages/core/schematics/utils/project_tsconfig_paths.mjs
75
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/change_tracker.mjs
76
+ var import_typescript2 = __toESM(require("typescript"), 1);
77
+
78
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/import_manager.mjs
79
+ var import_typescript = __toESM(require("typescript"), 1);
80
+
81
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/change_tracker.mjs
82
+ function normalizePath(path2) {
83
+ return path2.replace(/\\/g, "/");
84
+ }
85
+
86
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/project_tsconfig_paths.mjs
76
87
  var import_core = require("@angular-devkit/core");
77
88
  function getProjectTsConfigPaths(tree) {
78
89
  return __async(this, null, function* () {
@@ -152,31 +163,31 @@ function getWorkspace(tree) {
152
163
  });
153
164
  }
154
165
 
155
- // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
166
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
156
167
  var import_path = require("path");
157
- var import_typescript2 = __toESM(require("typescript"), 1);
168
+ var import_typescript4 = __toESM(require("typescript"), 1);
158
169
 
159
- // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/typescript/parse_tsconfig.mjs
170
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/parse_tsconfig.mjs
160
171
  var path = __toESM(require("path"), 1);
161
- var import_typescript = __toESM(require("typescript"), 1);
172
+ var import_typescript3 = __toESM(require("typescript"), 1);
162
173
  function parseTsconfigFile(tsconfigPath, basePath) {
163
- const { config } = import_typescript.default.readConfigFile(tsconfigPath, import_typescript.default.sys.readFile);
174
+ const { config } = import_typescript3.default.readConfigFile(tsconfigPath, import_typescript3.default.sys.readFile);
164
175
  const parseConfigHost = {
165
- useCaseSensitiveFileNames: import_typescript.default.sys.useCaseSensitiveFileNames,
166
- fileExists: import_typescript.default.sys.fileExists,
167
- readDirectory: import_typescript.default.sys.readDirectory,
168
- readFile: import_typescript.default.sys.readFile
176
+ useCaseSensitiveFileNames: import_typescript3.default.sys.useCaseSensitiveFileNames,
177
+ fileExists: import_typescript3.default.sys.fileExists,
178
+ readDirectory: import_typescript3.default.sys.readDirectory,
179
+ readFile: import_typescript3.default.sys.readFile
169
180
  };
170
181
  if (!path.isAbsolute(basePath)) {
171
182
  throw Error("Unexpected relative base path has been specified.");
172
183
  }
173
- return import_typescript.default.parseJsonConfigFileContent(config, parseConfigHost, basePath, {});
184
+ return import_typescript3.default.parseJsonConfigFileContent(config, parseConfigHost, basePath, {});
174
185
  }
175
186
 
176
- // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
187
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
177
188
  function createMigrationProgram(tree, tsconfigPath, basePath, fakeFileRead, additionalFiles) {
178
189
  const { rootNames, options, host } = createProgramOptions(tree, tsconfigPath, basePath, fakeFileRead, additionalFiles);
179
- return import_typescript2.default.createProgram(rootNames, options, host);
190
+ return import_typescript4.default.createProgram(rootNames, options, host);
180
191
  }
181
192
  function createProgramOptions(tree, tsconfigPath, basePath, fakeFileRead, additionalFiles, optionOverrides) {
182
193
  tsconfigPath = (0, import_path.resolve)(basePath, tsconfigPath);
@@ -186,7 +197,7 @@ function createProgramOptions(tree, tsconfigPath, basePath, fakeFileRead, additi
186
197
  return { rootNames: parsed.fileNames.concat(additionalFiles || []), options, host };
187
198
  }
188
199
  function createMigrationCompilerHost(tree, options, basePath, fakeRead) {
189
- const host = import_typescript2.default.createCompilerHost(options, true);
200
+ const host = import_typescript4.default.createCompilerHost(options, true);
190
201
  const defaultReadFile = host.readFile;
191
202
  host.readFile = (fileName) => {
192
203
  var _a2;
@@ -206,7 +217,7 @@ function canMigrateFile(basePath, sourceFile, program) {
206
217
  return !(0, import_path.relative)(basePath, sourceFile.fileName).startsWith("..");
207
218
  }
208
219
 
209
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/selector.mjs
220
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/selector.mjs
210
221
  var _SELECTOR_REGEXP = new RegExp(
211
222
  `(\\:not\\()|(([\\.\\#]?)[-\\w]+)|(?:\\[([-.\\w*\\\\$]+)(?:=(["']?)([^\\]"']*)\\5)?\\])|(\\))|(\\s*,\\s*)`,
212
223
  "g"
@@ -514,7 +525,7 @@ var SelectorContext = class {
514
525
  }
515
526
  };
516
527
 
517
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/core.mjs
528
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/core.mjs
518
529
  var ViewEncapsulation;
519
530
  (function(ViewEncapsulation2) {
520
531
  ViewEncapsulation2[ViewEncapsulation2["Emulated"] = 0] = "Emulated";
@@ -576,7 +587,7 @@ function parseSelectorToR3Selector(selector) {
576
587
  return selector ? CssSelector.parse(selector).map(parserSelectorToR3Selector) : [];
577
588
  }
578
589
 
579
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/digest.mjs
590
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/digest.mjs
580
591
  var textEncoder;
581
592
  function computeDigest(message) {
582
593
  return sha1(serializeNodes(message.nodes).join("") + `[${message.meaning}]`);
@@ -813,7 +824,7 @@ function wordAt(bytes, index, endian) {
813
824
  return word;
814
825
  }
815
826
 
816
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/output_ast.mjs
827
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/output/output_ast.mjs
817
828
  var TypeModifier;
818
829
  (function(TypeModifier2) {
819
830
  TypeModifier2[TypeModifier2["None"] = 0] = "None";
@@ -1768,7 +1779,7 @@ function serializeTags(tags) {
1768
1779
  return out;
1769
1780
  }
1770
1781
 
1771
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/constant_pool.mjs
1782
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/constant_pool.mjs
1772
1783
  var CONSTANT_PREFIX = "_c";
1773
1784
  var UNKNOWN_VALUE_KEY = variable("<unknown>");
1774
1785
  var KEY_CONTEXT = {};
@@ -1951,7 +1962,7 @@ function isLongStringLiteral(expr) {
1951
1962
  return expr instanceof LiteralExpr && typeof expr.value === "string" && expr.value.length >= POOL_INCLUSION_LENGTH_THRESHOLD_FOR_STRINGS;
1952
1963
  }
1953
1964
 
1954
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_identifiers.mjs
1965
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_identifiers.mjs
1955
1966
  var CORE = "@angular/core";
1956
1967
  var _Identifiers = class {
1957
1968
  };
@@ -2584,7 +2595,7 @@ var Identifiers = _Identifiers;
2584
2595
  _Identifiers.validateIframeAttribute = { name: "\u0275\u0275validateIframeAttribute", moduleName: CORE };
2585
2596
  })();
2586
2597
 
2587
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/util.mjs
2598
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/util.mjs
2588
2599
  var DASH_CASE_REGEXP = /-+([a-z0-9])/g;
2589
2600
  function dashCaseToCamelCase(input) {
2590
2601
  return input.replace(DASH_CASE_REGEXP, (...m) => m[1].toUpperCase());
@@ -2672,7 +2683,7 @@ function partitionArray(arr, conditionFn) {
2672
2683
  return [truthy, falsy];
2673
2684
  }
2674
2685
 
2675
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/source_map.mjs
2686
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/output/source_map.mjs
2676
2687
  var VERSION = 3;
2677
2688
  var JS_B64_PREFIX = "# sourceMappingURL=data:application/json;base64,";
2678
2689
  var SourceMapGenerator = class {
@@ -2801,7 +2812,7 @@ function toBase64Digit(value) {
2801
2812
  return B64_DIGITS[value];
2802
2813
  }
2803
2814
 
2804
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/abstract_emitter.mjs
2815
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/output/abstract_emitter.mjs
2805
2816
  var _SINGLE_QUOTE_ESCAPE_STRING_RE = /'|\\|\n|\r|\$/g;
2806
2817
  var _LEGAL_IDENTIFIER_RE = /^[$A-Z_][0-9A-Z_$]*$/i;
2807
2818
  var _INDENT_WITH = " ";
@@ -3286,7 +3297,7 @@ function _createIndent(count) {
3286
3297
  return res;
3287
3298
  }
3288
3299
 
3289
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/util.mjs
3300
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/util.mjs
3290
3301
  function typeWithParameters(type, numParams) {
3291
3302
  if (numParams === 0) {
3292
3303
  return expressionType(type);
@@ -3351,7 +3362,7 @@ function generateForwardRef(expr) {
3351
3362
  return importExpr(Identifiers.forwardRef).callFn([arrowFn([], expr)]);
3352
3363
  }
3353
3364
 
3354
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_factory.mjs
3365
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_factory.mjs
3355
3366
  var R3FactoryDelegateType;
3356
3367
  (function(R3FactoryDelegateType2) {
3357
3368
  R3FactoryDelegateType2[R3FactoryDelegateType2["Class"] = 0] = "Class";
@@ -3496,7 +3507,7 @@ function getInjectFn(target) {
3496
3507
  }
3497
3508
  }
3498
3509
 
3499
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_ast.mjs
3510
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_ast.mjs
3500
3511
  var Comment = class {
3501
3512
  constructor(value, sourceSpan) {
3502
3513
  this.value = value;
@@ -3601,16 +3612,19 @@ var Element = class {
3601
3612
  }
3602
3613
  };
3603
3614
  var DeferredTrigger = class {
3604
- constructor(sourceSpan) {
3615
+ constructor(nameSpan, sourceSpan, prefetchSpan, whenOrOnSourceSpan) {
3616
+ this.nameSpan = nameSpan;
3605
3617
  this.sourceSpan = sourceSpan;
3618
+ this.prefetchSpan = prefetchSpan;
3619
+ this.whenOrOnSourceSpan = whenOrOnSourceSpan;
3606
3620
  }
3607
3621
  visit(visitor) {
3608
3622
  return visitor.visitDeferredTrigger(this);
3609
3623
  }
3610
3624
  };
3611
3625
  var BoundDeferredTrigger = class extends DeferredTrigger {
3612
- constructor(value, sourceSpan) {
3613
- super(sourceSpan);
3626
+ constructor(value, sourceSpan, prefetchSpan, whenSourceSpan) {
3627
+ super(null, sourceSpan, prefetchSpan, whenSourceSpan);
3614
3628
  this.value = value;
3615
3629
  }
3616
3630
  };
@@ -3619,75 +3633,75 @@ var IdleDeferredTrigger = class extends DeferredTrigger {
3619
3633
  var ImmediateDeferredTrigger = class extends DeferredTrigger {
3620
3634
  };
3621
3635
  var HoverDeferredTrigger = class extends DeferredTrigger {
3622
- constructor(reference2, sourceSpan) {
3623
- super(sourceSpan);
3636
+ constructor(reference2, nameSpan, sourceSpan, prefetchSpan, onSourceSpan) {
3637
+ super(nameSpan, sourceSpan, prefetchSpan, onSourceSpan);
3624
3638
  this.reference = reference2;
3625
3639
  }
3626
3640
  };
3627
3641
  var TimerDeferredTrigger = class extends DeferredTrigger {
3628
- constructor(delay, sourceSpan) {
3629
- super(sourceSpan);
3642
+ constructor(delay, nameSpan, sourceSpan, prefetchSpan, onSourceSpan) {
3643
+ super(nameSpan, sourceSpan, prefetchSpan, onSourceSpan);
3630
3644
  this.delay = delay;
3631
3645
  }
3632
3646
  };
3633
3647
  var InteractionDeferredTrigger = class extends DeferredTrigger {
3634
- constructor(reference2, sourceSpan) {
3635
- super(sourceSpan);
3648
+ constructor(reference2, nameSpan, sourceSpan, prefetchSpan, onSourceSpan) {
3649
+ super(nameSpan, sourceSpan, prefetchSpan, onSourceSpan);
3636
3650
  this.reference = reference2;
3637
3651
  }
3638
3652
  };
3639
3653
  var ViewportDeferredTrigger = class extends DeferredTrigger {
3640
- constructor(reference2, sourceSpan) {
3641
- super(sourceSpan);
3654
+ constructor(reference2, nameSpan, sourceSpan, prefetchSpan, onSourceSpan) {
3655
+ super(nameSpan, sourceSpan, prefetchSpan, onSourceSpan);
3642
3656
  this.reference = reference2;
3643
3657
  }
3644
3658
  };
3645
- var DeferredBlockPlaceholder = class {
3646
- constructor(children, minimumTime, sourceSpan, startSourceSpan, endSourceSpan) {
3647
- this.children = children;
3648
- this.minimumTime = minimumTime;
3659
+ var BlockNode = class {
3660
+ constructor(nameSpan, sourceSpan, startSourceSpan, endSourceSpan) {
3661
+ this.nameSpan = nameSpan;
3649
3662
  this.sourceSpan = sourceSpan;
3650
3663
  this.startSourceSpan = startSourceSpan;
3651
3664
  this.endSourceSpan = endSourceSpan;
3652
3665
  }
3666
+ };
3667
+ var DeferredBlockPlaceholder = class extends BlockNode {
3668
+ constructor(children, minimumTime, nameSpan, sourceSpan, startSourceSpan, endSourceSpan) {
3669
+ super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);
3670
+ this.children = children;
3671
+ this.minimumTime = minimumTime;
3672
+ }
3653
3673
  visit(visitor) {
3654
3674
  return visitor.visitDeferredBlockPlaceholder(this);
3655
3675
  }
3656
3676
  };
3657
- var DeferredBlockLoading = class {
3658
- constructor(children, afterTime, minimumTime, sourceSpan, startSourceSpan, endSourceSpan) {
3677
+ var DeferredBlockLoading = class extends BlockNode {
3678
+ constructor(children, afterTime, minimumTime, nameSpan, sourceSpan, startSourceSpan, endSourceSpan) {
3679
+ super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);
3659
3680
  this.children = children;
3660
3681
  this.afterTime = afterTime;
3661
3682
  this.minimumTime = minimumTime;
3662
- this.sourceSpan = sourceSpan;
3663
- this.startSourceSpan = startSourceSpan;
3664
- this.endSourceSpan = endSourceSpan;
3665
3683
  }
3666
3684
  visit(visitor) {
3667
3685
  return visitor.visitDeferredBlockLoading(this);
3668
3686
  }
3669
3687
  };
3670
- var DeferredBlockError = class {
3671
- constructor(children, sourceSpan, startSourceSpan, endSourceSpan) {
3688
+ var DeferredBlockError = class extends BlockNode {
3689
+ constructor(children, nameSpan, sourceSpan, startSourceSpan, endSourceSpan) {
3690
+ super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);
3672
3691
  this.children = children;
3673
- this.sourceSpan = sourceSpan;
3674
- this.startSourceSpan = startSourceSpan;
3675
- this.endSourceSpan = endSourceSpan;
3676
3692
  }
3677
3693
  visit(visitor) {
3678
3694
  return visitor.visitDeferredBlockError(this);
3679
3695
  }
3680
3696
  };
3681
- var DeferredBlock = class {
3682
- constructor(children, triggers, prefetchTriggers, placeholder, loading, error2, sourceSpan, mainBlockSpan, startSourceSpan, endSourceSpan) {
3697
+ var DeferredBlock = class extends BlockNode {
3698
+ constructor(children, triggers, prefetchTriggers, placeholder, loading, error2, nameSpan, sourceSpan, mainBlockSpan, startSourceSpan, endSourceSpan) {
3699
+ super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);
3683
3700
  this.children = children;
3684
3701
  this.placeholder = placeholder;
3685
3702
  this.loading = loading;
3686
3703
  this.error = error2;
3687
- this.sourceSpan = sourceSpan;
3688
3704
  this.mainBlockSpan = mainBlockSpan;
3689
- this.startSourceSpan = startSourceSpan;
3690
- this.endSourceSpan = endSourceSpan;
3691
3705
  this.triggers = triggers;
3692
3706
  this.prefetchTriggers = prefetchTriggers;
3693
3707
  this.definedTriggers = Object.keys(triggers);
@@ -3707,78 +3721,67 @@ var DeferredBlock = class {
3707
3721
  visitAll(visitor, keys.map((k) => triggers[k]));
3708
3722
  }
3709
3723
  };
3710
- var SwitchBlock = class {
3711
- constructor(expression, cases, unknownBlocks, sourceSpan, startSourceSpan, endSourceSpan) {
3724
+ var SwitchBlock = class extends BlockNode {
3725
+ constructor(expression, cases, unknownBlocks, sourceSpan, startSourceSpan, endSourceSpan, nameSpan) {
3726
+ super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);
3712
3727
  this.expression = expression;
3713
3728
  this.cases = cases;
3714
3729
  this.unknownBlocks = unknownBlocks;
3715
- this.sourceSpan = sourceSpan;
3716
- this.startSourceSpan = startSourceSpan;
3717
- this.endSourceSpan = endSourceSpan;
3718
3730
  }
3719
3731
  visit(visitor) {
3720
3732
  return visitor.visitSwitchBlock(this);
3721
3733
  }
3722
3734
  };
3723
- var SwitchBlockCase = class {
3724
- constructor(expression, children, sourceSpan, startSourceSpan, endSourceSpan) {
3735
+ var SwitchBlockCase = class extends BlockNode {
3736
+ constructor(expression, children, sourceSpan, startSourceSpan, endSourceSpan, nameSpan) {
3737
+ super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);
3725
3738
  this.expression = expression;
3726
3739
  this.children = children;
3727
- this.sourceSpan = sourceSpan;
3728
- this.startSourceSpan = startSourceSpan;
3729
- this.endSourceSpan = endSourceSpan;
3730
3740
  }
3731
3741
  visit(visitor) {
3732
3742
  return visitor.visitSwitchBlockCase(this);
3733
3743
  }
3734
3744
  };
3735
- var ForLoopBlock = class {
3736
- constructor(item, expression, trackBy, contextVariables, children, empty, sourceSpan, mainBlockSpan, startSourceSpan, endSourceSpan) {
3745
+ var ForLoopBlock = class extends BlockNode {
3746
+ constructor(item, expression, trackBy, trackKeywordSpan, contextVariables, children, empty, sourceSpan, mainBlockSpan, startSourceSpan, endSourceSpan, nameSpan) {
3747
+ super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);
3737
3748
  this.item = item;
3738
3749
  this.expression = expression;
3739
3750
  this.trackBy = trackBy;
3751
+ this.trackKeywordSpan = trackKeywordSpan;
3740
3752
  this.contextVariables = contextVariables;
3741
3753
  this.children = children;
3742
3754
  this.empty = empty;
3743
- this.sourceSpan = sourceSpan;
3744
3755
  this.mainBlockSpan = mainBlockSpan;
3745
- this.startSourceSpan = startSourceSpan;
3746
- this.endSourceSpan = endSourceSpan;
3747
3756
  }
3748
3757
  visit(visitor) {
3749
3758
  return visitor.visitForLoopBlock(this);
3750
3759
  }
3751
3760
  };
3752
- var ForLoopBlockEmpty = class {
3753
- constructor(children, sourceSpan, startSourceSpan, endSourceSpan) {
3761
+ var ForLoopBlockEmpty = class extends BlockNode {
3762
+ constructor(children, sourceSpan, startSourceSpan, endSourceSpan, nameSpan) {
3763
+ super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);
3754
3764
  this.children = children;
3755
- this.sourceSpan = sourceSpan;
3756
- this.startSourceSpan = startSourceSpan;
3757
- this.endSourceSpan = endSourceSpan;
3758
3765
  }
3759
3766
  visit(visitor) {
3760
3767
  return visitor.visitForLoopBlockEmpty(this);
3761
3768
  }
3762
3769
  };
3763
- var IfBlock = class {
3764
- constructor(branches, sourceSpan, startSourceSpan, endSourceSpan) {
3770
+ var IfBlock = class extends BlockNode {
3771
+ constructor(branches, sourceSpan, startSourceSpan, endSourceSpan, nameSpan) {
3772
+ super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);
3765
3773
  this.branches = branches;
3766
- this.sourceSpan = sourceSpan;
3767
- this.startSourceSpan = startSourceSpan;
3768
- this.endSourceSpan = endSourceSpan;
3769
3774
  }
3770
3775
  visit(visitor) {
3771
3776
  return visitor.visitIfBlock(this);
3772
3777
  }
3773
3778
  };
3774
- var IfBlockBranch = class {
3775
- constructor(expression, children, expressionAlias, sourceSpan, startSourceSpan, endSourceSpan) {
3779
+ var IfBlockBranch = class extends BlockNode {
3780
+ constructor(expression, children, expressionAlias, sourceSpan, startSourceSpan, endSourceSpan, nameSpan) {
3781
+ super(nameSpan, sourceSpan, startSourceSpan, endSourceSpan);
3776
3782
  this.expression = expression;
3777
3783
  this.children = children;
3778
3784
  this.expressionAlias = expressionAlias;
3779
- this.sourceSpan = sourceSpan;
3780
- this.startSourceSpan = startSourceSpan;
3781
- this.endSourceSpan = endSourceSpan;
3782
3785
  }
3783
3786
  visit(visitor) {
3784
3787
  return visitor.visitIfBlockBranch(this);
@@ -3877,7 +3880,7 @@ function visitAll(visitor, nodes) {
3877
3880
  return result;
3878
3881
  }
3879
3882
 
3880
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/i18n_ast.mjs
3883
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/i18n_ast.mjs
3881
3884
  var Message = class {
3882
3885
  constructor(nodes, placeholders, placeholderToMessage, meaning, description, customId) {
3883
3886
  this.nodes = nodes;
@@ -3996,7 +3999,7 @@ var LocalizeMessageStringVisitor = class {
3996
3999
  }
3997
4000
  };
3998
4001
 
3999
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/serializers/xml_helper.mjs
4002
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/serializers/xml_helper.mjs
4000
4003
  var _Visitor = class {
4001
4004
  visitTag(tag) {
4002
4005
  const strAttrs = this._serializeAttributes(tag.attrs);
@@ -4024,12 +4027,12 @@ ${doctype.dtd}
4024
4027
  };
4025
4028
  var _visitor = new _Visitor();
4026
4029
 
4027
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/serializers/xmb.mjs
4030
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/serializers/xmb.mjs
4028
4031
  function toPublicName(internalName) {
4029
4032
  return internalName.toUpperCase().replace(/[^A-Z0-9_]/g, "_");
4030
4033
  }
4031
4034
 
4032
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/i18n/util.mjs
4035
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/i18n/util.mjs
4033
4036
  var CLOSURE_TRANSLATION_VAR_PREFIX = "MSG_";
4034
4037
  var TRANSLATION_VAR_PREFIX = "i18n_";
4035
4038
  var I18N_ATTR = "i18n";
@@ -4131,7 +4134,7 @@ function declareI18nVariable(variable2) {
4131
4134
  return new DeclareVarStmt(variable2.name, void 0, INFERRED_TYPE, void 0, variable2.sourceSpan);
4132
4135
  }
4133
4136
 
4134
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/util.mjs
4137
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/util.mjs
4135
4138
  var UNSAFE_OBJECT_KEY_NAME_REGEXP = /[-.]/;
4136
4139
  var TEMPORARY_NAME = "_t";
4137
4140
  var CONTEXT_NAME = "ctx";
@@ -4354,7 +4357,7 @@ function getInstructionStatements(instructions) {
4354
4357
  return statements;
4355
4358
  }
4356
4359
 
4357
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/injectable_compiler_2.mjs
4360
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/injectable_compiler_2.mjs
4358
4361
  function compileInjectable(meta, resolveForwardRefs) {
4359
4362
  let result = null;
4360
4363
  const factoryMeta = {
@@ -4439,7 +4442,7 @@ function createFactoryFunction(type) {
4439
4442
  return arrowFn([new FnParam("t", DYNAMIC_TYPE)], type.prop("\u0275fac").callFn([variable("t")]));
4440
4443
  }
4441
4444
 
4442
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/assertions.mjs
4445
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/assertions.mjs
4443
4446
  var UNUSABLE_INTERPOLATION_REGEXPS = [
4444
4447
  /^\s*$/,
4445
4448
  /[<>]/,
@@ -4461,7 +4464,7 @@ function assertInterpolationSymbols(identifier, value) {
4461
4464
  }
4462
4465
  }
4463
4466
 
4464
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/interpolation_config.mjs
4467
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/interpolation_config.mjs
4465
4468
  var InterpolationConfig = class {
4466
4469
  static fromArray(markers) {
4467
4470
  if (!markers) {
@@ -4477,7 +4480,7 @@ var InterpolationConfig = class {
4477
4480
  };
4478
4481
  var DEFAULT_INTERPOLATION_CONFIG = new InterpolationConfig("{{", "}}");
4479
4482
 
4480
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/chars.mjs
4483
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/chars.mjs
4481
4484
  var $EOF = 0;
4482
4485
  var $BSPACE = 8;
4483
4486
  var $TAB = 9;
@@ -4559,7 +4562,7 @@ function isQuote(code) {
4559
4562
  return code === $SQ || code === $DQ || code === $BT;
4560
4563
  }
4561
4564
 
4562
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/parse_util.mjs
4565
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/parse_util.mjs
4563
4566
  var ParseLocation = class {
4564
4567
  constructor(file, offset, line, col) {
4565
4568
  this.file = file;
@@ -4706,7 +4709,7 @@ function sanitizeIdentifier(name) {
4706
4709
  return name.replace(/\W/g, "_");
4707
4710
  }
4708
4711
 
4709
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/abstract_js_emitter.mjs
4712
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/output/abstract_js_emitter.mjs
4710
4713
  var makeTemplateObjectPolyfill = '(this&&this.__makeTemplateObject||function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e})';
4711
4714
  var AbstractJsEmitterVisitor = class extends AbstractEmitterVisitor {
4712
4715
  constructor() {
@@ -4799,7 +4802,7 @@ var AbstractJsEmitterVisitor = class extends AbstractEmitterVisitor {
4799
4802
  }
4800
4803
  };
4801
4804
 
4802
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/output_jit_trusted_types.mjs
4805
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/output/output_jit_trusted_types.mjs
4803
4806
  var policy;
4804
4807
  function getPolicy() {
4805
4808
  if (policy === void 0) {
@@ -4837,7 +4840,7 @@ function newTrustedFunctionForJIT(...args) {
4837
4840
  return fn2.bind(_global);
4838
4841
  }
4839
4842
 
4840
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/output_jit.mjs
4843
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/output/output_jit.mjs
4841
4844
  var JitEvaluator = class {
4842
4845
  evaluateStatements(sourceUrl, statements, refResolver, createSourceMaps) {
4843
4846
  const converter = new JitEmitterVisitor(refResolver);
@@ -4928,7 +4931,7 @@ function isUseStrictStatement(statement) {
4928
4931
  return statement.isEquivalent(literal("use strict").toStmt());
4929
4932
  }
4930
4933
 
4931
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_injector_compiler.mjs
4934
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_injector_compiler.mjs
4932
4935
  function compileInjector(meta) {
4933
4936
  const definitionMap = new DefinitionMap();
4934
4937
  if (meta.providers !== null) {
@@ -4945,7 +4948,7 @@ function createInjectorType(meta) {
4945
4948
  return new ExpressionType(importExpr(Identifiers.InjectorDeclaration, [new ExpressionType(meta.type.type)]));
4946
4949
  }
4947
4950
 
4948
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_jit.mjs
4951
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_jit.mjs
4949
4952
  var R3JitReflector = class {
4950
4953
  constructor(context) {
4951
4954
  this.context = context;
@@ -4961,7 +4964,7 @@ var R3JitReflector = class {
4961
4964
  }
4962
4965
  };
4963
4966
 
4964
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_module_compiler.mjs
4967
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_module_compiler.mjs
4965
4968
  var R3SelectorScopeMode;
4966
4969
  (function(R3SelectorScopeMode2) {
4967
4970
  R3SelectorScopeMode2[R3SelectorScopeMode2["Inline"] = 0] = "Inline";
@@ -5102,7 +5105,7 @@ function tupleOfTypes(types) {
5102
5105
  return types.length > 0 ? expressionType(literalArr(typeofTypes)) : NONE_TYPE;
5103
5106
  }
5104
5107
 
5105
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_pipe_compiler.mjs
5108
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_pipe_compiler.mjs
5106
5109
  function compilePipeFromMetadata(metadata) {
5107
5110
  const definitionMapValues = [];
5108
5111
  definitionMapValues.push({ key: "name", value: literal(metadata.pipeName), quoted: false });
@@ -5123,7 +5126,7 @@ function createPipeType(metadata) {
5123
5126
  ]));
5124
5127
  }
5125
5128
 
5126
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/api.mjs
5129
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/api.mjs
5127
5130
  var R3TemplateDependencyKind;
5128
5131
  (function(R3TemplateDependencyKind2) {
5129
5132
  R3TemplateDependencyKind2[R3TemplateDependencyKind2["Directive"] = 0] = "Directive";
@@ -5131,7 +5134,7 @@ var R3TemplateDependencyKind;
5131
5134
  R3TemplateDependencyKind2[R3TemplateDependencyKind2["NgModule"] = 2] = "NgModule";
5132
5135
  })(R3TemplateDependencyKind || (R3TemplateDependencyKind = {}));
5133
5136
 
5134
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/expression_parser/ast.mjs
5137
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/expression_parser/ast.mjs
5135
5138
  var ParserError = class {
5136
5139
  constructor(message, input, errLocation, ctxLocation) {
5137
5140
  this.input = input;
@@ -5797,7 +5800,7 @@ var BoundElementProperty = class {
5797
5800
  }
5798
5801
  };
5799
5802
 
5800
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/compiler_util/expression_converter.mjs
5803
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/compiler_util/expression_converter.mjs
5801
5804
  var _EventHandlerVars = class {
5802
5805
  };
5803
5806
  var EventHandlerVars = _EventHandlerVars;
@@ -6438,7 +6441,7 @@ var BuiltinFunctionCall = class extends Call {
6438
6441
  }
6439
6442
  };
6440
6443
 
6441
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/schema/dom_security_schema.mjs
6444
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/schema/dom_security_schema.mjs
6442
6445
  var _SECURITY_SCHEMA;
6443
6446
  function SECURITY_SCHEMA() {
6444
6447
  if (!_SECURITY_SCHEMA) {
@@ -6496,7 +6499,7 @@ function isIframeSecuritySensitiveAttr(attrName) {
6496
6499
  return IFRAME_SECURITY_SENSITIVE_ATTRS.has(attrName.toLowerCase());
6497
6500
  }
6498
6501
 
6499
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/shadow_css.mjs
6502
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/shadow_css.mjs
6500
6503
  var animationKeywords = /* @__PURE__ */ new Set([
6501
6504
  "inherit",
6502
6505
  "initial",
@@ -6967,7 +6970,7 @@ function repeatGroups(groups, multiples) {
6967
6970
  }
6968
6971
  }
6969
6972
 
6970
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/enums.mjs
6973
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/enums.mjs
6971
6974
  var OpKind;
6972
6975
  (function(OpKind2) {
6973
6976
  OpKind2[OpKind2["ListEnd"] = 0] = "ListEnd";
@@ -6997,22 +7000,21 @@ var OpKind;
6997
7000
  OpKind2[OpKind2["Attribute"] = 24] = "Attribute";
6998
7001
  OpKind2[OpKind2["ExtractedAttribute"] = 25] = "ExtractedAttribute";
6999
7002
  OpKind2[OpKind2["Defer"] = 26] = "Defer";
7000
- OpKind2[OpKind2["DeferSecondaryBlock"] = 27] = "DeferSecondaryBlock";
7001
- OpKind2[OpKind2["DeferOn"] = 28] = "DeferOn";
7002
- OpKind2[OpKind2["ExtractedMessage"] = 29] = "ExtractedMessage";
7003
- OpKind2[OpKind2["HostProperty"] = 30] = "HostProperty";
7004
- OpKind2[OpKind2["Namespace"] = 31] = "Namespace";
7005
- OpKind2[OpKind2["ProjectionDef"] = 32] = "ProjectionDef";
7006
- OpKind2[OpKind2["Projection"] = 33] = "Projection";
7007
- OpKind2[OpKind2["RepeaterCreate"] = 34] = "RepeaterCreate";
7008
- OpKind2[OpKind2["Repeater"] = 35] = "Repeater";
7009
- OpKind2[OpKind2["I18nStart"] = 36] = "I18nStart";
7010
- OpKind2[OpKind2["I18n"] = 37] = "I18n";
7011
- OpKind2[OpKind2["I18nEnd"] = 38] = "I18nEnd";
7012
- OpKind2[OpKind2["I18nExpression"] = 39] = "I18nExpression";
7013
- OpKind2[OpKind2["I18nApply"] = 40] = "I18nApply";
7014
- OpKind2[OpKind2["Icu"] = 41] = "Icu";
7015
- OpKind2[OpKind2["IcuUpdate"] = 42] = "IcuUpdate";
7003
+ OpKind2[OpKind2["DeferOn"] = 27] = "DeferOn";
7004
+ OpKind2[OpKind2["ExtractedMessage"] = 28] = "ExtractedMessage";
7005
+ OpKind2[OpKind2["HostProperty"] = 29] = "HostProperty";
7006
+ OpKind2[OpKind2["Namespace"] = 30] = "Namespace";
7007
+ OpKind2[OpKind2["ProjectionDef"] = 31] = "ProjectionDef";
7008
+ OpKind2[OpKind2["Projection"] = 32] = "Projection";
7009
+ OpKind2[OpKind2["RepeaterCreate"] = 33] = "RepeaterCreate";
7010
+ OpKind2[OpKind2["Repeater"] = 34] = "Repeater";
7011
+ OpKind2[OpKind2["I18nStart"] = 35] = "I18nStart";
7012
+ OpKind2[OpKind2["I18n"] = 36] = "I18n";
7013
+ OpKind2[OpKind2["I18nEnd"] = 37] = "I18nEnd";
7014
+ OpKind2[OpKind2["I18nExpression"] = 38] = "I18nExpression";
7015
+ OpKind2[OpKind2["I18nApply"] = 39] = "I18nApply";
7016
+ OpKind2[OpKind2["Icu"] = 40] = "Icu";
7017
+ OpKind2[OpKind2["IcuUpdate"] = 41] = "IcuUpdate";
7016
7018
  })(OpKind || (OpKind = {}));
7017
7019
  var ExpressionKind;
7018
7020
  (function(ExpressionKind2) {
@@ -7040,6 +7042,7 @@ var ExpressionKind;
7040
7042
  ExpressionKind2[ExpressionKind2["SlotLiteralExpr"] = 21] = "SlotLiteralExpr";
7041
7043
  ExpressionKind2[ExpressionKind2["ConditionalCase"] = 22] = "ConditionalCase";
7042
7044
  ExpressionKind2[ExpressionKind2["DerivedRepeaterVar"] = 23] = "DerivedRepeaterVar";
7045
+ ExpressionKind2[ExpressionKind2["ConstCollected"] = 24] = "ConstCollected";
7043
7046
  })(ExpressionKind || (ExpressionKind = {}));
7044
7047
  var VariableFlags;
7045
7048
  (function(VariableFlags2) {
@@ -7088,23 +7091,46 @@ var I18nParamResolutionTime;
7088
7091
  I18nParamResolutionTime2[I18nParamResolutionTime2["Creation"] = 0] = "Creation";
7089
7092
  I18nParamResolutionTime2[I18nParamResolutionTime2["Postproccessing"] = 1] = "Postproccessing";
7090
7093
  })(I18nParamResolutionTime || (I18nParamResolutionTime = {}));
7094
+ var I18nParamValueFlags;
7095
+ (function(I18nParamValueFlags2) {
7096
+ I18nParamValueFlags2[I18nParamValueFlags2["None"] = 0] = "None";
7097
+ I18nParamValueFlags2[I18nParamValueFlags2["ElementTag"] = 1] = "ElementTag";
7098
+ I18nParamValueFlags2[I18nParamValueFlags2["TemplateTag"] = 2] = "TemplateTag";
7099
+ I18nParamValueFlags2[I18nParamValueFlags2["OpenTag"] = 4] = "OpenTag";
7100
+ I18nParamValueFlags2[I18nParamValueFlags2["CloseTag"] = 8] = "CloseTag";
7101
+ })(I18nParamValueFlags || (I18nParamValueFlags = {}));
7102
+ var Namespace;
7103
+ (function(Namespace2) {
7104
+ Namespace2[Namespace2["HTML"] = 0] = "HTML";
7105
+ Namespace2[Namespace2["SVG"] = 1] = "SVG";
7106
+ Namespace2[Namespace2["Math"] = 2] = "Math";
7107
+ })(Namespace || (Namespace = {}));
7108
+ var DeferTriggerKind;
7109
+ (function(DeferTriggerKind2) {
7110
+ DeferTriggerKind2[DeferTriggerKind2["Idle"] = 0] = "Idle";
7111
+ DeferTriggerKind2[DeferTriggerKind2["Immediate"] = 1] = "Immediate";
7112
+ DeferTriggerKind2[DeferTriggerKind2["Timer"] = 2] = "Timer";
7113
+ DeferTriggerKind2[DeferTriggerKind2["Hover"] = 3] = "Hover";
7114
+ DeferTriggerKind2[DeferTriggerKind2["Interaction"] = 4] = "Interaction";
7115
+ DeferTriggerKind2[DeferTriggerKind2["Viewport"] = 5] = "Viewport";
7116
+ })(DeferTriggerKind || (DeferTriggerKind = {}));
7117
+ var DerivedRepeaterVarIdentity;
7118
+ (function(DerivedRepeaterVarIdentity2) {
7119
+ DerivedRepeaterVarIdentity2[DerivedRepeaterVarIdentity2["First"] = 0] = "First";
7120
+ DerivedRepeaterVarIdentity2[DerivedRepeaterVarIdentity2["Last"] = 1] = "Last";
7121
+ DerivedRepeaterVarIdentity2[DerivedRepeaterVarIdentity2["Even"] = 2] = "Even";
7122
+ DerivedRepeaterVarIdentity2[DerivedRepeaterVarIdentity2["Odd"] = 3] = "Odd";
7123
+ })(DerivedRepeaterVarIdentity || (DerivedRepeaterVarIdentity = {}));
7091
7124
 
7092
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/traits.mjs
7125
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/traits.mjs
7093
7126
  var ConsumesSlot = Symbol("ConsumesSlot");
7094
7127
  var DependsOnSlotContext = Symbol("DependsOnSlotContext");
7095
- var UsesSlotIndex = Symbol("UsesSlotIndex");
7096
7128
  var ConsumesVarsTrait = Symbol("ConsumesVars");
7097
7129
  var UsesVarOffset = Symbol("UsesVarOffset");
7098
- var HasConst = Symbol("HasConst");
7099
7130
  var TRAIT_CONSUMES_SLOT = {
7100
7131
  [ConsumesSlot]: true,
7101
- slot: null,
7102
7132
  numSlotsUsed: 1
7103
7133
  };
7104
- var TRAIT_USES_SLOT_INDEX = {
7105
- [UsesSlotIndex]: true,
7106
- targetSlot: null
7107
- };
7108
7134
  var TRAIT_DEPENDS_ON_SLOT_CONTEXT = {
7109
7135
  [DependsOnSlotContext]: true
7110
7136
  };
@@ -7115,10 +7141,6 @@ var TRAIT_USES_VAR_OFFSET = {
7115
7141
  [UsesVarOffset]: true,
7116
7142
  varOffset: null
7117
7143
  };
7118
- var TRAIT_HAS_CONST = {
7119
- [HasConst]: true,
7120
- constIndex: null
7121
- };
7122
7144
  function hasConsumesSlotTrait(op) {
7123
7145
  return op[ConsumesSlot] === true;
7124
7146
  }
@@ -7131,14 +7153,8 @@ function hasConsumesVarsTrait(value) {
7131
7153
  function hasUsesVarOffsetTrait(expr) {
7132
7154
  return expr[UsesVarOffset] === true;
7133
7155
  }
7134
- function hasUsesSlotIndexTrait(value) {
7135
- return value[UsesSlotIndex] === true;
7136
- }
7137
- function hasConstTrait(value) {
7138
- return value[HasConst] === true;
7139
- }
7140
7156
 
7141
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/shared.mjs
7157
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/shared.mjs
7142
7158
  function createStatementOp(statement) {
7143
7159
  return __spreadValues({
7144
7160
  kind: OpKind.Statement,
@@ -7160,7 +7176,7 @@ var NEW_OP = {
7160
7176
  next: null
7161
7177
  };
7162
7178
 
7163
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/update.mjs
7179
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/update.mjs
7164
7180
  function createInterpolateTextOp(xref, interpolation, i18nPlaceholders, sourceSpan) {
7165
7181
  return __spreadValues(__spreadValues(__spreadValues({
7166
7182
  kind: OpKind.InterpolateText,
@@ -7258,29 +7274,32 @@ function createAdvanceOp(delta, sourceSpan) {
7258
7274
  sourceSpan
7259
7275
  }, NEW_OP);
7260
7276
  }
7261
- function createConditionalOp(target, test, conditions, sourceSpan) {
7262
- return __spreadValues(__spreadValues(__spreadValues(__spreadValues({
7277
+ function createConditionalOp(target, targetSlot, test, conditions, sourceSpan) {
7278
+ return __spreadValues(__spreadValues(__spreadValues({
7263
7279
  kind: OpKind.Conditional,
7264
7280
  target,
7281
+ targetSlot,
7265
7282
  test,
7266
7283
  conditions,
7267
7284
  processed: null,
7268
7285
  sourceSpan,
7269
7286
  contextValue: null
7270
- }, NEW_OP), TRAIT_USES_SLOT_INDEX), TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS);
7287
+ }, NEW_OP), TRAIT_DEPENDS_ON_SLOT_CONTEXT), TRAIT_CONSUMES_VARS);
7271
7288
  }
7272
- function createRepeaterOp(repeaterCreate2, collection, sourceSpan) {
7273
- return __spreadValues(__spreadValues({
7289
+ function createRepeaterOp(repeaterCreate2, targetSlot, collection, sourceSpan) {
7290
+ return __spreadValues({
7274
7291
  kind: OpKind.Repeater,
7275
7292
  target: repeaterCreate2,
7293
+ targetSlot,
7276
7294
  collection,
7277
7295
  sourceSpan
7278
- }, NEW_OP), TRAIT_USES_SLOT_INDEX);
7296
+ }, NEW_OP);
7279
7297
  }
7280
- function createI18nExpressionOp(owner, expression, i18nPlaceholder, resolutionTime, sourceSpan) {
7298
+ function createI18nExpressionOp(owner, ownerSlot, expression, i18nPlaceholder, resolutionTime, sourceSpan) {
7281
7299
  return __spreadValues(__spreadValues(__spreadValues({
7282
7300
  kind: OpKind.I18nExpression,
7283
7301
  owner,
7302
+ ownerSlot,
7284
7303
  target: owner,
7285
7304
  expression,
7286
7305
  i18nPlaceholder,
@@ -7288,12 +7307,13 @@ function createI18nExpressionOp(owner, expression, i18nPlaceholder, resolutionTi
7288
7307
  sourceSpan
7289
7308
  }, NEW_OP), TRAIT_CONSUMES_VARS), TRAIT_DEPENDS_ON_SLOT_CONTEXT);
7290
7309
  }
7291
- function createI18nApplyOp(target, sourceSpan) {
7292
- return __spreadValues(__spreadValues({
7310
+ function createI18nApplyOp(target, targetSlot, sourceSpan) {
7311
+ return __spreadValues({
7293
7312
  kind: OpKind.I18nApply,
7294
7313
  target,
7314
+ targetSlot,
7295
7315
  sourceSpan
7296
- }, NEW_OP), TRAIT_USES_SLOT_INDEX);
7316
+ }, NEW_OP);
7297
7317
  }
7298
7318
  function createIcuUpdateOp(xref, sourceSpan) {
7299
7319
  return __spreadValues({
@@ -7303,17 +7323,13 @@ function createIcuUpdateOp(xref, sourceSpan) {
7303
7323
  }, NEW_OP);
7304
7324
  }
7305
7325
 
7306
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/expression.mjs
7326
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/expression.mjs
7307
7327
  var _a;
7308
7328
  var _b;
7309
7329
  var _c;
7310
7330
  var _d;
7311
7331
  var _e;
7312
7332
  var _f;
7313
- var _g;
7314
- var _h;
7315
- var _j;
7316
- var _k;
7317
7333
  function isIrExpression(expr) {
7318
7334
  return expr instanceof ExpressionBase;
7319
7335
  }
@@ -7342,19 +7358,18 @@ var LexicalReadExpr = class extends ExpressionBase {
7342
7358
  return new LexicalReadExpr(this.name);
7343
7359
  }
7344
7360
  };
7345
- var _ReferenceExpr = class extends ExpressionBase {
7346
- constructor(target, offset) {
7361
+ var ReferenceExpr = class extends ExpressionBase {
7362
+ constructor(target, targetSlot, offset) {
7347
7363
  super();
7348
7364
  this.target = target;
7365
+ this.targetSlot = targetSlot;
7349
7366
  this.offset = offset;
7350
7367
  this.kind = ExpressionKind.Reference;
7351
- this[_a] = true;
7352
- this.targetSlot = null;
7353
7368
  }
7354
7369
  visitExpression() {
7355
7370
  }
7356
7371
  isEquivalent(e) {
7357
- return e instanceof _ReferenceExpr && e.target === this.target;
7372
+ return e instanceof ReferenceExpr && e.target === this.target;
7358
7373
  }
7359
7374
  isConstant() {
7360
7375
  return false;
@@ -7362,15 +7377,9 @@ var _ReferenceExpr = class extends ExpressionBase {
7362
7377
  transformInternalExpressions() {
7363
7378
  }
7364
7379
  clone() {
7365
- const expr = new _ReferenceExpr(this.target, this.offset);
7366
- expr.targetSlot = this.targetSlot;
7367
- return expr;
7380
+ return new ReferenceExpr(this.target, this.targetSlot, this.offset);
7368
7381
  }
7369
7382
  };
7370
- var ReferenceExpr = _ReferenceExpr;
7371
- (() => {
7372
- _a = UsesSlotIndex;
7373
- })();
7374
7383
  var ContextExpr = class extends ExpressionBase {
7375
7384
  constructor(view) {
7376
7385
  super();
@@ -7534,8 +7543,8 @@ var _PureFunctionExpr = class extends ExpressionBase {
7534
7543
  constructor(expression, args) {
7535
7544
  super();
7536
7545
  this.kind = ExpressionKind.PureFunctionExpr;
7546
+ this[_a] = true;
7537
7547
  this[_b] = true;
7538
- this[_c] = true;
7539
7548
  this.varOffset = null;
7540
7549
  this.fn = null;
7541
7550
  this.body = expression;
@@ -7577,7 +7586,7 @@ var _PureFunctionExpr = class extends ExpressionBase {
7577
7586
  };
7578
7587
  var PureFunctionExpr = _PureFunctionExpr;
7579
7588
  (() => {
7580
- _b = ConsumesVarsTrait, _c = UsesVarOffset;
7589
+ _a = ConsumesVarsTrait, _b = UsesVarOffset;
7581
7590
  })();
7582
7591
  var PureFunctionParameterExpr = class extends ExpressionBase {
7583
7592
  constructor(index) {
@@ -7600,16 +7609,15 @@ var PureFunctionParameterExpr = class extends ExpressionBase {
7600
7609
  }
7601
7610
  };
7602
7611
  var _PipeBindingExpr = class extends ExpressionBase {
7603
- constructor(target, name, args) {
7612
+ constructor(target, targetSlot, name, args) {
7604
7613
  super();
7605
7614
  this.target = target;
7615
+ this.targetSlot = targetSlot;
7606
7616
  this.name = name;
7607
7617
  this.args = args;
7608
7618
  this.kind = ExpressionKind.PipeBinding;
7619
+ this[_c] = true;
7609
7620
  this[_d] = true;
7610
- this[_e] = true;
7611
- this[_f] = true;
7612
- this.targetSlot = null;
7613
7621
  this.varOffset = null;
7614
7622
  }
7615
7623
  visitExpression(visitor, context) {
@@ -7629,28 +7637,26 @@ var _PipeBindingExpr = class extends ExpressionBase {
7629
7637
  }
7630
7638
  }
7631
7639
  clone() {
7632
- const r = new _PipeBindingExpr(this.target, this.name, this.args.map((a) => a.clone()));
7633
- r.targetSlot = this.targetSlot;
7640
+ const r = new _PipeBindingExpr(this.target, this.targetSlot, this.name, this.args.map((a) => a.clone()));
7634
7641
  r.varOffset = this.varOffset;
7635
7642
  return r;
7636
7643
  }
7637
7644
  };
7638
7645
  var PipeBindingExpr = _PipeBindingExpr;
7639
7646
  (() => {
7640
- _d = UsesSlotIndex, _e = ConsumesVarsTrait, _f = UsesVarOffset;
7647
+ _c = ConsumesVarsTrait, _d = UsesVarOffset;
7641
7648
  })();
7642
7649
  var _PipeBindingVariadicExpr = class extends ExpressionBase {
7643
- constructor(target, name, args, numArgs) {
7650
+ constructor(target, targetSlot, name, args, numArgs) {
7644
7651
  super();
7645
7652
  this.target = target;
7653
+ this.targetSlot = targetSlot;
7646
7654
  this.name = name;
7647
7655
  this.args = args;
7648
7656
  this.numArgs = numArgs;
7649
7657
  this.kind = ExpressionKind.PipeBindingVariadic;
7650
- this[_g] = true;
7651
- this[_h] = true;
7652
- this[_j] = true;
7653
- this.targetSlot = null;
7658
+ this[_e] = true;
7659
+ this[_f] = true;
7654
7660
  this.varOffset = null;
7655
7661
  }
7656
7662
  visitExpression(visitor, context) {
@@ -7666,15 +7672,14 @@ var _PipeBindingVariadicExpr = class extends ExpressionBase {
7666
7672
  this.args = transformExpressionsInExpression(this.args, transform2, flags);
7667
7673
  }
7668
7674
  clone() {
7669
- const r = new _PipeBindingVariadicExpr(this.target, this.name, this.args.clone(), this.numArgs);
7670
- r.targetSlot = this.targetSlot;
7675
+ const r = new _PipeBindingVariadicExpr(this.target, this.targetSlot, this.name, this.args.clone(), this.numArgs);
7671
7676
  r.varOffset = this.varOffset;
7672
7677
  return r;
7673
7678
  }
7674
7679
  };
7675
7680
  var PipeBindingVariadicExpr = _PipeBindingVariadicExpr;
7676
7681
  (() => {
7677
- _g = UsesSlotIndex, _h = ConsumesVarsTrait, _j = UsesVarOffset;
7682
+ _e = ConsumesVarsTrait, _f = UsesVarOffset;
7678
7683
  })();
7679
7684
  var SafePropertyReadExpr = class extends ExpressionBase {
7680
7685
  constructor(receiver, name) {
@@ -7869,39 +7874,32 @@ var SanitizerExpr = class extends ExpressionBase {
7869
7874
  transformInternalExpressions() {
7870
7875
  }
7871
7876
  };
7872
- var _SlotLiteralExpr = class extends ExpressionBase {
7873
- constructor(target) {
7877
+ var SlotLiteralExpr = class extends ExpressionBase {
7878
+ constructor(slot) {
7874
7879
  super();
7875
- this.target = target;
7880
+ this.slot = slot;
7876
7881
  this.kind = ExpressionKind.SlotLiteralExpr;
7877
- this[_k] = true;
7878
- this.targetSlot = null;
7879
7882
  }
7880
7883
  visitExpression(visitor, context) {
7881
7884
  }
7882
7885
  isEquivalent(e) {
7883
- return e instanceof _SlotLiteralExpr && e.target === this.target && e.targetSlot === this.targetSlot;
7886
+ return e instanceof SlotLiteralExpr && e.slot === this.slot;
7884
7887
  }
7885
7888
  isConstant() {
7886
7889
  return true;
7887
7890
  }
7888
7891
  clone() {
7889
- const copy = new _SlotLiteralExpr(this.target);
7890
- copy.targetSlot = this.targetSlot;
7891
- return copy;
7892
+ return new SlotLiteralExpr(this.slot);
7892
7893
  }
7893
7894
  transformInternalExpressions() {
7894
7895
  }
7895
7896
  };
7896
- var SlotLiteralExpr = _SlotLiteralExpr;
7897
- (() => {
7898
- _k = UsesSlotIndex;
7899
- })();
7900
7897
  var ConditionalCaseExpr = class extends ExpressionBase {
7901
- constructor(expr, target, alias = null) {
7898
+ constructor(expr, target, targetSlot, alias = null) {
7902
7899
  super();
7903
7900
  this.expr = expr;
7904
7901
  this.target = target;
7902
+ this.targetSlot = targetSlot;
7905
7903
  this.alias = alias;
7906
7904
  this.kind = ExpressionKind.ConditionalCase;
7907
7905
  }
@@ -7917,7 +7915,7 @@ var ConditionalCaseExpr = class extends ExpressionBase {
7917
7915
  return true;
7918
7916
  }
7919
7917
  clone() {
7920
- return new ConditionalCaseExpr(this.expr, this.target);
7918
+ return new ConditionalCaseExpr(this.expr, this.target, this.targetSlot);
7921
7919
  }
7922
7920
  transformInternalExpressions(transform2, flags) {
7923
7921
  if (this.expr !== null) {
@@ -7925,13 +7923,6 @@ var ConditionalCaseExpr = class extends ExpressionBase {
7925
7923
  }
7926
7924
  }
7927
7925
  };
7928
- var DerivedRepeaterVarIdentity;
7929
- (function(DerivedRepeaterVarIdentity2) {
7930
- DerivedRepeaterVarIdentity2[DerivedRepeaterVarIdentity2["First"] = 0] = "First";
7931
- DerivedRepeaterVarIdentity2[DerivedRepeaterVarIdentity2["Last"] = 1] = "Last";
7932
- DerivedRepeaterVarIdentity2[DerivedRepeaterVarIdentity2["Even"] = 2] = "Even";
7933
- DerivedRepeaterVarIdentity2[DerivedRepeaterVarIdentity2["Odd"] = 3] = "Odd";
7934
- })(DerivedRepeaterVarIdentity || (DerivedRepeaterVarIdentity = {}));
7935
7926
  var DerivedRepeaterVarExpr = class extends ExpressionBase {
7936
7927
  constructor(xref, identity) {
7937
7928
  super();
@@ -7953,6 +7944,31 @@ var DerivedRepeaterVarExpr = class extends ExpressionBase {
7953
7944
  return new DerivedRepeaterVarExpr(this.xref, this.identity);
7954
7945
  }
7955
7946
  };
7947
+ var ConstCollectedExpr = class extends ExpressionBase {
7948
+ constructor(expr) {
7949
+ super();
7950
+ this.expr = expr;
7951
+ this.kind = ExpressionKind.ConstCollected;
7952
+ }
7953
+ transformInternalExpressions(transform2, flags) {
7954
+ this.expr = transform2(this.expr, flags);
7955
+ }
7956
+ visitExpression(visitor, context) {
7957
+ this.expr.visitExpression(visitor, context);
7958
+ }
7959
+ isEquivalent(e) {
7960
+ if (!(e instanceof ConstCollectedExpr)) {
7961
+ return false;
7962
+ }
7963
+ return this.expr.isEquivalent(e.expr);
7964
+ }
7965
+ isConstant() {
7966
+ return this.expr.isConstant();
7967
+ }
7968
+ clone() {
7969
+ return new ConstCollectedExpr(this.expr);
7970
+ }
7971
+ };
7956
7972
  function visitExpressionsInOp(op, visitor) {
7957
7973
  transformExpressionsInOp(op, (expr, flags) => {
7958
7974
  visitor(expr, flags);
@@ -8026,12 +8042,6 @@ function transformExpressionsInOp(op, transform2, flags) {
8026
8042
  case OpKind.ExtractedAttribute:
8027
8043
  op.expression = op.expression && transformExpressionsInExpression(op.expression, transform2, flags);
8028
8044
  break;
8029
- case OpKind.ExtractedMessage:
8030
- op.expression = transformExpressionsInExpression(op.expression, transform2, flags);
8031
- for (const statement of op.statements) {
8032
- transformExpressionsInStatement(statement, transform2, flags);
8033
- }
8034
- break;
8035
8045
  case OpKind.RepeaterCreate:
8036
8046
  op.track = transformExpressionsInExpression(op.track, transform2, flags);
8037
8047
  if (op.trackByFn !== null) {
@@ -8041,34 +8051,37 @@ function transformExpressionsInOp(op, transform2, flags) {
8041
8051
  case OpKind.Repeater:
8042
8052
  op.collection = transformExpressionsInExpression(op.collection, transform2, flags);
8043
8053
  break;
8044
- case OpKind.I18n:
8045
- case OpKind.I18nStart:
8046
- for (const [placeholder, expression] of op.params) {
8047
- op.params.set(placeholder, transformExpressionsInExpression(expression, transform2, flags));
8054
+ case OpKind.Defer:
8055
+ if (op.loadingConfig !== null) {
8056
+ op.loadingConfig = transformExpressionsInExpression(op.loadingConfig, transform2, flags);
8057
+ }
8058
+ if (op.placeholderConfig !== null) {
8059
+ op.placeholderConfig = transformExpressionsInExpression(op.placeholderConfig, transform2, flags);
8048
8060
  }
8049
8061
  break;
8050
- case OpKind.Defer:
8051
- case OpKind.DeferSecondaryBlock:
8052
- case OpKind.DeferOn:
8053
- case OpKind.Projection:
8054
- case OpKind.ProjectionDef:
8055
- case OpKind.Element:
8056
- case OpKind.ElementStart:
8057
- case OpKind.ElementEnd:
8058
- case OpKind.I18nEnd:
8062
+ case OpKind.Advance:
8059
8063
  case OpKind.Container:
8060
- case OpKind.ContainerStart:
8061
8064
  case OpKind.ContainerEnd:
8062
- case OpKind.Template:
8065
+ case OpKind.ContainerStart:
8066
+ case OpKind.DeferOn:
8063
8067
  case OpKind.DisableBindings:
8068
+ case OpKind.Element:
8069
+ case OpKind.ElementEnd:
8070
+ case OpKind.ElementStart:
8064
8071
  case OpKind.EnableBindings:
8065
- case OpKind.Text:
8066
- case OpKind.Pipe:
8067
- case OpKind.Advance:
8068
- case OpKind.Namespace:
8072
+ case OpKind.ExtractedMessage:
8073
+ case OpKind.I18n:
8069
8074
  case OpKind.I18nApply:
8075
+ case OpKind.I18nEnd:
8076
+ case OpKind.I18nStart:
8070
8077
  case OpKind.Icu:
8071
8078
  case OpKind.IcuUpdate:
8079
+ case OpKind.Namespace:
8080
+ case OpKind.Pipe:
8081
+ case OpKind.Projection:
8082
+ case OpKind.ProjectionDef:
8083
+ case OpKind.Template:
8084
+ case OpKind.Text:
8072
8085
  break;
8073
8086
  default:
8074
8087
  throw new Error(`AssertionError: transformExpressionsInOp doesn't handle ${OpKind[op.kind]}`);
@@ -8150,7 +8163,7 @@ function isStringLiteral(expr) {
8150
8163
  return expr instanceof LiteralExpr && typeof expr.value === "string";
8151
8164
  }
8152
8165
 
8153
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/operations.mjs
8166
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/operations.mjs
8154
8167
  var _OpList = class {
8155
8168
  constructor() {
8156
8169
  this.debugListId = _OpList.nextListId++;
@@ -8341,7 +8354,14 @@ var OpList = _OpList;
8341
8354
  _OpList.nextListId = 0;
8342
8355
  })();
8343
8356
 
8344
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/create.mjs
8357
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/handle.mjs
8358
+ var SlotHandle = class {
8359
+ constructor() {
8360
+ this.slot = null;
8361
+ }
8362
+ };
8363
+
8364
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/create.mjs
8345
8365
  var elementContainerOpKinds = /* @__PURE__ */ new Set([
8346
8366
  OpKind.Element,
8347
8367
  OpKind.ElementStart,
@@ -8358,6 +8378,7 @@ function createElementStartOp(tag, xref, namespace, i18nPlaceholder, sourceSpan)
8358
8378
  kind: OpKind.ElementStart,
8359
8379
  xref,
8360
8380
  tag,
8381
+ handle: new SlotHandle(),
8361
8382
  attributes: null,
8362
8383
  localRefs: [],
8363
8384
  nonBindable: false,
@@ -8366,13 +8387,14 @@ function createElementStartOp(tag, xref, namespace, i18nPlaceholder, sourceSpan)
8366
8387
  sourceSpan
8367
8388
  }, TRAIT_CONSUMES_SLOT), NEW_OP);
8368
8389
  }
8369
- function createTemplateOp(xref, tag, namespace, generatedInBlock, i18nPlaceholder, sourceSpan) {
8390
+ function createTemplateOp(xref, tag, functionNameSuffix, namespace, i18nPlaceholder, sourceSpan) {
8370
8391
  return __spreadValues(__spreadValues({
8371
8392
  kind: OpKind.Template,
8372
8393
  xref,
8373
8394
  attributes: null,
8374
8395
  tag,
8375
- block: generatedInBlock,
8396
+ handle: new SlotHandle(),
8397
+ functionNameSuffix,
8376
8398
  decls: null,
8377
8399
  vars: null,
8378
8400
  localRefs: [],
@@ -8382,15 +8404,17 @@ function createTemplateOp(xref, tag, namespace, generatedInBlock, i18nPlaceholde
8382
8404
  sourceSpan
8383
8405
  }, TRAIT_CONSUMES_SLOT), NEW_OP);
8384
8406
  }
8385
- function createRepeaterCreateOp(primaryView, emptyView, track, varNames, sourceSpan) {
8407
+ function createRepeaterCreateOp(primaryView, emptyView, tag, track, varNames, sourceSpan) {
8386
8408
  return __spreadProps(__spreadValues(__spreadValues({
8387
8409
  kind: OpKind.RepeaterCreate,
8388
8410
  attributes: null,
8389
8411
  xref: primaryView,
8412
+ handle: new SlotHandle(),
8390
8413
  emptyView,
8391
8414
  track,
8392
8415
  trackByFn: null,
8393
- tag: "For",
8416
+ tag,
8417
+ functionNameSuffix: "For",
8394
8418
  namespace: Namespace.HTML,
8395
8419
  nonBindable: false,
8396
8420
  localRefs: [],
@@ -8426,14 +8450,16 @@ function createTextOp(xref, initialValue, sourceSpan) {
8426
8450
  return __spreadValues(__spreadValues({
8427
8451
  kind: OpKind.Text,
8428
8452
  xref,
8453
+ handle: new SlotHandle(),
8429
8454
  initialValue,
8430
8455
  sourceSpan
8431
8456
  }, TRAIT_CONSUMES_SLOT), NEW_OP);
8432
8457
  }
8433
- function createListenerOp(target, name, tag, animationPhase, hostListener, sourceSpan) {
8434
- return __spreadValues(__spreadValues({
8458
+ function createListenerOp(target, targetSlot, name, tag, animationPhase, hostListener, sourceSpan) {
8459
+ return __spreadValues({
8435
8460
  kind: OpKind.Listener,
8436
8461
  target,
8462
+ targetSlot,
8437
8463
  tag,
8438
8464
  hostListener,
8439
8465
  name,
@@ -8443,21 +8469,16 @@ function createListenerOp(target, name, tag, animationPhase, hostListener, sourc
8443
8469
  isAnimationListener: animationPhase !== null,
8444
8470
  animationPhase,
8445
8471
  sourceSpan
8446
- }, NEW_OP), TRAIT_USES_SLOT_INDEX);
8472
+ }, NEW_OP);
8447
8473
  }
8448
- function createPipeOp(xref, name) {
8474
+ function createPipeOp(xref, slot, name) {
8449
8475
  return __spreadValues(__spreadValues({
8450
8476
  kind: OpKind.Pipe,
8451
8477
  xref,
8478
+ handle: slot,
8452
8479
  name
8453
8480
  }, NEW_OP), TRAIT_CONSUMES_SLOT);
8454
8481
  }
8455
- var Namespace;
8456
- (function(Namespace2) {
8457
- Namespace2[Namespace2["HTML"] = 0] = "HTML";
8458
- Namespace2[Namespace2["SVG"] = 1] = "SVG";
8459
- Namespace2[Namespace2["Math"] = 2] = "Math";
8460
- })(Namespace || (Namespace = {}));
8461
8482
  function createNamespaceOp(namespace) {
8462
8483
  return __spreadValues({
8463
8484
  kind: OpKind.Namespace,
@@ -8474,6 +8495,7 @@ function createProjectionOp(xref, selector, sourceSpan) {
8474
8495
  return __spreadValues(__spreadValues({
8475
8496
  kind: OpKind.Projection,
8476
8497
  xref,
8498
+ handle: new SlotHandle(),
8477
8499
  selector,
8478
8500
  projectionSlotIndex: 0,
8479
8501
  attributes: [],
@@ -8490,53 +8512,60 @@ function createExtractedAttributeOp(target, bindingKind, name, expression) {
8490
8512
  expression
8491
8513
  }, NEW_OP);
8492
8514
  }
8493
- function createDeferOp(xref, main, sourceSpan) {
8494
- return __spreadValues(__spreadValues(__spreadValues({
8515
+ function createDeferOp(xref, main, mainSlot, sourceSpan) {
8516
+ return __spreadProps(__spreadValues(__spreadValues({
8495
8517
  kind: OpKind.Defer,
8496
8518
  xref,
8497
- target: main,
8498
- loading: null,
8499
- placeholder: null,
8500
- error: null,
8519
+ handle: new SlotHandle(),
8520
+ mainView: main,
8521
+ mainSlot,
8522
+ loadingView: null,
8523
+ loadingSlot: null,
8524
+ loadingConfig: null,
8525
+ loadingMinimumTime: null,
8526
+ loadingAfterTime: null,
8527
+ placeholderView: null,
8528
+ placeholderSlot: null,
8529
+ placeholderConfig: null,
8530
+ placeholderMinimumTime: null,
8531
+ errorView: null,
8532
+ errorSlot: null,
8501
8533
  sourceSpan
8502
- }, NEW_OP), TRAIT_CONSUMES_SLOT), TRAIT_USES_SLOT_INDEX);
8534
+ }, NEW_OP), TRAIT_CONSUMES_SLOT), {
8535
+ numSlotsUsed: 2
8536
+ });
8503
8537
  }
8504
- function createDeferSecondaryOp(deferOp, secondaryView, secondaryBlockKind) {
8505
- return __spreadValues(__spreadValues(__spreadValues({
8506
- kind: OpKind.DeferSecondaryBlock,
8507
- deferOp,
8508
- target: secondaryView,
8509
- secondaryBlockKind,
8510
- constValue: null,
8511
- makeExpression: literalOrArrayLiteral
8512
- }, NEW_OP), TRAIT_USES_SLOT_INDEX), TRAIT_HAS_CONST);
8513
- }
8514
- function createDeferOnOp(xref, sourceSpan) {
8515
- return __spreadValues(__spreadValues({
8538
+ function createDeferOnOp(defer2, trigger, prefetch, sourceSpan) {
8539
+ return __spreadValues({
8516
8540
  kind: OpKind.DeferOn,
8517
- xref,
8541
+ defer: defer2,
8542
+ trigger,
8543
+ prefetch,
8518
8544
  sourceSpan
8519
- }, NEW_OP), TRAIT_CONSUMES_SLOT);
8545
+ }, NEW_OP);
8520
8546
  }
8521
- function createExtractedMessageOp(owner, expression, statements) {
8547
+ function createExtractedMessageOp(owner, message, isRoot) {
8522
8548
  return __spreadValues({
8523
8549
  kind: OpKind.ExtractedMessage,
8524
8550
  owner,
8525
- expression,
8526
- statements
8551
+ message,
8552
+ isRoot,
8553
+ params: /* @__PURE__ */ new Map(),
8554
+ postprocessingParams: /* @__PURE__ */ new Map(),
8555
+ needsPostprocessing: false,
8556
+ formattedParams: null,
8557
+ formattedPostprocessingParams: null
8527
8558
  }, NEW_OP);
8528
8559
  }
8529
8560
  function createI18nStartOp(xref, message, root) {
8530
8561
  return __spreadValues(__spreadValues({
8531
8562
  kind: OpKind.I18nStart,
8532
8563
  xref,
8564
+ handle: new SlotHandle(),
8533
8565
  root: root != null ? root : xref,
8534
8566
  message,
8535
- params: /* @__PURE__ */ new Map(),
8536
- postprocessingParams: /* @__PURE__ */ new Map(),
8537
8567
  messageIndex: null,
8538
- subTemplateIndex: null,
8539
- needsPostprocessing: false
8568
+ subTemplateIndex: null
8540
8569
  }, NEW_OP), TRAIT_CONSUMES_SLOT);
8541
8570
  }
8542
8571
  function createI18nEndOp(xref) {
@@ -8553,14 +8582,8 @@ function createIcuOp(xref, message, sourceSpan) {
8553
8582
  sourceSpan
8554
8583
  }, NEW_OP);
8555
8584
  }
8556
- function literalOrArrayLiteral(value) {
8557
- if (Array.isArray(value)) {
8558
- return literalArr(value.map(literalOrArrayLiteral));
8559
- }
8560
- return literal(value, INFERRED_TYPE);
8561
- }
8562
8585
 
8563
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/host.mjs
8586
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/ops/host.mjs
8564
8587
  function createHostPropertyOp(name, expression, isAnimationTrigger, sourceSpan) {
8565
8588
  return __spreadValues(__spreadValues({
8566
8589
  kind: OpKind.HostProperty,
@@ -8571,10 +8594,10 @@ function createHostPropertyOp(name, expression, isAnimationTrigger, sourceSpan)
8571
8594
  }, TRAIT_CONSUMES_VARS), NEW_OP);
8572
8595
  }
8573
8596
 
8574
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/variable.mjs
8597
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/ir/src/variable.mjs
8575
8598
  var CTX_REF = "CTX_REF_MARKER";
8576
8599
 
8577
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/compilation.mjs
8600
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/compilation.mjs
8578
8601
  var CompilationJobKind;
8579
8602
  (function(CompilationJobKind2) {
8580
8603
  CompilationJobKind2[CompilationJobKind2["Tmpl"] = 0] = "Tmpl";
@@ -8680,8 +8703,8 @@ var HostBindingCompilationUnit = class extends CompilationUnit {
8680
8703
  }
8681
8704
  };
8682
8705
 
8683
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/any_cast.mjs
8684
- function phaseFindAnyCasts(job) {
8706
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/any_cast.mjs
8707
+ function deleteAnyCasts(job) {
8685
8708
  for (const unit of job.units) {
8686
8709
  for (const op of unit.ops()) {
8687
8710
  transformExpressionsInOp(op, removeAnys, VisitorContextFlag.None);
@@ -8698,12 +8721,12 @@ function removeAnys(e) {
8698
8721
  return e;
8699
8722
  }
8700
8723
 
8701
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/apply_i18n_expressions.mjs
8702
- function phaseApplyI18nExpressions(job) {
8724
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/apply_i18n_expressions.mjs
8725
+ function applyI18nExpressions(job) {
8703
8726
  for (const unit of job.units) {
8704
8727
  for (const op of unit.update) {
8705
8728
  if (op.kind === OpKind.I18nExpression && needsApplication(op)) {
8706
- OpList.insertAfter(createI18nApplyOp(op.owner, null), op);
8729
+ OpList.insertAfter(createI18nApplyOp(op.owner, op.ownerSlot, null), op);
8707
8730
  }
8708
8731
  }
8709
8732
  }
@@ -8719,8 +8742,8 @@ function needsApplication(op) {
8719
8742
  return false;
8720
8743
  }
8721
8744
 
8722
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/assign_i18n_slot_dependencies.mjs
8723
- function phaseAssignI18nSlotDependencies(job) {
8745
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/assign_i18n_slot_dependencies.mjs
8746
+ function assignI18nSlotDependencies(job) {
8724
8747
  const i18nLastSlotConsumers = /* @__PURE__ */ new Map();
8725
8748
  let lastSlotConsumer = null;
8726
8749
  for (const unit of job.units) {
@@ -8740,19 +8763,7 @@ function phaseAssignI18nSlotDependencies(job) {
8740
8763
  }
8741
8764
  }
8742
8765
 
8743
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/collapse_singleton_interpolations.mjs
8744
- function phaseCollapseSingletonInterpolations(job) {
8745
- for (const unit of job.units) {
8746
- for (const op of unit.update) {
8747
- const eligibleOpKind = op.kind === OpKind.Attribute;
8748
- if (eligibleOpKind && op.expression instanceof Interpolation2 && op.expression.strings.length === 2 && op.expression.strings.every((s) => s === "")) {
8749
- op.expression = op.expression.expressions[0];
8750
- }
8751
- }
8752
- }
8753
- }
8754
-
8755
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/util/elements.mjs
8766
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/util/elements.mjs
8756
8767
  function createOpXrefMap(unit) {
8757
8768
  const map = /* @__PURE__ */ new Map();
8758
8769
  for (const op of unit.create) {
@@ -8764,8 +8775,8 @@ function createOpXrefMap(unit) {
8764
8775
  return map;
8765
8776
  }
8766
8777
 
8767
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/attribute_extraction.mjs
8768
- function phaseAttributeExtraction(job) {
8778
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/attribute_extraction.mjs
8779
+ function extractAttributes(job) {
8769
8780
  for (const unit of job.units) {
8770
8781
  const elements = createOpXrefMap(unit);
8771
8782
  for (const op of unit.ops()) {
@@ -8831,7 +8842,7 @@ function extractAttributeOp(unit, op, elements) {
8831
8842
  }
8832
8843
  }
8833
8844
 
8834
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/binding_specialization.mjs
8845
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/binding_specialization.mjs
8835
8846
  function lookupElement2(elements, xref) {
8836
8847
  const el = elements.get(xref);
8837
8848
  if (el === void 0) {
@@ -8839,7 +8850,7 @@ function lookupElement2(elements, xref) {
8839
8850
  }
8840
8851
  return el;
8841
8852
  }
8842
- function phaseBindingSpecialization(job) {
8853
+ function specializeBindings(job) {
8843
8854
  const elements = /* @__PURE__ */ new Map();
8844
8855
  for (const unit of job.units) {
8845
8856
  for (const op of unit.create) {
@@ -8881,7 +8892,7 @@ function phaseBindingSpecialization(job) {
8881
8892
  }
8882
8893
  }
8883
8894
 
8884
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/chaining.mjs
8895
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/chaining.mjs
8885
8896
  var CHAINABLE = /* @__PURE__ */ new Set([
8886
8897
  Identifiers.attribute,
8887
8898
  Identifiers.classProp,
@@ -8910,35 +8921,35 @@ var CHAINABLE = /* @__PURE__ */ new Set([
8910
8921
  Identifiers.syntheticHostProperty,
8911
8922
  Identifiers.templateCreate
8912
8923
  ]);
8913
- function phaseChaining(job) {
8924
+ function chain(job) {
8914
8925
  for (const unit of job.units) {
8915
8926
  chainOperationsInList(unit.create);
8916
8927
  chainOperationsInList(unit.update);
8917
8928
  }
8918
8929
  }
8919
8930
  function chainOperationsInList(opList) {
8920
- let chain = null;
8931
+ let chain2 = null;
8921
8932
  for (const op of opList) {
8922
8933
  if (op.kind !== OpKind.Statement || !(op.statement instanceof ExpressionStatement)) {
8923
- chain = null;
8934
+ chain2 = null;
8924
8935
  continue;
8925
8936
  }
8926
8937
  if (!(op.statement.expr instanceof InvokeFunctionExpr) || !(op.statement.expr.fn instanceof ExternalExpr)) {
8927
- chain = null;
8938
+ chain2 = null;
8928
8939
  continue;
8929
8940
  }
8930
8941
  const instruction = op.statement.expr.fn.value;
8931
8942
  if (!CHAINABLE.has(instruction)) {
8932
- chain = null;
8943
+ chain2 = null;
8933
8944
  continue;
8934
8945
  }
8935
- if (chain !== null && chain.instruction === instruction) {
8936
- const expression = chain.expression.callFn(op.statement.expr.args, op.statement.expr.sourceSpan, op.statement.expr.pure);
8937
- chain.expression = expression;
8938
- chain.op.statement = expression.toStmt();
8946
+ if (chain2 !== null && chain2.instruction === instruction) {
8947
+ const expression = chain2.expression.callFn(op.statement.expr.args, op.statement.expr.sourceSpan, op.statement.expr.pure);
8948
+ chain2.expression = expression;
8949
+ chain2.op.statement = expression.toStmt();
8939
8950
  OpList.remove(op);
8940
8951
  } else {
8941
- chain = {
8952
+ chain2 = {
8942
8953
  op,
8943
8954
  instruction,
8944
8955
  expression: op.statement.expr
@@ -8947,8 +8958,20 @@ function chainOperationsInList(opList) {
8947
8958
  }
8948
8959
  }
8949
8960
 
8950
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/conditionals.mjs
8951
- function phaseConditionals(job) {
8961
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/collapse_singleton_interpolations.mjs
8962
+ function collapseSingletonInterpolations(job) {
8963
+ for (const unit of job.units) {
8964
+ for (const op of unit.update) {
8965
+ const eligibleOpKind = op.kind === OpKind.Attribute;
8966
+ if (eligibleOpKind && op.expression instanceof Interpolation2 && op.expression.strings.length === 2 && op.expression.strings.every((s) => s === "")) {
8967
+ op.expression = op.expression.expressions[0];
8968
+ }
8969
+ }
8970
+ }
8971
+ }
8972
+
8973
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/conditionals.mjs
8974
+ function generateConditionalExpressions(job) {
8952
8975
  for (const unit of job.units) {
8953
8976
  for (const op of unit.ops()) {
8954
8977
  if (op.kind !== OpKind.Conditional) {
@@ -8957,8 +8980,8 @@ function phaseConditionals(job) {
8957
8980
  let test;
8958
8981
  const defaultCase = op.conditions.findIndex((cond) => cond.expr === null);
8959
8982
  if (defaultCase >= 0) {
8960
- const xref = op.conditions.splice(defaultCase, 1)[0].target;
8961
- test = new SlotLiteralExpr(xref);
8983
+ const slot = op.conditions.splice(defaultCase, 1)[0].targetSlot;
8984
+ test = new SlotLiteralExpr(slot);
8962
8985
  } else {
8963
8986
  test = literal(-1);
8964
8987
  }
@@ -8976,7 +8999,7 @@ function phaseConditionals(job) {
8976
8999
  conditionalCase.expr = new AssignTemporaryExpr(conditionalCase.expr, caseExpressionTemporaryXref);
8977
9000
  op.contextValue = new ReadTemporaryExpr(caseExpressionTemporaryXref);
8978
9001
  }
8979
- test = new ConditionalExpr(conditionalCase.expr, new SlotLiteralExpr(conditionalCase.target), test);
9002
+ test = new ConditionalExpr(conditionalCase.expr, new SlotLiteralExpr(conditionalCase.targetSlot), test);
8980
9003
  }
8981
9004
  op.processed = test;
8982
9005
  op.conditions = [];
@@ -8984,7 +9007,7 @@ function phaseConditionals(job) {
8984
9007
  }
8985
9008
  }
8986
9009
 
8987
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/tags.mjs
9010
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/tags.mjs
8988
9011
  var TagContentType;
8989
9012
  (function(TagContentType2) {
8990
9013
  TagContentType2[TagContentType2["RAW_TEXT"] = 0] = "RAW_TEXT";
@@ -9017,7 +9040,7 @@ function mergeNsAndName(prefix, localName) {
9017
9040
  return prefix ? `:${prefix}:${localName}` : localName;
9018
9041
  }
9019
9042
 
9020
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/conversion.mjs
9043
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/conversion.mjs
9021
9044
  var BINARY_OPERATORS = /* @__PURE__ */ new Map([
9022
9045
  ["&&", BinaryOperator.And],
9023
9046
  [">", BinaryOperator.Bigger],
@@ -9060,15 +9083,15 @@ function prefixWithNamespace(strippedTag, namespace) {
9060
9083
  }
9061
9084
  return `:${keyForNamespace(namespace)}:${strippedTag}`;
9062
9085
  }
9063
- function literalOrArrayLiteral2(value) {
9086
+ function literalOrArrayLiteral(value) {
9064
9087
  if (Array.isArray(value)) {
9065
- return literalArr(value.map(literalOrArrayLiteral2));
9088
+ return literalArr(value.map(literalOrArrayLiteral));
9066
9089
  }
9067
- return literal(value, INFERRED_TYPE);
9090
+ return literal(value);
9068
9091
  }
9069
9092
 
9070
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/const_collection.mjs
9071
- function phaseConstCollection(job) {
9093
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/const_collection.mjs
9094
+ function collectElementConsts(job) {
9072
9095
  const allElementAttributes = /* @__PURE__ */ new Map();
9073
9096
  for (const unit of job.units) {
9074
9097
  for (const op of unit.create) {
@@ -9181,7 +9204,7 @@ function serializeAttributes({ attributes, bindings, classes, i18n: i18n2, proje
9181
9204
  const attrArray = [...attributes];
9182
9205
  if (projectAs !== null) {
9183
9206
  const parsedR3Selector = parseSelectorToR3Selector(projectAs)[0];
9184
- attrArray.push(literal(5), literalOrArrayLiteral2(parsedR3Selector));
9207
+ attrArray.push(literal(5), literalOrArrayLiteral(parsedR3Selector));
9185
9208
  }
9186
9209
  if (classes.length > 0) {
9187
9210
  attrArray.push(literal(1), ...classes);
@@ -9201,52 +9224,147 @@ function serializeAttributes({ attributes, bindings, classes, i18n: i18n2, proje
9201
9224
  return literalArr(attrArray);
9202
9225
  }
9203
9226
 
9204
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/empty_elements.mjs
9205
- var REPLACEMENTS = /* @__PURE__ */ new Map([
9206
- [OpKind.ElementEnd, [OpKind.ElementStart, OpKind.Element]],
9207
- [OpKind.ContainerEnd, [OpKind.ContainerStart, OpKind.Container]],
9208
- [OpKind.I18nEnd, [OpKind.I18nStart, OpKind.I18n]]
9209
- ]);
9210
- var IGNORED_OP_KINDS = /* @__PURE__ */ new Set([OpKind.Pipe]);
9211
- function phaseEmptyElements(job) {
9227
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/defer_configs.mjs
9228
+ function configureDeferInstructions(job) {
9212
9229
  for (const unit of job.units) {
9213
9230
  for (const op of unit.create) {
9214
- const opReplacements = REPLACEMENTS.get(op.kind);
9215
- if (opReplacements === void 0) {
9231
+ if (op.kind !== OpKind.Defer) {
9216
9232
  continue;
9217
9233
  }
9218
- const [startKind, mergedKind] = opReplacements;
9219
- let prevOp = op.prev;
9220
- while (prevOp !== null && IGNORED_OP_KINDS.has(prevOp.kind)) {
9221
- prevOp = prevOp.prev;
9234
+ if (op.placeholderMinimumTime !== null) {
9235
+ op.placeholderConfig = new ConstCollectedExpr(literalOrArrayLiteral([op.placeholderMinimumTime]));
9222
9236
  }
9223
- if (prevOp !== null && prevOp.kind === startKind) {
9224
- prevOp.kind = mergedKind;
9225
- OpList.remove(op);
9237
+ if (op.loadingMinimumTime !== null || op.loadingAfterTime !== null) {
9238
+ op.loadingConfig = new ConstCollectedExpr(literalOrArrayLiteral([op.loadingMinimumTime, op.loadingAfterTime]));
9226
9239
  }
9227
9240
  }
9228
9241
  }
9229
9242
  }
9230
9243
 
9231
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/expand_safe_reads.mjs
9232
- function phaseExpandSafeReads(job) {
9233
- for (const unit of job.units) {
9234
- for (const op of unit.ops()) {
9235
- transformExpressionsInOp(op, (e) => safeTransform(e, { job }), VisitorContextFlag.None);
9236
- transformExpressionsInOp(op, ternaryTransform, VisitorContextFlag.None);
9244
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/defer_resolve_targets.mjs
9245
+ function resolveDeferTargetNames(job) {
9246
+ const scopes = /* @__PURE__ */ new Map();
9247
+ function getScopeForView2(view) {
9248
+ if (scopes.has(view.xref)) {
9249
+ return scopes.get(view.xref);
9250
+ }
9251
+ const scope = new Scope();
9252
+ for (const op of view.create) {
9253
+ if (!isElementOrContainerOp(op) || op.localRefs === null) {
9254
+ continue;
9255
+ }
9256
+ if (!Array.isArray(op.localRefs)) {
9257
+ throw new Error("LocalRefs were already processed, but were needed to resolve defer targets.");
9258
+ }
9259
+ for (const ref of op.localRefs) {
9260
+ if (ref.target !== "") {
9261
+ continue;
9262
+ }
9263
+ scope.targets.set(ref.name, { xref: op.xref, slot: op.handle });
9264
+ }
9237
9265
  }
9266
+ scopes.set(view.xref, scope);
9267
+ return scope;
9238
9268
  }
9239
- }
9240
- var requiresTemporary = [
9241
- InvokeFunctionExpr,
9242
- LiteralArrayExpr,
9243
- LiteralMapExpr,
9244
- SafeInvokeFunctionExpr,
9245
- PipeBindingExpr
9246
- ].map((e) => e.constructor.name);
9247
- function needsTemporaryInSafeAccess(e) {
9248
- if (e instanceof UnaryOperatorExpr) {
9249
- return needsTemporaryInSafeAccess(e.expr);
9269
+ function resolveTrigger(deferOwnerView, op, placeholderView) {
9270
+ switch (op.trigger.kind) {
9271
+ case DeferTriggerKind.Idle:
9272
+ case DeferTriggerKind.Immediate:
9273
+ case DeferTriggerKind.Timer:
9274
+ return;
9275
+ case DeferTriggerKind.Hover:
9276
+ case DeferTriggerKind.Interaction:
9277
+ case DeferTriggerKind.Viewport:
9278
+ if (op.trigger.targetName === null) {
9279
+ return;
9280
+ }
9281
+ let view = placeholderView !== null ? job.views.get(placeholderView) : deferOwnerView;
9282
+ let step = placeholderView !== null ? -1 : 0;
9283
+ while (view !== null) {
9284
+ const scope = getScopeForView2(view);
9285
+ if (scope.targets.has(op.trigger.targetName)) {
9286
+ const { xref, slot } = scope.targets.get(op.trigger.targetName);
9287
+ op.trigger.targetXref = xref;
9288
+ op.trigger.targetView = view.xref;
9289
+ op.trigger.targetSlotViewSteps = step;
9290
+ op.trigger.targetSlot = slot;
9291
+ return;
9292
+ }
9293
+ view = view.parent !== null ? job.views.get(view.parent) : null;
9294
+ step++;
9295
+ }
9296
+ break;
9297
+ default:
9298
+ throw new Error(`Trigger kind ${op.trigger.kind} not handled`);
9299
+ }
9300
+ }
9301
+ for (const unit of job.units) {
9302
+ const defers = /* @__PURE__ */ new Map();
9303
+ for (const op of unit.create) {
9304
+ switch (op.kind) {
9305
+ case OpKind.Defer:
9306
+ defers.set(op.xref, op);
9307
+ break;
9308
+ case OpKind.DeferOn:
9309
+ const deferOp = defers.get(op.defer);
9310
+ resolveTrigger(unit, op, deferOp.placeholderView);
9311
+ break;
9312
+ }
9313
+ }
9314
+ }
9315
+ }
9316
+ var Scope = class {
9317
+ constructor() {
9318
+ this.targets = /* @__PURE__ */ new Map();
9319
+ }
9320
+ };
9321
+
9322
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/empty_elements.mjs
9323
+ var REPLACEMENTS = /* @__PURE__ */ new Map([
9324
+ [OpKind.ElementEnd, [OpKind.ElementStart, OpKind.Element]],
9325
+ [OpKind.ContainerEnd, [OpKind.ContainerStart, OpKind.Container]],
9326
+ [OpKind.I18nEnd, [OpKind.I18nStart, OpKind.I18n]]
9327
+ ]);
9328
+ var IGNORED_OP_KINDS = /* @__PURE__ */ new Set([OpKind.Pipe]);
9329
+ function collapseEmptyInstructions(job) {
9330
+ for (const unit of job.units) {
9331
+ for (const op of unit.create) {
9332
+ const opReplacements = REPLACEMENTS.get(op.kind);
9333
+ if (opReplacements === void 0) {
9334
+ continue;
9335
+ }
9336
+ const [startKind, mergedKind] = opReplacements;
9337
+ let prevOp = op.prev;
9338
+ while (prevOp !== null && IGNORED_OP_KINDS.has(prevOp.kind)) {
9339
+ prevOp = prevOp.prev;
9340
+ }
9341
+ if (prevOp !== null && prevOp.kind === startKind) {
9342
+ prevOp.kind = mergedKind;
9343
+ OpList.remove(op);
9344
+ }
9345
+ }
9346
+ }
9347
+ }
9348
+
9349
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/expand_safe_reads.mjs
9350
+ function expandSafeReads(job) {
9351
+ for (const unit of job.units) {
9352
+ for (const op of unit.ops()) {
9353
+ transformExpressionsInOp(op, (e) => safeTransform(e, { job }), VisitorContextFlag.None);
9354
+ transformExpressionsInOp(op, ternaryTransform, VisitorContextFlag.None);
9355
+ }
9356
+ }
9357
+ }
9358
+ var requiresTemporary = [
9359
+ InvokeFunctionExpr,
9360
+ LiteralArrayExpr,
9361
+ LiteralMapExpr,
9362
+ SafeInvokeFunctionExpr,
9363
+ PipeBindingExpr
9364
+ ].map((e) => e.constructor.name);
9365
+ function needsTemporaryInSafeAccess(e) {
9366
+ if (e instanceof UnaryOperatorExpr) {
9367
+ return needsTemporaryInSafeAccess(e.expr);
9250
9368
  } else if (e instanceof BinaryOperatorExpr) {
9251
9369
  return needsTemporaryInSafeAccess(e.lhs) || needsTemporaryInSafeAccess(e.rhs);
9252
9370
  } else if (e instanceof ConditionalExpr) {
@@ -9364,49 +9482,79 @@ function ternaryTransform(e) {
9364
9482
  return new ConditionalExpr(new BinaryOperatorExpr(BinaryOperator.Equals, e.guard, NULL_EXPR), NULL_EXPR, e.expr);
9365
9483
  }
9366
9484
 
9367
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/repeater_derived_vars.mjs
9368
- function phaseRepeaterDerivedVars(job) {
9369
- const repeaters = /* @__PURE__ */ new Map();
9485
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/format_i18n_params.mjs
9486
+ var ESCAPE = "\uFFFD";
9487
+ var ELEMENT_MARKER = "#";
9488
+ var TEMPLATE_MARKER = "*";
9489
+ var TAG_CLOSE_MARKER = "/";
9490
+ var CONTEXT_MARKER = ":";
9491
+ var LIST_START_MARKER = "[";
9492
+ var LIST_END_MARKER = "]";
9493
+ var LIST_DELIMITER = "|";
9494
+ function formatI18nParams(job) {
9370
9495
  for (const unit of job.units) {
9371
- for (const op of unit.ops()) {
9372
- if (op.kind === OpKind.RepeaterCreate) {
9373
- repeaters.set(op.xref, op);
9496
+ for (const op of unit.create) {
9497
+ if (op.kind === OpKind.ExtractedMessage) {
9498
+ if (op.isRoot) {
9499
+ op.formattedParams = formatParams(op.params);
9500
+ op.formattedPostprocessingParams = formatParams(op.postprocessingParams);
9501
+ op.needsPostprocessing = op.postprocessingParams.size > 0;
9502
+ for (const [param, values] of op.params) {
9503
+ if (values.length > 1) {
9504
+ op.needsPostprocessing = true;
9505
+ }
9506
+ }
9507
+ }
9374
9508
  }
9375
9509
  }
9376
9510
  }
9377
- for (const unit of job.units) {
9378
- for (const op of unit.ops()) {
9379
- transformExpressionsInOp(op, (expr) => {
9380
- if (!(expr instanceof DerivedRepeaterVarExpr)) {
9381
- return expr;
9382
- }
9383
- const repeaterOp = repeaters.get(expr.xref);
9384
- switch (expr.identity) {
9385
- case DerivedRepeaterVarIdentity.First:
9386
- return new BinaryOperatorExpr(BinaryOperator.Identical, new LexicalReadExpr(repeaterOp.varNames.$index), literal(0));
9387
- case DerivedRepeaterVarIdentity.Last:
9388
- return new BinaryOperatorExpr(BinaryOperator.Identical, new LexicalReadExpr(repeaterOp.varNames.$index), new BinaryOperatorExpr(BinaryOperator.Minus, new LexicalReadExpr(repeaterOp.varNames.$count), literal(1)));
9389
- case DerivedRepeaterVarIdentity.Even:
9390
- return new BinaryOperatorExpr(BinaryOperator.Identical, new BinaryOperatorExpr(BinaryOperator.Modulo, new LexicalReadExpr(repeaterOp.varNames.$index), literal(2)), literal(0));
9391
- case DerivedRepeaterVarIdentity.Odd:
9392
- return new BinaryOperatorExpr(BinaryOperator.NotIdentical, new BinaryOperatorExpr(BinaryOperator.Modulo, new LexicalReadExpr(repeaterOp.varNames.$index), literal(2)), literal(0));
9393
- }
9394
- }, VisitorContextFlag.None);
9511
+ }
9512
+ function formatParams(params) {
9513
+ const result = /* @__PURE__ */ new Map();
9514
+ for (const [placeholder, placeholderValues] of [...params].sort()) {
9515
+ const serializedValues = formatParamValues(placeholderValues);
9516
+ if (serializedValues !== null) {
9517
+ result.set(placeholder, literal(formatParamValues(placeholderValues)));
9395
9518
  }
9396
9519
  }
9520
+ return result;
9521
+ }
9522
+ function formatParamValues(values) {
9523
+ if (values.length === 0) {
9524
+ return null;
9525
+ }
9526
+ const serializedValues = values.map((value) => formatValue(value));
9527
+ return serializedValues.length === 1 ? serializedValues[0] : `${LIST_START_MARKER}${serializedValues.join(LIST_DELIMITER)}${LIST_END_MARKER}`;
9528
+ }
9529
+ function formatValue(value) {
9530
+ let tagMarker = "";
9531
+ let closeMarker = "";
9532
+ if (value.flags & I18nParamValueFlags.ElementTag) {
9533
+ tagMarker = ELEMENT_MARKER;
9534
+ } else if (value.flags & I18nParamValueFlags.TemplateTag) {
9535
+ tagMarker = TEMPLATE_MARKER;
9536
+ }
9537
+ if (tagMarker !== "") {
9538
+ closeMarker = value.flags & I18nParamValueFlags.CloseTag ? TAG_CLOSE_MARKER : "";
9539
+ }
9540
+ const context = value.subTemplateIndex === null ? "" : `${CONTEXT_MARKER}${value.subTemplateIndex}`;
9541
+ if (value.flags & I18nParamValueFlags.OpenTag && value.flags & I18nParamValueFlags.CloseTag) {
9542
+ return `${ESCAPE}${tagMarker}${value.value}${context}${ESCAPE}${ESCAPE}${closeMarker}${tagMarker}${value.value}${context}${ESCAPE}`;
9543
+ }
9544
+ return `${ESCAPE}${closeMarker}${tagMarker}${value.value}${context}${ESCAPE}`;
9397
9545
  }
9398
9546
 
9399
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_advance.mjs
9400
- function phaseGenerateAdvance(job) {
9547
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_advance.mjs
9548
+ function generateAdvance(job) {
9401
9549
  for (const unit of job.units) {
9402
9550
  const slotMap = /* @__PURE__ */ new Map();
9403
9551
  for (const op of unit.create) {
9404
9552
  if (!hasConsumesSlotTrait(op)) {
9405
9553
  continue;
9406
- } else if (op.slot === null) {
9554
+ } else if (op.handle.slot === null) {
9407
9555
  throw new Error(`AssertionError: expected slots to have been allocated before generating advance() calls`);
9408
9556
  }
9409
- slotMap.set(op.xref, op.slot);
9557
+ slotMap.set(op.xref, op.handle.slot);
9410
9558
  }
9411
9559
  let slotContext = 0;
9412
9560
  for (const op of unit.update) {
@@ -9428,8 +9576,8 @@ function phaseGenerateAdvance(job) {
9428
9576
  }
9429
9577
  }
9430
9578
 
9431
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_projection_def.mjs
9432
- function phaseGenerateProjectionDef(job) {
9579
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_projection_def.mjs
9580
+ function generateProjectionDefs(job) {
9433
9581
  const share = job.compatibility === CompatibilityMode.TemplateDefinitionBuilder;
9434
9582
  const selectors = [];
9435
9583
  let projectionSlotIndex = 0;
@@ -9445,15 +9593,15 @@ function phaseGenerateProjectionDef(job) {
9445
9593
  let defExpr = null;
9446
9594
  if (selectors.length > 1 || selectors[0] !== "*") {
9447
9595
  const def = selectors.map((s) => s === "*" ? s : parseSelectorToR3Selector(s));
9448
- defExpr = job.pool.getConstLiteral(literalOrArrayLiteral2(def), share);
9596
+ defExpr = job.pool.getConstLiteral(literalOrArrayLiteral(def), share);
9449
9597
  }
9450
- job.contentSelectors = job.pool.getConstLiteral(literalOrArrayLiteral2(selectors), share);
9598
+ job.contentSelectors = job.pool.getConstLiteral(literalOrArrayLiteral(selectors), share);
9451
9599
  job.root.create.prepend([createProjectionDefOp(defExpr)]);
9452
9600
  }
9453
9601
  }
9454
9602
 
9455
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_variables.mjs
9456
- function phaseGenerateVariables(job) {
9603
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/generate_variables.mjs
9604
+ function generateVariables(job) {
9457
9605
  recursivelyProcessView(job.root, null);
9458
9606
  }
9459
9607
  function recursivelyProcessView(view, parentScope) {
@@ -9503,6 +9651,7 @@ function getScopeForView(view, parent) {
9503
9651
  scope.references.push({
9504
9652
  name: op.localRefs[offset].name,
9505
9653
  targetId: op.xref,
9654
+ targetSlot: op.handle,
9506
9655
  offset,
9507
9656
  variable: {
9508
9657
  kind: SemanticVariableKind.Identifier,
@@ -9531,7 +9680,7 @@ function generateVariablesInScopeForView(view, scope) {
9531
9680
  newOps.push(createVariableOp(view.job.allocateXrefId(), alias, alias.expression.clone(), VariableFlags.AlwaysInline));
9532
9681
  }
9533
9682
  for (const ref of scope.references) {
9534
- newOps.push(createVariableOp(view.job.allocateXrefId(), ref.variable, new ReferenceExpr(ref.targetId, ref.offset), VariableFlags.None));
9683
+ newOps.push(createVariableOp(view.job.allocateXrefId(), ref.variable, new ReferenceExpr(ref.targetId, ref.targetSlot, ref.offset), VariableFlags.None));
9535
9684
  }
9536
9685
  if (scope.parent !== null) {
9537
9686
  newOps.push(...generateVariablesInScopeForView(view, scope.parent));
@@ -9539,34 +9688,27 @@ function generateVariablesInScopeForView(view, scope) {
9539
9688
  return newOps;
9540
9689
  }
9541
9690
 
9542
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/has_const_trait_collection.mjs
9543
- function phaseConstTraitCollection(job) {
9544
- const collectGlobalConsts = (e) => {
9545
- if (e instanceof ExpressionBase && hasConstTrait(e)) {
9546
- const ea = e;
9547
- if (ea.constValue !== null) {
9548
- ea.constIndex = job.addConst(ea.constValue);
9549
- }
9550
- }
9551
- return e;
9552
- };
9691
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/has_const_expression_collection.mjs
9692
+ function collectConstExpressions(job) {
9553
9693
  for (const unit of job.units) {
9554
9694
  for (const op of unit.ops()) {
9555
- if (hasConstTrait(op) && op.constValue !== null) {
9556
- op.constIndex = job.addConst(op.makeExpression(op.constValue));
9557
- }
9558
- transformExpressionsInOp(op, collectGlobalConsts, VisitorContextFlag.None);
9695
+ transformExpressionsInOp(op, (expr) => {
9696
+ if (!(expr instanceof ConstCollectedExpr)) {
9697
+ return expr;
9698
+ }
9699
+ return literal(job.addConst(expr.expr));
9700
+ }, VisitorContextFlag.None);
9559
9701
  }
9560
9702
  }
9561
9703
  }
9562
9704
 
9563
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/host_style_property_parsing.mjs
9705
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/host_style_property_parsing.mjs
9564
9706
  var STYLE_DOT = "style.";
9565
9707
  var CLASS_DOT = "class.";
9566
9708
  var STYLE_BANG = "style!";
9567
9709
  var CLASS_BANG = "class!";
9568
9710
  var BANG_IMPORTANT = "!important";
9569
- function phaseHostStylePropertyParsing(job) {
9711
+ function parseHostStyleProperties(job) {
9570
9712
  for (const op of job.root.update) {
9571
9713
  if (op.kind !== OpKind.Binding) {
9572
9714
  continue;
@@ -9618,27 +9760,7 @@ function parseProperty(name) {
9618
9760
  return { property: property2, suffix };
9619
9761
  }
9620
9762
 
9621
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/i18n_const_collection.mjs
9622
- function phaseI18nConstCollection(job) {
9623
- const messageConstIndices = {};
9624
- for (const unit of job.units) {
9625
- for (const op of unit.create) {
9626
- if (op.kind === OpKind.ExtractedMessage) {
9627
- messageConstIndices[op.owner] = job.addConst(op.expression, op.statements);
9628
- OpList.remove(op);
9629
- }
9630
- }
9631
- }
9632
- for (const unit of job.units) {
9633
- for (const op of unit.create) {
9634
- if (op.kind === OpKind.I18nStart) {
9635
- op.messageIndex = messageConstIndices[op.root];
9636
- }
9637
- }
9638
- }
9639
- }
9640
-
9641
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/output/map_util.mjs
9763
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/output/map_util.mjs
9642
9764
  function mapLiteral(obj, quoted = false) {
9643
9765
  return literalMap(Object.keys(obj).map((key) => ({
9644
9766
  key,
@@ -9647,7 +9769,7 @@ function mapLiteral(obj, quoted = false) {
9647
9769
  })));
9648
9770
  }
9649
9771
 
9650
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/i18n/icu_serializer.mjs
9772
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/i18n/icu_serializer.mjs
9651
9773
  var IcuSerializerVisitor = class {
9652
9774
  visitText(text2) {
9653
9775
  return text2.value;
@@ -9678,7 +9800,7 @@ function serializeIcuNode(icu) {
9678
9800
  return icu.visit(serializer);
9679
9801
  }
9680
9802
 
9681
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/expression_parser/lexer.mjs
9803
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/expression_parser/lexer.mjs
9682
9804
  var TokenType;
9683
9805
  (function(TokenType2) {
9684
9806
  TokenType2[TokenType2["Character"] = 0] = "Character";
@@ -10039,7 +10161,7 @@ function parseIntAutoRadix(text2) {
10039
10161
  return result;
10040
10162
  }
10041
10163
 
10042
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/expression_parser/parser.mjs
10164
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/expression_parser/parser.mjs
10043
10165
  var SplitInterpolation = class {
10044
10166
  constructor(strings, expressions, offsets) {
10045
10167
  this.strings = strings;
@@ -10933,7 +11055,7 @@ function getIndexMapForOriginalTemplate(interpolatedTokens) {
10933
11055
  return offsetMap;
10934
11056
  }
10935
11057
 
10936
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/ast.mjs
11058
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/ast.mjs
10937
11059
  var NodeWithI18n = class {
10938
11060
  constructor(sourceSpan, i18n2) {
10939
11061
  this.sourceSpan = sourceSpan;
@@ -11085,11 +11207,11 @@ var RecursiveVisitor = class {
11085
11207
  }
11086
11208
  };
11087
11209
 
11088
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/schema/element_schema_registry.mjs
11210
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/schema/element_schema_registry.mjs
11089
11211
  var ElementSchemaRegistry = class {
11090
11212
  };
11091
11213
 
11092
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/schema/dom_element_schema_registry.mjs
11214
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/schema/dom_element_schema_registry.mjs
11093
11215
  var BOOLEAN = "boolean";
11094
11216
  var NUMBER = "number";
11095
11217
  var STRING = "string";
@@ -11442,7 +11564,7 @@ function _isPixelDimensionStyle(prop) {
11442
11564
  }
11443
11565
  }
11444
11566
 
11445
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/html_tags.mjs
11567
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/html_tags.mjs
11446
11568
  var HtmlTagDefinition = class {
11447
11569
  constructor({ closedByChildren, implicitNamespacePrefix, contentType = TagContentType.PARSABLE_DATA, closedByParent = false, isVoid = false, ignoreFirstLf = false, preventNamespaceInheritance = false, canSelfClose = false } = {}) {
11448
11570
  this.closedByChildren = {};
@@ -11560,7 +11682,7 @@ function getHtmlTagDefinition(tagName) {
11560
11682
  return (_b2 = (_a2 = TAG_DEFINITIONS[tagName]) != null ? _a2 : TAG_DEFINITIONS[tagName.toLowerCase()]) != null ? _b2 : DEFAULT_TAG_DEFINITION;
11561
11683
  }
11562
11684
 
11563
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/serializers/placeholder.mjs
11685
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/serializers/placeholder.mjs
11564
11686
  var TAG_TO_PLACEHOLDER_NAMES = {
11565
11687
  "A": "LINK",
11566
11688
  "B": "BOLD_TEXT",
@@ -11654,7 +11776,7 @@ var PlaceholderRegistry = class {
11654
11776
  }
11655
11777
  };
11656
11778
 
11657
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/i18n_parser.mjs
11779
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/i18n_parser.mjs
11658
11780
  var _expParser = new Parser(new Lexer());
11659
11781
  function createI18nMessageFactory(interpolationConfig) {
11660
11782
  const visitor = new _I18nVisitor(_expParser, interpolationConfig);
@@ -11816,14 +11938,14 @@ function extractPlaceholderName(input) {
11816
11938
  return input.split(_CUSTOM_PH_EXP)[2];
11817
11939
  }
11818
11940
 
11819
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/parse_util.mjs
11941
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/parse_util.mjs
11820
11942
  var I18nError = class extends ParseError {
11821
11943
  constructor(span, msg) {
11822
11944
  super(span, msg);
11823
11945
  }
11824
11946
  };
11825
11947
 
11826
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/entities.mjs
11948
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/entities.mjs
11827
11949
  var NAMED_ENTITIES = {
11828
11950
  "AElig": "\xC6",
11829
11951
  "AMP": "&",
@@ -13954,7 +14076,7 @@ var NAMED_ENTITIES = {
13954
14076
  var NGSP_UNICODE = "\uE500";
13955
14077
  NAMED_ENTITIES["ngsp"] = NGSP_UNICODE;
13956
14078
 
13957
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/lexer.mjs
14079
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/lexer.mjs
13958
14080
  var TokenError = class extends ParseError {
13959
14081
  constructor(errorMsg, tokenType, span) {
13960
14082
  super(span, errorMsg);
@@ -14875,7 +14997,7 @@ var CursorError = class {
14875
14997
  }
14876
14998
  };
14877
14999
 
14878
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/parser.mjs
15000
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/parser.mjs
14879
15001
  var TreeError = class extends ParseError {
14880
15002
  static create(elementName, span, msg) {
14881
15003
  return new TreeError(elementName, span, msg);
@@ -15259,7 +15381,7 @@ function decodeEntity(match, entity) {
15259
15381
  return match;
15260
15382
  }
15261
15383
 
15262
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/schema/trusted_types_sinks.mjs
15384
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/schema/trusted_types_sinks.mjs
15263
15385
  var TRUSTED_TYPES_SINKS = /* @__PURE__ */ new Set([
15264
15386
  "iframe|srcdoc",
15265
15387
  "*|innerhtml",
@@ -15274,7 +15396,7 @@ function isTrustedTypesSink(tagName, propName) {
15274
15396
  return TRUSTED_TYPES_SINKS.has(tagName + "|" + propName) || TRUSTED_TYPES_SINKS.has("*|" + propName);
15275
15397
  }
15276
15398
 
15277
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/i18n/meta.mjs
15399
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/i18n/meta.mjs
15278
15400
  var setI18nRefs = (htmlNode, i18nNode) => {
15279
15401
  if (htmlNode instanceof NodeWithI18n) {
15280
15402
  if (i18nNode instanceof IcuPlaceholder && htmlNode.i18n instanceof Message) {
@@ -15430,7 +15552,7 @@ function i18nMetaToJSDoc(meta) {
15430
15552
  return jsDocComment(tags);
15431
15553
  }
15432
15554
 
15433
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/i18n/get_msg_utils.mjs
15555
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/i18n/get_msg_utils.mjs
15434
15556
  var GOOG_GET_MSG = "goog.getMsg";
15435
15557
  function createGoogleGetMsgStatements(variable2, message, closureVar, placeholderValues) {
15436
15558
  const messageString = serializeI18nMessageForGetMsg(message);
@@ -15478,7 +15600,7 @@ function serializeI18nMessageForGetMsg(message) {
15478
15600
  return message.nodes.map((node) => node.visit(serializerVisitor2, null)).join("");
15479
15601
  }
15480
15602
 
15481
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/i18n/localize_utils.mjs
15603
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/i18n/localize_utils.mjs
15482
15604
  function createLocalizeStatements(variable2, message, params) {
15483
15605
  const { messageParts, placeHolders } = serializeI18nMessageForLocalize(message);
15484
15606
  const sourceSpan = getSourceSpan(message);
@@ -15561,29 +15683,38 @@ function createEmptyMessagePart(location) {
15561
15683
  return new LiteralPiece("", new ParseSourceSpan(location, location));
15562
15684
  }
15563
15685
 
15564
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/i18n_message_extraction.mjs
15686
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/i18n_const_collection.mjs
15565
15687
  var NG_I18N_CLOSURE_MODE = "ngI18nClosureMode";
15566
15688
  var TRANSLATION_VAR_PREFIX2 = "i18n_";
15567
- function phaseI18nMessageExtraction(job) {
15689
+ function collectI18nConsts(job) {
15568
15690
  const fileBasedI18nSuffix = job.relativeContextFilePath.replace(/[^A-Za-z0-9]/g, "_").toUpperCase() + "_";
15691
+ const messageConstIndices = /* @__PURE__ */ new Map();
15569
15692
  for (const unit of job.units) {
15570
15693
  for (const op of unit.create) {
15571
- if (op.kind === OpKind.I18nStart) {
15572
- if (op.xref === op.root) {
15573
- const params = new Map([...op.params.entries()].sort());
15694
+ if (op.kind === OpKind.ExtractedMessage) {
15695
+ if (op.isRoot) {
15696
+ assertAllParamsResolved(op);
15574
15697
  const mainVar = variable(job.pool.uniqueName(TRANSLATION_VAR_PREFIX2));
15575
15698
  const closureVar = i18nGenerateClosureVar(job.pool, op.message.id, fileBasedI18nSuffix, job.i18nUseExternalIds);
15576
15699
  let transformFn = void 0;
15577
15700
  if (op.needsPostprocessing) {
15578
15701
  const extraTransformFnParams = [];
15579
- if (op.postprocessingParams.size > 0) {
15580
- extraTransformFnParams.push(literalMap([...op.postprocessingParams.entries()].map(([key, value]) => ({ key, value, quoted: true }))));
15702
+ if (op.formattedPostprocessingParams.size > 0) {
15703
+ extraTransformFnParams.push(literalMap([...op.formattedPostprocessingParams].map(([key, value]) => ({ key, value, quoted: true }))));
15581
15704
  }
15582
15705
  transformFn = (expr) => importExpr(Identifiers.i18nPostprocess).callFn([expr, ...extraTransformFnParams]);
15583
15706
  }
15584
- const statements = getTranslationDeclStmts(op.message, mainVar, closureVar, params, transformFn);
15585
- unit.create.push(createExtractedMessageOp(op.xref, mainVar, statements));
15707
+ const statements = getTranslationDeclStmts(op.message, mainVar, closureVar, op.formattedParams, transformFn);
15708
+ messageConstIndices.set(op.owner, job.addConst(mainVar, statements));
15586
15709
  }
15710
+ OpList.remove(op);
15711
+ }
15712
+ }
15713
+ }
15714
+ for (const unit of job.units) {
15715
+ for (const op of unit.create) {
15716
+ if (op.kind === OpKind.I18nStart) {
15717
+ op.messageIndex = messageConstIndices.get(op.root);
15587
15718
  }
15588
15719
  }
15589
15720
  }
@@ -15615,24 +15746,53 @@ function i18nGenerateClosureVar(pool, messageId, fileBasedI18nSuffix, useExterna
15615
15746
  }
15616
15747
  return variable(name);
15617
15748
  }
15749
+ function assertAllParamsResolved(op) {
15750
+ if (op.formattedParams === null || op.formattedPostprocessingParams === null) {
15751
+ throw Error("Params should have been formatted.");
15752
+ }
15753
+ for (const placeholder in op.message.placeholders) {
15754
+ if (!op.formattedParams.has(placeholder) && !op.formattedPostprocessingParams.has(placeholder)) {
15755
+ throw Error(`Failed to resolve i18n placeholder: ${placeholder}`);
15756
+ }
15757
+ }
15758
+ for (const placeholder in op.message.placeholderToMessage) {
15759
+ if (!op.formattedParams.has(placeholder) && !op.formattedPostprocessingParams.has(placeholder)) {
15760
+ throw Error(`Failed to resolve i18n message placeholder: ${placeholder}`);
15761
+ }
15762
+ }
15763
+ }
15764
+
15765
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/i18n_message_extraction.mjs
15766
+ function extractI18nMessages(job) {
15767
+ for (const unit of job.units) {
15768
+ for (const op of unit.create) {
15769
+ if (op.kind === OpKind.I18nStart) {
15770
+ unit.create.push(createExtractedMessageOp(op.xref, op.message, op.xref === op.root));
15771
+ }
15772
+ }
15773
+ }
15774
+ }
15618
15775
 
15619
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/i18n_text_extraction.mjs
15620
- function phaseI18nTextExtraction(job) {
15776
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/i18n_text_extraction.mjs
15777
+ function extractI18nText(job) {
15621
15778
  var _a2;
15622
15779
  for (const unit of job.units) {
15623
15780
  let currentI18nId = null;
15781
+ let currentI18nSlot = null;
15624
15782
  const textNodes = /* @__PURE__ */ new Map();
15625
15783
  for (const op of unit.create) {
15626
15784
  switch (op.kind) {
15627
15785
  case OpKind.I18nStart:
15628
15786
  currentI18nId = op.xref;
15787
+ currentI18nSlot = op.handle;
15629
15788
  break;
15630
15789
  case OpKind.I18nEnd:
15631
15790
  currentI18nId = null;
15791
+ currentI18nSlot = null;
15632
15792
  break;
15633
15793
  case OpKind.Text:
15634
- if (currentI18nId !== null) {
15635
- textNodes.set(op.xref, currentI18nId);
15794
+ if (currentI18nId !== null && currentI18nSlot !== null) {
15795
+ textNodes.set(op.xref, { xref: currentI18nId, slot: currentI18nSlot });
15636
15796
  OpList.remove(op);
15637
15797
  }
15638
15798
  break;
@@ -15644,12 +15804,12 @@ function phaseI18nTextExtraction(job) {
15644
15804
  if (!textNodes.has(op.target)) {
15645
15805
  continue;
15646
15806
  }
15647
- const i18nBlockId = textNodes.get(op.target);
15807
+ const i18nBlock = textNodes.get(op.target);
15648
15808
  const ops = [];
15649
15809
  for (let i = 0; i < op.interpolation.expressions.length; i++) {
15650
15810
  const expr = op.interpolation.expressions[i];
15651
15811
  const placeholder = op.i18nPlaceholders[i];
15652
- ops.push(createI18nExpressionOp(i18nBlockId, expr, placeholder.name, I18nParamResolutionTime.Creation, (_a2 = expr.sourceSpan) != null ? _a2 : op.sourceSpan));
15812
+ ops.push(createI18nExpressionOp(i18nBlock.xref, i18nBlock.slot, expr, placeholder.name, I18nParamResolutionTime.Creation, (_a2 = expr.sourceSpan) != null ? _a2 : op.sourceSpan));
15653
15813
  }
15654
15814
  if (ops.length > 0) {
15655
15815
  }
@@ -15660,24 +15820,27 @@ function phaseI18nTextExtraction(job) {
15660
15820
  }
15661
15821
  }
15662
15822
 
15663
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/icu_extraction.mjs
15664
- function phaseIcuExtraction(job) {
15823
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/icu_extraction.mjs
15824
+ function extractI18nICUs(job) {
15665
15825
  for (const unit of job.units) {
15666
15826
  const icus = /* @__PURE__ */ new Map();
15667
15827
  let currentI18nId = null;
15828
+ let currentI18nSlot = null;
15668
15829
  for (const op of unit.create) {
15669
15830
  switch (op.kind) {
15670
15831
  case OpKind.I18nStart:
15671
15832
  currentI18nId = op.xref;
15833
+ currentI18nSlot = op.handle;
15672
15834
  break;
15673
15835
  case OpKind.I18nEnd:
15674
15836
  currentI18nId = null;
15837
+ currentI18nSlot = null;
15675
15838
  break;
15676
15839
  case OpKind.Icu:
15677
15840
  if (currentI18nId === null) {
15678
15841
  throw Error("Unexpected ICU outside of an i18n block.");
15679
15842
  }
15680
- icus.set(op.xref, { message: op.message, i18nBlockId: currentI18nId });
15843
+ icus.set(op.xref, { message: op.message, i18nBlockId: currentI18nId, i18nBlockSlot: currentI18nSlot });
15681
15844
  OpList.remove(op);
15682
15845
  break;
15683
15846
  }
@@ -15685,7 +15848,7 @@ function phaseIcuExtraction(job) {
15685
15848
  for (const op of unit.update) {
15686
15849
  switch (op.kind) {
15687
15850
  case OpKind.IcuUpdate:
15688
- const { message, i18nBlockId } = icus.get(op.xref);
15851
+ const { message, i18nBlockId, i18nBlockSlot } = icus.get(op.xref);
15689
15852
  const icuNode = message.nodes.find((n) => n instanceof Icu2);
15690
15853
  if (icuNode === void 0) {
15691
15854
  throw Error("Could not find ICU in i18n AST");
@@ -15693,15 +15856,15 @@ function phaseIcuExtraction(job) {
15693
15856
  if (icuNode.expressionPlaceholder === void 0) {
15694
15857
  throw Error("ICU is missing an i18n placeholder");
15695
15858
  }
15696
- OpList.replace(op, createI18nExpressionOp(i18nBlockId, new LexicalReadExpr(icuNode.expression), icuNode.expressionPlaceholder, I18nParamResolutionTime.Postproccessing, null));
15859
+ OpList.replace(op, createI18nExpressionOp(i18nBlockId, i18nBlockSlot, new LexicalReadExpr(icuNode.expression), icuNode.expressionPlaceholder, I18nParamResolutionTime.Postproccessing, null));
15697
15860
  break;
15698
15861
  }
15699
15862
  }
15700
15863
  }
15701
15864
  }
15702
15865
 
15703
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/local_refs.mjs
15704
- function phaseLocalRefs(job) {
15866
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/local_refs.mjs
15867
+ function liftLocalRefs(job) {
15705
15868
  for (const unit of job.units) {
15706
15869
  for (const op of unit.create) {
15707
15870
  switch (op.kind) {
@@ -15730,8 +15893,8 @@ function serializeLocalRefs(refs) {
15730
15893
  return literalArr(constRefs);
15731
15894
  }
15732
15895
 
15733
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/namespace.mjs
15734
- function phaseNamespace(job) {
15896
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/namespace.mjs
15897
+ function emitNamespaceChanges(job) {
15735
15898
  for (const unit of job.units) {
15736
15899
  let activeNamespace = Namespace.HTML;
15737
15900
  for (const op of unit.create) {
@@ -15746,7 +15909,7 @@ function phaseNamespace(job) {
15746
15909
  }
15747
15910
  }
15748
15911
 
15749
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/style_parser.mjs
15912
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/style_parser.mjs
15750
15913
  function parse(value) {
15751
15914
  const styles = [];
15752
15915
  let i = 0;
@@ -15807,9 +15970,9 @@ function hyphenate2(value) {
15807
15970
  }).toLowerCase();
15808
15971
  }
15809
15972
 
15810
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/naming.mjs
15811
- function phaseNaming(cpl) {
15812
- addNamesToView(cpl.root, cpl.componentName, { index: 0 }, cpl.compatibility === CompatibilityMode.TemplateDefinitionBuilder);
15973
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/naming.mjs
15974
+ function nameFunctionsAndVariables(job) {
15975
+ addNamesToView(job.root, job.componentName, { index: 0 }, job.compatibility === CompatibilityMode.TemplateDefinitionBuilder);
15813
15976
  }
15814
15977
  function addNamesToView(unit, baseName, state, compatibility) {
15815
15978
  if (unit.fnName === null) {
@@ -15828,7 +15991,7 @@ function addNamesToView(unit, baseName, state, compatibility) {
15828
15991
  if (op.handlerFnName !== null) {
15829
15992
  break;
15830
15993
  }
15831
- if (!op.hostListener && op.targetSlot === null) {
15994
+ if (!op.hostListener && op.targetSlot.slot === null) {
15832
15995
  throw new Error(`Expected a slot to be assigned`);
15833
15996
  }
15834
15997
  let animation = "";
@@ -15839,7 +16002,7 @@ function addNamesToView(unit, baseName, state, compatibility) {
15839
16002
  if (op.hostListener) {
15840
16003
  op.handlerFnName = `${baseName}_${animation}${op.name}_HostBindingHandler`;
15841
16004
  } else {
15842
- op.handlerFnName = `${unit.fnName}_${op.tag.replace("-", "_")}_${animation}${op.name}_${op.targetSlot}_listener`;
16005
+ op.handlerFnName = `${unit.fnName}_${op.tag.replace("-", "_")}_${animation}${op.name}_${op.targetSlot.slot}_listener`;
15843
16006
  }
15844
16007
  op.handlerFnName = sanitizeIdentifier(op.handlerFnName);
15845
16008
  break;
@@ -15850,26 +16013,25 @@ function addNamesToView(unit, baseName, state, compatibility) {
15850
16013
  if (!(unit instanceof ViewCompilationUnit)) {
15851
16014
  throw new Error(`AssertionError: must be compiling a component`);
15852
16015
  }
15853
- if (op.slot === null) {
16016
+ if (op.handle.slot === null) {
15854
16017
  throw new Error(`Expected slot to be assigned`);
15855
16018
  }
15856
16019
  if (op.emptyView !== null) {
15857
16020
  const emptyView = unit.job.views.get(op.emptyView);
15858
- addNamesToView(emptyView, `${baseName}_${prefixWithNamespace(`${op.tag}Empty`, op.namespace)}_${op.slot + 2}`, state, compatibility);
16021
+ addNamesToView(emptyView, `${baseName}_${`${op.functionNameSuffix}Empty`}_${op.handle.slot + 2}`, state, compatibility);
15859
16022
  }
15860
- const repeaterToken = op.tag === null ? "" : "_" + prefixWithNamespace(op.tag, op.namespace);
15861
- addNamesToView(unit.job.views.get(op.xref), `${baseName}${repeaterToken}_${op.slot + 1}`, state, compatibility);
16023
+ addNamesToView(unit.job.views.get(op.xref), `${baseName}_${op.functionNameSuffix}_${op.handle.slot + 1}`, state, compatibility);
15862
16024
  break;
15863
16025
  case OpKind.Template:
15864
16026
  if (!(unit instanceof ViewCompilationUnit)) {
15865
16027
  throw new Error(`AssertionError: must be compiling a component`);
15866
16028
  }
15867
16029
  const childView = unit.job.views.get(op.xref);
15868
- if (op.slot === null) {
16030
+ if (op.handle.slot === null) {
15869
16031
  throw new Error(`Expected slot to be assigned`);
15870
16032
  }
15871
- const tagToken = op.tag === null ? "" : "_" + prefixWithNamespace(op.tag, op.namespace);
15872
- addNamesToView(childView, `${baseName}${tagToken}_${op.slot}`, state, compatibility);
16033
+ const suffix = op.functionNameSuffix.length === 0 ? "" : `_${op.functionNameSuffix}`;
16034
+ addNamesToView(childView, `${baseName}${suffix}_${op.handle.slot}`, state, compatibility);
15873
16035
  break;
15874
16036
  case OpKind.StyleProp:
15875
16037
  op.name = normalizeStylePropName(op.name);
@@ -15923,8 +16085,8 @@ function stripImportant(name) {
15923
16085
  return name;
15924
16086
  }
15925
16087
 
15926
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/next_context_merging.mjs
15927
- function phaseMergeNextContext(job) {
16088
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/next_context_merging.mjs
16089
+ function mergeNextContextExpressions(job) {
15928
16090
  for (const unit of job.units) {
15929
16091
  for (const op of unit.create) {
15930
16092
  if (op.kind === OpKind.Listener) {
@@ -15969,9 +16131,9 @@ function mergeNextContextsInOps(ops) {
15969
16131
  }
15970
16132
  }
15971
16133
 
15972
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/ng_container.mjs
16134
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/ng_container.mjs
15973
16135
  var CONTAINER_TAG = "ng-container";
15974
- function phaseNgContainer(job) {
16136
+ function generateNgContainerOps(job) {
15975
16137
  for (const unit of job.units) {
15976
16138
  const updatedElementXrefs = /* @__PURE__ */ new Set();
15977
16139
  for (const op of unit.create) {
@@ -15986,7 +16148,7 @@ function phaseNgContainer(job) {
15986
16148
  }
15987
16149
  }
15988
16150
 
15989
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/nonbindable.mjs
16151
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/nonbindable.mjs
15990
16152
  function lookupElement3(elements, xref) {
15991
16153
  const el = elements.get(xref);
15992
16154
  if (el === void 0) {
@@ -15994,7 +16156,7 @@ function lookupElement3(elements, xref) {
15994
16156
  }
15995
16157
  return el;
15996
16158
  }
15997
- function phaseNonbindable(job) {
16159
+ function disableBindings(job) {
15998
16160
  const elements = /* @__PURE__ */ new Map();
15999
16161
  for (const view of job.units) {
16000
16162
  for (const op of view.create) {
@@ -16016,8 +16178,8 @@ function phaseNonbindable(job) {
16016
16178
  }
16017
16179
  }
16018
16180
 
16019
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/nullish_coalescing.mjs
16020
- function phaseNullishCoalescing(job) {
16181
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/nullish_coalescing.mjs
16182
+ function generateNullishCoalesceExpressions(job) {
16021
16183
  for (const unit of job.units) {
16022
16184
  for (const op of unit.ops()) {
16023
16185
  transformExpressionsInOp(op, (expr) => {
@@ -16032,7 +16194,7 @@ function phaseNullishCoalescing(job) {
16032
16194
  }
16033
16195
  }
16034
16196
 
16035
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/ordering.mjs
16197
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/ordering.mjs
16036
16198
  function kindTest(kind) {
16037
16199
  return (op) => op.kind === kind;
16038
16200
  }
@@ -16067,7 +16229,7 @@ var handledOpKinds = /* @__PURE__ */ new Set([
16067
16229
  OpKind.HostProperty,
16068
16230
  OpKind.Attribute
16069
16231
  ]);
16070
- function phaseOrdering(job) {
16232
+ function orderOps(job) {
16071
16233
  for (const unit of job.units) {
16072
16234
  orderWithin(unit.create, CREATE_ORDERING);
16073
16235
  orderWithin(unit.update, UPDATE_ORDERING);
@@ -16106,9 +16268,9 @@ function keepLast(ops) {
16106
16268
  return ops.slice(ops.length - 1);
16107
16269
  }
16108
16270
 
16109
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/parse_extracted_styles.mjs
16110
- function phaseParseExtractedStyles(cpl) {
16111
- for (const unit of cpl.units) {
16271
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/parse_extracted_styles.mjs
16272
+ function parseExtractedStyles(job) {
16273
+ for (const unit of job.units) {
16112
16274
  for (const op of unit.create) {
16113
16275
  if (op.kind === OpKind.ExtractedAttribute && op.bindingKind === BindingKind.Attribute && isStringLiteral(op.expression)) {
16114
16276
  if (op.name === "style") {
@@ -16129,8 +16291,8 @@ function phaseParseExtractedStyles(cpl) {
16129
16291
  }
16130
16292
  }
16131
16293
 
16132
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/phase_remove_content_selectors.mjs
16133
- function phaseRemoveContentSelectors(job) {
16294
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/phase_remove_content_selectors.mjs
16295
+ function removeContentSelectors(job) {
16134
16296
  for (const unit of job.units) {
16135
16297
  const elements = createOpXrefMap(unit);
16136
16298
  for (const op of unit.update) {
@@ -16153,8 +16315,8 @@ function lookupInXrefMap(map, xref) {
16153
16315
  return el;
16154
16316
  }
16155
16317
 
16156
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pipe_creation.mjs
16157
- function phasePipeCreation(job) {
16318
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pipe_creation.mjs
16319
+ function createPipes(job) {
16158
16320
  for (const unit of job.units) {
16159
16321
  processPipeBindingsInView(unit);
16160
16322
  }
@@ -16171,13 +16333,14 @@ function processPipeBindingsInView(unit) {
16171
16333
  if (flags & VisitorContextFlag.InChildOperation) {
16172
16334
  throw new Error(`AssertionError: pipe bindings should not appear in child expressions`);
16173
16335
  }
16174
- if (!hasDependsOnSlotContextTrait(updateOp) && !hasUsesSlotIndexTrait(updateOp)) {
16175
- throw new Error(`AssertionError: pipe binding associated with non-slot operation ${OpKind[updateOp.kind]}`);
16176
- }
16177
16336
  if (unit.job.compatibility) {
16337
+ const slotHandle = updateOp.target;
16338
+ if (slotHandle == void 0) {
16339
+ throw new Error(`AssertionError: expected slot handle to be assigned for pipe creation`);
16340
+ }
16178
16341
  addPipeToCreationBlock(unit, updateOp.target, expr);
16179
16342
  } else {
16180
- unit.create.push(createPipeOp(expr.target, expr.name));
16343
+ unit.create.push(createPipeOp(expr.target, expr.targetSlot, expr.name));
16181
16344
  }
16182
16345
  });
16183
16346
  }
@@ -16193,15 +16356,15 @@ function addPipeToCreationBlock(unit, afterTargetXref, binding) {
16193
16356
  while (op.next.kind === OpKind.Pipe) {
16194
16357
  op = op.next;
16195
16358
  }
16196
- const pipe2 = createPipeOp(binding.target, binding.name);
16359
+ const pipe2 = createPipeOp(binding.target, binding.targetSlot, binding.name);
16197
16360
  OpList.insertBefore(pipe2, op.next);
16198
16361
  return;
16199
16362
  }
16200
16363
  throw new Error(`AssertionError: unable to find insertion point for pipe ${binding.name}`);
16201
16364
  }
16202
16365
 
16203
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pipe_variadic.mjs
16204
- function phasePipeVariadic(job) {
16366
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pipe_variadic.mjs
16367
+ function createVariadicPipes(job) {
16205
16368
  for (const unit of job.units) {
16206
16369
  for (const op of unit.update) {
16207
16370
  transformExpressionsInOp(op, (expr) => {
@@ -16211,14 +16374,14 @@ function phasePipeVariadic(job) {
16211
16374
  if (expr.args.length <= 4) {
16212
16375
  return expr;
16213
16376
  }
16214
- return new PipeBindingVariadicExpr(expr.target, expr.name, literalArr(expr.args), expr.args.length);
16377
+ return new PipeBindingVariadicExpr(expr.target, expr.targetSlot, expr.name, literalArr(expr.args), expr.args.length);
16215
16378
  }, VisitorContextFlag.None);
16216
16379
  }
16217
16380
  }
16218
16381
  }
16219
16382
 
16220
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/propagate_i18n_blocks.mjs
16221
- function phasePropagateI18nBlocks(job) {
16383
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/propagate_i18n_blocks.mjs
16384
+ function propagateI18nBlocks(job) {
16222
16385
  propagateI18nBlocksToTemplates(job.root, 0);
16223
16386
  }
16224
16387
  function propagateI18nBlocksToTemplates(unit, subTemplateIndex) {
@@ -16254,8 +16417,51 @@ function wrapTemplateWithI18n(unit, parentI18n) {
16254
16417
  }
16255
16418
  }
16256
16419
 
16257
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pure_function_extraction.mjs
16258
- function phasePureFunctionExtraction(job) {
16420
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/propagate_i18n_placeholders.mjs
16421
+ function propogateI18nPlaceholders(job) {
16422
+ const i18nOps = /* @__PURE__ */ new Map();
16423
+ const extractedMessageOps = /* @__PURE__ */ new Map();
16424
+ for (const unit of job.units) {
16425
+ for (const op of unit.create) {
16426
+ switch (op.kind) {
16427
+ case OpKind.I18nStart:
16428
+ i18nOps.set(op.xref, op);
16429
+ break;
16430
+ case OpKind.ExtractedMessage:
16431
+ extractedMessageOps.set(op.owner, op);
16432
+ break;
16433
+ }
16434
+ }
16435
+ }
16436
+ for (const [xref, childExtractedMessageOp] of extractedMessageOps) {
16437
+ if (!childExtractedMessageOp.isRoot) {
16438
+ const i18nOp = i18nOps.get(xref);
16439
+ if (i18nOp === void 0) {
16440
+ throw Error("Could not find owner i18n block for extracted message.");
16441
+ }
16442
+ const rootExtractedMessageOp = extractedMessageOps.get(i18nOp.root);
16443
+ if (rootExtractedMessageOp === void 0) {
16444
+ throw Error("Could not find extracted message op for root i18n block.");
16445
+ }
16446
+ mergeParams(rootExtractedMessageOp.params, childExtractedMessageOp.params);
16447
+ mergeParams(rootExtractedMessageOp.postprocessingParams, childExtractedMessageOp.postprocessingParams);
16448
+ }
16449
+ }
16450
+ }
16451
+ function mergeParams(to, from) {
16452
+ for (const [placeholder, fromValues] of from) {
16453
+ const toValues = to.get(placeholder) || [];
16454
+ const flags = fromValues[0].flags;
16455
+ if (flags & I18nParamValueFlags.CloseTag && !(flags & I18nParamValueFlags.OpenTag)) {
16456
+ to.set(placeholder, [...fromValues, ...toValues]);
16457
+ } else {
16458
+ to.set(placeholder, [...toValues, ...fromValues]);
16459
+ }
16460
+ }
16461
+ }
16462
+
16463
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pure_function_extraction.mjs
16464
+ function extractPureFunctions(job) {
16259
16465
  for (const view of job.units) {
16260
16466
  for (const op of view.ops()) {
16261
16467
  visitExpressionsInOp(op, (expr) => {
@@ -16296,10 +16502,10 @@ var PureFunctionConstant = class extends GenericKeyFn {
16296
16502
  }
16297
16503
  };
16298
16504
 
16299
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pure_literal_structures.mjs
16300
- function phasePureLiteralStructures(job) {
16301
- for (const view of job.units) {
16302
- for (const op of view.update) {
16505
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/pure_literal_structures.mjs
16506
+ function generatePureLiteralStructures(job) {
16507
+ for (const unit of job.units) {
16508
+ for (const op of unit.update) {
16303
16509
  transformExpressionsInOp(op, (expr, flags) => {
16304
16510
  if (flags & VisitorContextFlag.InChildOperation) {
16305
16511
  return expr;
@@ -16343,7 +16549,7 @@ function transformLiteralMap(expr) {
16343
16549
  return new PureFunctionExpr(literalMap(derivedEntries), nonConstantArgs);
16344
16550
  }
16345
16551
 
16346
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/instruction.mjs
16552
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/instruction.mjs
16347
16553
  function element(slot, tag, constIndex, localRefIndex, sourceSpan) {
16348
16554
  return elementOrContainerBase(Identifiers.element, slot, tag, constIndex, localRefIndex, sourceSpan);
16349
16555
  }
@@ -16387,7 +16593,7 @@ function template(slot, templateFnRef, decls, vars, tag, constIndex, sourceSpan)
16387
16593
  }
16388
16594
  return call(Identifiers.templateCreate, args, sourceSpan);
16389
16595
  }
16390
- function disableBindings() {
16596
+ function disableBindings2() {
16391
16597
  return call(Identifiers.disableBindings, [], null);
16392
16598
  }
16393
16599
  function enableBindings() {
@@ -16453,7 +16659,7 @@ function text(slot, initialValue, sourceSpan) {
16453
16659
  }
16454
16660
  return call(Identifiers.text, args, sourceSpan);
16455
16661
  }
16456
- function defer(selfSlot, primarySlot, dependencyResolverFn, loadingSlot, placeholderSlot, errorSlot, loadingConfigIndex, placeholderConfigIndex, sourceSpan) {
16662
+ function defer(selfSlot, primarySlot, dependencyResolverFn, loadingSlot, placeholderSlot, errorSlot, loadingConfig, placeholderConfig, enableTimerScheduling, sourceSpan) {
16457
16663
  const args = [
16458
16664
  literal(selfSlot),
16459
16665
  literal(primarySlot),
@@ -16461,16 +16667,40 @@ function defer(selfSlot, primarySlot, dependencyResolverFn, loadingSlot, placeho
16461
16667
  literal(loadingSlot),
16462
16668
  literal(placeholderSlot),
16463
16669
  literal(errorSlot),
16464
- literal(loadingConfigIndex),
16465
- literal(placeholderConfigIndex)
16670
+ loadingConfig != null ? loadingConfig : literal(null),
16671
+ placeholderConfig != null ? placeholderConfig : literal(null),
16672
+ enableTimerScheduling ? importExpr(Identifiers.deferEnableTimerScheduling) : literal(null)
16466
16673
  ];
16467
- while (args[args.length - 1].value === null) {
16674
+ let expr;
16675
+ while ((expr = args[args.length - 1]) !== null && expr instanceof LiteralExpr && expr.value === null) {
16468
16676
  args.pop();
16469
16677
  }
16470
16678
  return call(Identifiers.defer, args, sourceSpan);
16471
16679
  }
16472
- function deferOn(sourceSpan) {
16473
- return call(Identifiers.deferOnIdle, [], sourceSpan);
16680
+ var deferTriggerToR3TriggerInstructionsMap = /* @__PURE__ */ new Map([
16681
+ [DeferTriggerKind.Idle, [Identifiers.deferOnIdle, Identifiers.deferPrefetchOnIdle]],
16682
+ [
16683
+ DeferTriggerKind.Immediate,
16684
+ [Identifiers.deferOnImmediate, Identifiers.deferPrefetchOnImmediate]
16685
+ ],
16686
+ [DeferTriggerKind.Timer, [Identifiers.deferOnTimer, Identifiers.deferPrefetchOnTimer]],
16687
+ [DeferTriggerKind.Hover, [Identifiers.deferOnHover, Identifiers.deferPrefetchOnHover]],
16688
+ [
16689
+ DeferTriggerKind.Interaction,
16690
+ [Identifiers.deferOnInteraction, Identifiers.deferPrefetchOnInteraction]
16691
+ ],
16692
+ [
16693
+ DeferTriggerKind.Viewport,
16694
+ [Identifiers.deferOnViewport, Identifiers.deferPrefetchOnViewport]
16695
+ ]
16696
+ ]);
16697
+ function deferOn(trigger, args, prefetch, sourceSpan) {
16698
+ const instructions = deferTriggerToR3TriggerInstructionsMap.get(trigger);
16699
+ if (instructions === void 0) {
16700
+ throw new Error(`Unable to determine instruction for trigger ${trigger}`);
16701
+ }
16702
+ const instructionToCall = prefetch ? instructions[1] : instructions[0];
16703
+ return call(instructionToCall, args.map((a) => literal(a)), sourceSpan);
16474
16704
  }
16475
16705
  function projectionDef(def) {
16476
16706
  return call(Identifiers.projectionDef, def ? [def] : [], null);
@@ -16492,20 +16722,20 @@ function i18nStart(slot, constIndex, subTemplateIndex) {
16492
16722
  }
16493
16723
  return call(Identifiers.i18nStart, args, null);
16494
16724
  }
16495
- function repeaterCreate(slot, viewFnName, decls, vars, trackByFn, trackByUsesComponentInstance, emptyViewFnName, emptyDecls, emptyVars, sourceSpan) {
16496
- let args = [
16725
+ function repeaterCreate(slot, viewFnName, decls, vars, tag, constIndex, trackByFn, trackByUsesComponentInstance, emptyViewFnName, emptyDecls, emptyVars, sourceSpan) {
16726
+ const args = [
16497
16727
  literal(slot),
16498
16728
  variable(viewFnName),
16499
16729
  literal(decls),
16500
16730
  literal(vars),
16731
+ literal(tag),
16732
+ literal(constIndex),
16501
16733
  trackByFn
16502
16734
  ];
16503
16735
  if (trackByUsesComponentInstance || emptyViewFnName !== null) {
16504
16736
  args.push(literal(trackByUsesComponentInstance));
16505
16737
  if (emptyViewFnName !== null) {
16506
- args.push(variable(emptyViewFnName));
16507
- args.push(literal(emptyDecls));
16508
- args.push(literal(emptyVars));
16738
+ args.push(variable(emptyViewFnName), literal(emptyDecls), literal(emptyVars));
16509
16739
  }
16510
16740
  }
16511
16741
  return call(Identifiers.repeaterCreate, args, sourceSpan);
@@ -16819,7 +17049,7 @@ function callVariadicInstruction(config, baseArgs, interpolationArgs, extraArgs,
16819
17049
  return createStatementOp(callVariadicInstructionExpr(config, baseArgs, interpolationArgs, extraArgs, sourceSpan).toStmt());
16820
17050
  }
16821
17051
 
16822
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/reify.mjs
17052
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/reify.mjs
16823
17053
  var sanitizerIdentifierMap = /* @__PURE__ */ new Map([
16824
17054
  [SanitizerFn.Html, Identifiers.sanitizeHtml],
16825
17055
  [SanitizerFn.IframeAttribute, Identifiers.validateIframeAttribute],
@@ -16828,62 +17058,62 @@ var sanitizerIdentifierMap = /* @__PURE__ */ new Map([
16828
17058
  [SanitizerFn.Style, Identifiers.sanitizeStyle],
16829
17059
  [SanitizerFn.Url, Identifiers.sanitizeUrl]
16830
17060
  ]);
16831
- function phaseReify(cpl) {
16832
- for (const unit of cpl.units) {
17061
+ function reify(job) {
17062
+ for (const unit of job.units) {
16833
17063
  reifyCreateOperations(unit, unit.create);
16834
17064
  reifyUpdateOperations(unit, unit.update);
16835
17065
  }
16836
17066
  }
16837
17067
  function reifyCreateOperations(unit, ops) {
16838
- var _a2, _b2, _c2, _d2;
17068
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g;
16839
17069
  for (const op of ops) {
16840
17070
  transformExpressionsInOp(op, reifyIrExpression, VisitorContextFlag.None);
16841
17071
  switch (op.kind) {
16842
17072
  case OpKind.Text:
16843
- OpList.replace(op, text(op.slot, op.initialValue, op.sourceSpan));
17073
+ OpList.replace(op, text(op.handle.slot, op.initialValue, op.sourceSpan));
16844
17074
  break;
16845
17075
  case OpKind.ElementStart:
16846
- OpList.replace(op, elementStart(op.slot, op.tag, op.attributes, op.localRefs, op.sourceSpan));
17076
+ OpList.replace(op, elementStart(op.handle.slot, op.tag, op.attributes, op.localRefs, op.sourceSpan));
16847
17077
  break;
16848
17078
  case OpKind.Element:
16849
- OpList.replace(op, element(op.slot, op.tag, op.attributes, op.localRefs, op.sourceSpan));
17079
+ OpList.replace(op, element(op.handle.slot, op.tag, op.attributes, op.localRefs, op.sourceSpan));
16850
17080
  break;
16851
17081
  case OpKind.ElementEnd:
16852
17082
  OpList.replace(op, elementEnd(op.sourceSpan));
16853
17083
  break;
16854
17084
  case OpKind.ContainerStart:
16855
- OpList.replace(op, elementContainerStart(op.slot, op.attributes, op.localRefs, op.sourceSpan));
17085
+ OpList.replace(op, elementContainerStart(op.handle.slot, op.attributes, op.localRefs, op.sourceSpan));
16856
17086
  break;
16857
17087
  case OpKind.Container:
16858
- OpList.replace(op, elementContainer(op.slot, op.attributes, op.localRefs, op.sourceSpan));
17088
+ OpList.replace(op, elementContainer(op.handle.slot, op.attributes, op.localRefs, op.sourceSpan));
16859
17089
  break;
16860
17090
  case OpKind.ContainerEnd:
16861
17091
  OpList.replace(op, elementContainerEnd());
16862
17092
  break;
16863
17093
  case OpKind.I18nStart:
16864
- OpList.replace(op, i18nStart(op.slot, op.messageIndex, op.subTemplateIndex));
17094
+ OpList.replace(op, i18nStart(op.handle.slot, op.messageIndex, op.subTemplateIndex));
16865
17095
  break;
16866
17096
  case OpKind.I18nEnd:
16867
17097
  OpList.replace(op, i18nEnd());
16868
17098
  break;
16869
17099
  case OpKind.I18n:
16870
- OpList.replace(op, i18n(op.slot, op.messageIndex, op.subTemplateIndex));
17100
+ OpList.replace(op, i18n(op.handle.slot, op.messageIndex, op.subTemplateIndex));
16871
17101
  break;
16872
17102
  case OpKind.Template:
16873
17103
  if (!(unit instanceof ViewCompilationUnit)) {
16874
17104
  throw new Error(`AssertionError: must be compiling a component`);
16875
17105
  }
16876
17106
  const childView = unit.job.views.get(op.xref);
16877
- OpList.replace(op, template(op.slot, variable(childView.fnName), childView.decls, childView.vars, op.block ? null : op.tag, op.attributes, op.sourceSpan));
17107
+ OpList.replace(op, template(op.handle.slot, variable(childView.fnName), childView.decls, childView.vars, op.tag, op.attributes, op.sourceSpan));
16878
17108
  break;
16879
17109
  case OpKind.DisableBindings:
16880
- OpList.replace(op, disableBindings());
17110
+ OpList.replace(op, disableBindings2());
16881
17111
  break;
16882
17112
  case OpKind.EnableBindings:
16883
17113
  OpList.replace(op, enableBindings());
16884
17114
  break;
16885
17115
  case OpKind.Pipe:
16886
- OpList.replace(op, pipe(op.slot, op.name));
17116
+ OpList.replace(op, pipe(op.handle.slot, op.name));
16887
17117
  break;
16888
17118
  case OpKind.Listener:
16889
17119
  const listenerFn = reifyListenerHandler(unit, op.handlerFnName, op.handlerOps, op.consumesDollarEvent);
@@ -16910,25 +17140,45 @@ function reifyCreateOperations(unit, ops) {
16910
17140
  }
16911
17141
  break;
16912
17142
  case OpKind.Defer:
16913
- OpList.replace(op, defer(op.slot, op.targetSlot, null, op.loading && op.loading.targetSlot, op.placeholder && op.placeholder.targetSlot, op.error && op.error.targetSlot, (_b2 = (_a2 = op.loading) == null ? void 0 : _a2.constIndex) != null ? _b2 : null, (_d2 = (_c2 = op.placeholder) == null ? void 0 : _c2.constIndex) != null ? _d2 : null, op.sourceSpan));
16914
- break;
16915
- case OpKind.DeferSecondaryBlock:
16916
- OpList.remove(op);
17143
+ const timerScheduling = !!op.loadingMinimumTime || !!op.loadingAfterTime || !!op.placeholderMinimumTime;
17144
+ OpList.replace(op, defer(op.handle.slot, op.mainSlot.slot, null, (_b2 = (_a2 = op.loadingSlot) == null ? void 0 : _a2.slot) != null ? _b2 : null, (_d2 = (_c2 = op.placeholderSlot) == null ? void 0 : _c2.slot) != null ? _d2 : null, (_f2 = (_e2 = op.errorSlot) == null ? void 0 : _e2.slot) != null ? _f2 : null, op.loadingConfig, op.placeholderConfig, timerScheduling, op.sourceSpan));
16917
17145
  break;
16918
17146
  case OpKind.DeferOn:
16919
- OpList.replace(op, deferOn(op.sourceSpan));
17147
+ let args = [];
17148
+ switch (op.trigger.kind) {
17149
+ case DeferTriggerKind.Idle:
17150
+ case DeferTriggerKind.Immediate:
17151
+ break;
17152
+ case DeferTriggerKind.Timer:
17153
+ args = [op.trigger.delay];
17154
+ break;
17155
+ case DeferTriggerKind.Interaction:
17156
+ case DeferTriggerKind.Hover:
17157
+ case DeferTriggerKind.Viewport:
17158
+ if (((_g = op.trigger.targetSlot) == null ? void 0 : _g.slot) == null || op.trigger.targetSlotViewSteps === null) {
17159
+ throw new Error(`Slot or view steps not set in trigger reification for trigger kind ${op.trigger.kind}`);
17160
+ }
17161
+ args = [op.trigger.targetSlot.slot];
17162
+ if (op.trigger.targetSlotViewSteps !== 0) {
17163
+ args.push(op.trigger.targetSlotViewSteps);
17164
+ }
17165
+ break;
17166
+ default:
17167
+ throw new Error(`AssertionError: Unsupported reification of defer trigger kind ${op.trigger.kind}`);
17168
+ }
17169
+ OpList.replace(op, deferOn(op.trigger.kind, args, op.prefetch, op.sourceSpan));
16920
17170
  break;
16921
17171
  case OpKind.ProjectionDef:
16922
17172
  OpList.replace(op, projectionDef(op.def));
16923
17173
  break;
16924
17174
  case OpKind.Projection:
16925
- if (op.slot === null) {
17175
+ if (op.handle.slot === null) {
16926
17176
  throw new Error("No slot was assigned for project instruction");
16927
17177
  }
16928
- OpList.replace(op, projection(op.slot, op.projectionSlotIndex, op.attributes, op.sourceSpan));
17178
+ OpList.replace(op, projection(op.handle.slot, op.projectionSlotIndex, op.attributes, op.sourceSpan));
16929
17179
  break;
16930
17180
  case OpKind.RepeaterCreate:
16931
- if (op.slot === null) {
17181
+ if (op.handle.slot === null) {
16932
17182
  throw new Error("No slot was assigned for repeater instruction");
16933
17183
  }
16934
17184
  if (!(unit instanceof ViewCompilationUnit)) {
@@ -16953,7 +17203,7 @@ function reifyCreateOperations(unit, ops) {
16953
17203
  emptyDecls = emptyView.decls;
16954
17204
  emptyVars = emptyView.vars;
16955
17205
  }
16956
- OpList.replace(op, repeaterCreate(op.slot, repeaterView.fnName, op.decls, op.vars, op.trackByFn, op.usesComponentInstance, emptyViewFnName, emptyDecls, emptyVars, op.sourceSpan));
17206
+ OpList.replace(op, repeaterCreate(op.handle.slot, repeaterView.fnName, op.decls, op.vars, op.tag, op.attributes, op.trackByFn, op.usesComponentInstance, emptyViewFnName, emptyDecls, emptyVars, op.sourceSpan));
16957
17207
  break;
16958
17208
  case OpKind.Statement:
16959
17209
  break;
@@ -17004,7 +17254,7 @@ function reifyUpdateOperations(_unit, ops) {
17004
17254
  OpList.replace(op, i18nExp(op.expression, op.sourceSpan));
17005
17255
  break;
17006
17256
  case OpKind.I18nApply:
17007
- OpList.replace(op, i18nApply(op.targetSlot, op.sourceSpan));
17257
+ OpList.replace(op, i18nApply(op.targetSlot.slot, op.sourceSpan));
17008
17258
  break;
17009
17259
  case OpKind.InterpolateText:
17010
17260
  OpList.replace(op, textInterpolate(op.interpolation.strings, op.interpolation.expressions, op.sourceSpan));
@@ -17037,13 +17287,13 @@ function reifyUpdateOperations(_unit, ops) {
17037
17287
  if (op.processed === null) {
17038
17288
  throw new Error(`Conditional test was not set.`);
17039
17289
  }
17040
- if (op.targetSlot === null) {
17290
+ if (op.targetSlot.slot === null) {
17041
17291
  throw new Error(`Conditional slot was not set.`);
17042
17292
  }
17043
- OpList.replace(op, conditional(op.targetSlot, op.processed, op.contextValue, op.sourceSpan));
17293
+ OpList.replace(op, conditional(op.targetSlot.slot, op.processed, op.contextValue, op.sourceSpan));
17044
17294
  break;
17045
17295
  case OpKind.Repeater:
17046
- OpList.replace(op, repeater(op.targetSlot, op.collection, op.sourceSpan));
17296
+ OpList.replace(op, repeater(op.targetSlot.slot, op.collection, op.sourceSpan));
17047
17297
  break;
17048
17298
  case OpKind.Statement:
17049
17299
  break;
@@ -17060,7 +17310,7 @@ function reifyIrExpression(expr) {
17060
17310
  case ExpressionKind.NextContext:
17061
17311
  return nextContext(expr.steps);
17062
17312
  case ExpressionKind.Reference:
17063
- return reference(expr.targetSlot + 1 + expr.offset);
17313
+ return reference(expr.targetSlot.slot + 1 + expr.offset);
17064
17314
  case ExpressionKind.LexicalRead:
17065
17315
  throw new Error(`AssertionError: unresolved LexicalRead of ${expr.name}`);
17066
17316
  case ExpressionKind.RestoreView:
@@ -17095,13 +17345,13 @@ function reifyIrExpression(expr) {
17095
17345
  case ExpressionKind.PureFunctionParameterExpr:
17096
17346
  throw new Error(`AssertionError: expected PureFunctionParameterExpr to have been extracted`);
17097
17347
  case ExpressionKind.PipeBinding:
17098
- return pipeBind(expr.targetSlot, expr.varOffset, expr.args);
17348
+ return pipeBind(expr.targetSlot.slot, expr.varOffset, expr.args);
17099
17349
  case ExpressionKind.PipeBindingVariadic:
17100
- return pipeBindV(expr.targetSlot, expr.varOffset, expr.args);
17350
+ return pipeBindV(expr.targetSlot.slot, expr.varOffset, expr.args);
17101
17351
  case ExpressionKind.SanitizerExpr:
17102
17352
  return importExpr(sanitizerIdentifierMap.get(expr.fn));
17103
17353
  case ExpressionKind.SlotLiteralExpr:
17104
- return literal(expr.targetSlot);
17354
+ return literal(expr.slot.slot);
17105
17355
  default:
17106
17356
  throw new Error(`AssertionError: Unsupported reification of ir.Expression kind: ${ExpressionKind[expr.kind]}`);
17107
17357
  }
@@ -17122,8 +17372,8 @@ function reifyListenerHandler(unit, name, handlerOps, consumesDollarEvent) {
17122
17372
  return fn(params, handlerStmts, void 0, void 0, name);
17123
17373
  }
17124
17374
 
17125
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/remove_empty_bindings.mjs
17126
- function phaseRemoveEmptyBindings(job) {
17375
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/remove_empty_bindings.mjs
17376
+ function removeEmptyBindings(job) {
17127
17377
  for (const unit of job.units) {
17128
17378
  for (const op of unit.update) {
17129
17379
  switch (op.kind) {
@@ -17143,9 +17393,41 @@ function phaseRemoveEmptyBindings(job) {
17143
17393
  }
17144
17394
  }
17145
17395
 
17146
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_contexts.mjs
17147
- function phaseResolveContexts(cpl) {
17148
- for (const unit of cpl.units) {
17396
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/repeater_derived_vars.mjs
17397
+ function generateRepeaterDerivedVars(job) {
17398
+ const repeaters = /* @__PURE__ */ new Map();
17399
+ for (const unit of job.units) {
17400
+ for (const op of unit.ops()) {
17401
+ if (op.kind === OpKind.RepeaterCreate) {
17402
+ repeaters.set(op.xref, op);
17403
+ }
17404
+ }
17405
+ }
17406
+ for (const unit of job.units) {
17407
+ for (const op of unit.ops()) {
17408
+ transformExpressionsInOp(op, (expr) => {
17409
+ if (!(expr instanceof DerivedRepeaterVarExpr)) {
17410
+ return expr;
17411
+ }
17412
+ const repeaterOp = repeaters.get(expr.xref);
17413
+ switch (expr.identity) {
17414
+ case DerivedRepeaterVarIdentity.First:
17415
+ return new BinaryOperatorExpr(BinaryOperator.Identical, new LexicalReadExpr(repeaterOp.varNames.$index), literal(0));
17416
+ case DerivedRepeaterVarIdentity.Last:
17417
+ return new BinaryOperatorExpr(BinaryOperator.Identical, new LexicalReadExpr(repeaterOp.varNames.$index), new BinaryOperatorExpr(BinaryOperator.Minus, new LexicalReadExpr(repeaterOp.varNames.$count), literal(1)));
17418
+ case DerivedRepeaterVarIdentity.Even:
17419
+ return new BinaryOperatorExpr(BinaryOperator.Identical, new BinaryOperatorExpr(BinaryOperator.Modulo, new LexicalReadExpr(repeaterOp.varNames.$index), literal(2)), literal(0));
17420
+ case DerivedRepeaterVarIdentity.Odd:
17421
+ return new BinaryOperatorExpr(BinaryOperator.NotIdentical, new BinaryOperatorExpr(BinaryOperator.Modulo, new LexicalReadExpr(repeaterOp.varNames.$index), literal(2)), literal(0));
17422
+ }
17423
+ }, VisitorContextFlag.None);
17424
+ }
17425
+ }
17426
+ }
17427
+
17428
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_contexts.mjs
17429
+ function resolveContexts(job) {
17430
+ for (const unit of job.units) {
17149
17431
  processLexicalScope(unit, unit.create);
17150
17432
  processLexicalScope(unit, unit.update);
17151
17433
  }
@@ -17184,14 +17466,14 @@ function processLexicalScope(view, ops) {
17184
17466
  }
17185
17467
  }
17186
17468
 
17187
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_dollar_event.mjs
17188
- function phaseResolveDollarEvent(job) {
17469
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_dollar_event.mjs
17470
+ function resolveDollarEvent(job) {
17189
17471
  for (const unit of job.units) {
17190
- resolveDollarEvent(unit, unit.create);
17191
- resolveDollarEvent(unit, unit.update);
17472
+ transformDollarEvent(unit, unit.create);
17473
+ transformDollarEvent(unit, unit.update);
17192
17474
  }
17193
17475
  }
17194
- function resolveDollarEvent(unit, ops) {
17476
+ function transformDollarEvent(unit, ops) {
17195
17477
  for (const op of ops) {
17196
17478
  if (op.kind === OpKind.Listener) {
17197
17479
  transformExpressionsInOp(op, (expr) => {
@@ -17205,174 +17487,74 @@ function resolveDollarEvent(unit, ops) {
17205
17487
  }
17206
17488
  }
17207
17489
 
17208
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_i18n_placeholders.mjs
17209
- var ESCAPE = "\uFFFD";
17210
- var ELEMENT_MARKER = "#";
17211
- var TEMPLATE_MARKER = "*";
17212
- var TAG_CLOSE_MARKER = "/";
17213
- var CONTEXT_MARKER = ":";
17214
- var LIST_START_MARKER = "[";
17215
- var LIST_END_MARKER = "]";
17216
- var LIST_DELIMITER = "|";
17217
- var I18nParamValueFlags;
17218
- (function(I18nParamValueFlags2) {
17219
- I18nParamValueFlags2[I18nParamValueFlags2["None"] = 0] = "None";
17220
- I18nParamValueFlags2[I18nParamValueFlags2["ElementTag"] = 1] = "ElementTag";
17221
- I18nParamValueFlags2[I18nParamValueFlags2["TemplateTag"] = 2] = "TemplateTag";
17222
- I18nParamValueFlags2[I18nParamValueFlags2["OpenTag"] = 4] = "OpenTag";
17223
- I18nParamValueFlags2[I18nParamValueFlags2["CloseTag"] = 8] = "CloseTag";
17224
- })(I18nParamValueFlags || (I18nParamValueFlags = {}));
17225
- var I18nPlaceholderParams = class {
17226
- constructor() {
17227
- this.values = /* @__PURE__ */ new Map();
17490
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_i18n_element_placeholders.mjs
17491
+ function resolveI18nElementPlaceholders(job) {
17492
+ const extractedMessageOps = /* @__PURE__ */ new Map();
17493
+ const elements = /* @__PURE__ */ new Map();
17494
+ for (const unit of job.units) {
17495
+ for (const op of unit.create) {
17496
+ switch (op.kind) {
17497
+ case OpKind.ExtractedMessage:
17498
+ extractedMessageOps.set(op.owner, op);
17499
+ break;
17500
+ case OpKind.ElementStart:
17501
+ elements.set(op.xref, op);
17502
+ break;
17503
+ }
17504
+ }
17228
17505
  }
17229
- addValue(placeholder, value, subTemplateIndex, resolutionTime, flags) {
17230
- var _a2;
17231
- const placeholderValues = (_a2 = this.values.get(placeholder)) != null ? _a2 : [];
17232
- placeholderValues.push({ value, subTemplateIndex, resolutionTime, flags });
17233
- this.values.set(placeholder, placeholderValues);
17234
- }
17235
- saveToOp(op) {
17236
- for (const [placeholder, placeholderValues] of this.values) {
17237
- const creationValues = placeholderValues.filter(({ resolutionTime }) => resolutionTime === I18nParamResolutionTime.Creation);
17238
- if (creationValues.length > 1) {
17239
- op.needsPostprocessing = true;
17240
- }
17241
- const serializedCreationValues = this.serializeValues(creationValues);
17242
- if (serializedCreationValues !== null) {
17243
- op.params.set(placeholder, literal(serializedCreationValues));
17244
- }
17245
- const serializedPostprocessingValues = this.serializeValues(placeholderValues.filter(({ resolutionTime }) => resolutionTime === I18nParamResolutionTime.Postproccessing));
17246
- if (serializedPostprocessingValues !== null) {
17247
- op.needsPostprocessing = true;
17248
- op.postprocessingParams.set(placeholder, literal(serializedPostprocessingValues));
17249
- }
17250
- }
17251
- }
17252
- merge(other) {
17253
- for (const [placeholder, otherValues] of other.values) {
17254
- const currentValues = this.values.get(placeholder) || [];
17255
- const flags = otherValues[0].flags;
17256
- if (flags & I18nParamValueFlags.CloseTag && !(flags & I18nParamValueFlags.OpenTag)) {
17257
- this.values.set(placeholder, [...otherValues, ...currentValues]);
17258
- } else {
17259
- this.values.set(placeholder, [...currentValues, ...otherValues]);
17260
- }
17261
- }
17262
- }
17263
- serializeValues(values) {
17264
- if (values.length === 0) {
17265
- return null;
17266
- }
17267
- const serializedValues = values.map((value) => this.serializeValue(value));
17268
- return serializedValues.length === 1 ? serializedValues[0] : `${LIST_START_MARKER}${serializedValues.join(LIST_DELIMITER)}${LIST_END_MARKER}`;
17269
- }
17270
- serializeValue(value) {
17271
- let tagMarker = "";
17272
- let closeMarker = "";
17273
- if (value.flags & I18nParamValueFlags.ElementTag) {
17274
- tagMarker = ELEMENT_MARKER;
17275
- } else if (value.flags & I18nParamValueFlags.TemplateTag) {
17276
- tagMarker = TEMPLATE_MARKER;
17277
- }
17278
- if (tagMarker !== "") {
17279
- closeMarker = value.flags & I18nParamValueFlags.CloseTag ? TAG_CLOSE_MARKER : "";
17280
- }
17281
- const context = value.subTemplateIndex === null ? "" : `${CONTEXT_MARKER}${value.subTemplateIndex}`;
17282
- if (value.flags & I18nParamValueFlags.OpenTag && value.flags & I18nParamValueFlags.CloseTag) {
17283
- return `${ESCAPE}${tagMarker}${value.value}${context}${ESCAPE}${ESCAPE}${closeMarker}${tagMarker}${value.value}${context}${ESCAPE}`;
17284
- }
17285
- return `${ESCAPE}${closeMarker}${tagMarker}${value.value}${context}${ESCAPE}`;
17286
- }
17287
- };
17288
- function phaseResolveI18nPlaceholders(job) {
17289
- const params = /* @__PURE__ */ new Map();
17290
- const i18nOps = /* @__PURE__ */ new Map();
17291
- resolvePlaceholders(job, params, i18nOps);
17292
- propagatePlaceholders(params, i18nOps);
17293
- for (const [xref, i18nOpParams] of params) {
17294
- i18nOpParams.saveToOp(i18nOps.get(xref));
17295
- }
17296
- for (const op of i18nOps.values()) {
17297
- if (op.xref === op.root) {
17298
- for (const placeholder in op.message.placeholders) {
17299
- if (!op.params.has(placeholder) && !op.postprocessingParams.has(placeholder)) {
17300
- throw Error(`Failed to resolve i18n placeholder: ${placeholder}`);
17301
- }
17302
- }
17303
- }
17304
- }
17305
- }
17306
- function resolvePlaceholders(job, params, i18nOps) {
17307
17506
  for (const unit of job.units) {
17308
- const elements = /* @__PURE__ */ new Map();
17309
- let currentI18nOp = null;
17507
+ let currentOps = null;
17310
17508
  for (const op of unit.create) {
17311
17509
  switch (op.kind) {
17312
17510
  case OpKind.I18nStart:
17313
- i18nOps.set(op.xref, op);
17314
- currentI18nOp = op.kind === OpKind.I18nStart ? op : null;
17511
+ if (!extractedMessageOps.has(op.xref)) {
17512
+ throw Error("Could not find extracted message for i18n op");
17513
+ }
17514
+ currentOps = { i18n: op, extractedMessage: extractedMessageOps.get(op.xref) };
17315
17515
  break;
17316
17516
  case OpKind.I18nEnd:
17317
- currentI18nOp = null;
17517
+ currentOps = null;
17318
17518
  break;
17319
17519
  case OpKind.ElementStart:
17320
17520
  if (op.i18nPlaceholder !== void 0) {
17321
- if (currentI18nOp === null) {
17521
+ if (currentOps === null) {
17322
17522
  throw Error("i18n tag placeholder should only occur inside an i18n block");
17323
17523
  }
17324
- elements.set(op.xref, op);
17325
17524
  const { startName, closeName } = op.i18nPlaceholder;
17326
17525
  let flags = I18nParamValueFlags.ElementTag | I18nParamValueFlags.OpenTag;
17327
17526
  if (closeName === "") {
17328
17527
  flags |= I18nParamValueFlags.CloseTag;
17329
17528
  }
17330
- addParam(params, currentI18nOp, startName, op.slot, currentI18nOp.subTemplateIndex, I18nParamResolutionTime.Creation, flags);
17529
+ addParam(currentOps.extractedMessage.params, startName, op.handle.slot, currentOps.i18n.subTemplateIndex, flags);
17331
17530
  }
17332
17531
  break;
17333
17532
  case OpKind.ElementEnd:
17334
17533
  const startOp = elements.get(op.xref);
17335
17534
  if (startOp && startOp.i18nPlaceholder !== void 0) {
17336
- if (currentI18nOp === null) {
17535
+ if (currentOps === null) {
17337
17536
  throw Error("i18n tag placeholder should only occur inside an i18n block");
17338
17537
  }
17339
17538
  const { closeName } = startOp.i18nPlaceholder;
17340
17539
  if (closeName !== "") {
17341
- addParam(params, currentI18nOp, closeName, startOp.slot, currentI18nOp.subTemplateIndex, I18nParamResolutionTime.Creation, I18nParamValueFlags.ElementTag | I18nParamValueFlags.CloseTag);
17540
+ addParam(currentOps.extractedMessage.params, closeName, startOp.handle.slot, currentOps.i18n.subTemplateIndex, I18nParamValueFlags.ElementTag | I18nParamValueFlags.CloseTag);
17342
17541
  }
17343
17542
  }
17344
17543
  break;
17345
17544
  case OpKind.Template:
17346
17545
  if (op.i18nPlaceholder !== void 0) {
17347
- if (currentI18nOp === null) {
17546
+ if (currentOps === null) {
17348
17547
  throw Error("i18n tag placeholder should only occur inside an i18n block");
17349
17548
  }
17350
- const subTemplateIndex = getSubTemplateIndexForTemplateTag(job, currentI18nOp, op);
17351
- addParam(params, currentI18nOp, op.i18nPlaceholder.startName, op.slot, subTemplateIndex, I18nParamResolutionTime.Creation, I18nParamValueFlags.TemplateTag);
17352
- addParam(params, currentI18nOp, op.i18nPlaceholder.closeName, op.slot, subTemplateIndex, I18nParamResolutionTime.Creation, I18nParamValueFlags.TemplateTag | I18nParamValueFlags.CloseTag);
17549
+ const subTemplateIndex = getSubTemplateIndexForTemplateTag(job, currentOps.i18n, op);
17550
+ addParam(currentOps.extractedMessage.params, op.i18nPlaceholder.startName, op.handle.slot, subTemplateIndex, I18nParamValueFlags.TemplateTag);
17551
+ addParam(currentOps.extractedMessage.params, op.i18nPlaceholder.closeName, op.handle.slot, subTemplateIndex, I18nParamValueFlags.TemplateTag | I18nParamValueFlags.CloseTag);
17353
17552
  }
17354
17553
  break;
17355
17554
  }
17356
17555
  }
17357
- const i18nBlockPlaceholderIndices = /* @__PURE__ */ new Map();
17358
- for (const op of unit.update) {
17359
- if (op.kind === OpKind.I18nExpression) {
17360
- const i18nOp = i18nOps.get(op.owner);
17361
- let index = i18nBlockPlaceholderIndices.get(op.owner) || 0;
17362
- if (!i18nOp) {
17363
- throw Error("Cannot find corresponding i18nStart for i18nExpr");
17364
- }
17365
- addParam(params, i18nOp, op.i18nPlaceholder, index++, i18nOp.subTemplateIndex, op.resolutionTime);
17366
- i18nBlockPlaceholderIndices.set(op.owner, index);
17367
- }
17368
- }
17369
17556
  }
17370
17557
  }
17371
- function addParam(params, i18nOp, placeholder, value, subTemplateIndex, resolutionTime, flags = I18nParamValueFlags.None) {
17372
- const i18nOpParams = params.get(i18nOp.xref) || new I18nPlaceholderParams();
17373
- i18nOpParams.addValue(placeholder, value, subTemplateIndex, resolutionTime, flags);
17374
- params.set(i18nOp.xref, i18nOpParams);
17375
- }
17376
17558
  function getSubTemplateIndexForTemplateTag(job, i18nOp, op) {
17377
17559
  for (const childOp of job.views.get(op.xref).create) {
17378
17560
  if (childOp.kind === OpKind.I18nStart) {
@@ -17381,19 +17563,59 @@ function getSubTemplateIndexForTemplateTag(job, i18nOp, op) {
17381
17563
  }
17382
17564
  return i18nOp.subTemplateIndex;
17383
17565
  }
17384
- function propagatePlaceholders(params, i18nOps) {
17385
- for (const [xref, opParams] of params) {
17386
- const op = i18nOps.get(xref);
17387
- if (op.xref !== op.root) {
17388
- const rootParams = params.get(op.root) || new I18nPlaceholderParams();
17389
- rootParams.merge(opParams);
17566
+ function addParam(params, placeholder, value, subTemplateIndex, flags = I18nParamValueFlags.None) {
17567
+ var _a2;
17568
+ const values = (_a2 = params.get(placeholder)) != null ? _a2 : [];
17569
+ values.push({ value, subTemplateIndex, flags });
17570
+ params.set(placeholder, values);
17571
+ }
17572
+
17573
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_i18n_expression_placeholders.mjs
17574
+ function resolveI18nExpressionPlaceholders(job) {
17575
+ const i18nOps = /* @__PURE__ */ new Map();
17576
+ const extractedMessageOps = /* @__PURE__ */ new Map();
17577
+ for (const unit of job.units) {
17578
+ for (const op of unit.create) {
17579
+ switch (op.kind) {
17580
+ case OpKind.I18nStart:
17581
+ i18nOps.set(op.xref, op);
17582
+ break;
17583
+ case OpKind.ExtractedMessage:
17584
+ extractedMessageOps.set(op.owner, op);
17585
+ break;
17586
+ }
17587
+ }
17588
+ }
17589
+ const expressionIndices = /* @__PURE__ */ new Map();
17590
+ for (const unit of job.units) {
17591
+ for (const op of unit.update) {
17592
+ if (op.kind === OpKind.I18nExpression) {
17593
+ const i18nOp = i18nOps.get(op.owner);
17594
+ let index = expressionIndices.get(op.owner) || 0;
17595
+ if (!i18nOp) {
17596
+ throw Error("Cannot find corresponding i18n block for i18nExpr");
17597
+ }
17598
+ const extractedMessageOp = extractedMessageOps.get(i18nOp.xref);
17599
+ if (!extractedMessageOp) {
17600
+ throw Error("Cannot find extracted message for i18n block");
17601
+ }
17602
+ const params = op.resolutionTime === I18nParamResolutionTime.Creation ? extractedMessageOp.params : extractedMessageOp.postprocessingParams;
17603
+ const values = params.get(op.i18nPlaceholder) || [];
17604
+ values.push({
17605
+ value: index,
17606
+ subTemplateIndex: i18nOp.subTemplateIndex,
17607
+ flags: I18nParamValueFlags.None
17608
+ });
17609
+ params.set(op.i18nPlaceholder, values);
17610
+ expressionIndices.set(op.owner, index + 1);
17611
+ }
17390
17612
  }
17391
17613
  }
17392
17614
  }
17393
17615
 
17394
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_names.mjs
17395
- function phaseResolveNames(cpl) {
17396
- for (const unit of cpl.units) {
17616
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_names.mjs
17617
+ function resolveNames(job) {
17618
+ for (const unit of job.units) {
17397
17619
  processLexicalScope2(unit, unit.create, null);
17398
17620
  processLexicalScope2(unit, unit.update, null);
17399
17621
  }
@@ -17455,7 +17677,7 @@ function processLexicalScope2(unit, ops, savedView) {
17455
17677
  }
17456
17678
  }
17457
17679
 
17458
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_sanitizers.mjs
17680
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/resolve_sanitizers.mjs
17459
17681
  var sanitizers = /* @__PURE__ */ new Map([
17460
17682
  [SecurityContext.HTML, SanitizerFn.Html],
17461
17683
  [SecurityContext.SCRIPT, SanitizerFn.Script],
@@ -17463,7 +17685,7 @@ var sanitizers = /* @__PURE__ */ new Map([
17463
17685
  [SecurityContext.URL, SanitizerFn.Url],
17464
17686
  [SecurityContext.RESOURCE_URL, SanitizerFn.ResourceUrl]
17465
17687
  ]);
17466
- function phaseResolveSanitizers(job) {
17688
+ function resolveSanitizers(job) {
17467
17689
  for (const unit of job.units) {
17468
17690
  const elements = createOpXrefMap(unit);
17469
17691
  let sanitizerFn;
@@ -17492,21 +17714,21 @@ function isIframeElement(op) {
17492
17714
  return op.kind === OpKind.ElementStart && ((_a2 = op.tag) == null ? void 0 : _a2.toLowerCase()) === "iframe";
17493
17715
  }
17494
17716
 
17495
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/save_restore_view.mjs
17496
- function phaseSaveRestoreView(job) {
17497
- for (const view of job.views.values()) {
17498
- view.create.prepend([
17499
- createVariableOp(view.job.allocateXrefId(), {
17717
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/save_restore_view.mjs
17718
+ function saveAndRestoreView(job) {
17719
+ for (const unit of job.units) {
17720
+ unit.create.prepend([
17721
+ createVariableOp(unit.job.allocateXrefId(), {
17500
17722
  kind: SemanticVariableKind.SavedView,
17501
17723
  name: null,
17502
- view: view.xref
17724
+ view: unit.xref
17503
17725
  }, new GetCurrentViewExpr(), VariableFlags.None)
17504
17726
  ]);
17505
- for (const op of view.create) {
17727
+ for (const op of unit.create) {
17506
17728
  if (op.kind !== OpKind.Listener) {
17507
17729
  continue;
17508
17730
  }
17509
- let needsRestoreView = view !== job.root;
17731
+ let needsRestoreView = unit !== job.root;
17510
17732
  if (!needsRestoreView) {
17511
17733
  for (const handlerOp of op.handlerOps) {
17512
17734
  visitExpressionsInOp(handlerOp, (expr) => {
@@ -17517,7 +17739,7 @@ function phaseSaveRestoreView(job) {
17517
17739
  }
17518
17740
  }
17519
17741
  if (needsRestoreView) {
17520
- addSaveRestoreViewOperationToListener(view, op);
17742
+ addSaveRestoreViewOperationToListener(unit, op);
17521
17743
  }
17522
17744
  }
17523
17745
  }
@@ -17537,8 +17759,8 @@ function addSaveRestoreViewOperationToListener(unit, op) {
17537
17759
  }
17538
17760
  }
17539
17761
 
17540
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/slot_allocation.mjs
17541
- function phaseSlotAllocation(job) {
17762
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/slot_allocation.mjs
17763
+ function allocateSlots(job) {
17542
17764
  const slotMap = /* @__PURE__ */ new Map();
17543
17765
  for (const unit of job.units) {
17544
17766
  let slotCount = 0;
@@ -17546,8 +17768,8 @@ function phaseSlotAllocation(job) {
17546
17768
  if (!hasConsumesSlotTrait(op)) {
17547
17769
  continue;
17548
17770
  }
17549
- op.slot = slotCount;
17550
- slotMap.set(op.xref, op.slot);
17771
+ op.handle.slot = slotCount;
17772
+ slotMap.set(op.xref, op.handle.slot);
17551
17773
  slotCount += op.numSlotsUsed;
17552
17774
  }
17553
17775
  unit.decls = slotCount;
@@ -17558,31 +17780,13 @@ function phaseSlotAllocation(job) {
17558
17780
  const childView = job.views.get(op.xref);
17559
17781
  op.decls = childView.decls;
17560
17782
  }
17561
- if (hasUsesSlotIndexTrait(op) && op.target !== null && op.targetSlot === null) {
17562
- if (!slotMap.has(op.target)) {
17563
- throw new Error(`AssertionError: no slot allocated for ${OpKind[op.kind]} target ${op.target}`);
17564
- }
17565
- op.targetSlot = slotMap.get(op.target);
17566
- }
17567
- visitExpressionsInOp(op, (expr) => {
17568
- if (!isIrExpression(expr)) {
17569
- return;
17570
- }
17571
- if (!hasUsesSlotIndexTrait(expr) || expr.targetSlot !== null) {
17572
- return;
17573
- }
17574
- if (!slotMap.has(expr.target)) {
17575
- throw new Error(`AssertionError: no slot allocated for ${expr.constructor.name} target ${expr.target}`);
17576
- }
17577
- expr.targetSlot = slotMap.get(expr.target);
17578
- });
17579
17783
  }
17580
17784
  }
17581
17785
  }
17582
17786
 
17583
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/style_binding_specialization.mjs
17584
- function phaseStyleBindingSpecialization(cpl) {
17585
- for (const unit of cpl.units) {
17787
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/style_binding_specialization.mjs
17788
+ function specializeStyleBindings(job) {
17789
+ for (const unit of job.units) {
17586
17790
  for (const op of unit.update) {
17587
17791
  if (op.kind !== OpKind.Binding) {
17588
17792
  continue;
@@ -17610,9 +17814,9 @@ function phaseStyleBindingSpecialization(cpl) {
17610
17814
  }
17611
17815
  }
17612
17816
 
17613
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/temporary_variables.mjs
17614
- function phaseTemporaryVariables(cpl) {
17615
- for (const unit of cpl.units) {
17817
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/temporary_variables.mjs
17818
+ function generateTemporaryVariables(job) {
17819
+ for (const unit of job.units) {
17616
17820
  unit.create.prepend(generateTemporaries(unit.create));
17617
17821
  unit.update.prepend(generateTemporaries(unit.update));
17618
17822
  }
@@ -17668,8 +17872,106 @@ function assignName(names, expr) {
17668
17872
  expr.name = name;
17669
17873
  }
17670
17874
 
17671
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/var_counting.mjs
17672
- function phaseVarCounting(job) {
17875
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/track_fn_generation.mjs
17876
+ function generateTrackFns(job) {
17877
+ for (const unit of job.units) {
17878
+ for (const op of unit.create) {
17879
+ if (op.kind !== OpKind.RepeaterCreate) {
17880
+ continue;
17881
+ }
17882
+ if (op.trackByFn !== null) {
17883
+ continue;
17884
+ }
17885
+ let usesComponentContext = false;
17886
+ op.track = transformExpressionsInExpression(op.track, (expr) => {
17887
+ if (expr instanceof TrackContextExpr) {
17888
+ usesComponentContext = true;
17889
+ return variable("this");
17890
+ }
17891
+ return expr;
17892
+ }, VisitorContextFlag.None);
17893
+ let fn2;
17894
+ const fnParams = [new FnParam("$index"), new FnParam("$item")];
17895
+ if (usesComponentContext) {
17896
+ fn2 = new FunctionExpr(fnParams, [new ReturnStatement(op.track)]);
17897
+ } else {
17898
+ fn2 = arrowFn(fnParams, op.track);
17899
+ }
17900
+ op.trackByFn = job.pool.getSharedFunctionReference(fn2, "_forTrack");
17901
+ }
17902
+ }
17903
+ }
17904
+
17905
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/track_fn_optimization.mjs
17906
+ function optimizeTrackFns(job) {
17907
+ for (const unit of job.units) {
17908
+ for (const op of unit.create) {
17909
+ if (op.kind !== OpKind.RepeaterCreate) {
17910
+ continue;
17911
+ }
17912
+ if (op.track instanceof ReadVarExpr && op.track.name === "$index") {
17913
+ op.trackByFn = importExpr(Identifiers.repeaterTrackByIndex);
17914
+ } else if (op.track instanceof ReadVarExpr && op.track.name === "$item") {
17915
+ op.trackByFn = importExpr(Identifiers.repeaterTrackByIdentity);
17916
+ } else if (isTrackByFunctionCall(job.root.xref, op.track)) {
17917
+ if (op.track.receiver.receiver.view === unit.xref) {
17918
+ op.trackByFn = op.track.receiver;
17919
+ } else {
17920
+ op.trackByFn = importExpr(Identifiers.componentInstance).callFn([]).prop(op.track.receiver.name);
17921
+ op.track = op.trackByFn;
17922
+ }
17923
+ } else {
17924
+ op.track = transformExpressionsInExpression(op.track, (expr) => {
17925
+ if (expr instanceof ContextExpr) {
17926
+ op.usesComponentInstance = true;
17927
+ return new TrackContextExpr(expr.view);
17928
+ }
17929
+ return expr;
17930
+ }, VisitorContextFlag.None);
17931
+ }
17932
+ }
17933
+ }
17934
+ }
17935
+ function isTrackByFunctionCall(rootView, expr) {
17936
+ if (!(expr instanceof InvokeFunctionExpr) || expr.args.length !== 2) {
17937
+ return false;
17938
+ }
17939
+ if (!(expr.receiver instanceof ReadPropExpr && expr.receiver.receiver instanceof ContextExpr) || expr.receiver.receiver.view !== rootView) {
17940
+ return false;
17941
+ }
17942
+ const [arg0, arg1] = expr.args;
17943
+ if (!(arg0 instanceof ReadVarExpr) || arg0.name !== "$index") {
17944
+ return false;
17945
+ }
17946
+ if (!(arg1 instanceof ReadVarExpr) || arg1.name !== "$item") {
17947
+ return false;
17948
+ }
17949
+ return true;
17950
+ }
17951
+
17952
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/track_variables.mjs
17953
+ function generateTrackVariables(job) {
17954
+ for (const unit of job.units) {
17955
+ for (const op of unit.create) {
17956
+ if (op.kind !== OpKind.RepeaterCreate) {
17957
+ continue;
17958
+ }
17959
+ op.track = transformExpressionsInExpression(op.track, (expr) => {
17960
+ if (expr instanceof LexicalReadExpr) {
17961
+ if (expr.name === op.varNames.$index) {
17962
+ return variable("$index");
17963
+ } else if (expr.name === op.varNames.$implicit) {
17964
+ return variable("$item");
17965
+ }
17966
+ }
17967
+ return expr;
17968
+ }, VisitorContextFlag.None);
17969
+ }
17970
+ }
17971
+ }
17972
+
17973
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/var_counting.mjs
17974
+ function countVariables(job) {
17673
17975
  for (const unit of job.units) {
17674
17976
  let varCount = 0;
17675
17977
  for (const op of unit.ops()) {
@@ -17773,8 +18075,8 @@ function isSingletonInterpolation(expr) {
17773
18075
  return true;
17774
18076
  }
17775
18077
 
17776
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/variable_optimization.mjs
17777
- function phaseVariableOptimization(job) {
18078
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/variable_optimization.mjs
18079
+ function optimizeVariables(job) {
17778
18080
  for (const unit of job.units) {
17779
18081
  inlineAlwaysInlineVariables(unit.create);
17780
18082
  inlineAlwaysInlineVariables(unit.update);
@@ -17796,7 +18098,7 @@ var Fence;
17796
18098
  (function(Fence2) {
17797
18099
  Fence2[Fence2["None"] = 0] = "None";
17798
18100
  Fence2[Fence2["ViewContextRead"] = 1] = "ViewContextRead";
17799
- Fence2[Fence2["ViewContextWrite"] = 3] = "ViewContextWrite";
18101
+ Fence2[Fence2["ViewContextWrite"] = 2] = "ViewContextWrite";
17800
18102
  Fence2[Fence2["SideEffectful"] = 4] = "SideEffectful";
17801
18103
  })(Fence || (Fence = {}));
17802
18104
  function inlineAlwaysInlineVariables(ops) {
@@ -17908,9 +18210,9 @@ function optimizeVariablesInOpList(ops, compatibility) {
17908
18210
  function fencesForIrExpression(expr) {
17909
18211
  switch (expr.kind) {
17910
18212
  case ExpressionKind.NextContext:
17911
- return Fence.ViewContextWrite;
18213
+ return Fence.ViewContextRead | Fence.ViewContextWrite;
17912
18214
  case ExpressionKind.RestoreView:
17913
- return Fence.ViewContextWrite | Fence.SideEffectful;
18215
+ return Fence.ViewContextRead | Fence.ViewContextWrite | Fence.SideEffectful;
17914
18216
  case ExpressionKind.Reference:
17915
18217
  return Fence.ViewContextRead;
17916
18218
  default:
@@ -18023,8 +18325,8 @@ function allowConservativeInlining(decl, target) {
18023
18325
  }
18024
18326
  }
18025
18327
 
18026
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/wrap_icus.mjs
18027
- function phaseWrapIcus(job) {
18328
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/wrap_icus.mjs
18329
+ function wrapI18nIcus(job) {
18028
18330
  for (const unit of job.units) {
18029
18331
  let currentI18nOp = null;
18030
18332
  for (const op of unit.create) {
@@ -18047,159 +18349,66 @@ function phaseWrapIcus(job) {
18047
18349
  }
18048
18350
  }
18049
18351
 
18050
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/track_variables.mjs
18051
- function phaseTrackVariables(job) {
18052
- for (const unit of job.units) {
18053
- for (const op of unit.create) {
18054
- if (op.kind !== OpKind.RepeaterCreate) {
18055
- continue;
18056
- }
18057
- op.track = transformExpressionsInExpression(op.track, (expr) => {
18058
- if (expr instanceof LexicalReadExpr) {
18059
- if (expr.name === op.varNames.$index) {
18060
- return variable("$index");
18061
- } else if (expr.name === op.varNames.$implicit) {
18062
- return variable("$item");
18063
- }
18064
- }
18065
- return expr;
18066
- }, VisitorContextFlag.None);
18067
- }
18068
- }
18069
- }
18070
-
18071
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/track_fn_generation.mjs
18072
- function phaseTrackFnGeneration(job) {
18073
- for (const unit of job.units) {
18074
- for (const op of unit.create) {
18075
- if (op.kind !== OpKind.RepeaterCreate) {
18076
- continue;
18077
- }
18078
- if (op.trackByFn !== null) {
18079
- continue;
18080
- }
18081
- let usesComponentContext = false;
18082
- op.track = transformExpressionsInExpression(op.track, (expr) => {
18083
- if (expr instanceof TrackContextExpr) {
18084
- usesComponentContext = true;
18085
- return variable("this");
18086
- }
18087
- return expr;
18088
- }, VisitorContextFlag.None);
18089
- let fn2;
18090
- const fnParams = [new FnParam("$index"), new FnParam("$item")];
18091
- if (usesComponentContext) {
18092
- fn2 = new FunctionExpr(fnParams, [new ReturnStatement(op.track)]);
18093
- } else {
18094
- fn2 = arrowFn(fnParams, op.track);
18095
- }
18096
- op.trackByFn = job.pool.getSharedFunctionReference(fn2, "_forTrack");
18097
- }
18098
- }
18099
- }
18100
-
18101
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/phases/track_fn_optimization.mjs
18102
- function phaseTrackFnOptimization(job) {
18103
- for (const unit of job.units) {
18104
- for (const op of unit.create) {
18105
- if (op.kind !== OpKind.RepeaterCreate) {
18106
- continue;
18107
- }
18108
- if (op.track instanceof ReadVarExpr && op.track.name === "$index") {
18109
- op.trackByFn = importExpr(Identifiers.repeaterTrackByIndex);
18110
- } else if (op.track instanceof ReadVarExpr && op.track.name === "$item") {
18111
- op.trackByFn = importExpr(Identifiers.repeaterTrackByIdentity);
18112
- } else if (isTrackByFunctionCall(job.root.xref, op.track)) {
18113
- if (op.track.receiver.receiver.view === unit.xref) {
18114
- op.trackByFn = op.track.receiver;
18115
- } else {
18116
- op.trackByFn = importExpr(Identifiers.componentInstance).callFn([]).prop(op.track.receiver.name);
18117
- op.track = op.trackByFn;
18118
- }
18119
- } else {
18120
- op.track = transformExpressionsInExpression(op.track, (expr) => {
18121
- if (expr instanceof ContextExpr) {
18122
- op.usesComponentInstance = true;
18123
- return new TrackContextExpr(expr.view);
18124
- }
18125
- return expr;
18126
- }, VisitorContextFlag.None);
18127
- }
18128
- }
18129
- }
18130
- }
18131
- function isTrackByFunctionCall(rootView, expr) {
18132
- if (!(expr instanceof InvokeFunctionExpr) || expr.args.length !== 2) {
18133
- return false;
18134
- }
18135
- if (!(expr.receiver instanceof ReadPropExpr && expr.receiver.receiver instanceof ContextExpr) || expr.receiver.receiver.view !== rootView) {
18136
- return false;
18137
- }
18138
- const [arg0, arg1] = expr.args;
18139
- if (!(arg0 instanceof ReadVarExpr) || arg0.name !== "$index") {
18140
- return false;
18141
- }
18142
- if (!(arg1 instanceof ReadVarExpr) || arg1.name !== "$item") {
18143
- return false;
18144
- }
18145
- return true;
18146
- }
18147
-
18148
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/emit.mjs
18352
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/emit.mjs
18149
18353
  var phases = [
18150
- { kind: CompilationJobKind.Tmpl, fn: phaseRemoveContentSelectors },
18151
- { kind: CompilationJobKind.Host, fn: phaseHostStylePropertyParsing },
18152
- { kind: CompilationJobKind.Tmpl, fn: phaseNamespace },
18153
- { kind: CompilationJobKind.Both, fn: phaseStyleBindingSpecialization },
18154
- { kind: CompilationJobKind.Both, fn: phaseBindingSpecialization },
18155
- { kind: CompilationJobKind.Tmpl, fn: phasePropagateI18nBlocks },
18156
- { kind: CompilationJobKind.Tmpl, fn: phaseWrapIcus },
18157
- { kind: CompilationJobKind.Both, fn: phaseAttributeExtraction },
18158
- { kind: CompilationJobKind.Both, fn: phaseParseExtractedStyles },
18159
- { kind: CompilationJobKind.Tmpl, fn: phaseRemoveEmptyBindings },
18160
- { kind: CompilationJobKind.Both, fn: phaseCollapseSingletonInterpolations },
18161
- { kind: CompilationJobKind.Both, fn: phaseOrdering },
18162
- { kind: CompilationJobKind.Tmpl, fn: phaseConditionals },
18163
- { kind: CompilationJobKind.Tmpl, fn: phasePipeCreation },
18164
- { kind: CompilationJobKind.Tmpl, fn: phaseI18nTextExtraction },
18165
- { kind: CompilationJobKind.Tmpl, fn: phaseIcuExtraction },
18166
- { kind: CompilationJobKind.Tmpl, fn: phaseApplyI18nExpressions },
18167
- { kind: CompilationJobKind.Tmpl, fn: phasePipeVariadic },
18168
- { kind: CompilationJobKind.Both, fn: phasePureLiteralStructures },
18169
- { kind: CompilationJobKind.Tmpl, fn: phaseGenerateProjectionDef },
18170
- { kind: CompilationJobKind.Tmpl, fn: phaseGenerateVariables },
18171
- { kind: CompilationJobKind.Tmpl, fn: phaseSaveRestoreView },
18172
- { kind: CompilationJobKind.Tmpl, fn: phaseFindAnyCasts },
18173
- { kind: CompilationJobKind.Both, fn: phaseResolveDollarEvent },
18174
- { kind: CompilationJobKind.Tmpl, fn: phaseRepeaterDerivedVars },
18175
- { kind: CompilationJobKind.Tmpl, fn: phaseTrackVariables },
18176
- { kind: CompilationJobKind.Both, fn: phaseResolveNames },
18177
- { kind: CompilationJobKind.Tmpl, fn: phaseTrackFnOptimization },
18178
- { kind: CompilationJobKind.Both, fn: phaseResolveContexts },
18179
- { kind: CompilationJobKind.Tmpl, fn: phaseResolveSanitizers },
18180
- { kind: CompilationJobKind.Tmpl, fn: phaseLocalRefs },
18181
- { kind: CompilationJobKind.Both, fn: phaseNullishCoalescing },
18182
- { kind: CompilationJobKind.Both, fn: phaseExpandSafeReads },
18183
- { kind: CompilationJobKind.Both, fn: phaseTemporaryVariables },
18184
- { kind: CompilationJobKind.Tmpl, fn: phaseSlotAllocation },
18185
- { kind: CompilationJobKind.Tmpl, fn: phaseResolveI18nPlaceholders },
18186
- { kind: CompilationJobKind.Tmpl, fn: phaseTrackFnGeneration },
18187
- { kind: CompilationJobKind.Tmpl, fn: phaseI18nMessageExtraction },
18188
- { kind: CompilationJobKind.Tmpl, fn: phaseI18nConstCollection },
18189
- { kind: CompilationJobKind.Tmpl, fn: phaseConstTraitCollection },
18190
- { kind: CompilationJobKind.Both, fn: phaseConstCollection },
18191
- { kind: CompilationJobKind.Tmpl, fn: phaseAssignI18nSlotDependencies },
18192
- { kind: CompilationJobKind.Both, fn: phaseVarCounting },
18193
- { kind: CompilationJobKind.Tmpl, fn: phaseGenerateAdvance },
18194
- { kind: CompilationJobKind.Both, fn: phaseVariableOptimization },
18195
- { kind: CompilationJobKind.Both, fn: phaseNaming },
18196
- { kind: CompilationJobKind.Tmpl, fn: phaseMergeNextContext },
18197
- { kind: CompilationJobKind.Tmpl, fn: phaseNgContainer },
18198
- { kind: CompilationJobKind.Tmpl, fn: phaseEmptyElements },
18199
- { kind: CompilationJobKind.Tmpl, fn: phaseNonbindable },
18200
- { kind: CompilationJobKind.Both, fn: phasePureFunctionExtraction },
18201
- { kind: CompilationJobKind.Both, fn: phaseReify },
18202
- { kind: CompilationJobKind.Both, fn: phaseChaining }
18354
+ { kind: CompilationJobKind.Tmpl, fn: removeContentSelectors },
18355
+ { kind: CompilationJobKind.Host, fn: parseHostStyleProperties },
18356
+ { kind: CompilationJobKind.Tmpl, fn: emitNamespaceChanges },
18357
+ { kind: CompilationJobKind.Both, fn: specializeStyleBindings },
18358
+ { kind: CompilationJobKind.Both, fn: specializeBindings },
18359
+ { kind: CompilationJobKind.Tmpl, fn: propagateI18nBlocks },
18360
+ { kind: CompilationJobKind.Tmpl, fn: wrapI18nIcus },
18361
+ { kind: CompilationJobKind.Both, fn: extractAttributes },
18362
+ { kind: CompilationJobKind.Both, fn: parseExtractedStyles },
18363
+ { kind: CompilationJobKind.Tmpl, fn: removeEmptyBindings },
18364
+ { kind: CompilationJobKind.Both, fn: collapseSingletonInterpolations },
18365
+ { kind: CompilationJobKind.Both, fn: orderOps },
18366
+ { kind: CompilationJobKind.Tmpl, fn: generateConditionalExpressions },
18367
+ { kind: CompilationJobKind.Tmpl, fn: createPipes },
18368
+ { kind: CompilationJobKind.Tmpl, fn: configureDeferInstructions },
18369
+ { kind: CompilationJobKind.Tmpl, fn: extractI18nText },
18370
+ { kind: CompilationJobKind.Tmpl, fn: extractI18nICUs },
18371
+ { kind: CompilationJobKind.Tmpl, fn: applyI18nExpressions },
18372
+ { kind: CompilationJobKind.Tmpl, fn: createVariadicPipes },
18373
+ { kind: CompilationJobKind.Both, fn: generatePureLiteralStructures },
18374
+ { kind: CompilationJobKind.Tmpl, fn: generateProjectionDefs },
18375
+ { kind: CompilationJobKind.Tmpl, fn: generateVariables },
18376
+ { kind: CompilationJobKind.Tmpl, fn: saveAndRestoreView },
18377
+ { kind: CompilationJobKind.Tmpl, fn: deleteAnyCasts },
18378
+ { kind: CompilationJobKind.Both, fn: resolveDollarEvent },
18379
+ { kind: CompilationJobKind.Tmpl, fn: generateRepeaterDerivedVars },
18380
+ { kind: CompilationJobKind.Tmpl, fn: generateTrackVariables },
18381
+ { kind: CompilationJobKind.Both, fn: resolveNames },
18382
+ { kind: CompilationJobKind.Tmpl, fn: resolveDeferTargetNames },
18383
+ { kind: CompilationJobKind.Tmpl, fn: optimizeTrackFns },
18384
+ { kind: CompilationJobKind.Both, fn: resolveContexts },
18385
+ { kind: CompilationJobKind.Tmpl, fn: resolveSanitizers },
18386
+ { kind: CompilationJobKind.Tmpl, fn: liftLocalRefs },
18387
+ { kind: CompilationJobKind.Both, fn: generateNullishCoalesceExpressions },
18388
+ { kind: CompilationJobKind.Both, fn: expandSafeReads },
18389
+ { kind: CompilationJobKind.Both, fn: generateTemporaryVariables },
18390
+ { kind: CompilationJobKind.Tmpl, fn: allocateSlots },
18391
+ { kind: CompilationJobKind.Tmpl, fn: extractI18nMessages },
18392
+ { kind: CompilationJobKind.Tmpl, fn: resolveI18nElementPlaceholders },
18393
+ { kind: CompilationJobKind.Tmpl, fn: resolveI18nExpressionPlaceholders },
18394
+ { kind: CompilationJobKind.Tmpl, fn: propogateI18nPlaceholders },
18395
+ { kind: CompilationJobKind.Tmpl, fn: formatI18nParams },
18396
+ { kind: CompilationJobKind.Tmpl, fn: generateTrackFns },
18397
+ { kind: CompilationJobKind.Tmpl, fn: collectI18nConsts },
18398
+ { kind: CompilationJobKind.Tmpl, fn: collectConstExpressions },
18399
+ { kind: CompilationJobKind.Both, fn: collectElementConsts },
18400
+ { kind: CompilationJobKind.Tmpl, fn: assignI18nSlotDependencies },
18401
+ { kind: CompilationJobKind.Both, fn: countVariables },
18402
+ { kind: CompilationJobKind.Tmpl, fn: generateAdvance },
18403
+ { kind: CompilationJobKind.Both, fn: optimizeVariables },
18404
+ { kind: CompilationJobKind.Both, fn: nameFunctionsAndVariables },
18405
+ { kind: CompilationJobKind.Tmpl, fn: mergeNextContextExpressions },
18406
+ { kind: CompilationJobKind.Tmpl, fn: generateNgContainerOps },
18407
+ { kind: CompilationJobKind.Tmpl, fn: collapseEmptyInstructions },
18408
+ { kind: CompilationJobKind.Tmpl, fn: disableBindings },
18409
+ { kind: CompilationJobKind.Both, fn: extractPureFunctions },
18410
+ { kind: CompilationJobKind.Both, fn: reify },
18411
+ { kind: CompilationJobKind.Both, fn: chain }
18203
18412
  ];
18204
18413
  function transform(job, kind) {
18205
18414
  for (const phase of phases) {
@@ -18303,12 +18512,12 @@ function emitHostBindingFunction(job) {
18303
18512
  );
18304
18513
  }
18305
18514
 
18306
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/src/ingest.mjs
18515
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/src/ingest.mjs
18307
18516
  var compatibilityMode = CompatibilityMode.TemplateDefinitionBuilder;
18308
18517
  function ingestComponent(componentName, template2, constantPool, relativeContextFilePath, i18nUseExternalIds) {
18309
- const cpl = new ComponentCompilationJob(componentName, constantPool, compatibilityMode, relativeContextFilePath, i18nUseExternalIds);
18310
- ingestNodes(cpl.root, template2);
18311
- return cpl;
18518
+ const job = new ComponentCompilationJob(componentName, constantPool, compatibilityMode, relativeContextFilePath, i18nUseExternalIds);
18519
+ ingestNodes(job.root, template2);
18520
+ return job;
18312
18521
  }
18313
18522
  function ingestHostBinding(input, bindingParser, constantPool) {
18314
18523
  var _a2, _b2, _c2;
@@ -18357,7 +18566,7 @@ function ingestHostAttribute(job, name, value) {
18357
18566
  job.root.update.push(attrBinding);
18358
18567
  }
18359
18568
  function ingestHostEvent(job, event) {
18360
- const eventBinding = createListenerOp(job.root.xref, event.name, null, event.targetOrPhase, true, event.sourceSpan);
18569
+ const eventBinding = createListenerOp(job.root.xref, new SlotHandle(), event.name, null, event.targetOrPhase, true, event.sourceSpan);
18361
18570
  eventBinding.handlerOps.push(createStatementOp(new ReturnStatement(convertAst(event.handler.ast, job, event.sourceSpan), event.handlerSpan)));
18362
18571
  job.root.create.push(eventBinding);
18363
18572
  }
@@ -18392,10 +18601,6 @@ function ingestElement(unit, element2) {
18392
18601
  if (element2.i18n !== void 0 && !(element2.i18n instanceof Message || element2.i18n instanceof TagPlaceholder)) {
18393
18602
  throw Error(`Unhandled i18n metadata type for element: ${element2.i18n.constructor.name}`);
18394
18603
  }
18395
- const staticAttributes = {};
18396
- for (const attr of element2.attributes) {
18397
- staticAttributes[attr.name] = attr.value;
18398
- }
18399
18604
  const id = unit.job.allocateXrefId();
18400
18605
  const [namespaceKey, elementName] = splitNsName(element2.name);
18401
18606
  const startOp = createElementStartOp(elementName, id, namespaceForKey(namespaceKey), element2.i18n instanceof TagPlaceholder ? element2.i18n : void 0, element2.startSourceSpan);
@@ -18422,7 +18627,9 @@ function ingestTemplate(unit, tmpl) {
18422
18627
  [namespacePrefix, tagNameWithoutNamespace] = splitNsName(tmpl.tagName);
18423
18628
  }
18424
18629
  const i18nPlaceholder = tmpl.i18n instanceof TagPlaceholder ? tmpl.i18n : void 0;
18425
- const tplOp = createTemplateOp(childView.xref, tagNameWithoutNamespace, namespaceForKey(namespacePrefix), false, i18nPlaceholder, tmpl.startSourceSpan);
18630
+ const namespace = namespaceForKey(namespacePrefix);
18631
+ const functionNameSuffix = tagNameWithoutNamespace === null ? "" : prefixWithNamespace(tagNameWithoutNamespace, namespace);
18632
+ const tplOp = createTemplateOp(childView.xref, tagNameWithoutNamespace, functionNameSuffix, namespace, i18nPlaceholder, tmpl.startSourceSpan);
18426
18633
  unit.create.push(tplOp);
18427
18634
  ingestBindings(unit, tplOp, tmpl);
18428
18635
  ingestReferences(tplOp, tmpl);
@@ -18466,39 +18673,50 @@ function ingestBoundText(unit, text2) {
18466
18673
  }
18467
18674
  function ingestIfBlock(unit, ifBlock) {
18468
18675
  let firstXref = null;
18676
+ let firstSlotHandle = null;
18469
18677
  let conditions = [];
18470
- for (const ifCase of ifBlock.branches) {
18678
+ for (let i = 0; i < ifBlock.branches.length; i++) {
18679
+ const ifCase = ifBlock.branches[i];
18471
18680
  const cView = unit.job.allocateView(unit.xref);
18681
+ let tagName = null;
18682
+ if (i === 0) {
18683
+ tagName = ingestControlFlowInsertionPoint(unit, cView.xref, ifCase);
18684
+ }
18472
18685
  if (ifCase.expressionAlias !== null) {
18473
18686
  cView.contextVariables.set(ifCase.expressionAlias.name, CTX_REF);
18474
18687
  }
18688
+ const tmplOp = createTemplateOp(cView.xref, tagName, "Conditional", Namespace.HTML, void 0, ifCase.sourceSpan);
18689
+ unit.create.push(tmplOp);
18475
18690
  if (firstXref === null) {
18476
18691
  firstXref = cView.xref;
18692
+ firstSlotHandle = tmplOp.handle;
18477
18693
  }
18478
- unit.create.push(createTemplateOp(cView.xref, "Conditional", Namespace.HTML, true, void 0, ifCase.sourceSpan));
18479
18694
  const caseExpr = ifCase.expression ? convertAst(ifCase.expression, unit.job, null) : null;
18480
- const conditionalCaseExpr = new ConditionalCaseExpr(caseExpr, cView.xref, ifCase.expressionAlias);
18695
+ const conditionalCaseExpr = new ConditionalCaseExpr(caseExpr, tmplOp.xref, tmplOp.handle, ifCase.expressionAlias);
18481
18696
  conditions.push(conditionalCaseExpr);
18482
18697
  ingestNodes(cView, ifCase.children);
18483
18698
  }
18484
- const conditional2 = createConditionalOp(firstXref, null, conditions, ifBlock.sourceSpan);
18699
+ const conditional2 = createConditionalOp(firstXref, firstSlotHandle, null, conditions, ifBlock.sourceSpan);
18485
18700
  unit.update.push(conditional2);
18486
18701
  }
18487
18702
  function ingestSwitchBlock(unit, switchBlock) {
18488
18703
  let firstXref = null;
18704
+ let firstSlotHandle = null;
18489
18705
  let conditions = [];
18490
18706
  for (const switchCase of switchBlock.cases) {
18491
18707
  const cView = unit.job.allocateView(unit.xref);
18708
+ const tmplOp = createTemplateOp(cView.xref, null, "Case", Namespace.HTML, void 0, switchCase.sourceSpan);
18709
+ unit.create.push(tmplOp);
18492
18710
  if (firstXref === null) {
18493
18711
  firstXref = cView.xref;
18712
+ firstSlotHandle = tmplOp.handle;
18494
18713
  }
18495
- unit.create.push(createTemplateOp(cView.xref, "Case", Namespace.HTML, true, void 0, switchCase.sourceSpan));
18496
18714
  const caseExpr = switchCase.expression ? convertAst(switchCase.expression, unit.job, switchBlock.startSourceSpan) : null;
18497
- const conditionalCaseExpr = new ConditionalCaseExpr(caseExpr, cView.xref);
18715
+ const conditionalCaseExpr = new ConditionalCaseExpr(caseExpr, tmplOp.xref, tmplOp.handle);
18498
18716
  conditions.push(conditionalCaseExpr);
18499
18717
  ingestNodes(cView, switchCase.children);
18500
18718
  }
18501
- const conditional2 = createConditionalOp(firstXref, convertAst(switchBlock.expression, unit.job, null), conditions, switchBlock.sourceSpan);
18719
+ const conditional2 = createConditionalOp(firstXref, firstSlotHandle, convertAst(switchBlock.expression, unit.job, null), conditions, switchBlock.sourceSpan);
18502
18720
  unit.update.push(conditional2);
18503
18721
  }
18504
18722
  function ingestDeferView(unit, suffix, children, sourceSpan) {
@@ -18507,38 +18725,80 @@ function ingestDeferView(unit, suffix, children, sourceSpan) {
18507
18725
  }
18508
18726
  const secondaryView = unit.job.allocateView(unit.xref);
18509
18727
  ingestNodes(secondaryView, children);
18510
- const templateOp = createTemplateOp(secondaryView.xref, `Defer${suffix}`, Namespace.HTML, true, void 0, sourceSpan);
18728
+ const templateOp = createTemplateOp(secondaryView.xref, null, `Defer${suffix}`, Namespace.HTML, void 0, sourceSpan);
18511
18729
  unit.create.push(templateOp);
18512
18730
  return templateOp;
18513
18731
  }
18514
18732
  function ingestDeferBlock(unit, deferBlock) {
18515
- var _a2, _b2, _c2, _d2, _e2, _f2;
18733
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
18516
18734
  const main = ingestDeferView(unit, "", deferBlock.children, deferBlock.sourceSpan);
18517
18735
  const loading = ingestDeferView(unit, "Loading", (_a2 = deferBlock.loading) == null ? void 0 : _a2.children, (_b2 = deferBlock.loading) == null ? void 0 : _b2.sourceSpan);
18518
18736
  const placeholder = ingestDeferView(unit, "Placeholder", (_c2 = deferBlock.placeholder) == null ? void 0 : _c2.children, (_d2 = deferBlock.placeholder) == null ? void 0 : _d2.sourceSpan);
18519
18737
  const error2 = ingestDeferView(unit, "Error", (_e2 = deferBlock.error) == null ? void 0 : _e2.children, (_f2 = deferBlock.error) == null ? void 0 : _f2.sourceSpan);
18520
- const deferOp = createDeferOp(unit.job.allocateXrefId(), main.xref, deferBlock.sourceSpan);
18738
+ const deferXref = unit.job.allocateXrefId();
18739
+ const deferOp = createDeferOp(deferXref, main.xref, main.handle, deferBlock.sourceSpan);
18740
+ deferOp.placeholderView = (_g = placeholder == null ? void 0 : placeholder.xref) != null ? _g : null;
18741
+ deferOp.placeholderSlot = (_h = placeholder == null ? void 0 : placeholder.handle) != null ? _h : null;
18742
+ deferOp.loadingSlot = (_i = loading == null ? void 0 : loading.handle) != null ? _i : null;
18743
+ deferOp.errorSlot = (_j = error2 == null ? void 0 : error2.handle) != null ? _j : null;
18744
+ deferOp.placeholderMinimumTime = (_l = (_k = deferBlock.placeholder) == null ? void 0 : _k.minimumTime) != null ? _l : null;
18745
+ deferOp.loadingMinimumTime = (_n = (_m = deferBlock.loading) == null ? void 0 : _m.minimumTime) != null ? _n : null;
18746
+ deferOp.loadingAfterTime = (_p = (_o = deferBlock.loading) == null ? void 0 : _o.afterTime) != null ? _p : null;
18521
18747
  unit.create.push(deferOp);
18522
- if (loading && deferBlock.loading) {
18523
- deferOp.loading = createDeferSecondaryOp(deferOp.xref, loading.xref, DeferSecondaryKind.Loading);
18524
- if (deferBlock.loading.afterTime !== null || deferBlock.loading.minimumTime !== null) {
18525
- deferOp.loading.constValue = [deferBlock.loading.minimumTime, deferBlock.loading.afterTime];
18526
- }
18527
- unit.create.push(deferOp.loading);
18528
- }
18529
- if (placeholder && deferBlock.placeholder) {
18530
- deferOp.placeholder = createDeferSecondaryOp(deferOp.xref, placeholder.xref, DeferSecondaryKind.Placeholder);
18531
- if (deferBlock.placeholder.minimumTime !== null) {
18532
- deferOp.placeholder.constValue = [deferBlock.placeholder.minimumTime];
18533
- }
18534
- unit.create.push(deferOp.placeholder);
18535
- }
18536
- if (error2 && deferBlock.error) {
18537
- deferOp.error = createDeferSecondaryOp(deferOp.xref, error2.xref, DeferSecondaryKind.Error);
18538
- unit.create.push(deferOp.error);
18539
- }
18540
- const deferOnOp = createDeferOnOp(unit.job.allocateXrefId(), null);
18541
- unit.create.push(deferOnOp);
18748
+ let prefetch = false;
18749
+ let deferOnOps = [];
18750
+ for (const triggers of [deferBlock.triggers, deferBlock.prefetchTriggers]) {
18751
+ if (triggers.idle !== void 0) {
18752
+ const deferOnOp = createDeferOnOp(deferXref, { kind: DeferTriggerKind.Idle }, prefetch, null);
18753
+ deferOnOps.push(deferOnOp);
18754
+ }
18755
+ if (triggers.immediate !== void 0) {
18756
+ const deferOnOp = createDeferOnOp(deferXref, { kind: DeferTriggerKind.Immediate }, prefetch, null);
18757
+ deferOnOps.push(deferOnOp);
18758
+ }
18759
+ if (triggers.timer !== void 0) {
18760
+ const deferOnOp = createDeferOnOp(deferXref, { kind: DeferTriggerKind.Timer, delay: triggers.timer.delay }, prefetch, null);
18761
+ deferOnOps.push(deferOnOp);
18762
+ }
18763
+ if (triggers.hover !== void 0) {
18764
+ const deferOnOp = createDeferOnOp(deferXref, {
18765
+ kind: DeferTriggerKind.Hover,
18766
+ targetName: triggers.hover.reference,
18767
+ targetXref: null,
18768
+ targetSlot: null,
18769
+ targetView: null,
18770
+ targetSlotViewSteps: null
18771
+ }, prefetch, null);
18772
+ deferOnOps.push(deferOnOp);
18773
+ }
18774
+ if (triggers.interaction !== void 0) {
18775
+ const deferOnOp = createDeferOnOp(deferXref, {
18776
+ kind: DeferTriggerKind.Interaction,
18777
+ targetName: triggers.interaction.reference,
18778
+ targetXref: null,
18779
+ targetSlot: null,
18780
+ targetView: null,
18781
+ targetSlotViewSteps: null
18782
+ }, prefetch, null);
18783
+ deferOnOps.push(deferOnOp);
18784
+ }
18785
+ if (triggers.viewport !== void 0) {
18786
+ const deferOnOp = createDeferOnOp(deferXref, {
18787
+ kind: DeferTriggerKind.Viewport,
18788
+ targetName: triggers.viewport.reference,
18789
+ targetXref: null,
18790
+ targetSlot: null,
18791
+ targetView: null,
18792
+ targetSlotViewSteps: null
18793
+ }, prefetch, null);
18794
+ deferOnOps.push(deferOnOp);
18795
+ }
18796
+ if (deferOnOps.length === 0) {
18797
+ deferOnOps.push(createDeferOnOp(deferXref, { kind: DeferTriggerKind.Idle }, false, null));
18798
+ }
18799
+ prefetch = true;
18800
+ }
18801
+ unit.create.push(deferOnOps);
18542
18802
  }
18543
18803
  function ingestIcu(unit, icu) {
18544
18804
  var _a2;
@@ -18585,10 +18845,11 @@ function ingestForBlock(unit, forBlock) {
18585
18845
  $odd: forBlock.contextVariables.$odd.name,
18586
18846
  $implicit: forBlock.item.name
18587
18847
  };
18588
- const repeaterCreate2 = createRepeaterCreateOp(repeaterView.xref, (_a2 = emptyView == null ? void 0 : emptyView.xref) != null ? _a2 : null, track, varNames, forBlock.sourceSpan);
18848
+ const tagName = ingestControlFlowInsertionPoint(unit, repeaterView.xref, forBlock);
18849
+ const repeaterCreate2 = createRepeaterCreateOp(repeaterView.xref, (_a2 = emptyView == null ? void 0 : emptyView.xref) != null ? _a2 : null, tagName, track, varNames, forBlock.sourceSpan);
18589
18850
  unit.create.push(repeaterCreate2);
18590
18851
  const expression = convertAst(forBlock.expression, unit.job, convertSourceSpan(forBlock.expression.span, forBlock.sourceSpan));
18591
- const repeater2 = createRepeaterOp(repeaterCreate2.xref, expression, forBlock.sourceSpan);
18852
+ const repeater2 = createRepeaterOp(repeaterCreate2.xref, repeaterCreate2.handle, expression, forBlock.sourceSpan);
18592
18853
  unit.update.push(repeater2);
18593
18854
  }
18594
18855
  function convertAst(ast, job, baseSourceSpan) {
@@ -18637,7 +18898,7 @@ function convertAst(ast, job, baseSourceSpan) {
18637
18898
  } else if (ast instanceof NonNullAssert) {
18638
18899
  return convertAst(ast.expression, job, baseSourceSpan);
18639
18900
  } else if (ast instanceof BindingPipe) {
18640
- return new PipeBindingExpr(job.allocateXrefId(), ast.name, [
18901
+ return new PipeBindingExpr(job.allocateXrefId(), new SlotHandle(), ast.name, [
18641
18902
  convertAst(ast.exp, job, baseSourceSpan),
18642
18903
  ...ast.args.map((arg) => convertAst(arg, job, baseSourceSpan))
18643
18904
  ]);
@@ -18690,7 +18951,7 @@ function ingestBindings(unit, op, element2) {
18690
18951
  unit.create.push(createExtractedAttributeOp(op.xref, BindingKind.Property, output.name, null));
18691
18952
  continue;
18692
18953
  }
18693
- listenerOp = createListenerOp(op.xref, output.name, op.tag, output.phase, false, output.sourceSpan);
18954
+ listenerOp = createListenerOp(op.xref, op.handle, output.name, op.tag, output.phase, false, output.sourceSpan);
18694
18955
  let handlerExprs;
18695
18956
  let handler = output.handler;
18696
18957
  if (handler instanceof ASTWithSource) {
@@ -18771,11 +19032,32 @@ function convertSourceSpan(span, baseSourceSpan) {
18771
19032
  const fullStart = baseSourceSpan.fullStart.moveBy(span.start);
18772
19033
  return new ParseSourceSpan(start, end, fullStart);
18773
19034
  }
19035
+ function ingestControlFlowInsertionPoint(unit, xref, node) {
19036
+ let root = null;
19037
+ for (const child of node.children) {
19038
+ if (child instanceof Comment) {
19039
+ continue;
19040
+ }
19041
+ if (root !== null) {
19042
+ return null;
19043
+ }
19044
+ if (child instanceof Element || child instanceof Template && child.tagName !== null) {
19045
+ root = child;
19046
+ }
19047
+ }
19048
+ if (root !== null) {
19049
+ for (const attr of root.attributes) {
19050
+ ingestBinding(unit, xref, attr.name, literal(attr.value), 1, null, SecurityContext.NONE, attr.sourceSpan, BindingFlags.TextValue);
19051
+ }
19052
+ return root instanceof Element ? root.name : root.tagName;
19053
+ }
19054
+ return null;
19055
+ }
18774
19056
 
18775
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template/pipeline/switch/index.mjs
19057
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template/pipeline/switch/index.mjs
18776
19058
  var USE_TEMPLATE_PIPELINE = false;
18777
19059
 
18778
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/styling_builder.mjs
19060
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/styling_builder.mjs
18779
19061
  var IMPORTANT_FLAG = "!important";
18780
19062
  var MIN_STYLING_BINDING_SLOTS_REQUIRED = 2;
18781
19063
  var StylingBuilder = class {
@@ -19108,7 +19390,7 @@ function isEmptyExpression(ast) {
19108
19390
  return ast instanceof EmptyExpr;
19109
19391
  }
19110
19392
 
19111
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/html_parser.mjs
19393
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/html_parser.mjs
19112
19394
  var HtmlParser = class extends Parser2 {
19113
19395
  constructor() {
19114
19396
  super(getHtmlTagDefinition);
@@ -19118,7 +19400,7 @@ var HtmlParser = class extends Parser2 {
19118
19400
  }
19119
19401
  };
19120
19402
 
19121
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/html_whitespaces.mjs
19403
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/html_whitespaces.mjs
19122
19404
  var PRESERVE_WS_ATTR_NAME = "ngPreserveWhitespaces";
19123
19405
  var SKIP_WS_TRIM_TAGS = /* @__PURE__ */ new Set(["pre", "template", "textarea", "script", "style"]);
19124
19406
  var WS_CHARS = " \f\n\r \v\u1680\u180E\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF";
@@ -19184,7 +19466,7 @@ function visitAllWithSiblings(visitor, nodes) {
19184
19466
  return result;
19185
19467
  }
19186
19468
 
19187
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template_parser/binding_parser.mjs
19469
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template_parser/binding_parser.mjs
19188
19470
  var PROPERTY_PARTS_SEPARATOR = ".";
19189
19471
  var ATTRIBUTE_PREFIX = "attr";
19190
19472
  var CLASS_PREFIX = "class";
@@ -19504,7 +19786,7 @@ function moveParseSourceSpan(sourceSpan, absoluteSpan) {
19504
19786
  return new ParseSourceSpan(sourceSpan.start.moveBy(startDiff), sourceSpan.end.moveBy(endDiff), sourceSpan.fullStart.moveBy(startDiff), sourceSpan.details);
19505
19787
  }
19506
19788
 
19507
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/style_url_resolver.mjs
19789
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/style_url_resolver.mjs
19508
19790
  function isStyleUrlResolvable(url) {
19509
19791
  if (url == null || url.length === 0 || url[0] == "/")
19510
19792
  return false;
@@ -19513,7 +19795,7 @@ function isStyleUrlResolvable(url) {
19513
19795
  }
19514
19796
  var URL_WITH_SCHEMA_REGEXP = /^([^:/?#]+):/;
19515
19797
 
19516
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/template_parser/template_preparser.mjs
19798
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/template_parser/template_preparser.mjs
19517
19799
  var NG_CONTENT_SELECT_ATTR = "select";
19518
19800
  var LINK_ELEMENT = "link";
19519
19801
  var LINK_STYLE_REL_ATTR = "rel";
@@ -19583,8 +19865,8 @@ function normalizeNgContentSelect(selectAttr) {
19583
19865
  return selectAttr;
19584
19866
  }
19585
19867
 
19586
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_control_flow.mjs
19587
- var FOR_LOOP_EXPRESSION_PATTERN = /^\s*([0-9A-Za-z_$]*)\s+of\s+(.*)/;
19868
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_control_flow.mjs
19869
+ var FOR_LOOP_EXPRESSION_PATTERN = /^\s*([0-9A-Za-z_$]*)\s+of\s+([\S\s]*)/;
19588
19870
  var FOR_LOOP_TRACK_PATTERN = /^track\s+([\S\s]*)/;
19589
19871
  var CONDITIONAL_ALIAS_PATTERN = /^as\s+(.*)/;
19590
19872
  var ELSE_IF_PATTERN = /^else[^\S\r\n]+if/;
@@ -19601,18 +19883,18 @@ function createIfBlock(ast, connectedBlocks, visitor, bindingParser) {
19601
19883
  const branches = [];
19602
19884
  const mainBlockParams = parseConditionalBlockParameters(ast, errors, bindingParser);
19603
19885
  if (mainBlockParams !== null) {
19604
- branches.push(new IfBlockBranch(mainBlockParams.expression, visitAll2(visitor, ast.children, ast.children), mainBlockParams.expressionAlias, ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan));
19886
+ branches.push(new IfBlockBranch(mainBlockParams.expression, visitAll2(visitor, ast.children, ast.children), mainBlockParams.expressionAlias, ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan, ast.nameSpan));
19605
19887
  }
19606
19888
  for (const block of connectedBlocks) {
19607
19889
  if (ELSE_IF_PATTERN.test(block.name)) {
19608
19890
  const params = parseConditionalBlockParameters(block, errors, bindingParser);
19609
19891
  if (params !== null) {
19610
19892
  const children = visitAll2(visitor, block.children, block.children);
19611
- branches.push(new IfBlockBranch(params.expression, children, params.expressionAlias, block.sourceSpan, block.startSourceSpan, block.endSourceSpan));
19893
+ branches.push(new IfBlockBranch(params.expression, children, params.expressionAlias, block.sourceSpan, block.startSourceSpan, block.endSourceSpan, block.nameSpan));
19612
19894
  }
19613
19895
  } else if (block.name === "else") {
19614
19896
  const children = visitAll2(visitor, block.children, block.children);
19615
- branches.push(new IfBlockBranch(null, children, null, block.sourceSpan, block.startSourceSpan, block.endSourceSpan));
19897
+ branches.push(new IfBlockBranch(null, children, null, block.sourceSpan, block.startSourceSpan, block.endSourceSpan, block.nameSpan));
19616
19898
  }
19617
19899
  }
19618
19900
  const ifBlockStartSourceSpan = branches.length > 0 ? branches[0].startSourceSpan : ast.startSourceSpan;
@@ -19623,7 +19905,7 @@ function createIfBlock(ast, connectedBlocks, visitor, bindingParser) {
19623
19905
  wholeSourceSpan = new ParseSourceSpan(ifBlockStartSourceSpan.start, lastBranch.sourceSpan.end);
19624
19906
  }
19625
19907
  return {
19626
- node: new IfBlock(branches, wholeSourceSpan, ast.startSourceSpan, ifBlockEndSourceSpan),
19908
+ node: new IfBlock(branches, wholeSourceSpan, ast.startSourceSpan, ifBlockEndSourceSpan, ast.nameSpan),
19627
19909
  errors
19628
19910
  };
19629
19911
  }
@@ -19640,7 +19922,7 @@ function createForLoop(ast, connectedBlocks, visitor, bindingParser) {
19640
19922
  } else if (block.parameters.length > 0) {
19641
19923
  errors.push(new ParseError(block.sourceSpan, "@empty block cannot have parameters"));
19642
19924
  } else {
19643
- empty = new ForLoopBlockEmpty(visitAll2(visitor, block.children, block.children), block.sourceSpan, block.startSourceSpan, block.endSourceSpan);
19925
+ empty = new ForLoopBlockEmpty(visitAll2(visitor, block.children, block.children), block.sourceSpan, block.startSourceSpan, block.endSourceSpan, block.nameSpan);
19644
19926
  }
19645
19927
  } else {
19646
19928
  errors.push(new ParseError(block.sourceSpan, `Unrecognized @for loop block "${block.name}"`));
@@ -19652,7 +19934,7 @@ function createForLoop(ast, connectedBlocks, visitor, bindingParser) {
19652
19934
  } else {
19653
19935
  const endSpan = (_a2 = empty == null ? void 0 : empty.endSourceSpan) != null ? _a2 : ast.endSourceSpan;
19654
19936
  const sourceSpan = new ParseSourceSpan(ast.sourceSpan.start, (_b2 = endSpan == null ? void 0 : endSpan.end) != null ? _b2 : ast.sourceSpan.end);
19655
- node = new ForLoopBlock(params.itemName, params.expression, params.trackBy, params.context, visitAll2(visitor, ast.children, ast.children), empty, sourceSpan, ast.sourceSpan, ast.startSourceSpan, endSpan);
19937
+ 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);
19656
19938
  }
19657
19939
  }
19658
19940
  return { node, errors };
@@ -19672,7 +19954,7 @@ function createSwitchBlock(ast, visitor, bindingParser) {
19672
19954
  continue;
19673
19955
  }
19674
19956
  const expression = node.name === "case" ? parseBlockParameterToBinding(node.parameters[0], bindingParser) : null;
19675
- const ast2 = new SwitchBlockCase(expression, visitAll2(visitor, node.children, node.children), node.sourceSpan, node.startSourceSpan, node.endSourceSpan);
19957
+ const ast2 = new SwitchBlockCase(expression, visitAll2(visitor, node.children, node.children), node.sourceSpan, node.startSourceSpan, node.endSourceSpan, node.nameSpan);
19676
19958
  if (expression === null) {
19677
19959
  defaultCase = ast2;
19678
19960
  } else {
@@ -19683,7 +19965,7 @@ function createSwitchBlock(ast, visitor, bindingParser) {
19683
19965
  cases.push(defaultCase);
19684
19966
  }
19685
19967
  return {
19686
- node: new SwitchBlock(primaryExpression, cases, unknownBlocks, ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan),
19968
+ node: new SwitchBlock(primaryExpression, cases, unknownBlocks, ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan, ast.nameSpan),
19687
19969
  errors
19688
19970
  };
19689
19971
  }
@@ -19717,7 +19999,9 @@ function parseForLoopParameters(block, errors, bindingParser) {
19717
19999
  if (result.trackBy !== null) {
19718
20000
  errors.push(new ParseError(param.sourceSpan, '@for loop can only have one "track" expression'));
19719
20001
  } else {
19720
- result.trackBy = parseBlockParameterToBinding(param, bindingParser, trackMatch[1]);
20002
+ const expression = parseBlockParameterToBinding(param, bindingParser, trackMatch[1]);
20003
+ const keywordSpan = new ParseSourceSpan(param.sourceSpan.start, param.sourceSpan.start.moveBy("track".length));
20004
+ result.trackBy = { expression, keywordSpan };
19721
20005
  }
19722
20006
  continue;
19723
20007
  }
@@ -19776,7 +20060,7 @@ function validateSwitchBlock(ast) {
19776
20060
  return errors;
19777
20061
  }
19778
20062
  for (const node of ast.children) {
19779
- if (node instanceof Text4 && node.value.trim().length === 0) {
20063
+ if (node instanceof Comment2 || node instanceof Text4 && node.value.trim().length === 0) {
19780
20064
  continue;
19781
20065
  }
19782
20066
  if (!(node instanceof Block) || node.name !== "case" && node.name !== "default") {
@@ -19872,8 +20156,8 @@ function stripOptionalParentheses(param, errors) {
19872
20156
  return expression.slice(start, end);
19873
20157
  }
19874
20158
 
19875
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_deferred_triggers.mjs
19876
- var TIME_PATTERN = /^\d+(ms|s)?$/;
20159
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_deferred_triggers.mjs
20160
+ var TIME_PATTERN = /^\d+\.?\d*(ms|s)?$/;
19877
20161
  var SEPARATOR_PATTERN = /^\s$/;
19878
20162
  var COMMA_DELIMITED_SYNTAX = /* @__PURE__ */ new Map([
19879
20163
  [$LBRACE, $RBRACE],
@@ -19891,32 +20175,44 @@ var OnTriggerType;
19891
20175
  })(OnTriggerType || (OnTriggerType = {}));
19892
20176
  function parseWhenTrigger({ expression, sourceSpan }, bindingParser, triggers, errors) {
19893
20177
  const whenIndex = expression.indexOf("when");
20178
+ const whenSourceSpan = new ParseSourceSpan(sourceSpan.start.moveBy(whenIndex), sourceSpan.start.moveBy(whenIndex + "when".length));
20179
+ const prefetchSpan = getPrefetchSpan(expression, sourceSpan);
19894
20180
  if (whenIndex === -1) {
19895
20181
  errors.push(new ParseError(sourceSpan, `Could not find "when" keyword in expression`));
19896
20182
  } else {
19897
20183
  const start = getTriggerParametersStart(expression, whenIndex + 1);
19898
20184
  const parsed = bindingParser.parseBinding(expression.slice(start), false, sourceSpan, sourceSpan.start.offset + start);
19899
- trackTrigger("when", triggers, errors, new BoundDeferredTrigger(parsed, sourceSpan));
20185
+ trackTrigger("when", triggers, errors, new BoundDeferredTrigger(parsed, sourceSpan, prefetchSpan, whenSourceSpan));
19900
20186
  }
19901
20187
  }
19902
20188
  function parseOnTrigger({ expression, sourceSpan }, triggers, errors, placeholder) {
19903
20189
  const onIndex = expression.indexOf("on");
20190
+ const onSourceSpan = new ParseSourceSpan(sourceSpan.start.moveBy(onIndex), sourceSpan.start.moveBy(onIndex + "on".length));
20191
+ const prefetchSpan = getPrefetchSpan(expression, sourceSpan);
19904
20192
  if (onIndex === -1) {
19905
20193
  errors.push(new ParseError(sourceSpan, `Could not find "on" keyword in expression`));
19906
20194
  } else {
19907
20195
  const start = getTriggerParametersStart(expression, onIndex + 1);
19908
- const parser = new OnTriggerParser(expression, start, sourceSpan, triggers, errors, placeholder);
20196
+ const parser = new OnTriggerParser(expression, start, sourceSpan, triggers, errors, placeholder, prefetchSpan, onSourceSpan);
19909
20197
  parser.parse();
19910
20198
  }
19911
20199
  }
20200
+ function getPrefetchSpan(expression, sourceSpan) {
20201
+ if (!expression.startsWith("prefetch")) {
20202
+ return null;
20203
+ }
20204
+ return new ParseSourceSpan(sourceSpan.start, sourceSpan.start.moveBy("prefetch".length));
20205
+ }
19912
20206
  var OnTriggerParser = class {
19913
- constructor(expression, start, span, triggers, errors, placeholder) {
20207
+ constructor(expression, start, span, triggers, errors, placeholder, prefetchSpan, onSourceSpan) {
19914
20208
  this.expression = expression;
19915
20209
  this.start = start;
19916
20210
  this.span = span;
19917
20211
  this.triggers = triggers;
19918
20212
  this.errors = errors;
19919
20213
  this.placeholder = placeholder;
20214
+ this.prefetchSpan = prefetchSpan;
20215
+ this.onSourceSpan = onSourceSpan;
19920
20216
  this.index = 0;
19921
20217
  this.tokens = new Lexer().tokenize(expression.slice(start));
19922
20218
  }
@@ -19958,28 +20254,32 @@ var OnTriggerParser = class {
19958
20254
  return this.tokens[Math.min(this.index, this.tokens.length - 1)];
19959
20255
  }
19960
20256
  consumeTrigger(identifier, parameters) {
19961
- const startSpan = this.span.start.moveBy(this.start + identifier.index - this.tokens[0].index);
19962
- const endSpan = startSpan.moveBy(this.token().end - identifier.index);
19963
- const sourceSpan = new ParseSourceSpan(startSpan, endSpan);
20257
+ const triggerNameStartSpan = this.span.start.moveBy(this.start + identifier.index - this.tokens[0].index);
20258
+ const nameSpan = new ParseSourceSpan(triggerNameStartSpan, triggerNameStartSpan.moveBy(identifier.strValue.length));
20259
+ const endSpan = triggerNameStartSpan.moveBy(this.token().end - identifier.index);
20260
+ const isFirstTrigger = identifier.index === 0;
20261
+ const onSourceSpan = isFirstTrigger ? this.onSourceSpan : null;
20262
+ const prefetchSourceSpan = isFirstTrigger ? this.prefetchSpan : null;
20263
+ const sourceSpan = new ParseSourceSpan(isFirstTrigger ? this.span.start : triggerNameStartSpan, endSpan);
19964
20264
  try {
19965
20265
  switch (identifier.toString()) {
19966
20266
  case OnTriggerType.IDLE:
19967
- this.trackTrigger("idle", createIdleTrigger(parameters, sourceSpan));
20267
+ this.trackTrigger("idle", createIdleTrigger(parameters, nameSpan, sourceSpan, prefetchSourceSpan, onSourceSpan));
19968
20268
  break;
19969
20269
  case OnTriggerType.TIMER:
19970
- this.trackTrigger("timer", createTimerTrigger(parameters, sourceSpan));
20270
+ this.trackTrigger("timer", createTimerTrigger(parameters, nameSpan, sourceSpan, this.prefetchSpan, this.onSourceSpan));
19971
20271
  break;
19972
20272
  case OnTriggerType.INTERACTION:
19973
- this.trackTrigger("interaction", createInteractionTrigger(parameters, sourceSpan, this.placeholder));
20273
+ this.trackTrigger("interaction", createInteractionTrigger(parameters, nameSpan, sourceSpan, this.prefetchSpan, this.onSourceSpan, this.placeholder));
19974
20274
  break;
19975
20275
  case OnTriggerType.IMMEDIATE:
19976
- this.trackTrigger("immediate", createImmediateTrigger(parameters, sourceSpan));
20276
+ this.trackTrigger("immediate", createImmediateTrigger(parameters, nameSpan, sourceSpan, this.prefetchSpan, this.onSourceSpan));
19977
20277
  break;
19978
20278
  case OnTriggerType.HOVER:
19979
- this.trackTrigger("hover", createHoverTrigger(parameters, sourceSpan, this.placeholder));
20279
+ this.trackTrigger("hover", createHoverTrigger(parameters, nameSpan, sourceSpan, this.prefetchSpan, this.onSourceSpan, this.placeholder));
19980
20280
  break;
19981
20281
  case OnTriggerType.VIEWPORT:
19982
- this.trackTrigger("viewport", createViewportTrigger(parameters, sourceSpan, this.placeholder));
20282
+ this.trackTrigger("viewport", createViewportTrigger(parameters, nameSpan, sourceSpan, this.prefetchSpan, this.onSourceSpan, this.placeholder));
19983
20283
  break;
19984
20284
  default:
19985
20285
  throw new Error(`Unrecognized trigger type "${identifier}"`);
@@ -20050,13 +20350,13 @@ function trackTrigger(name, allTriggers, errors, trigger) {
20050
20350
  allTriggers[name] = trigger;
20051
20351
  }
20052
20352
  }
20053
- function createIdleTrigger(parameters, sourceSpan) {
20353
+ function createIdleTrigger(parameters, nameSpan, sourceSpan, prefetchSpan, onSourceSpan) {
20054
20354
  if (parameters.length > 0) {
20055
20355
  throw new Error(`"${OnTriggerType.IDLE}" trigger cannot have parameters`);
20056
20356
  }
20057
- return new IdleDeferredTrigger(sourceSpan);
20357
+ return new IdleDeferredTrigger(nameSpan, sourceSpan, prefetchSpan, onSourceSpan);
20058
20358
  }
20059
- function createTimerTrigger(parameters, sourceSpan) {
20359
+ function createTimerTrigger(parameters, nameSpan, sourceSpan, prefetchSpan, onSourceSpan) {
20060
20360
  if (parameters.length !== 1) {
20061
20361
  throw new Error(`"${OnTriggerType.TIMER}" trigger must have exactly one parameter`);
20062
20362
  }
@@ -20064,28 +20364,28 @@ function createTimerTrigger(parameters, sourceSpan) {
20064
20364
  if (delay === null) {
20065
20365
  throw new Error(`Could not parse time value of trigger "${OnTriggerType.TIMER}"`);
20066
20366
  }
20067
- return new TimerDeferredTrigger(delay, sourceSpan);
20367
+ return new TimerDeferredTrigger(delay, nameSpan, sourceSpan, prefetchSpan, onSourceSpan);
20068
20368
  }
20069
- function createImmediateTrigger(parameters, sourceSpan) {
20369
+ function createImmediateTrigger(parameters, nameSpan, sourceSpan, prefetchSpan, onSourceSpan) {
20070
20370
  if (parameters.length > 0) {
20071
20371
  throw new Error(`"${OnTriggerType.IMMEDIATE}" trigger cannot have parameters`);
20072
20372
  }
20073
- return new ImmediateDeferredTrigger(sourceSpan);
20373
+ return new ImmediateDeferredTrigger(nameSpan, sourceSpan, prefetchSpan, onSourceSpan);
20074
20374
  }
20075
- function createHoverTrigger(parameters, sourceSpan, placeholder) {
20375
+ function createHoverTrigger(parameters, nameSpan, sourceSpan, prefetchSpan, onSourceSpan, placeholder) {
20076
20376
  var _a2;
20077
20377
  validateReferenceBasedTrigger(OnTriggerType.HOVER, parameters, placeholder);
20078
- return new HoverDeferredTrigger((_a2 = parameters[0]) != null ? _a2 : null, sourceSpan);
20378
+ return new HoverDeferredTrigger((_a2 = parameters[0]) != null ? _a2 : null, nameSpan, sourceSpan, prefetchSpan, onSourceSpan);
20079
20379
  }
20080
- function createInteractionTrigger(parameters, sourceSpan, placeholder) {
20380
+ function createInteractionTrigger(parameters, nameSpan, sourceSpan, prefetchSpan, onSourceSpan, placeholder) {
20081
20381
  var _a2;
20082
20382
  validateReferenceBasedTrigger(OnTriggerType.INTERACTION, parameters, placeholder);
20083
- return new InteractionDeferredTrigger((_a2 = parameters[0]) != null ? _a2 : null, sourceSpan);
20383
+ return new InteractionDeferredTrigger((_a2 = parameters[0]) != null ? _a2 : null, nameSpan, sourceSpan, prefetchSpan, onSourceSpan);
20084
20384
  }
20085
- function createViewportTrigger(parameters, sourceSpan, placeholder) {
20385
+ function createViewportTrigger(parameters, nameSpan, sourceSpan, prefetchSpan, onSourceSpan, placeholder) {
20086
20386
  var _a2;
20087
20387
  validateReferenceBasedTrigger(OnTriggerType.VIEWPORT, parameters, placeholder);
20088
- return new ViewportDeferredTrigger((_a2 = parameters[0]) != null ? _a2 : null, sourceSpan);
20388
+ return new ViewportDeferredTrigger((_a2 = parameters[0]) != null ? _a2 : null, nameSpan, sourceSpan, prefetchSpan, onSourceSpan);
20089
20389
  }
20090
20390
  function validateReferenceBasedTrigger(type, parameters, placeholder) {
20091
20391
  if (parameters.length > 1) {
@@ -20117,10 +20417,10 @@ function parseDeferredTime(value) {
20117
20417
  return null;
20118
20418
  }
20119
20419
  const [time, units] = match;
20120
- return parseInt(time) * (units === "s" ? 1e3 : 1);
20420
+ return parseFloat(time) * (units === "s" ? 1e3 : 1);
20121
20421
  }
20122
20422
 
20123
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_deferred_blocks.mjs
20423
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_deferred_blocks.mjs
20124
20424
  var PREFETCH_WHEN_PATTERN = /^prefetch\s+when\s/;
20125
20425
  var PREFETCH_ON_PATTERN = /^prefetch\s+on\s/;
20126
20426
  var MINIMUM_PARAMETER_PATTERN = /^minimum\s/;
@@ -20141,8 +20441,8 @@ function createDeferredBlock(ast, connectedBlocks, visitor, bindingParser) {
20141
20441
  lastEndSourceSpan = lastConnectedBlock.endSourceSpan;
20142
20442
  endOfLastSourceSpan = lastConnectedBlock.sourceSpan.end;
20143
20443
  }
20144
- const mainDeferredSourceSpan = new ParseSourceSpan(ast.sourceSpan.start, endOfLastSourceSpan);
20145
- const node = new DeferredBlock(visitAll2(visitor, ast.children, ast.children), triggers, prefetchTriggers, placeholder, loading, error2, mainDeferredSourceSpan, ast.sourceSpan, ast.startSourceSpan, lastEndSourceSpan);
20444
+ const sourceSpanWithConnectedBlocks = new ParseSourceSpan(ast.sourceSpan.start, endOfLastSourceSpan);
20445
+ const node = new DeferredBlock(visitAll2(visitor, ast.children, ast.children), triggers, prefetchTriggers, placeholder, loading, error2, ast.nameSpan, sourceSpanWithConnectedBlocks, ast.sourceSpan, ast.startSourceSpan, lastEndSourceSpan);
20146
20446
  return { node, errors };
20147
20447
  }
20148
20448
  function parseConnectedBlocks(connectedBlocks, errors, visitor) {
@@ -20200,7 +20500,7 @@ function parsePlaceholderBlock(ast, visitor) {
20200
20500
  throw new Error(`Unrecognized parameter in @placeholder block: "${param.expression}"`);
20201
20501
  }
20202
20502
  }
20203
- return new DeferredBlockPlaceholder(visitAll2(visitor, ast.children, ast.children), minimumTime, ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan);
20503
+ return new DeferredBlockPlaceholder(visitAll2(visitor, ast.children, ast.children), minimumTime, ast.nameSpan, ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan);
20204
20504
  }
20205
20505
  function parseLoadingBlock(ast, visitor) {
20206
20506
  let afterTime = null;
@@ -20228,13 +20528,13 @@ function parseLoadingBlock(ast, visitor) {
20228
20528
  throw new Error(`Unrecognized parameter in @loading block: "${param.expression}"`);
20229
20529
  }
20230
20530
  }
20231
- return new DeferredBlockLoading(visitAll2(visitor, ast.children, ast.children), afterTime, minimumTime, ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan);
20531
+ return new DeferredBlockLoading(visitAll2(visitor, ast.children, ast.children), afterTime, minimumTime, ast.nameSpan, ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan);
20232
20532
  }
20233
20533
  function parseErrorBlock(ast, visitor) {
20234
20534
  if (ast.parameters.length > 0) {
20235
20535
  throw new Error(`@error block cannot have parameters`);
20236
20536
  }
20237
- return new DeferredBlockError(visitAll2(visitor, ast.children, ast.children), ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan);
20537
+ return new DeferredBlockError(visitAll2(visitor, ast.children, ast.children), ast.nameSpan, ast.sourceSpan, ast.startSourceSpan, ast.endSourceSpan);
20238
20538
  }
20239
20539
  function parsePrimaryTriggers(params, bindingParser, errors, placeholder) {
20240
20540
  const triggers = {};
@@ -20255,7 +20555,7 @@ function parsePrimaryTriggers(params, bindingParser, errors, placeholder) {
20255
20555
  return { triggers, prefetchTriggers };
20256
20556
  }
20257
20557
 
20258
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/r3_template_transform.mjs
20558
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/r3_template_transform.mjs
20259
20559
  var BIND_NAME_REGEXP = /^(?:(bind-)|(let-)|(ref-|#)|(on-)|(bindon-)|(@))(.*)$/;
20260
20560
  var KW_BIND_IDX = 1;
20261
20561
  var KW_LET_IDX = 2;
@@ -20686,7 +20986,7 @@ function textContents(node) {
20686
20986
  }
20687
20987
  }
20688
20988
 
20689
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/i18n/context.mjs
20989
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/i18n/context.mjs
20690
20990
  var TagType;
20691
20991
  (function(TagType2) {
20692
20992
  TagType2[TagType2["ELEMENT"] = 0] = "ELEMENT";
@@ -20821,10 +21121,11 @@ function serializePlaceholderValue(value) {
20821
21121
  }
20822
21122
  }
20823
21123
 
20824
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/template.mjs
21124
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/template.mjs
20825
21125
  var NG_CONTENT_SELECT_ATTR2 = "select";
20826
21126
  var NG_PROJECT_AS_ATTR_NAME = "ngProjectAs";
20827
21127
  var EVENT_BINDING_SCOPE_GLOBALS = /* @__PURE__ */ new Set(["$event"]);
21128
+ var NG_TEMPLATE_TAG_NAME = "ng-template";
20828
21129
  var GLOBAL_TARGET_RESOLVERS = /* @__PURE__ */ new Map([["window", Identifiers.resolveWindow], ["document", Identifiers.resolveDocument], ["body", Identifiers.resolveBody]]);
20829
21130
  var LEADING_TRIVIA_CHARS = [" ", "\n", "\r", " "];
20830
21131
  function renderFlagCheckIfStmt(flags, statements) {
@@ -21403,7 +21704,6 @@ var TemplateDefinitionBuilder = class {
21403
21704
  var _a2;
21404
21705
  const tagNameWithoutNamespace = template2.tagName ? splitNsName(template2.tagName)[1] : template2.tagName;
21405
21706
  const contextNameSuffix = template2.tagName ? "_" + sanitizeIdentifier(template2.tagName) : "";
21406
- const NG_TEMPLATE_TAG_NAME = "ng-template";
21407
21707
  const attrsExprs = this.getAttributeExpressions(NG_TEMPLATE_TAG_NAME, template2.attributes, template2.inputs, template2.outputs, void 0, template2.templateAttrs);
21408
21708
  const templateIndex = this.createEmbeddedTemplateFn(tagNameWithoutNamespace, template2.children, contextNameSuffix, template2.sourceSpan, template2.variables, attrsExprs, template2.references, template2.i18n);
21409
21709
  this.templatePropertyBindings(templateIndex, template2.templateAttrs);
@@ -21473,11 +21773,19 @@ var TemplateDefinitionBuilder = class {
21473
21773
  }
21474
21774
  visitIfBlock(block) {
21475
21775
  this.allocateBindingSlots(null);
21476
- const branchData = block.branches.map(({ expression, expressionAlias, children, sourceSpan }) => {
21776
+ const branchData = block.branches.map((branch, branchIndex) => {
21777
+ const { expression, expressionAlias, children, sourceSpan } = branch;
21477
21778
  const variables = expressionAlias !== null ? [new Variable(expressionAlias.name, DIRECT_CONTEXT_REFERENCE, expressionAlias.sourceSpan, expressionAlias.keySpan)] : void 0;
21478
- const index = this.createEmbeddedTemplateFn(null, children, "_Conditional", sourceSpan, variables);
21779
+ let tagName = null;
21780
+ let attrsExprs;
21781
+ if (branchIndex === 0) {
21782
+ const inferredData = this.inferProjectionDataFromInsertionPoint(branch);
21783
+ tagName = inferredData.tagName;
21784
+ attrsExprs = inferredData.attrsExprs;
21785
+ }
21786
+ const templateIndex = this.createEmbeddedTemplateFn(tagName, children, "_Conditional", sourceSpan, variables, attrsExprs);
21479
21787
  const processedExpression = expression === null ? null : expression.visit(this._valueConverter);
21480
- return { index, expression: processedExpression, alias: expressionAlias };
21788
+ return { index: templateIndex, expression: processedExpression, alias: expressionAlias };
21481
21789
  });
21482
21790
  const containerIndex = branchData[0].index;
21483
21791
  const paramsCallback = () => {
@@ -21622,11 +21930,34 @@ var TemplateDefinitionBuilder = class {
21622
21930
  return params;
21623
21931
  });
21624
21932
  }
21933
+ inferProjectionDataFromInsertionPoint(node) {
21934
+ let root = null;
21935
+ let tagName = null;
21936
+ let attrsExprs;
21937
+ for (const child of node.children) {
21938
+ if (child instanceof Comment) {
21939
+ continue;
21940
+ }
21941
+ if (root !== null) {
21942
+ root = null;
21943
+ break;
21944
+ }
21945
+ if (child instanceof Element || child instanceof Template && child.tagName !== null) {
21946
+ root = child;
21947
+ }
21948
+ }
21949
+ if (root !== null) {
21950
+ tagName = root instanceof Element ? root.name : root.tagName;
21951
+ attrsExprs = this.getAttributeExpressions(NG_TEMPLATE_TAG_NAME, root.attributes, root.inputs, []);
21952
+ }
21953
+ return { tagName, attrsExprs };
21954
+ }
21625
21955
  allocateDataSlot() {
21626
21956
  return this._dataIndex++;
21627
21957
  }
21628
21958
  visitForLoopBlock(block) {
21629
21959
  const blockIndex = this.allocateDataSlot();
21960
+ const { tagName, attrsExprs } = this.inferProjectionDataFromInsertionPoint(block);
21630
21961
  const primaryData = this.prepareEmbeddedTemplateFn(block.children, "_For", [block.item, block.contextVariables.$index, block.contextVariables.$count]);
21631
21962
  const { expression: trackByExpression, usesComponentInstance: trackByUsesComponentInstance } = this.createTrackByFunction(block);
21632
21963
  let emptyData = null;
@@ -21641,6 +21972,8 @@ var TemplateDefinitionBuilder = class {
21641
21972
  variable(primaryData.name),
21642
21973
  literal(primaryData.getConstCount()),
21643
21974
  literal(primaryData.getVarCount()),
21975
+ literal(tagName),
21976
+ this.addAttrsToConsts(attrsExprs || null),
21644
21977
  trackByExpression
21645
21978
  ];
21646
21979
  if (emptyData !== null) {
@@ -22007,9 +22340,9 @@ function pureFunctionCallInfo(args) {
22007
22340
  function generateNextContextExpr(relativeLevelDiff) {
22008
22341
  return importExpr(Identifiers.nextContext).callFn(relativeLevelDiff > 1 ? [literal(relativeLevelDiff)] : []);
22009
22342
  }
22010
- function getLiteralFactory(constantPool, literal2, allocateSlots) {
22343
+ function getLiteralFactory(constantPool, literal2, allocateSlots2) {
22011
22344
  const { literalFactory, literalFactoryArguments } = constantPool.getLiteralFactory(literal2);
22012
- const startSlot = allocateSlots(1 + literalFactoryArguments.length);
22345
+ const startSlot = allocateSlots2(1 + literalFactoryArguments.length);
22013
22346
  const { identifier, isVarLength } = pureFunctionCallInfo(literalFactoryArguments);
22014
22347
  const args = [literal(startSlot), literalFactory];
22015
22348
  if (isVarLength) {
@@ -22451,7 +22784,7 @@ function createClosureModeGuard2() {
22451
22784
  return typeofExpr(variable(NG_I18N_CLOSURE_MODE2)).notIdentical(literal("undefined", STRING_TYPE)).and(variable(NG_I18N_CLOSURE_MODE2));
22452
22785
  }
22453
22786
 
22454
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/compiler.mjs
22787
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/compiler.mjs
22455
22788
  var ATTR_REGEX = /attr\.([^\]]+)/;
22456
22789
  var COMPONENT_VARIABLE = "%COMP%";
22457
22790
  var HOST_ATTR = `_nghost-${COMPONENT_VARIABLE}`;
@@ -23053,7 +23386,7 @@ function createHostDirectivesMappingArray(mapping) {
23053
23386
  return elements.length > 0 ? literalArr(elements) : null;
23054
23387
  }
23055
23388
 
23056
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/view/t2_binder.mjs
23389
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/view/t2_binder.mjs
23057
23390
  var R3TargetBinder = class {
23058
23391
  constructor(directiveMatcher) {
23059
23392
  this.directiveMatcher = directiveMatcher;
@@ -23062,14 +23395,14 @@ var R3TargetBinder = class {
23062
23395
  if (!target.template) {
23063
23396
  throw new Error("Binding without a template not yet supported");
23064
23397
  }
23065
- const scope = Scope.apply(target.template);
23398
+ const scope = Scope2.apply(target.template);
23066
23399
  const scopedNodeEntities = extractScopedNodeEntities(scope);
23067
23400
  const { directives, eagerDirectives, bindings, references } = DirectiveBinder.apply(target.template, this.directiveMatcher);
23068
23401
  const { expressions, symbols, nestingLevel, usedPipes, eagerPipes, deferBlocks } = TemplateBinder.applyWithScope(target.template, scope);
23069
23402
  return new R3BoundTarget(target, directives, eagerDirectives, bindings, references, expressions, symbols, nestingLevel, scopedNodeEntities, usedPipes, eagerPipes, deferBlocks);
23070
23403
  }
23071
23404
  };
23072
- var Scope = class {
23405
+ var Scope2 = class {
23073
23406
  constructor(parentScope, rootNode) {
23074
23407
  this.parentScope = parentScope;
23075
23408
  this.rootNode = rootNode;
@@ -23078,10 +23411,10 @@ var Scope = class {
23078
23411
  this.isDeferred = parentScope !== null && parentScope.isDeferred ? true : rootNode instanceof DeferredBlock;
23079
23412
  }
23080
23413
  static newRootScope() {
23081
- return new Scope(null, null);
23414
+ return new Scope2(null, null);
23082
23415
  }
23083
23416
  static apply(template2) {
23084
- const scope = Scope.newRootScope();
23417
+ const scope = Scope2.newRootScope();
23085
23418
  scope.ingest(template2);
23086
23419
  return scope;
23087
23420
  }
@@ -23194,7 +23527,7 @@ var Scope = class {
23194
23527
  return res;
23195
23528
  }
23196
23529
  ingestScopedNode(node) {
23197
- const scope = new Scope(this, node);
23530
+ const scope = new Scope2(this, node);
23198
23531
  scope.ingest(node);
23199
23532
  this.childScopes.set(node, scope);
23200
23533
  }
@@ -23576,8 +23909,21 @@ var R3BoundTarget = class {
23576
23909
  }
23577
23910
  const name = trigger.reference;
23578
23911
  if (name === null) {
23579
- const children = block.placeholder ? block.placeholder.children : null;
23580
- return children !== null && children.length === 1 && children[0] instanceof Element ? children[0] : null;
23912
+ let trigger2 = null;
23913
+ if (block.placeholder !== null) {
23914
+ for (const child of block.placeholder.children) {
23915
+ if (child instanceof Comment) {
23916
+ continue;
23917
+ }
23918
+ if (trigger2 !== null) {
23919
+ return null;
23920
+ }
23921
+ if (child instanceof Element) {
23922
+ trigger2 = child;
23923
+ }
23924
+ }
23925
+ }
23926
+ return trigger2;
23581
23927
  }
23582
23928
  const outsideRef = this.findEntityInScope(block, name);
23583
23929
  if (outsideRef instanceof Reference && this.getDefinitionNodeOfSymbol(outsideRef) !== block) {
@@ -23645,11 +23991,11 @@ function extractScopedNodeEntities(rootScope) {
23645
23991
  return templateEntities;
23646
23992
  }
23647
23993
 
23648
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/resource_loader.mjs
23994
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/resource_loader.mjs
23649
23995
  var ResourceLoader = class {
23650
23996
  };
23651
23997
 
23652
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/jit_compiler_facade.mjs
23998
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/jit_compiler_facade.mjs
23653
23999
  var CompilerFacadeImpl = class {
23654
24000
  constructor(jitEvaluator = new JitEvaluator()) {
23655
24001
  this.jitEvaluator = jitEvaluator;
@@ -23889,7 +24235,7 @@ function convertDirectiveFacadeToMetadata(facade) {
23889
24235
  });
23890
24236
  }
23891
24237
  function convertDeclareDirectiveFacadeToMetadata(declaration, typeSourceSpan) {
23892
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i;
24238
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g, _h, _i;
23893
24239
  return {
23894
24240
  name: declaration.type.name,
23895
24241
  type: wrapReference(declaration.type),
@@ -23903,11 +24249,11 @@ function convertDeclareDirectiveFacadeToMetadata(declaration, typeSourceSpan) {
23903
24249
  providers: declaration.providers !== void 0 ? new WrappedNodeExpr(declaration.providers) : null,
23904
24250
  exportAs: (_e2 = declaration.exportAs) != null ? _e2 : null,
23905
24251
  usesInheritance: (_f2 = declaration.usesInheritance) != null ? _f2 : false,
23906
- lifecycle: { usesOnChanges: (_g2 = declaration.usesOnChanges) != null ? _g2 : false },
24252
+ lifecycle: { usesOnChanges: (_g = declaration.usesOnChanges) != null ? _g : false },
23907
24253
  deps: null,
23908
24254
  typeArgumentCount: 0,
23909
24255
  fullInheritance: false,
23910
- isStandalone: (_h2 = declaration.isStandalone) != null ? _h2 : false,
24256
+ isStandalone: (_h = declaration.isStandalone) != null ? _h : false,
23911
24257
  isSignal: (_i = declaration.isSignal) != null ? _i : false,
23912
24258
  hostDirectives: convertHostDirectivesToMetadata(declaration)
23913
24259
  };
@@ -24201,17 +24547,17 @@ function publishFacade(global) {
24201
24547
  ng.\u0275compilerFacade = new CompilerFacadeImpl();
24202
24548
  }
24203
24549
 
24204
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/version.mjs
24205
- var VERSION2 = new Version("17.0.0-rc.1");
24550
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/version.mjs
24551
+ var VERSION2 = new Version("17.0.0-rc.2");
24206
24552
 
24207
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/i18n/extractor_merger.mjs
24553
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/i18n/extractor_merger.mjs
24208
24554
  var _VisitorMode;
24209
24555
  (function(_VisitorMode2) {
24210
24556
  _VisitorMode2[_VisitorMode2["Extract"] = 0] = "Extract";
24211
24557
  _VisitorMode2[_VisitorMode2["Merge"] = 1] = "Merge";
24212
24558
  })(_VisitorMode || (_VisitorMode = {}));
24213
24559
 
24214
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/ml_parser/xml_tags.mjs
24560
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/ml_parser/xml_tags.mjs
24215
24561
  var XmlTagDefinition = class {
24216
24562
  constructor() {
24217
24563
  this.closedByParent = false;
@@ -24233,7 +24579,7 @@ var XmlTagDefinition = class {
24233
24579
  };
24234
24580
  var _TAG_DEFINITION = new XmlTagDefinition();
24235
24581
 
24236
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/render3/partial/api.mjs
24582
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/render3/partial/api.mjs
24237
24583
  var FactoryTarget2;
24238
24584
  (function(FactoryTarget3) {
24239
24585
  FactoryTarget3[FactoryTarget3["Directive"] = 0] = "Directive";
@@ -24243,14 +24589,14 @@ var FactoryTarget2;
24243
24589
  FactoryTarget3[FactoryTarget3["NgModule"] = 4] = "NgModule";
24244
24590
  })(FactoryTarget2 || (FactoryTarget2 = {}));
24245
24591
 
24246
- // bazel-out/darwin-fastbuild/bin/packages/compiler/src/compiler.mjs
24592
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler/src/compiler.mjs
24247
24593
  publishFacade(_global);
24248
24594
 
24249
- // bazel-out/darwin-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/util.mjs
24595
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/util.mjs
24250
24596
  var import_path2 = require("path");
24251
- var import_typescript3 = __toESM(require("typescript"), 1);
24597
+ var import_typescript5 = __toESM(require("typescript"), 1);
24252
24598
 
24253
- // bazel-out/darwin-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/types.mjs
24599
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/types.mjs
24254
24600
  var ngif = "*ngIf";
24255
24601
  var boundngif = "[ngIf]";
24256
24602
  var nakedngif = "ngIf";
@@ -24369,19 +24715,19 @@ var ElementCollector = class extends RecursiveVisitor {
24369
24715
  }
24370
24716
  };
24371
24717
 
24372
- // bazel-out/darwin-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/util.mjs
24718
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/util.mjs
24373
24719
  function analyze(sourceFile, analyzedFiles) {
24374
24720
  forEachClass(sourceFile, (node) => {
24375
24721
  var _a2;
24376
- const decorator = (_a2 = import_typescript3.default.getDecorators(node)) == null ? void 0 : _a2.find((dec) => {
24377
- return import_typescript3.default.isCallExpression(dec.expression) && import_typescript3.default.isIdentifier(dec.expression.expression) && dec.expression.expression.text === "Component";
24722
+ const decorator = (_a2 = import_typescript5.default.getDecorators(node)) == null ? void 0 : _a2.find((dec) => {
24723
+ return import_typescript5.default.isCallExpression(dec.expression) && import_typescript5.default.isIdentifier(dec.expression.expression) && dec.expression.expression.text === "Component";
24378
24724
  });
24379
- const metadata = decorator && decorator.expression.arguments.length > 0 && import_typescript3.default.isObjectLiteralExpression(decorator.expression.arguments[0]) ? decorator.expression.arguments[0] : null;
24725
+ const metadata = decorator && decorator.expression.arguments.length > 0 && import_typescript5.default.isObjectLiteralExpression(decorator.expression.arguments[0]) ? decorator.expression.arguments[0] : null;
24380
24726
  if (!metadata) {
24381
24727
  return;
24382
24728
  }
24383
24729
  for (const prop of metadata.properties) {
24384
- if (!import_typescript3.default.isPropertyAssignment(prop) || !import_typescript3.default.isStringLiteralLike(prop.initializer) || !import_typescript3.default.isIdentifier(prop.name) && !import_typescript3.default.isStringLiteralLike(prop.name)) {
24730
+ if (!import_typescript5.default.isPropertyAssignment(prop) || !import_typescript5.default.isStringLiteralLike(prop.initializer) || !import_typescript5.default.isIdentifier(prop.name) && !import_typescript5.default.isStringLiteralLike(prop.name)) {
24385
24731
  continue;
24386
24732
  }
24387
24733
  switch (prop.name.text) {
@@ -24410,23 +24756,19 @@ function getNestedCount(etm, aggregator) {
24410
24756
  }
24411
24757
  var lb = "\n";
24412
24758
  function migrateTemplate(template2) {
24413
- var _a2, _b2, _c2, _d2;
24759
+ var _a2, _b2;
24414
24760
  let parsed;
24415
24761
  let errors = [];
24416
24762
  try {
24417
24763
  parsed = new HtmlParser().parse(template2, "", {
24418
24764
  tokenizeExpansionForms: true,
24419
- tokenizeBlocks: false,
24765
+ tokenizeBlocks: true,
24420
24766
  preserveLineEndings: true
24421
24767
  });
24422
24768
  if (parsed.errors && parsed.errors.length > 0) {
24423
- for (let error2 of parsed.errors) {
24424
- errors.push({ type: "parse", error: error2 });
24425
- }
24426
24769
  return { migrated: null, errors };
24427
24770
  }
24428
- } catch (error2) {
24429
- errors.push({ type: "parse", error: error2 });
24771
+ } catch (e) {
24430
24772
  return { migrated: null, errors };
24431
24773
  }
24432
24774
  let result = template2;
@@ -24440,11 +24782,14 @@ function migrateTemplate(template2) {
24440
24782
  tmpl.count = (_a2 = matches == null ? void 0 : matches.length) != null ? _a2 : 0;
24441
24783
  tmpl.generateContents(template2);
24442
24784
  }
24443
- visitor.elements[0].hasLineBreaks = hasLineBreaks;
24444
- let prevElEnd = (_c2 = (_b2 = visitor.elements[0]) == null ? void 0 : _b2.el.sourceSpan.end.offset) != null ? _c2 : result.length - 1;
24445
- let nestedQueue = [prevElEnd];
24446
- for (let i = 1; i < visitor.elements.length; i++) {
24785
+ let nestedQueue = [];
24786
+ for (let i = 0; i < visitor.elements.length; i++) {
24447
24787
  let currEl = visitor.elements[i];
24788
+ if (i === 0) {
24789
+ nestedQueue.push(currEl.el.sourceSpan.end.offset);
24790
+ currEl.hasLineBreaks = hasLineBreaks;
24791
+ continue;
24792
+ }
24448
24793
  currEl.hasLineBreaks = hasLineBreaks;
24449
24794
  currEl.nestCount = getNestedCount(currEl, nestedQueue);
24450
24795
  if (currEl.el.sourceSpan.end.offset !== nestedQueue[nestedQueue.length - 1]) {
@@ -24459,7 +24804,7 @@ function migrateTemplate(template2) {
24459
24804
  if (el.nestCount <= nestLevel) {
24460
24805
  const count = nestLevel - el.nestCount;
24461
24806
  for (let i = 0; i <= count; i++) {
24462
- offset += (_d2 = postOffsets.pop()) != null ? _d2 : 0;
24807
+ offset += (_b2 = postOffsets.pop()) != null ? _b2 : 0;
24463
24808
  }
24464
24809
  }
24465
24810
  if (el.attr.name === ngif || el.attr.name === nakedngif || el.attr.name === boundngif) {
@@ -24569,7 +24914,7 @@ function buildIfThenElseBlock(etm, ngTemplates, tmpl, thenString, elseString, of
24569
24914
  return { tmpl: updatedTmpl, offsets: { pre, post } };
24570
24915
  }
24571
24916
  function migrateNgFor(etm, tmpl, offset) {
24572
- const aliasWithEqualRegexp = /=\s+(count|index|first|last|even|odd)/gm;
24917
+ const aliasWithEqualRegexp = /=\s*(count|index|first|last|even|odd)/gm;
24573
24918
  const aliasWithAsRegexp = /(count|index|first|last|even|odd)\s+as/gm;
24574
24919
  const aliases = [];
24575
24920
  const lbString = etm.hasLineBreaks ? lb : "";
@@ -24579,6 +24924,7 @@ function migrateNgFor(etm, tmpl, offset) {
24579
24924
  const condition = parts[0].replace("let ", "");
24580
24925
  const loopVar = condition.split(" of ")[0];
24581
24926
  let trackBy = loopVar;
24927
+ let aliasedIndex = null;
24582
24928
  for (let i = 1; i < parts.length; i++) {
24583
24929
  const part = parts[i].trim();
24584
24930
  if (part.startsWith("trackBy:")) {
@@ -24588,12 +24934,21 @@ function migrateNgFor(etm, tmpl, offset) {
24588
24934
  if (part.match(aliasWithEqualRegexp)) {
24589
24935
  const aliasParts = part.split("=");
24590
24936
  aliases.push(` ${aliasParts[0].trim()} = $${aliasParts[1].trim()}`);
24937
+ if (aliasParts[1].trim() === "index") {
24938
+ aliasedIndex = aliasParts[0].trim().split(/\s+as\s+/)[1];
24939
+ }
24591
24940
  }
24592
24941
  if (part.match(aliasWithAsRegexp)) {
24593
24942
  const aliasParts = part.split(/\s+as\s+/);
24594
24943
  aliases.push(` let ${aliasParts[1].trim()} = $${aliasParts[0].trim()}`);
24944
+ if (aliasParts[0].trim() === "index") {
24945
+ aliasedIndex = aliasParts[1].trim();
24946
+ }
24595
24947
  }
24596
24948
  }
24949
+ if (aliasedIndex !== null && trackBy !== loopVar) {
24950
+ trackBy = trackBy.replace("$index", aliasedIndex);
24951
+ }
24597
24952
  const aliasStr = aliases.length > 0 ? `;${aliases.join(";")}` : "";
24598
24953
  const { start, middle, end } = getMainBlock(etm, tmpl, offset);
24599
24954
  const startBlock = `@for (${condition}; track ${trackBy}${aliasStr}) {${lbSpaces}${start}`;
@@ -24678,26 +25033,27 @@ function migrateNgSwitchDefault(etm, tmpl, offset) {
24678
25033
  }
24679
25034
  function forEachClass(sourceFile, callback) {
24680
25035
  sourceFile.forEachChild(function walk(node) {
24681
- if (import_typescript3.default.isClassDeclaration(node)) {
25036
+ if (import_typescript5.default.isClassDeclaration(node)) {
24682
25037
  callback(node);
24683
25038
  }
24684
25039
  node.forEachChild(walk);
24685
25040
  });
24686
25041
  }
24687
25042
 
24688
- // bazel-out/darwin-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/index.mjs
24689
- function control_flow_migration_default() {
25043
+ // bazel-out/darwin_arm64-fastbuild/bin/packages/core/schematics/ng-generate/control-flow-migration/index.mjs
25044
+ function control_flow_migration_default(options) {
24690
25045
  return (tree, context) => __async(this, null, function* () {
24691
25046
  const { buildPaths, testPaths } = yield getProjectTsConfigPaths(tree);
24692
25047
  const basePath = process.cwd();
24693
- const allPaths = [...buildPaths, ...testPaths];
25048
+ const pathToMigrate = normalizePath((0, import_path3.join)(basePath, options.path));
25049
+ const allPaths = options.path !== "./" ? [...buildPaths, ...testPaths] : [pathToMigrate];
24694
25050
  if (!allPaths.length) {
24695
25051
  throw new import_schematics.SchematicsException("Could not find any tsconfig file. Cannot run the control flow migration.");
24696
25052
  }
24697
25053
  context.logger.warn("IMPORTANT! This migration is in developer preview. Use with caution.");
24698
25054
  let errors = [];
24699
25055
  for (const tsconfigPath of allPaths) {
24700
- const migrateErrors = runControlFlowMigration(tree, tsconfigPath, basePath);
25056
+ const migrateErrors = runControlFlowMigration(tree, tsconfigPath, basePath, pathToMigrate, options);
24701
25057
  errors = [...errors, ...migrateErrors];
24702
25058
  }
24703
25059
  if (errors.length > 0) {
@@ -24709,9 +25065,15 @@ function control_flow_migration_default() {
24709
25065
  }
24710
25066
  });
24711
25067
  }
24712
- function runControlFlowMigration(tree, tsconfigPath, basePath) {
25068
+ function runControlFlowMigration(tree, tsconfigPath, basePath, pathToMigrate, schematicOptions) {
25069
+ if (schematicOptions.path.startsWith("..")) {
25070
+ throw new import_schematics.SchematicsException("Cannot run control flow migration outside of the current project.");
25071
+ }
24713
25072
  const program = createMigrationProgram(tree, tsconfigPath, basePath);
24714
- const sourceFiles = program.getSourceFiles().filter((sourceFile) => canMigrateFile(basePath, sourceFile, program));
25073
+ const sourceFiles = program.getSourceFiles().filter((sourceFile) => sourceFile.fileName.startsWith(pathToMigrate) && canMigrateFile(basePath, sourceFile, program));
25074
+ if (sourceFiles.length === 0) {
25075
+ throw new import_schematics.SchematicsException(`Could not find any files to migrate under the path ${pathToMigrate}. Cannot run the control flow migration.`);
25076
+ }
24715
25077
  const analysis = /* @__PURE__ */ new Map();
24716
25078
  const migrateErrors = /* @__PURE__ */ new Map();
24717
25079
  for (const sourceFile of sourceFiles) {