@angular-eslint/bundled-angular-compiler 15.2.2-alpha.9 → 16.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,5 +1,7 @@
1
+ 'use strict';
2
+
1
3
  /**
2
- * @license Angular v15.2.5
4
+ * @license Angular v16.0.0-rc.2
3
5
  * (c) 2010-2022 Google LLC. https://angular.io/
4
6
  * License: MIT
5
7
  */
@@ -740,7 +742,7 @@ class _SerializerIgnoreIcuExpVisitor extends _SerializerVisitor {
740
742
  * DO NOT USE IT IN A SECURITY SENSITIVE CONTEXT.
741
743
  */
742
744
  function sha1(str) {
743
- textEncoder !== null && textEncoder !== void 0 ? textEncoder : (textEncoder = new TextEncoder());
745
+ textEncoder ??= new TextEncoder();
744
746
  const utf8 = [...textEncoder.encode(str)];
745
747
  const words32 = bytesToWords32(utf8, Endian.Big);
746
748
  const len = utf8.length * 8;
@@ -806,7 +808,7 @@ function fk(index, b, c, d) {
806
808
  * https://github.com/google/closure-compiler/blob/master/src/com/google/javascript/jscomp/GoogleJsMessageIdGenerator.java
807
809
  */
808
810
  function fingerprint(str) {
809
- textEncoder !== null && textEncoder !== void 0 ? textEncoder : (textEncoder = new TextEncoder());
811
+ textEncoder ??= new TextEncoder();
810
812
  const utf8 = textEncoder.encode(str);
811
813
  const view = new DataView(utf8.buffer, utf8.byteOffset, utf8.byteLength);
812
814
  let hi = hash32(view, utf8.length, 0);
@@ -1381,7 +1383,6 @@ class TemplateLiteral {
1381
1383
  }
1382
1384
  class TemplateLiteralElement {
1383
1385
  constructor(text, sourceSpan, rawText) {
1384
- var _a;
1385
1386
  this.text = text;
1386
1387
  this.sourceSpan = sourceSpan;
1387
1388
  // If `rawText` is not provided, try to extract the raw string from its
@@ -1391,7 +1392,7 @@ class TemplateLiteralElement {
1391
1392
  // - "`" and "${" are template string control sequences that would otherwise prematurely
1392
1393
  // indicate the end of the template literal element.
1393
1394
  this.rawText =
1394
- (_a = rawText !== null && rawText !== void 0 ? rawText : sourceSpan === null || sourceSpan === void 0 ? void 0 : sourceSpan.toString()) !== null && _a !== void 0 ? _a : escapeForTemplateLiteral(escapeSlashes(text));
1395
+ rawText ?? sourceSpan?.toString() ?? escapeForTemplateLiteral(escapeSlashes(text));
1395
1396
  }
1396
1397
  }
1397
1398
  class LiteralPiece {
@@ -1461,12 +1462,11 @@ class LocalizedString extends Expression {
1461
1462
  return createCookedRawString(metaBlock, this.messageParts[0].text, this.getMessagePartSourceSpan(0));
1462
1463
  }
1463
1464
  getMessagePartSourceSpan(i) {
1464
- var _a, _b;
1465
- return (_b = (_a = this.messageParts[i]) === null || _a === void 0 ? void 0 : _a.sourceSpan) !== null && _b !== void 0 ? _b : this.sourceSpan;
1465
+ return this.messageParts[i]?.sourceSpan ?? this.sourceSpan;
1466
1466
  }
1467
1467
  getPlaceholderSourceSpan(i) {
1468
- var _a, _b, _c, _d;
1469
- return (_d = (_b = (_a = this.placeHolderNames[i]) === null || _a === void 0 ? void 0 : _a.sourceSpan) !== null && _b !== void 0 ? _b : (_c = this.expressions[i]) === null || _c === void 0 ? void 0 : _c.sourceSpan) !== null && _d !== void 0 ? _d : this.sourceSpan;
1468
+ return this.placeHolderNames[i]?.sourceSpan ?? this.expressions[i]?.sourceSpan ??
1469
+ this.sourceSpan;
1470
1470
  }
1471
1471
  /**
1472
1472
  * Serialize the given `placeholderName` and `messagePart` into "cooked" and "raw" strings that
@@ -1480,11 +1480,10 @@ class LocalizedString extends Expression {
1480
1480
  * @param partIndex The index of the message part to serialize.
1481
1481
  */
1482
1482
  serializeI18nTemplatePart(partIndex) {
1483
- var _a;
1484
1483
  const placeholder = this.placeHolderNames[partIndex - 1];
1485
1484
  const messagePart = this.messageParts[partIndex];
1486
1485
  let metaBlock = placeholder.text;
1487
- if (((_a = placeholder.associatedMessage) === null || _a === void 0 ? void 0 : _a.legacyIds.length) === 0) {
1486
+ if (placeholder.associatedMessage?.legacyIds.length === 0) {
1488
1487
  metaBlock += `${ID_SEPARATOR$1}${computeMsgId(placeholder.associatedMessage.messageString, placeholder.associatedMessage.meaning)}`;
1489
1488
  }
1490
1489
  return createCookedRawString(metaBlock, messagePart.text, this.getMessagePartSourceSpan(partIndex));
@@ -1787,8 +1786,7 @@ class Statement {
1787
1786
  return (this.modifiers & modifier) !== 0;
1788
1787
  }
1789
1788
  addLeadingComment(leadingComment) {
1790
- var _a;
1791
- this.leadingComments = (_a = this.leadingComments) !== null && _a !== void 0 ? _a : [];
1789
+ this.leadingComments = this.leadingComments ?? [];
1792
1790
  this.leadingComments.push(leadingComment);
1793
1791
  }
1794
1792
  }
@@ -2224,6 +2222,7 @@ class FixupExpression extends Expression {
2224
2222
  constructor(resolved) {
2225
2223
  super(resolved.type);
2226
2224
  this.resolved = resolved;
2225
+ this.shared = false;
2227
2226
  this.original = resolved;
2228
2227
  }
2229
2228
  visitExpression(visitor, context) {
@@ -2431,209 +2430,209 @@ function isLongStringLiteral(expr) {
2431
2430
 
2432
2431
  const CORE = '@angular/core';
2433
2432
  class Identifiers {
2433
+ /* Methods */
2434
+ static { this.NEW_METHOD = 'factory'; }
2435
+ static { this.TRANSFORM_METHOD = 'transform'; }
2436
+ static { this.PATCH_DEPS = 'patchedDeps'; }
2437
+ static { this.core = { name: null, moduleName: CORE }; }
2438
+ /* Instructions */
2439
+ static { this.namespaceHTML = { name: 'ɵɵnamespaceHTML', moduleName: CORE }; }
2440
+ static { this.namespaceMathML = { name: 'ɵɵnamespaceMathML', moduleName: CORE }; }
2441
+ static { this.namespaceSVG = { name: 'ɵɵnamespaceSVG', moduleName: CORE }; }
2442
+ static { this.element = { name: 'ɵɵelement', moduleName: CORE }; }
2443
+ static { this.elementStart = { name: 'ɵɵelementStart', moduleName: CORE }; }
2444
+ static { this.elementEnd = { name: 'ɵɵelementEnd', moduleName: CORE }; }
2445
+ static { this.advance = { name: 'ɵɵadvance', moduleName: CORE }; }
2446
+ static { this.syntheticHostProperty = { name: 'ɵɵsyntheticHostProperty', moduleName: CORE }; }
2447
+ static { this.syntheticHostListener = { name: 'ɵɵsyntheticHostListener', moduleName: CORE }; }
2448
+ static { this.attribute = { name: 'ɵɵattribute', moduleName: CORE }; }
2449
+ static { this.attributeInterpolate1 = { name: 'ɵɵattributeInterpolate1', moduleName: CORE }; }
2450
+ static { this.attributeInterpolate2 = { name: 'ɵɵattributeInterpolate2', moduleName: CORE }; }
2451
+ static { this.attributeInterpolate3 = { name: 'ɵɵattributeInterpolate3', moduleName: CORE }; }
2452
+ static { this.attributeInterpolate4 = { name: 'ɵɵattributeInterpolate4', moduleName: CORE }; }
2453
+ static { this.attributeInterpolate5 = { name: 'ɵɵattributeInterpolate5', moduleName: CORE }; }
2454
+ static { this.attributeInterpolate6 = { name: 'ɵɵattributeInterpolate6', moduleName: CORE }; }
2455
+ static { this.attributeInterpolate7 = { name: 'ɵɵattributeInterpolate7', moduleName: CORE }; }
2456
+ static { this.attributeInterpolate8 = { name: 'ɵɵattributeInterpolate8', moduleName: CORE }; }
2457
+ static { this.attributeInterpolateV = { name: 'ɵɵattributeInterpolateV', moduleName: CORE }; }
2458
+ static { this.classProp = { name: 'ɵɵclassProp', moduleName: CORE }; }
2459
+ static { this.elementContainerStart = { name: 'ɵɵelementContainerStart', moduleName: CORE }; }
2460
+ static { this.elementContainerEnd = { name: 'ɵɵelementContainerEnd', moduleName: CORE }; }
2461
+ static { this.elementContainer = { name: 'ɵɵelementContainer', moduleName: CORE }; }
2462
+ static { this.styleMap = { name: 'ɵɵstyleMap', moduleName: CORE }; }
2463
+ static { this.styleMapInterpolate1 = { name: 'ɵɵstyleMapInterpolate1', moduleName: CORE }; }
2464
+ static { this.styleMapInterpolate2 = { name: 'ɵɵstyleMapInterpolate2', moduleName: CORE }; }
2465
+ static { this.styleMapInterpolate3 = { name: 'ɵɵstyleMapInterpolate3', moduleName: CORE }; }
2466
+ static { this.styleMapInterpolate4 = { name: 'ɵɵstyleMapInterpolate4', moduleName: CORE }; }
2467
+ static { this.styleMapInterpolate5 = { name: 'ɵɵstyleMapInterpolate5', moduleName: CORE }; }
2468
+ static { this.styleMapInterpolate6 = { name: 'ɵɵstyleMapInterpolate6', moduleName: CORE }; }
2469
+ static { this.styleMapInterpolate7 = { name: 'ɵɵstyleMapInterpolate7', moduleName: CORE }; }
2470
+ static { this.styleMapInterpolate8 = { name: 'ɵɵstyleMapInterpolate8', moduleName: CORE }; }
2471
+ static { this.styleMapInterpolateV = { name: 'ɵɵstyleMapInterpolateV', moduleName: CORE }; }
2472
+ static { this.classMap = { name: 'ɵɵclassMap', moduleName: CORE }; }
2473
+ static { this.classMapInterpolate1 = { name: 'ɵɵclassMapInterpolate1', moduleName: CORE }; }
2474
+ static { this.classMapInterpolate2 = { name: 'ɵɵclassMapInterpolate2', moduleName: CORE }; }
2475
+ static { this.classMapInterpolate3 = { name: 'ɵɵclassMapInterpolate3', moduleName: CORE }; }
2476
+ static { this.classMapInterpolate4 = { name: 'ɵɵclassMapInterpolate4', moduleName: CORE }; }
2477
+ static { this.classMapInterpolate5 = { name: 'ɵɵclassMapInterpolate5', moduleName: CORE }; }
2478
+ static { this.classMapInterpolate6 = { name: 'ɵɵclassMapInterpolate6', moduleName: CORE }; }
2479
+ static { this.classMapInterpolate7 = { name: 'ɵɵclassMapInterpolate7', moduleName: CORE }; }
2480
+ static { this.classMapInterpolate8 = { name: 'ɵɵclassMapInterpolate8', moduleName: CORE }; }
2481
+ static { this.classMapInterpolateV = { name: 'ɵɵclassMapInterpolateV', moduleName: CORE }; }
2482
+ static { this.styleProp = { name: 'ɵɵstyleProp', moduleName: CORE }; }
2483
+ static { this.stylePropInterpolate1 = { name: 'ɵɵstylePropInterpolate1', moduleName: CORE }; }
2484
+ static { this.stylePropInterpolate2 = { name: 'ɵɵstylePropInterpolate2', moduleName: CORE }; }
2485
+ static { this.stylePropInterpolate3 = { name: 'ɵɵstylePropInterpolate3', moduleName: CORE }; }
2486
+ static { this.stylePropInterpolate4 = { name: 'ɵɵstylePropInterpolate4', moduleName: CORE }; }
2487
+ static { this.stylePropInterpolate5 = { name: 'ɵɵstylePropInterpolate5', moduleName: CORE }; }
2488
+ static { this.stylePropInterpolate6 = { name: 'ɵɵstylePropInterpolate6', moduleName: CORE }; }
2489
+ static { this.stylePropInterpolate7 = { name: 'ɵɵstylePropInterpolate7', moduleName: CORE }; }
2490
+ static { this.stylePropInterpolate8 = { name: 'ɵɵstylePropInterpolate8', moduleName: CORE }; }
2491
+ static { this.stylePropInterpolateV = { name: 'ɵɵstylePropInterpolateV', moduleName: CORE }; }
2492
+ static { this.nextContext = { name: 'ɵɵnextContext', moduleName: CORE }; }
2493
+ static { this.resetView = { name: 'ɵɵresetView', moduleName: CORE }; }
2494
+ static { this.templateCreate = { name: 'ɵɵtemplate', moduleName: CORE }; }
2495
+ static { this.text = { name: 'ɵɵtext', moduleName: CORE }; }
2496
+ static { this.enableBindings = { name: 'ɵɵenableBindings', moduleName: CORE }; }
2497
+ static { this.disableBindings = { name: 'ɵɵdisableBindings', moduleName: CORE }; }
2498
+ static { this.getCurrentView = { name: 'ɵɵgetCurrentView', moduleName: CORE }; }
2499
+ static { this.textInterpolate = { name: 'ɵɵtextInterpolate', moduleName: CORE }; }
2500
+ static { this.textInterpolate1 = { name: 'ɵɵtextInterpolate1', moduleName: CORE }; }
2501
+ static { this.textInterpolate2 = { name: 'ɵɵtextInterpolate2', moduleName: CORE }; }
2502
+ static { this.textInterpolate3 = { name: 'ɵɵtextInterpolate3', moduleName: CORE }; }
2503
+ static { this.textInterpolate4 = { name: 'ɵɵtextInterpolate4', moduleName: CORE }; }
2504
+ static { this.textInterpolate5 = { name: 'ɵɵtextInterpolate5', moduleName: CORE }; }
2505
+ static { this.textInterpolate6 = { name: 'ɵɵtextInterpolate6', moduleName: CORE }; }
2506
+ static { this.textInterpolate7 = { name: 'ɵɵtextInterpolate7', moduleName: CORE }; }
2507
+ static { this.textInterpolate8 = { name: 'ɵɵtextInterpolate8', moduleName: CORE }; }
2508
+ static { this.textInterpolateV = { name: 'ɵɵtextInterpolateV', moduleName: CORE }; }
2509
+ static { this.restoreView = { name: 'ɵɵrestoreView', moduleName: CORE }; }
2510
+ static { this.pureFunction0 = { name: 'ɵɵpureFunction0', moduleName: CORE }; }
2511
+ static { this.pureFunction1 = { name: 'ɵɵpureFunction1', moduleName: CORE }; }
2512
+ static { this.pureFunction2 = { name: 'ɵɵpureFunction2', moduleName: CORE }; }
2513
+ static { this.pureFunction3 = { name: 'ɵɵpureFunction3', moduleName: CORE }; }
2514
+ static { this.pureFunction4 = { name: 'ɵɵpureFunction4', moduleName: CORE }; }
2515
+ static { this.pureFunction5 = { name: 'ɵɵpureFunction5', moduleName: CORE }; }
2516
+ static { this.pureFunction6 = { name: 'ɵɵpureFunction6', moduleName: CORE }; }
2517
+ static { this.pureFunction7 = { name: 'ɵɵpureFunction7', moduleName: CORE }; }
2518
+ static { this.pureFunction8 = { name: 'ɵɵpureFunction8', moduleName: CORE }; }
2519
+ static { this.pureFunctionV = { name: 'ɵɵpureFunctionV', moduleName: CORE }; }
2520
+ static { this.pipeBind1 = { name: 'ɵɵpipeBind1', moduleName: CORE }; }
2521
+ static { this.pipeBind2 = { name: 'ɵɵpipeBind2', moduleName: CORE }; }
2522
+ static { this.pipeBind3 = { name: 'ɵɵpipeBind3', moduleName: CORE }; }
2523
+ static { this.pipeBind4 = { name: 'ɵɵpipeBind4', moduleName: CORE }; }
2524
+ static { this.pipeBindV = { name: 'ɵɵpipeBindV', moduleName: CORE }; }
2525
+ static { this.hostProperty = { name: 'ɵɵhostProperty', moduleName: CORE }; }
2526
+ static { this.property = { name: 'ɵɵproperty', moduleName: CORE }; }
2527
+ static { this.propertyInterpolate = { name: 'ɵɵpropertyInterpolate', moduleName: CORE }; }
2528
+ static { this.propertyInterpolate1 = { name: 'ɵɵpropertyInterpolate1', moduleName: CORE }; }
2529
+ static { this.propertyInterpolate2 = { name: 'ɵɵpropertyInterpolate2', moduleName: CORE }; }
2530
+ static { this.propertyInterpolate3 = { name: 'ɵɵpropertyInterpolate3', moduleName: CORE }; }
2531
+ static { this.propertyInterpolate4 = { name: 'ɵɵpropertyInterpolate4', moduleName: CORE }; }
2532
+ static { this.propertyInterpolate5 = { name: 'ɵɵpropertyInterpolate5', moduleName: CORE }; }
2533
+ static { this.propertyInterpolate6 = { name: 'ɵɵpropertyInterpolate6', moduleName: CORE }; }
2534
+ static { this.propertyInterpolate7 = { name: 'ɵɵpropertyInterpolate7', moduleName: CORE }; }
2535
+ static { this.propertyInterpolate8 = { name: 'ɵɵpropertyInterpolate8', moduleName: CORE }; }
2536
+ static { this.propertyInterpolateV = { name: 'ɵɵpropertyInterpolateV', moduleName: CORE }; }
2537
+ static { this.i18n = { name: 'ɵɵi18n', moduleName: CORE }; }
2538
+ static { this.i18nAttributes = { name: 'ɵɵi18nAttributes', moduleName: CORE }; }
2539
+ static { this.i18nExp = { name: 'ɵɵi18nExp', moduleName: CORE }; }
2540
+ static { this.i18nStart = { name: 'ɵɵi18nStart', moduleName: CORE }; }
2541
+ static { this.i18nEnd = { name: 'ɵɵi18nEnd', moduleName: CORE }; }
2542
+ static { this.i18nApply = { name: 'ɵɵi18nApply', moduleName: CORE }; }
2543
+ static { this.i18nPostprocess = { name: 'ɵɵi18nPostprocess', moduleName: CORE }; }
2544
+ static { this.pipe = { name: 'ɵɵpipe', moduleName: CORE }; }
2545
+ static { this.projection = { name: 'ɵɵprojection', moduleName: CORE }; }
2546
+ static { this.projectionDef = { name: 'ɵɵprojectionDef', moduleName: CORE }; }
2547
+ static { this.reference = { name: 'ɵɵreference', moduleName: CORE }; }
2548
+ static { this.inject = { name: 'ɵɵinject', moduleName: CORE }; }
2549
+ static { this.injectAttribute = { name: 'ɵɵinjectAttribute', moduleName: CORE }; }
2550
+ static { this.directiveInject = { name: 'ɵɵdirectiveInject', moduleName: CORE }; }
2551
+ static { this.invalidFactory = { name: 'ɵɵinvalidFactory', moduleName: CORE }; }
2552
+ static { this.invalidFactoryDep = { name: 'ɵɵinvalidFactoryDep', moduleName: CORE }; }
2553
+ static { this.templateRefExtractor = { name: 'ɵɵtemplateRefExtractor', moduleName: CORE }; }
2554
+ static { this.forwardRef = { name: 'forwardRef', moduleName: CORE }; }
2555
+ static { this.resolveForwardRef = { name: 'resolveForwardRef', moduleName: CORE }; }
2556
+ static { this.ɵɵdefineInjectable = { name: 'ɵɵdefineInjectable', moduleName: CORE }; }
2557
+ static { this.declareInjectable = { name: 'ɵɵngDeclareInjectable', moduleName: CORE }; }
2558
+ static { this.InjectableDeclaration = { name: 'ɵɵInjectableDeclaration', moduleName: CORE }; }
2559
+ static { this.resolveWindow = { name: 'ɵɵresolveWindow', moduleName: CORE }; }
2560
+ static { this.resolveDocument = { name: 'ɵɵresolveDocument', moduleName: CORE }; }
2561
+ static { this.resolveBody = { name: 'ɵɵresolveBody', moduleName: CORE }; }
2562
+ static { this.defineComponent = { name: 'ɵɵdefineComponent', moduleName: CORE }; }
2563
+ static { this.declareComponent = { name: 'ɵɵngDeclareComponent', moduleName: CORE }; }
2564
+ static { this.setComponentScope = { name: 'ɵɵsetComponentScope', moduleName: CORE }; }
2565
+ static { this.ChangeDetectionStrategy = {
2566
+ name: 'ChangeDetectionStrategy',
2567
+ moduleName: CORE,
2568
+ }; }
2569
+ static { this.ViewEncapsulation = {
2570
+ name: 'ViewEncapsulation',
2571
+ moduleName: CORE,
2572
+ }; }
2573
+ static { this.ComponentDeclaration = {
2574
+ name: 'ɵɵComponentDeclaration',
2575
+ moduleName: CORE,
2576
+ }; }
2577
+ static { this.FactoryDeclaration = {
2578
+ name: 'ɵɵFactoryDeclaration',
2579
+ moduleName: CORE,
2580
+ }; }
2581
+ static { this.declareFactory = { name: 'ɵɵngDeclareFactory', moduleName: CORE }; }
2582
+ static { this.FactoryTarget = { name: 'ɵɵFactoryTarget', moduleName: CORE }; }
2583
+ static { this.defineDirective = { name: 'ɵɵdefineDirective', moduleName: CORE }; }
2584
+ static { this.declareDirective = { name: 'ɵɵngDeclareDirective', moduleName: CORE }; }
2585
+ static { this.DirectiveDeclaration = {
2586
+ name: 'ɵɵDirectiveDeclaration',
2587
+ moduleName: CORE,
2588
+ }; }
2589
+ static { this.InjectorDef = { name: 'ɵɵInjectorDef', moduleName: CORE }; }
2590
+ static { this.InjectorDeclaration = { name: 'ɵɵInjectorDeclaration', moduleName: CORE }; }
2591
+ static { this.defineInjector = { name: 'ɵɵdefineInjector', moduleName: CORE }; }
2592
+ static { this.declareInjector = { name: 'ɵɵngDeclareInjector', moduleName: CORE }; }
2593
+ static { this.NgModuleDeclaration = {
2594
+ name: 'ɵɵNgModuleDeclaration',
2595
+ moduleName: CORE,
2596
+ }; }
2597
+ static { this.ModuleWithProviders = {
2598
+ name: 'ModuleWithProviders',
2599
+ moduleName: CORE,
2600
+ }; }
2601
+ static { this.defineNgModule = { name: 'ɵɵdefineNgModule', moduleName: CORE }; }
2602
+ static { this.declareNgModule = { name: 'ɵɵngDeclareNgModule', moduleName: CORE }; }
2603
+ static { this.setNgModuleScope = { name: 'ɵɵsetNgModuleScope', moduleName: CORE }; }
2604
+ static { this.registerNgModuleType = { name: 'ɵɵregisterNgModuleType', moduleName: CORE }; }
2605
+ static { this.PipeDeclaration = { name: 'ɵɵPipeDeclaration', moduleName: CORE }; }
2606
+ static { this.definePipe = { name: 'ɵɵdefinePipe', moduleName: CORE }; }
2607
+ static { this.declarePipe = { name: 'ɵɵngDeclarePipe', moduleName: CORE }; }
2608
+ static { this.declareClassMetadata = { name: 'ɵɵngDeclareClassMetadata', moduleName: CORE }; }
2609
+ static { this.setClassMetadata = { name: 'ɵsetClassMetadata', moduleName: CORE }; }
2610
+ static { this.queryRefresh = { name: 'ɵɵqueryRefresh', moduleName: CORE }; }
2611
+ static { this.viewQuery = { name: 'ɵɵviewQuery', moduleName: CORE }; }
2612
+ static { this.loadQuery = { name: 'ɵɵloadQuery', moduleName: CORE }; }
2613
+ static { this.contentQuery = { name: 'ɵɵcontentQuery', moduleName: CORE }; }
2614
+ static { this.NgOnChangesFeature = { name: 'ɵɵNgOnChangesFeature', moduleName: CORE }; }
2615
+ static { this.InheritDefinitionFeature = { name: 'ɵɵInheritDefinitionFeature', moduleName: CORE }; }
2616
+ static { this.CopyDefinitionFeature = { name: 'ɵɵCopyDefinitionFeature', moduleName: CORE }; }
2617
+ static { this.StandaloneFeature = { name: 'ɵɵStandaloneFeature', moduleName: CORE }; }
2618
+ static { this.ProvidersFeature = { name: 'ɵɵProvidersFeature', moduleName: CORE }; }
2619
+ static { this.HostDirectivesFeature = { name: 'ɵɵHostDirectivesFeature', moduleName: CORE }; }
2620
+ static { this.listener = { name: 'ɵɵlistener', moduleName: CORE }; }
2621
+ static { this.getInheritedFactory = {
2622
+ name: 'ɵɵgetInheritedFactory',
2623
+ moduleName: CORE,
2624
+ }; }
2625
+ // sanitization-related functions
2626
+ static { this.sanitizeHtml = { name: 'ɵɵsanitizeHtml', moduleName: CORE }; }
2627
+ static { this.sanitizeStyle = { name: 'ɵɵsanitizeStyle', moduleName: CORE }; }
2628
+ static { this.sanitizeResourceUrl = { name: 'ɵɵsanitizeResourceUrl', moduleName: CORE }; }
2629
+ static { this.sanitizeScript = { name: 'ɵɵsanitizeScript', moduleName: CORE }; }
2630
+ static { this.sanitizeUrl = { name: 'ɵɵsanitizeUrl', moduleName: CORE }; }
2631
+ static { this.sanitizeUrlOrResourceUrl = { name: 'ɵɵsanitizeUrlOrResourceUrl', moduleName: CORE }; }
2632
+ static { this.trustConstantHtml = { name: 'ɵɵtrustConstantHtml', moduleName: CORE }; }
2633
+ static { this.trustConstantResourceUrl = { name: 'ɵɵtrustConstantResourceUrl', moduleName: CORE }; }
2634
+ static { this.validateIframeAttribute = { name: 'ɵɵvalidateIframeAttribute', moduleName: CORE }; }
2434
2635
  }
2435
- /* Methods */
2436
- Identifiers.NEW_METHOD = 'factory';
2437
- Identifiers.TRANSFORM_METHOD = 'transform';
2438
- Identifiers.PATCH_DEPS = 'patchedDeps';
2439
- Identifiers.core = { name: null, moduleName: CORE };
2440
- /* Instructions */
2441
- Identifiers.namespaceHTML = { name: 'ɵɵnamespaceHTML', moduleName: CORE };
2442
- Identifiers.namespaceMathML = { name: 'ɵɵnamespaceMathML', moduleName: CORE };
2443
- Identifiers.namespaceSVG = { name: 'ɵɵnamespaceSVG', moduleName: CORE };
2444
- Identifiers.element = { name: 'ɵɵelement', moduleName: CORE };
2445
- Identifiers.elementStart = { name: 'ɵɵelementStart', moduleName: CORE };
2446
- Identifiers.elementEnd = { name: 'ɵɵelementEnd', moduleName: CORE };
2447
- Identifiers.advance = { name: 'ɵɵadvance', moduleName: CORE };
2448
- Identifiers.syntheticHostProperty = { name: 'ɵɵsyntheticHostProperty', moduleName: CORE };
2449
- Identifiers.syntheticHostListener = { name: 'ɵɵsyntheticHostListener', moduleName: CORE };
2450
- Identifiers.attribute = { name: 'ɵɵattribute', moduleName: CORE };
2451
- Identifiers.attributeInterpolate1 = { name: 'ɵɵattributeInterpolate1', moduleName: CORE };
2452
- Identifiers.attributeInterpolate2 = { name: 'ɵɵattributeInterpolate2', moduleName: CORE };
2453
- Identifiers.attributeInterpolate3 = { name: 'ɵɵattributeInterpolate3', moduleName: CORE };
2454
- Identifiers.attributeInterpolate4 = { name: 'ɵɵattributeInterpolate4', moduleName: CORE };
2455
- Identifiers.attributeInterpolate5 = { name: 'ɵɵattributeInterpolate5', moduleName: CORE };
2456
- Identifiers.attributeInterpolate6 = { name: 'ɵɵattributeInterpolate6', moduleName: CORE };
2457
- Identifiers.attributeInterpolate7 = { name: 'ɵɵattributeInterpolate7', moduleName: CORE };
2458
- Identifiers.attributeInterpolate8 = { name: 'ɵɵattributeInterpolate8', moduleName: CORE };
2459
- Identifiers.attributeInterpolateV = { name: 'ɵɵattributeInterpolateV', moduleName: CORE };
2460
- Identifiers.classProp = { name: 'ɵɵclassProp', moduleName: CORE };
2461
- Identifiers.elementContainerStart = { name: 'ɵɵelementContainerStart', moduleName: CORE };
2462
- Identifiers.elementContainerEnd = { name: 'ɵɵelementContainerEnd', moduleName: CORE };
2463
- Identifiers.elementContainer = { name: 'ɵɵelementContainer', moduleName: CORE };
2464
- Identifiers.styleMap = { name: 'ɵɵstyleMap', moduleName: CORE };
2465
- Identifiers.styleMapInterpolate1 = { name: 'ɵɵstyleMapInterpolate1', moduleName: CORE };
2466
- Identifiers.styleMapInterpolate2 = { name: 'ɵɵstyleMapInterpolate2', moduleName: CORE };
2467
- Identifiers.styleMapInterpolate3 = { name: 'ɵɵstyleMapInterpolate3', moduleName: CORE };
2468
- Identifiers.styleMapInterpolate4 = { name: 'ɵɵstyleMapInterpolate4', moduleName: CORE };
2469
- Identifiers.styleMapInterpolate5 = { name: 'ɵɵstyleMapInterpolate5', moduleName: CORE };
2470
- Identifiers.styleMapInterpolate6 = { name: 'ɵɵstyleMapInterpolate6', moduleName: CORE };
2471
- Identifiers.styleMapInterpolate7 = { name: 'ɵɵstyleMapInterpolate7', moduleName: CORE };
2472
- Identifiers.styleMapInterpolate8 = { name: 'ɵɵstyleMapInterpolate8', moduleName: CORE };
2473
- Identifiers.styleMapInterpolateV = { name: 'ɵɵstyleMapInterpolateV', moduleName: CORE };
2474
- Identifiers.classMap = { name: 'ɵɵclassMap', moduleName: CORE };
2475
- Identifiers.classMapInterpolate1 = { name: 'ɵɵclassMapInterpolate1', moduleName: CORE };
2476
- Identifiers.classMapInterpolate2 = { name: 'ɵɵclassMapInterpolate2', moduleName: CORE };
2477
- Identifiers.classMapInterpolate3 = { name: 'ɵɵclassMapInterpolate3', moduleName: CORE };
2478
- Identifiers.classMapInterpolate4 = { name: 'ɵɵclassMapInterpolate4', moduleName: CORE };
2479
- Identifiers.classMapInterpolate5 = { name: 'ɵɵclassMapInterpolate5', moduleName: CORE };
2480
- Identifiers.classMapInterpolate6 = { name: 'ɵɵclassMapInterpolate6', moduleName: CORE };
2481
- Identifiers.classMapInterpolate7 = { name: 'ɵɵclassMapInterpolate7', moduleName: CORE };
2482
- Identifiers.classMapInterpolate8 = { name: 'ɵɵclassMapInterpolate8', moduleName: CORE };
2483
- Identifiers.classMapInterpolateV = { name: 'ɵɵclassMapInterpolateV', moduleName: CORE };
2484
- Identifiers.styleProp = { name: 'ɵɵstyleProp', moduleName: CORE };
2485
- Identifiers.stylePropInterpolate1 = { name: 'ɵɵstylePropInterpolate1', moduleName: CORE };
2486
- Identifiers.stylePropInterpolate2 = { name: 'ɵɵstylePropInterpolate2', moduleName: CORE };
2487
- Identifiers.stylePropInterpolate3 = { name: 'ɵɵstylePropInterpolate3', moduleName: CORE };
2488
- Identifiers.stylePropInterpolate4 = { name: 'ɵɵstylePropInterpolate4', moduleName: CORE };
2489
- Identifiers.stylePropInterpolate5 = { name: 'ɵɵstylePropInterpolate5', moduleName: CORE };
2490
- Identifiers.stylePropInterpolate6 = { name: 'ɵɵstylePropInterpolate6', moduleName: CORE };
2491
- Identifiers.stylePropInterpolate7 = { name: 'ɵɵstylePropInterpolate7', moduleName: CORE };
2492
- Identifiers.stylePropInterpolate8 = { name: 'ɵɵstylePropInterpolate8', moduleName: CORE };
2493
- Identifiers.stylePropInterpolateV = { name: 'ɵɵstylePropInterpolateV', moduleName: CORE };
2494
- Identifiers.nextContext = { name: 'ɵɵnextContext', moduleName: CORE };
2495
- Identifiers.resetView = { name: 'ɵɵresetView', moduleName: CORE };
2496
- Identifiers.templateCreate = { name: 'ɵɵtemplate', moduleName: CORE };
2497
- Identifiers.text = { name: 'ɵɵtext', moduleName: CORE };
2498
- Identifiers.enableBindings = { name: 'ɵɵenableBindings', moduleName: CORE };
2499
- Identifiers.disableBindings = { name: 'ɵɵdisableBindings', moduleName: CORE };
2500
- Identifiers.getCurrentView = { name: 'ɵɵgetCurrentView', moduleName: CORE };
2501
- Identifiers.textInterpolate = { name: 'ɵɵtextInterpolate', moduleName: CORE };
2502
- Identifiers.textInterpolate1 = { name: 'ɵɵtextInterpolate1', moduleName: CORE };
2503
- Identifiers.textInterpolate2 = { name: 'ɵɵtextInterpolate2', moduleName: CORE };
2504
- Identifiers.textInterpolate3 = { name: 'ɵɵtextInterpolate3', moduleName: CORE };
2505
- Identifiers.textInterpolate4 = { name: 'ɵɵtextInterpolate4', moduleName: CORE };
2506
- Identifiers.textInterpolate5 = { name: 'ɵɵtextInterpolate5', moduleName: CORE };
2507
- Identifiers.textInterpolate6 = { name: 'ɵɵtextInterpolate6', moduleName: CORE };
2508
- Identifiers.textInterpolate7 = { name: 'ɵɵtextInterpolate7', moduleName: CORE };
2509
- Identifiers.textInterpolate8 = { name: 'ɵɵtextInterpolate8', moduleName: CORE };
2510
- Identifiers.textInterpolateV = { name: 'ɵɵtextInterpolateV', moduleName: CORE };
2511
- Identifiers.restoreView = { name: 'ɵɵrestoreView', moduleName: CORE };
2512
- Identifiers.pureFunction0 = { name: 'ɵɵpureFunction0', moduleName: CORE };
2513
- Identifiers.pureFunction1 = { name: 'ɵɵpureFunction1', moduleName: CORE };
2514
- Identifiers.pureFunction2 = { name: 'ɵɵpureFunction2', moduleName: CORE };
2515
- Identifiers.pureFunction3 = { name: 'ɵɵpureFunction3', moduleName: CORE };
2516
- Identifiers.pureFunction4 = { name: 'ɵɵpureFunction4', moduleName: CORE };
2517
- Identifiers.pureFunction5 = { name: 'ɵɵpureFunction5', moduleName: CORE };
2518
- Identifiers.pureFunction6 = { name: 'ɵɵpureFunction6', moduleName: CORE };
2519
- Identifiers.pureFunction7 = { name: 'ɵɵpureFunction7', moduleName: CORE };
2520
- Identifiers.pureFunction8 = { name: 'ɵɵpureFunction8', moduleName: CORE };
2521
- Identifiers.pureFunctionV = { name: 'ɵɵpureFunctionV', moduleName: CORE };
2522
- Identifiers.pipeBind1 = { name: 'ɵɵpipeBind1', moduleName: CORE };
2523
- Identifiers.pipeBind2 = { name: 'ɵɵpipeBind2', moduleName: CORE };
2524
- Identifiers.pipeBind3 = { name: 'ɵɵpipeBind3', moduleName: CORE };
2525
- Identifiers.pipeBind4 = { name: 'ɵɵpipeBind4', moduleName: CORE };
2526
- Identifiers.pipeBindV = { name: 'ɵɵpipeBindV', moduleName: CORE };
2527
- Identifiers.hostProperty = { name: 'ɵɵhostProperty', moduleName: CORE };
2528
- Identifiers.property = { name: 'ɵɵproperty', moduleName: CORE };
2529
- Identifiers.propertyInterpolate = { name: 'ɵɵpropertyInterpolate', moduleName: CORE };
2530
- Identifiers.propertyInterpolate1 = { name: 'ɵɵpropertyInterpolate1', moduleName: CORE };
2531
- Identifiers.propertyInterpolate2 = { name: 'ɵɵpropertyInterpolate2', moduleName: CORE };
2532
- Identifiers.propertyInterpolate3 = { name: 'ɵɵpropertyInterpolate3', moduleName: CORE };
2533
- Identifiers.propertyInterpolate4 = { name: 'ɵɵpropertyInterpolate4', moduleName: CORE };
2534
- Identifiers.propertyInterpolate5 = { name: 'ɵɵpropertyInterpolate5', moduleName: CORE };
2535
- Identifiers.propertyInterpolate6 = { name: 'ɵɵpropertyInterpolate6', moduleName: CORE };
2536
- Identifiers.propertyInterpolate7 = { name: 'ɵɵpropertyInterpolate7', moduleName: CORE };
2537
- Identifiers.propertyInterpolate8 = { name: 'ɵɵpropertyInterpolate8', moduleName: CORE };
2538
- Identifiers.propertyInterpolateV = { name: 'ɵɵpropertyInterpolateV', moduleName: CORE };
2539
- Identifiers.i18n = { name: 'ɵɵi18n', moduleName: CORE };
2540
- Identifiers.i18nAttributes = { name: 'ɵɵi18nAttributes', moduleName: CORE };
2541
- Identifiers.i18nExp = { name: 'ɵɵi18nExp', moduleName: CORE };
2542
- Identifiers.i18nStart = { name: 'ɵɵi18nStart', moduleName: CORE };
2543
- Identifiers.i18nEnd = { name: 'ɵɵi18nEnd', moduleName: CORE };
2544
- Identifiers.i18nApply = { name: 'ɵɵi18nApply', moduleName: CORE };
2545
- Identifiers.i18nPostprocess = { name: 'ɵɵi18nPostprocess', moduleName: CORE };
2546
- Identifiers.pipe = { name: 'ɵɵpipe', moduleName: CORE };
2547
- Identifiers.projection = { name: 'ɵɵprojection', moduleName: CORE };
2548
- Identifiers.projectionDef = { name: 'ɵɵprojectionDef', moduleName: CORE };
2549
- Identifiers.reference = { name: 'ɵɵreference', moduleName: CORE };
2550
- Identifiers.inject = { name: 'ɵɵinject', moduleName: CORE };
2551
- Identifiers.injectAttribute = { name: 'ɵɵinjectAttribute', moduleName: CORE };
2552
- Identifiers.directiveInject = { name: 'ɵɵdirectiveInject', moduleName: CORE };
2553
- Identifiers.invalidFactory = { name: 'ɵɵinvalidFactory', moduleName: CORE };
2554
- Identifiers.invalidFactoryDep = { name: 'ɵɵinvalidFactoryDep', moduleName: CORE };
2555
- Identifiers.templateRefExtractor = { name: 'ɵɵtemplateRefExtractor', moduleName: CORE };
2556
- Identifiers.forwardRef = { name: 'forwardRef', moduleName: CORE };
2557
- Identifiers.resolveForwardRef = { name: 'resolveForwardRef', moduleName: CORE };
2558
- Identifiers.ɵɵdefineInjectable = { name: 'ɵɵdefineInjectable', moduleName: CORE };
2559
- Identifiers.declareInjectable = { name: 'ɵɵngDeclareInjectable', moduleName: CORE };
2560
- Identifiers.InjectableDeclaration = { name: 'ɵɵInjectableDeclaration', moduleName: CORE };
2561
- Identifiers.resolveWindow = { name: 'ɵɵresolveWindow', moduleName: CORE };
2562
- Identifiers.resolveDocument = { name: 'ɵɵresolveDocument', moduleName: CORE };
2563
- Identifiers.resolveBody = { name: 'ɵɵresolveBody', moduleName: CORE };
2564
- Identifiers.defineComponent = { name: 'ɵɵdefineComponent', moduleName: CORE };
2565
- Identifiers.declareComponent = { name: 'ɵɵngDeclareComponent', moduleName: CORE };
2566
- Identifiers.setComponentScope = { name: 'ɵɵsetComponentScope', moduleName: CORE };
2567
- Identifiers.ChangeDetectionStrategy = {
2568
- name: 'ChangeDetectionStrategy',
2569
- moduleName: CORE,
2570
- };
2571
- Identifiers.ViewEncapsulation = {
2572
- name: 'ViewEncapsulation',
2573
- moduleName: CORE,
2574
- };
2575
- Identifiers.ComponentDeclaration = {
2576
- name: 'ɵɵComponentDeclaration',
2577
- moduleName: CORE,
2578
- };
2579
- Identifiers.FactoryDeclaration = {
2580
- name: 'ɵɵFactoryDeclaration',
2581
- moduleName: CORE,
2582
- };
2583
- Identifiers.declareFactory = { name: 'ɵɵngDeclareFactory', moduleName: CORE };
2584
- Identifiers.FactoryTarget = { name: 'ɵɵFactoryTarget', moduleName: CORE };
2585
- Identifiers.defineDirective = { name: 'ɵɵdefineDirective', moduleName: CORE };
2586
- Identifiers.declareDirective = { name: 'ɵɵngDeclareDirective', moduleName: CORE };
2587
- Identifiers.DirectiveDeclaration = {
2588
- name: 'ɵɵDirectiveDeclaration',
2589
- moduleName: CORE,
2590
- };
2591
- Identifiers.InjectorDef = { name: 'ɵɵInjectorDef', moduleName: CORE };
2592
- Identifiers.InjectorDeclaration = { name: 'ɵɵInjectorDeclaration', moduleName: CORE };
2593
- Identifiers.defineInjector = { name: 'ɵɵdefineInjector', moduleName: CORE };
2594
- Identifiers.declareInjector = { name: 'ɵɵngDeclareInjector', moduleName: CORE };
2595
- Identifiers.NgModuleDeclaration = {
2596
- name: 'ɵɵNgModuleDeclaration',
2597
- moduleName: CORE,
2598
- };
2599
- Identifiers.ModuleWithProviders = {
2600
- name: 'ModuleWithProviders',
2601
- moduleName: CORE,
2602
- };
2603
- Identifiers.defineNgModule = { name: 'ɵɵdefineNgModule', moduleName: CORE };
2604
- Identifiers.declareNgModule = { name: 'ɵɵngDeclareNgModule', moduleName: CORE };
2605
- Identifiers.setNgModuleScope = { name: 'ɵɵsetNgModuleScope', moduleName: CORE };
2606
- Identifiers.registerNgModuleType = { name: 'ɵɵregisterNgModuleType', moduleName: CORE };
2607
- Identifiers.PipeDeclaration = { name: 'ɵɵPipeDeclaration', moduleName: CORE };
2608
- Identifiers.definePipe = { name: 'ɵɵdefinePipe', moduleName: CORE };
2609
- Identifiers.declarePipe = { name: 'ɵɵngDeclarePipe', moduleName: CORE };
2610
- Identifiers.declareClassMetadata = { name: 'ɵɵngDeclareClassMetadata', moduleName: CORE };
2611
- Identifiers.setClassMetadata = { name: 'ɵsetClassMetadata', moduleName: CORE };
2612
- Identifiers.queryRefresh = { name: 'ɵɵqueryRefresh', moduleName: CORE };
2613
- Identifiers.viewQuery = { name: 'ɵɵviewQuery', moduleName: CORE };
2614
- Identifiers.loadQuery = { name: 'ɵɵloadQuery', moduleName: CORE };
2615
- Identifiers.contentQuery = { name: 'ɵɵcontentQuery', moduleName: CORE };
2616
- Identifiers.NgOnChangesFeature = { name: 'ɵɵNgOnChangesFeature', moduleName: CORE };
2617
- Identifiers.InheritDefinitionFeature = { name: 'ɵɵInheritDefinitionFeature', moduleName: CORE };
2618
- Identifiers.CopyDefinitionFeature = { name: 'ɵɵCopyDefinitionFeature', moduleName: CORE };
2619
- Identifiers.StandaloneFeature = { name: 'ɵɵStandaloneFeature', moduleName: CORE };
2620
- Identifiers.ProvidersFeature = { name: 'ɵɵProvidersFeature', moduleName: CORE };
2621
- Identifiers.HostDirectivesFeature = { name: 'ɵɵHostDirectivesFeature', moduleName: CORE };
2622
- Identifiers.listener = { name: 'ɵɵlistener', moduleName: CORE };
2623
- Identifiers.getInheritedFactory = {
2624
- name: 'ɵɵgetInheritedFactory',
2625
- moduleName: CORE,
2626
- };
2627
- // sanitization-related functions
2628
- Identifiers.sanitizeHtml = { name: 'ɵɵsanitizeHtml', moduleName: CORE };
2629
- Identifiers.sanitizeStyle = { name: 'ɵɵsanitizeStyle', moduleName: CORE };
2630
- Identifiers.sanitizeResourceUrl = { name: 'ɵɵsanitizeResourceUrl', moduleName: CORE };
2631
- Identifiers.sanitizeScript = { name: 'ɵɵsanitizeScript', moduleName: CORE };
2632
- Identifiers.sanitizeUrl = { name: 'ɵɵsanitizeUrl', moduleName: CORE };
2633
- Identifiers.sanitizeUrlOrResourceUrl = { name: 'ɵɵsanitizeUrlOrResourceUrl', moduleName: CORE };
2634
- Identifiers.trustConstantHtml = { name: 'ɵɵtrustConstantHtml', moduleName: CORE };
2635
- Identifiers.trustConstantResourceUrl = { name: 'ɵɵtrustConstantResourceUrl', moduleName: CORE };
2636
- Identifiers.validateIframeAttribute = { name: 'ɵɵvalidateIframeAttribute', moduleName: CORE };
2637
2636
 
2638
2637
  const DASH_CASE_REGEXP = /-+([a-z0-9])/g;
2639
2638
  function dashCaseToCamelCase(input) {
@@ -3493,7 +3492,7 @@ function compileFactoryFunction(meta) {
3493
3492
  // delegated factory (which is used to create the current type) then this is only the type-to-
3494
3493
  // create parameter (t).
3495
3494
  const typeForCtor = !isDelegatedFactoryMetadata(meta) ?
3496
- new BinaryOperatorExpr(exports.BinaryOperator.Or, t, meta.internalType) :
3495
+ new BinaryOperatorExpr(exports.BinaryOperator.Or, t, meta.type.value) :
3497
3496
  t;
3498
3497
  let ctorExpr = null;
3499
3498
  if (meta.deps !== null) {
@@ -3540,7 +3539,7 @@ function compileFactoryFunction(meta) {
3540
3539
  }
3541
3540
  else if (baseFactoryVar !== null) {
3542
3541
  // This factory uses a base factory, so call `ɵɵgetInheritedFactory()` to compute it.
3543
- const getInheritedFactoryCall = importExpr(Identifiers.getInheritedFactory).callFn([meta.internalType]);
3542
+ const getInheritedFactoryCall = importExpr(Identifiers.getInheritedFactory).callFn([meta.type.value]);
3544
3543
  // Memoize the base factoryFn: `baseFactory || (baseFactory = ɵɵgetInheritedFactory(...))`
3545
3544
  const baseFactory = new BinaryOperatorExpr(exports.BinaryOperator.Or, baseFactoryVar, baseFactoryVar.set(getInheritedFactoryCall));
3546
3545
  body.push(new ReturnStatement(baseFactory.callFn([typeForCtor])));
@@ -3907,9 +3906,9 @@ class Message {
3907
3906
  this.meaning = meaning;
3908
3907
  this.description = description;
3909
3908
  this.customId = customId;
3910
- this.id = this.customId;
3911
3909
  /** The ids to use if there are no custom id and if `i18nLegacyMessageIdFormat` is not empty */
3912
3910
  this.legacyIds = [];
3911
+ this.id = this.customId;
3913
3912
  this.messageString = serializeMessage(this.nodes);
3914
3913
  if (nodes.length) {
3915
3914
  this.sources = [{
@@ -3945,11 +3944,12 @@ class Container {
3945
3944
  }
3946
3945
  }
3947
3946
  class Icu {
3948
- constructor(expression, type, cases, sourceSpan) {
3947
+ constructor(expression, type, cases, sourceSpan, expressionPlaceholder) {
3949
3948
  this.expression = expression;
3950
3949
  this.type = type;
3951
3950
  this.cases = cases;
3952
3951
  this.sourceSpan = sourceSpan;
3952
+ this.expressionPlaceholder = expressionPlaceholder;
3953
3953
  }
3954
3954
  visit(visitor, context) {
3955
3955
  return visitor.visitIcu(this, context);
@@ -4005,8 +4005,7 @@ class CloneVisitor {
4005
4005
  visitIcu(icu, context) {
4006
4006
  const cases = {};
4007
4007
  Object.keys(icu.cases).forEach(key => cases[key] = icu.cases[key].visit(this, context));
4008
- const msg = new Icu(icu.expression, icu.type, cases, icu.sourceSpan);
4009
- msg.expressionPlaceholder = icu.expressionPlaceholder;
4008
+ const msg = new Icu(icu.expression, icu.type, cases, icu.sourceSpan, icu.expressionPlaceholder);
4010
4009
  return msg;
4011
4010
  }
4012
4011
  visitTagPlaceholder(ph, context) {
@@ -4620,30 +4619,30 @@ function asLiteral(value) {
4620
4619
  }
4621
4620
  return literal(value, INFERRED_TYPE);
4622
4621
  }
4623
- function conditionallyCreateMapObjectLiteral(keys, keepDeclared) {
4624
- if (Object.getOwnPropertyNames(keys).length > 0) {
4625
- return mapToExpression(keys, keepDeclared);
4622
+ function conditionallyCreateDirectiveBindingLiteral(map, keepDeclared) {
4623
+ const keys = Object.getOwnPropertyNames(map);
4624
+ if (keys.length === 0) {
4625
+ return null;
4626
4626
  }
4627
- return null;
4628
- }
4629
- function mapToExpression(map, keepDeclared) {
4630
- return literalMap(Object.getOwnPropertyNames(map).map(key => {
4631
- // canonical syntax: `dirProp: publicProp`
4627
+ return literalMap(keys.map(key => {
4632
4628
  const value = map[key];
4633
4629
  let declaredName;
4634
4630
  let publicName;
4635
4631
  let minifiedName;
4636
4632
  let needsDeclaredName;
4637
- if (Array.isArray(value)) {
4638
- [publicName, declaredName] = value;
4633
+ if (typeof value === 'string') {
4634
+ // canonical syntax: `dirProp: publicProp`
4635
+ declaredName = key;
4639
4636
  minifiedName = key;
4640
- needsDeclaredName = publicName !== declaredName;
4641
- }
4642
- else {
4643
- minifiedName = declaredName = key;
4644
4637
  publicName = value;
4645
4638
  needsDeclaredName = false;
4646
4639
  }
4640
+ else {
4641
+ minifiedName = key;
4642
+ declaredName = value.classPropertyName;
4643
+ publicName = value.bindingPropertyName;
4644
+ needsDeclaredName = publicName !== declaredName;
4645
+ }
4647
4646
  return {
4648
4647
  key: minifiedName,
4649
4648
  // put quotes around keys that contain potentially unsafe characters
@@ -4725,7 +4724,9 @@ function getAttrsForDirectiveMatching(elOrTpl) {
4725
4724
  }
4726
4725
  });
4727
4726
  elOrTpl.inputs.forEach(i => {
4728
- attributesMap[i.name] = '';
4727
+ if (i.type === 0 /* BindingType.Property */) {
4728
+ attributesMap[i.name] = '';
4729
+ }
4729
4730
  });
4730
4731
  elOrTpl.outputs.forEach(o => {
4731
4732
  attributesMap[o.name] = '';
@@ -4755,13 +4756,13 @@ function getInterpolationArgsLength(interpolation) {
4755
4756
  * Will try to chain instructions as much as possible, if chaining is supported.
4756
4757
  */
4757
4758
  function getInstructionStatements(instructions) {
4758
- var _a;
4759
4759
  const statements = [];
4760
4760
  let pendingExpression = null;
4761
4761
  let pendingExpressionType = null;
4762
4762
  let chainLength = 0;
4763
4763
  for (const current of instructions) {
4764
- const resolvedParams = (_a = (typeof current.paramsOrFn === 'function' ? current.paramsOrFn() : current.paramsOrFn)) !== null && _a !== void 0 ? _a : [];
4764
+ const resolvedParams = (typeof current.paramsOrFn === 'function' ? current.paramsOrFn() : current.paramsOrFn) ??
4765
+ [];
4765
4766
  const params = Array.isArray(resolvedParams) ? resolvedParams : [resolvedParams];
4766
4767
  // If the current instruction is the same as the previous one
4767
4768
  // and it can be chained, add another call to the chain.
@@ -4793,7 +4794,6 @@ function compileInjectable(meta, resolveForwardRefs) {
4793
4794
  const factoryMeta = {
4794
4795
  name: meta.name,
4795
4796
  type: meta.type,
4796
- internalType: meta.internalType,
4797
4797
  typeArgumentCount: meta.typeArgumentCount,
4798
4798
  deps: [],
4799
4799
  target: exports.FactoryTarget.Injectable,
@@ -4805,14 +4805,19 @@ function compileInjectable(meta, resolveForwardRefs) {
4805
4805
  //
4806
4806
  // A special case exists for useClass: Type where Type is the injectable type itself and no
4807
4807
  // deps are specified, in which case 'useClass' is effectively ignored.
4808
- const useClassOnSelf = meta.useClass.expression.isEquivalent(meta.internalType);
4808
+ const useClassOnSelf = meta.useClass.expression.isEquivalent(meta.type.value);
4809
4809
  let deps = undefined;
4810
4810
  if (meta.deps !== undefined) {
4811
4811
  deps = meta.deps;
4812
4812
  }
4813
4813
  if (deps !== undefined) {
4814
4814
  // factory: () => new meta.useClass(...deps)
4815
- result = compileFactoryFunction(Object.assign(Object.assign({}, factoryMeta), { delegate: meta.useClass.expression, delegateDeps: deps, delegateType: R3FactoryDelegateType.Class }));
4815
+ result = compileFactoryFunction({
4816
+ ...factoryMeta,
4817
+ delegate: meta.useClass.expression,
4818
+ delegateDeps: deps,
4819
+ delegateType: R3FactoryDelegateType.Class,
4820
+ });
4816
4821
  }
4817
4822
  else if (useClassOnSelf) {
4818
4823
  result = compileFactoryFunction(factoryMeta);
@@ -4826,7 +4831,12 @@ function compileInjectable(meta, resolveForwardRefs) {
4826
4831
  }
4827
4832
  else if (meta.useFactory !== undefined) {
4828
4833
  if (meta.deps !== undefined) {
4829
- result = compileFactoryFunction(Object.assign(Object.assign({}, factoryMeta), { delegate: meta.useFactory, delegateDeps: meta.deps || [], delegateType: R3FactoryDelegateType.Function }));
4834
+ result = compileFactoryFunction({
4835
+ ...factoryMeta,
4836
+ delegate: meta.useFactory,
4837
+ delegateDeps: meta.deps || [],
4838
+ delegateType: R3FactoryDelegateType.Function,
4839
+ });
4830
4840
  }
4831
4841
  else {
4832
4842
  result = {
@@ -4839,19 +4849,25 @@ function compileInjectable(meta, resolveForwardRefs) {
4839
4849
  // Note: it's safe to use `meta.useValue` instead of the `USE_VALUE in meta` check used for
4840
4850
  // client code because meta.useValue is an Expression which will be defined even if the actual
4841
4851
  // value is undefined.
4842
- result = compileFactoryFunction(Object.assign(Object.assign({}, factoryMeta), { expression: meta.useValue.expression }));
4852
+ result = compileFactoryFunction({
4853
+ ...factoryMeta,
4854
+ expression: meta.useValue.expression,
4855
+ });
4843
4856
  }
4844
4857
  else if (meta.useExisting !== undefined) {
4845
4858
  // useExisting is an `inject` call on the existing token.
4846
- result = compileFactoryFunction(Object.assign(Object.assign({}, factoryMeta), { expression: importExpr(Identifiers.inject).callFn([meta.useExisting.expression]) }));
4859
+ result = compileFactoryFunction({
4860
+ ...factoryMeta,
4861
+ expression: importExpr(Identifiers.inject).callFn([meta.useExisting.expression]),
4862
+ });
4847
4863
  }
4848
4864
  else {
4849
4865
  result = {
4850
4866
  statements: [],
4851
- expression: delegateToFactory(meta.type.value, meta.internalType, resolveForwardRefs)
4867
+ expression: delegateToFactory(meta.type.value, meta.type.value, resolveForwardRefs)
4852
4868
  };
4853
4869
  }
4854
- const token = meta.internalType;
4870
+ const token = meta.type.value;
4855
4871
  const injectableProps = new DefinitionMap();
4856
4872
  injectableProps.set('token', token);
4857
4873
  injectableProps.set('factory', result.expression);
@@ -4870,28 +4886,28 @@ function compileInjectable(meta, resolveForwardRefs) {
4870
4886
  function createInjectableType(meta) {
4871
4887
  return new ExpressionType(importExpr(Identifiers.InjectableDeclaration, [typeWithParameters(meta.type.type, meta.typeArgumentCount)]));
4872
4888
  }
4873
- function delegateToFactory(type, internalType, unwrapForwardRefs) {
4874
- if (type.node === internalType.node) {
4889
+ function delegateToFactory(type, useType, unwrapForwardRefs) {
4890
+ if (type.node === useType.node) {
4875
4891
  // The types are the same, so we can simply delegate directly to the type's factory.
4876
4892
  // ```
4877
4893
  // factory: type.ɵfac
4878
4894
  // ```
4879
- return internalType.prop('ɵfac');
4895
+ return useType.prop('ɵfac');
4880
4896
  }
4881
4897
  if (!unwrapForwardRefs) {
4882
4898
  // The type is not wrapped in a `forwardRef()`, so we create a simple factory function that
4883
4899
  // accepts a sub-type as an argument.
4884
4900
  // ```
4885
- // factory: function(t) { return internalType.ɵfac(t); }
4901
+ // factory: function(t) { return useType.ɵfac(t); }
4886
4902
  // ```
4887
- return createFactoryFunction(internalType);
4903
+ return createFactoryFunction(useType);
4888
4904
  }
4889
- // The internalType is actually wrapped in a `forwardRef()` so we need to resolve that before
4905
+ // The useType is actually wrapped in a `forwardRef()` so we need to resolve that before
4890
4906
  // calling its factory.
4891
4907
  // ```
4892
4908
  // factory: function(t) { return core.resolveForwardRef(type).ɵfac(t); }
4893
4909
  // ```
4894
- const unwrappedType = importExpr(Identifiers.resolveForwardRef).callFn([internalType]);
4910
+ const unwrappedType = importExpr(Identifiers.resolveForwardRef).callFn([useType]);
4895
4911
  return createFactoryFunction(unwrappedType);
4896
4912
  }
4897
4913
  function createFactoryFunction(type) {
@@ -5299,45 +5315,6 @@ class AbstractJsEmitterVisitor extends AbstractEmitterVisitor {
5299
5315
  this.visitAllObjects(param => ctx.print(null, param.name), params, ctx, ',');
5300
5316
  }
5301
5317
  }
5302
-
5303
- /**
5304
- * @fileoverview
5305
- * A module to facilitate use of a Trusted Types policy within the JIT
5306
- * compiler. It lazily constructs the Trusted Types policy, providing helper
5307
- * utilities for promoting strings to Trusted Types. When Trusted Types are not
5308
- * available, strings are used as a fallback.
5309
- * @security All use of this module is security-sensitive and should go through
5310
- * security review.
5311
- */
5312
- /**
5313
- * The Trusted Types policy, or null if Trusted Types are not
5314
- * enabled/supported, or undefined if the policy has not been created yet.
5315
- */
5316
- let policy;
5317
- /**
5318
- * Returns the Trusted Types policy, or null if Trusted Types are not
5319
- * enabled/supported. The first call to this function will create the policy.
5320
- */
5321
- function getPolicy() {
5322
- if (policy === undefined) {
5323
- policy = null;
5324
- if (_global.trustedTypes) {
5325
- try {
5326
- policy =
5327
- _global.trustedTypes.createPolicy('angular#unsafe-jit', {
5328
- createScript: (s) => s,
5329
- });
5330
- }
5331
- catch (_a) {
5332
- // trustedTypes.createPolicy throws if called with a name that is
5333
- // already registered, even in report-only mode. Until the API changes,
5334
- // catch the error not to break the applications functionally. In such
5335
- // cases, the code will fall back to using strings.
5336
- }
5337
- }
5338
- }
5339
- return policy;
5340
- }
5341
5318
  /**
5342
5319
  * Unsafely promote a string to a TrustedScript, falling back to strings when
5343
5320
  * Trusted Types are not available.
@@ -5346,8 +5323,7 @@ function getPolicy() {
5346
5323
  * interpreted and executed as a script by a browser, e.g. when calling eval.
5347
5324
  */
5348
5325
  function trustedScriptFromString(script) {
5349
- var _a;
5350
- return ((_a = getPolicy()) === null || _a === void 0 ? void 0 : _a.createScript(script)) || script;
5326
+ return script;
5351
5327
  }
5352
5328
  /**
5353
5329
  * Unsafely call the Function constructor with the given string arguments.
@@ -5593,10 +5569,10 @@ exports.R3SelectorScopeMode = void 0;
5593
5569
  * Construct an `R3NgModuleDef` for the given `R3NgModuleMetadata`.
5594
5570
  */
5595
5571
  function compileNgModule(meta) {
5596
- const { adjacentType, internalType, bootstrap, declarations, imports, exports: exports$1, schemas, containsForwardDecls, selectorScopeMode, id } = meta;
5572
+ const { type: moduleType, bootstrap, declarations, imports, exports: exports$1, schemas, containsForwardDecls, selectorScopeMode, id } = meta;
5597
5573
  const statements = [];
5598
5574
  const definitionMap = new DefinitionMap();
5599
- definitionMap.set('type', internalType);
5575
+ definitionMap.set('type', moduleType.value);
5600
5576
  if (bootstrap.length > 0) {
5601
5577
  definitionMap.set('bootstrap', refsToArray(bootstrap, containsForwardDecls));
5602
5578
  }
@@ -5631,7 +5607,7 @@ function compileNgModule(meta) {
5631
5607
  definitionMap.set('id', id);
5632
5608
  // Generate a side-effectful call to register this NgModule by its id, as per the semantics of
5633
5609
  // NgModule ids.
5634
- statements.push(importExpr(Identifiers.registerNgModuleType).callFn([adjacentType, id]).toStmt());
5610
+ statements.push(importExpr(Identifiers.registerNgModuleType).callFn([moduleType.value, id]).toStmt());
5635
5611
  }
5636
5612
  const expression = importExpr(Identifiers.defineNgModule).callFn([definitionMap.toLiteralMap()], undefined, true);
5637
5613
  const type = createNgModuleType(meta);
@@ -5680,7 +5656,7 @@ function createNgModuleType({ type: moduleType, declarations, exports, imports,
5680
5656
  * symbols to become tree-shakeable.
5681
5657
  */
5682
5658
  function generateSetNgModuleScopeCall(meta) {
5683
- const { adjacentType: moduleType, declarations, imports, exports, containsForwardDecls } = meta;
5659
+ const { type: moduleType, declarations, imports, exports, containsForwardDecls } = meta;
5684
5660
  const scopeMap = new DefinitionMap();
5685
5661
  if (declarations.length > 0) {
5686
5662
  scopeMap.set('declarations', refsToArray(declarations, containsForwardDecls));
@@ -5697,7 +5673,7 @@ function generateSetNgModuleScopeCall(meta) {
5697
5673
  // setNgModuleScope(...)
5698
5674
  const fnCall = new InvokeFunctionExpr(
5699
5675
  /* fn */ importExpr(Identifiers.setNgModuleScope),
5700
- /* args */ [moduleType, scopeMap.toLiteralMap()]);
5676
+ /* args */ [moduleType.value, scopeMap.toLiteralMap()]);
5701
5677
  // (ngJitMode guard) && setNgModuleScope(...)
5702
5678
  const guardedCall = jitOnlyGuardedExpression(fnCall);
5703
5679
  // function() { (ngJitMode guard) && setNgModuleScope(...); }
@@ -5805,8 +5781,7 @@ class ImplicitReceiver extends AST {
5805
5781
  */
5806
5782
  class ThisReceiver extends ImplicitReceiver {
5807
5783
  visit(visitor, context = null) {
5808
- var _a;
5809
- return (_a = visitor.visitThisReceiver) === null || _a === void 0 ? void 0 : _a.call(visitor, this, context);
5784
+ return visitor.visitThisReceiver?.(this, context);
5810
5785
  }
5811
5786
  }
5812
5787
  /**
@@ -6476,8 +6451,8 @@ class BoundElementProperty {
6476
6451
  }
6477
6452
 
6478
6453
  class EventHandlerVars {
6454
+ static { this.event = variable('$event'); }
6479
6455
  }
6480
- EventHandlerVars.event = variable('$event');
6481
6456
  /**
6482
6457
  * Converts the given expression AST into an executable output AST, assuming the expression is
6483
6458
  * used in an action binding (e.g. an event handler).
@@ -6798,8 +6773,7 @@ class _AstToIrVisitor {
6798
6773
  return convertToStatementIfNeeded(mode, literal(ast.value, type, this.convertSourceSpan(ast.span)));
6799
6774
  }
6800
6775
  _getLocal(name, receiver) {
6801
- var _a;
6802
- if (((_a = this._localResolver.globals) === null || _a === void 0 ? void 0 : _a.has(name)) && receiver instanceof ThisReceiver) {
6776
+ if (this._localResolver.globals?.has(name) && receiver instanceof ThisReceiver) {
6803
6777
  return null;
6804
6778
  }
6805
6779
  return this._localResolver.getLocal(name);
@@ -7547,10 +7521,13 @@ class ShadowCss {
7547
7521
  * @returns the css rule modified with the scoped keyframes name.
7548
7522
  */
7549
7523
  _scopeLocalKeyframeDeclarations(rule, scopeSelector, unscopedKeyframesSet) {
7550
- return Object.assign(Object.assign({}, rule), { selector: rule.selector.replace(/(^@(?:-webkit-)?keyframes(?:\s+))(['"]?)(.+)\2(\s*)$/, (_, start, quote, keyframeName, endSpaces) => {
7524
+ return {
7525
+ ...rule,
7526
+ selector: rule.selector.replace(/(^@(?:-webkit-)?keyframes(?:\s+))(['"]?)(.+)\2(\s*)$/, (_, start, quote, keyframeName, endSpaces) => {
7551
7527
  unscopedKeyframesSet.add(unescapeQuotes(keyframeName, quote));
7552
7528
  return `${start}${quote}${scopeSelector}_${keyframeName}${quote}${endSpaces}`;
7553
- }) });
7529
+ }),
7530
+ };
7554
7531
  }
7555
7532
  /**
7556
7533
  * Function used to scope a keyframes name (obtained from an animation declaration)
@@ -7598,7 +7575,7 @@ class ShadowCss {
7598
7575
  content = content.replace(/((?:^|\s+|;)(?:-webkit-)?animation-name(?:\s*):(?:\s*))([^;]+)/g, (_match, start, commaSeparatedKeyframes) => `${start}${commaSeparatedKeyframes.split(',')
7599
7576
  .map((keyframe) => this._scopeAnimationKeyframe(keyframe, scopeSelector, unscopedKeyframesSet))
7600
7577
  .join(',')}`);
7601
- return Object.assign(Object.assign({}, rule), { content });
7578
+ return { ...rule, content };
7602
7579
  }
7603
7580
  /*
7604
7581
  * Process styles to convert native ShadowDOM rules that will trip
@@ -7729,7 +7706,6 @@ class ShadowCss {
7729
7706
  */
7730
7707
  _convertColonHostContext(cssText) {
7731
7708
  return cssText.replace(_cssColonHostContextReGlobal, selectorText => {
7732
- var _a;
7733
7709
  // We have captured a selector that contains a `:host-context` rule.
7734
7710
  // For backward compatibility `:host-context` may contain a comma separated list of selectors.
7735
7711
  // Each context selector group will contain a list of host-context selectors that must match
@@ -7744,7 +7720,7 @@ class ShadowCss {
7744
7720
  while (match = _cssColonHostContextRe.exec(selectorText)) {
7745
7721
  // `match` = [':host-context(<selectors>)<rest>', <selectors>, <rest>]
7746
7722
  // The `<selectors>` could actually be a comma separated list: `:host-context(.one, .two)`.
7747
- const newContextSelectors = ((_a = match[1]) !== null && _a !== void 0 ? _a : '').trim().split(',').map(m => m.trim()).filter(m => m !== '');
7723
+ const newContextSelectors = (match[1] ?? '').trim().split(',').map(m => m.trim()).filter(m => m !== '');
7748
7724
  // We must duplicate the current selector group for each of these new selectors.
7749
7725
  // For example if the current groups are:
7750
7726
  // ```
@@ -7881,7 +7857,6 @@ class ShadowCss {
7881
7857
  // return a selector with [name] suffix on each simple selector
7882
7858
  // e.g. .foo.bar > .zot becomes .foo[name].bar[name] > .zot[name] /** @internal */
7883
7859
  _applySelectorScope(selector, scopeSelector, hostSelector) {
7884
- var _a;
7885
7860
  const isRe = /\[is=([^\]]*)\]/g;
7886
7861
  scopeSelector = scopeSelector.replace(isRe, (_, ...parts) => parts[0]);
7887
7862
  const attrName = '[' + scopeSelector + ']';
@@ -7932,7 +7907,7 @@ class ShadowCss {
7932
7907
  // (ie: ".\fc ber" for ".über") is not a separator between 2 selectors
7933
7908
  // also keep in mind that backslashes are replaced by a placeholder by SafeSelector
7934
7909
  // These escaped selectors happen for example when esbuild runs with optimization.minify.
7935
- if (part.match(_placeholderRe) && ((_a = selector[res.index + 1]) === null || _a === void 0 ? void 0 : _a.match(/[a-fA-F\d]/))) {
7910
+ if (part.match(_placeholderRe) && selector[res.index + 1]?.match(/[a-fA-F\d]/)) {
7936
7911
  continue;
7937
7912
  }
7938
7913
  shouldScope = shouldScope || part.indexOf(_polyfillHostNoCombinator) > -1;
@@ -8294,6 +8269,470 @@ function repeatGroups(groups, multiples) {
8294
8269
  }
8295
8270
  }
8296
8271
 
8272
+ exports.TagContentType = void 0;
8273
+ (function (TagContentType) {
8274
+ TagContentType[TagContentType["RAW_TEXT"] = 0] = "RAW_TEXT";
8275
+ TagContentType[TagContentType["ESCAPABLE_RAW_TEXT"] = 1] = "ESCAPABLE_RAW_TEXT";
8276
+ TagContentType[TagContentType["PARSABLE_DATA"] = 2] = "PARSABLE_DATA";
8277
+ })(exports.TagContentType || (exports.TagContentType = {}));
8278
+ function splitNsName(elementName) {
8279
+ if (elementName[0] != ':') {
8280
+ return [null, elementName];
8281
+ }
8282
+ const colonIndex = elementName.indexOf(':', 1);
8283
+ if (colonIndex === -1) {
8284
+ throw new Error(`Unsupported format "${elementName}" expecting ":namespace:name"`);
8285
+ }
8286
+ return [elementName.slice(1, colonIndex), elementName.slice(colonIndex + 1)];
8287
+ }
8288
+ // `<ng-container>` tags work the same regardless the namespace
8289
+ function isNgContainer(tagName) {
8290
+ return splitNsName(tagName)[1] === 'ng-container';
8291
+ }
8292
+ // `<ng-content>` tags work the same regardless the namespace
8293
+ function isNgContent(tagName) {
8294
+ return splitNsName(tagName)[1] === 'ng-content';
8295
+ }
8296
+ // `<ng-template>` tags work the same regardless the namespace
8297
+ function isNgTemplate(tagName) {
8298
+ return splitNsName(tagName)[1] === 'ng-template';
8299
+ }
8300
+ function getNsPrefix(fullName) {
8301
+ return fullName === null ? null : splitNsName(fullName)[0];
8302
+ }
8303
+ function mergeNsAndName(prefix, localName) {
8304
+ return prefix ? `:${prefix}:${localName}` : localName;
8305
+ }
8306
+
8307
+ /**
8308
+ * Enumeration of the types of attributes which can be applied to an element.
8309
+ */
8310
+ var ElementAttributeKind;
8311
+ (function (ElementAttributeKind) {
8312
+ /**
8313
+ * Static attributes.
8314
+ */
8315
+ ElementAttributeKind[ElementAttributeKind["Attribute"] = 0] = "Attribute";
8316
+ /**
8317
+ * Class bindings.
8318
+ */
8319
+ ElementAttributeKind[ElementAttributeKind["Class"] = 1] = "Class";
8320
+ /**
8321
+ * Style bindings.
8322
+ */
8323
+ ElementAttributeKind[ElementAttributeKind["Style"] = 2] = "Style";
8324
+ /**
8325
+ * Dynamic property or attribute bindings.
8326
+ */
8327
+ ElementAttributeKind[ElementAttributeKind["Binding"] = 3] = "Binding";
8328
+ /**
8329
+ * Attributes on a template node.
8330
+ */
8331
+ ElementAttributeKind[ElementAttributeKind["Template"] = 4] = "Template";
8332
+ /**
8333
+ * Internationalized attributes.
8334
+ */
8335
+ ElementAttributeKind[ElementAttributeKind["I18n"] = 5] = "I18n";
8336
+ })(ElementAttributeKind || (ElementAttributeKind = {}));
8337
+
8338
+ /**
8339
+ * Distinguishes different kinds of IR operations.
8340
+ *
8341
+ * Includes both creation and update operations.
8342
+ */
8343
+ var OpKind;
8344
+ (function (OpKind) {
8345
+ /**
8346
+ * A special operation type which is used to represent the beginning and end nodes of a linked
8347
+ * list of operations.
8348
+ */
8349
+ OpKind[OpKind["ListEnd"] = 0] = "ListEnd";
8350
+ /**
8351
+ * An operation which wraps an output AST statement.
8352
+ */
8353
+ OpKind[OpKind["Statement"] = 1] = "Statement";
8354
+ /**
8355
+ * An operation which declares and initializes a `SemanticVariable`.
8356
+ */
8357
+ OpKind[OpKind["Variable"] = 2] = "Variable";
8358
+ /**
8359
+ * An operation to begin rendering of an element.
8360
+ */
8361
+ OpKind[OpKind["ElementStart"] = 3] = "ElementStart";
8362
+ /**
8363
+ * An operation to render an element with no children.
8364
+ */
8365
+ OpKind[OpKind["Element"] = 4] = "Element";
8366
+ /**
8367
+ * An operation which declares an embedded view.
8368
+ */
8369
+ OpKind[OpKind["Template"] = 5] = "Template";
8370
+ /**
8371
+ * An operation to end rendering of an element previously started with `ElementStart`.
8372
+ */
8373
+ OpKind[OpKind["ElementEnd"] = 6] = "ElementEnd";
8374
+ /**
8375
+ * An operation to render a text node.
8376
+ */
8377
+ OpKind[OpKind["Text"] = 7] = "Text";
8378
+ /**
8379
+ * An operation declaring an event listener for an element.
8380
+ */
8381
+ OpKind[OpKind["Listener"] = 8] = "Listener";
8382
+ /**
8383
+ * An operation to interpolate text into a text node.
8384
+ */
8385
+ OpKind[OpKind["InterpolateText"] = 9] = "InterpolateText";
8386
+ /**
8387
+ * An operation to bind an expression to a property of an element.
8388
+ */
8389
+ OpKind[OpKind["Property"] = 10] = "Property";
8390
+ /**
8391
+ * An operation to advance the runtime's implicit slot context during the update phase of a view.
8392
+ */
8393
+ OpKind[OpKind["Advance"] = 11] = "Advance";
8394
+ })(OpKind || (OpKind = {}));
8395
+ /**
8396
+ * Distinguishes different kinds of IR expressions.
8397
+ */
8398
+ var ExpressionKind;
8399
+ (function (ExpressionKind) {
8400
+ /**
8401
+ * Read of a variable in a lexical scope.
8402
+ */
8403
+ ExpressionKind[ExpressionKind["LexicalRead"] = 0] = "LexicalRead";
8404
+ /**
8405
+ * A reference to the current view context.
8406
+ */
8407
+ ExpressionKind[ExpressionKind["Context"] = 1] = "Context";
8408
+ /**
8409
+ * Read of a variable declared in a `VariableOp`.
8410
+ */
8411
+ ExpressionKind[ExpressionKind["ReadVariable"] = 2] = "ReadVariable";
8412
+ /**
8413
+ * Runtime operation to navigate to the next view context in the view hierarchy.
8414
+ */
8415
+ ExpressionKind[ExpressionKind["NextContext"] = 3] = "NextContext";
8416
+ /**
8417
+ * Runtime operation to retrieve the value of a local reference.
8418
+ */
8419
+ ExpressionKind[ExpressionKind["Reference"] = 4] = "Reference";
8420
+ /**
8421
+ * Runtime operation to snapshot the current view context.
8422
+ */
8423
+ ExpressionKind[ExpressionKind["GetCurrentView"] = 5] = "GetCurrentView";
8424
+ /**
8425
+ * Runtime operation to restore a snapshotted view.
8426
+ */
8427
+ ExpressionKind[ExpressionKind["RestoreView"] = 6] = "RestoreView";
8428
+ /**
8429
+ * Runtime operation to reset the current view context after `RestoreView`.
8430
+ */
8431
+ ExpressionKind[ExpressionKind["ResetView"] = 7] = "ResetView";
8432
+ })(ExpressionKind || (ExpressionKind = {}));
8433
+ /**
8434
+ * Distinguishes between different kinds of `SemanticVariable`s.
8435
+ */
8436
+ var SemanticVariableKind;
8437
+ (function (SemanticVariableKind) {
8438
+ /**
8439
+ * Represents the context of a particular view.
8440
+ */
8441
+ SemanticVariableKind[SemanticVariableKind["Context"] = 0] = "Context";
8442
+ /**
8443
+ * Represents an identifier declared in the lexical scope of a view.
8444
+ */
8445
+ SemanticVariableKind[SemanticVariableKind["Identifier"] = 1] = "Identifier";
8446
+ /**
8447
+ * Represents a saved state that can be used to restore a view in a listener handler function.
8448
+ */
8449
+ SemanticVariableKind[SemanticVariableKind["SavedView"] = 2] = "SavedView";
8450
+ })(SemanticVariableKind || (SemanticVariableKind = {}));
8451
+ var VisitorContextFlag;
8452
+ (function (VisitorContextFlag) {
8453
+ VisitorContextFlag[VisitorContextFlag["None"] = 0] = "None";
8454
+ VisitorContextFlag[VisitorContextFlag["InChildOperation"] = 1] = "InChildOperation";
8455
+ })(VisitorContextFlag || (VisitorContextFlag = {}));
8456
+
8457
+ /**
8458
+ * A linked list of `Op` nodes of a given subtype.
8459
+ *
8460
+ * @param OpT specific subtype of `Op` nodes which this list contains.
8461
+ */
8462
+ class OpList {
8463
+ static { this.nextListId = 0; }
8464
+ constructor() {
8465
+ /**
8466
+ * Debug ID of this `OpList` instance.
8467
+ */
8468
+ this.debugListId = OpList.nextListId++;
8469
+ // OpList uses static head/tail nodes of a special `ListEnd` type.
8470
+ // This avoids the need for special casing of the first and last list
8471
+ // elements in all list operations.
8472
+ this.head = {
8473
+ kind: OpKind.ListEnd,
8474
+ next: null,
8475
+ prev: null,
8476
+ debugListId: this.debugListId,
8477
+ };
8478
+ this.tail = {
8479
+ kind: OpKind.ListEnd,
8480
+ next: null,
8481
+ prev: null,
8482
+ debugListId: this.debugListId,
8483
+ };
8484
+ // Link `head` and `tail` together at the start (list is empty).
8485
+ this.head.next = this.tail;
8486
+ this.tail.prev = this.head;
8487
+ }
8488
+ /**
8489
+ * Push a new operation to the tail of the list.
8490
+ */
8491
+ push(op) {
8492
+ OpList.assertIsNotEnd(op);
8493
+ OpList.assertIsUnowned(op);
8494
+ op.debugListId = this.debugListId;
8495
+ // The old "previous" node (which might be the head, if the list is empty).
8496
+ const oldLast = this.tail.prev;
8497
+ // Insert `op` following the old last node.
8498
+ op.prev = oldLast;
8499
+ oldLast.next = op;
8500
+ // Connect `op` with the list tail.
8501
+ op.next = this.tail;
8502
+ this.tail.prev = op;
8503
+ }
8504
+ /**
8505
+ * Prepend one or more nodes to the start of the list.
8506
+ */
8507
+ prepend(ops) {
8508
+ if (ops.length === 0) {
8509
+ return;
8510
+ }
8511
+ for (const op of ops) {
8512
+ OpList.assertIsNotEnd(op);
8513
+ OpList.assertIsUnowned(op);
8514
+ op.debugListId = this.debugListId;
8515
+ }
8516
+ const first = this.head.next;
8517
+ let prev = this.head;
8518
+ for (const op of ops) {
8519
+ prev.next = op;
8520
+ op.prev = prev;
8521
+ prev = op;
8522
+ }
8523
+ prev.next = first;
8524
+ first.prev = prev;
8525
+ }
8526
+ /**
8527
+ * `OpList` is iterable via the iteration protocol.
8528
+ *
8529
+ * It's safe to mutate the part of the list that has already been returned by the iterator, up to
8530
+ * and including the last operation returned. Mutations beyond that point _may_ be safe, but may
8531
+ * also corrupt the iteration position and should be avoided.
8532
+ */
8533
+ *[Symbol.iterator]() {
8534
+ let current = this.head.next;
8535
+ while (current !== this.tail) {
8536
+ // Guards against corruption of the iterator state by mutations to the tail of the list during
8537
+ // iteration.
8538
+ OpList.assertIsOwned(current, this.debugListId);
8539
+ const next = current.next;
8540
+ yield current;
8541
+ current = next;
8542
+ }
8543
+ }
8544
+ *reversed() {
8545
+ let current = this.tail.prev;
8546
+ while (current !== this.head) {
8547
+ OpList.assertIsOwned(current, this.debugListId);
8548
+ const prev = current.prev;
8549
+ yield current;
8550
+ current = prev;
8551
+ }
8552
+ }
8553
+ /**
8554
+ * Replace `oldOp` with `newOp` in the list.
8555
+ */
8556
+ static replace(oldOp, newOp) {
8557
+ OpList.assertIsNotEnd(oldOp);
8558
+ OpList.assertIsNotEnd(newOp);
8559
+ OpList.assertIsOwned(oldOp);
8560
+ OpList.assertIsUnowned(newOp);
8561
+ newOp.debugListId = oldOp.debugListId;
8562
+ if (oldOp.prev !== null) {
8563
+ oldOp.prev.next = newOp;
8564
+ newOp.prev = oldOp.prev;
8565
+ }
8566
+ if (oldOp.next !== null) {
8567
+ oldOp.next.prev = newOp;
8568
+ newOp.next = oldOp.next;
8569
+ }
8570
+ oldOp.debugListId = null;
8571
+ oldOp.prev = null;
8572
+ oldOp.next = null;
8573
+ }
8574
+ /**
8575
+ * Replace `oldOp` with some number of new operations in the list (which may include `oldOp`).
8576
+ */
8577
+ static replaceWithMany(oldOp, newOps) {
8578
+ if (newOps.length === 0) {
8579
+ // Replacing with an empty list -> pure removal.
8580
+ OpList.remove(oldOp);
8581
+ return;
8582
+ }
8583
+ OpList.assertIsNotEnd(oldOp);
8584
+ OpList.assertIsOwned(oldOp);
8585
+ const listId = oldOp.debugListId;
8586
+ oldOp.debugListId = null;
8587
+ for (const newOp of newOps) {
8588
+ OpList.assertIsNotEnd(newOp);
8589
+ // `newOp` might be `oldOp`, but at this point it's been marked as unowned.
8590
+ OpList.assertIsUnowned(newOp);
8591
+ }
8592
+ // It should be safe to reuse `oldOp` in the `newOps` list - maybe you want to sandwich an
8593
+ // operation between two new ops.
8594
+ const { prev: oldPrev, next: oldNext } = oldOp;
8595
+ oldOp.prev = null;
8596
+ oldOp.next = null;
8597
+ let prev = oldPrev;
8598
+ for (const newOp of newOps) {
8599
+ this.assertIsUnowned(newOp);
8600
+ newOp.debugListId = listId;
8601
+ prev.next = newOp;
8602
+ newOp.prev = prev;
8603
+ // This _should_ be the case, but set it just in case.
8604
+ newOp.next = null;
8605
+ prev = newOp;
8606
+ }
8607
+ // At the end of iteration, `prev` holds the last node in the list.
8608
+ const first = newOps[0];
8609
+ const last = prev;
8610
+ // Replace `oldOp` with the chain `first` -> `last`.
8611
+ if (oldPrev !== null) {
8612
+ oldPrev.next = first;
8613
+ first.prev = oldOp.prev;
8614
+ }
8615
+ if (oldNext !== null) {
8616
+ oldNext.prev = last;
8617
+ last.next = oldNext;
8618
+ }
8619
+ }
8620
+ /**
8621
+ * Remove the given node from the list which contains it.
8622
+ */
8623
+ static remove(op) {
8624
+ OpList.assertIsNotEnd(op);
8625
+ OpList.assertIsOwned(op);
8626
+ op.prev.next = op.next;
8627
+ op.next.prev = op.prev;
8628
+ // Break any link between the node and this list to safeguard against its usage in future
8629
+ // operations.
8630
+ op.debugListId = null;
8631
+ op.prev = null;
8632
+ op.next = null;
8633
+ }
8634
+ /**
8635
+ * Insert `op` before `before`.
8636
+ */
8637
+ static insertBefore(op, before) {
8638
+ OpList.assertIsNotEnd(before);
8639
+ OpList.assertIsNotEnd(op);
8640
+ OpList.assertIsUnowned(op);
8641
+ OpList.assertIsOwned(before);
8642
+ op.debugListId = before.debugListId;
8643
+ // Just in case.
8644
+ op.prev = null;
8645
+ before.prev.next = op;
8646
+ op.prev = before.prev;
8647
+ op.next = before;
8648
+ before.prev = op;
8649
+ }
8650
+ /**
8651
+ * Asserts that `op` does not currently belong to a list.
8652
+ */
8653
+ static assertIsUnowned(op) {
8654
+ if (op.debugListId !== null) {
8655
+ throw new Error(`AssertionError: illegal operation on owned node: ${OpKind[op.kind]}`);
8656
+ }
8657
+ }
8658
+ /**
8659
+ * Asserts that `op` currently belongs to a list. If `byList` is passed, `op` is asserted to
8660
+ * specifically belong to that list.
8661
+ */
8662
+ static assertIsOwned(op, byList) {
8663
+ if (op.debugListId === null) {
8664
+ throw new Error(`AssertionError: illegal operation on unowned node: ${OpKind[op.kind]}`);
8665
+ }
8666
+ else if (byList !== undefined && op.debugListId !== byList) {
8667
+ throw new Error(`AssertionError: node belongs to the wrong list (expected ${byList}, actual ${op.debugListId})`);
8668
+ }
8669
+ }
8670
+ /**
8671
+ * Asserts that `op` is not a special `ListEnd` node.
8672
+ */
8673
+ static assertIsNotEnd(op) {
8674
+ if (op.kind === OpKind.ListEnd) {
8675
+ throw new Error(`AssertionError: illegal operation on list head or tail`);
8676
+ }
8677
+ }
8678
+ }
8679
+ /**
8680
+ * `InterpolationConfig` for the `textInterpolate` instruction.
8681
+ */
8682
+ ({
8683
+ constant: [
8684
+ Identifiers.textInterpolate,
8685
+ Identifiers.textInterpolate1,
8686
+ Identifiers.textInterpolate2,
8687
+ Identifiers.textInterpolate3,
8688
+ Identifiers.textInterpolate4,
8689
+ Identifiers.textInterpolate5,
8690
+ Identifiers.textInterpolate6,
8691
+ Identifiers.textInterpolate7,
8692
+ Identifiers.textInterpolate8,
8693
+ ],
8694
+ variable: Identifiers.textInterpolateV,
8695
+ });
8696
+ /**
8697
+ * A [fence](https://en.wikipedia.org/wiki/Memory_barrier) flag for an expression which indicates
8698
+ * how that expression can be optimized in relation to other expressions or instructions.
8699
+ *
8700
+ * `Fence`s are a bitfield, so multiple flags may be set on a single expression.
8701
+ */
8702
+ var Fence;
8703
+ (function (Fence) {
8704
+ /**
8705
+ * Empty flag (no fence exists).
8706
+ */
8707
+ Fence[Fence["None"] = 0] = "None";
8708
+ /**
8709
+ * A context read fence, meaning that the expression in question reads from the "current view"
8710
+ * context of the runtime.
8711
+ */
8712
+ Fence[Fence["ViewContextRead"] = 1] = "ViewContextRead";
8713
+ /**
8714
+ * A context write fence, meaning that the expression in question writes to the "current view"
8715
+ * context of the runtime.
8716
+ *
8717
+ * Note that all `ContextWrite` fences are implicitly `ContextRead` fences as operations which
8718
+ * change the view context do so based on the current one.
8719
+ */
8720
+ Fence[Fence["ViewContextWrite"] = 3] = "ViewContextWrite";
8721
+ /**
8722
+ * Indicates that a call is required for its side-effects, even if nothing reads its result.
8723
+ *
8724
+ * This is also true of `ViewContextWrite` operations **if** they are followed by a
8725
+ * `ViewContextRead`.
8726
+ */
8727
+ Fence[Fence["SideEffectful"] = 4] = "SideEffectful";
8728
+ })(Fence || (Fence = {}));
8729
+
8730
+ new Set([
8731
+ Identifiers.elementStart,
8732
+ Identifiers.elementEnd,
8733
+ Identifiers.property,
8734
+ ]);
8735
+
8297
8736
  /**
8298
8737
  * Parses string representation of a style and converts it into object literal.
8299
8738
  *
@@ -9442,7 +9881,6 @@ class Parser$1 {
9442
9881
  * <raw text> <expression> <raw text> ... <raw text> <expression> <raw text>
9443
9882
  */
9444
9883
  splitInterpolation(input, location, interpolatedTokens, interpolationConfig = DEFAULT_INTERPOLATION_CONFIG) {
9445
- var _a;
9446
9884
  const strings = [];
9447
9885
  const expressions = [];
9448
9886
  const offsets = [];
@@ -9481,7 +9919,7 @@ class Parser$1 {
9481
9919
  this._reportError('Blank expressions are not allowed in interpolated strings', input, `at column ${i} in`, location);
9482
9920
  }
9483
9921
  expressions.push({ text, start: fullStart, end: fullEnd });
9484
- const startInOriginalTemplate = (_a = inputToTemplateIndexMap === null || inputToTemplateIndexMap === void 0 ? void 0 : inputToTemplateIndexMap.get(fullStart)) !== null && _a !== void 0 ? _a : fullStart;
9922
+ const startInOriginalTemplate = inputToTemplateIndexMap?.get(fullStart) ?? fullStart;
9485
9923
  const offset = startInOriginalTemplate + interpStart.length;
9486
9924
  offsets.push(offset);
9487
9925
  i = fullEnd;
@@ -10147,8 +10585,7 @@ class _ParseAST {
10147
10585
  parseAccessMember(readReceiver, start, isSafe) {
10148
10586
  const nameStart = this.inputIndex;
10149
10587
  const id = this.withContext(ParseContextFlags.Writable, () => {
10150
- var _a;
10151
- const id = (_a = this.expectIdentifierOrKeyword()) !== null && _a !== void 0 ? _a : '';
10588
+ const id = this.expectIdentifierOrKeyword() ?? '';
10152
10589
  if (id.length === 0) {
10153
10590
  this.error(`Expected identifier for property access`, readReceiver.span.end);
10154
10591
  }
@@ -10654,41 +11091,6 @@ class RecursiveVisitor {
10654
11091
  }
10655
11092
  }
10656
11093
 
10657
- exports.TagContentType = void 0;
10658
- (function (TagContentType) {
10659
- TagContentType[TagContentType["RAW_TEXT"] = 0] = "RAW_TEXT";
10660
- TagContentType[TagContentType["ESCAPABLE_RAW_TEXT"] = 1] = "ESCAPABLE_RAW_TEXT";
10661
- TagContentType[TagContentType["PARSABLE_DATA"] = 2] = "PARSABLE_DATA";
10662
- })(exports.TagContentType || (exports.TagContentType = {}));
10663
- function splitNsName(elementName) {
10664
- if (elementName[0] != ':') {
10665
- return [null, elementName];
10666
- }
10667
- const colonIndex = elementName.indexOf(':', 1);
10668
- if (colonIndex === -1) {
10669
- throw new Error(`Unsupported format "${elementName}" expecting ":namespace:name"`);
10670
- }
10671
- return [elementName.slice(1, colonIndex), elementName.slice(colonIndex + 1)];
10672
- }
10673
- // `<ng-container>` tags work the same regardless the namespace
10674
- function isNgContainer(tagName) {
10675
- return splitNsName(tagName)[1] === 'ng-container';
10676
- }
10677
- // `<ng-content>` tags work the same regardless the namespace
10678
- function isNgContent(tagName) {
10679
- return splitNsName(tagName)[1] === 'ng-content';
10680
- }
10681
- // `<ng-template>` tags work the same regardless the namespace
10682
- function isNgTemplate(tagName) {
10683
- return splitNsName(tagName)[1] === 'ng-template';
10684
- }
10685
- function getNsPrefix(fullName) {
10686
- return fullName === null ? null : splitNsName(fullName)[0];
10687
- }
10688
- function mergeNsAndName(prefix, localName) {
10689
- return prefix ? `:${prefix}:${localName}` : localName;
10690
- }
10691
-
10692
11094
  class ElementSchemaRegistry {
10693
11095
  }
10694
11096
 
@@ -11026,8 +11428,7 @@ class DomElementSchemaRegistry extends ElementSchemaRegistry {
11026
11428
  return ctx ? ctx : SecurityContext.NONE;
11027
11429
  }
11028
11430
  getMappedPropName(propName) {
11029
- var _a;
11030
- return (_a = _ATTR_TO_PROP.get(propName)) !== null && _a !== void 0 ? _a : propName;
11431
+ return _ATTR_TO_PROP.get(propName) ?? propName;
11031
11432
  }
11032
11433
  getDefaultComponentElementName() {
11033
11434
  return 'ng-component';
@@ -11060,11 +11461,10 @@ class DomElementSchemaRegistry extends ElementSchemaRegistry {
11060
11461
  allKnownAttributesOfElement(tagName) {
11061
11462
  const elementProperties = this._schema.get(tagName.toLowerCase()) || this._schema.get('unknown');
11062
11463
  // Convert properties to attributes.
11063
- return Array.from(elementProperties.keys()).map(prop => { var _a; return (_a = _PROP_TO_ATTR.get(prop)) !== null && _a !== void 0 ? _a : prop; });
11464
+ return Array.from(elementProperties.keys()).map(prop => _PROP_TO_ATTR.get(prop) ?? prop);
11064
11465
  }
11065
11466
  allKnownEventsOfElement(tagName) {
11066
- var _a;
11067
- return Array.from((_a = this._eventSchema.get(tagName.toLowerCase())) !== null && _a !== void 0 ? _a : []);
11467
+ return Array.from(this._eventSchema.get(tagName.toLowerCase()) ?? []);
11068
11468
  }
11069
11469
  normalizeAnimationStyleProperty(propName) {
11070
11470
  return dashCaseToCamelCase(propName);
@@ -11136,7 +11536,7 @@ class HtmlTagDefinition {
11136
11536
  this.contentType = contentType;
11137
11537
  this.ignoreFirstLf = ignoreFirstLf;
11138
11538
  this.preventNamespaceInheritance = preventNamespaceInheritance;
11139
- this.canSelfClose = canSelfClose !== null && canSelfClose !== void 0 ? canSelfClose : isVoid;
11539
+ this.canSelfClose = canSelfClose ?? isVoid;
11140
11540
  }
11141
11541
  isClosedByChild(name) {
11142
11542
  return this.isVoid || name.toLowerCase() in this.closedByChildren;
@@ -11144,7 +11544,7 @@ class HtmlTagDefinition {
11144
11544
  getContentType(prefix) {
11145
11545
  if (typeof this.contentType === 'object') {
11146
11546
  const overrideType = prefix === undefined ? undefined : this.contentType[prefix];
11147
- return overrideType !== null && overrideType !== void 0 ? overrideType : this.contentType.default;
11547
+ return overrideType ?? this.contentType.default;
11148
11548
  }
11149
11549
  return this.contentType;
11150
11550
  }
@@ -11154,7 +11554,6 @@ let DEFAULT_TAG_DEFINITION;
11154
11554
  // This implementation does not fully conform to the HTML5 spec.
11155
11555
  let TAG_DEFINITIONS;
11156
11556
  function getHtmlTagDefinition(tagName) {
11157
- var _a, _b;
11158
11557
  if (!TAG_DEFINITIONS) {
11159
11558
  DEFAULT_TAG_DEFINITION = new HtmlTagDefinition({ canSelfClose: true });
11160
11559
  TAG_DEFINITIONS = {
@@ -11228,7 +11627,8 @@ function getHtmlTagDefinition(tagName) {
11228
11627
  }
11229
11628
  // We have to make both a case-sensitive and a case-insensitive lookup, because
11230
11629
  // HTML tag names are case insensitive, whereas some SVG tags are case sensitive.
11231
- return (_b = (_a = TAG_DEFINITIONS[tagName]) !== null && _a !== void 0 ? _a : TAG_DEFINITIONS[tagName.toLowerCase()]) !== null && _b !== void 0 ? _b : DEFAULT_TAG_DEFINITION;
11630
+ return TAG_DEFINITIONS[tagName] ?? TAG_DEFINITIONS[tagName.toLowerCase()] ??
11631
+ DEFAULT_TAG_DEFINITION;
11232
11632
  }
11233
11633
 
11234
11634
  // Mapping between all HTML entity names and their unicode representation.
@@ -13362,8 +13762,9 @@ const NAMED_ENTITIES = {
13362
13762
  'zwj': '\u200D',
13363
13763
  'zwnj': '\u200C'
13364
13764
  };
13365
- // The &ngsp; pseudo-entity is denoting a space. see:
13366
- // https://github.com/dart-lang/angular/blob/0bb611387d29d65b5af7f9d2515ab571fd3fbee4/_tests/test/compiler/preserve_whitespace_test.dart
13765
+ // The &ngsp; pseudo-entity is denoting a space.
13766
+ // 0xE500 is a PUA (Private Use Areas) unicode character
13767
+ // This is inspired by the Angular Dart implementation.
13367
13768
  const NGSP_UNICODE = '\uE500';
13368
13769
  NAMED_ENTITIES['ngsp'] = NGSP_UNICODE;
13369
13770
 
@@ -13524,7 +13925,7 @@ class _Tokenizer {
13524
13925
  const token = {
13525
13926
  type: this._currentTokenType,
13526
13927
  parts,
13527
- sourceSpan: (end !== null && end !== void 0 ? end : this._cursor).getSpan(this._currentTokenStart, this._leadingTriviaCodePoints),
13928
+ sourceSpan: (end ?? this._cursor).getSpan(this._currentTokenStart, this._leadingTriviaCodePoints),
13528
13929
  };
13529
13930
  this.tokens.push(token);
13530
13931
  this._currentTokenStart = null;
@@ -13646,7 +14047,7 @@ class _Tokenizer {
13646
14047
  const charCode = parseInt(strNum, isHex ? 16 : 10);
13647
14048
  this._endToken([String.fromCharCode(charCode), this._cursor.getChars(start)]);
13648
14049
  }
13649
- catch (_a) {
14050
+ catch {
13650
14051
  throw this._createError(_unknownEntityErrorMsg(this._cursor.getChars(start)), this._cursor.getSpan());
13651
14052
  }
13652
14053
  }
@@ -14212,7 +14613,7 @@ class EscapedCharacterCursor extends PlainCharacterCursor {
14212
14613
  constructor(fileOrCursor, range) {
14213
14614
  if (fileOrCursor instanceof EscapedCharacterCursor) {
14214
14615
  super(fileOrCursor);
14215
- this.internalState = Object.assign({}, fileOrCursor.internalState);
14616
+ this.internalState = { ...fileOrCursor.internalState };
14216
14617
  }
14217
14618
  else {
14218
14619
  super(fileOrCursor, range);
@@ -14250,7 +14651,7 @@ class EscapedCharacterCursor extends PlainCharacterCursor {
14250
14651
  if (peek() === $BACKSLASH) {
14251
14652
  // We have hit an escape sequence so we need the internal state to become independent
14252
14653
  // of the external state.
14253
- this.internalState = Object.assign({}, this.state);
14654
+ this.internalState = { ...this.state };
14254
14655
  // Move past the backslash
14255
14656
  this.advanceState(this.internalState);
14256
14657
  // First check for standard control char sequences
@@ -14766,10 +15167,9 @@ function hasPreserveWhitespacesAttr(attrs) {
14766
15167
  return attrs.some((attr) => attr.name === PRESERVE_WS_ATTR_NAME);
14767
15168
  }
14768
15169
  /**
14769
- * Angular Dart introduced &ngsp; as a placeholder for non-removable space, see:
14770
- * https://github.com/dart-lang/angular/blob/0bb611387d29d65b5af7f9d2515ab571fd3fbee4/_tests/test/compiler/preserve_whitespace_test.dart#L25-L32
14771
- * In Angular Dart &ngsp; is converted to the 0xE500 PUA (Private Use Areas) unicode character
14772
- * and later on replaced by a space. We are re-implementing the same idea here.
15170
+ * &ngsp; is a placeholder for non-removable space
15171
+ * &ngsp; is converted to the 0xE500 PUA (Private Use Areas) unicode character
15172
+ * and later on replaced by a space.
14773
15173
  */
14774
15174
  function replaceNgsp(value) {
14775
15175
  // lexer is replacing the &ngsp; pseudo-entity with NGSP_UNICODE
@@ -15612,7 +16012,6 @@ class HtmlAstToIvyAst {
15612
16012
  return { bound, literal };
15613
16013
  }
15614
16014
  parseAttribute(isTemplateElement, attribute, matchableAttributes, parsedProperties, boundEvents, variables, references) {
15615
- var _a;
15616
16015
  const name = normalizeAttributeName(attribute.name);
15617
16016
  const value = attribute.value;
15618
16017
  const srcSpan = attribute.sourceSpan;
@@ -15702,7 +16101,7 @@ class HtmlAstToIvyAst {
15702
16101
  }
15703
16102
  // No explicit binding found.
15704
16103
  const keySpan = createKeySpan(srcSpan, '' /* prefix */, name);
15705
- const hasBinding = this.bindingParser.parsePropertyInterpolation(name, value, srcSpan, attribute.valueSpan, matchableAttributes, parsedProperties, keySpan, (_a = attribute.valueTokens) !== null && _a !== void 0 ? _a : null);
16104
+ const hasBinding = this.bindingParser.parsePropertyInterpolation(name, value, srcSpan, attribute.valueSpan, matchableAttributes, parsedProperties, keySpan, attribute.valueTokens ?? null);
15706
16105
  return hasBinding;
15707
16106
  }
15708
16107
  _visitTextWithInterpolation(value, sourceSpan, interpolatedTokens, i18n) {
@@ -16147,7 +16546,6 @@ class _I18nVisitor {
16147
16546
  return new Message(i18nodes, context.placeholderToContent, context.placeholderToMessage, meaning, description, customId);
16148
16547
  }
16149
16548
  visitElement(el, context) {
16150
- var _a;
16151
16549
  const children = visitAll(this, el.children, context);
16152
16550
  const attrs = {};
16153
16551
  el.attrs.forEach(attr => {
@@ -16165,7 +16563,7 @@ class _I18nVisitor {
16165
16563
  closePhName = context.placeholderRegistry.getCloseTagPlaceholderName(el.name);
16166
16564
  context.placeholderToContent[closePhName] = {
16167
16565
  text: `</${el.name}>`,
16168
- sourceSpan: (_a = el.endSourceSpan) !== null && _a !== void 0 ? _a : el.sourceSpan,
16566
+ sourceSpan: el.endSourceSpan ?? el.sourceSpan,
16169
16567
  };
16170
16568
  }
16171
16569
  const node = new TagPlaceholder(el.name, attrs, startPhName, closePhName, children, isVoid, el.sourceSpan, el.startSourceSpan, el.endSourceSpan);
@@ -16361,12 +16759,11 @@ class I18nMetaVisitor {
16361
16759
  // whether visited nodes contain i18n information
16362
16760
  this.hasI18nMeta = false;
16363
16761
  this._errors = [];
16364
- // i18n message generation factory
16365
- this._createI18nMessage = createI18nMessageFactory(this.interpolationConfig);
16366
16762
  }
16367
16763
  _generateI18nMessage(nodes, meta = '', visitNodeFn) {
16368
16764
  const { meaning, description, customId } = this._parseMetadata(meta);
16369
- const message = this._createI18nMessage(nodes, meaning, description, customId, visitNodeFn);
16765
+ const createI18nMessage = createI18nMessageFactory(this.interpolationConfig);
16766
+ const message = createI18nMessage(nodes, meaning, description, customId, visitNodeFn);
16370
16767
  this._setMessageId(message, meta);
16371
16768
  this._setLegacyIds(message, meta);
16372
16769
  return message;
@@ -16703,11 +17100,10 @@ class LocalizeSerializerVisitor {
16703
17100
  this.pieces.push(new LiteralPiece(serializeIcuNode(icu), icu.sourceSpan));
16704
17101
  }
16705
17102
  visitTagPlaceholder(ph) {
16706
- var _a, _b;
16707
- this.pieces.push(this.createPlaceholderPiece(ph.startName, (_a = ph.startSourceSpan) !== null && _a !== void 0 ? _a : ph.sourceSpan));
17103
+ this.pieces.push(this.createPlaceholderPiece(ph.startName, ph.startSourceSpan ?? ph.sourceSpan));
16708
17104
  if (!ph.isVoid) {
16709
17105
  ph.children.forEach(child => child.visit(this));
16710
- this.pieces.push(this.createPlaceholderPiece(ph.closeName, (_b = ph.endSourceSpan) !== null && _b !== void 0 ? _b : ph.sourceSpan));
17106
+ this.pieces.push(this.createPlaceholderPiece(ph.closeName, ph.endSourceSpan ?? ph.sourceSpan));
16711
17107
  }
16712
17108
  }
16713
17109
  visitPlaceholder(ph) {
@@ -16804,8 +17200,8 @@ function prepareEventListenerParameters(eventAst, handlerName = null, scope = nu
16804
17200
  scope.getOrCreateSharedContextVar(0);
16805
17201
  const bindingStatements = convertActionBinding(scope, implicitReceiverExpr, handler, 'b', eventAst.handlerSpan, implicitReceiverAccesses, EVENT_BINDING_SCOPE_GLOBALS);
16806
17202
  const statements = [];
16807
- const variableDeclarations = scope === null || scope === void 0 ? void 0 : scope.variableDeclarations();
16808
- const restoreViewStatement = scope === null || scope === void 0 ? void 0 : scope.restoreViewStatement();
17203
+ const variableDeclarations = scope?.variableDeclarations();
17204
+ const restoreViewStatement = scope?.restoreViewStatement();
16809
17205
  if (variableDeclarations) {
16810
17206
  // `variableDeclarations` needs to run first, because
16811
17207
  // `restoreViewStatement` depends on the result.
@@ -17237,7 +17633,6 @@ class TemplateDefinitionBuilder {
17237
17633
  }
17238
17634
  }
17239
17635
  visitElement(element) {
17240
- var _a, _b;
17241
17636
  const elementIndex = this.allocateDataSlot();
17242
17637
  const stylingBuilder = new StylingBuilder(null);
17243
17638
  let isNonBindableMode = false;
@@ -17312,7 +17707,7 @@ class TemplateDefinitionBuilder {
17312
17707
  this.creationInstruction(element.startSourceSpan, Identifiers.disableBindings);
17313
17708
  }
17314
17709
  if (boundI18nAttrs.length > 0) {
17315
- this.i18nAttributesInstruction(elementIndex, boundI18nAttrs, (_a = element.startSourceSpan) !== null && _a !== void 0 ? _a : element.sourceSpan);
17710
+ this.i18nAttributesInstruction(elementIndex, boundI18nAttrs, element.startSourceSpan ?? element.sourceSpan);
17316
17711
  }
17317
17712
  // Generate Listeners (outputs)
17318
17713
  if (element.outputs.length > 0) {
@@ -17452,7 +17847,7 @@ class TemplateDefinitionBuilder {
17452
17847
  }
17453
17848
  if (!createSelfClosingInstruction) {
17454
17849
  // Finish element construction mode.
17455
- const span = (_b = element.endSourceSpan) !== null && _b !== void 0 ? _b : element.sourceSpan;
17850
+ const span = element.endSourceSpan ?? element.sourceSpan;
17456
17851
  if (isI18nRootElement) {
17457
17852
  this.i18nEnd(span, createSelfClosingI18nInstruction);
17458
17853
  }
@@ -17463,7 +17858,6 @@ class TemplateDefinitionBuilder {
17463
17858
  }
17464
17859
  }
17465
17860
  visitTemplate(template) {
17466
- var _a;
17467
17861
  const NG_TEMPLATE_TAG_NAME = 'ng-template';
17468
17862
  const templateIndex = this.allocateDataSlot();
17469
17863
  if (this.i18n) {
@@ -17516,7 +17910,7 @@ class TemplateDefinitionBuilder {
17516
17910
  // elements, in case of inline templates, corresponding instructions will be generated in the
17517
17911
  // nested template function.
17518
17912
  if (i18nInputs.length > 0) {
17519
- this.i18nAttributesInstruction(templateIndex, i18nInputs, (_a = template.startSourceSpan) !== null && _a !== void 0 ? _a : template.sourceSpan);
17913
+ this.i18nAttributesInstruction(templateIndex, i18nInputs, template.startSourceSpan ?? template.sourceSpan);
17520
17914
  }
17521
17915
  // Add the input bindings
17522
17916
  if (inputs.length > 0) {
@@ -17577,7 +17971,7 @@ class TemplateDefinitionBuilder {
17577
17971
  // inside ICUs)
17578
17972
  // - all ICU vars (such as `VAR_SELECT` or `VAR_PLURAL`) are replaced with correct values
17579
17973
  const transformFn = (raw) => {
17580
- const params = Object.assign(Object.assign({}, vars), placeholders);
17974
+ const params = { ...vars, ...placeholders };
17581
17975
  const formatted = formatI18nPlaceholderNamesInMap(params, /* useCamelCase */ false);
17582
17976
  return invokeInstruction(null, Identifiers.i18nPostprocess, [raw, mapLiteral(formatted, true)]);
17583
17977
  };
@@ -18335,7 +18729,7 @@ function parseTemplate(template, templateUrl, options = {}) {
18335
18729
  const { interpolationConfig, preserveWhitespaces, enableI18nLegacyMessageIdFormat } = options;
18336
18730
  const bindingParser = makeBindingParser(interpolationConfig);
18337
18731
  const htmlParser = new HtmlParser();
18338
- const parseResult = htmlParser.parse(template, templateUrl, Object.assign(Object.assign({ leadingTriviaChars: LEADING_TRIVIA_CHARS }, options), { tokenizeExpansionForms: true }));
18732
+ const parseResult = htmlParser.parse(template, templateUrl, { leadingTriviaChars: LEADING_TRIVIA_CHARS, ...options, tokenizeExpansionForms: true });
18339
18733
  if (!options.alwaysAttemptHtmlToR3AstConversion && parseResult.errors &&
18340
18734
  parseResult.errors.length > 0) {
18341
18735
  const parsedTemplate = {
@@ -18533,7 +18927,7 @@ function baseDirectiveFields(meta, constantPool, bindingParser) {
18533
18927
  const definitionMap = new DefinitionMap();
18534
18928
  const selectors = parseSelectorToR3Selector(meta.selector);
18535
18929
  // e.g. `type: MyDirective`
18536
- definitionMap.set('type', meta.internalType);
18930
+ definitionMap.set('type', meta.type.value);
18537
18931
  // e.g. `selectors: [['', 'someDir', '']]`
18538
18932
  if (selectors.length > 0) {
18539
18933
  definitionMap.set('selectors', asLiteral(selectors));
@@ -18548,9 +18942,9 @@ function baseDirectiveFields(meta, constantPool, bindingParser) {
18548
18942
  // e.g. `hostBindings: (rf, ctx) => { ... }
18549
18943
  definitionMap.set('hostBindings', createHostBindingsFunction(meta.host, meta.typeSourceSpan, bindingParser, constantPool, meta.selector || '', meta.name, definitionMap));
18550
18944
  // e.g 'inputs: {a: 'a'}`
18551
- definitionMap.set('inputs', conditionallyCreateMapObjectLiteral(meta.inputs, true));
18945
+ definitionMap.set('inputs', conditionallyCreateDirectiveBindingLiteral(meta.inputs, true));
18552
18946
  // e.g 'outputs: {a: 'a'}`
18553
- definitionMap.set('outputs', conditionallyCreateMapObjectLiteral(meta.outputs));
18947
+ definitionMap.set('outputs', conditionallyCreateDirectiveBindingLiteral(meta.outputs));
18554
18948
  if (meta.exportAs !== null) {
18555
18949
  definitionMap.set('exportAs', literalArr(meta.exportAs.map(e => literal(e))));
18556
18950
  }
@@ -18563,7 +18957,6 @@ function baseDirectiveFields(meta, constantPool, bindingParser) {
18563
18957
  * Add features to the definition map.
18564
18958
  */
18565
18959
  function addFeatures(definitionMap, meta) {
18566
- var _a;
18567
18960
  // e.g. `features: [NgOnChangesFeature]`
18568
18961
  const features = [];
18569
18962
  const providers = meta.providers;
@@ -18588,7 +18981,7 @@ function addFeatures(definitionMap, meta) {
18588
18981
  if (meta.hasOwnProperty('template') && meta.isStandalone) {
18589
18982
  features.push(importExpr(Identifiers.StandaloneFeature));
18590
18983
  }
18591
- if ((_a = meta.hostDirectives) === null || _a === void 0 ? void 0 : _a.length) {
18984
+ if (meta.hostDirectives?.length) {
18592
18985
  features.push(importExpr(Identifiers.HostDirectivesFeature).callFn([createHostDirectivesFeatureArg(meta.hostDirectives)]));
18593
18986
  }
18594
18987
  if (features.length) {
@@ -18626,34 +19019,43 @@ function compileComponentFromMetadata(meta, constantPool, bindingParser) {
18626
19019
  const templateTypeName = meta.name;
18627
19020
  const templateName = templateTypeName ? `${templateTypeName}_Template` : null;
18628
19021
  const changeDetection = meta.changeDetection;
18629
- const template = meta.template;
18630
- const templateBuilder = new TemplateDefinitionBuilder(constantPool, BindingScope.createRootScope(), 0, templateTypeName, null, null, templateName, Identifiers.namespaceHTML, meta.relativeContextFilePath, meta.i18nUseExternalIds);
18631
- const templateFunctionExpression = templateBuilder.buildTemplateFunction(template.nodes, []);
18632
- // We need to provide this so that dynamically generated components know what
18633
- // projected content blocks to pass through to the component when it is instantiated.
18634
- const ngContentSelectors = templateBuilder.getNgContentSelectors();
18635
- if (ngContentSelectors) {
18636
- definitionMap.set('ngContentSelectors', ngContentSelectors);
18637
- }
18638
- // e.g. `decls: 2`
18639
- definitionMap.set('decls', literal(templateBuilder.getConstCount()));
18640
- // e.g. `vars: 2`
18641
- definitionMap.set('vars', literal(templateBuilder.getVarCount()));
18642
- // Generate `consts` section of ComponentDef:
18643
- // - either as an array:
18644
- // `consts: [['one', 'two'], ['three', 'four']]`
18645
- // - or as a factory function in case additional statements are present (to support i18n):
18646
- // `consts: function() { var i18n_0; if (ngI18nClosureMode) {...} else {...} return [i18n_0]; }`
18647
- const { constExpressions, prepareStatements } = templateBuilder.getConsts();
18648
- if (constExpressions.length > 0) {
18649
- let constsExpr = literalArr(constExpressions);
18650
- // Prepare statements are present - turn `consts` into a function.
18651
- if (prepareStatements.length > 0) {
18652
- constsExpr = fn([], [...prepareStatements, new ReturnStatement(constsExpr)]);
18653
- }
18654
- definitionMap.set('consts', constsExpr);
18655
- }
18656
- definitionMap.set('template', templateFunctionExpression);
19022
+ // Template compilation is currently conditional as we're in the process of rewriting it.
19023
+ {
19024
+ // This is the main path currently used in compilation, which compiles the template with the
19025
+ // legacy `TemplateDefinitionBuilder`.
19026
+ const template = meta.template;
19027
+ const templateBuilder = new TemplateDefinitionBuilder(constantPool, BindingScope.createRootScope(), 0, templateTypeName, null, null, templateName, Identifiers.namespaceHTML, meta.relativeContextFilePath, meta.i18nUseExternalIds);
19028
+ const templateFunctionExpression = templateBuilder.buildTemplateFunction(template.nodes, []);
19029
+ // We need to provide this so that dynamically generated components know what
19030
+ // projected content blocks to pass through to the component when it is
19031
+ // instantiated.
19032
+ const ngContentSelectors = templateBuilder.getNgContentSelectors();
19033
+ if (ngContentSelectors) {
19034
+ definitionMap.set('ngContentSelectors', ngContentSelectors);
19035
+ }
19036
+ // e.g. `decls: 2`
19037
+ // definitionMap.set('decls', o.literal(tpl.root.decls!));
19038
+ definitionMap.set('decls', literal(templateBuilder.getConstCount()));
19039
+ // e.g. `vars: 2`
19040
+ // definitionMap.set('vars', o.literal(tpl.root.vars!));
19041
+ definitionMap.set('vars', literal(templateBuilder.getVarCount()));
19042
+ // Generate `consts` section of ComponentDef:
19043
+ // - either as an array:
19044
+ // `consts: [['one', 'two'], ['three', 'four']]`
19045
+ // - or as a factory function in case additional statements are present (to support i18n):
19046
+ // `consts: function() { var i18n_0; if (ngI18nClosureMode) {...} else {...} return [i18n_0];
19047
+ // }`
19048
+ const { constExpressions, prepareStatements } = templateBuilder.getConsts();
19049
+ if (constExpressions.length > 0) {
19050
+ let constsExpr = literalArr(constExpressions);
19051
+ // Prepare statements are present - turn `consts` into a function.
19052
+ if (prepareStatements.length > 0) {
19053
+ constsExpr = fn([], [...prepareStatements, new ReturnStatement(constsExpr)]);
19054
+ }
19055
+ definitionMap.set('consts', constsExpr);
19056
+ }
19057
+ definitionMap.set('template', templateFunctionExpression);
19058
+ }
18657
19059
  if (meta.declarations.length > 0) {
18658
19060
  definitionMap.set('dependencies', compileDeclarationList(literalArr(meta.declarations.map(decl => decl.type)), meta.declarationListEmitMode));
18659
19061
  }
@@ -18802,11 +19204,24 @@ function createBaseDirectiveTypeParams(meta) {
18802
19204
  typeWithParameters(meta.type.type, meta.typeArgumentCount),
18803
19205
  selectorForType !== null ? stringAsType(selectorForType) : NONE_TYPE,
18804
19206
  meta.exportAs !== null ? stringArrayAsType(meta.exportAs) : NONE_TYPE,
18805
- expressionType(stringMapAsLiteralExpression(meta.inputs)),
19207
+ expressionType(getInputsTypeExpression(meta)),
18806
19208
  expressionType(stringMapAsLiteralExpression(meta.outputs)),
18807
19209
  stringArrayAsType(meta.queries.map(q => q.propertyName)),
18808
19210
  ];
18809
19211
  }
19212
+ function getInputsTypeExpression(meta) {
19213
+ return literalMap(Object.keys(meta.inputs).map(key => {
19214
+ const value = meta.inputs[key];
19215
+ return {
19216
+ key,
19217
+ value: literalMap([
19218
+ { key: 'alias', value: literal(value.bindingPropertyName), quoted: true },
19219
+ { key: 'required', value: literal(value.required), quoted: true }
19220
+ ]),
19221
+ quoted: true
19222
+ };
19223
+ }));
19224
+ }
18810
19225
  /**
18811
19226
  * Creates the type specification from the directive meta. This type is inserted into .d.ts files
18812
19227
  * to be consumed by upstream compilations.
@@ -19136,8 +19551,7 @@ function compileStyles(styles, selector, hostSelector) {
19136
19551
  });
19137
19552
  }
19138
19553
  function createHostDirectivesType(meta) {
19139
- var _a;
19140
- if (!((_a = meta.hostDirectives) === null || _a === void 0 ? void 0 : _a.length)) {
19554
+ if (!meta.hostDirectives?.length) {
19141
19555
  return NONE_TYPE;
19142
19556
  }
19143
19557
  return expressionType(literalArr(meta.hostDirectives.map(hostMeta => literalMap([
@@ -19220,7 +19634,6 @@ class CompilerFacadeImpl {
19220
19634
  const metadata = {
19221
19635
  name: facade.name,
19222
19636
  type: wrapReference(facade.type),
19223
- internalType: new WrappedNodeExpr(facade.type),
19224
19637
  typeArgumentCount: 0,
19225
19638
  deps: null,
19226
19639
  pipeName: facade.pipeName,
@@ -19236,35 +19649,31 @@ class CompilerFacadeImpl {
19236
19649
  return this.jitExpression(res.expression, angularCoreEnv, sourceMapUrl, []);
19237
19650
  }
19238
19651
  compileInjectable(angularCoreEnv, sourceMapUrl, facade) {
19239
- var _a;
19240
19652
  const { expression, statements } = compileInjectable({
19241
19653
  name: facade.name,
19242
19654
  type: wrapReference(facade.type),
19243
- internalType: new WrappedNodeExpr(facade.type),
19244
19655
  typeArgumentCount: facade.typeArgumentCount,
19245
19656
  providedIn: computeProvidedIn(facade.providedIn),
19246
19657
  useClass: convertToProviderExpression(facade, 'useClass'),
19247
19658
  useFactory: wrapExpression(facade, 'useFactory'),
19248
19659
  useValue: convertToProviderExpression(facade, 'useValue'),
19249
19660
  useExisting: convertToProviderExpression(facade, 'useExisting'),
19250
- deps: (_a = facade.deps) === null || _a === void 0 ? void 0 : _a.map(convertR3DependencyMetadata),
19661
+ deps: facade.deps?.map(convertR3DependencyMetadata),
19251
19662
  },
19252
19663
  /* resolveForwardRefs */ true);
19253
19664
  return this.jitExpression(expression, angularCoreEnv, sourceMapUrl, statements);
19254
19665
  }
19255
19666
  compileInjectableDeclaration(angularCoreEnv, sourceMapUrl, facade) {
19256
- var _a;
19257
19667
  const { expression, statements } = compileInjectable({
19258
19668
  name: facade.type.name,
19259
19669
  type: wrapReference(facade.type),
19260
- internalType: new WrappedNodeExpr(facade.type),
19261
19670
  typeArgumentCount: 0,
19262
19671
  providedIn: computeProvidedIn(facade.providedIn),
19263
19672
  useClass: convertToProviderExpression(facade, 'useClass'),
19264
19673
  useFactory: wrapExpression(facade, 'useFactory'),
19265
19674
  useValue: convertToProviderExpression(facade, 'useValue'),
19266
19675
  useExisting: convertToProviderExpression(facade, 'useExisting'),
19267
- deps: (_a = facade.deps) === null || _a === void 0 ? void 0 : _a.map(convertR3DeclareDependencyMetadata),
19676
+ deps: facade.deps?.map(convertR3DeclareDependencyMetadata),
19268
19677
  },
19269
19678
  /* resolveForwardRefs */ true);
19270
19679
  return this.jitExpression(expression, angularCoreEnv, sourceMapUrl, statements);
@@ -19273,7 +19682,6 @@ class CompilerFacadeImpl {
19273
19682
  const meta = {
19274
19683
  name: facade.name,
19275
19684
  type: wrapReference(facade.type),
19276
- internalType: new WrappedNodeExpr(facade.type),
19277
19685
  providers: facade.providers && facade.providers.length > 0 ?
19278
19686
  new WrappedNodeExpr(facade.providers) :
19279
19687
  null,
@@ -19290,8 +19698,6 @@ class CompilerFacadeImpl {
19290
19698
  compileNgModule(angularCoreEnv, sourceMapUrl, facade) {
19291
19699
  const meta = {
19292
19700
  type: wrapReference(facade.type),
19293
- internalType: new WrappedNodeExpr(facade.type),
19294
- adjacentType: new WrappedNodeExpr(facade.type),
19295
19701
  bootstrap: facade.bootstrap.map(wrapReference),
19296
19702
  declarations: facade.declarations.map(wrapReference),
19297
19703
  publicDeclarationTypes: null,
@@ -19329,8 +19735,23 @@ class CompilerFacadeImpl {
19329
19735
  // Parse the template and check for errors.
19330
19736
  const { template, interpolation } = parseJitTemplate(facade.template, facade.name, sourceMapUrl, facade.preserveWhitespaces, facade.interpolation);
19331
19737
  // Compile the component metadata, including template, into an expression.
19332
- 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) :
19333
- null, relativeContextFilePath: '', i18nUseExternalIds: true });
19738
+ const meta = {
19739
+ ...facade,
19740
+ ...convertDirectiveFacadeToMetadata(facade),
19741
+ selector: facade.selector || this.elementSchemaRegistry.getDefaultComponentElementName(),
19742
+ template,
19743
+ declarations: facade.declarations.map(convertDeclarationFacadeToMetadata),
19744
+ declarationListEmitMode: 0 /* DeclarationListEmitMode.Direct */,
19745
+ styles: [...facade.styles, ...template.styles],
19746
+ encapsulation: facade.encapsulation,
19747
+ interpolation,
19748
+ changeDetection: facade.changeDetection,
19749
+ animations: facade.animations != null ? new WrappedNodeExpr(facade.animations) : null,
19750
+ viewProviders: facade.viewProviders != null ? new WrappedNodeExpr(facade.viewProviders) :
19751
+ null,
19752
+ relativeContextFilePath: '',
19753
+ i18nUseExternalIds: true,
19754
+ };
19334
19755
  const jitExpressionSourceMap = `ng:///${facade.name}.js`;
19335
19756
  return this.compileComponentFromMeta(angularCoreEnv, jitExpressionSourceMap, meta);
19336
19757
  }
@@ -19349,7 +19770,6 @@ class CompilerFacadeImpl {
19349
19770
  const factoryRes = compileFactoryFunction({
19350
19771
  name: meta.name,
19351
19772
  type: wrapReference(meta.type),
19352
- internalType: new WrappedNodeExpr(meta.type),
19353
19773
  typeArgumentCount: meta.typeArgumentCount,
19354
19774
  deps: convertR3DependencyMetadataArray(meta.deps),
19355
19775
  target: meta.target,
@@ -19360,7 +19780,6 @@ class CompilerFacadeImpl {
19360
19780
  const factoryRes = compileFactoryFunction({
19361
19781
  name: meta.type.name,
19362
19782
  type: wrapReference(meta.type),
19363
- internalType: new WrappedNodeExpr(meta.type),
19364
19783
  typeArgumentCount: 0,
19365
19784
  deps: Array.isArray(meta.deps) ? meta.deps.map(convertR3DeclareDependencyMetadata) :
19366
19785
  meta.deps,
@@ -19393,18 +19812,23 @@ class CompilerFacadeImpl {
19393
19812
  }
19394
19813
  }
19395
19814
  function convertToR3QueryMetadata(facade) {
19396
- return Object.assign(Object.assign({}, facade), { predicate: convertQueryPredicate(facade.predicate), read: facade.read ? new WrappedNodeExpr(facade.read) : null, static: facade.static, emitDistinctChangesOnly: facade.emitDistinctChangesOnly });
19815
+ return {
19816
+ ...facade,
19817
+ predicate: convertQueryPredicate(facade.predicate),
19818
+ read: facade.read ? new WrappedNodeExpr(facade.read) : null,
19819
+ static: facade.static,
19820
+ emitDistinctChangesOnly: facade.emitDistinctChangesOnly,
19821
+ };
19397
19822
  }
19398
19823
  function convertQueryDeclarationToMetadata(declaration) {
19399
- var _a, _b, _c, _d;
19400
19824
  return {
19401
19825
  propertyName: declaration.propertyName,
19402
- first: (_a = declaration.first) !== null && _a !== void 0 ? _a : false,
19826
+ first: declaration.first ?? false,
19403
19827
  predicate: convertQueryPredicate(declaration.predicate),
19404
- descendants: (_b = declaration.descendants) !== null && _b !== void 0 ? _b : false,
19828
+ descendants: declaration.descendants ?? false,
19405
19829
  read: declaration.read ? new WrappedNodeExpr(declaration.read) : null,
19406
- static: (_c = declaration.static) !== null && _c !== void 0 ? _c : false,
19407
- emitDistinctChangesOnly: (_d = declaration.emitDistinctChangesOnly) !== null && _d !== void 0 ? _d : true,
19830
+ static: declaration.static ?? false,
19831
+ emitDistinctChangesOnly: declaration.emitDistinctChangesOnly ?? true,
19408
19832
  };
19409
19833
  }
19410
19834
  function convertQueryPredicate(predicate) {
@@ -19415,8 +19839,8 @@ function convertQueryPredicate(predicate) {
19415
19839
  createMayBeForwardRefExpression(new WrappedNodeExpr(predicate), 1 /* ForwardRefHandling.Wrapped */);
19416
19840
  }
19417
19841
  function convertDirectiveFacadeToMetadata(facade) {
19418
- const inputsFromMetadata = parseInputOutputs(facade.inputs || []);
19419
- const outputsFromMetadata = parseInputOutputs(facade.outputs || []);
19842
+ const inputsFromMetadata = parseInputsArray(facade.inputs || []);
19843
+ const outputsFromMetadata = parseMappingStringArray(facade.outputs || []);
19420
19844
  const propMetadata = facade.propMetadata;
19421
19845
  const inputsFromType = {};
19422
19846
  const outputsFromType = {};
@@ -19424,48 +19848,62 @@ function convertDirectiveFacadeToMetadata(facade) {
19424
19848
  if (propMetadata.hasOwnProperty(field)) {
19425
19849
  propMetadata[field].forEach(ann => {
19426
19850
  if (isInput(ann)) {
19427
- inputsFromType[field] =
19428
- ann.bindingPropertyName ? [ann.bindingPropertyName, field] : field;
19851
+ inputsFromType[field] = {
19852
+ bindingPropertyName: ann.alias || field,
19853
+ classPropertyName: field,
19854
+ required: ann.required || false
19855
+ };
19429
19856
  }
19430
19857
  else if (isOutput(ann)) {
19431
- outputsFromType[field] = ann.bindingPropertyName || field;
19858
+ outputsFromType[field] = ann.alias || field;
19432
19859
  }
19433
19860
  });
19434
19861
  }
19435
19862
  }
19436
- return Object.assign(Object.assign({}, facade), { typeArgumentCount: 0, typeSourceSpan: facade.typeSourceSpan, type: wrapReference(facade.type), internalType: new WrappedNodeExpr(facade.type), deps: null, host: extractHostBindings(facade.propMetadata, facade.typeSourceSpan, facade.host), inputs: Object.assign(Object.assign({}, inputsFromMetadata), inputsFromType), outputs: Object.assign(Object.assign({}, outputsFromMetadata), outputsFromType), queries: facade.queries.map(convertToR3QueryMetadata), providers: facade.providers != null ? new WrappedNodeExpr(facade.providers) : null, viewQueries: facade.viewQueries.map(convertToR3QueryMetadata), fullInheritance: false, hostDirectives: convertHostDirectivesToMetadata(facade) });
19863
+ return {
19864
+ ...facade,
19865
+ typeArgumentCount: 0,
19866
+ typeSourceSpan: facade.typeSourceSpan,
19867
+ type: wrapReference(facade.type),
19868
+ deps: null,
19869
+ host: extractHostBindings(facade.propMetadata, facade.typeSourceSpan, facade.host),
19870
+ inputs: { ...inputsFromMetadata, ...inputsFromType },
19871
+ outputs: { ...outputsFromMetadata, ...outputsFromType },
19872
+ queries: facade.queries.map(convertToR3QueryMetadata),
19873
+ providers: facade.providers != null ? new WrappedNodeExpr(facade.providers) : null,
19874
+ viewQueries: facade.viewQueries.map(convertToR3QueryMetadata),
19875
+ fullInheritance: false,
19876
+ hostDirectives: convertHostDirectivesToMetadata(facade),
19877
+ };
19437
19878
  }
19438
19879
  function convertDeclareDirectiveFacadeToMetadata(declaration, typeSourceSpan) {
19439
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
19440
19880
  return {
19441
19881
  name: declaration.type.name,
19442
19882
  type: wrapReference(declaration.type),
19443
19883
  typeSourceSpan,
19444
- internalType: new WrappedNodeExpr(declaration.type),
19445
- selector: (_a = declaration.selector) !== null && _a !== void 0 ? _a : null,
19446
- inputs: (_b = declaration.inputs) !== null && _b !== void 0 ? _b : {},
19447
- outputs: (_c = declaration.outputs) !== null && _c !== void 0 ? _c : {},
19884
+ selector: declaration.selector ?? null,
19885
+ inputs: declaration.inputs ? inputsMappingToInputMetadata(declaration.inputs) : {},
19886
+ outputs: declaration.outputs ?? {},
19448
19887
  host: convertHostDeclarationToMetadata(declaration.host),
19449
- queries: ((_d = declaration.queries) !== null && _d !== void 0 ? _d : []).map(convertQueryDeclarationToMetadata),
19450
- viewQueries: ((_e = declaration.viewQueries) !== null && _e !== void 0 ? _e : []).map(convertQueryDeclarationToMetadata),
19888
+ queries: (declaration.queries ?? []).map(convertQueryDeclarationToMetadata),
19889
+ viewQueries: (declaration.viewQueries ?? []).map(convertQueryDeclarationToMetadata),
19451
19890
  providers: declaration.providers !== undefined ? new WrappedNodeExpr(declaration.providers) :
19452
19891
  null,
19453
- exportAs: (_f = declaration.exportAs) !== null && _f !== void 0 ? _f : null,
19454
- usesInheritance: (_g = declaration.usesInheritance) !== null && _g !== void 0 ? _g : false,
19455
- lifecycle: { usesOnChanges: (_h = declaration.usesOnChanges) !== null && _h !== void 0 ? _h : false },
19892
+ exportAs: declaration.exportAs ?? null,
19893
+ usesInheritance: declaration.usesInheritance ?? false,
19894
+ lifecycle: { usesOnChanges: declaration.usesOnChanges ?? false },
19456
19895
  deps: null,
19457
19896
  typeArgumentCount: 0,
19458
19897
  fullInheritance: false,
19459
- isStandalone: (_j = declaration.isStandalone) !== null && _j !== void 0 ? _j : false,
19898
+ isStandalone: declaration.isStandalone ?? false,
19460
19899
  hostDirectives: convertHostDirectivesToMetadata(declaration),
19461
19900
  };
19462
19901
  }
19463
19902
  function convertHostDeclarationToMetadata(host = {}) {
19464
- var _a, _b, _c;
19465
19903
  return {
19466
- attributes: convertOpaqueValuesToExpressions((_a = host.attributes) !== null && _a !== void 0 ? _a : {}),
19467
- listeners: (_b = host.listeners) !== null && _b !== void 0 ? _b : {},
19468
- properties: (_c = host.properties) !== null && _c !== void 0 ? _c : {},
19904
+ attributes: convertOpaqueValuesToExpressions(host.attributes ?? {}),
19905
+ listeners: host.listeners ?? {},
19906
+ properties: host.properties ?? {},
19469
19907
  specialAttributes: {
19470
19908
  classAttr: host.classAttribute,
19471
19909
  styleAttr: host.styleAttribute,
@@ -19473,8 +19911,7 @@ function convertHostDeclarationToMetadata(host = {}) {
19473
19911
  };
19474
19912
  }
19475
19913
  function convertHostDirectivesToMetadata(metadata) {
19476
- var _a;
19477
- if ((_a = metadata.hostDirectives) === null || _a === void 0 ? void 0 : _a.length) {
19914
+ if (metadata.hostDirectives?.length) {
19478
19915
  return metadata.hostDirectives.map(hostDirective => {
19479
19916
  return typeof hostDirective === 'function' ?
19480
19917
  {
@@ -19486,8 +19923,8 @@ function convertHostDirectivesToMetadata(metadata) {
19486
19923
  {
19487
19924
  directive: wrapReference(hostDirective.directive),
19488
19925
  isForwardReference: false,
19489
- inputs: hostDirective.inputs ? parseInputOutputs(hostDirective.inputs) : null,
19490
- outputs: hostDirective.outputs ? parseInputOutputs(hostDirective.outputs) : null,
19926
+ inputs: hostDirective.inputs ? parseMappingStringArray(hostDirective.inputs) : null,
19927
+ outputs: hostDirective.outputs ? parseMappingStringArray(hostDirective.outputs) : null,
19491
19928
  };
19492
19929
  });
19493
19930
  }
@@ -19501,8 +19938,7 @@ function convertOpaqueValuesToExpressions(obj) {
19501
19938
  return result;
19502
19939
  }
19503
19940
  function convertDeclareComponentFacadeToMetadata(decl, typeSourceSpan, sourceMapUrl) {
19504
- var _a, _b, _c, _d;
19505
- const { template, interpolation } = parseJitTemplate(decl.template, decl.type.name, sourceMapUrl, (_a = decl.preserveWhitespaces) !== null && _a !== void 0 ? _a : false, decl.interpolation);
19941
+ const { template, interpolation } = parseJitTemplate(decl.template, decl.type.name, sourceMapUrl, decl.preserveWhitespaces ?? false, decl.interpolation);
19506
19942
  const declarations = [];
19507
19943
  if (decl.dependencies) {
19508
19944
  for (const innerDep of decl.dependencies) {
@@ -19526,22 +19962,37 @@ function convertDeclareComponentFacadeToMetadata(decl, typeSourceSpan, sourceMap
19526
19962
  declarations.push(...decl.directives.map(dir => convertDirectiveDeclarationToMetadata(dir)));
19527
19963
  decl.pipes && declarations.push(...convertPipeMapToMetadata(decl.pipes));
19528
19964
  }
19529
- 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) :
19530
- null, animations: decl.animations !== undefined ? new WrappedNodeExpr(decl.animations) : null, changeDetection: (_c = decl.changeDetection) !== null && _c !== void 0 ? _c : exports.ChangeDetectionStrategy.Default, encapsulation: (_d = decl.encapsulation) !== null && _d !== void 0 ? _d : exports.ViewEncapsulation.Emulated, interpolation, declarationListEmitMode: 2 /* DeclarationListEmitMode.ClosureResolved */, relativeContextFilePath: '', i18nUseExternalIds: true });
19965
+ return {
19966
+ ...convertDeclareDirectiveFacadeToMetadata(decl, typeSourceSpan),
19967
+ template,
19968
+ styles: decl.styles ?? [],
19969
+ declarations,
19970
+ viewProviders: decl.viewProviders !== undefined ? new WrappedNodeExpr(decl.viewProviders) :
19971
+ null,
19972
+ animations: decl.animations !== undefined ? new WrappedNodeExpr(decl.animations) : null,
19973
+ changeDetection: decl.changeDetection ?? exports.ChangeDetectionStrategy.Default,
19974
+ encapsulation: decl.encapsulation ?? exports.ViewEncapsulation.Emulated,
19975
+ interpolation,
19976
+ declarationListEmitMode: 2 /* DeclarationListEmitMode.ClosureResolved */,
19977
+ relativeContextFilePath: '',
19978
+ i18nUseExternalIds: true,
19979
+ };
19531
19980
  }
19532
19981
  function convertDeclarationFacadeToMetadata(declaration) {
19533
- return Object.assign(Object.assign({}, declaration), { type: new WrappedNodeExpr(declaration.type) });
19982
+ return {
19983
+ ...declaration,
19984
+ type: new WrappedNodeExpr(declaration.type),
19985
+ };
19534
19986
  }
19535
19987
  function convertDirectiveDeclarationToMetadata(declaration, isComponent = null) {
19536
- var _a, _b, _c;
19537
19988
  return {
19538
19989
  kind: exports.R3TemplateDependencyKind.Directive,
19539
19990
  isComponent: isComponent || declaration.kind === 'component',
19540
19991
  selector: declaration.selector,
19541
19992
  type: new WrappedNodeExpr(declaration.type),
19542
- inputs: (_a = declaration.inputs) !== null && _a !== void 0 ? _a : [],
19543
- outputs: (_b = declaration.outputs) !== null && _b !== void 0 ? _b : [],
19544
- exportAs: (_c = declaration.exportAs) !== null && _c !== void 0 ? _c : null,
19993
+ inputs: declaration.inputs ?? [],
19994
+ outputs: declaration.outputs ?? [],
19995
+ exportAs: declaration.exportAs ?? null,
19545
19996
  };
19546
19997
  }
19547
19998
  function convertPipeMapToMetadata(pipes) {
@@ -19599,7 +20050,7 @@ function wrapExpression(obj, property) {
19599
20050
  }
19600
20051
  function computeProvidedIn(providedIn) {
19601
20052
  const expression = typeof providedIn === 'function' ? new WrappedNodeExpr(providedIn) :
19602
- new LiteralExpr(providedIn !== null && providedIn !== void 0 ? providedIn : null);
20053
+ new LiteralExpr(providedIn ?? null);
19603
20054
  // See `convertToProviderExpression()` for why this uses `ForwardRefHandling.None`.
19604
20055
  return createMayBeForwardRefExpression(expression, 0 /* ForwardRefHandling.None */);
19605
20056
  }
@@ -19615,10 +20066,9 @@ function convertR3DependencyMetadata(facade) {
19615
20066
  return createR3DependencyMetadata(token, isAttributeDep, facade.host, facade.optional, facade.self, facade.skipSelf);
19616
20067
  }
19617
20068
  function convertR3DeclareDependencyMetadata(facade) {
19618
- var _a, _b, _c, _d, _e;
19619
- const isAttributeDep = (_a = facade.attribute) !== null && _a !== void 0 ? _a : false;
20069
+ const isAttributeDep = facade.attribute ?? false;
19620
20070
  const token = facade.token === null ? null : new WrappedNodeExpr(facade.token);
19621
- return createR3DependencyMetadata(token, isAttributeDep, (_b = facade.host) !== null && _b !== void 0 ? _b : false, (_c = facade.optional) !== null && _c !== void 0 ? _c : false, (_d = facade.self) !== null && _d !== void 0 ? _d : false, (_e = facade.skipSelf) !== null && _e !== void 0 ? _e : false);
20071
+ return createR3DependencyMetadata(token, isAttributeDep, facade.host ?? false, facade.optional ?? false, facade.self ?? false, facade.skipSelf ?? false);
19622
20072
  }
19623
20073
  function createR3DependencyMetadata(token, isAttributeDep, host, optional, self, skipSelf) {
19624
20074
  // If the dep is an `@Attribute()` the `attributeNameType` ought to be the `unknown` type.
@@ -19666,31 +20116,59 @@ function isInput(value) {
19666
20116
  function isOutput(value) {
19667
20117
  return value.ngMetadataName === 'Output';
19668
20118
  }
19669
- function parseInputOutputs(values) {
20119
+ function inputsMappingToInputMetadata(inputs) {
20120
+ return Object.keys(inputs).reduce((result, key) => {
20121
+ const value = inputs[key];
20122
+ result[key] = typeof value === 'string' ?
20123
+ { bindingPropertyName: value, classPropertyName: value, required: false } :
20124
+ { bindingPropertyName: value[0], classPropertyName: value[1], required: false };
20125
+ return result;
20126
+ }, {});
20127
+ }
20128
+ function parseInputsArray(values) {
20129
+ return values.reduce((results, value) => {
20130
+ if (typeof value === 'string') {
20131
+ const [bindingPropertyName, classPropertyName] = parseMappingString(value);
20132
+ results[classPropertyName] = { bindingPropertyName, classPropertyName, required: false };
20133
+ }
20134
+ else {
20135
+ results[value.name] = {
20136
+ bindingPropertyName: value.alias || value.name,
20137
+ classPropertyName: value.name,
20138
+ required: value.required || false
20139
+ };
20140
+ }
20141
+ return results;
20142
+ }, {});
20143
+ }
20144
+ function parseMappingStringArray(values) {
19670
20145
  return values.reduce((results, value) => {
19671
- const [field, property] = value.split(':', 2).map(str => str.trim());
19672
- results[field] = property || field;
20146
+ const [alias, fieldName] = parseMappingString(value);
20147
+ results[fieldName] = alias;
19673
20148
  return results;
19674
20149
  }, {});
19675
20150
  }
20151
+ function parseMappingString(value) {
20152
+ // Either the value is 'field' or 'field: property'. In the first case, `property` will
20153
+ // be undefined, in which case the field name should also be used as the property name.
20154
+ const [fieldName, bindingPropertyName] = value.split(':', 2).map(str => str.trim());
20155
+ return [bindingPropertyName ?? fieldName, fieldName];
20156
+ }
19676
20157
  function convertDeclarePipeFacadeToMetadata(declaration) {
19677
- var _a, _b;
19678
20158
  return {
19679
20159
  name: declaration.type.name,
19680
20160
  type: wrapReference(declaration.type),
19681
- internalType: new WrappedNodeExpr(declaration.type),
19682
20161
  typeArgumentCount: 0,
19683
20162
  pipeName: declaration.name,
19684
20163
  deps: null,
19685
- pure: (_a = declaration.pure) !== null && _a !== void 0 ? _a : true,
19686
- isStandalone: (_b = declaration.isStandalone) !== null && _b !== void 0 ? _b : false,
20164
+ pure: declaration.pure ?? true,
20165
+ isStandalone: declaration.isStandalone ?? false,
19687
20166
  };
19688
20167
  }
19689
20168
  function convertDeclareInjectorFacadeToMetadata(declaration) {
19690
20169
  return {
19691
20170
  name: declaration.type.name,
19692
20171
  type: wrapReference(declaration.type),
19693
- internalType: new WrappedNodeExpr(declaration.type),
19694
20172
  providers: declaration.providers !== undefined && declaration.providers.length > 0 ?
19695
20173
  new WrappedNodeExpr(declaration.providers) :
19696
20174
  null,
@@ -19709,7 +20187,7 @@ function publishFacade(global) {
19709
20187
  * @description
19710
20188
  * Entry point for all public APIs of the compiler package.
19711
20189
  */
19712
- const VERSION = new Version('15.2.5');
20190
+ const VERSION = new Version('16.0.0-rc.2');
19713
20191
 
19714
20192
  class CompilerConfig {
19715
20193
  constructor({ defaultEncapsulation = exports.ViewEncapsulation.Emulated, useJit = true, missingTranslation = null, preserveWhitespaces, strictInjectionParameters } = {}) {
@@ -20117,6 +20595,7 @@ function _parseMessageMeta(i18n) {
20117
20595
  class XmlTagDefinition {
20118
20596
  constructor() {
20119
20597
  this.closedByParent = false;
20598
+ this.implicitNamespacePrefix = null;
20120
20599
  this.isVoid = false;
20121
20600
  this.ignoreFirstLf = false;
20122
20601
  this.canSelfClose = true;
@@ -20458,6 +20937,9 @@ class Xliff2 extends Serializer {
20458
20937
  }
20459
20938
  }
20460
20939
  class _WriteVisitor {
20940
+ constructor() {
20941
+ this._nextPlaceholderId = 0;
20942
+ }
20461
20943
  visitText(text, context) {
20462
20944
  return [new Text$1(text.value)];
20463
20945
  }
@@ -20887,8 +21369,8 @@ class I18nToHtmlVisitor {
20887
21369
  this._mapperFactory = _mapperFactory;
20888
21370
  this._missingTranslationStrategy = _missingTranslationStrategy;
20889
21371
  this._console = _console;
20890
- this._contextStack = [];
20891
21372
  this._errors = [];
21373
+ this._contextStack = [];
20892
21374
  }
20893
21375
  convert(srcMsg) {
20894
21376
  this._contextStack.length = 0;
@@ -21011,7 +21493,7 @@ class I18NHtmlParser {
21011
21493
  }
21012
21494
  parse(source, url, options = {}) {
21013
21495
  const interpolationConfig = options.interpolationConfig || DEFAULT_INTERPOLATION_CONFIG;
21014
- const parseResult = this._htmlParser.parse(source, url, Object.assign({ interpolationConfig }, options));
21496
+ const parseResult = this._htmlParser.parse(source, url, { interpolationConfig, ...options });
21015
21497
  if (parseResult.errors.length) {
21016
21498
  return new ParseTreeResult(parseResult.rootNodes, parseResult.errors);
21017
21499
  }
@@ -21548,8 +22030,7 @@ class R3BoundTarget {
21548
22030
  this.usedPipes = usedPipes;
21549
22031
  }
21550
22032
  getEntitiesInTemplateScope(template) {
21551
- var _a;
21552
- return (_a = this.templateEntities.get(template)) !== null && _a !== void 0 ? _a : new Set();
22033
+ return this.templateEntities.get(template) ?? new Set();
21553
22034
  }
21554
22035
  getDirectivesOfNode(node) {
21555
22036
  return this.directives.get(node) || null;
@@ -21611,14 +22092,13 @@ function extractTemplateEntities(rootScope) {
21611
22092
  }
21612
22093
 
21613
22094
  function compileClassMetadata(metadata) {
21614
- var _a, _b;
21615
22095
  // Generate an ngDevMode guarded call to setClassMetadata with the class identifier and its
21616
22096
  // metadata.
21617
22097
  const fnCall = importExpr(Identifiers.setClassMetadata).callFn([
21618
22098
  metadata.type,
21619
22099
  metadata.decorators,
21620
- (_a = metadata.ctorParameters) !== null && _a !== void 0 ? _a : literal(null),
21621
- (_b = metadata.propDecorators) !== null && _b !== void 0 ? _b : literal(null),
22100
+ metadata.ctorParameters ?? literal(null),
22101
+ metadata.propDecorators ?? literal(null),
21622
22102
  ]);
21623
22103
  const iife = fn([], [devOnlyGuardedExpression(fnCall).toStmt()]);
21624
22104
  return iife.callFn([]);
@@ -21635,7 +22115,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$6 = '12.0.0';
21635
22115
  function compileDeclareClassMetadata(metadata) {
21636
22116
  const definitionMap = new DefinitionMap();
21637
22117
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$6));
21638
- definitionMap.set('version', literal('15.2.5'));
22118
+ definitionMap.set('version', literal('16.0.0-rc.2'));
21639
22119
  definitionMap.set('ngImport', importExpr(Identifiers.core));
21640
22120
  definitionMap.set('type', metadata.type);
21641
22121
  definitionMap.set('decorators', metadata.decorators);
@@ -21736,12 +22216,11 @@ function compileDeclareDirectiveFromMetadata(meta) {
21736
22216
  * this logic for components, as they extend the directive metadata.
21737
22217
  */
21738
22218
  function createDirectiveDefinitionMap(meta) {
21739
- var _a;
21740
22219
  const definitionMap = new DefinitionMap();
21741
22220
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
21742
- definitionMap.set('version', literal('15.2.5'));
22221
+ definitionMap.set('version', literal('16.0.0-rc.2'));
21743
22222
  // e.g. `type: MyDirective`
21744
- definitionMap.set('type', meta.internalType);
22223
+ definitionMap.set('type', meta.type.value);
21745
22224
  if (meta.isStandalone) {
21746
22225
  definitionMap.set('isStandalone', literal(meta.isStandalone));
21747
22226
  }
@@ -21749,8 +22228,8 @@ function createDirectiveDefinitionMap(meta) {
21749
22228
  if (meta.selector !== null) {
21750
22229
  definitionMap.set('selector', literal(meta.selector));
21751
22230
  }
21752
- definitionMap.set('inputs', conditionallyCreateMapObjectLiteral(meta.inputs, true));
21753
- definitionMap.set('outputs', conditionallyCreateMapObjectLiteral(meta.outputs));
22231
+ definitionMap.set('inputs', conditionallyCreateDirectiveBindingLiteral(meta.inputs, true));
22232
+ definitionMap.set('outputs', conditionallyCreateDirectiveBindingLiteral(meta.outputs));
21754
22233
  definitionMap.set('host', compileHostMetadata(meta.host));
21755
22234
  definitionMap.set('providers', meta.providers);
21756
22235
  if (meta.queries.length > 0) {
@@ -21768,7 +22247,7 @@ function createDirectiveDefinitionMap(meta) {
21768
22247
  if (meta.lifecycle.usesOnChanges) {
21769
22248
  definitionMap.set('usesOnChanges', literal(true));
21770
22249
  }
21771
- if ((_a = meta.hostDirectives) === null || _a === void 0 ? void 0 : _a.length) {
22250
+ if (meta.hostDirectives?.length) {
21772
22251
  definitionMap.set('hostDirectives', createHostDirectives(meta.hostDirectives));
21773
22252
  }
21774
22253
  definitionMap.set('ngImport', importExpr(Identifiers.core));
@@ -21961,9 +22440,9 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
21961
22440
  function compileDeclareFactoryFunction(meta) {
21962
22441
  const definitionMap = new DefinitionMap();
21963
22442
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
21964
- definitionMap.set('version', literal('15.2.5'));
22443
+ definitionMap.set('version', literal('16.0.0-rc.2'));
21965
22444
  definitionMap.set('ngImport', importExpr(Identifiers.core));
21966
- definitionMap.set('type', meta.internalType);
22445
+ definitionMap.set('type', meta.type.value);
21967
22446
  definitionMap.set('deps', compileDependencies(meta.deps));
21968
22447
  definitionMap.set('target', importExpr(Identifiers.FactoryTarget).prop(exports.FactoryTarget[meta.target]));
21969
22448
  return {
@@ -21996,9 +22475,9 @@ function compileDeclareInjectableFromMetadata(meta) {
21996
22475
  function createInjectableDefinitionMap(meta) {
21997
22476
  const definitionMap = new DefinitionMap();
21998
22477
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
21999
- definitionMap.set('version', literal('15.2.5'));
22478
+ definitionMap.set('version', literal('16.0.0-rc.2'));
22000
22479
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22001
- definitionMap.set('type', meta.internalType);
22480
+ definitionMap.set('type', meta.type.value);
22002
22481
  // Only generate providedIn property if it has a non-null value
22003
22482
  if (meta.providedIn !== undefined) {
22004
22483
  const providedIn = convertFromMaybeForwardRefExpression(meta.providedIn);
@@ -22047,9 +22526,9 @@ function compileDeclareInjectorFromMetadata(meta) {
22047
22526
  function createInjectorDefinitionMap(meta) {
22048
22527
  const definitionMap = new DefinitionMap();
22049
22528
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
22050
- definitionMap.set('version', literal('15.2.5'));
22529
+ definitionMap.set('version', literal('16.0.0-rc.2'));
22051
22530
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22052
- definitionMap.set('type', meta.internalType);
22531
+ definitionMap.set('type', meta.type.value);
22053
22532
  definitionMap.set('providers', meta.providers);
22054
22533
  if (meta.imports.length > 0) {
22055
22534
  definitionMap.set('imports', literalArr(meta.imports));
@@ -22077,9 +22556,9 @@ function compileDeclareNgModuleFromMetadata(meta) {
22077
22556
  function createNgModuleDefinitionMap(meta) {
22078
22557
  const definitionMap = new DefinitionMap();
22079
22558
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
22080
- definitionMap.set('version', literal('15.2.5'));
22559
+ definitionMap.set('version', literal('16.0.0-rc.2'));
22081
22560
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22082
- definitionMap.set('type', meta.internalType);
22561
+ definitionMap.set('type', meta.type.value);
22083
22562
  // We only generate the keys in the metadata if the arrays contain values.
22084
22563
  // We must wrap the arrays inside a function if any of the values are a forward reference to a
22085
22564
  // not-yet-declared class. This is to support JIT execution of the `ɵɵngDeclareNgModule()` call.
@@ -22128,10 +22607,10 @@ function compileDeclarePipeFromMetadata(meta) {
22128
22607
  function createPipeDefinitionMap(meta) {
22129
22608
  const definitionMap = new DefinitionMap();
22130
22609
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
22131
- definitionMap.set('version', literal('15.2.5'));
22610
+ definitionMap.set('version', literal('16.0.0-rc.2'));
22132
22611
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22133
22612
  // e.g. `type: MyPipe`
22134
- definitionMap.set('type', meta.internalType);
22613
+ definitionMap.set('type', meta.type.value);
22135
22614
  if (meta.isStandalone) {
22136
22615
  definitionMap.set('isStandalone', literal(meta.isStandalone));
22137
22616
  }