@angular/compiler 14.0.0-next.7 → 14.0.0-rc.0

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 (151) hide show
  1. package/esm2020/src/compiler.mjs +4 -3
  2. package/esm2020/src/compiler_facade_interface.mjs +7 -1
  3. package/esm2020/src/core.mjs +6 -6
  4. package/esm2020/src/expression_parser/parser.mjs +12 -12
  5. package/esm2020/src/i18n/i18n_parser.mjs +3 -3
  6. package/esm2020/src/jit_compiler_facade.mjs +76 -44
  7. package/esm2020/src/ml_parser/html_whitespaces.mjs +2 -2
  8. package/esm2020/src/ml_parser/lexer.mjs +37 -37
  9. package/esm2020/src/ml_parser/parser.mjs +41 -41
  10. package/esm2020/src/parse_util.mjs +2 -2
  11. package/esm2020/src/render3/partial/api.mjs +1 -1
  12. package/esm2020/src/render3/partial/class_metadata.mjs +1 -1
  13. package/esm2020/src/render3/partial/component.mjs +28 -37
  14. package/esm2020/src/render3/partial/directive.mjs +6 -3
  15. package/esm2020/src/render3/partial/factory.mjs +1 -1
  16. package/esm2020/src/render3/partial/injectable.mjs +1 -1
  17. package/esm2020/src/render3/partial/injector.mjs +1 -1
  18. package/esm2020/src/render3/partial/ng_module.mjs +3 -3
  19. package/esm2020/src/render3/partial/pipe.mjs +6 -3
  20. package/esm2020/src/render3/r3_ast.mjs +3 -3
  21. package/esm2020/src/render3/r3_factory.mjs +6 -6
  22. package/esm2020/src/render3/r3_identifiers.mjs +4 -1
  23. package/esm2020/src/render3/r3_module_compiler.mjs +45 -8
  24. package/esm2020/src/render3/r3_pipe_compiler.mjs +5 -1
  25. package/esm2020/src/render3/util.mjs +4 -4
  26. package/esm2020/src/render3/view/api.mjs +7 -2
  27. package/esm2020/src/render3/view/compiler.mjs +45 -35
  28. package/esm2020/src/render3/view/i18n/get_msg_utils.mjs +58 -5
  29. package/esm2020/src/render3/view/i18n/meta.mjs +4 -4
  30. package/esm2020/src/render3/view/i18n/util.mjs +2 -2
  31. package/esm2020/src/render3/view/style_parser.mjs +20 -20
  32. package/esm2020/src/render3/view/styling_builder.mjs +8 -8
  33. package/esm2020/src/render3/view/template.mjs +45 -32
  34. package/esm2020/src/render3/view/util.mjs +14 -5
  35. package/esm2020/src/selector.mjs +10 -10
  36. package/esm2020/src/shadow_css.mjs +2 -2
  37. package/esm2020/src/template_parser/binding_parser.mjs +9 -9
  38. package/esm2020/src/util.mjs +8 -8
  39. package/esm2020/src/version.mjs +1 -1
  40. package/fesm2015/compiler.mjs +492 -325
  41. package/fesm2015/compiler.mjs.map +1 -1
  42. package/fesm2015/testing.mjs +1 -1
  43. package/fesm2020/compiler.mjs +500 -338
  44. package/fesm2020/compiler.mjs.map +1 -1
  45. package/fesm2020/testing.mjs +1 -1
  46. package/index.d.ts +4964 -5
  47. package/package.json +3 -3
  48. package/testing/index.d.ts +22 -5
  49. package/compiler.d.ts +0 -8
  50. package/public_api.d.ts +0 -13
  51. package/src/assertions.d.ts +0 -8
  52. package/src/chars.d.ts +0 -75
  53. package/src/compiler.d.ts +0 -77
  54. package/src/compiler_facade_interface.d.ts +0 -284
  55. package/src/compiler_util/expression_converter.d.ts +0 -71
  56. package/src/config.d.ts +0 -25
  57. package/src/constant_pool.d.ts +0 -37
  58. package/src/core.d.ts +0 -216
  59. package/src/expression_parser/ast.d.ts +0 -440
  60. package/src/expression_parser/lexer.d.ts +0 -47
  61. package/src/expression_parser/parser.d.ts +0 -315
  62. package/src/i18n/big_integer.d.ts +0 -108
  63. package/src/i18n/digest.d.ts +0 -44
  64. package/src/i18n/extractor_merger.d.ts +0 -27
  65. package/src/i18n/i18n_ast.d.ts +0 -148
  66. package/src/i18n/i18n_html_parser.d.ts +0 -19
  67. package/src/i18n/i18n_parser.d.ts +0 -18
  68. package/src/i18n/index.d.ts +0 -15
  69. package/src/i18n/message_bundle.d.ts +0 -28
  70. package/src/i18n/parse_util.d.ts +0 -14
  71. package/src/i18n/serializers/placeholder.d.ts +0 -25
  72. package/src/i18n/serializers/serializer.d.ts +0 -46
  73. package/src/i18n/serializers/xliff.d.ts +0 -19
  74. package/src/i18n/serializers/xliff2.d.ts +0 -19
  75. package/src/i18n/serializers/xmb.d.ts +0 -22
  76. package/src/i18n/serializers/xml_helper.d.ts +0 -52
  77. package/src/i18n/serializers/xtb.d.ts +0 -20
  78. package/src/i18n/translation_bundle.d.ts +0 -27
  79. package/src/injectable_compiler_2.d.ts +0 -24
  80. package/src/jit_compiler_facade.d.ts +0 -46
  81. package/src/ml_parser/ast.d.ts +0 -89
  82. package/src/ml_parser/entities.d.ts +0 -9
  83. package/src/ml_parser/html_parser.d.ts +0 -13
  84. package/src/ml_parser/html_tags.d.ts +0 -33
  85. package/src/ml_parser/html_whitespaces.d.ts +0 -45
  86. package/src/ml_parser/icu_ast_expander.d.ts +0 -42
  87. package/src/ml_parser/interpolation_config.d.ts +0 -14
  88. package/src/ml_parser/lexer.d.ts +0 -114
  89. package/src/ml_parser/parser.d.ts +0 -26
  90. package/src/ml_parser/tags.d.ts +0 -29
  91. package/src/ml_parser/tokens.d.ts +0 -141
  92. package/src/ml_parser/xml_parser.d.ts +0 -13
  93. package/src/ml_parser/xml_tags.d.ts +0 -24
  94. package/src/output/abstract_emitter.d.ts +0 -66
  95. package/src/output/abstract_js_emitter.d.ts +0 -19
  96. package/src/output/map_util.d.ts +0 -18
  97. package/src/output/output_ast.d.ts +0 -575
  98. package/src/output/output_jit.d.ts +0 -73
  99. package/src/output/output_jit_trusted_types.d.ts +0 -43
  100. package/src/output/source_map.d.ts +0 -29
  101. package/src/parse_util.d.ts +0 -75
  102. package/src/render3/partial/api.d.ts +0 -441
  103. package/src/render3/partial/class_metadata.d.ts +0 -10
  104. package/src/render3/partial/component.d.ts +0 -39
  105. package/src/render3/partial/directive.d.ts +0 -13
  106. package/src/render3/partial/factory.d.ts +0 -3
  107. package/src/render3/partial/injectable.d.ts +0 -19
  108. package/src/render3/partial/injector.d.ts +0 -3
  109. package/src/render3/partial/ng_module.d.ts +0 -3
  110. package/src/render3/partial/pipe.d.ts +0 -12
  111. package/src/render3/partial/util.d.ts +0 -33
  112. package/src/render3/r3_ast.d.ts +0 -211
  113. package/src/render3/r3_class_metadata_compiler.d.ts +0 -35
  114. package/src/render3/r3_factory.d.ts +0 -94
  115. package/src/render3/r3_identifiers.d.ts +0 -180
  116. package/src/render3/r3_injector_compiler.d.ts +0 -18
  117. package/src/render3/r3_jit.d.ts +0 -22
  118. package/src/render3/r3_module_compiler.d.ts +0 -77
  119. package/src/render3/r3_pipe_compiler.d.ts +0 -50
  120. package/src/render3/r3_template_transform.d.ts +0 -24
  121. package/src/render3/util.d.ts +0 -94
  122. package/src/render3/view/api.d.ts +0 -328
  123. package/src/render3/view/compiler.d.ts +0 -86
  124. package/src/render3/view/i18n/context.d.ts +0 -68
  125. package/src/render3/view/i18n/get_msg_utils.d.ts +0 -13
  126. package/src/render3/view/i18n/icu_serializer.d.ts +0 -9
  127. package/src/render3/view/i18n/localize_utils.d.ts +0 -24
  128. package/src/render3/view/i18n/meta.d.ts +0 -78
  129. package/src/render3/view/i18n/util.d.ts +0 -78
  130. package/src/render3/view/style_parser.d.ts +0 -18
  131. package/src/render3/view/styling_builder.d.ts +0 -211
  132. package/src/render3/view/t2_api.d.ts +0 -152
  133. package/src/render3/view/t2_binder.d.ts +0 -57
  134. package/src/render3/view/template.d.ts +0 -450
  135. package/src/render3/view/util.d.ts +0 -94
  136. package/src/resource_loader.d.ts +0 -17
  137. package/src/schema/dom_element_schema_registry.d.ts +0 -45
  138. package/src/schema/dom_security_schema.d.ts +0 -11
  139. package/src/schema/element_schema_registry.d.ts +0 -29
  140. package/src/schema/trusted_types_sinks.d.ts +0 -15
  141. package/src/selector.d.ts +0 -105
  142. package/src/shadow_css.d.ts +0 -76
  143. package/src/style_url_resolver.d.ts +0 -8
  144. package/src/template_parser/binding_parser.d.ts +0 -91
  145. package/src/template_parser/template_preparser.d.ts +0 -24
  146. package/src/util.d.ts +0 -42
  147. package/src/version.d.ts +0 -14
  148. package/testing/package.json +0 -9
  149. package/testing/public_api.d.ts +0 -13
  150. package/testing/src/testing.d.ts +0 -23
  151. package/testing/testing.d.ts +0 -4
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v14.0.0-next.7
2
+ * @license Angular v14.0.0-rc.0
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -211,7 +211,7 @@ class CssSelector {
211
211
  let inNot = false;
212
212
  _SELECTOR_REGEXP.lastIndex = 0;
213
213
  while (match = _SELECTOR_REGEXP.exec(selector)) {
214
- if (match[1 /* NOT */]) {
214
+ if (match[1 /* SelectorRegexp.NOT */]) {
215
215
  if (inNot) {
216
216
  throw new Error('Nesting :not in a selector is not allowed');
217
217
  }
@@ -219,31 +219,31 @@ class CssSelector {
219
219
  current = new CssSelector();
220
220
  cssSelector.notSelectors.push(current);
221
221
  }
222
- const tag = match[2 /* TAG */];
222
+ const tag = match[2 /* SelectorRegexp.TAG */];
223
223
  if (tag) {
224
- const prefix = match[3 /* PREFIX */];
224
+ const prefix = match[3 /* SelectorRegexp.PREFIX */];
225
225
  if (prefix === '#') {
226
226
  // #hash
227
- current.addAttribute('id', tag.substr(1));
227
+ current.addAttribute('id', tag.slice(1));
228
228
  }
229
229
  else if (prefix === '.') {
230
230
  // Class
231
- current.addClassName(tag.substr(1));
231
+ current.addClassName(tag.slice(1));
232
232
  }
233
233
  else {
234
234
  // Element
235
235
  current.setElement(tag);
236
236
  }
237
237
  }
238
- const attribute = match[4 /* ATTRIBUTE */];
238
+ const attribute = match[4 /* SelectorRegexp.ATTRIBUTE */];
239
239
  if (attribute) {
240
- current.addAttribute(current.unescapeAttribute(attribute), match[6 /* ATTRIBUTE_VALUE */]);
240
+ current.addAttribute(current.unescapeAttribute(attribute), match[6 /* SelectorRegexp.ATTRIBUTE_VALUE */]);
241
241
  }
242
- if (match[7 /* NOT_END */]) {
242
+ if (match[7 /* SelectorRegexp.NOT_END */]) {
243
243
  inNot = false;
244
244
  current = cssSelector;
245
245
  }
246
- if (match[8 /* SEPARATOR */]) {
246
+ if (match[8 /* SelectorRegexp.SEPARATOR */]) {
247
247
  if (inNot) {
248
248
  throw new Error('Multiple selectors in :not are not supported');
249
249
  }
@@ -611,26 +611,26 @@ var MissingTranslationStrategy;
611
611
  })(MissingTranslationStrategy || (MissingTranslationStrategy = {}));
612
612
  function parserSelectorToSimpleSelector(selector) {
613
613
  const classes = selector.classNames && selector.classNames.length ?
614
- [8 /* CLASS */, ...selector.classNames] :
614
+ [8 /* SelectorFlags.CLASS */, ...selector.classNames] :
615
615
  [];
616
616
  const elementName = selector.element && selector.element !== '*' ? selector.element : '';
617
617
  return [elementName, ...selector.attrs, ...classes];
618
618
  }
619
619
  function parserSelectorToNegativeSelector(selector) {
620
620
  const classes = selector.classNames && selector.classNames.length ?
621
- [8 /* CLASS */, ...selector.classNames] :
621
+ [8 /* SelectorFlags.CLASS */, ...selector.classNames] :
622
622
  [];
623
623
  if (selector.element) {
624
624
  return [
625
- 1 /* NOT */ | 4 /* ELEMENT */, selector.element, ...selector.attrs, ...classes
625
+ 1 /* SelectorFlags.NOT */ | 4 /* SelectorFlags.ELEMENT */, selector.element, ...selector.attrs, ...classes
626
626
  ];
627
627
  }
628
628
  else if (selector.attrs.length) {
629
- return [1 /* NOT */ | 2 /* ATTRIBUTE */, ...selector.attrs, ...classes];
629
+ return [1 /* SelectorFlags.NOT */ | 2 /* SelectorFlags.ATTRIBUTE */, ...selector.attrs, ...classes];
630
630
  }
631
631
  else {
632
632
  return selector.classNames && selector.classNames.length ?
633
- [1 /* NOT */ | 8 /* CLASS */, ...selector.classNames] :
633
+ [1 /* SelectorFlags.NOT */ | 8 /* SelectorFlags.CLASS */, ...selector.classNames] :
634
634
  [];
635
635
  }
636
636
  }
@@ -756,13 +756,13 @@ class Version {
756
756
  this.patch = splits.slice(2).join('.');
757
757
  }
758
758
  }
759
- const __window = typeof window !== 'undefined' && window;
760
- const __self = typeof self !== 'undefined' && typeof WorkerGlobalScope !== 'undefined' &&
761
- self instanceof WorkerGlobalScope && self;
762
- const __global = typeof global !== 'undefined' && global;
763
- // Check __global first, because in Node tests both __global and __window may be defined and _global
764
- // should be __global in that case.
765
- const _global = __global || __window || __self;
759
+ // Check `global` first, because in Node tests both `global` and `window` may be defined and our
760
+ // `_global` variable should point to the NodeJS `global` in that case. Note: Typeof/Instanceof
761
+ // checks are considered side-effects in Terser. We explicitly mark this as side-effect free:
762
+ // https://github.com/terser/terser/issues/250.
763
+ const _global = ( /* @__PURE__ */(() => (typeof global !== 'undefined' && global) || (typeof window !== 'undefined' && window) ||
764
+ (typeof self !== 'undefined' && typeof WorkerGlobalScope !== 'undefined' &&
765
+ self instanceof WorkerGlobalScope && self))());
766
766
  function newArray(size, value) {
767
767
  const list = [];
768
768
  for (let i = 0; i < size; i++) {
@@ -2800,6 +2800,7 @@ Identifiers.stylePropInterpolate7 = { name: 'ɵɵstylePropInterpolate7', moduleN
2800
2800
  Identifiers.stylePropInterpolate8 = { name: 'ɵɵstylePropInterpolate8', moduleName: CORE };
2801
2801
  Identifiers.stylePropInterpolateV = { name: 'ɵɵstylePropInterpolateV', moduleName: CORE };
2802
2802
  Identifiers.nextContext = { name: 'ɵɵnextContext', moduleName: CORE };
2803
+ Identifiers.resetView = { name: 'ɵɵresetView', moduleName: CORE };
2803
2804
  Identifiers.templateCreate = { name: 'ɵɵtemplate', moduleName: CORE };
2804
2805
  Identifiers.text = { name: 'ɵɵtext', moduleName: CORE };
2805
2806
  Identifiers.enableBindings = { name: 'ɵɵenableBindings', moduleName: CORE };
@@ -2910,6 +2911,7 @@ Identifiers.ModuleWithProviders = {
2910
2911
  Identifiers.defineNgModule = { name: 'ɵɵdefineNgModule', moduleName: CORE };
2911
2912
  Identifiers.declareNgModule = { name: 'ɵɵngDeclareNgModule', moduleName: CORE };
2912
2913
  Identifiers.setNgModuleScope = { name: 'ɵɵsetNgModuleScope', moduleName: CORE };
2914
+ Identifiers.registerNgModuleType = { name: 'ɵɵregisterNgModuleType', moduleName: CORE };
2913
2915
  Identifiers.PipeDeclaration = { name: 'ɵɵPipeDeclaration', moduleName: CORE };
2914
2916
  Identifiers.definePipe = { name: 'ɵɵdefinePipe', moduleName: CORE };
2915
2917
  Identifiers.declarePipe = { name: 'ɵɵngDeclarePipe', moduleName: CORE };
@@ -2922,6 +2924,7 @@ Identifiers.contentQuery = { name: 'ɵɵcontentQuery', moduleName: CORE };
2922
2924
  Identifiers.NgOnChangesFeature = { name: 'ɵɵNgOnChangesFeature', moduleName: CORE };
2923
2925
  Identifiers.InheritDefinitionFeature = { name: 'ɵɵInheritDefinitionFeature', moduleName: CORE };
2924
2926
  Identifiers.CopyDefinitionFeature = { name: 'ɵɵCopyDefinitionFeature', moduleName: CORE };
2927
+ Identifiers.StandaloneFeature = { name: 'ɵɵStandaloneFeature', moduleName: CORE };
2925
2928
  Identifiers.ProvidersFeature = { name: 'ɵɵProvidersFeature', moduleName: CORE };
2926
2929
  Identifiers.listener = { name: 'ɵɵlistener', moduleName: CORE };
2927
2930
  Identifiers.getInheritedFactory = {
@@ -3663,10 +3666,10 @@ function createMayBeForwardRefExpression(expression, forwardRef) {
3663
3666
  */
3664
3667
  function convertFromMaybeForwardRefExpression({ expression, forwardRef }) {
3665
3668
  switch (forwardRef) {
3666
- case 0 /* None */:
3667
- case 1 /* Wrapped */:
3669
+ case 0 /* ForwardRefHandling.None */:
3670
+ case 1 /* ForwardRefHandling.Wrapped */:
3668
3671
  return expression;
3669
- case 2 /* Unwrapped */:
3672
+ case 2 /* ForwardRefHandling.Unwrapped */:
3670
3673
  return generateForwardRef(expression);
3671
3674
  }
3672
3675
  }
@@ -3790,14 +3793,14 @@ function compileInjectDependency(dep, target, index) {
3790
3793
  }
3791
3794
  else if (dep.attributeNameType === null) {
3792
3795
  // Build up the injection flags according to the metadata.
3793
- const flags = 0 /* Default */ | (dep.self ? 2 /* Self */ : 0) |
3794
- (dep.skipSelf ? 4 /* SkipSelf */ : 0) | (dep.host ? 1 /* Host */ : 0) |
3795
- (dep.optional ? 8 /* Optional */ : 0) |
3796
- (target === FactoryTarget$1.Pipe ? 16 /* ForPipe */ : 0);
3796
+ const flags = 0 /* InjectFlags.Default */ | (dep.self ? 2 /* InjectFlags.Self */ : 0) |
3797
+ (dep.skipSelf ? 4 /* InjectFlags.SkipSelf */ : 0) | (dep.host ? 1 /* InjectFlags.Host */ : 0) |
3798
+ (dep.optional ? 8 /* InjectFlags.Optional */ : 0) |
3799
+ (target === FactoryTarget$1.Pipe ? 16 /* InjectFlags.ForPipe */ : 0);
3797
3800
  // If this dependency is optional or otherwise has non-default flags, then additional
3798
3801
  // parameters describing how to inject the dependency must be passed to the inject function
3799
3802
  // that's being used.
3800
- let flagsParam = (flags !== 0 /* Default */ || dep.optional) ? literal(flags) : null;
3803
+ let flagsParam = (flags !== 0 /* InjectFlags.Default */ || dep.optional) ? literal(flags) : null;
3801
3804
  // Build up the arguments to the injectFn call.
3802
3805
  const injectArgs = [dep.token];
3803
3806
  if (flagsParam) {
@@ -3968,8 +3971,8 @@ class BoundEvent {
3968
3971
  this.keySpan = keySpan;
3969
3972
  }
3970
3973
  static fromParsedEvent(event) {
3971
- const target = event.type === 0 /* Regular */ ? event.targetOrPhase : null;
3972
- const phase = event.type === 1 /* Animation */ ? event.targetOrPhase : null;
3974
+ const target = event.type === 0 /* ParsedEventType.Regular */ ? event.targetOrPhase : null;
3975
+ const phase = event.type === 1 /* ParsedEventType.Animation */ ? event.targetOrPhase : null;
3973
3976
  if (event.keySpan === undefined) {
3974
3977
  throw new Error(`Unexpected state: keySpan must be defined for bound event but was not for ${event.name}: ${event.sourceSpan}`);
3975
3978
  }
@@ -4793,7 +4796,7 @@ function assembleBoundTextPlaceholders(meta, bindingStartIndex = 0, contextId =
4793
4796
  * @param useCamelCase whether to camelCase the placeholder name when formatting.
4794
4797
  * @returns A new map of formatted placeholder names to expressions.
4795
4798
  */
4796
- function i18nFormatPlaceholderNames(params = {}, useCamelCase) {
4799
+ function formatI18nPlaceholderNamesInMap(params = {}, useCamelCase) {
4797
4800
  const _params = {};
4798
4801
  if (params && Object.keys(params).length) {
4799
4802
  Object.keys(params).forEach(key => _params[formatI18nPlaceholderName(key, useCamelCase)] = params[key]);
@@ -4876,6 +4879,12 @@ const IMPLICIT_REFERENCE = '$implicit';
4876
4879
  const NON_BINDABLE_ATTR = 'ngNonBindable';
4877
4880
  /** Name for the variable keeping track of the context returned by `ɵɵrestoreView`. */
4878
4881
  const RESTORED_VIEW_CONTEXT_NAME = 'restoredCtx';
4882
+ /**
4883
+ * Maximum length of a single instruction chain. Because our output AST uses recursion, we're
4884
+ * limited in how many expressions we can nest before we reach the call stack limit. This
4885
+ * length is set very conservatively in order to reduce the chance of problems.
4886
+ */
4887
+ const MAX_CHAIN_LENGTH = 500;
4879
4888
  /** Instructions that support chaining. */
4880
4889
  const CHAINABLE_INSTRUCTIONS = new Set([
4881
4890
  Identifiers.element,
@@ -5021,10 +5030,10 @@ function getQueryPredicate(query, constantPool) {
5021
5030
  else {
5022
5031
  // The original predicate may have been wrapped in a `forwardRef()` call.
5023
5032
  switch (query.predicate.forwardRef) {
5024
- case 0 /* None */:
5025
- case 2 /* Unwrapped */:
5033
+ case 0 /* ForwardRefHandling.None */:
5034
+ case 2 /* ForwardRefHandling.Unwrapped */:
5026
5035
  return query.predicate.expression;
5027
- case 1 /* Wrapped */:
5036
+ case 1 /* ForwardRefHandling.Wrapped */:
5028
5037
  return importExpr(Identifiers.resolveForwardRef).callFn([query.predicate.expression]);
5029
5038
  }
5030
5039
  }
@@ -5102,15 +5111,17 @@ function getInstructionStatements(instructions) {
5102
5111
  const statements = [];
5103
5112
  let pendingExpression = null;
5104
5113
  let pendingExpressionType = null;
5114
+ let chainLength = 0;
5105
5115
  for (const current of instructions) {
5106
5116
  const resolvedParams = (_a = (typeof current.paramsOrFn === 'function' ? current.paramsOrFn() : current.paramsOrFn)) !== null && _a !== void 0 ? _a : [];
5107
5117
  const params = Array.isArray(resolvedParams) ? resolvedParams : [resolvedParams];
5108
5118
  // If the current instruction is the same as the previous one
5109
5119
  // and it can be chained, add another call to the chain.
5110
- if (pendingExpressionType === current.reference &&
5120
+ if (chainLength < MAX_CHAIN_LENGTH && pendingExpressionType === current.reference &&
5111
5121
  CHAINABLE_INSTRUCTIONS.has(pendingExpressionType)) {
5112
5122
  // We'll always have a pending expression when there's a pending expression type.
5113
5123
  pendingExpression = pendingExpression.callFn(params, pendingExpression.sourceSpan);
5124
+ chainLength++;
5114
5125
  }
5115
5126
  else {
5116
5127
  if (pendingExpression !== null) {
@@ -5118,6 +5129,7 @@ function getInstructionStatements(instructions) {
5118
5129
  }
5119
5130
  pendingExpression = invokeInstruction(current.span, current.reference, params);
5120
5131
  pendingExpressionType = current.reference;
5132
+ chainLength = 0;
5121
5133
  }
5122
5134
  }
5123
5135
  // Since the current instruction adds the previous one to the statements,
@@ -5416,7 +5428,7 @@ class ParseLocation {
5416
5428
  const ch = source.charCodeAt(offset);
5417
5429
  if (ch == $LF) {
5418
5430
  line--;
5419
- const priorLine = source.substr(0, offset - 1).lastIndexOf(String.fromCharCode($LF));
5431
+ const priorLine = source.substring(0, offset - 1).lastIndexOf(String.fromCharCode($LF));
5420
5432
  col = priorLine > 0 ? offset - priorLine : offset;
5421
5433
  }
5422
5434
  else {
@@ -5971,20 +5983,49 @@ class R3JitReflector {
5971
5983
  * Use of this source code is governed by an MIT-style license that can be
5972
5984
  * found in the LICENSE file at https://angular.io/license
5973
5985
  */
5986
+ /**
5987
+ * How the selector scope of an NgModule (its declarations, imports, and exports) should be emitted
5988
+ * as a part of the NgModule definition.
5989
+ */
5990
+ var R3SelectorScopeMode;
5991
+ (function (R3SelectorScopeMode) {
5992
+ /**
5993
+ * Emit the declarations inline into the module definition.
5994
+ *
5995
+ * This option is useful in certain contexts where it's known that JIT support is required. The
5996
+ * tradeoff here is that this emit style prevents directives and pipes from being tree-shaken if
5997
+ * they are unused, but the NgModule is used.
5998
+ */
5999
+ R3SelectorScopeMode[R3SelectorScopeMode["Inline"] = 0] = "Inline";
6000
+ /**
6001
+ * Emit the declarations using a side effectful function call, `ɵɵsetNgModuleScope`, that is
6002
+ * guarded with the `ngJitMode` flag.
6003
+ *
6004
+ * This form of emit supports JIT and can be optimized away if the `ngJitMode` flag is set to
6005
+ * false, which allows unused directives and pipes to be tree-shaken.
6006
+ */
6007
+ R3SelectorScopeMode[R3SelectorScopeMode["SideEffect"] = 1] = "SideEffect";
6008
+ /**
6009
+ * Don't generate selector scopes at all.
6010
+ *
6011
+ * This is useful for contexts where JIT support is known to be unnecessary.
6012
+ */
6013
+ R3SelectorScopeMode[R3SelectorScopeMode["Omit"] = 2] = "Omit";
6014
+ })(R3SelectorScopeMode || (R3SelectorScopeMode = {}));
5974
6015
  /**
5975
6016
  * Construct an `R3NgModuleDef` for the given `R3NgModuleMetadata`.
5976
6017
  */
5977
6018
  function compileNgModule(meta) {
5978
- const { internalType, bootstrap, declarations, imports, exports, schemas, containsForwardDecls, emitInline, id } = meta;
6019
+ const { adjacentType, internalType, bootstrap, declarations, imports, exports, schemas, containsForwardDecls, selectorScopeMode, id } = meta;
5979
6020
  const statements = [];
5980
6021
  const definitionMap = new DefinitionMap();
5981
6022
  definitionMap.set('type', internalType);
5982
6023
  if (bootstrap.length > 0) {
5983
6024
  definitionMap.set('bootstrap', refsToArray(bootstrap, containsForwardDecls));
5984
6025
  }
5985
- // If requested to emit scope information inline, pass the `declarations`, `imports` and `exports`
5986
- // to the `ɵɵdefineNgModule()` call. The JIT compilation uses this.
5987
- if (emitInline) {
6026
+ if (selectorScopeMode === R3SelectorScopeMode.Inline) {
6027
+ // If requested to emit scope information inline, pass the `declarations`, `imports` and
6028
+ // `exports` to the `ɵɵdefineNgModule()` call directly.
5988
6029
  if (declarations.length > 0) {
5989
6030
  definitionMap.set('declarations', refsToArray(declarations, containsForwardDecls));
5990
6031
  }
@@ -5995,19 +6036,27 @@ function compileNgModule(meta) {
5995
6036
  definitionMap.set('exports', refsToArray(exports, containsForwardDecls));
5996
6037
  }
5997
6038
  }
5998
- // If not emitting inline, the scope information is not passed into `ɵɵdefineNgModule` as it would
5999
- // prevent tree-shaking of the declarations, imports and exports references.
6000
- else {
6039
+ else if (selectorScopeMode === R3SelectorScopeMode.SideEffect) {
6040
+ // In this mode, scope information is not passed into `ɵɵdefineNgModule` as it
6041
+ // would prevent tree-shaking of the declarations, imports and exports references. Instead, it's
6042
+ // patched onto the NgModule definition with a `ɵɵsetNgModuleScope` call that's guarded by the
6043
+ // `ngJitMode` flag.
6001
6044
  const setNgModuleScopeCall = generateSetNgModuleScopeCall(meta);
6002
6045
  if (setNgModuleScopeCall !== null) {
6003
6046
  statements.push(setNgModuleScopeCall);
6004
6047
  }
6005
6048
  }
6049
+ else {
6050
+ // Selector scope emit was not requested, so skip it.
6051
+ }
6006
6052
  if (schemas !== null && schemas.length > 0) {
6007
6053
  definitionMap.set('schemas', literalArr(schemas.map(ref => ref.value)));
6008
6054
  }
6009
6055
  if (id !== null) {
6010
6056
  definitionMap.set('id', id);
6057
+ // Generate a side-effectful call to register this NgModule by its id, as per the semantics of
6058
+ // NgModule ids.
6059
+ statements.push(importExpr(Identifiers.registerNgModuleType).callFn([adjacentType, id]).toStmt());
6011
6060
  }
6012
6061
  const expression = importExpr(Identifiers.defineNgModule).callFn([definitionMap.toLiteralMap()], undefined, true);
6013
6062
  const type = createNgModuleType(meta);
@@ -6103,6 +6152,9 @@ function compilePipeFromMetadata(metadata) {
6103
6152
  definitionMapValues.push({ key: 'type', value: metadata.type.value, quoted: false });
6104
6153
  // e.g. `pure: true`
6105
6154
  definitionMapValues.push({ key: 'pure', value: literal(metadata.pure), quoted: false });
6155
+ if (metadata.isStandalone) {
6156
+ definitionMapValues.push({ key: 'standalone', value: literal(true), quoted: false });
6157
+ }
6106
6158
  const expression = importExpr(Identifiers.definePipe).callFn([literalMap(definitionMapValues)], undefined, true);
6107
6159
  const type = createPipeType(metadata);
6108
6160
  return { expression, type, statements: [] };
@@ -6111,9 +6163,24 @@ function createPipeType(metadata) {
6111
6163
  return new ExpressionType(importExpr(Identifiers.PipeDeclaration, [
6112
6164
  typeWithParameters(metadata.type.type, metadata.typeArgumentCount),
6113
6165
  new ExpressionType(new LiteralExpr(metadata.pipeName)),
6166
+ new ExpressionType(new LiteralExpr(metadata.isStandalone)),
6114
6167
  ]));
6115
6168
  }
6116
6169
 
6170
+ /**
6171
+ * @license
6172
+ * Copyright Google LLC All Rights Reserved.
6173
+ *
6174
+ * Use of this source code is governed by an MIT-style license that can be
6175
+ * found in the LICENSE file at https://angular.io/license
6176
+ */
6177
+ var R3TemplateDependencyKind;
6178
+ (function (R3TemplateDependencyKind) {
6179
+ R3TemplateDependencyKind[R3TemplateDependencyKind["Directive"] = 0] = "Directive";
6180
+ R3TemplateDependencyKind[R3TemplateDependencyKind["Pipe"] = 1] = "Pipe";
6181
+ R3TemplateDependencyKind[R3TemplateDependencyKind["NgModule"] = 2] = "NgModule";
6182
+ })(R3TemplateDependencyKind || (R3TemplateDependencyKind = {}));
6183
+
6117
6184
  /**
6118
6185
  * @license
6119
6186
  * Copyright Google LLC All Rights Reserved.
@@ -7957,7 +8024,7 @@ class ShadowCss {
7957
8024
  this._scopeSelector(rule.selector, scopeSelector, hostSelector, this.strictStyling);
7958
8025
  }
7959
8026
  else if (rule.selector.startsWith('@media') || rule.selector.startsWith('@supports') ||
7960
- rule.selector.startsWith('@document')) {
8027
+ rule.selector.startsWith('@document') || rule.selector.startsWith('@layer')) {
7961
8028
  content = this._scopeSelectors(rule.content, scopeSelector, hostSelector);
7962
8029
  }
7963
8030
  else if (rule.selector.startsWith('@font-face') || rule.selector.startsWith('@page')) {
@@ -8366,7 +8433,7 @@ function parse(value) {
8366
8433
  const styles = [];
8367
8434
  let i = 0;
8368
8435
  let parenDepth = 0;
8369
- let quote = 0 /* QuoteNone */;
8436
+ let quote = 0 /* Char.QuoteNone */;
8370
8437
  let valueStart = 0;
8371
8438
  let propStart = 0;
8372
8439
  let currentProp = null;
@@ -8374,41 +8441,41 @@ function parse(value) {
8374
8441
  while (i < value.length) {
8375
8442
  const token = value.charCodeAt(i++);
8376
8443
  switch (token) {
8377
- case 40 /* OpenParen */:
8444
+ case 40 /* Char.OpenParen */:
8378
8445
  parenDepth++;
8379
8446
  break;
8380
- case 41 /* CloseParen */:
8447
+ case 41 /* Char.CloseParen */:
8381
8448
  parenDepth--;
8382
8449
  break;
8383
- case 39 /* QuoteSingle */:
8450
+ case 39 /* Char.QuoteSingle */:
8384
8451
  // valueStart needs to be there since prop values don't
8385
8452
  // have quotes in CSS
8386
8453
  valueHasQuotes = valueHasQuotes || valueStart > 0;
8387
- if (quote === 0 /* QuoteNone */) {
8388
- quote = 39 /* QuoteSingle */;
8454
+ if (quote === 0 /* Char.QuoteNone */) {
8455
+ quote = 39 /* Char.QuoteSingle */;
8389
8456
  }
8390
- else if (quote === 39 /* QuoteSingle */ && value.charCodeAt(i - 1) !== 92 /* BackSlash */) {
8391
- quote = 0 /* QuoteNone */;
8457
+ else if (quote === 39 /* Char.QuoteSingle */ && value.charCodeAt(i - 1) !== 92 /* Char.BackSlash */) {
8458
+ quote = 0 /* Char.QuoteNone */;
8392
8459
  }
8393
8460
  break;
8394
- case 34 /* QuoteDouble */:
8461
+ case 34 /* Char.QuoteDouble */:
8395
8462
  // same logic as above
8396
8463
  valueHasQuotes = valueHasQuotes || valueStart > 0;
8397
- if (quote === 0 /* QuoteNone */) {
8398
- quote = 34 /* QuoteDouble */;
8464
+ if (quote === 0 /* Char.QuoteNone */) {
8465
+ quote = 34 /* Char.QuoteDouble */;
8399
8466
  }
8400
- else if (quote === 34 /* QuoteDouble */ && value.charCodeAt(i - 1) !== 92 /* BackSlash */) {
8401
- quote = 0 /* QuoteNone */;
8467
+ else if (quote === 34 /* Char.QuoteDouble */ && value.charCodeAt(i - 1) !== 92 /* Char.BackSlash */) {
8468
+ quote = 0 /* Char.QuoteNone */;
8402
8469
  }
8403
8470
  break;
8404
- case 58 /* Colon */:
8405
- if (!currentProp && parenDepth === 0 && quote === 0 /* QuoteNone */) {
8471
+ case 58 /* Char.Colon */:
8472
+ if (!currentProp && parenDepth === 0 && quote === 0 /* Char.QuoteNone */) {
8406
8473
  currentProp = hyphenate(value.substring(propStart, i - 1).trim());
8407
8474
  valueStart = i;
8408
8475
  }
8409
8476
  break;
8410
- case 59 /* Semicolon */:
8411
- if (currentProp && valueStart > 0 && parenDepth === 0 && quote === 0 /* QuoteNone */) {
8477
+ case 59 /* Char.Semicolon */:
8478
+ if (currentProp && valueStart > 0 && parenDepth === 0 && quote === 0 /* Char.QuoteNone */) {
8412
8479
  const styleVal = value.substring(valueStart, i - 1).trim();
8413
8480
  styles.push(currentProp, valueHasQuotes ? stripUnnecessaryQuotes(styleVal) : styleVal);
8414
8481
  propStart = i;
@@ -8420,7 +8487,7 @@ function parse(value) {
8420
8487
  }
8421
8488
  }
8422
8489
  if (currentProp && valueStart) {
8423
- const styleVal = value.substr(valueStart).trim();
8490
+ const styleVal = value.slice(valueStart).trim();
8424
8491
  styles.push(currentProp, valueHasQuotes ? stripUnnecessaryQuotes(styleVal) : styleVal);
8425
8492
  }
8426
8493
  return styles;
@@ -8428,7 +8495,7 @@ function parse(value) {
8428
8495
  function stripUnnecessaryQuotes(value) {
8429
8496
  const qS = value.charCodeAt(0);
8430
8497
  const qE = value.charCodeAt(value.length - 1);
8431
- if (qS == qE && (qS == 39 /* QuoteSingle */ || qS == 34 /* QuoteDouble */)) {
8498
+ if (qS == qE && (qS == 39 /* Char.QuoteSingle */ || qS == 34 /* Char.QuoteDouble */)) {
8432
8499
  const tempValue = value.substring(1, value.length - 1);
8433
8500
  // special case to avoid using a multi-quoted string that was just chomped
8434
8501
  // (e.g. `font-family: "Verdana", "sans-serif"`)
@@ -8579,13 +8646,13 @@ class StylingBuilder {
8579
8646
  let binding = null;
8580
8647
  let name = input.name;
8581
8648
  switch (input.type) {
8582
- case 0 /* Property */:
8649
+ case 0 /* BindingType.Property */:
8583
8650
  binding = this.registerInputBasedOnName(name, input.value, input.sourceSpan);
8584
8651
  break;
8585
- case 3 /* Style */:
8652
+ case 3 /* BindingType.Style */:
8586
8653
  binding = this.registerStyleInput(name, false, input.value, input.sourceSpan, input.unit);
8587
8654
  break;
8588
- case 2 /* Class */:
8655
+ case 2 /* BindingType.Class */:
8589
8656
  binding = this.registerClassInput(name, false, input.value, input.sourceSpan);
8590
8657
  break;
8591
8658
  }
@@ -8598,7 +8665,7 @@ class StylingBuilder {
8598
8665
  const isClass = !isStyle && (name === 'class' || prefix === 'class.' || prefix === 'class!');
8599
8666
  if (isStyle || isClass) {
8600
8667
  const isMapBased = name.charAt(5) !== '.'; // style.prop or class.prop makes this a no
8601
- const property = name.substr(isMapBased ? 5 : 6); // the dot explains why there's a +1
8668
+ const property = name.slice(isMapBased ? 5 : 6); // the dot explains why there's a +1
8602
8669
  if (isStyle) {
8603
8670
  binding = this.registerStyleInput(property, isMapBased, expression, sourceSpan);
8604
8671
  }
@@ -8684,14 +8751,14 @@ class StylingBuilder {
8684
8751
  populateInitialStylingAttrs(attrs) {
8685
8752
  // [CLASS_MARKER, 'foo', 'bar', 'baz' ...]
8686
8753
  if (this._initialClassValues.length) {
8687
- attrs.push(literal(1 /* Classes */));
8754
+ attrs.push(literal(1 /* AttributeMarker.Classes */));
8688
8755
  for (let i = 0; i < this._initialClassValues.length; i++) {
8689
8756
  attrs.push(literal(this._initialClassValues[i]));
8690
8757
  }
8691
8758
  }
8692
8759
  // [STYLE_MARKER, 'width', '200px', 'height', '100px', ...]
8693
8760
  if (this._initialStyleValues.length) {
8694
- attrs.push(literal(2 /* Styles */));
8761
+ attrs.push(literal(2 /* AttributeMarker.Styles */));
8695
8762
  for (let i = 0; i < this._initialStyleValues.length; i += 2) {
8696
8763
  attrs.push(literal(this._initialStyleValues[i]), literal(this._initialStyleValues[i + 1]));
8697
8764
  }
@@ -8872,7 +8939,7 @@ function parseProperty(name) {
8872
8939
  let property = name;
8873
8940
  const unitIndex = name.lastIndexOf('.');
8874
8941
  if (unitIndex > 0) {
8875
- suffix = name.substr(unitIndex + 1);
8942
+ suffix = name.slice(unitIndex + 1);
8876
8943
  property = name.substring(0, unitIndex);
8877
8944
  }
8878
8945
  return { property, suffix, hasOverrideFlag };
@@ -9423,9 +9490,9 @@ class Parser$1 {
9423
9490
  this._checkNoInterpolation(input, location, interpolationConfig);
9424
9491
  const sourceToLex = this._stripComments(input);
9425
9492
  const tokens = this._lexer.tokenize(sourceToLex);
9426
- let flags = 1 /* Action */;
9493
+ let flags = 1 /* ParseFlags.Action */;
9427
9494
  if (isAssignmentEvent) {
9428
- flags |= 2 /* AssignmentEvent */;
9495
+ flags |= 2 /* ParseFlags.AssignmentEvent */;
9429
9496
  }
9430
9497
  const ast = new _ParseAST(input, location, absoluteOffset, tokens, flags, this.errors, 0).parseChain();
9431
9498
  return new ASTWithSource(ast, input, location, absoluteOffset, this.errors);
@@ -9454,7 +9521,7 @@ class Parser$1 {
9454
9521
  this._checkNoInterpolation(input, location, interpolationConfig);
9455
9522
  const sourceToLex = this._stripComments(input);
9456
9523
  const tokens = this._lexer.tokenize(sourceToLex);
9457
- return new _ParseAST(input, location, absoluteOffset, tokens, 0 /* None */, this.errors, 0)
9524
+ return new _ParseAST(input, location, absoluteOffset, tokens, 0 /* ParseFlags.None */, this.errors, 0)
9458
9525
  .parseChain();
9459
9526
  }
9460
9527
  /**
@@ -9485,7 +9552,7 @@ class Parser$1 {
9485
9552
  */
9486
9553
  parseTemplateBindings(templateKey, templateValue, templateUrl, absoluteKeyOffset, absoluteValueOffset) {
9487
9554
  const tokens = this._lexer.tokenize(templateValue);
9488
- const parser = new _ParseAST(templateValue, templateUrl, absoluteValueOffset, tokens, 0 /* None */, this.errors, 0 /* relative offset */);
9555
+ const parser = new _ParseAST(templateValue, templateUrl, absoluteValueOffset, tokens, 0 /* ParseFlags.None */, this.errors, 0 /* relative offset */);
9489
9556
  return parser.parseTemplateBindings({
9490
9557
  source: templateKey,
9491
9558
  span: new AbsoluteSourceSpan(absoluteKeyOffset, absoluteKeyOffset + templateKey.length),
@@ -9500,7 +9567,7 @@ class Parser$1 {
9500
9567
  const expressionText = expressions[i].text;
9501
9568
  const sourceToLex = this._stripComments(expressionText);
9502
9569
  const tokens = this._lexer.tokenize(sourceToLex);
9503
- const ast = new _ParseAST(input, location, absoluteOffset, tokens, 0 /* None */, this.errors, offsets[i])
9570
+ const ast = new _ParseAST(input, location, absoluteOffset, tokens, 0 /* ParseFlags.None */, this.errors, offsets[i])
9504
9571
  .parseChain();
9505
9572
  expressionNodes.push(ast);
9506
9573
  }
@@ -9514,7 +9581,7 @@ class Parser$1 {
9514
9581
  parseInterpolationExpression(expression, location, absoluteOffset) {
9515
9582
  const sourceToLex = this._stripComments(expression);
9516
9583
  const tokens = this._lexer.tokenize(sourceToLex);
9517
- const ast = new _ParseAST(expression, location, absoluteOffset, tokens, 0 /* None */, this.errors, 0)
9584
+ const ast = new _ParseAST(expression, location, absoluteOffset, tokens, 0 /* ParseFlags.None */, this.errors, 0)
9518
9585
  .parseChain();
9519
9586
  const strings = ['', '']; // The prefix and suffix strings are both empty
9520
9587
  return this.createInterpolationAst(strings, [ast], expression, location, absoluteOffset);
@@ -9871,7 +9938,7 @@ class _ParseAST {
9871
9938
  const expr = this.parsePipe();
9872
9939
  exprs.push(expr);
9873
9940
  if (this.consumeOptionalCharacter($SEMICOLON)) {
9874
- if (!(this.parseFlags & 1 /* Action */)) {
9941
+ if (!(this.parseFlags & 1 /* ParseFlags.Action */)) {
9875
9942
  this.error('Binding expression cannot contain chained expression');
9876
9943
  }
9877
9944
  while (this.consumeOptionalCharacter($SEMICOLON)) {
@@ -9895,7 +9962,7 @@ class _ParseAST {
9895
9962
  const start = this.inputIndex;
9896
9963
  let result = this.parseExpression();
9897
9964
  if (this.consumeOptionalOperator('|')) {
9898
- if (this.parseFlags & 1 /* Action */) {
9965
+ if (this.parseFlags & 1 /* ParseFlags.Action */) {
9899
9966
  this.error('Cannot have a pipe in an action expression');
9900
9967
  }
9901
9968
  do {
@@ -10248,7 +10315,7 @@ class _ParseAST {
10248
10315
  }
10249
10316
  else {
10250
10317
  if (this.consumeOptionalAssignment()) {
10251
- if (!(this.parseFlags & 1 /* Action */)) {
10318
+ if (!(this.parseFlags & 1 /* ParseFlags.Action */)) {
10252
10319
  this.error('Bindings cannot contain assignments');
10253
10320
  return new EmptyExpr(this.span(start), this.sourceSpan(start));
10254
10321
  }
@@ -10280,7 +10347,7 @@ class _ParseAST {
10280
10347
  // primary expression is substituted as LHS of the assignment operator to achieve
10281
10348
  // two-way-binding, such that the LHS could be the non-null operator. The grammar doesn't
10282
10349
  // naturally allow for this syntax, so assignment events are parsed specially.
10283
- if ((this.parseFlags & 2 /* AssignmentEvent */) && this.next.isOperator('!') &&
10350
+ if ((this.parseFlags & 2 /* ParseFlags.AssignmentEvent */) && this.next.isOperator('!') &&
10284
10351
  this.peek(1).isOperator('=')) {
10285
10352
  // First skip over the ! operator.
10286
10353
  this.advance();
@@ -10602,7 +10669,7 @@ function getIndexMapForOriginalTemplate(interpolatedTokens) {
10602
10669
  let tokenIndex = 0;
10603
10670
  while (tokenIndex < interpolatedTokens.length) {
10604
10671
  const currentToken = interpolatedTokens[tokenIndex];
10605
- if (currentToken.type === 9 /* ENCODED_ENTITY */) {
10672
+ if (currentToken.type === 9 /* MlParserTokenType.ENCODED_ENTITY */) {
10606
10673
  const [decoded, encoded] = currentToken.parts;
10607
10674
  consumedInOriginalTemplate += encoded.length;
10608
10675
  consumedInInput += decoded.length;
@@ -13000,14 +13067,14 @@ class _Tokenizer {
13000
13067
  else if (!(this._tokenizeIcu && this._tokenizeExpansionForm())) {
13001
13068
  // In (possibly interpolated) text the end of the text is given by `isTextEnd()`, while
13002
13069
  // the premature end of an interpolation is given by the start of a new HTML element.
13003
- this._consumeWithInterpolation(5 /* TEXT */, 8 /* INTERPOLATION */, () => this._isTextEnd(), () => this._isTagStart());
13070
+ this._consumeWithInterpolation(5 /* TokenType.TEXT */, 8 /* TokenType.INTERPOLATION */, () => this._isTextEnd(), () => this._isTagStart());
13004
13071
  }
13005
13072
  }
13006
13073
  catch (e) {
13007
13074
  this.handleError(e);
13008
13075
  }
13009
13076
  }
13010
- this._beginToken(24 /* EOF */);
13077
+ this._beginToken(24 /* TokenType.EOF */);
13011
13078
  this._endToken([]);
13012
13079
  }
13013
13080
  /**
@@ -13151,7 +13218,7 @@ class _Tokenizer {
13151
13218
  return char;
13152
13219
  }
13153
13220
  _consumeEntity(textTokenType) {
13154
- this._beginToken(9 /* ENCODED_ENTITY */);
13221
+ this._beginToken(9 /* TokenType.ENCODED_ENTITY */);
13155
13222
  const start = this._cursor.clone();
13156
13223
  this._cursor.advance();
13157
13224
  if (this._attemptCharCode($HASH)) {
@@ -13197,7 +13264,7 @@ class _Tokenizer {
13197
13264
  }
13198
13265
  }
13199
13266
  _consumeRawText(consumeEntities, endMarkerPredicate) {
13200
- this._beginToken(consumeEntities ? 6 /* ESCAPABLE_RAW_TEXT */ : 7 /* RAW_TEXT */);
13267
+ this._beginToken(consumeEntities ? 6 /* TokenType.ESCAPABLE_RAW_TEXT */ : 7 /* TokenType.RAW_TEXT */);
13201
13268
  const parts = [];
13202
13269
  while (true) {
13203
13270
  const tagCloseStart = this._cursor.clone();
@@ -13209,8 +13276,8 @@ class _Tokenizer {
13209
13276
  if (consumeEntities && this._cursor.peek() === $AMPERSAND) {
13210
13277
  this._endToken([this._processCarriageReturns(parts.join(''))]);
13211
13278
  parts.length = 0;
13212
- this._consumeEntity(6 /* ESCAPABLE_RAW_TEXT */);
13213
- this._beginToken(6 /* ESCAPABLE_RAW_TEXT */);
13279
+ this._consumeEntity(6 /* TokenType.ESCAPABLE_RAW_TEXT */);
13280
+ this._beginToken(6 /* TokenType.ESCAPABLE_RAW_TEXT */);
13214
13281
  }
13215
13282
  else {
13216
13283
  parts.push(this._readChar());
@@ -13219,25 +13286,25 @@ class _Tokenizer {
13219
13286
  this._endToken([this._processCarriageReturns(parts.join(''))]);
13220
13287
  }
13221
13288
  _consumeComment(start) {
13222
- this._beginToken(10 /* COMMENT_START */, start);
13289
+ this._beginToken(10 /* TokenType.COMMENT_START */, start);
13223
13290
  this._requireCharCode($MINUS);
13224
13291
  this._endToken([]);
13225
13292
  this._consumeRawText(false, () => this._attemptStr('-->'));
13226
- this._beginToken(11 /* COMMENT_END */);
13293
+ this._beginToken(11 /* TokenType.COMMENT_END */);
13227
13294
  this._requireStr('-->');
13228
13295
  this._endToken([]);
13229
13296
  }
13230
13297
  _consumeCdata(start) {
13231
- this._beginToken(12 /* CDATA_START */, start);
13298
+ this._beginToken(12 /* TokenType.CDATA_START */, start);
13232
13299
  this._requireStr('CDATA[');
13233
13300
  this._endToken([]);
13234
13301
  this._consumeRawText(false, () => this._attemptStr(']]>'));
13235
- this._beginToken(13 /* CDATA_END */);
13302
+ this._beginToken(13 /* TokenType.CDATA_END */);
13236
13303
  this._requireStr(']]>');
13237
13304
  this._endToken([]);
13238
13305
  }
13239
13306
  _consumeDocType(start) {
13240
- this._beginToken(18 /* DOC_TYPE */, start);
13307
+ this._beginToken(18 /* TokenType.DOC_TYPE */, start);
13241
13308
  const contentStart = this._cursor.clone();
13242
13309
  this._attemptUntilChar($GT);
13243
13310
  const content = this._cursor.getChars(contentStart);
@@ -13291,12 +13358,12 @@ class _Tokenizer {
13291
13358
  if (e instanceof _ControlFlowError) {
13292
13359
  if (openTagToken) {
13293
13360
  // We errored before we could close the opening tag, so it is incomplete.
13294
- openTagToken.type = 4 /* INCOMPLETE_TAG_OPEN */;
13361
+ openTagToken.type = 4 /* TokenType.INCOMPLETE_TAG_OPEN */;
13295
13362
  }
13296
13363
  else {
13297
13364
  // When the start tag is invalid, assume we want a "<" as text.
13298
13365
  // Back to back text tokens are merged at the end.
13299
- this._beginToken(5 /* TEXT */, start);
13366
+ this._beginToken(5 /* TokenType.TEXT */, start);
13300
13367
  this._endToken(['<']);
13301
13368
  }
13302
13369
  return;
@@ -13323,13 +13390,13 @@ class _Tokenizer {
13323
13390
  this._attemptCharCodeUntilFn(isNotWhitespace);
13324
13391
  return this._attemptCharCode($GT);
13325
13392
  });
13326
- this._beginToken(3 /* TAG_CLOSE */);
13393
+ this._beginToken(3 /* TokenType.TAG_CLOSE */);
13327
13394
  this._requireCharCodeUntilFn(code => code === $GT, 3);
13328
13395
  this._cursor.advance(); // Consume the `>`
13329
13396
  this._endToken([prefix, tagName]);
13330
13397
  }
13331
13398
  _consumeTagOpenStart(start) {
13332
- this._beginToken(0 /* TAG_OPEN_START */, start);
13399
+ this._beginToken(0 /* TokenType.TAG_OPEN_START */, start);
13333
13400
  const parts = this._consumePrefixAndName();
13334
13401
  return this._endToken(parts);
13335
13402
  }
@@ -13338,7 +13405,7 @@ class _Tokenizer {
13338
13405
  if (attrNameStart === $SQ || attrNameStart === $DQ) {
13339
13406
  throw this._createError(_unexpectedCharacterErrorMsg(attrNameStart), this._cursor.getSpan());
13340
13407
  }
13341
- this._beginToken(14 /* ATTR_NAME */);
13408
+ this._beginToken(14 /* TokenType.ATTR_NAME */);
13342
13409
  const prefixAndName = this._consumePrefixAndName();
13343
13410
  this._endToken(prefixAndName);
13344
13411
  }
@@ -13350,27 +13417,27 @@ class _Tokenizer {
13350
13417
  // In an attribute then end of the attribute value and the premature end to an interpolation
13351
13418
  // are both triggered by the `quoteChar`.
13352
13419
  const endPredicate = () => this._cursor.peek() === quoteChar;
13353
- this._consumeWithInterpolation(16 /* ATTR_VALUE_TEXT */, 17 /* ATTR_VALUE_INTERPOLATION */, endPredicate, endPredicate);
13420
+ this._consumeWithInterpolation(16 /* TokenType.ATTR_VALUE_TEXT */, 17 /* TokenType.ATTR_VALUE_INTERPOLATION */, endPredicate, endPredicate);
13354
13421
  this._consumeQuote(quoteChar);
13355
13422
  }
13356
13423
  else {
13357
13424
  const endPredicate = () => isNameEnd(this._cursor.peek());
13358
- this._consumeWithInterpolation(16 /* ATTR_VALUE_TEXT */, 17 /* ATTR_VALUE_INTERPOLATION */, endPredicate, endPredicate);
13425
+ this._consumeWithInterpolation(16 /* TokenType.ATTR_VALUE_TEXT */, 17 /* TokenType.ATTR_VALUE_INTERPOLATION */, endPredicate, endPredicate);
13359
13426
  }
13360
13427
  }
13361
13428
  _consumeQuote(quoteChar) {
13362
- this._beginToken(15 /* ATTR_QUOTE */);
13429
+ this._beginToken(15 /* TokenType.ATTR_QUOTE */);
13363
13430
  this._requireCharCode(quoteChar);
13364
13431
  this._endToken([String.fromCodePoint(quoteChar)]);
13365
13432
  }
13366
13433
  _consumeTagOpenEnd() {
13367
- const tokenType = this._attemptCharCode($SLASH) ? 2 /* TAG_OPEN_END_VOID */ : 1 /* TAG_OPEN_END */;
13434
+ const tokenType = this._attemptCharCode($SLASH) ? 2 /* TokenType.TAG_OPEN_END_VOID */ : 1 /* TokenType.TAG_OPEN_END */;
13368
13435
  this._beginToken(tokenType);
13369
13436
  this._requireCharCode($GT);
13370
13437
  this._endToken([]);
13371
13438
  }
13372
13439
  _consumeTagClose(start) {
13373
- this._beginToken(3 /* TAG_CLOSE */, start);
13440
+ this._beginToken(3 /* TokenType.TAG_CLOSE */, start);
13374
13441
  this._attemptCharCodeUntilFn(isNotWhitespace);
13375
13442
  const prefixAndName = this._consumePrefixAndName();
13376
13443
  this._attemptCharCodeUntilFn(isNotWhitespace);
@@ -13378,11 +13445,11 @@ class _Tokenizer {
13378
13445
  this._endToken(prefixAndName);
13379
13446
  }
13380
13447
  _consumeExpansionFormStart() {
13381
- this._beginToken(19 /* EXPANSION_FORM_START */);
13448
+ this._beginToken(19 /* TokenType.EXPANSION_FORM_START */);
13382
13449
  this._requireCharCode($LBRACE);
13383
13450
  this._endToken([]);
13384
- this._expansionCaseStack.push(19 /* EXPANSION_FORM_START */);
13385
- this._beginToken(7 /* RAW_TEXT */);
13451
+ this._expansionCaseStack.push(19 /* TokenType.EXPANSION_FORM_START */);
13452
+ this._beginToken(7 /* TokenType.RAW_TEXT */);
13386
13453
  const condition = this._readUntil($COMMA);
13387
13454
  const normalizedCondition = this._processCarriageReturns(condition);
13388
13455
  if (this._i18nNormalizeLineEndingsInICUs) {
@@ -13398,32 +13465,32 @@ class _Tokenizer {
13398
13465
  }
13399
13466
  this._requireCharCode($COMMA);
13400
13467
  this._attemptCharCodeUntilFn(isNotWhitespace);
13401
- this._beginToken(7 /* RAW_TEXT */);
13468
+ this._beginToken(7 /* TokenType.RAW_TEXT */);
13402
13469
  const type = this._readUntil($COMMA);
13403
13470
  this._endToken([type]);
13404
13471
  this._requireCharCode($COMMA);
13405
13472
  this._attemptCharCodeUntilFn(isNotWhitespace);
13406
13473
  }
13407
13474
  _consumeExpansionCaseStart() {
13408
- this._beginToken(20 /* EXPANSION_CASE_VALUE */);
13475
+ this._beginToken(20 /* TokenType.EXPANSION_CASE_VALUE */);
13409
13476
  const value = this._readUntil($LBRACE).trim();
13410
13477
  this._endToken([value]);
13411
13478
  this._attemptCharCodeUntilFn(isNotWhitespace);
13412
- this._beginToken(21 /* EXPANSION_CASE_EXP_START */);
13479
+ this._beginToken(21 /* TokenType.EXPANSION_CASE_EXP_START */);
13413
13480
  this._requireCharCode($LBRACE);
13414
13481
  this._endToken([]);
13415
13482
  this._attemptCharCodeUntilFn(isNotWhitespace);
13416
- this._expansionCaseStack.push(21 /* EXPANSION_CASE_EXP_START */);
13483
+ this._expansionCaseStack.push(21 /* TokenType.EXPANSION_CASE_EXP_START */);
13417
13484
  }
13418
13485
  _consumeExpansionCaseEnd() {
13419
- this._beginToken(22 /* EXPANSION_CASE_EXP_END */);
13486
+ this._beginToken(22 /* TokenType.EXPANSION_CASE_EXP_END */);
13420
13487
  this._requireCharCode($RBRACE);
13421
13488
  this._endToken([]);
13422
13489
  this._attemptCharCodeUntilFn(isNotWhitespace);
13423
13490
  this._expansionCaseStack.pop();
13424
13491
  }
13425
13492
  _consumeExpansionFormEnd() {
13426
- this._beginToken(23 /* EXPANSION_FORM_END */);
13493
+ this._beginToken(23 /* TokenType.EXPANSION_FORM_END */);
13427
13494
  this._requireCharCode($RBRACE);
13428
13495
  this._endToken([]);
13429
13496
  this._expansionCaseStack.pop();
@@ -13573,12 +13640,12 @@ class _Tokenizer {
13573
13640
  _isInExpansionCase() {
13574
13641
  return this._expansionCaseStack.length > 0 &&
13575
13642
  this._expansionCaseStack[this._expansionCaseStack.length - 1] ===
13576
- 21 /* EXPANSION_CASE_EXP_START */;
13643
+ 21 /* TokenType.EXPANSION_CASE_EXP_START */;
13577
13644
  }
13578
13645
  _isInExpansionForm() {
13579
13646
  return this._expansionCaseStack.length > 0 &&
13580
13647
  this._expansionCaseStack[this._expansionCaseStack.length - 1] ===
13581
- 19 /* EXPANSION_FORM_START */;
13648
+ 19 /* TokenType.EXPANSION_FORM_START */;
13582
13649
  }
13583
13650
  isExpansionFormStart() {
13584
13651
  if (this._cursor.peek() !== $LBRACE) {
@@ -13625,9 +13692,9 @@ function mergeTextTokens(srcTokens) {
13625
13692
  let lastDstToken = undefined;
13626
13693
  for (let i = 0; i < srcTokens.length; i++) {
13627
13694
  const token = srcTokens[i];
13628
- if ((lastDstToken && lastDstToken.type === 5 /* TEXT */ && token.type === 5 /* TEXT */) ||
13629
- (lastDstToken && lastDstToken.type === 16 /* ATTR_VALUE_TEXT */ &&
13630
- token.type === 16 /* ATTR_VALUE_TEXT */)) {
13695
+ if ((lastDstToken && lastDstToken.type === 5 /* TokenType.TEXT */ && token.type === 5 /* TokenType.TEXT */) ||
13696
+ (lastDstToken && lastDstToken.type === 16 /* TokenType.ATTR_VALUE_TEXT */ &&
13697
+ token.type === 16 /* TokenType.ATTR_VALUE_TEXT */)) {
13631
13698
  lastDstToken.parts[0] += token.parts[0];
13632
13699
  lastDstToken.sourceSpan.end = token.sourceSpan.end;
13633
13700
  }
@@ -13858,7 +13925,7 @@ class EscapedCharacterCursor extends PlainCharacterCursor {
13858
13925
  }
13859
13926
  }
13860
13927
  decodeHexDigits(start, length) {
13861
- const hex = this.input.substr(start.internalState.offset, length);
13928
+ const hex = this.input.slice(start.internalState.offset, start.internalState.offset + length);
13862
13929
  const charCode = parseInt(hex, 16);
13863
13930
  if (!isNaN(charCode)) {
13864
13931
  return charCode;
@@ -13920,28 +13987,28 @@ class _TreeBuilder {
13920
13987
  this._advance();
13921
13988
  }
13922
13989
  build() {
13923
- while (this._peek.type !== 24 /* EOF */) {
13924
- if (this._peek.type === 0 /* TAG_OPEN_START */ ||
13925
- this._peek.type === 4 /* INCOMPLETE_TAG_OPEN */) {
13990
+ while (this._peek.type !== 24 /* TokenType.EOF */) {
13991
+ if (this._peek.type === 0 /* TokenType.TAG_OPEN_START */ ||
13992
+ this._peek.type === 4 /* TokenType.INCOMPLETE_TAG_OPEN */) {
13926
13993
  this._consumeStartTag(this._advance());
13927
13994
  }
13928
- else if (this._peek.type === 3 /* TAG_CLOSE */) {
13995
+ else if (this._peek.type === 3 /* TokenType.TAG_CLOSE */) {
13929
13996
  this._consumeEndTag(this._advance());
13930
13997
  }
13931
- else if (this._peek.type === 12 /* CDATA_START */) {
13998
+ else if (this._peek.type === 12 /* TokenType.CDATA_START */) {
13932
13999
  this._closeVoidElement();
13933
14000
  this._consumeCdata(this._advance());
13934
14001
  }
13935
- else if (this._peek.type === 10 /* COMMENT_START */) {
14002
+ else if (this._peek.type === 10 /* TokenType.COMMENT_START */) {
13936
14003
  this._closeVoidElement();
13937
14004
  this._consumeComment(this._advance());
13938
14005
  }
13939
- else if (this._peek.type === 5 /* TEXT */ || this._peek.type === 7 /* RAW_TEXT */ ||
13940
- this._peek.type === 6 /* ESCAPABLE_RAW_TEXT */) {
14006
+ else if (this._peek.type === 5 /* TokenType.TEXT */ || this._peek.type === 7 /* TokenType.RAW_TEXT */ ||
14007
+ this._peek.type === 6 /* TokenType.ESCAPABLE_RAW_TEXT */) {
13941
14008
  this._closeVoidElement();
13942
14009
  this._consumeText(this._advance());
13943
14010
  }
13944
- else if (this._peek.type === 19 /* EXPANSION_FORM_START */) {
14011
+ else if (this._peek.type === 19 /* TokenType.EXPANSION_FORM_START */) {
13945
14012
  this._consumeExpansion(this._advance());
13946
14013
  }
13947
14014
  else {
@@ -13967,11 +14034,11 @@ class _TreeBuilder {
13967
14034
  }
13968
14035
  _consumeCdata(_startToken) {
13969
14036
  this._consumeText(this._advance());
13970
- this._advanceIf(13 /* CDATA_END */);
14037
+ this._advanceIf(13 /* TokenType.CDATA_END */);
13971
14038
  }
13972
14039
  _consumeComment(token) {
13973
- const text = this._advanceIf(7 /* RAW_TEXT */);
13974
- this._advanceIf(11 /* COMMENT_END */);
14040
+ const text = this._advanceIf(7 /* TokenType.RAW_TEXT */);
14041
+ this._advanceIf(11 /* TokenType.COMMENT_END */);
13975
14042
  const value = text != null ? text.parts[0].trim() : null;
13976
14043
  this._addToParent(new Comment(value, token.sourceSpan));
13977
14044
  }
@@ -13980,14 +14047,14 @@ class _TreeBuilder {
13980
14047
  const type = this._advance();
13981
14048
  const cases = [];
13982
14049
  // read =
13983
- while (this._peek.type === 20 /* EXPANSION_CASE_VALUE */) {
14050
+ while (this._peek.type === 20 /* TokenType.EXPANSION_CASE_VALUE */) {
13984
14051
  const expCase = this._parseExpansionCase();
13985
14052
  if (!expCase)
13986
14053
  return; // error
13987
14054
  cases.push(expCase);
13988
14055
  }
13989
14056
  // read the final }
13990
- if (this._peek.type !== 23 /* EXPANSION_FORM_END */) {
14057
+ if (this._peek.type !== 23 /* TokenType.EXPANSION_FORM_END */) {
13991
14058
  this.errors.push(TreeError.create(null, this._peek.sourceSpan, `Invalid ICU message. Missing '}'.`));
13992
14059
  return;
13993
14060
  }
@@ -13998,7 +14065,7 @@ class _TreeBuilder {
13998
14065
  _parseExpansionCase() {
13999
14066
  const value = this._advance();
14000
14067
  // read {
14001
- if (this._peek.type !== 21 /* EXPANSION_CASE_EXP_START */) {
14068
+ if (this._peek.type !== 21 /* TokenType.EXPANSION_CASE_EXP_START */) {
14002
14069
  this.errors.push(TreeError.create(null, this._peek.sourceSpan, `Invalid ICU message. Missing '{'.`));
14003
14070
  return null;
14004
14071
  }
@@ -14008,7 +14075,7 @@ class _TreeBuilder {
14008
14075
  if (!exp)
14009
14076
  return null;
14010
14077
  const end = this._advance();
14011
- exp.push({ type: 24 /* EOF */, parts: [], sourceSpan: end.sourceSpan });
14078
+ exp.push({ type: 24 /* TokenType.EOF */, parts: [], sourceSpan: end.sourceSpan });
14012
14079
  // parse everything in between { and }
14013
14080
  const expansionCaseParser = new _TreeBuilder(exp, this.getTagDefinition);
14014
14081
  expansionCaseParser.build();
@@ -14022,14 +14089,14 @@ class _TreeBuilder {
14022
14089
  }
14023
14090
  _collectExpansionExpTokens(start) {
14024
14091
  const exp = [];
14025
- const expansionFormStack = [21 /* EXPANSION_CASE_EXP_START */];
14092
+ const expansionFormStack = [21 /* TokenType.EXPANSION_CASE_EXP_START */];
14026
14093
  while (true) {
14027
- if (this._peek.type === 19 /* EXPANSION_FORM_START */ ||
14028
- this._peek.type === 21 /* EXPANSION_CASE_EXP_START */) {
14094
+ if (this._peek.type === 19 /* TokenType.EXPANSION_FORM_START */ ||
14095
+ this._peek.type === 21 /* TokenType.EXPANSION_CASE_EXP_START */) {
14029
14096
  expansionFormStack.push(this._peek.type);
14030
14097
  }
14031
- if (this._peek.type === 22 /* EXPANSION_CASE_EXP_END */) {
14032
- if (lastOnStack(expansionFormStack, 21 /* EXPANSION_CASE_EXP_START */)) {
14098
+ if (this._peek.type === 22 /* TokenType.EXPANSION_CASE_EXP_END */) {
14099
+ if (lastOnStack(expansionFormStack, 21 /* TokenType.EXPANSION_CASE_EXP_START */)) {
14033
14100
  expansionFormStack.pop();
14034
14101
  if (expansionFormStack.length === 0)
14035
14102
  return exp;
@@ -14039,8 +14106,8 @@ class _TreeBuilder {
14039
14106
  return null;
14040
14107
  }
14041
14108
  }
14042
- if (this._peek.type === 23 /* EXPANSION_FORM_END */) {
14043
- if (lastOnStack(expansionFormStack, 19 /* EXPANSION_FORM_START */)) {
14109
+ if (this._peek.type === 23 /* TokenType.EXPANSION_FORM_END */) {
14110
+ if (lastOnStack(expansionFormStack, 19 /* TokenType.EXPANSION_FORM_START */)) {
14044
14111
  expansionFormStack.pop();
14045
14112
  }
14046
14113
  else {
@@ -14048,7 +14115,7 @@ class _TreeBuilder {
14048
14115
  return null;
14049
14116
  }
14050
14117
  }
14051
- if (this._peek.type === 24 /* EOF */) {
14118
+ if (this._peek.type === 24 /* TokenType.EOF */) {
14052
14119
  this.errors.push(TreeError.create(null, start.sourceSpan, `Invalid ICU message. Missing '}'.`));
14053
14120
  return null;
14054
14121
  }
@@ -14067,18 +14134,18 @@ class _TreeBuilder {
14067
14134
  tokens[0] = { type: token.type, sourceSpan: token.sourceSpan, parts: [text] };
14068
14135
  }
14069
14136
  }
14070
- while (this._peek.type === 8 /* INTERPOLATION */ || this._peek.type === 5 /* TEXT */ ||
14071
- this._peek.type === 9 /* ENCODED_ENTITY */) {
14137
+ while (this._peek.type === 8 /* TokenType.INTERPOLATION */ || this._peek.type === 5 /* TokenType.TEXT */ ||
14138
+ this._peek.type === 9 /* TokenType.ENCODED_ENTITY */) {
14072
14139
  token = this._advance();
14073
14140
  tokens.push(token);
14074
- if (token.type === 8 /* INTERPOLATION */) {
14141
+ if (token.type === 8 /* TokenType.INTERPOLATION */) {
14075
14142
  // For backward compatibility we decode HTML entities that appear in interpolation
14076
14143
  // expressions. This is arguably a bug, but it could be a considerable breaking change to
14077
14144
  // fix it. It should be addressed in a larger project to refactor the entire parser/lexer
14078
14145
  // chain after View Engine has been removed.
14079
14146
  text += token.parts.join('').replace(/&([^;]+);/g, decodeEntity);
14080
14147
  }
14081
- else if (token.type === 9 /* ENCODED_ENTITY */) {
14148
+ else if (token.type === 9 /* TokenType.ENCODED_ENTITY */) {
14082
14149
  text += token.parts[0];
14083
14150
  }
14084
14151
  else {
@@ -14099,14 +14166,14 @@ class _TreeBuilder {
14099
14166
  _consumeStartTag(startTagToken) {
14100
14167
  const [prefix, name] = startTagToken.parts;
14101
14168
  const attrs = [];
14102
- while (this._peek.type === 14 /* ATTR_NAME */) {
14169
+ while (this._peek.type === 14 /* TokenType.ATTR_NAME */) {
14103
14170
  attrs.push(this._consumeAttr(this._advance()));
14104
14171
  }
14105
14172
  const fullName = this._getElementFullName(prefix, name, this._getParentElement());
14106
14173
  let selfClosing = false;
14107
14174
  // Note: There could have been a tokenizer error
14108
14175
  // so that we don't get a token for the end tag...
14109
- if (this._peek.type === 2 /* TAG_OPEN_END_VOID */) {
14176
+ if (this._peek.type === 2 /* TokenType.TAG_OPEN_END_VOID */) {
14110
14177
  this._advance();
14111
14178
  selfClosing = true;
14112
14179
  const tagDef = this.getTagDefinition(fullName);
@@ -14114,7 +14181,7 @@ class _TreeBuilder {
14114
14181
  this.errors.push(TreeError.create(fullName, startTagToken.sourceSpan, `Only void and foreign elements can be self closed "${startTagToken.parts[1]}"`));
14115
14182
  }
14116
14183
  }
14117
- else if (this._peek.type === 1 /* TAG_OPEN_END */) {
14184
+ else if (this._peek.type === 1 /* TokenType.TAG_OPEN_END */) {
14118
14185
  this._advance();
14119
14186
  selfClosing = false;
14120
14187
  }
@@ -14129,7 +14196,7 @@ class _TreeBuilder {
14129
14196
  // element start tag also represents the end tag.
14130
14197
  this._popElement(fullName, span);
14131
14198
  }
14132
- else if (startTagToken.type === 4 /* INCOMPLETE_TAG_OPEN */) {
14199
+ else if (startTagToken.type === 4 /* TokenType.INCOMPLETE_TAG_OPEN */) {
14133
14200
  // We already know the opening tag is not complete, so it is unlikely it has a corresponding
14134
14201
  // close tag. Let's optimistically parse it as a full element and emit an error.
14135
14202
  this._popElement(fullName, null);
@@ -14186,7 +14253,7 @@ class _TreeBuilder {
14186
14253
  const fullName = mergeNsAndName(attrName.parts[0], attrName.parts[1]);
14187
14254
  let attrEnd = attrName.sourceSpan.end;
14188
14255
  // Consume any quote
14189
- if (this._peek.type === 15 /* ATTR_QUOTE */) {
14256
+ if (this._peek.type === 15 /* TokenType.ATTR_QUOTE */) {
14190
14257
  this._advance();
14191
14258
  }
14192
14259
  // Consume the attribute value
@@ -14199,22 +14266,22 @@ class _TreeBuilder {
14199
14266
  // being able to consider `ATTR_VALUE_INTERPOLATION` as an option. This is because TS is not
14200
14267
  // able to see that `_advance()` will actually mutate `_peek`.
14201
14268
  const nextTokenType = this._peek.type;
14202
- if (nextTokenType === 16 /* ATTR_VALUE_TEXT */) {
14269
+ if (nextTokenType === 16 /* TokenType.ATTR_VALUE_TEXT */) {
14203
14270
  valueStartSpan = this._peek.sourceSpan;
14204
14271
  valueEnd = this._peek.sourceSpan.end;
14205
- while (this._peek.type === 16 /* ATTR_VALUE_TEXT */ ||
14206
- this._peek.type === 17 /* ATTR_VALUE_INTERPOLATION */ ||
14207
- this._peek.type === 9 /* ENCODED_ENTITY */) {
14272
+ while (this._peek.type === 16 /* TokenType.ATTR_VALUE_TEXT */ ||
14273
+ this._peek.type === 17 /* TokenType.ATTR_VALUE_INTERPOLATION */ ||
14274
+ this._peek.type === 9 /* TokenType.ENCODED_ENTITY */) {
14208
14275
  const valueToken = this._advance();
14209
14276
  valueTokens.push(valueToken);
14210
- if (valueToken.type === 17 /* ATTR_VALUE_INTERPOLATION */) {
14277
+ if (valueToken.type === 17 /* TokenType.ATTR_VALUE_INTERPOLATION */) {
14211
14278
  // For backward compatibility we decode HTML entities that appear in interpolation
14212
14279
  // expressions. This is arguably a bug, but it could be a considerable breaking change to
14213
14280
  // fix it. It should be addressed in a larger project to refactor the entire parser/lexer
14214
14281
  // chain after View Engine has been removed.
14215
14282
  value += valueToken.parts.join('').replace(/&([^;]+);/g, decodeEntity);
14216
14283
  }
14217
- else if (valueToken.type === 9 /* ENCODED_ENTITY */) {
14284
+ else if (valueToken.type === 9 /* TokenType.ENCODED_ENTITY */) {
14218
14285
  value += valueToken.parts[0];
14219
14286
  }
14220
14287
  else {
@@ -14224,7 +14291,7 @@ class _TreeBuilder {
14224
14291
  }
14225
14292
  }
14226
14293
  // Consume any quote
14227
- if (this._peek.type === 15 /* ATTR_QUOTE */) {
14294
+ if (this._peek.type === 15 /* TokenType.ATTR_QUOTE */) {
14228
14295
  const quoteToken = this._advance();
14229
14296
  attrEnd = quoteToken.sourceSpan.end;
14230
14297
  }
@@ -14354,7 +14421,7 @@ class WhitespaceVisitor {
14354
14421
  (context.prev instanceof Expansion || context.next instanceof Expansion);
14355
14422
  if (isNotBlank || hasExpansionSibling) {
14356
14423
  // Process the whitespace in the tokens of this Text node
14357
- const tokens = text.tokens.map(token => token.type === 5 /* TEXT */ ? createWhitespaceProcessedTextToken(token) : token);
14424
+ const tokens = text.tokens.map(token => token.type === 5 /* TokenType.TEXT */ ? createWhitespaceProcessedTextToken(token) : token);
14358
14425
  // Process the whitespace of the value of this Text node
14359
14426
  const value = processWhitespace(text.value);
14360
14427
  return new Text(value, text.sourceSpan, tokens, text.i18n);
@@ -15204,7 +15271,7 @@ class BindingParser {
15204
15271
  }
15205
15272
  createBoundElementProperty(elementSelector, boundProp, skipValidation = false, mapPropertyName = true) {
15206
15273
  if (boundProp.isAnimation) {
15207
- return new BoundElementProperty(boundProp.name, 4 /* Animation */, SecurityContext.NONE, boundProp.expression, null, boundProp.sourceSpan, boundProp.keySpan, boundProp.valueSpan);
15274
+ return new BoundElementProperty(boundProp.name, 4 /* BindingType.Animation */, SecurityContext.NONE, boundProp.expression, null, boundProp.sourceSpan, boundProp.keySpan, boundProp.valueSpan);
15208
15275
  }
15209
15276
  let unit = null;
15210
15277
  let bindingType = undefined;
@@ -15225,17 +15292,17 @@ class BindingParser {
15225
15292
  const name = boundPropertyName.substring(nsSeparatorIdx + 1);
15226
15293
  boundPropertyName = mergeNsAndName(ns, name);
15227
15294
  }
15228
- bindingType = 1 /* Attribute */;
15295
+ bindingType = 1 /* BindingType.Attribute */;
15229
15296
  }
15230
15297
  else if (parts[0] == CLASS_PREFIX) {
15231
15298
  boundPropertyName = parts[1];
15232
- bindingType = 2 /* Class */;
15299
+ bindingType = 2 /* BindingType.Class */;
15233
15300
  securityContexts = [SecurityContext.NONE];
15234
15301
  }
15235
15302
  else if (parts[0] == STYLE_PREFIX) {
15236
15303
  unit = parts.length > 2 ? parts[2] : null;
15237
15304
  boundPropertyName = parts[1];
15238
- bindingType = 3 /* Style */;
15305
+ bindingType = 3 /* BindingType.Style */;
15239
15306
  securityContexts = [SecurityContext.STYLE];
15240
15307
  }
15241
15308
  }
@@ -15244,7 +15311,7 @@ class BindingParser {
15244
15311
  const mappedPropName = this._schemaRegistry.getMappedPropName(boundProp.name);
15245
15312
  boundPropertyName = mapPropertyName ? mappedPropName : boundProp.name;
15246
15313
  securityContexts = calcPossibleSecurityContexts(this._schemaRegistry, elementSelector, mappedPropName, false);
15247
- bindingType = 0 /* Property */;
15314
+ bindingType = 0 /* BindingType.Property */;
15248
15315
  if (!skipValidation) {
15249
15316
  this._validatePropertyOrAttributeName(mappedPropName, boundProp.sourceSpan, false);
15250
15317
  }
@@ -15257,7 +15324,7 @@ class BindingParser {
15257
15324
  this._reportError(`Event name is missing in binding`, sourceSpan);
15258
15325
  }
15259
15326
  if (isAnimationLabel(name)) {
15260
- name = name.substr(1);
15327
+ name = name.slice(1);
15261
15328
  if (keySpan !== undefined) {
15262
15329
  keySpan = moveParseSourceSpan(keySpan, new AbsoluteSourceSpan(keySpan.start.offset + 1, keySpan.end.offset));
15263
15330
  }
@@ -15276,7 +15343,7 @@ class BindingParser {
15276
15343
  const eventName = matches[0];
15277
15344
  const phase = matches[1].toLowerCase();
15278
15345
  const ast = this._parseAction(expression, isAssignmentEvent, handlerSpan);
15279
- targetEvents.push(new ParsedEvent(eventName, phase, 1 /* Animation */, ast, sourceSpan, handlerSpan, keySpan));
15346
+ targetEvents.push(new ParsedEvent(eventName, phase, 1 /* ParsedEventType.Animation */, ast, sourceSpan, handlerSpan, keySpan));
15280
15347
  if (eventName.length === 0) {
15281
15348
  this._reportError(`Animation event name is missing in binding`, sourceSpan);
15282
15349
  }
@@ -15294,7 +15361,7 @@ class BindingParser {
15294
15361
  const [target, eventName] = splitAtColon(name, [null, name]);
15295
15362
  const ast = this._parseAction(expression, isAssignmentEvent, handlerSpan);
15296
15363
  targetMatchableAttrs.push([name, ast.source]);
15297
- targetEvents.push(new ParsedEvent(eventName, target, 0 /* Regular */, ast, sourceSpan, handlerSpan, keySpan));
15364
+ targetEvents.push(new ParsedEvent(eventName, target, 0 /* ParsedEventType.Regular */, ast, sourceSpan, handlerSpan, keySpan));
15298
15365
  // Don't detect directives for event names for now,
15299
15366
  // so don't add the event name to the matchableAttrs
15300
15367
  }
@@ -16377,8 +16444,8 @@ class _I18nVisitor {
16377
16444
  let hasInterpolation = false;
16378
16445
  for (const token of tokens) {
16379
16446
  switch (token.type) {
16380
- case 8 /* INTERPOLATION */:
16381
- case 17 /* ATTR_VALUE_INTERPOLATION */:
16447
+ case 8 /* TokenType.INTERPOLATION */:
16448
+ case 17 /* TokenType.ATTR_VALUE_INTERPOLATION */:
16382
16449
  hasInterpolation = true;
16383
16450
  const expression = token.parts[1];
16384
16451
  const baseName = extractPlaceholderName(expression) || 'INTERPOLATION';
@@ -16707,25 +16774,78 @@ function parseI18nMeta(meta = '') {
16707
16774
  function i18nMetaToJSDoc(meta) {
16708
16775
  const tags = [];
16709
16776
  if (meta.description) {
16710
- tags.push({ tagName: "desc" /* Desc */, text: meta.description });
16777
+ tags.push({ tagName: "desc" /* o.JSDocTagName.Desc */, text: meta.description });
16711
16778
  }
16712
16779
  else {
16713
16780
  // Suppress the JSCompiler warning that a `@desc` was not given for this message.
16714
- tags.push({ tagName: "suppress" /* Suppress */, text: '{msgDescriptions}' });
16781
+ tags.push({ tagName: "suppress" /* o.JSDocTagName.Suppress */, text: '{msgDescriptions}' });
16715
16782
  }
16716
16783
  if (meta.meaning) {
16717
- tags.push({ tagName: "meaning" /* Meaning */, text: meta.meaning });
16784
+ tags.push({ tagName: "meaning" /* o.JSDocTagName.Meaning */, text: meta.meaning });
16718
16785
  }
16719
16786
  return jsDocComment(tags);
16720
16787
  }
16721
16788
 
16722
16789
  /** Closure uses `goog.getMsg(message)` to lookup translations */
16723
16790
  const GOOG_GET_MSG = 'goog.getMsg';
16724
- function createGoogleGetMsgStatements(variable$1, message, closureVar, params) {
16791
+ /**
16792
+ * Generates a `goog.getMsg()` statement and reassignment. The template:
16793
+ *
16794
+ * ```html
16795
+ * <div i18n>Sent from {{ sender }} to <span class="receiver">{{ receiver }}</span></div>
16796
+ * ```
16797
+ *
16798
+ * Generates:
16799
+ *
16800
+ * ```typescript
16801
+ * const MSG_FOO = goog.getMsg(
16802
+ * // Message template.
16803
+ * 'Sent from {$interpolation} to {$startTagSpan}{$interpolation_1}{$closeTagSpan}.',
16804
+ * // Placeholder values, set to magic strings which get replaced by the Angular runtime.
16805
+ * {
16806
+ * 'interpolation': '\uFFFD0\uFFFD',
16807
+ * 'startTagSpan': '\uFFFD1\uFFFD',
16808
+ * 'interpolation_1': '\uFFFD2\uFFFD',
16809
+ * 'closeTagSpan': '\uFFFD3\uFFFD',
16810
+ * },
16811
+ * // Options bag.
16812
+ * {
16813
+ * // Maps each placeholder to the original Angular source code which generates it's value.
16814
+ * original_code: {
16815
+ * 'interpolation': '{{ sender }}',
16816
+ * 'startTagSpan': '<span class="receiver">',
16817
+ * 'interploation_1': '{{ receiver }}',
16818
+ * 'closeTagSpan': '</span>',
16819
+ * },
16820
+ * },
16821
+ * );
16822
+ * const I18N_0 = MSG_FOO;
16823
+ * ```
16824
+ */
16825
+ function createGoogleGetMsgStatements(variable$1, message, closureVar, placeholderValues) {
16725
16826
  const messageString = serializeI18nMessageForGetMsg(message);
16726
16827
  const args = [literal(messageString)];
16727
- if (Object.keys(params).length) {
16728
- args.push(mapLiteral(params, true));
16828
+ if (Object.keys(placeholderValues).length) {
16829
+ // Message template parameters containing the magic strings replaced by the Angular runtime with
16830
+ // real data, e.g. `{'interpolation': '\uFFFD0\uFFFD'}`.
16831
+ args.push(mapLiteral(formatI18nPlaceholderNamesInMap(placeholderValues, true /* useCamelCase */), true /* quoted */));
16832
+ // Message options object, which contains original source code for placeholders (as they are
16833
+ // present in a template, e.g.
16834
+ // `{original_code: {'interpolation': '{{ name }}', 'startTagSpan': '<span>'}}`.
16835
+ args.push(mapLiteral({
16836
+ original_code: literalMap(Object.keys(placeholderValues)
16837
+ .map((param) => ({
16838
+ key: formatI18nPlaceholderName(param),
16839
+ quoted: true,
16840
+ value: message.placeholders[param] ?
16841
+ // Get source span for typical placeholder if it exists.
16842
+ literal(message.placeholders[param].sourceSpan.toString()) :
16843
+ // Otherwise must be an ICU expression, get it's source span.
16844
+ literal(message.placeholderToMessage[param]
16845
+ .nodes.map((node) => node.sourceSpan.toString())
16846
+ .join('')),
16847
+ }))),
16848
+ }));
16729
16849
  }
16730
16850
  // /**
16731
16851
  // * @desc description of message
@@ -16915,14 +17035,28 @@ function prepareEventListenerParameters(eventAst, handlerName = null, scope = nu
16915
17035
  scope.getOrCreateSharedContextVar(0);
16916
17036
  const bindingStatements = convertActionBinding(scope, implicitReceiverExpr, handler, 'b', eventAst.handlerSpan, implicitReceiverAccesses, EVENT_BINDING_SCOPE_GLOBALS);
16917
17037
  const statements = [];
16918
- if (scope) {
17038
+ const variableDeclarations = scope === null || scope === void 0 ? void 0 : scope.variableDeclarations();
17039
+ const restoreViewStatement = scope === null || scope === void 0 ? void 0 : scope.restoreViewStatement();
17040
+ if (variableDeclarations) {
16919
17041
  // `variableDeclarations` needs to run first, because
16920
17042
  // `restoreViewStatement` depends on the result.
16921
- statements.push(...scope.variableDeclarations());
16922
- statements.unshift(...scope.restoreViewStatement());
17043
+ statements.push(...variableDeclarations);
16923
17044
  }
16924
17045
  statements.push(...bindingStatements);
16925
- const eventName = type === 1 /* Animation */ ? prepareSyntheticListenerName(name, phase) : name;
17046
+ if (restoreViewStatement) {
17047
+ statements.unshift(restoreViewStatement);
17048
+ // If there's a `restoreView` call, we need to reset the view at the end of the listener
17049
+ // in order to avoid a leak. If there's a `return` statement already, we wrap it in the
17050
+ // call, e.g. `return resetView(ctx.foo())`. Otherwise we add the call as the last statement.
17051
+ const lastStatement = statements[statements.length - 1];
17052
+ if (lastStatement instanceof ReturnStatement) {
17053
+ statements[statements.length - 1] = new ReturnStatement(invokeInstruction(lastStatement.value.sourceSpan, Identifiers.resetView, [lastStatement.value]));
17054
+ }
17055
+ else {
17056
+ statements.push(new ExpressionStatement(invokeInstruction(null, Identifiers.resetView, [])));
17057
+ }
17058
+ }
17059
+ const eventName = type === 1 /* ParsedEventType.Animation */ ? prepareSyntheticListenerName(name, phase) : name;
16926
17060
  const fnName = handlerName && sanitizeIdentifier(handlerName);
16927
17061
  const fnArgs = [];
16928
17062
  if (implicitReceiverAccesses.has(eventArgumentName)) {
@@ -17074,10 +17208,10 @@ class TemplateDefinitionBuilder {
17074
17208
  const creationVariables = this._bindingScope.viewSnapshotStatements();
17075
17209
  const updateVariables = this._bindingScope.variableDeclarations().concat(this._tempVariables);
17076
17210
  const creationBlock = creationStatements.length > 0 ?
17077
- [renderFlagCheckIfStmt(1 /* Create */, creationVariables.concat(creationStatements))] :
17211
+ [renderFlagCheckIfStmt(1 /* core.RenderFlags.Create */, creationVariables.concat(creationStatements))] :
17078
17212
  [];
17079
17213
  const updateBlock = updateStatements.length > 0 ?
17080
- [renderFlagCheckIfStmt(2 /* Update */, updateVariables.concat(updateStatements))] :
17214
+ [renderFlagCheckIfStmt(2 /* core.RenderFlags.Update */, updateVariables.concat(updateStatements))] :
17081
17215
  [];
17082
17216
  return fn(
17083
17217
  // i.e. (rf: RenderFlags, ctx: any)
@@ -17115,7 +17249,7 @@ class TemplateDefinitionBuilder {
17115
17249
  const scopedName = this._bindingScope.freshReferenceName();
17116
17250
  const retrievalLevel = this.level;
17117
17251
  const lhs = variable(variable$1.name + scopedName);
17118
- this._bindingScope.set(retrievalLevel, variable$1.name, lhs, 1 /* CONTEXT */, (scope, relativeLevel) => {
17252
+ this._bindingScope.set(retrievalLevel, variable$1.name, lhs, 1 /* DeclarationPriority.CONTEXT */, (scope, relativeLevel) => {
17119
17253
  let rhs;
17120
17254
  if (scope.bindingLevel === retrievalLevel) {
17121
17255
  if (scope.isListenerScope() && scope.hasRestoreViewVariable()) {
@@ -17369,7 +17503,7 @@ class TemplateDefinitionBuilder {
17369
17503
  element.inputs.forEach(input => {
17370
17504
  const stylingInputWasSet = stylingBuilder.registerBoundInput(input);
17371
17505
  if (!stylingInputWasSet) {
17372
- if (input.type === 0 /* Property */ && input.i18n) {
17506
+ if (input.type === 0 /* BindingType.Property */ && input.i18n) {
17373
17507
  boundI18nAttrs.push(input);
17374
17508
  }
17375
17509
  else {
@@ -17442,7 +17576,7 @@ class TemplateDefinitionBuilder {
17442
17576
  // Generate element input bindings
17443
17577
  allOtherInputs.forEach(input => {
17444
17578
  const inputType = input.type;
17445
- if (inputType === 4 /* Animation */) {
17579
+ if (inputType === 4 /* BindingType.Animation */) {
17446
17580
  const value = input.value.visit(this._valueConverter);
17447
17581
  // animation bindings can be presented in the following formats:
17448
17582
  // 1. [@binding]="fooExp"
@@ -17469,7 +17603,7 @@ class TemplateDefinitionBuilder {
17469
17603
  if (value !== undefined) {
17470
17604
  const params = [];
17471
17605
  const [attrNamespace, attrName] = splitNsName(input.name);
17472
- const isAttributeBinding = inputType === 1 /* Attribute */;
17606
+ const isAttributeBinding = inputType === 1 /* BindingType.Attribute */;
17473
17607
  const sanitizationRef = resolveSanitizationFn(input.securityContext, isAttributeBinding);
17474
17608
  if (sanitizationRef)
17475
17609
  params.push(sanitizationRef);
@@ -17485,7 +17619,7 @@ class TemplateDefinitionBuilder {
17485
17619
  }
17486
17620
  }
17487
17621
  this.allocateBindingSlots(value);
17488
- if (inputType === 0 /* Property */) {
17622
+ if (inputType === 0 /* BindingType.Property */) {
17489
17623
  if (value instanceof Interpolation) {
17490
17624
  // prop="{{value}}" and friends
17491
17625
  this.interpolatedUpdateInstruction(getPropertyInterpolationExpression(value), elementIndex, attrName, input, value, params);
@@ -17499,7 +17633,7 @@ class TemplateDefinitionBuilder {
17499
17633
  });
17500
17634
  }
17501
17635
  }
17502
- else if (inputType === 1 /* Attribute */) {
17636
+ else if (inputType === 1 /* BindingType.Attribute */) {
17503
17637
  if (value instanceof Interpolation && getInterpolationArgsLength(value) > 1) {
17504
17638
  // attr.name="text{{value}}" and friends
17505
17639
  this.interpolatedUpdateInstruction(getAttributeInterpolationExpression(value), elementIndex, attrName, input, value, params);
@@ -17665,7 +17799,7 @@ class TemplateDefinitionBuilder {
17665
17799
  // - all ICU vars (such as `VAR_SELECT` or `VAR_PLURAL`) are replaced with correct values
17666
17800
  const transformFn = (raw) => {
17667
17801
  const params = Object.assign(Object.assign({}, vars), placeholders);
17668
- const formatted = i18nFormatPlaceholderNames(params, /* useCamelCase */ false);
17802
+ const formatted = formatI18nPlaceholderNamesInMap(params, /* useCamelCase */ false);
17669
17803
  return invokeInstruction(null, Identifiers.i18nPostprocess, [raw, mapLiteral(formatted, true)]);
17670
17804
  };
17671
17805
  // in case the whole i18n message is a single ICU - we do not need to
@@ -17896,13 +18030,13 @@ class TemplateDefinitionBuilder {
17896
18030
  const input = inputs[i];
17897
18031
  // We don't want the animation and attribute bindings in the
17898
18032
  // attributes array since they aren't used for directive matching.
17899
- if (input.type !== 4 /* Animation */ && input.type !== 1 /* Attribute */) {
18033
+ if (input.type !== 4 /* BindingType.Animation */ && input.type !== 1 /* BindingType.Attribute */) {
17900
18034
  addAttrExpr(input.name);
17901
18035
  }
17902
18036
  }
17903
18037
  for (let i = 0; i < outputs.length; i++) {
17904
18038
  const output = outputs[i];
17905
- if (output.type !== 1 /* Animation */) {
18039
+ if (output.type !== 1 /* ParsedEventType.Animation */) {
17906
18040
  addAttrExpr(output.name);
17907
18041
  }
17908
18042
  }
@@ -17911,15 +18045,15 @@ class TemplateDefinitionBuilder {
17911
18045
  // to the expressions. The marker is important because it tells the runtime
17912
18046
  // code that this is where attributes without values start...
17913
18047
  if (attrExprs.length !== attrsLengthBeforeInputs) {
17914
- attrExprs.splice(attrsLengthBeforeInputs, 0, literal(3 /* Bindings */));
18048
+ attrExprs.splice(attrsLengthBeforeInputs, 0, literal(3 /* core.AttributeMarker.Bindings */));
17915
18049
  }
17916
18050
  }
17917
18051
  if (templateAttrs.length) {
17918
- attrExprs.push(literal(4 /* Template */));
18052
+ attrExprs.push(literal(4 /* core.AttributeMarker.Template */));
17919
18053
  templateAttrs.forEach(attr => addAttrExpr(attr.name));
17920
18054
  }
17921
18055
  if (boundI18nAttrs.length) {
17922
- attrExprs.push(literal(6 /* I18n */));
18056
+ attrExprs.push(literal(6 /* core.AttributeMarker.I18n */));
17923
18057
  boundI18nAttrs.forEach(attr => addAttrExpr(attr.name));
17924
18058
  }
17925
18059
  return attrExprs;
@@ -17950,7 +18084,7 @@ class TemplateDefinitionBuilder {
17950
18084
  const variableName = this._bindingScope.freshReferenceName();
17951
18085
  const retrievalLevel = this.level;
17952
18086
  const lhs = variable(variableName);
17953
- this._bindingScope.set(retrievalLevel, reference.name, lhs, 0 /* DEFAULT */, (scope, relativeLevel) => {
18087
+ this._bindingScope.set(retrievalLevel, reference.name, lhs, 0 /* DeclarationPriority.DEFAULT */, (scope, relativeLevel) => {
17954
18088
  // e.g. nextContext(2);
17955
18089
  const nextContextStmt = relativeLevel > 0 ? [generateNextContextExpr(relativeLevel).toStmt()] : [];
17956
18090
  // e.g. const $foo$ = reference(1);
@@ -17964,7 +18098,7 @@ class TemplateDefinitionBuilder {
17964
18098
  prepareListenerParameter(tagName, outputAst, index) {
17965
18099
  return () => {
17966
18100
  const eventName = outputAst.name;
17967
- const bindingFnName = outputAst.type === 1 /* Animation */ ?
18101
+ const bindingFnName = outputAst.type === 1 /* ParsedEventType.Animation */ ?
17968
18102
  // synthetic @listener.foo values are treated the exact same as are standard listeners
17969
18103
  prepareSyntheticListenerFunctionName(eventName, outputAst.phase) :
17970
18104
  sanitizeIdentifier(eventName);
@@ -18084,7 +18218,7 @@ function getAttributeNameLiterals(name) {
18084
18218
  const nameLiteral = literal(attributeName);
18085
18219
  if (attributeNamespace) {
18086
18220
  return [
18087
- literal(0 /* NamespaceURI */), literal(attributeNamespace), nameLiteral
18221
+ literal(0 /* core.AttributeMarker.NamespaceURI */), literal(attributeNamespace), nameLiteral
18088
18222
  ];
18089
18223
  }
18090
18224
  return [nameLiteral];
@@ -18153,7 +18287,7 @@ class BindingScope {
18153
18287
  * @param declareLocalCallback The callback to invoke when declaring this local var
18154
18288
  * @param localRef Whether or not this is a local ref
18155
18289
  */
18156
- set(retrievalLevel, name, lhs, priority = 0 /* DEFAULT */, declareLocalCallback, localRef) {
18290
+ set(retrievalLevel, name, lhs, priority = 0 /* DeclarationPriority.DEFAULT */, declareLocalCallback, localRef) {
18157
18291
  if (this.map.has(name)) {
18158
18292
  if (localRef) {
18159
18293
  // Do not throw an error if it's a local ref and do not update existing value,
@@ -18209,7 +18343,7 @@ class BindingScope {
18209
18343
  return sharedCtxObj && sharedCtxObj.declare ? sharedCtxObj.lhs : null;
18210
18344
  }
18211
18345
  maybeGenerateSharedContextVar(value) {
18212
- if (value.priority === 1 /* CONTEXT */ &&
18346
+ if (value.priority === 1 /* DeclarationPriority.CONTEXT */ &&
18213
18347
  value.retrievalLevel < this.bindingLevel) {
18214
18348
  const sharedCtxObj = this.map.get(SHARED_CONTEXT_KEY + value.retrievalLevel);
18215
18349
  if (sharedCtxObj) {
@@ -18230,7 +18364,7 @@ class BindingScope {
18230
18364
  return [lhs.set(generateNextContextExpr(relativeLevel)).toConstDecl()];
18231
18365
  },
18232
18366
  declare: false,
18233
- priority: 2 /* SHARED_CONTEXT */,
18367
+ priority: 2 /* DeclarationPriority.SHARED_CONTEXT */,
18234
18368
  });
18235
18369
  }
18236
18370
  getComponentProperty(name) {
@@ -18253,16 +18387,15 @@ class BindingScope {
18253
18387
  }
18254
18388
  }
18255
18389
  restoreViewStatement() {
18256
- const statements = [];
18257
18390
  if (this.restoreViewVariable) {
18258
18391
  const restoreCall = invokeInstruction(null, Identifiers.restoreView, [this.restoreViewVariable]);
18259
18392
  // Either `const restoredCtx = restoreView($state$);` or `restoreView($state$);`
18260
18393
  // depending on whether it is being used.
18261
- statements.push(this.usesRestoredViewContext ?
18394
+ return this.usesRestoredViewContext ?
18262
18395
  variable(RESTORED_VIEW_CONTEXT_NAME).set(restoreCall).toConstDecl() :
18263
- restoreCall.toStmt());
18396
+ restoreCall.toStmt();
18264
18397
  }
18265
- return statements;
18398
+ return null;
18266
18399
  }
18267
18400
  viewSnapshotStatements() {
18268
18401
  // const $state$ = getCurrentView();
@@ -18328,7 +18461,7 @@ function getNgProjectAsLiteral(attribute) {
18328
18461
  // Parse the attribute value into a CssSelectorList. Note that we only take the
18329
18462
  // first selector, because we don't support multiple selectors in ngProjectAs.
18330
18463
  const parsedR3Selector = parseSelectorToR3Selector(attribute.value)[0];
18331
- return [literal(5 /* ProjectAs */), asLiteral(parsedR3Selector)];
18464
+ return [literal(5 /* core.AttributeMarker.ProjectAs */), asLiteral(parsedR3Selector)];
18332
18465
  }
18333
18466
  /**
18334
18467
  * Gets the instruction to generate for an interpolated property
@@ -18587,7 +18720,7 @@ const NG_I18N_CLOSURE_MODE = 'ngI18nClosureMode';
18587
18720
  function getTranslationDeclStmts(message, variable, closureVar, params = {}, transformFn) {
18588
18721
  const statements = [
18589
18722
  declareI18nVariable(variable),
18590
- ifStmt(createClosureModeGuard(), createGoogleGetMsgStatements(variable, message, closureVar, i18nFormatPlaceholderNames(params, /* useCamelCase */ true)), createLocalizeStatements(variable, message, i18nFormatPlaceholderNames(params, /* useCamelCase */ false))),
18723
+ ifStmt(createClosureModeGuard(), createGoogleGetMsgStatements(variable, message, closureVar, params), createLocalizeStatements(variable, message, formatI18nPlaceholderNamesInMap(params, /* useCamelCase */ false))),
18591
18724
  ];
18592
18725
  if (transformFn) {
18593
18726
  statements.push(new ExpressionStatement(variable.set(transformFn(variable))));
@@ -18652,6 +18785,9 @@ function baseDirectiveFields(meta, constantPool, bindingParser) {
18652
18785
  if (meta.exportAs !== null) {
18653
18786
  definitionMap.set('exportAs', literalArr(meta.exportAs.map(e => literal(e))));
18654
18787
  }
18788
+ if (meta.isStandalone) {
18789
+ definitionMap.set('standalone', literal(true));
18790
+ }
18655
18791
  return definitionMap;
18656
18792
  }
18657
18793
  /**
@@ -18678,6 +18814,10 @@ function addFeatures(definitionMap, meta) {
18678
18814
  if (meta.lifecycle.usesOnChanges) {
18679
18815
  features.push(importExpr(Identifiers.NgOnChangesFeature));
18680
18816
  }
18817
+ // TODO: better way of differentiating component vs directive metadata.
18818
+ if (meta.hasOwnProperty('template') && meta.isStandalone) {
18819
+ features.push(importExpr(Identifiers.StandaloneFeature));
18820
+ }
18681
18821
  if (features.length) {
18682
18822
  definitionMap.set('features', literalArr(features));
18683
18823
  }
@@ -18741,17 +18881,8 @@ function compileComponentFromMetadata(meta, constantPool, bindingParser) {
18741
18881
  definitionMap.set('consts', constsExpr);
18742
18882
  }
18743
18883
  definitionMap.set('template', templateFunctionExpression);
18744
- // e.g. `directives: [MyDirective]`
18745
- if (meta.directives.length > 0) {
18746
- const directivesList = literalArr(meta.directives.map(dir => dir.type));
18747
- const directivesExpr = compileDeclarationList(directivesList, meta.declarationListEmitMode);
18748
- definitionMap.set('directives', directivesExpr);
18749
- }
18750
- // e.g. `pipes: [MyPipe]`
18751
- if (meta.pipes.size > 0) {
18752
- const pipesList = literalArr(Array.from(meta.pipes.values()));
18753
- const pipesExpr = compileDeclarationList(pipesList, meta.declarationListEmitMode);
18754
- definitionMap.set('pipes', pipesExpr);
18884
+ if (meta.declarations.length > 0) {
18885
+ definitionMap.set('dependencies', compileDeclarationList(literalArr(meta.declarations.map(decl => decl.type)), meta.declarationListEmitMode));
18755
18886
  }
18756
18887
  if (meta.encapsulation === null) {
18757
18888
  meta.encapsulation = ViewEncapsulation.Emulated;
@@ -18761,8 +18892,15 @@ function compileComponentFromMetadata(meta, constantPool, bindingParser) {
18761
18892
  const styleValues = meta.encapsulation == ViewEncapsulation.Emulated ?
18762
18893
  compileStyles(meta.styles, CONTENT_ATTR, HOST_ATTR) :
18763
18894
  meta.styles;
18764
- const strings = styleValues.map(str => constantPool.getConstLiteral(literal(str)));
18765
- definitionMap.set('styles', literalArr(strings));
18895
+ const styleNodes = styleValues.reduce((result, style) => {
18896
+ if (style.trim().length > 0) {
18897
+ result.push(constantPool.getConstLiteral(literal(style)));
18898
+ }
18899
+ return result;
18900
+ }, []);
18901
+ if (styleNodes.length > 0) {
18902
+ definitionMap.set('styles', literalArr(styleNodes));
18903
+ }
18766
18904
  }
18767
18905
  else if (meta.encapsulation === ViewEncapsulation.Emulated) {
18768
18906
  // If there is no style, don't generate css selectors on elements
@@ -18789,8 +18927,9 @@ function compileComponentFromMetadata(meta, constantPool, bindingParser) {
18789
18927
  * to be consumed by upstream compilations.
18790
18928
  */
18791
18929
  function createComponentType(meta) {
18792
- const typeParams = createDirectiveTypeParams(meta);
18930
+ const typeParams = createBaseDirectiveTypeParams(meta);
18793
18931
  typeParams.push(stringArrayAsType(meta.template.ngContentSelectors));
18932
+ typeParams.push(expressionType(literal(meta.isStandalone)));
18794
18933
  return expressionType(importExpr(Identifiers.ComponentDeclaration, typeParams));
18795
18934
  }
18796
18935
  /**
@@ -18799,13 +18938,13 @@ function createComponentType(meta) {
18799
18938
  */
18800
18939
  function compileDeclarationList(list, mode) {
18801
18940
  switch (mode) {
18802
- case 0 /* Direct */:
18941
+ case 0 /* DeclarationListEmitMode.Direct */:
18803
18942
  // directives: [MyDir],
18804
18943
  return list;
18805
- case 1 /* Closure */:
18944
+ case 1 /* DeclarationListEmitMode.Closure */:
18806
18945
  // directives: function () { return [MyDir]; }
18807
18946
  return fn([], [new ReturnStatement(list)]);
18808
- case 2 /* ClosureResolved */:
18947
+ case 2 /* DeclarationListEmitMode.ClosureResolved */:
18809
18948
  // directives: function () { return [MyDir].map(ng.resolveForwardRef); }
18810
18949
  const resolvedList = list.prop('map').callFn([importExpr(Identifiers.resolveForwardRef)]);
18811
18950
  return fn([], [new ReturnStatement(resolvedList)]);
@@ -18823,9 +18962,9 @@ function prepareQueryParams(query, constantPool) {
18823
18962
  * @param query
18824
18963
  */
18825
18964
  function toQueryFlags(query) {
18826
- return (query.descendants ? 1 /* descendants */ : 0 /* none */) |
18827
- (query.static ? 2 /* isStatic */ : 0 /* none */) |
18828
- (query.emitDistinctChangesOnly ? 4 /* emitDistinctChangesOnly */ : 0 /* none */);
18965
+ return (query.descendants ? 1 /* QueryFlags.descendants */ : 0 /* QueryFlags.none */) |
18966
+ (query.static ? 2 /* QueryFlags.isStatic */ : 0 /* QueryFlags.none */) |
18967
+ (query.emitDistinctChangesOnly ? 4 /* QueryFlags.emitDistinctChangesOnly */ : 0 /* QueryFlags.none */);
18829
18968
  }
18830
18969
  function convertAttributesToExpressions(attributes) {
18831
18970
  const values = [];
@@ -18859,8 +18998,8 @@ function createContentQueriesFunction(queries, constantPool, name) {
18859
18998
  new FnParam(RENDER_FLAGS, NUMBER_TYPE), new FnParam(CONTEXT_NAME, null),
18860
18999
  new FnParam('dirIndex', null)
18861
19000
  ], [
18862
- renderFlagCheckIfStmt(1 /* Create */, createStatements),
18863
- renderFlagCheckIfStmt(2 /* Update */, updateStatements)
19001
+ renderFlagCheckIfStmt(1 /* core.RenderFlags.Create */, createStatements),
19002
+ renderFlagCheckIfStmt(2 /* core.RenderFlags.Update */, updateStatements)
18864
19003
  ], INFERRED_TYPE, null, contentQueriesFnName);
18865
19004
  }
18866
19005
  function stringAsType(str) {
@@ -18881,7 +19020,7 @@ function stringArrayAsType(arr) {
18881
19020
  return arr.length > 0 ? expressionType(literalArr(arr.map(value => literal(value)))) :
18882
19021
  NONE_TYPE;
18883
19022
  }
18884
- function createDirectiveTypeParams(meta) {
19023
+ function createBaseDirectiveTypeParams(meta) {
18885
19024
  // On the type side, remove newlines from the selector as it will need to fit into a TypeScript
18886
19025
  // string literal, which must be on one line.
18887
19026
  const selectorForType = meta.selector !== null ? meta.selector.replace(/\n/g, '') : null;
@@ -18899,7 +19038,11 @@ function createDirectiveTypeParams(meta) {
18899
19038
  * to be consumed by upstream compilations.
18900
19039
  */
18901
19040
  function createDirectiveType(meta) {
18902
- const typeParams = createDirectiveTypeParams(meta);
19041
+ const typeParams = createBaseDirectiveTypeParams(meta);
19042
+ // Directives have no NgContentSelectors slot, but instead express a `never` type
19043
+ // so that future fields align.
19044
+ typeParams.push(NONE_TYPE);
19045
+ typeParams.push(expressionType(literal(meta.isStandalone)));
18903
19046
  return expressionType(importExpr(Identifiers.DirectiveDeclaration, typeParams));
18904
19047
  }
18905
19048
  // Define and update any view queries
@@ -18922,8 +19065,8 @@ function createViewQueriesFunction(viewQueries, constantPool, name) {
18922
19065
  });
18923
19066
  const viewQueryFnName = name ? `${name}_Query` : null;
18924
19067
  return fn([new FnParam(RENDER_FLAGS, NUMBER_TYPE), new FnParam(CONTEXT_NAME, null)], [
18925
- renderFlagCheckIfStmt(1 /* Create */, createStatements),
18926
- renderFlagCheckIfStmt(2 /* Update */, updateStatements)
19068
+ renderFlagCheckIfStmt(1 /* core.RenderFlags.Create */, createStatements),
19069
+ renderFlagCheckIfStmt(2 /* core.RenderFlags.Update */, updateStatements)
18927
19070
  ], INFERRED_TYPE, null, viewQueryFnName);
18928
19071
  }
18929
19072
  // Return a host binding function or null if one is not necessary.
@@ -19063,10 +19206,10 @@ function createHostBindingsFunction(hostBindingsMetadata, typeSourceSpan, bindin
19063
19206
  const hostBindingsFnName = name ? `${name}_HostBindings` : null;
19064
19207
  const statements = [];
19065
19208
  if (createInstructions.length > 0) {
19066
- statements.push(renderFlagCheckIfStmt(1 /* Create */, getInstructionStatements(createInstructions)));
19209
+ statements.push(renderFlagCheckIfStmt(1 /* core.RenderFlags.Create */, getInstructionStatements(createInstructions)));
19067
19210
  }
19068
19211
  if (updateInstructions.length > 0) {
19069
- statements.push(renderFlagCheckIfStmt(2 /* Update */, updateVariables.concat(getInstructionStatements(updateInstructions))));
19212
+ statements.push(renderFlagCheckIfStmt(2 /* core.RenderFlags.Update */, updateVariables.concat(getInstructionStatements(updateInstructions))));
19070
19213
  }
19071
19214
  return fn([new FnParam(RENDER_FLAGS, NUMBER_TYPE), new FnParam(CONTEXT_NAME, null)], statements, INFERRED_TYPE, null, hostBindingsFnName);
19072
19215
  }
@@ -19107,12 +19250,12 @@ function createHostListeners(eventBindings, name) {
19107
19250
  const instructions = [];
19108
19251
  for (const binding of eventBindings) {
19109
19252
  let bindingName = binding.name && sanitizeIdentifier(binding.name);
19110
- const bindingFnName = binding.type === 1 /* Animation */ ?
19253
+ const bindingFnName = binding.type === 1 /* ParsedEventType.Animation */ ?
19111
19254
  prepareSyntheticListenerFunctionName(bindingName, binding.targetOrPhase) :
19112
19255
  bindingName;
19113
19256
  const handlerName = name && bindingName ? `${name}_${bindingFnName}_HostBindingHandler` : null;
19114
19257
  const params = prepareEventListenerParameters(BoundEvent.fromParsedEvent(binding), handlerName);
19115
- if (binding.type == 1 /* Animation */) {
19258
+ if (binding.type == 1 /* ParsedEventType.Animation */) {
19116
19259
  syntheticListenerParams.push(params);
19117
19260
  }
19118
19261
  else {
@@ -19161,7 +19304,7 @@ function parseHostBindings(host) {
19161
19304
  }
19162
19305
  }
19163
19306
  }
19164
- else if (matches[1 /* Binding */] != null) {
19307
+ else if (matches[1 /* HostBindingGroup.Binding */] != null) {
19165
19308
  if (typeof value !== 'string') {
19166
19309
  // TODO(alxhub): make this a diagnostic.
19167
19310
  throw new Error(`Property binding must be string`);
@@ -19169,14 +19312,14 @@ function parseHostBindings(host) {
19169
19312
  // synthetic properties (the ones that have a `@` as a prefix)
19170
19313
  // are still treated the same as regular properties. Therefore
19171
19314
  // there is no point in storing them in a separate map.
19172
- properties[matches[1 /* Binding */]] = value;
19315
+ properties[matches[1 /* HostBindingGroup.Binding */]] = value;
19173
19316
  }
19174
- else if (matches[2 /* Event */] != null) {
19317
+ else if (matches[2 /* HostBindingGroup.Event */] != null) {
19175
19318
  if (typeof value !== 'string') {
19176
19319
  // TODO(alxhub): make this a diagnostic.
19177
19320
  throw new Error(`Event binding must be string`);
19178
19321
  }
19179
- listeners[matches[2 /* Event */]] = value;
19322
+ listeners[matches[2 /* HostBindingGroup.Event */]] = value;
19180
19323
  }
19181
19324
  }
19182
19325
  return { attributes, listeners, properties, specialAttributes };
@@ -19262,10 +19405,10 @@ class CompilerFacadeImpl {
19262
19405
  internalType: new WrappedNodeExpr(facade.type),
19263
19406
  typeArgumentCount: facade.typeArgumentCount,
19264
19407
  providedIn: computeProvidedIn(facade.providedIn),
19265
- useClass: convertToProviderExpression(facade, USE_CLASS),
19266
- useFactory: wrapExpression(facade, USE_FACTORY),
19267
- useValue: convertToProviderExpression(facade, USE_VALUE),
19268
- useExisting: convertToProviderExpression(facade, USE_EXISTING),
19408
+ useClass: convertToProviderExpression(facade, 'useClass'),
19409
+ useFactory: wrapExpression(facade, 'useFactory'),
19410
+ useValue: convertToProviderExpression(facade, 'useValue'),
19411
+ useExisting: convertToProviderExpression(facade, 'useExisting'),
19269
19412
  deps: (_a = facade.deps) === null || _a === void 0 ? void 0 : _a.map(convertR3DependencyMetadata),
19270
19413
  },
19271
19414
  /* resolveForwardRefs */ true);
@@ -19279,10 +19422,10 @@ class CompilerFacadeImpl {
19279
19422
  internalType: new WrappedNodeExpr(facade.type),
19280
19423
  typeArgumentCount: 0,
19281
19424
  providedIn: computeProvidedIn(facade.providedIn),
19282
- useClass: convertToProviderExpression(facade, USE_CLASS),
19283
- useFactory: wrapExpression(facade, USE_FACTORY),
19284
- useValue: convertToProviderExpression(facade, USE_VALUE),
19285
- useExisting: convertToProviderExpression(facade, USE_EXISTING),
19425
+ useClass: convertToProviderExpression(facade, 'useClass'),
19426
+ useFactory: wrapExpression(facade, 'useFactory'),
19427
+ useValue: convertToProviderExpression(facade, 'useValue'),
19428
+ useExisting: convertToProviderExpression(facade, 'useExisting'),
19286
19429
  deps: (_a = facade.deps) === null || _a === void 0 ? void 0 : _a.map(convertR3DeclareDependencyMetadata),
19287
19430
  },
19288
19431
  /* resolveForwardRefs */ true);
@@ -19313,7 +19456,7 @@ class CompilerFacadeImpl {
19313
19456
  declarations: facade.declarations.map(wrapReference),
19314
19457
  imports: facade.imports.map(wrapReference),
19315
19458
  exports: facade.exports.map(wrapReference),
19316
- emitInline: true,
19459
+ selectorScopeMode: R3SelectorScopeMode.Inline,
19317
19460
  containsForwardDecls: false,
19318
19461
  schemas: facade.schemas ? facade.schemas.map(wrapReference) : null,
19319
19462
  id: facade.id ? new WrappedNodeExpr(facade.id) : null,
@@ -19344,7 +19487,7 @@ class CompilerFacadeImpl {
19344
19487
  // Parse the template and check for errors.
19345
19488
  const { template, interpolation } = parseJitTemplate(facade.template, facade.name, sourceMapUrl, facade.preserveWhitespaces, facade.interpolation);
19346
19489
  // Compile the component metadata, including template, into an expression.
19347
- const meta = Object.assign(Object.assign(Object.assign({}, facade), convertDirectiveFacadeToMetadata(facade)), { selector: facade.selector || this.elementSchemaRegistry.getDefaultComponentElementName(), template, declarationListEmitMode: 0 /* Direct */, styles: [...facade.styles, ...template.styles], encapsulation: facade.encapsulation, interpolation, changeDetection: facade.changeDetection, animations: facade.animations != null ? new WrappedNodeExpr(facade.animations) : null, viewProviders: facade.viewProviders != null ? new WrappedNodeExpr(facade.viewProviders) :
19490
+ const meta = Object.assign(Object.assign(Object.assign({}, facade), convertDirectiveFacadeToMetadata(facade)), { selector: facade.selector || this.elementSchemaRegistry.getDefaultComponentElementName(), template, declarations: facade.declarations.map(convertDeclarationFacadeToMetadata), declarationListEmitMode: 0 /* DeclarationListEmitMode.Direct */, styles: [...facade.styles, ...template.styles], encapsulation: facade.encapsulation, interpolation, changeDetection: facade.changeDetection, animations: facade.animations != null ? new WrappedNodeExpr(facade.animations) : null, viewProviders: facade.viewProviders != null ? new WrappedNodeExpr(facade.viewProviders) :
19348
19491
  null, relativeContextFilePath: '', i18nUseExternalIds: true });
19349
19492
  const jitExpressionSourceMap = `ng:///${facade.name}.js`;
19350
19493
  return this.compileComponentFromMeta(angularCoreEnv, jitExpressionSourceMap, meta);
@@ -19407,10 +19550,6 @@ class CompilerFacadeImpl {
19407
19550
  return res['$def'];
19408
19551
  }
19409
19552
  }
19410
- const USE_CLASS = Object.keys({ useClass: null })[0];
19411
- const USE_FACTORY = Object.keys({ useFactory: null })[0];
19412
- const USE_VALUE = Object.keys({ useValue: null })[0];
19413
- const USE_EXISTING = Object.keys({ useExisting: null })[0];
19414
19553
  function convertToR3QueryMetadata(facade) {
19415
19554
  return Object.assign(Object.assign({}, facade), { predicate: convertQueryPredicate(facade.predicate), read: facade.read ? new WrappedNodeExpr(facade.read) : null, static: facade.static, emitDistinctChangesOnly: facade.emitDistinctChangesOnly });
19416
19555
  }
@@ -19431,7 +19570,7 @@ function convertQueryPredicate(predicate) {
19431
19570
  // The predicate is an array of strings so pass it through.
19432
19571
  predicate :
19433
19572
  // The predicate is a type - assume that we will need to unwrap any `forwardRef()` calls.
19434
- createMayBeForwardRefExpression(new WrappedNodeExpr(predicate), 1 /* Wrapped */);
19573
+ createMayBeForwardRefExpression(new WrappedNodeExpr(predicate), 1 /* ForwardRefHandling.Wrapped */);
19435
19574
  }
19436
19575
  function convertDirectiveFacadeToMetadata(facade) {
19437
19576
  const inputsFromMetadata = parseInputOutputs(facade.inputs || []);
@@ -19497,19 +19636,43 @@ function convertOpaqueValuesToExpressions(obj) {
19497
19636
  }
19498
19637
  return result;
19499
19638
  }
19500
- function convertDeclareComponentFacadeToMetadata(declaration, typeSourceSpan, sourceMapUrl) {
19501
- var _a, _b, _c, _d, _e, _f;
19502
- const { template, interpolation } = parseJitTemplate(declaration.template, declaration.type.name, sourceMapUrl, (_a = declaration.preserveWhitespaces) !== null && _a !== void 0 ? _a : false, declaration.interpolation);
19503
- return Object.assign(Object.assign({}, convertDeclareDirectiveFacadeToMetadata(declaration, typeSourceSpan)), { template, styles: (_b = declaration.styles) !== null && _b !== void 0 ? _b : [], directives: ((_c = declaration.components) !== null && _c !== void 0 ? _c : [])
19504
- .concat((_d = declaration.directives) !== null && _d !== void 0 ? _d : [])
19505
- .map(convertUsedDirectiveDeclarationToMetadata), pipes: convertUsedPipesToMetadata(declaration.pipes), viewProviders: declaration.viewProviders !== undefined ?
19506
- new WrappedNodeExpr(declaration.viewProviders) :
19507
- null, animations: declaration.animations !== undefined ? new WrappedNodeExpr(declaration.animations) :
19508
- null, changeDetection: (_e = declaration.changeDetection) !== null && _e !== void 0 ? _e : ChangeDetectionStrategy.Default, encapsulation: (_f = declaration.encapsulation) !== null && _f !== void 0 ? _f : ViewEncapsulation.Emulated, interpolation, declarationListEmitMode: 2 /* ClosureResolved */, relativeContextFilePath: '', i18nUseExternalIds: true });
19509
- }
19510
- function convertUsedDirectiveDeclarationToMetadata(declaration) {
19639
+ function convertDeclareComponentFacadeToMetadata(decl, typeSourceSpan, sourceMapUrl) {
19640
+ var _a, _b, _c, _d;
19641
+ const { template, interpolation } = parseJitTemplate(decl.template, decl.type.name, sourceMapUrl, (_a = decl.preserveWhitespaces) !== null && _a !== void 0 ? _a : false, decl.interpolation);
19642
+ const declarations = [];
19643
+ if (decl.dependencies) {
19644
+ for (const innerDep of decl.dependencies) {
19645
+ switch (innerDep.kind) {
19646
+ case 'directive':
19647
+ case 'component':
19648
+ declarations.push(convertDirectiveDeclarationToMetadata(innerDep));
19649
+ break;
19650
+ case 'pipe':
19651
+ declarations.push(convertPipeDeclarationToMetadata(innerDep));
19652
+ break;
19653
+ }
19654
+ }
19655
+ }
19656
+ else if (decl.components || decl.directives || decl.pipes) {
19657
+ // Existing declarations on NPM may not be using the new `dependencies` merged field, and may
19658
+ // have separate fields for dependencies instead. Unify them for JIT compilation.
19659
+ decl.components &&
19660
+ declarations.push(...decl.components.map(dir => convertDirectiveDeclarationToMetadata(dir, /* isComponent */ true)));
19661
+ decl.directives &&
19662
+ declarations.push(...decl.directives.map(dir => convertDirectiveDeclarationToMetadata(dir)));
19663
+ decl.pipes && declarations.push(...convertPipeMapToMetadata(decl.pipes));
19664
+ }
19665
+ return Object.assign(Object.assign({}, convertDeclareDirectiveFacadeToMetadata(decl, typeSourceSpan)), { template, styles: (_b = decl.styles) !== null && _b !== void 0 ? _b : [], declarations, viewProviders: decl.viewProviders !== undefined ? new WrappedNodeExpr(decl.viewProviders) :
19666
+ null, animations: decl.animations !== undefined ? new WrappedNodeExpr(decl.animations) : null, changeDetection: (_c = decl.changeDetection) !== null && _c !== void 0 ? _c : ChangeDetectionStrategy.Default, encapsulation: (_d = decl.encapsulation) !== null && _d !== void 0 ? _d : ViewEncapsulation.Emulated, interpolation, declarationListEmitMode: 2 /* DeclarationListEmitMode.ClosureResolved */, relativeContextFilePath: '', i18nUseExternalIds: true });
19667
+ }
19668
+ function convertDeclarationFacadeToMetadata(declaration) {
19669
+ return Object.assign(Object.assign({}, declaration), { type: new WrappedNodeExpr(declaration.type) });
19670
+ }
19671
+ function convertDirectiveDeclarationToMetadata(declaration, isComponent = null) {
19511
19672
  var _a, _b, _c;
19512
19673
  return {
19674
+ kind: R3TemplateDependencyKind.Directive,
19675
+ isComponent: isComponent || declaration.kind === 'component',
19513
19676
  selector: declaration.selector,
19514
19677
  type: new WrappedNodeExpr(declaration.type),
19515
19678
  inputs: (_a = declaration.inputs) !== null && _a !== void 0 ? _a : [],
@@ -19517,16 +19680,24 @@ function convertUsedDirectiveDeclarationToMetadata(declaration) {
19517
19680
  exportAs: (_c = declaration.exportAs) !== null && _c !== void 0 ? _c : null,
19518
19681
  };
19519
19682
  }
19520
- function convertUsedPipesToMetadata(declaredPipes) {
19521
- const pipes = new Map();
19522
- if (declaredPipes === undefined) {
19523
- return pipes;
19524
- }
19525
- for (const pipeName of Object.keys(declaredPipes)) {
19526
- const pipeType = declaredPipes[pipeName];
19527
- pipes.set(pipeName, new WrappedNodeExpr(pipeType));
19683
+ function convertPipeMapToMetadata(pipes) {
19684
+ if (!pipes) {
19685
+ return [];
19528
19686
  }
19529
- return pipes;
19687
+ return Object.keys(pipes).map(name => {
19688
+ return {
19689
+ kind: R3TemplateDependencyKind.Pipe,
19690
+ name,
19691
+ type: new WrappedNodeExpr(pipes[name]),
19692
+ };
19693
+ });
19694
+ }
19695
+ function convertPipeDeclarationToMetadata(pipe) {
19696
+ return {
19697
+ kind: R3TemplateDependencyKind.Pipe,
19698
+ name: pipe.name,
19699
+ type: new WrappedNodeExpr(pipe.type),
19700
+ };
19530
19701
  }
19531
19702
  function parseJitTemplate(template, typeName, sourceMapUrl, preserveWhitespaces, interpolation) {
19532
19703
  const interpolationConfig = interpolation ? InterpolationConfig.fromArray(interpolation) : DEFAULT_INTERPOLATION_CONFIG;
@@ -19548,7 +19719,7 @@ function parseJitTemplate(template, typeName, sourceMapUrl, preserveWhitespaces,
19548
19719
  */
19549
19720
  function convertToProviderExpression(obj, property) {
19550
19721
  if (obj.hasOwnProperty(property)) {
19551
- return createMayBeForwardRefExpression(new WrappedNodeExpr(obj[property]), 0 /* None */);
19722
+ return createMayBeForwardRefExpression(new WrappedNodeExpr(obj[property]), 0 /* ForwardRefHandling.None */);
19552
19723
  }
19553
19724
  else {
19554
19725
  return undefined;
@@ -19566,7 +19737,7 @@ function computeProvidedIn(providedIn) {
19566
19737
  const expression = typeof providedIn === 'function' ? new WrappedNodeExpr(providedIn) :
19567
19738
  new LiteralExpr(providedIn !== null && providedIn !== void 0 ? providedIn : null);
19568
19739
  // See `convertToProviderExpression()` for why this uses `ForwardRefHandling.None`.
19569
- return createMayBeForwardRefExpression(expression, 0 /* None */);
19740
+ return createMayBeForwardRefExpression(expression, 0 /* ForwardRefHandling.None */);
19570
19741
  }
19571
19742
  function convertR3DependencyMetadataArray(facades) {
19572
19743
  return facades == null ? null : facades.map(convertR3DependencyMetadata);
@@ -19675,7 +19846,7 @@ function publishFacade(global) {
19675
19846
  * Use of this source code is governed by an MIT-style license that can be
19676
19847
  * found in the LICENSE file at https://angular.io/license
19677
19848
  */
19678
- const VERSION = new Version('14.0.0-next.7');
19849
+ const VERSION = new Version('14.0.0-rc.0');
19679
19850
 
19680
19851
  /**
19681
19852
  * @license
@@ -21702,7 +21873,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$6 = '12.0.0';
21702
21873
  function compileDeclareClassMetadata(metadata) {
21703
21874
  const definitionMap = new DefinitionMap();
21704
21875
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$6));
21705
- definitionMap.set('version', literal('14.0.0-next.7'));
21876
+ definitionMap.set('version', literal('14.0.0-rc.0'));
21706
21877
  definitionMap.set('ngImport', importExpr(Identifiers.core));
21707
21878
  definitionMap.set('type', metadata.type);
21708
21879
  definitionMap.set('decorators', metadata.decorators);
@@ -21802,7 +21973,7 @@ function compileDependency(dep) {
21802
21973
  *
21803
21974
  * Do not include any prerelease in these versions as they are ignored.
21804
21975
  */
21805
- const MINIMUM_PARTIAL_LINKER_VERSION$5 = '12.0.0';
21976
+ const MINIMUM_PARTIAL_LINKER_VERSION$5 = '14.0.0';
21806
21977
  /**
21807
21978
  * Compile a directive declaration defined by the `R3DirectiveMetadata`.
21808
21979
  */
@@ -21819,9 +21990,12 @@ function compileDeclareDirectiveFromMetadata(meta) {
21819
21990
  function createDirectiveDefinitionMap(meta) {
21820
21991
  const definitionMap = new DefinitionMap();
21821
21992
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
21822
- definitionMap.set('version', literal('14.0.0-next.7'));
21993
+ definitionMap.set('version', literal('14.0.0-rc.0'));
21823
21994
  // e.g. `type: MyDirective`
21824
21995
  definitionMap.set('type', meta.internalType);
21996
+ if (meta.isStandalone) {
21997
+ definitionMap.set('isStandalone', literal(meta.isStandalone));
21998
+ }
21825
21999
  // e.g. `selector: 'some-dir'`
21826
22000
  if (meta.selector !== null) {
21827
22001
  definitionMap.set('selector', literal(meta.selector));
@@ -21926,9 +22100,7 @@ function createComponentDefinitionMap(meta, template, templateInfo) {
21926
22100
  definitionMap.set('isInline', literal(true));
21927
22101
  }
21928
22102
  definitionMap.set('styles', toOptionalLiteralArray(meta.styles, literal));
21929
- definitionMap.set('components', compileUsedDirectiveMetadata(meta, directive => directive.isComponent === true));
21930
- definitionMap.set('directives', compileUsedDirectiveMetadata(meta, directive => directive.isComponent !== true));
21931
- definitionMap.set('pipes', compileUsedPipeMetadata(meta));
22103
+ definitionMap.set('dependencies', compileUsedDependenciesMetadata(meta));
21932
22104
  definitionMap.set('viewProviders', meta.viewProviders);
21933
22105
  definitionMap.set('animations', meta.animations);
21934
22106
  if (meta.changeDetection !== undefined) {
@@ -21984,43 +22156,35 @@ function computeEndLocation(file, contents) {
21984
22156
  } while (lineStart !== -1);
21985
22157
  return new ParseLocation(file, length, line, length - lastLineStart);
21986
22158
  }
21987
- /**
21988
- * Compiles the directives as registered in the component metadata into an array literal of the
21989
- * individual directives. If the component does not use any directives, then null is returned.
21990
- */
21991
- function compileUsedDirectiveMetadata(meta, predicate) {
21992
- const wrapType = meta.declarationListEmitMode !== 0 /* Direct */ ?
22159
+ function compileUsedDependenciesMetadata(meta) {
22160
+ const wrapType = meta.declarationListEmitMode !== 0 /* DeclarationListEmitMode.Direct */ ?
21993
22161
  generateForwardRef :
21994
22162
  (expr) => expr;
21995
- const directives = meta.directives.filter(predicate);
21996
- return toOptionalLiteralArray(directives, directive => {
21997
- const dirMeta = new DefinitionMap();
21998
- dirMeta.set('type', wrapType(directive.type));
21999
- dirMeta.set('selector', literal(directive.selector));
22000
- dirMeta.set('inputs', toOptionalLiteralArray(directive.inputs, literal));
22001
- dirMeta.set('outputs', toOptionalLiteralArray(directive.outputs, literal));
22002
- dirMeta.set('exportAs', toOptionalLiteralArray(directive.exportAs, literal));
22003
- return dirMeta.toLiteralMap();
22163
+ return toOptionalLiteralArray(meta.declarations, decl => {
22164
+ switch (decl.kind) {
22165
+ case R3TemplateDependencyKind.Directive:
22166
+ const dirMeta = new DefinitionMap();
22167
+ dirMeta.set('kind', literal(decl.isComponent ? 'component' : 'directive'));
22168
+ dirMeta.set('type', wrapType(decl.type));
22169
+ dirMeta.set('selector', literal(decl.selector));
22170
+ dirMeta.set('inputs', toOptionalLiteralArray(decl.inputs, literal));
22171
+ dirMeta.set('outputs', toOptionalLiteralArray(decl.outputs, literal));
22172
+ dirMeta.set('exportAs', toOptionalLiteralArray(decl.exportAs, literal));
22173
+ return dirMeta.toLiteralMap();
22174
+ case R3TemplateDependencyKind.Pipe:
22175
+ const pipeMeta = new DefinitionMap();
22176
+ pipeMeta.set('kind', literal('pipe'));
22177
+ pipeMeta.set('type', wrapType(decl.type));
22178
+ pipeMeta.set('name', literal(decl.name));
22179
+ return pipeMeta.toLiteralMap();
22180
+ case R3TemplateDependencyKind.NgModule:
22181
+ const ngModuleMeta = new DefinitionMap();
22182
+ ngModuleMeta.set('kind', literal('ngmodule'));
22183
+ ngModuleMeta.set('type', wrapType(decl.type));
22184
+ return ngModuleMeta.toLiteralMap();
22185
+ }
22004
22186
  });
22005
22187
  }
22006
- /**
22007
- * Compiles the pipes as registered in the component metadata into an object literal, where the
22008
- * pipe's name is used as key and a reference to its type as value. If the component does not use
22009
- * any pipes, then null is returned.
22010
- */
22011
- function compileUsedPipeMetadata(meta) {
22012
- if (meta.pipes.size === 0) {
22013
- return null;
22014
- }
22015
- const wrapType = meta.declarationListEmitMode !== 0 /* Direct */ ?
22016
- generateForwardRef :
22017
- (expr) => expr;
22018
- const entries = [];
22019
- for (const [name, pipe] of meta.pipes) {
22020
- entries.push({ key: name, value: wrapType(pipe), quoted: true });
22021
- }
22022
- return literalMap(entries);
22023
- }
22024
22188
 
22025
22189
  /**
22026
22190
  * @license
@@ -22040,7 +22204,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
22040
22204
  function compileDeclareFactoryFunction(meta) {
22041
22205
  const definitionMap = new DefinitionMap();
22042
22206
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
22043
- definitionMap.set('version', literal('14.0.0-next.7'));
22207
+ definitionMap.set('version', literal('14.0.0-rc.0'));
22044
22208
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22045
22209
  definitionMap.set('type', meta.internalType);
22046
22210
  definitionMap.set('deps', compileDependencies(meta.deps));
@@ -22082,7 +22246,7 @@ function compileDeclareInjectableFromMetadata(meta) {
22082
22246
  function createInjectableDefinitionMap(meta) {
22083
22247
  const definitionMap = new DefinitionMap();
22084
22248
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
22085
- definitionMap.set('version', literal('14.0.0-next.7'));
22249
+ definitionMap.set('version', literal('14.0.0-rc.0'));
22086
22250
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22087
22251
  definitionMap.set('type', meta.internalType);
22088
22252
  // Only generate providedIn property if it has a non-null value
@@ -22140,7 +22304,7 @@ function compileDeclareInjectorFromMetadata(meta) {
22140
22304
  function createInjectorDefinitionMap(meta) {
22141
22305
  const definitionMap = new DefinitionMap();
22142
22306
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
22143
- definitionMap.set('version', literal('14.0.0-next.7'));
22307
+ definitionMap.set('version', literal('14.0.0-rc.0'));
22144
22308
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22145
22309
  definitionMap.set('type', meta.internalType);
22146
22310
  definitionMap.set('providers', meta.providers);
@@ -22164,7 +22328,7 @@ function createInjectorDefinitionMap(meta) {
22164
22328
  *
22165
22329
  * Do not include any prerelease in these versions as they are ignored.
22166
22330
  */
22167
- const MINIMUM_PARTIAL_LINKER_VERSION$1 = '12.0.0';
22331
+ const MINIMUM_PARTIAL_LINKER_VERSION$1 = '14.0.0';
22168
22332
  function compileDeclareNgModuleFromMetadata(meta) {
22169
22333
  const definitionMap = createNgModuleDefinitionMap(meta);
22170
22334
  const expression = importExpr(Identifiers.declareNgModule).callFn([definitionMap.toLiteralMap()]);
@@ -22177,7 +22341,7 @@ function compileDeclareNgModuleFromMetadata(meta) {
22177
22341
  function createNgModuleDefinitionMap(meta) {
22178
22342
  const definitionMap = new DefinitionMap();
22179
22343
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
22180
- definitionMap.set('version', literal('14.0.0-next.7'));
22344
+ definitionMap.set('version', literal('14.0.0-rc.0'));
22181
22345
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22182
22346
  definitionMap.set('type', meta.internalType);
22183
22347
  // We only generate the keys in the metadata if the arrays contain values.
@@ -22219,7 +22383,7 @@ function createNgModuleDefinitionMap(meta) {
22219
22383
  *
22220
22384
  * Do not include any prerelease in these versions as they are ignored.
22221
22385
  */
22222
- const MINIMUM_PARTIAL_LINKER_VERSION = '12.0.0';
22386
+ const MINIMUM_PARTIAL_LINKER_VERSION = '14.0.0';
22223
22387
  /**
22224
22388
  * Compile a Pipe declaration defined by the `R3PipeMetadata`.
22225
22389
  */
@@ -22235,10 +22399,13 @@ function compileDeclarePipeFromMetadata(meta) {
22235
22399
  function createPipeDefinitionMap(meta) {
22236
22400
  const definitionMap = new DefinitionMap();
22237
22401
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
22238
- definitionMap.set('version', literal('14.0.0-next.7'));
22402
+ definitionMap.set('version', literal('14.0.0-rc.0'));
22239
22403
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22240
22404
  // e.g. `type: MyPipe`
22241
22405
  definitionMap.set('type', meta.internalType);
22406
+ if (meta.isStandalone) {
22407
+ definitionMap.set('isStandalone', literal(meta.isStandalone));
22408
+ }
22242
22409
  // e.g. `name: "myPipe"`
22243
22410
  definitionMap.set('name', literal(meta.pipeName));
22244
22411
  if (meta.pure === false) {
@@ -22285,5 +22452,5 @@ publishFacade(_global);
22285
22452
  * found in the LICENSE file at https://angular.io/license
22286
22453
  */
22287
22454
 
22288
- export { AST, ASTWithName, ASTWithSource, AbsoluteSourceSpan, ArrayType, AstMemoryEfficientTransformer, AstTransformer, Attribute, Binary, BinaryOperator, BinaryOperatorExpr, BindingPipe, BoundElementProperty, BuiltinType, BuiltinTypeName, CUSTOM_ELEMENTS_SCHEMA, Call, Chain, ChangeDetectionStrategy, CommaExpr, Comment, CompilerConfig, Conditional, ConditionalExpr, ConstantPool, CssSelector, DEFAULT_INTERPOLATION_CONFIG, DYNAMIC_TYPE, DeclareFunctionStmt, DeclareVarStmt, DomElementSchemaRegistry, EOF, Element, ElementSchemaRegistry, EmitterVisitorContext, EmptyExpr, Expansion, ExpansionCase, Expression, ExpressionBinding, ExpressionStatement, ExpressionType, ExternalExpr, ExternalReference, FactoryTarget$1 as FactoryTarget, FunctionExpr, HtmlParser, HtmlTagDefinition, I18NHtmlParser, IfStmt, ImplicitReceiver, InstantiateExpr, Interpolation, InterpolationConfig, InvokeFunctionExpr, JSDocComment, JitEvaluator, KeyedRead, KeyedWrite, LeadingComment, Lexer, LiteralArray, LiteralArrayExpr, LiteralExpr, LiteralMap, LiteralMapExpr, LiteralPrimitive, LocalizedString, MapType, MessageBundle, NONE_TYPE, NO_ERRORS_SCHEMA, NodeWithI18n, NonNullAssert, NotExpr, ParseError, ParseErrorLevel, ParseLocation, ParseSourceFile, ParseSourceSpan, ParseSpan, ParseTreeResult, ParsedEvent, ParsedProperty, ParsedPropertyType, ParsedVariable, Parser$1 as Parser, ParserError, PrefixNot, PropertyRead, PropertyWrite, R3BoundTarget, Identifiers as R3Identifiers, R3TargetBinder, ReadKeyExpr, ReadPropExpr, ReadVarExpr, RecursiveAstVisitor, RecursiveVisitor, ResourceLoader, ReturnStatement, STRING_TYPE, SafeCall, SafeKeyedRead, SafePropertyRead, SelectorContext, SelectorListContext, SelectorMatcher, Serializer, SplitInterpolation, Statement, StmtModifier, TagContentType, TaggedTemplateExpr, TemplateBindingParseResult, TemplateLiteral, TemplateLiteralElement, Text, ThisReceiver, BoundAttribute as TmplAstBoundAttribute, BoundEvent as TmplAstBoundEvent, BoundText as TmplAstBoundText, Content as TmplAstContent, Element$1 as TmplAstElement, Icu$1 as TmplAstIcu, RecursiveVisitor$1 as TmplAstRecursiveVisitor, Reference as TmplAstReference, Template as TmplAstTemplate, Text$3 as TmplAstText, TextAttribute as TmplAstTextAttribute, Variable as TmplAstVariable, Token, TokenType, TreeError, Type, TypeModifier, TypeofExpr, Unary, UnaryOperator, UnaryOperatorExpr, VERSION, VariableBinding, Version, ViewEncapsulation, WrappedNodeExpr, WriteKeyExpr, WritePropExpr, WriteVarExpr, Xliff, Xliff2, Xmb, XmlParser, Xtb, _ParseAST, compileClassMetadata, compileComponentFromMetadata, compileDeclareClassMetadata, compileDeclareComponentFromMetadata, compileDeclareDirectiveFromMetadata, compileDeclareFactoryFunction, compileDeclareInjectableFromMetadata, compileDeclareInjectorFromMetadata, compileDeclareNgModuleFromMetadata, compileDeclarePipeFromMetadata, compileDirectiveFromMetadata, compileFactoryFunction, compileInjectable, compileInjector, compileNgModule, compilePipeFromMetadata, computeMsgId, core, createInjectableType, createMayBeForwardRefExpression, devOnlyGuardedExpression, emitDistinctChangesOnlyDefaultValue, getHtmlTagDefinition, getNsPrefix, getSafePropertyAccessString, identifierName, isIdentifier, isNgContainer, isNgContent, isNgTemplate, jsDocComment, leadingComment, literalMap, makeBindingParser, mergeNsAndName, output_ast as outputAst, parseHostBindings, parseTemplate, preserveWhitespacesDefault, publishFacade, r3JitTypeSourceSpan, sanitizeIdentifier, splitNsName, verifyHostBindings, visitAll };
22455
+ export { AST, ASTWithName, ASTWithSource, AbsoluteSourceSpan, ArrayType, AstMemoryEfficientTransformer, AstTransformer, Attribute, Binary, BinaryOperator, BinaryOperatorExpr, BindingPipe, BoundElementProperty, BuiltinType, BuiltinTypeName, CUSTOM_ELEMENTS_SCHEMA, Call, Chain, ChangeDetectionStrategy, CommaExpr, Comment, CompilerConfig, Conditional, ConditionalExpr, ConstantPool, CssSelector, DEFAULT_INTERPOLATION_CONFIG, DYNAMIC_TYPE, DeclareFunctionStmt, DeclareVarStmt, DomElementSchemaRegistry, EOF, Element, ElementSchemaRegistry, EmitterVisitorContext, EmptyExpr, Expansion, ExpansionCase, Expression, ExpressionBinding, ExpressionStatement, ExpressionType, ExternalExpr, ExternalReference, FactoryTarget$1 as FactoryTarget, FunctionExpr, HtmlParser, HtmlTagDefinition, I18NHtmlParser, IfStmt, ImplicitReceiver, InstantiateExpr, Interpolation, InterpolationConfig, InvokeFunctionExpr, JSDocComment, JitEvaluator, KeyedRead, KeyedWrite, LeadingComment, Lexer, LiteralArray, LiteralArrayExpr, LiteralExpr, LiteralMap, LiteralMapExpr, LiteralPrimitive, LocalizedString, MapType, MessageBundle, NONE_TYPE, NO_ERRORS_SCHEMA, NodeWithI18n, NonNullAssert, NotExpr, ParseError, ParseErrorLevel, ParseLocation, ParseSourceFile, ParseSourceSpan, ParseSpan, ParseTreeResult, ParsedEvent, ParsedProperty, ParsedPropertyType, ParsedVariable, Parser$1 as Parser, ParserError, PrefixNot, PropertyRead, PropertyWrite, R3BoundTarget, Identifiers as R3Identifiers, R3SelectorScopeMode, R3TargetBinder, R3TemplateDependencyKind, ReadKeyExpr, ReadPropExpr, ReadVarExpr, RecursiveAstVisitor, RecursiveVisitor, ResourceLoader, ReturnStatement, STRING_TYPE, SafeCall, SafeKeyedRead, SafePropertyRead, SelectorContext, SelectorListContext, SelectorMatcher, Serializer, SplitInterpolation, Statement, StmtModifier, TagContentType, TaggedTemplateExpr, TemplateBindingParseResult, TemplateLiteral, TemplateLiteralElement, Text, ThisReceiver, BoundAttribute as TmplAstBoundAttribute, BoundEvent as TmplAstBoundEvent, BoundText as TmplAstBoundText, Content as TmplAstContent, Element$1 as TmplAstElement, Icu$1 as TmplAstIcu, RecursiveVisitor$1 as TmplAstRecursiveVisitor, Reference as TmplAstReference, Template as TmplAstTemplate, Text$3 as TmplAstText, TextAttribute as TmplAstTextAttribute, Variable as TmplAstVariable, Token, TokenType, TreeError, Type, TypeModifier, TypeofExpr, Unary, UnaryOperator, UnaryOperatorExpr, VERSION, VariableBinding, Version, ViewEncapsulation, WrappedNodeExpr, WriteKeyExpr, WritePropExpr, WriteVarExpr, Xliff, Xliff2, Xmb, XmlParser, Xtb, _ParseAST, compileClassMetadata, compileComponentFromMetadata, compileDeclareClassMetadata, compileDeclareComponentFromMetadata, compileDeclareDirectiveFromMetadata, compileDeclareFactoryFunction, compileDeclareInjectableFromMetadata, compileDeclareInjectorFromMetadata, compileDeclareNgModuleFromMetadata, compileDeclarePipeFromMetadata, compileDirectiveFromMetadata, compileFactoryFunction, compileInjectable, compileInjector, compileNgModule, compilePipeFromMetadata, computeMsgId, core, createInjectableType, createMayBeForwardRefExpression, devOnlyGuardedExpression, emitDistinctChangesOnlyDefaultValue, getHtmlTagDefinition, getNsPrefix, getSafePropertyAccessString, identifierName, isIdentifier, isNgContainer, isNgContent, isNgTemplate, jsDocComment, leadingComment, literalMap, makeBindingParser, mergeNsAndName, output_ast as outputAst, parseHostBindings, parseTemplate, preserveWhitespacesDefault, publishFacade, r3JitTypeSourceSpan, sanitizeIdentifier, splitNsName, verifyHostBindings, visitAll };
22289
22456
  //# sourceMappingURL=compiler.mjs.map