@angular/core 14.1.0-next.3 → 14.1.0-next.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/esm2020/src/application_ref.mjs +1 -1
  2. package/esm2020/src/core.mjs +1 -1
  3. package/esm2020/src/core_render3_private_export.mjs +2 -2
  4. package/esm2020/src/debug/debug_node.mjs +2 -3
  5. package/esm2020/src/di/index.mjs +1 -1
  6. package/esm2020/src/di/injector_compatibility.mjs +11 -1
  7. package/esm2020/src/di/interface/injector.mjs +2 -1
  8. package/esm2020/src/di/r3_injector.mjs +13 -1
  9. package/esm2020/src/errors.mjs +1 -1
  10. package/esm2020/src/linker/component_factory.mjs +1 -1
  11. package/esm2020/src/metadata/di.mjs +1 -1
  12. package/esm2020/src/render/api.mjs +2 -11
  13. package/esm2020/src/render3/component.mjs +3 -58
  14. package/esm2020/src/render3/component_ref.mjs +30 -5
  15. package/esm2020/src/render3/index.mjs +3 -3
  16. package/esm2020/src/render3/instructions/element_validation.mjs +4 -1
  17. package/esm2020/src/render3/instructions/listener.mjs +34 -44
  18. package/esm2020/src/render3/instructions/lview_debug.mjs +1 -1
  19. package/esm2020/src/render3/instructions/shared.mjs +22 -59
  20. package/esm2020/src/render3/instructions/styling.mjs +2 -2
  21. package/esm2020/src/render3/interfaces/renderer.mjs +1 -26
  22. package/esm2020/src/render3/interfaces/view.mjs +1 -1
  23. package/esm2020/src/render3/ng_module_ref.mjs +4 -1
  24. package/esm2020/src/render3/node_manipulation.mjs +24 -87
  25. package/esm2020/src/render3/node_manipulation_i18n.mjs +1 -1
  26. package/esm2020/src/render3/util/attrs_utils.mjs +4 -12
  27. package/esm2020/src/render3/util/view_utils.mjs +3 -6
  28. package/esm2020/src/version.mjs +1 -1
  29. package/esm2020/testing/src/logger.mjs +3 -3
  30. package/esm2020/testing/src/ng_zone_mock.mjs +3 -3
  31. package/fesm2015/core.mjs +1798 -1946
  32. package/fesm2015/core.mjs.map +1 -1
  33. package/fesm2015/testing.mjs +1429 -1669
  34. package/fesm2015/testing.mjs.map +1 -1
  35. package/fesm2020/core.mjs +1798 -1946
  36. package/fesm2020/core.mjs.map +1 -1
  37. package/fesm2020/testing.mjs +1429 -1669
  38. package/fesm2020/testing.mjs.map +1 -1
  39. package/index.d.ts +138 -128
  40. package/package.json +1 -1
  41. package/testing/index.d.ts +1 -1
package/fesm2020/core.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v14.1.0-next.3
2
+ * @license Angular v14.1.0-next.4
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -499,6 +499,7 @@ const NG_INJECTOR_DEF = getClosureSafeProperty({ ngInjectorDef: getClosureSafePr
499
499
  * Injection flags for DI.
500
500
  *
501
501
  * @publicApi
502
+ * @deprecated use an options object for `inject` instead.
502
503
  */
503
504
  var InjectFlags;
504
505
  (function (InjectFlags) {
@@ -1593,96 +1594,6 @@ function getNamespaceUri(namespace) {
1593
1594
  (name === MATH_ML_NAMESPACE ? MATH_ML_NAMESPACE_URI : null);
1594
1595
  }
1595
1596
 
1596
- /**
1597
- * @license
1598
- * Copyright Google LLC All Rights Reserved.
1599
- *
1600
- * Use of this source code is governed by an MIT-style license that can be
1601
- * found in the LICENSE file at https://angular.io/license
1602
- */
1603
- /**
1604
- * Most of the use of `document` in Angular is from within the DI system so it is possible to simply
1605
- * inject the `DOCUMENT` token and are done.
1606
- *
1607
- * Ivy is special because it does not rely upon the DI and must get hold of the document some other
1608
- * way.
1609
- *
1610
- * The solution is to define `getDocument()` and `setDocument()` top-level functions for ivy.
1611
- * Wherever ivy needs the global document, it calls `getDocument()` instead.
1612
- *
1613
- * When running ivy outside of a browser environment, it is necessary to call `setDocument()` to
1614
- * tell ivy what the global `document` is.
1615
- *
1616
- * Angular does this for us in each of the standard platforms (`Browser`, `Server`, and `WebWorker`)
1617
- * by calling `setDocument()` when providing the `DOCUMENT` token.
1618
- */
1619
- let DOCUMENT = undefined;
1620
- /**
1621
- * Tell ivy what the `document` is for this platform.
1622
- *
1623
- * It is only necessary to call this if the current platform is not a browser.
1624
- *
1625
- * @param document The object representing the global `document` in this environment.
1626
- */
1627
- function setDocument(document) {
1628
- DOCUMENT = document;
1629
- }
1630
- /**
1631
- * Access the object that represents the `document` for this platform.
1632
- *
1633
- * Ivy calls this whenever it needs to access the `document` object.
1634
- * For example to create the renderer or to do sanitization.
1635
- */
1636
- function getDocument() {
1637
- if (DOCUMENT !== undefined) {
1638
- return DOCUMENT;
1639
- }
1640
- else if (typeof document !== 'undefined') {
1641
- return document;
1642
- }
1643
- // No "document" can be found. This should only happen if we are running ivy outside Angular and
1644
- // the current platform is not a browser. Since this is not a supported scenario at the moment
1645
- // this should not happen in Angular apps.
1646
- // Once we support running ivy outside of Angular we will need to publish `setDocument()` as a
1647
- // public API. Meanwhile we just return `undefined` and let the application fail.
1648
- return undefined;
1649
- }
1650
-
1651
- /**
1652
- * @license
1653
- * Copyright Google LLC All Rights Reserved.
1654
- *
1655
- * Use of this source code is governed by an MIT-style license that can be
1656
- * found in the LICENSE file at https://angular.io/license
1657
- */
1658
- // TODO: cleanup once the code is merged in angular/angular
1659
- var RendererStyleFlags3;
1660
- (function (RendererStyleFlags3) {
1661
- RendererStyleFlags3[RendererStyleFlags3["Important"] = 1] = "Important";
1662
- RendererStyleFlags3[RendererStyleFlags3["DashCase"] = 2] = "DashCase";
1663
- })(RendererStyleFlags3 || (RendererStyleFlags3 = {}));
1664
- /** Returns whether the `renderer` is a `ProceduralRenderer3` */
1665
- function isProceduralRenderer(renderer) {
1666
- return !!(renderer.listen);
1667
- }
1668
- let renderer3Enabled = false;
1669
- function enableRenderer3() {
1670
- renderer3Enabled = true;
1671
- }
1672
- const domRendererFactory3 = {
1673
- createRenderer: (hostElement, rendererType) => {
1674
- if (!renderer3Enabled) {
1675
- throw new Error(ngDevMode ?
1676
- `Renderer3 is not supported. This problem is likely caused by some component in the hierarchy was constructed without a correct parent injector.` :
1677
- 'Renderer3 disabled');
1678
- }
1679
- return getDocument();
1680
- }
1681
- };
1682
- // Note: This hack is necessary so we don't erroneously get a circular dependency
1683
- // failure based on types.
1684
- const unusedValueExportToPlacateAjd$6 = 1;
1685
-
1686
1597
  /**
1687
1598
  * @license
1688
1599
  * Copyright Google LLC All Rights Reserved.
@@ -1765,7 +1676,6 @@ function getNativeByTNode(tNode, lView) {
1765
1676
  ngDevMode && assertTNodeForLView(tNode, lView);
1766
1677
  ngDevMode && assertIndexInRange(lView, tNode.index);
1767
1678
  const node = unwrapRNode(lView[tNode.index]);
1768
- ngDevMode && !isProceduralRenderer(lView[RENDERER]) && assertDomNode(node);
1769
1679
  return node;
1770
1680
  }
1771
1681
  /**
@@ -1781,7 +1691,6 @@ function getNativeByTNodeOrNull(tNode, lView) {
1781
1691
  if (index !== -1) {
1782
1692
  ngDevMode && assertTNodeForLView(tNode, lView);
1783
1693
  const node = unwrapRNode(lView[index]);
1784
- ngDevMode && node !== null && !isProceduralRenderer(lView[RENDERER]) && assertDomNode(node);
1785
1694
  return node;
1786
1695
  }
1787
1696
  return null;
@@ -2730,7 +2639,7 @@ function isFactory(obj) {
2730
2639
  }
2731
2640
  // Note: This hack is necessary so we don't erroneously get a circular dependency
2732
2641
  // failure based on types.
2733
- const unusedValueExportToPlacateAjd$5 = 1;
2642
+ const unusedValueExportToPlacateAjd$6 = 1;
2734
2643
 
2735
2644
  /**
2736
2645
  * Converts `TNodeType` into human readable text.
@@ -2749,7 +2658,7 @@ function toTNodeTypeAsString(tNodeType) {
2749
2658
  }
2750
2659
  // Note: This hack is necessary so we don't erroneously get a circular dependency
2751
2660
  // failure based on types.
2752
- const unusedValueExportToPlacateAjd$4 = 1;
2661
+ const unusedValueExportToPlacateAjd$5 = 1;
2753
2662
  /**
2754
2663
  * Returns `true` if the `TNode` has a directive which has `@Input()` for `class` binding.
2755
2664
  *
@@ -2853,7 +2762,6 @@ function assertPureTNodeType(type) {
2853
2762
  * @returns the index value that was last accessed in the attributes array
2854
2763
  */
2855
2764
  function setUpAttributes(renderer, native, attrs) {
2856
- const isProc = isProceduralRenderer(renderer);
2857
2765
  let i = 0;
2858
2766
  while (i < attrs.length) {
2859
2767
  const value = attrs[i];
@@ -2870,9 +2778,7 @@ function setUpAttributes(renderer, native, attrs) {
2870
2778
  const attrName = attrs[i++];
2871
2779
  const attrVal = attrs[i++];
2872
2780
  ngDevMode && ngDevMode.rendererSetAttribute++;
2873
- isProc ?
2874
- renderer.setAttribute(native, attrName, attrVal, namespaceURI) :
2875
- native.setAttributeNS(namespaceURI, attrName, attrVal);
2781
+ renderer.setAttribute(native, attrName, attrVal, namespaceURI);
2876
2782
  }
2877
2783
  else {
2878
2784
  // attrName is string;
@@ -2881,14 +2787,10 @@ function setUpAttributes(renderer, native, attrs) {
2881
2787
  // Standard attributes
2882
2788
  ngDevMode && ngDevMode.rendererSetAttribute++;
2883
2789
  if (isAnimationProp(attrName)) {
2884
- if (isProc) {
2885
- renderer.setProperty(native, attrName, attrVal);
2886
- }
2790
+ renderer.setProperty(native, attrName, attrVal);
2887
2791
  }
2888
2792
  else {
2889
- isProc ?
2890
- renderer.setAttribute(native, attrName, attrVal) :
2891
- native.setAttribute(attrName, attrVal);
2793
+ renderer.setAttribute(native, attrName, attrVal);
2892
2794
  }
2893
2795
  i++;
2894
2796
  }
@@ -4961,6 +4863,16 @@ Please check that 1) the type for the parameter at index ${index} is correct and
4961
4863
  * @publicApi
4962
4864
  */
4963
4865
  function inject(token, flags = InjectFlags.Default) {
4866
+ if (typeof flags !== 'number') {
4867
+ // While TypeScript doesn't accept it without a cast, bitwise OR with false-y values in
4868
+ // JavaScript is a no-op. We can use that for a very codesize-efficient conversion from
4869
+ // `InjectOptions` to `InjectFlags`.
4870
+ flags = (0 /* InternalInjectFlags.Default */ | // comment to force a line break in the formatter
4871
+ (flags.optional && 8 /* InternalInjectFlags.Optional */) |
4872
+ (flags.host && 1 /* InternalInjectFlags.Host */) |
4873
+ (flags.self && 2 /* InternalInjectFlags.Self */) |
4874
+ (flags.skipSelf && 4 /* InternalInjectFlags.SkipSelf */));
4875
+ }
4964
4876
  return ɵɵinject(token, flags);
4965
4877
  }
4966
4878
  function injectArgs(types) {
@@ -5344,6 +5256,61 @@ function setAllowDuplicateNgModuleIdsForTest(allowDuplicates) {
5344
5256
  checkForDuplicateNgModules = !allowDuplicates;
5345
5257
  }
5346
5258
 
5259
+ /**
5260
+ * @license
5261
+ * Copyright Google LLC All Rights Reserved.
5262
+ *
5263
+ * Use of this source code is governed by an MIT-style license that can be
5264
+ * found in the LICENSE file at https://angular.io/license
5265
+ */
5266
+ /**
5267
+ * Most of the use of `document` in Angular is from within the DI system so it is possible to simply
5268
+ * inject the `DOCUMENT` token and are done.
5269
+ *
5270
+ * Ivy is special because it does not rely upon the DI and must get hold of the document some other
5271
+ * way.
5272
+ *
5273
+ * The solution is to define `getDocument()` and `setDocument()` top-level functions for ivy.
5274
+ * Wherever ivy needs the global document, it calls `getDocument()` instead.
5275
+ *
5276
+ * When running ivy outside of a browser environment, it is necessary to call `setDocument()` to
5277
+ * tell ivy what the global `document` is.
5278
+ *
5279
+ * Angular does this for us in each of the standard platforms (`Browser`, `Server`, and `WebWorker`)
5280
+ * by calling `setDocument()` when providing the `DOCUMENT` token.
5281
+ */
5282
+ let DOCUMENT = undefined;
5283
+ /**
5284
+ * Tell ivy what the `document` is for this platform.
5285
+ *
5286
+ * It is only necessary to call this if the current platform is not a browser.
5287
+ *
5288
+ * @param document The object representing the global `document` in this environment.
5289
+ */
5290
+ function setDocument(document) {
5291
+ DOCUMENT = document;
5292
+ }
5293
+ /**
5294
+ * Access the object that represents the `document` for this platform.
5295
+ *
5296
+ * Ivy calls this whenever it needs to access the `document` object.
5297
+ * For example to create the renderer or to do sanitization.
5298
+ */
5299
+ function getDocument() {
5300
+ if (DOCUMENT !== undefined) {
5301
+ return DOCUMENT;
5302
+ }
5303
+ else if (typeof document !== 'undefined') {
5304
+ return document;
5305
+ }
5306
+ // No "document" can be found. This should only happen if we are running ivy outside Angular and
5307
+ // the current platform is not a browser. Since this is not a supported scenario at the moment
5308
+ // this should not happen in Angular apps.
5309
+ // Once we support running ivy outside of Angular we will need to publish `setDocument()` as a
5310
+ // public API. Meanwhile we just return `undefined` and let the application fail.
5311
+ return undefined;
5312
+ }
5313
+
5347
5314
  /**
5348
5315
  * @license
5349
5316
  * Copyright Google LLC All Rights Reserved.
@@ -7073,6 +7040,17 @@ function ensureIcuContainerVisitorLoaded(loader) {
7073
7040
  }
7074
7041
  }
7075
7042
 
7043
+ /**
7044
+ * @license
7045
+ * Copyright Google LLC All Rights Reserved.
7046
+ *
7047
+ * Use of this source code is governed by an MIT-style license that can be
7048
+ * found in the LICENSE file at https://angular.io/license
7049
+ */
7050
+ // Note: This hack is necessary so we don't erroneously get a circular dependency
7051
+ // failure based on types.
7052
+ const unusedValueExportToPlacateAjd$4 = 1;
7053
+
7076
7054
  /**
7077
7055
  * @license
7078
7056
  * Copyright Google LLC All Rights Reserved.
@@ -7155,7 +7133,7 @@ function getNearestLContainer(viewOrContainer) {
7155
7133
  * Use of this source code is governed by an MIT-style license that can be
7156
7134
  * found in the LICENSE file at https://angular.io/license
7157
7135
  */
7158
- const unusedValueToPlacateAjd$2 = unusedValueExportToPlacateAjd$7 + unusedValueExportToPlacateAjd$4 + unusedValueExportToPlacateAjd$3 + unusedValueExportToPlacateAjd$6 + unusedValueExportToPlacateAjd$8;
7136
+ const unusedValueToPlacateAjd$2 = unusedValueExportToPlacateAjd$7 + unusedValueExportToPlacateAjd$5 + unusedValueExportToPlacateAjd$4 + unusedValueExportToPlacateAjd$3 + unusedValueExportToPlacateAjd$8;
7159
7137
  /**
7160
7138
  * NOTE: for performance reasons, the possible actions are inlined within the function instead of
7161
7139
  * being passed as an argument.
@@ -7180,7 +7158,6 @@ function applyToElementOrContainer(action, renderer, parent, lNodeToHandle, befo
7180
7158
  lNodeToHandle = lNodeToHandle[HOST];
7181
7159
  }
7182
7160
  const rNode = unwrapRNode(lNodeToHandle);
7183
- ngDevMode && !isProceduralRenderer(renderer) && assertDomNode(rNode);
7184
7161
  if (action === 0 /* WalkTNodeTreeAction.Create */ && parent !== null) {
7185
7162
  if (beforeNode == null) {
7186
7163
  nativeAppendChild(renderer, parent, rNode);
@@ -7207,17 +7184,14 @@ function applyToElementOrContainer(action, renderer, parent, lNodeToHandle, befo
7207
7184
  function createTextNode(renderer, value) {
7208
7185
  ngDevMode && ngDevMode.rendererCreateTextNode++;
7209
7186
  ngDevMode && ngDevMode.rendererSetText++;
7210
- return isProceduralRenderer(renderer) ? renderer.createText(value) :
7211
- renderer.createTextNode(value);
7187
+ return renderer.createText(value);
7212
7188
  }
7213
7189
  function updateTextNode(renderer, rNode, value) {
7214
7190
  ngDevMode && ngDevMode.rendererSetText++;
7215
- isProceduralRenderer(renderer) ? renderer.setValue(rNode, value) : rNode.textContent = value;
7191
+ renderer.setValue(rNode, value);
7216
7192
  }
7217
7193
  function createCommentNode(renderer, value) {
7218
7194
  ngDevMode && ngDevMode.rendererCreateComment++;
7219
- // isProceduralRenderer check is not needed because both `Renderer2` and `Renderer3` have the same
7220
- // method name.
7221
7195
  return renderer.createComment(escapeCommentText(value));
7222
7196
  }
7223
7197
  /**
@@ -7229,14 +7203,7 @@ function createCommentNode(renderer, value) {
7229
7203
  */
7230
7204
  function createElementNode(renderer, name, namespace) {
7231
7205
  ngDevMode && ngDevMode.rendererCreateElement++;
7232
- if (isProceduralRenderer(renderer)) {
7233
- return renderer.createElement(name, namespace);
7234
- }
7235
- else {
7236
- const namespaceUri = namespace !== null ? getNamespaceUri(namespace) : null;
7237
- return namespaceUri === null ? renderer.createElement(name) :
7238
- renderer.createElementNS(namespaceUri, name);
7239
- }
7206
+ return renderer.createElement(name, namespace);
7240
7207
  }
7241
7208
  /**
7242
7209
  * Removes all DOM elements associated with a view.
@@ -7468,7 +7435,7 @@ function detachView(lContainer, removeIndex) {
7468
7435
  function destroyLView(tView, lView) {
7469
7436
  if (!(lView[FLAGS] & 128 /* LViewFlags.Destroyed */)) {
7470
7437
  const renderer = lView[RENDERER];
7471
- if (isProceduralRenderer(renderer) && renderer.destroyNode) {
7438
+ if (renderer.destroyNode) {
7472
7439
  applyView(tView, lView, renderer, 3 /* WalkTNodeTreeAction.Destroy */, null, null);
7473
7440
  }
7474
7441
  destroyViewTree(lView);
@@ -7496,7 +7463,7 @@ function cleanUpView(tView, lView) {
7496
7463
  executeOnDestroys(tView, lView);
7497
7464
  processCleanups(tView, lView);
7498
7465
  // For component views only, the local renderer is destroyed at clean up time.
7499
- if (lView[TVIEW].type === 1 /* TViewType.Component */ && isProceduralRenderer(lView[RENDERER])) {
7466
+ if (lView[TVIEW].type === 1 /* TViewType.Component */) {
7500
7467
  ngDevMode && ngDevMode.rendererDestroy++;
7501
7468
  lView[RENDERER].destroy();
7502
7469
  }
@@ -7672,30 +7639,17 @@ function getClosestRElement(tView, tNode, lView) {
7672
7639
  }
7673
7640
  }
7674
7641
  /**
7675
- * Inserts a native node before another native node for a given parent using {@link Renderer3}.
7676
- * This is a utility function that can be used when native nodes were determined - it abstracts an
7677
- * actual renderer being used.
7642
+ * Inserts a native node before another native node for a given parent.
7643
+ * This is a utility function that can be used when native nodes were determined.
7678
7644
  */
7679
7645
  function nativeInsertBefore(renderer, parent, child, beforeNode, isMove) {
7680
7646
  ngDevMode && ngDevMode.rendererInsertBefore++;
7681
- if (isProceduralRenderer(renderer)) {
7682
- renderer.insertBefore(parent, child, beforeNode, isMove);
7683
- }
7684
- else {
7685
- const targetParent = isTemplateNode(parent) ? parent.content : parent;
7686
- targetParent.insertBefore(child, beforeNode, isMove);
7687
- }
7647
+ renderer.insertBefore(parent, child, beforeNode, isMove);
7688
7648
  }
7689
7649
  function nativeAppendChild(renderer, parent, child) {
7690
7650
  ngDevMode && ngDevMode.rendererAppendChild++;
7691
7651
  ngDevMode && assertDefined(parent, 'parent node must be defined');
7692
- if (isProceduralRenderer(renderer)) {
7693
- renderer.appendChild(parent, child);
7694
- }
7695
- else {
7696
- const targetParent = isTemplateNode(parent) ? parent.content : parent;
7697
- targetParent.appendChild(child);
7698
- }
7652
+ renderer.appendChild(parent, child);
7699
7653
  }
7700
7654
  function nativeAppendOrInsertBefore(renderer, parent, child, beforeNode, isMove) {
7701
7655
  if (beforeNode !== null) {
@@ -7707,12 +7661,7 @@ function nativeAppendOrInsertBefore(renderer, parent, child, beforeNode, isMove)
7707
7661
  }
7708
7662
  /** Removes a node from the DOM given its native parent. */
7709
7663
  function nativeRemoveChild(renderer, parent, child, isHostElement) {
7710
- if (isProceduralRenderer(renderer)) {
7711
- renderer.removeChild(parent, child, isHostElement);
7712
- }
7713
- else {
7714
- parent.removeChild(child);
7715
- }
7664
+ renderer.removeChild(parent, child, isHostElement);
7716
7665
  }
7717
7666
  /** Checks if an element is a `<template>` node. */
7718
7667
  function isTemplateNode(node) {
@@ -7722,13 +7671,13 @@ function isTemplateNode(node) {
7722
7671
  * Returns a native parent of a given native node.
7723
7672
  */
7724
7673
  function nativeParentNode(renderer, node) {
7725
- return (isProceduralRenderer(renderer) ? renderer.parentNode(node) : node.parentNode);
7674
+ return renderer.parentNode(node);
7726
7675
  }
7727
7676
  /**
7728
7677
  * Returns a native sibling of a given native node.
7729
7678
  */
7730
7679
  function nativeNextSibling(renderer, node) {
7731
- return isProceduralRenderer(renderer) ? renderer.nextSibling(node) : node.nextSibling;
7680
+ return renderer.nextSibling(node);
7732
7681
  }
7733
7682
  /**
7734
7683
  * Find a node in front of which `currentTNode` should be inserted.
@@ -8037,39 +7986,22 @@ function applyContainer(renderer, action, lContainer, parentRElement, beforeNode
8037
7986
  * otherwise).
8038
7987
  */
8039
7988
  function applyStyling(renderer, isClassBased, rNode, prop, value) {
8040
- const isProcedural = isProceduralRenderer(renderer);
8041
7989
  if (isClassBased) {
8042
7990
  // We actually want JS true/false here because any truthy value should add the class
8043
7991
  if (!value) {
8044
7992
  ngDevMode && ngDevMode.rendererRemoveClass++;
8045
- if (isProcedural) {
8046
- renderer.removeClass(rNode, prop);
8047
- }
8048
- else {
8049
- rNode.classList.remove(prop);
8050
- }
7993
+ renderer.removeClass(rNode, prop);
8051
7994
  }
8052
7995
  else {
8053
7996
  ngDevMode && ngDevMode.rendererAddClass++;
8054
- if (isProcedural) {
8055
- renderer.addClass(rNode, prop);
8056
- }
8057
- else {
8058
- ngDevMode && assertDefined(rNode.classList, 'HTMLElement expected');
8059
- rNode.classList.add(prop);
8060
- }
7997
+ renderer.addClass(rNode, prop);
8061
7998
  }
8062
7999
  }
8063
8000
  else {
8064
8001
  let flags = prop.indexOf('-') === -1 ? undefined : RendererStyleFlags2.DashCase;
8065
8002
  if (value == null /** || value === undefined */) {
8066
8003
  ngDevMode && ngDevMode.rendererRemoveStyle++;
8067
- if (isProcedural) {
8068
- renderer.removeStyle(rNode, prop, flags);
8069
- }
8070
- else {
8071
- rNode.style.removeProperty(prop);
8072
- }
8004
+ renderer.removeStyle(rNode, prop, flags);
8073
8005
  }
8074
8006
  else {
8075
8007
  // A value is important if it ends with `!important`. The style
@@ -8081,13 +8013,7 @@ function applyStyling(renderer, isClassBased, rNode, prop, value) {
8081
8013
  flags |= RendererStyleFlags2.Important;
8082
8014
  }
8083
8015
  ngDevMode && ngDevMode.rendererSetStyle++;
8084
- if (isProcedural) {
8085
- renderer.setStyle(rNode, prop, value, flags);
8086
- }
8087
- else {
8088
- ngDevMode && assertDefined(rNode.style, 'HTMLElement expected');
8089
- rNode.style.setProperty(prop, value, isImportant ? 'important' : '');
8090
- }
8016
+ renderer.setStyle(rNode, prop, value, flags);
8091
8017
  }
8092
8018
  }
8093
8019
  }
@@ -8103,12 +8029,7 @@ function applyStyling(renderer, isClassBased, rNode, prop, value) {
8103
8029
  */
8104
8030
  function writeDirectStyle(renderer, element, newValue) {
8105
8031
  ngDevMode && assertString(newValue, '\'newValue\' should be a string');
8106
- if (isProceduralRenderer(renderer)) {
8107
- renderer.setAttribute(element, 'style', newValue);
8108
- }
8109
- else {
8110
- element.style.cssText = newValue;
8111
- }
8032
+ renderer.setAttribute(element, 'style', newValue);
8112
8033
  ngDevMode && ngDevMode.rendererSetStyle++;
8113
8034
  }
8114
8035
  /**
@@ -8123,17 +8044,12 @@ function writeDirectStyle(renderer, element, newValue) {
8123
8044
  */
8124
8045
  function writeDirectClass(renderer, element, newValue) {
8125
8046
  ngDevMode && assertString(newValue, '\'newValue\' should be a string');
8126
- if (isProceduralRenderer(renderer)) {
8127
- if (newValue === '') {
8128
- // There are tests in `google3` which expect `element.getAttribute('class')` to be `null`.
8129
- renderer.removeAttribute(element, 'class');
8130
- }
8131
- else {
8132
- renderer.setAttribute(element, 'class', newValue);
8133
- }
8047
+ if (newValue === '') {
8048
+ // There are tests in `google3` which expect `element.getAttribute('class')` to be `null`.
8049
+ renderer.removeAttribute(element, 'class');
8134
8050
  }
8135
8051
  else {
8136
- element.className = newValue;
8052
+ renderer.setAttribute(element, 'class', newValue);
8137
8053
  }
8138
8054
  ngDevMode && ngDevMode.rendererSetClassName++;
8139
8055
  }
@@ -8183,7 +8099,7 @@ function classIndexOf(className, classToSearch, startingIndex) {
8183
8099
  * Use of this source code is governed by an MIT-style license that can be
8184
8100
  * found in the LICENSE file at https://angular.io/license
8185
8101
  */
8186
- const unusedValueToPlacateAjd$1 = unusedValueExportToPlacateAjd$4 + unusedValueExportToPlacateAjd$3;
8102
+ const unusedValueToPlacateAjd$1 = unusedValueExportToPlacateAjd$5 + unusedValueExportToPlacateAjd$4;
8187
8103
  const NG_TEMPLATE_SELECTOR = 'ng-template';
8188
8104
  /**
8189
8105
  * Search the `TAttributes` to see if it contains `cssClassToMatch` (case insensitive)
@@ -9212,6 +9128,18 @@ class R3Injector extends EnvironmentInjector {
9212
9128
  onDestroy(callback) {
9213
9129
  this._onDestroyHooks.push(callback);
9214
9130
  }
9131
+ runInContext(fn) {
9132
+ this.assertNotDestroyed();
9133
+ const previousInjector = setCurrentInjector(this);
9134
+ const previousInjectImplementation = setInjectImplementation(undefined);
9135
+ try {
9136
+ return fn();
9137
+ }
9138
+ finally {
9139
+ setCurrentInjector(previousInjector);
9140
+ setInjectImplementation(previousInjectImplementation);
9141
+ }
9142
+ }
9215
9143
  get(token, notFoundValue = THROW_IF_NOT_FOUND, flags = InjectFlags.Default) {
9216
9144
  this.assertNotDestroyed();
9217
9145
  // Set the injection context.
@@ -10626,6 +10554,9 @@ function handleUnknownPropertyError(propName, tagName, nodeType, lView) {
10626
10554
  `the ${schemas} of this component.`;
10627
10555
  }
10628
10556
  }
10557
+ reportUnknownPropertyError(message);
10558
+ }
10559
+ function reportUnknownPropertyError(message) {
10629
10560
  if (shouldThrowErrorOnUnknownProperty) {
10630
10561
  throw new RuntimeError(303 /* RuntimeErrorCode.UNKNOWN_BINDING */, message);
10631
10562
  }
@@ -11512,6 +11443,13 @@ class LContainerDebug {
11512
11443
  }
11513
11444
  }
11514
11445
 
11446
+ /**
11447
+ * @license
11448
+ * Copyright Google LLC All Rights Reserved.
11449
+ *
11450
+ * Use of this source code is governed by an MIT-style license that can be
11451
+ * found in the LICENSE file at https://angular.io/license
11452
+ */
11515
11453
  /**
11516
11454
  * A permanent marker promise which signifies that the current CD tree is
11517
11455
  * clean.
@@ -11579,7 +11517,7 @@ function refreshChildComponents(hostLView, components) {
11579
11517
  /** Renders child components in the current view (creation mode). */
11580
11518
  function renderChildComponents(hostLView, components) {
11581
11519
  for (let i = 0; i < components.length; i++) {
11582
- renderComponent$1(hostLView, components[i]);
11520
+ renderComponent(hostLView, components[i]);
11583
11521
  }
11584
11522
  }
11585
11523
  function createLView(parentLView, tView, context, flags, host, tHostNode, rendererFactory, renderer, sanitizer, injector, embeddedViewInjector) {
@@ -12097,16 +12035,6 @@ function createViewBlueprint(bindingStartIndex, initialViewLength) {
12097
12035
  function createError(text, token) {
12098
12036
  return new Error(`Renderer: ${text} [${stringifyForError(token)}]`);
12099
12037
  }
12100
- function assertHostNodeExists(rElement, elementOrSelector) {
12101
- if (!rElement) {
12102
- if (typeof elementOrSelector === 'string') {
12103
- throw createError('Host node with selector not found:', elementOrSelector);
12104
- }
12105
- else {
12106
- throw createError('Host node is required:', elementOrSelector);
12107
- }
12108
- }
12109
- }
12110
12038
  /**
12111
12039
  * Locates the host native element, used for bootstrapping existing nodes into rendering pipeline.
12112
12040
  *
@@ -12115,21 +12043,9 @@ function assertHostNodeExists(rElement, elementOrSelector) {
12115
12043
  * @param encapsulation View Encapsulation defined for component that requests host element.
12116
12044
  */
12117
12045
  function locateHostElement(renderer, elementOrSelector, encapsulation) {
12118
- if (isProceduralRenderer(renderer)) {
12119
- // When using native Shadow DOM, do not clear host element to allow native slot projection
12120
- const preserveContent = encapsulation === ViewEncapsulation$1.ShadowDom;
12121
- return renderer.selectRootElement(elementOrSelector, preserveContent);
12122
- }
12123
- let rElement = typeof elementOrSelector === 'string' ?
12124
- renderer.querySelector(elementOrSelector) :
12125
- elementOrSelector;
12126
- ngDevMode && assertHostNodeExists(rElement, elementOrSelector);
12127
- // Always clear host element's content when Renderer3 is in use. For procedural renderer case we
12128
- // make it depend on whether ShadowDom encapsulation is used (in which case the content should be
12129
- // preserved to allow native slot projection). ShadowDom encapsulation requires procedural
12130
- // renderer, and procedural renderer case is handled above.
12131
- rElement.textContent = '';
12132
- return rElement;
12046
+ // When using native Shadow DOM, do not clear host element to allow native slot projection
12047
+ const preserveContent = encapsulation === ViewEncapsulation$1.ShadowDom;
12048
+ return renderer.selectRootElement(elementOrSelector, preserveContent);
12133
12049
  }
12134
12050
  /**
12135
12051
  * Saves context for this cleanup function in LView.cleanupInstances.
@@ -12344,13 +12260,7 @@ function elementPropertyInternal(tView, tNode, lView, propName, value, renderer,
12344
12260
  // It is assumed that the sanitizer is only added when the compiler determines that the
12345
12261
  // property is risky, so sanitization can be done without further checks.
12346
12262
  value = sanitizer != null ? sanitizer(value, tNode.value || '', propName) : value;
12347
- if (isProceduralRenderer(renderer)) {
12348
- renderer.setProperty(element, propName, value);
12349
- }
12350
- else if (!isAnimationProp(propName)) {
12351
- element.setProperty ? element.setProperty(propName, value) :
12352
- element[propName] = value;
12353
- }
12263
+ renderer.setProperty(element, propName, value);
12354
12264
  }
12355
12265
  else if (tNode.type & 12 /* TNodeType.AnyContainer */) {
12356
12266
  // If the node is a container and the property didn't
@@ -12374,23 +12284,15 @@ function setNgReflectProperty(lView, element, type, attrName, value) {
12374
12284
  const debugValue = normalizeDebugBindingValue(value);
12375
12285
  if (type & 3 /* TNodeType.AnyRNode */) {
12376
12286
  if (value == null) {
12377
- isProceduralRenderer(renderer) ? renderer.removeAttribute(element, attrName) :
12378
- element.removeAttribute(attrName);
12287
+ renderer.removeAttribute(element, attrName);
12379
12288
  }
12380
12289
  else {
12381
- isProceduralRenderer(renderer) ?
12382
- renderer.setAttribute(element, attrName, debugValue) :
12383
- element.setAttribute(attrName, debugValue);
12290
+ renderer.setAttribute(element, attrName, debugValue);
12384
12291
  }
12385
12292
  }
12386
12293
  else {
12387
12294
  const textContent = escapeCommentText(`bindings=${JSON.stringify({ [attrName]: debugValue }, null, 2)}`);
12388
- if (isProceduralRenderer(renderer)) {
12389
- renderer.setValue(element, textContent);
12390
- }
12391
- else {
12392
- element.textContent = textContent;
12393
- }
12295
+ renderer.setValue(element, textContent);
12394
12296
  }
12395
12297
  }
12396
12298
  function setNgReflectProperties(lView, element, type, dataValue, value) {
@@ -12420,6 +12322,7 @@ function instantiateRootComponent(tView, lView, def) {
12420
12322
  ngDevMode &&
12421
12323
  assertEqual(directiveIndex, rootTNode.directiveStart, 'Because this is a root component the allocated expando should match the TNode component.');
12422
12324
  configureViewWithDirective(tView, rootTNode, lView, directiveIndex, def);
12325
+ initializeInputAndOutputAliases(tView, rootTNode);
12423
12326
  }
12424
12327
  const directive = getNodeInjectable(lView, tView, rootTNode.directiveStart, rootTNode);
12425
12328
  attachPatchData(directive, lView);
@@ -12744,19 +12647,12 @@ function elementAttributeInternal(tNode, lView, name, value, sanitizer, namespac
12744
12647
  function setElementAttribute(renderer, element, namespace, tagName, name, value, sanitizer) {
12745
12648
  if (value == null) {
12746
12649
  ngDevMode && ngDevMode.rendererRemoveAttribute++;
12747
- isProceduralRenderer(renderer) ? renderer.removeAttribute(element, name, namespace) :
12748
- element.removeAttribute(name);
12650
+ renderer.removeAttribute(element, name, namespace);
12749
12651
  }
12750
12652
  else {
12751
12653
  ngDevMode && ngDevMode.rendererSetAttribute++;
12752
12654
  const strValue = sanitizer == null ? renderStringify(value) : sanitizer(value, tagName || '', name);
12753
- if (isProceduralRenderer(renderer)) {
12754
- renderer.setAttribute(element, name, strValue, namespace);
12755
- }
12756
- else {
12757
- namespace ? element.setAttributeNS(namespace, name, strValue) :
12758
- element.setAttribute(name, strValue);
12759
- }
12655
+ renderer.setAttribute(element, name, strValue, namespace);
12760
12656
  }
12761
12657
  }
12762
12658
  /**
@@ -12848,7 +12744,6 @@ const LContainerArray = class LContainer extends Array {
12848
12744
  */
12849
12745
  function createLContainer(hostNative, currentView, native, tNode) {
12850
12746
  ngDevMode && assertLView(currentView);
12851
- ngDevMode && !isProceduralRenderer(currentView[RENDERER]) && assertDomNode(native);
12852
12747
  // https://jsperf.com/array-literal-vs-new-array-really
12853
12748
  const lContainer = new (ngDevMode ? LContainerArray : Array)(hostNative, // host native
12854
12749
  true, // Boolean `true` in this position signifies that this is an `LContainer`
@@ -12964,7 +12859,7 @@ function refreshContainsDirtyView(lView) {
12964
12859
  }
12965
12860
  }
12966
12861
  }
12967
- function renderComponent$1(hostLView, componentHostIdx) {
12862
+ function renderComponent(hostLView, componentHostIdx) {
12968
12863
  ngDevMode && assertEqual(isCreationMode(hostLView), true, 'Should be run in creation mode');
12969
12864
  const componentView = getComponentLViewByIndex(componentHostIdx, hostLView);
12970
12865
  const componentTView = componentView[TVIEW];
@@ -13316,48 +13211,135 @@ function computeStaticStyling(tNode, attrs, writeToHost) {
13316
13211
  * Use of this source code is governed by an MIT-style license that can be
13317
13212
  * found in the LICENSE file at https://angular.io/license
13318
13213
  */
13214
+ // TODO: A hack to not pull in the NullInjector from @angular/core.
13215
+ const NULL_INJECTOR = {
13216
+ get: (token, notFoundValue) => {
13217
+ throwProviderNotFoundError(token, 'NullInjector');
13218
+ }
13219
+ };
13319
13220
  /**
13320
- * Synchronously perform change detection on a component (and possibly its sub-components).
13221
+ * Creates the root component view and the root component node.
13321
13222
  *
13322
- * This function triggers change detection in a synchronous way on a component.
13223
+ * @param rNode Render host element.
13224
+ * @param def ComponentDef
13225
+ * @param rootView The parent view where the host node is stored
13226
+ * @param rendererFactory Factory to be used for creating child renderers.
13227
+ * @param hostRenderer The current renderer
13228
+ * @param sanitizer The sanitizer, if provided
13323
13229
  *
13324
- * @param component The component which the change detection should be performed on.
13230
+ * @returns Component view created
13325
13231
  */
13326
- function detectChanges(component) {
13327
- const view = getComponentViewByInstance(component);
13328
- detectChangesInternal(view[TVIEW], view, component);
13232
+ function createRootComponentView(rNode, def, rootView, rendererFactory, hostRenderer, sanitizer) {
13233
+ const tView = rootView[TVIEW];
13234
+ const index = HEADER_OFFSET;
13235
+ ngDevMode && assertIndexInRange(rootView, index);
13236
+ rootView[index] = rNode;
13237
+ // '#host' is added here as we don't know the real host DOM name (we don't want to read it) and at
13238
+ // the same time we want to communicate the debug `TNode` that this is a special `TNode`
13239
+ // representing a host element.
13240
+ const tNode = getOrCreateTNode(tView, index, 2 /* TNodeType.Element */, '#host', null);
13241
+ const mergedAttrs = tNode.mergedAttrs = def.hostAttrs;
13242
+ if (mergedAttrs !== null) {
13243
+ computeStaticStyling(tNode, mergedAttrs, true);
13244
+ if (rNode !== null) {
13245
+ setUpAttributes(hostRenderer, rNode, mergedAttrs);
13246
+ if (tNode.classes !== null) {
13247
+ writeDirectClass(hostRenderer, rNode, tNode.classes);
13248
+ }
13249
+ if (tNode.styles !== null) {
13250
+ writeDirectStyle(hostRenderer, rNode, tNode.styles);
13251
+ }
13252
+ }
13253
+ }
13254
+ const viewRenderer = rendererFactory.createRenderer(rNode, def);
13255
+ const componentView = createLView(rootView, getOrCreateTComponentView(def), null, def.onPush ? 32 /* LViewFlags.Dirty */ : 16 /* LViewFlags.CheckAlways */, rootView[index], tNode, rendererFactory, viewRenderer, sanitizer || null, null, null);
13256
+ if (tView.firstCreatePass) {
13257
+ diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, rootView), tView, def.type);
13258
+ markAsComponentHost(tView, tNode);
13259
+ initTNodeFlags(tNode, rootView.length, 1);
13260
+ }
13261
+ addToViewTree(rootView, componentView);
13262
+ // Store component view at node index, with node as the HOST
13263
+ return rootView[index] = componentView;
13329
13264
  }
13330
13265
  /**
13331
- * Marks the component as dirty (needing change detection). Marking a component dirty will
13332
- * schedule a change detection on it at some point in the future.
13333
- *
13334
- * Marking an already dirty component as dirty won't do anything. Only one outstanding change
13335
- * detection can be scheduled per component tree.
13266
+ * Creates a root component and sets it up with features and host bindings. Shared by
13267
+ * renderComponent() and ViewContainerRef.createComponent().
13268
+ */
13269
+ function createRootComponent(componentView, componentDef, rootLView, rootContext, hostFeatures) {
13270
+ const tView = rootLView[TVIEW];
13271
+ // Create directive instance with factory() and store at next index in viewData
13272
+ const component = instantiateRootComponent(tView, rootLView, componentDef);
13273
+ rootContext.components.push(component);
13274
+ componentView[CONTEXT] = component;
13275
+ if (hostFeatures !== null) {
13276
+ for (const feature of hostFeatures) {
13277
+ feature(component, componentDef);
13278
+ }
13279
+ }
13280
+ // We want to generate an empty QueryList for root content queries for backwards
13281
+ // compatibility with ViewEngine.
13282
+ if (componentDef.contentQueries) {
13283
+ const tNode = getCurrentTNode();
13284
+ ngDevMode && assertDefined(tNode, 'TNode expected');
13285
+ componentDef.contentQueries(1 /* RenderFlags.Create */, component, tNode.directiveStart);
13286
+ }
13287
+ const rootTNode = getCurrentTNode();
13288
+ ngDevMode && assertDefined(rootTNode, 'tNode should have been already created');
13289
+ if (tView.firstCreatePass &&
13290
+ (componentDef.hostBindings !== null || componentDef.hostAttrs !== null)) {
13291
+ setSelectedIndex(rootTNode.index);
13292
+ const rootTView = rootLView[TVIEW];
13293
+ registerHostBindingOpCodes(rootTView, rootTNode, rootLView, rootTNode.directiveStart, rootTNode.directiveEnd, componentDef);
13294
+ invokeHostBindingsInCreationMode(componentDef, component);
13295
+ }
13296
+ return component;
13297
+ }
13298
+ function createRootContext(scheduler, playerHandler) {
13299
+ return {
13300
+ components: [],
13301
+ scheduler: scheduler || defaultScheduler,
13302
+ clean: CLEAN_PROMISE,
13303
+ playerHandler: playerHandler || null,
13304
+ flags: 0 /* RootContextFlags.Empty */
13305
+ };
13306
+ }
13307
+ /**
13308
+ * Used to enable lifecycle hooks on the root component.
13336
13309
  *
13337
- * @param component Component to mark as dirty.
13310
+ * Include this feature when calling `renderComponent` if the root component
13311
+ * you are rendering has lifecycle hooks defined. Otherwise, the hooks won't
13312
+ * be called properly.
13313
+ *
13314
+ * Example:
13315
+ *
13316
+ * ```
13317
+ * renderComponent(AppComponent, {hostFeatures: [LifecycleHooksFeature]});
13318
+ * ```
13338
13319
  */
13339
- function markDirty(component) {
13340
- ngDevMode && assertDefined(component, 'component');
13341
- const rootView = markViewDirty(getComponentViewByInstance(component));
13342
- ngDevMode && assertDefined(rootView[CONTEXT], 'rootContext should be defined');
13343
- scheduleTick(rootView[CONTEXT], 1 /* RootContextFlags.DetectChanges */);
13320
+ function LifecycleHooksFeature() {
13321
+ const tNode = getCurrentTNode();
13322
+ ngDevMode && assertDefined(tNode, 'TNode is required');
13323
+ registerPostOrderHooks(getLView()[TVIEW], tNode);
13344
13324
  }
13345
13325
  /**
13346
- * Used to perform change detection on the whole application.
13326
+ * Wait on component until it is rendered.
13347
13327
  *
13348
- * This is equivalent to `detectChanges`, but invoked on root component. Additionally, `tick`
13349
- * executes lifecycle hooks and conditionally checks components based on their
13350
- * `ChangeDetectionStrategy` and dirtiness.
13328
+ * This function returns a `Promise` which is resolved when the component's
13329
+ * change detection is executed. This is determined by finding the scheduler
13330
+ * associated with the `component`'s render tree and waiting until the scheduler
13331
+ * flushes. If nothing is scheduled, the function returns a resolved promise.
13351
13332
  *
13352
- * The preferred way to trigger change detection is to call `markDirty`. `markDirty` internally
13353
- * schedules `tick` using a scheduler in order to coalesce multiple `markDirty` calls into a
13354
- * single change detection run. By default, the scheduler is `requestAnimationFrame`, but can
13355
- * be changed when calling `renderComponent` and providing the `scheduler` option.
13333
+ * Example:
13334
+ * ```
13335
+ * await whenRendered(myComponent);
13336
+ * ```
13337
+ *
13338
+ * @param component Component to wait upon
13339
+ * @returns Promise which resolves when the component is rendered.
13356
13340
  */
13357
- function tick(component) {
13358
- const rootView = getRootView(component);
13359
- const rootContext = rootView[CONTEXT];
13360
- tickRootContext(rootContext);
13341
+ function whenRendered(component) {
13342
+ return getRootContext(component).clean;
13361
13343
  }
13362
13344
 
13363
13345
  /**
@@ -13367,407 +13349,312 @@ function tick(component) {
13367
13349
  * Use of this source code is governed by an MIT-style license that can be
13368
13350
  * found in the LICENSE file at https://angular.io/license
13369
13351
  */
13352
+ function getSuperType(type) {
13353
+ return Object.getPrototypeOf(type.prototype).constructor;
13354
+ }
13370
13355
  /**
13371
- * Retrieves the component instance associated with a given DOM element.
13372
- *
13373
- * @usageNotes
13374
- * Given the following DOM structure:
13375
- *
13376
- * ```html
13377
- * <app-root>
13378
- * <div>
13379
- * <child-comp></child-comp>
13380
- * </div>
13381
- * </app-root>
13382
- * ```
13383
- *
13384
- * Calling `getComponent` on `<child-comp>` will return the instance of `ChildComponent`
13385
- * associated with this DOM element.
13386
- *
13387
- * Calling the function on `<app-root>` will return the `MyApp` instance.
13388
- *
13389
- *
13390
- * @param element DOM element from which the component should be retrieved.
13391
- * @returns Component instance associated with the element or `null` if there
13392
- * is no component associated with it.
13356
+ * Merges the definition from a super class to a sub class.
13357
+ * @param definition The definition that is a SubClass of another directive of component
13393
13358
  *
13394
- * @publicApi
13395
- * @globalApi ng
13359
+ * @codeGenApi
13396
13360
  */
13397
- function getComponent$1(element) {
13398
- ngDevMode && assertDomElement(element);
13399
- const context = getLContext(element);
13400
- if (context === null)
13401
- return null;
13402
- if (context.component === undefined) {
13403
- const lView = context.lView;
13404
- if (lView === null) {
13405
- return null;
13361
+ function ɵɵInheritDefinitionFeature(definition) {
13362
+ let superType = getSuperType(definition.type);
13363
+ let shouldInheritFields = true;
13364
+ const inheritanceChain = [definition];
13365
+ while (superType) {
13366
+ let superDef = undefined;
13367
+ if (isComponentDef(definition)) {
13368
+ // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
13369
+ superDef = superType.ɵcmp || superType.ɵdir;
13406
13370
  }
13407
- context.component = getComponentAtNodeIndex(context.nodeIndex, lView);
13371
+ else {
13372
+ if (superType.ɵcmp) {
13373
+ throw new RuntimeError(903 /* RuntimeErrorCode.INVALID_INHERITANCE */, ngDevMode &&
13374
+ `Directives cannot inherit Components. Directive ${stringifyForError(definition.type)} is attempting to extend component ${stringifyForError(superType)}`);
13375
+ }
13376
+ // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
13377
+ superDef = superType.ɵdir;
13378
+ }
13379
+ if (superDef) {
13380
+ if (shouldInheritFields) {
13381
+ inheritanceChain.push(superDef);
13382
+ // Some fields in the definition may be empty, if there were no values to put in them that
13383
+ // would've justified object creation. Unwrap them if necessary.
13384
+ const writeableDef = definition;
13385
+ writeableDef.inputs = maybeUnwrapEmpty(definition.inputs);
13386
+ writeableDef.declaredInputs = maybeUnwrapEmpty(definition.declaredInputs);
13387
+ writeableDef.outputs = maybeUnwrapEmpty(definition.outputs);
13388
+ // Merge hostBindings
13389
+ const superHostBindings = superDef.hostBindings;
13390
+ superHostBindings && inheritHostBindings(definition, superHostBindings);
13391
+ // Merge queries
13392
+ const superViewQuery = superDef.viewQuery;
13393
+ const superContentQueries = superDef.contentQueries;
13394
+ superViewQuery && inheritViewQuery(definition, superViewQuery);
13395
+ superContentQueries && inheritContentQueries(definition, superContentQueries);
13396
+ // Merge inputs and outputs
13397
+ fillProperties(definition.inputs, superDef.inputs);
13398
+ fillProperties(definition.declaredInputs, superDef.declaredInputs);
13399
+ fillProperties(definition.outputs, superDef.outputs);
13400
+ // Merge animations metadata.
13401
+ // If `superDef` is a Component, the `data` field is present (defaults to an empty object).
13402
+ if (isComponentDef(superDef) && superDef.data.animation) {
13403
+ // If super def is a Component, the `definition` is also a Component, since Directives can
13404
+ // not inherit Components (we throw an error above and cannot reach this code).
13405
+ const defData = definition.data;
13406
+ defData.animation = (defData.animation || []).concat(superDef.data.animation);
13407
+ }
13408
+ }
13409
+ // Run parent features
13410
+ const features = superDef.features;
13411
+ if (features) {
13412
+ for (let i = 0; i < features.length; i++) {
13413
+ const feature = features[i];
13414
+ if (feature && feature.ngInherit) {
13415
+ feature(definition);
13416
+ }
13417
+ // If `InheritDefinitionFeature` is a part of the current `superDef`, it means that this
13418
+ // def already has all the necessary information inherited from its super class(es), so we
13419
+ // can stop merging fields from super classes. However we need to iterate through the
13420
+ // prototype chain to look for classes that might contain other "features" (like
13421
+ // NgOnChanges), which we should invoke for the original `definition`. We set the
13422
+ // `shouldInheritFields` flag to indicate that, essentially skipping fields inheritance
13423
+ // logic and only invoking functions from the "features" list.
13424
+ if (feature === ɵɵInheritDefinitionFeature) {
13425
+ shouldInheritFields = false;
13426
+ }
13427
+ }
13428
+ }
13429
+ }
13430
+ superType = Object.getPrototypeOf(superType);
13408
13431
  }
13409
- return context.component;
13410
- }
13411
- /**
13412
- * If inside an embedded view (e.g. `*ngIf` or `*ngFor`), retrieves the context of the embedded
13413
- * view that the element is part of. Otherwise retrieves the instance of the component whose view
13414
- * owns the element (in this case, the result is the same as calling `getOwningComponent`).
13415
- *
13416
- * @param element Element for which to get the surrounding component instance.
13417
- * @returns Instance of the component that is around the element or null if the element isn't
13418
- * inside any component.
13419
- *
13420
- * @publicApi
13421
- * @globalApi ng
13422
- */
13423
- function getContext(element) {
13424
- assertDomElement(element);
13425
- const context = getLContext(element);
13426
- const lView = context ? context.lView : null;
13427
- return lView === null ? null : lView[CONTEXT];
13432
+ mergeHostAttrsAcrossInheritance(inheritanceChain);
13428
13433
  }
13429
13434
  /**
13430
- * Retrieves the component instance whose view contains the DOM element.
13431
- *
13432
- * For example, if `<child-comp>` is used in the template of `<app-comp>`
13433
- * (i.e. a `ViewChild` of `<app-comp>`), calling `getOwningComponent` on `<child-comp>`
13434
- * would return `<app-comp>`.
13435
- *
13436
- * @param elementOrDir DOM element, component or directive instance
13437
- * for which to retrieve the root components.
13438
- * @returns Component instance whose view owns the DOM element or null if the element is not
13439
- * part of a component view.
13435
+ * Merge the `hostAttrs` and `hostVars` from the inherited parent to the base class.
13440
13436
  *
13441
- * @publicApi
13442
- * @globalApi ng
13437
+ * @param inheritanceChain A list of `WritableDefs` starting at the top most type and listing
13438
+ * sub-types in order. For each type take the `hostAttrs` and `hostVars` and merge it with the child
13439
+ * type.
13443
13440
  */
13444
- function getOwningComponent(elementOrDir) {
13445
- const context = getLContext(elementOrDir);
13446
- let lView = context ? context.lView : null;
13447
- if (lView === null)
13448
- return null;
13449
- let parent;
13450
- while (lView[TVIEW].type === 2 /* TViewType.Embedded */ && (parent = getLViewParent(lView))) {
13451
- lView = parent;
13441
+ function mergeHostAttrsAcrossInheritance(inheritanceChain) {
13442
+ let hostVars = 0;
13443
+ let hostAttrs = null;
13444
+ // We process the inheritance order from the base to the leaves here.
13445
+ for (let i = inheritanceChain.length - 1; i >= 0; i--) {
13446
+ const def = inheritanceChain[i];
13447
+ // For each `hostVars`, we need to add the superclass amount.
13448
+ def.hostVars = (hostVars += def.hostVars);
13449
+ // for each `hostAttrs` we need to merge it with superclass.
13450
+ def.hostAttrs =
13451
+ mergeHostAttrs(def.hostAttrs, hostAttrs = mergeHostAttrs(hostAttrs, def.hostAttrs));
13452
13452
  }
13453
- return lView[FLAGS] & 256 /* LViewFlags.IsRoot */ ? null : lView[CONTEXT];
13454
13453
  }
13455
- /**
13456
- * Retrieves all root components associated with a DOM element, directive or component instance.
13457
- * Root components are those which have been bootstrapped by Angular.
13458
- *
13459
- * @param elementOrDir DOM element, component or directive instance
13460
- * for which to retrieve the root components.
13461
- * @returns Root components associated with the target object.
13462
- *
13463
- * @publicApi
13464
- * @globalApi ng
13465
- */
13466
- function getRootComponents(elementOrDir) {
13467
- const lView = readPatchedLView(elementOrDir);
13468
- return lView !== null ? [...getRootContext(lView).components] : [];
13469
- }
13470
- /**
13471
- * Retrieves an `Injector` associated with an element, component or directive instance.
13472
- *
13473
- * @param elementOrDir DOM element, component or directive instance for which to
13474
- * retrieve the injector.
13475
- * @returns Injector associated with the element, component or directive instance.
13476
- *
13477
- * @publicApi
13478
- * @globalApi ng
13479
- */
13480
- function getInjector(elementOrDir) {
13481
- const context = getLContext(elementOrDir);
13482
- const lView = context ? context.lView : null;
13483
- if (lView === null)
13484
- return Injector.NULL;
13485
- const tNode = lView[TVIEW].data[context.nodeIndex];
13486
- return new NodeInjector(tNode, lView);
13487
- }
13488
- /**
13489
- * Retrieve a set of injection tokens at a given DOM node.
13490
- *
13491
- * @param element Element for which the injection tokens should be retrieved.
13492
- */
13493
- function getInjectionTokens(element) {
13494
- const context = getLContext(element);
13495
- const lView = context ? context.lView : null;
13496
- if (lView === null)
13497
- return [];
13498
- const tView = lView[TVIEW];
13499
- const tNode = tView.data[context.nodeIndex];
13500
- const providerTokens = [];
13501
- const startIndex = tNode.providerIndexes & 1048575 /* TNodeProviderIndexes.ProvidersStartIndexMask */;
13502
- const endIndex = tNode.directiveEnd;
13503
- for (let i = startIndex; i < endIndex; i++) {
13504
- let value = tView.data[i];
13505
- if (isDirectiveDefHack(value)) {
13506
- // The fact that we sometimes store Type and sometimes DirectiveDef in this location is a
13507
- // design flaw. We should always store same type so that we can be monomorphic. The issue
13508
- // is that for Components/Directives we store the def instead the type. The correct behavior
13509
- // is that we should always be storing injectable type in this location.
13510
- value = value.type;
13511
- }
13512
- providerTokens.push(value);
13454
+ function maybeUnwrapEmpty(value) {
13455
+ if (value === EMPTY_OBJ) {
13456
+ return {};
13513
13457
  }
13514
- return providerTokens;
13515
- }
13516
- /**
13517
- * Retrieves directive instances associated with a given DOM node. Does not include
13518
- * component instances.
13519
- *
13520
- * @usageNotes
13521
- * Given the following DOM structure:
13522
- *
13523
- * ```html
13524
- * <app-root>
13525
- * <button my-button></button>
13526
- * <my-comp></my-comp>
13527
- * </app-root>
13528
- * ```
13529
- *
13530
- * Calling `getDirectives` on `<button>` will return an array with an instance of the `MyButton`
13531
- * directive that is associated with the DOM node.
13532
- *
13533
- * Calling `getDirectives` on `<my-comp>` will return an empty array.
13534
- *
13535
- * @param node DOM node for which to get the directives.
13536
- * @returns Array of directives associated with the node.
13537
- *
13538
- * @publicApi
13539
- * @globalApi ng
13540
- */
13541
- function getDirectives(node) {
13542
- // Skip text nodes because we can't have directives associated with them.
13543
- if (node instanceof Text) {
13458
+ else if (value === EMPTY_ARRAY) {
13544
13459
  return [];
13545
13460
  }
13546
- const context = getLContext(node);
13547
- const lView = context ? context.lView : null;
13548
- if (lView === null) {
13549
- return [];
13461
+ else {
13462
+ return value;
13550
13463
  }
13551
- const tView = lView[TVIEW];
13552
- const nodeIndex = context.nodeIndex;
13553
- if (!tView?.data[nodeIndex]) {
13554
- return [];
13464
+ }
13465
+ function inheritViewQuery(definition, superViewQuery) {
13466
+ const prevViewQuery = definition.viewQuery;
13467
+ if (prevViewQuery) {
13468
+ definition.viewQuery = (rf, ctx) => {
13469
+ superViewQuery(rf, ctx);
13470
+ prevViewQuery(rf, ctx);
13471
+ };
13555
13472
  }
13556
- if (context.directives === undefined) {
13557
- context.directives = getDirectivesAtNodeIndex(nodeIndex, lView, false);
13473
+ else {
13474
+ definition.viewQuery = superViewQuery;
13558
13475
  }
13559
- // The `directives` in this case are a named array called `LComponentView`. Clone the
13560
- // result so we don't expose an internal data structure in the user's console.
13561
- return context.directives === null ? [] : [...context.directives];
13562
13476
  }
13563
- /**
13564
- * Returns the debug (partial) metadata for a particular directive or component instance.
13565
- * The function accepts an instance of a directive or component and returns the corresponding
13566
- * metadata.
13567
- *
13568
- * @param directiveOrComponentInstance Instance of a directive or component
13569
- * @returns metadata of the passed directive or component
13570
- *
13571
- * @publicApi
13572
- * @globalApi ng
13573
- */
13574
- function getDirectiveMetadata$1(directiveOrComponentInstance) {
13575
- const { constructor } = directiveOrComponentInstance;
13576
- if (!constructor) {
13577
- throw new Error('Unable to find the instance constructor');
13477
+ function inheritContentQueries(definition, superContentQueries) {
13478
+ const prevContentQueries = definition.contentQueries;
13479
+ if (prevContentQueries) {
13480
+ definition.contentQueries = (rf, ctx, directiveIndex) => {
13481
+ superContentQueries(rf, ctx, directiveIndex);
13482
+ prevContentQueries(rf, ctx, directiveIndex);
13483
+ };
13578
13484
  }
13579
- // In case a component inherits from a directive, we may have component and directive metadata
13580
- // To ensure we don't get the metadata of the directive, we want to call `getComponentDef` first.
13581
- const componentDef = getComponentDef(constructor);
13582
- if (componentDef) {
13583
- return {
13584
- inputs: componentDef.inputs,
13585
- outputs: componentDef.outputs,
13586
- encapsulation: componentDef.encapsulation,
13587
- changeDetection: componentDef.onPush ? ChangeDetectionStrategy.OnPush :
13588
- ChangeDetectionStrategy.Default
13485
+ else {
13486
+ definition.contentQueries = superContentQueries;
13487
+ }
13488
+ }
13489
+ function inheritHostBindings(definition, superHostBindings) {
13490
+ const prevHostBindings = definition.hostBindings;
13491
+ if (prevHostBindings) {
13492
+ definition.hostBindings = (rf, ctx) => {
13493
+ superHostBindings(rf, ctx);
13494
+ prevHostBindings(rf, ctx);
13589
13495
  };
13590
13496
  }
13591
- const directiveDef = getDirectiveDef(constructor);
13592
- if (directiveDef) {
13593
- return { inputs: directiveDef.inputs, outputs: directiveDef.outputs };
13497
+ else {
13498
+ definition.hostBindings = superHostBindings;
13594
13499
  }
13595
- return null;
13596
13500
  }
13501
+
13597
13502
  /**
13598
- * Retrieve map of local references.
13599
- *
13600
- * The references are retrieved as a map of local reference name to element or directive instance.
13503
+ * @license
13504
+ * Copyright Google LLC All Rights Reserved.
13601
13505
  *
13602
- * @param target DOM element, component or directive instance for which to retrieve
13603
- * the local references.
13506
+ * Use of this source code is governed by an MIT-style license that can be
13507
+ * found in the LICENSE file at https://angular.io/license
13604
13508
  */
13605
- function getLocalRefs(target) {
13606
- const context = getLContext(target);
13607
- if (context === null)
13608
- return {};
13609
- if (context.localRefs === undefined) {
13610
- const lView = context.lView;
13611
- if (lView === null) {
13612
- return {};
13613
- }
13614
- context.localRefs = discoverLocalRefs(lView, context.nodeIndex);
13615
- }
13616
- return context.localRefs || {};
13617
- }
13618
13509
  /**
13619
- * Retrieves the host element of a component or directive instance.
13620
- * The host element is the DOM element that matched the selector of the directive.
13621
- *
13622
- * @param componentOrDirective Component or directive instance for which the host
13623
- * element should be retrieved.
13624
- * @returns Host element of the target.
13625
- *
13626
- * @publicApi
13627
- * @globalApi ng
13510
+ * Fields which exist on either directive or component definitions, and need to be copied from
13511
+ * parent to child classes by the `ɵɵCopyDefinitionFeature`.
13628
13512
  */
13629
- function getHostElement(componentOrDirective) {
13630
- return getLContext(componentOrDirective).native;
13631
- }
13513
+ const COPY_DIRECTIVE_FIELDS = [
13514
+ // The child class should use the providers of its parent.
13515
+ 'providersResolver',
13516
+ // Not listed here are any fields which are handled by the `ɵɵInheritDefinitionFeature`, such
13517
+ // as inputs, outputs, and host binding functions.
13518
+ ];
13632
13519
  /**
13633
- * Retrieves the rendered text for a given component.
13634
- *
13635
- * This function retrieves the host element of a component and
13636
- * and then returns the `textContent` for that element. This implies
13637
- * that the text returned will include re-projected content of
13638
- * the component as well.
13520
+ * Fields which exist only on component definitions, and need to be copied from parent to child
13521
+ * classes by the `ɵɵCopyDefinitionFeature`.
13639
13522
  *
13640
- * @param component The component to return the content text for.
13523
+ * The type here allows any field of `ComponentDef` which is not also a property of `DirectiveDef`,
13524
+ * since those should go in `COPY_DIRECTIVE_FIELDS` above.
13641
13525
  */
13642
- function getRenderedText(component) {
13643
- const hostElement = getHostElement(component);
13644
- return hostElement.textContent || '';
13645
- }
13526
+ const COPY_COMPONENT_FIELDS = [
13527
+ // The child class should use the template function of its parent, including all template
13528
+ // semantics.
13529
+ 'template',
13530
+ 'decls',
13531
+ 'consts',
13532
+ 'vars',
13533
+ 'onPush',
13534
+ 'ngContentSelectors',
13535
+ // The child class should use the CSS styles of its parent, including all styling semantics.
13536
+ 'styles',
13537
+ 'encapsulation',
13538
+ // The child class should be checked by the runtime in the same way as its parent.
13539
+ 'schemas',
13540
+ ];
13646
13541
  /**
13647
- * Retrieves a list of event listeners associated with a DOM element. The list does include host
13648
- * listeners, but it does not include event listeners defined outside of the Angular context
13649
- * (e.g. through `addEventListener`).
13542
+ * Copies the fields not handled by the `ɵɵInheritDefinitionFeature` from the supertype of a
13543
+ * definition.
13650
13544
  *
13651
- * @usageNotes
13652
- * Given the following DOM structure:
13545
+ * This exists primarily to support ngcc migration of an existing View Engine pattern, where an
13546
+ * entire decorator is inherited from a parent to a child class. When ngcc detects this case, it
13547
+ * generates a skeleton definition on the child class, and applies this feature.
13653
13548
  *
13654
- * ```html
13655
- * <app-root>
13656
- * <div (click)="doSomething()"></div>
13657
- * </app-root>
13658
- * ```
13549
+ * The `ɵɵCopyDefinitionFeature` then copies any needed fields from the parent class' definition,
13550
+ * including things like the component template function.
13659
13551
  *
13660
- * Calling `getListeners` on `<div>` will return an object that looks as follows:
13552
+ * @param definition The definition of a child class which inherits from a parent class with its
13553
+ * own definition.
13661
13554
  *
13662
- * ```ts
13663
- * {
13664
- * name: 'click',
13665
- * element: <div>,
13666
- * callback: () => doSomething(),
13667
- * useCapture: false
13668
- * }
13669
- * ```
13670
- *
13671
- * @param element Element for which the DOM listeners should be retrieved.
13672
- * @returns Array of event listeners on the DOM element.
13673
- *
13674
- * @publicApi
13675
- * @globalApi ng
13555
+ * @codeGenApi
13676
13556
  */
13677
- function getListeners(element) {
13678
- ngDevMode && assertDomElement(element);
13679
- const lContext = getLContext(element);
13680
- const lView = lContext === null ? null : lContext.lView;
13681
- if (lView === null)
13682
- return [];
13683
- const tView = lView[TVIEW];
13684
- const lCleanup = lView[CLEANUP];
13685
- const tCleanup = tView.cleanup;
13686
- const listeners = [];
13687
- if (tCleanup && lCleanup) {
13688
- for (let i = 0; i < tCleanup.length;) {
13689
- const firstParam = tCleanup[i++];
13690
- const secondParam = tCleanup[i++];
13691
- if (typeof firstParam === 'string') {
13692
- const name = firstParam;
13693
- const listenerElement = unwrapRNode(lView[secondParam]);
13694
- const callback = lCleanup[tCleanup[i++]];
13695
- const useCaptureOrIndx = tCleanup[i++];
13696
- // if useCaptureOrIndx is boolean then report it as is.
13697
- // if useCaptureOrIndx is positive number then it in unsubscribe method
13698
- // if useCaptureOrIndx is negative number then it is a Subscription
13699
- const type = (typeof useCaptureOrIndx === 'boolean' || useCaptureOrIndx >= 0) ? 'dom' : 'output';
13700
- const useCapture = typeof useCaptureOrIndx === 'boolean' ? useCaptureOrIndx : false;
13701
- if (element == listenerElement) {
13702
- listeners.push({ element, name, callback, useCapture, type });
13703
- }
13704
- }
13557
+ function ɵɵCopyDefinitionFeature(definition) {
13558
+ let superType = getSuperType(definition.type);
13559
+ let superDef = undefined;
13560
+ if (isComponentDef(definition)) {
13561
+ // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
13562
+ superDef = superType.ɵcmp;
13563
+ }
13564
+ else {
13565
+ // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
13566
+ superDef = superType.ɵdir;
13567
+ }
13568
+ // Needed because `definition` fields are readonly.
13569
+ const defAny = definition;
13570
+ // Copy over any fields that apply to either directives or components.
13571
+ for (const field of COPY_DIRECTIVE_FIELDS) {
13572
+ defAny[field] = superDef[field];
13573
+ }
13574
+ if (isComponentDef(superDef)) {
13575
+ // Copy over any component-specific fields.
13576
+ for (const field of COPY_COMPONENT_FIELDS) {
13577
+ defAny[field] = superDef[field];
13705
13578
  }
13706
13579
  }
13707
- listeners.sort(sortListeners);
13708
- return listeners;
13709
- }
13710
- function sortListeners(a, b) {
13711
- if (a.name == b.name)
13712
- return 0;
13713
- return a.name < b.name ? -1 : 1;
13714
13580
  }
13581
+
13715
13582
  /**
13716
- * This function should not exist because it is megamorphic and only mostly correct.
13583
+ * @license
13584
+ * Copyright Google LLC All Rights Reserved.
13717
13585
  *
13718
- * See call site for more info.
13586
+ * Use of this source code is governed by an MIT-style license that can be
13587
+ * found in the LICENSE file at https://angular.io/license
13719
13588
  */
13720
- function isDirectiveDefHack(obj) {
13721
- return obj.type !== undefined && obj.template !== undefined && obj.declaredInputs !== undefined;
13589
+ let _symbolIterator = null;
13590
+ function getSymbolIterator() {
13591
+ if (!_symbolIterator) {
13592
+ const Symbol = _global['Symbol'];
13593
+ if (Symbol && Symbol.iterator) {
13594
+ _symbolIterator = Symbol.iterator;
13595
+ }
13596
+ else {
13597
+ // es6-shim specific logic
13598
+ const keys = Object.getOwnPropertyNames(Map.prototype);
13599
+ for (let i = 0; i < keys.length; ++i) {
13600
+ const key = keys[i];
13601
+ if (key !== 'entries' && key !== 'size' &&
13602
+ Map.prototype[key] === Map.prototype['entries']) {
13603
+ _symbolIterator = key;
13604
+ }
13605
+ }
13606
+ }
13607
+ }
13608
+ return _symbolIterator;
13722
13609
  }
13610
+
13723
13611
  /**
13724
- * Returns the attached `DebugNode` instance for an element in the DOM.
13612
+ * @license
13613
+ * Copyright Google LLC All Rights Reserved.
13725
13614
  *
13726
- * @param element DOM element which is owned by an existing component's view.
13615
+ * Use of this source code is governed by an MIT-style license that can be
13616
+ * found in the LICENSE file at https://angular.io/license
13727
13617
  */
13728
- function getDebugNode$1(element) {
13729
- if (ngDevMode && !(element instanceof Node)) {
13730
- throw new Error('Expecting instance of DOM Element');
13618
+ function isIterable(obj) {
13619
+ return obj !== null && typeof obj === 'object' && obj[getSymbolIterator()] !== undefined;
13620
+ }
13621
+ function isListLikeIterable(obj) {
13622
+ if (!isJsObject(obj))
13623
+ return false;
13624
+ return Array.isArray(obj) ||
13625
+ (!(obj instanceof Map) && // JS Map are iterables but return entries as [k, v]
13626
+ getSymbolIterator() in obj); // JS Iterable have a Symbol.iterator prop
13627
+ }
13628
+ function areIterablesEqual(a, b, comparator) {
13629
+ const iterator1 = a[getSymbolIterator()]();
13630
+ const iterator2 = b[getSymbolIterator()]();
13631
+ while (true) {
13632
+ const item1 = iterator1.next();
13633
+ const item2 = iterator2.next();
13634
+ if (item1.done && item2.done)
13635
+ return true;
13636
+ if (item1.done || item2.done)
13637
+ return false;
13638
+ if (!comparator(item1.value, item2.value))
13639
+ return false;
13731
13640
  }
13732
- const lContext = getLContext(element);
13733
- const lView = lContext ? lContext.lView : null;
13734
- if (lView === null) {
13735
- return null;
13641
+ }
13642
+ function iterateListLike(obj, fn) {
13643
+ if (Array.isArray(obj)) {
13644
+ for (let i = 0; i < obj.length; i++) {
13645
+ fn(obj[i]);
13646
+ }
13736
13647
  }
13737
- const nodeIndex = lContext.nodeIndex;
13738
- if (nodeIndex !== -1) {
13739
- const valueInLView = lView[nodeIndex];
13740
- // this means that value in the lView is a component with its own
13741
- // data. In this situation the TNode is not accessed at the same spot.
13742
- const tNode = isLView(valueInLView) ? valueInLView[T_HOST] : getTNode(lView[TVIEW], nodeIndex);
13743
- ngDevMode &&
13744
- assertEqual(tNode.index, nodeIndex, 'Expecting that TNode at index is same as index');
13745
- return buildDebugNode(tNode, lView);
13648
+ else {
13649
+ const iterator = obj[getSymbolIterator()]();
13650
+ let item;
13651
+ while (!((item = iterator.next()).done)) {
13652
+ fn(item.value);
13653
+ }
13746
13654
  }
13747
- return null;
13748
- }
13749
- /**
13750
- * Retrieve the component `LView` from component/element.
13751
- *
13752
- * NOTE: `LView` is a private and should not be leaked outside.
13753
- * Don't export this method to `ng.*` on window.
13754
- *
13755
- * @param target DOM element or component instance for which to retrieve the LView.
13756
- */
13757
- function getComponentLView(target) {
13758
- const lContext = getLContext(target);
13759
- const nodeIndx = lContext.nodeIndex;
13760
- const lView = lContext.lView;
13761
- ngDevMode && assertLView(lView);
13762
- const componentLView = lView[nodeIndx];
13763
- ngDevMode && assertLView(componentLView);
13764
- return componentLView;
13765
13655
  }
13766
- /** Asserts that a value is a DOM Element. */
13767
- function assertDomElement(value) {
13768
- if (typeof Element !== 'undefined' && !(value instanceof Element)) {
13769
- throw new Error('Expecting instance of DOM Element');
13770
- }
13656
+ function isJsObject(o) {
13657
+ return o !== null && (typeof o === 'function' || typeof o === 'object');
13771
13658
  }
13772
13659
 
13773
13660
  /**
@@ -13777,18 +13664,22 @@ function assertDomElement(value) {
13777
13664
  * Use of this source code is governed by an MIT-style license that can be
13778
13665
  * found in the LICENSE file at https://angular.io/license
13779
13666
  */
13780
- /**
13781
- * Marks a component for check (in case of OnPush components) and synchronously
13782
- * performs change detection on the application this component belongs to.
13783
- *
13784
- * @param component Component to {@link ChangeDetectorRef#markForCheck mark for check}.
13785
- *
13786
- * @publicApi
13787
- * @globalApi ng
13788
- */
13789
- function applyChanges(component) {
13790
- markDirty(component);
13791
- getRootComponents(component).forEach(rootComponent => detectChanges(rootComponent));
13667
+ function devModeEqual(a, b) {
13668
+ const isListLikeIterableA = isListLikeIterable(a);
13669
+ const isListLikeIterableB = isListLikeIterable(b);
13670
+ if (isListLikeIterableA && isListLikeIterableB) {
13671
+ return areIterablesEqual(a, b, devModeEqual);
13672
+ }
13673
+ else {
13674
+ const isAObject = a && (typeof a === 'object' || typeof a === 'function');
13675
+ const isBObject = b && (typeof b === 'object' || typeof b === 'function');
13676
+ if (!isListLikeIterableA && isAObject && !isListLikeIterableB && isBObject) {
13677
+ return true;
13678
+ }
13679
+ else {
13680
+ return Object.is(a, b);
13681
+ }
13682
+ }
13792
13683
  }
13793
13684
 
13794
13685
  /**
@@ -13798,70 +13689,73 @@ function applyChanges(component) {
13798
13689
  * Use of this source code is governed by an MIT-style license that can be
13799
13690
  * found in the LICENSE file at https://angular.io/license
13800
13691
  */
13692
+ // TODO(misko): consider inlining
13693
+ /** Updates binding and returns the value. */
13694
+ function updateBinding(lView, bindingIndex, value) {
13695
+ return lView[bindingIndex] = value;
13696
+ }
13697
+ /** Gets the current binding value. */
13698
+ function getBinding(lView, bindingIndex) {
13699
+ ngDevMode && assertIndexInRange(lView, bindingIndex);
13700
+ ngDevMode &&
13701
+ assertNotSame(lView[bindingIndex], NO_CHANGE, 'Stored value should never be NO_CHANGE.');
13702
+ return lView[bindingIndex];
13703
+ }
13801
13704
  /**
13802
- * This file introduces series of globally accessible debug tools
13803
- * to allow for the Angular debugging story to function.
13804
- *
13805
- * To see this in action run the following command:
13806
- *
13807
- * bazel run //packages/core/test/bundling/todo:devserver
13705
+ * Updates binding if changed, then returns whether it was updated.
13808
13706
  *
13809
- * Then load `localhost:5432` and start using the console tools.
13810
- */
13811
- /**
13812
- * This value reflects the property on the window where the dev
13813
- * tools are patched (window.ng).
13814
- * */
13815
- const GLOBAL_PUBLISH_EXPANDO_KEY = 'ng';
13816
- let _published = false;
13817
- /**
13818
- * Publishes a collection of default debug tools onto`window.ng`.
13707
+ * This function also checks the `CheckNoChangesMode` and throws if changes are made.
13708
+ * Some changes (Objects/iterables) during `CheckNoChangesMode` are exempt to comply with VE
13709
+ * behavior.
13819
13710
  *
13820
- * These functions are available globally when Angular is in development
13821
- * mode and are automatically stripped away from prod mode is on.
13711
+ * @param lView current `LView`
13712
+ * @param bindingIndex The binding in the `LView` to check
13713
+ * @param value New value to check against `lView[bindingIndex]`
13714
+ * @returns `true` if the bindings has changed. (Throws if binding has changed during
13715
+ * `CheckNoChangesMode`)
13822
13716
  */
13823
- function publishDefaultGlobalUtils$1() {
13824
- if (!_published) {
13825
- _published = true;
13826
- /**
13827
- * Warning: this function is *INTERNAL* and should not be relied upon in application's code.
13828
- * The contract of the function might be changed in any release and/or the function can be
13829
- * removed completely.
13830
- */
13831
- publishGlobalUtil('ɵsetProfiler', setProfiler);
13832
- publishGlobalUtil('getDirectiveMetadata', getDirectiveMetadata$1);
13833
- publishGlobalUtil('getComponent', getComponent$1);
13834
- publishGlobalUtil('getContext', getContext);
13835
- publishGlobalUtil('getListeners', getListeners);
13836
- publishGlobalUtil('getOwningComponent', getOwningComponent);
13837
- publishGlobalUtil('getHostElement', getHostElement);
13838
- publishGlobalUtil('getInjector', getInjector);
13839
- publishGlobalUtil('getRootComponents', getRootComponents);
13840
- publishGlobalUtil('getDirectives', getDirectives);
13841
- publishGlobalUtil('applyChanges', applyChanges);
13717
+ function bindingUpdated(lView, bindingIndex, value) {
13718
+ ngDevMode && assertNotSame(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');
13719
+ ngDevMode &&
13720
+ assertLessThan(bindingIndex, lView.length, `Slot should have been initialized to NO_CHANGE`);
13721
+ const oldValue = lView[bindingIndex];
13722
+ if (Object.is(oldValue, value)) {
13723
+ return false;
13842
13724
  }
13843
- }
13844
- /**
13845
- * Publishes the given function to `window.ng` so that it can be
13846
- * used from the browser console when an application is not in production.
13847
- */
13848
- function publishGlobalUtil(name, fn) {
13849
- if (typeof COMPILED === 'undefined' || !COMPILED) {
13850
- // Note: we can't export `ng` when using closure enhanced optimization as:
13851
- // - closure declares globals itself for minified names, which sometimes clobber our `ng` global
13852
- // - we can't declare a closure extern as the namespace `ng` is already used within Google
13853
- // for typings for AngularJS (via `goog.provide('ng....')`).
13854
- const w = _global;
13855
- ngDevMode && assertDefined(fn, 'function not defined');
13856
- if (w) {
13857
- let container = w[GLOBAL_PUBLISH_EXPANDO_KEY];
13858
- if (!container) {
13859
- container = w[GLOBAL_PUBLISH_EXPANDO_KEY] = {};
13725
+ else {
13726
+ if (ngDevMode && isInCheckNoChangesMode()) {
13727
+ // View engine didn't report undefined values as changed on the first checkNoChanges pass
13728
+ // (before the change detection was run).
13729
+ const oldValueToCompare = oldValue !== NO_CHANGE ? oldValue : undefined;
13730
+ if (!devModeEqual(oldValueToCompare, value)) {
13731
+ const details = getExpressionChangedErrorDetails(lView, bindingIndex, oldValueToCompare, value);
13732
+ throwErrorIfNoChangesMode(oldValue === NO_CHANGE, details.oldValue, details.newValue, details.propName);
13860
13733
  }
13861
- container[name] = fn;
13734
+ // There was a change, but the `devModeEqual` decided that the change is exempt from an error.
13735
+ // For this reason we exit as if no change. The early exit is needed to prevent the changed
13736
+ // value to be written into `LView` (If we would write the new value that we would not see it
13737
+ // as change on next CD.)
13738
+ return false;
13862
13739
  }
13740
+ lView[bindingIndex] = value;
13741
+ return true;
13863
13742
  }
13864
13743
  }
13744
+ /** Updates 2 bindings if changed, then returns whether either was updated. */
13745
+ function bindingUpdated2(lView, bindingIndex, exp1, exp2) {
13746
+ const different = bindingUpdated(lView, bindingIndex, exp1);
13747
+ return bindingUpdated(lView, bindingIndex + 1, exp2) || different;
13748
+ }
13749
+ /** Updates 3 bindings if changed, then returns whether any was updated. */
13750
+ function bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) {
13751
+ const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);
13752
+ return bindingUpdated(lView, bindingIndex + 2, exp3) || different;
13753
+ }
13754
+ /** Updates 4 bindings if changed, then returns whether any was updated. */
13755
+ function bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4) {
13756
+ const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);
13757
+ return bindingUpdated2(lView, bindingIndex + 2, exp3, exp4) || different;
13758
+ }
13865
13759
 
13866
13760
  /**
13867
13761
  * @license
@@ -13870,981 +13764,377 @@ function publishGlobalUtil(name, fn) {
13870
13764
  * Use of this source code is governed by an MIT-style license that can be
13871
13765
  * found in the LICENSE file at https://angular.io/license
13872
13766
  */
13873
- // TODO: A hack to not pull in the NullInjector from @angular/core.
13874
- const NULL_INJECTOR = {
13875
- get: (token, notFoundValue) => {
13876
- throwProviderNotFoundError(token, 'NullInjector');
13877
- }
13878
- };
13879
13767
  /**
13880
- * Bootstraps a Component into an existing host element and returns an instance
13881
- * of the component.
13768
+ * Updates the value of or removes a bound attribute on an Element.
13769
+ *
13770
+ * Used in the case of `[attr.title]="value"`
13882
13771
  *
13883
- * Use this function to bootstrap a component into the DOM tree. Each invocation
13884
- * of this function will create a separate tree of components, injectors and
13885
- * change detection cycles and lifetimes. To dynamically insert a new component
13886
- * into an existing tree such that it shares the same injection, change detection
13887
- * and object lifetime, use {@link ViewContainer#createComponent}.
13772
+ * @param name name The name of the attribute.
13773
+ * @param value value The attribute is removed when value is `null` or `undefined`.
13774
+ * Otherwise the attribute value is set to the stringified value.
13775
+ * @param sanitizer An optional function used to sanitize the value.
13776
+ * @param namespace Optional namespace to use when setting the attribute.
13888
13777
  *
13889
- * @param componentType Component to bootstrap
13890
- * @param options Optional parameters which control bootstrapping
13778
+ * @codeGenApi
13891
13779
  */
13892
- function renderComponent(componentType /* Type as workaround for: Microsoft/TypeScript/issues/4881 */, opts = {}) {
13893
- ngDevMode && publishDefaultGlobalUtils$1();
13894
- ngDevMode && assertComponentType(componentType);
13895
- enableRenderer3();
13896
- const rendererFactory = opts.rendererFactory || domRendererFactory3;
13897
- const sanitizer = opts.sanitizer || null;
13898
- const componentDef = getComponentDef(componentType);
13899
- if (componentDef.type != componentType)
13900
- componentDef.type = componentType;
13901
- // The first index of the first selector is the tag name.
13902
- const componentTag = componentDef.selectors[0][0];
13903
- const hostRenderer = rendererFactory.createRenderer(null, null);
13904
- const hostRNode = locateHostElement(hostRenderer, opts.host || componentTag, componentDef.encapsulation);
13905
- const rootFlags = componentDef.onPush ? 32 /* LViewFlags.Dirty */ | 256 /* LViewFlags.IsRoot */ :
13906
- 16 /* LViewFlags.CheckAlways */ | 256 /* LViewFlags.IsRoot */;
13907
- const rootContext = createRootContext(opts.scheduler, opts.playerHandler);
13908
- const renderer = rendererFactory.createRenderer(hostRNode, componentDef);
13909
- const rootTView = createTView(0 /* TViewType.Root */, null, null, 1, 0, null, null, null, null, null);
13910
- const rootView = createLView(null, rootTView, rootContext, rootFlags, null, null, rendererFactory, renderer, null, opts.injector || null, null);
13911
- enterView(rootView);
13912
- let component;
13913
- try {
13914
- if (rendererFactory.begin)
13915
- rendererFactory.begin();
13916
- const componentView = createRootComponentView(hostRNode, componentDef, rootView, rendererFactory, renderer, sanitizer);
13917
- component = createRootComponent(componentView, componentDef, rootView, rootContext, opts.hostFeatures || null);
13918
- // create mode pass
13919
- renderView(rootTView, rootView, null);
13920
- // update mode pass
13921
- refreshView(rootTView, rootView, null, null);
13922
- }
13923
- finally {
13924
- leaveView();
13925
- if (rendererFactory.end)
13926
- rendererFactory.end();
13780
+ function ɵɵattribute(name, value, sanitizer, namespace) {
13781
+ const lView = getLView();
13782
+ const bindingIndex = nextBindingIndex();
13783
+ if (bindingUpdated(lView, bindingIndex, value)) {
13784
+ const tView = getTView();
13785
+ const tNode = getSelectedTNode();
13786
+ elementAttributeInternal(tNode, lView, name, value, sanitizer, namespace);
13787
+ ngDevMode && storePropertyBindingMetadata(tView.data, tNode, 'attr.' + name, bindingIndex);
13927
13788
  }
13928
- return component;
13789
+ return ɵɵattribute;
13929
13790
  }
13791
+
13930
13792
  /**
13931
- * Creates the root component view and the root component node.
13932
- *
13933
- * @param rNode Render host element.
13934
- * @param def ComponentDef
13935
- * @param rootView The parent view where the host node is stored
13936
- * @param rendererFactory Factory to be used for creating child renderers.
13937
- * @param hostRenderer The current renderer
13938
- * @param sanitizer The sanitizer, if provided
13793
+ * @license
13794
+ * Copyright Google LLC All Rights Reserved.
13939
13795
  *
13940
- * @returns Component view created
13796
+ * Use of this source code is governed by an MIT-style license that can be
13797
+ * found in the LICENSE file at https://angular.io/license
13941
13798
  */
13942
- function createRootComponentView(rNode, def, rootView, rendererFactory, hostRenderer, sanitizer) {
13943
- const tView = rootView[TVIEW];
13944
- const index = HEADER_OFFSET;
13945
- ngDevMode && assertIndexInRange(rootView, index);
13946
- rootView[index] = rNode;
13947
- // '#host' is added here as we don't know the real host DOM name (we don't want to read it) and at
13948
- // the same time we want to communicate the debug `TNode` that this is a special `TNode`
13949
- // representing a host element.
13950
- const tNode = getOrCreateTNode(tView, index, 2 /* TNodeType.Element */, '#host', null);
13951
- const mergedAttrs = tNode.mergedAttrs = def.hostAttrs;
13952
- if (mergedAttrs !== null) {
13953
- computeStaticStyling(tNode, mergedAttrs, true);
13954
- if (rNode !== null) {
13955
- setUpAttributes(hostRenderer, rNode, mergedAttrs);
13956
- if (tNode.classes !== null) {
13957
- writeDirectClass(hostRenderer, rNode, tNode.classes);
13958
- }
13959
- if (tNode.styles !== null) {
13960
- writeDirectStyle(hostRenderer, rNode, tNode.styles);
13961
- }
13962
- }
13963
- }
13964
- const viewRenderer = rendererFactory.createRenderer(rNode, def);
13965
- const componentView = createLView(rootView, getOrCreateTComponentView(def), null, def.onPush ? 32 /* LViewFlags.Dirty */ : 16 /* LViewFlags.CheckAlways */, rootView[index], tNode, rendererFactory, viewRenderer, sanitizer || null, null, null);
13966
- if (tView.firstCreatePass) {
13967
- diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, rootView), tView, def.type);
13968
- markAsComponentHost(tView, tNode);
13969
- initTNodeFlags(tNode, rootView.length, 1);
13970
- }
13971
- addToViewTree(rootView, componentView);
13972
- // Store component view at node index, with node as the HOST
13973
- return rootView[index] = componentView;
13974
- }
13975
13799
  /**
13976
- * Creates a root component and sets it up with features and host bindings. Shared by
13977
- * renderComponent() and ViewContainerRef.createComponent().
13800
+ * Create interpolation bindings with a variable number of expressions.
13801
+ *
13802
+ * If there are 1 to 8 expressions `interpolation1()` to `interpolation8()` should be used instead.
13803
+ * Those are faster because there is no need to create an array of expressions and iterate over it.
13804
+ *
13805
+ * `values`:
13806
+ * - has static text at even indexes,
13807
+ * - has evaluated expressions at odd indexes.
13808
+ *
13809
+ * Returns the concatenated string when any of the arguments changes, `NO_CHANGE` otherwise.
13978
13810
  */
13979
- function createRootComponent(componentView, componentDef, rootLView, rootContext, hostFeatures) {
13980
- const tView = rootLView[TVIEW];
13981
- // Create directive instance with factory() and store at next index in viewData
13982
- const component = instantiateRootComponent(tView, rootLView, componentDef);
13983
- rootContext.components.push(component);
13984
- componentView[CONTEXT] = component;
13985
- if (hostFeatures !== null) {
13986
- for (const feature of hostFeatures) {
13987
- feature(component, componentDef);
13988
- }
13811
+ function interpolationV(lView, values) {
13812
+ ngDevMode && assertLessThan(2, values.length, 'should have at least 3 values');
13813
+ ngDevMode && assertEqual(values.length % 2, 1, 'should have an odd number of values');
13814
+ let isBindingUpdated = false;
13815
+ let bindingIndex = getBindingIndex();
13816
+ for (let i = 1; i < values.length; i += 2) {
13817
+ // Check if bindings (odd indexes) have changed
13818
+ isBindingUpdated = bindingUpdated(lView, bindingIndex++, values[i]) || isBindingUpdated;
13989
13819
  }
13990
- // We want to generate an empty QueryList for root content queries for backwards
13991
- // compatibility with ViewEngine.
13992
- if (componentDef.contentQueries) {
13993
- const tNode = getCurrentTNode();
13994
- ngDevMode && assertDefined(tNode, 'TNode expected');
13995
- componentDef.contentQueries(1 /* RenderFlags.Create */, component, tNode.directiveStart);
13820
+ setBindingIndex(bindingIndex);
13821
+ if (!isBindingUpdated) {
13822
+ return NO_CHANGE;
13996
13823
  }
13997
- const rootTNode = getCurrentTNode();
13998
- ngDevMode && assertDefined(rootTNode, 'tNode should have been already created');
13999
- if (tView.firstCreatePass &&
14000
- (componentDef.hostBindings !== null || componentDef.hostAttrs !== null)) {
14001
- setSelectedIndex(rootTNode.index);
14002
- const rootTView = rootLView[TVIEW];
14003
- registerHostBindingOpCodes(rootTView, rootTNode, rootLView, rootTNode.directiveStart, rootTNode.directiveEnd, componentDef);
14004
- invokeHostBindingsInCreationMode(componentDef, component);
13824
+ // Build the updated content
13825
+ let content = values[0];
13826
+ for (let i = 1; i < values.length; i += 2) {
13827
+ content += renderStringify(values[i]) + values[i + 1];
14005
13828
  }
14006
- return component;
14007
- }
14008
- function createRootContext(scheduler, playerHandler) {
14009
- return {
14010
- components: [],
14011
- scheduler: scheduler || defaultScheduler,
14012
- clean: CLEAN_PROMISE,
14013
- playerHandler: playerHandler || null,
14014
- flags: 0 /* RootContextFlags.Empty */
14015
- };
13829
+ return content;
14016
13830
  }
14017
13831
  /**
14018
- * Used to enable lifecycle hooks on the root component.
14019
- *
14020
- * Include this feature when calling `renderComponent` if the root component
14021
- * you are rendering has lifecycle hooks defined. Otherwise, the hooks won't
14022
- * be called properly.
14023
- *
14024
- * Example:
13832
+ * Creates an interpolation binding with 1 expression.
14025
13833
  *
14026
- * ```
14027
- * renderComponent(AppComponent, {hostFeatures: [LifecycleHooksFeature]});
14028
- * ```
13834
+ * @param prefix static value used for concatenation only.
13835
+ * @param v0 value checked for change.
13836
+ * @param suffix static value used for concatenation only.
14029
13837
  */
14030
- function LifecycleHooksFeature() {
14031
- const tNode = getCurrentTNode();
14032
- ngDevMode && assertDefined(tNode, 'TNode is required');
14033
- registerPostOrderHooks(getLView()[TVIEW], tNode);
13838
+ function interpolation1(lView, prefix, v0, suffix) {
13839
+ const different = bindingUpdated(lView, nextBindingIndex(), v0);
13840
+ return different ? prefix + renderStringify(v0) + suffix : NO_CHANGE;
14034
13841
  }
14035
13842
  /**
14036
- * Wait on component until it is rendered.
14037
- *
14038
- * This function returns a `Promise` which is resolved when the component's
14039
- * change detection is executed. This is determined by finding the scheduler
14040
- * associated with the `component`'s render tree and waiting until the scheduler
14041
- * flushes. If nothing is scheduled, the function returns a resolved promise.
14042
- *
14043
- * Example:
14044
- * ```
14045
- * await whenRendered(myComponent);
14046
- * ```
14047
- *
14048
- * @param component Component to wait upon
14049
- * @returns Promise which resolves when the component is rendered.
13843
+ * Creates an interpolation binding with 2 expressions.
14050
13844
  */
14051
- function whenRendered(component) {
14052
- return getRootContext(component).clean;
13845
+ function interpolation2(lView, prefix, v0, i0, v1, suffix) {
13846
+ const bindingIndex = getBindingIndex();
13847
+ const different = bindingUpdated2(lView, bindingIndex, v0, v1);
13848
+ incrementBindingIndex(2);
13849
+ return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + suffix : NO_CHANGE;
14053
13850
  }
14054
-
14055
13851
  /**
14056
- * @license
14057
- * Copyright Google LLC All Rights Reserved.
14058
- *
14059
- * Use of this source code is governed by an MIT-style license that can be
14060
- * found in the LICENSE file at https://angular.io/license
13852
+ * Creates an interpolation binding with 3 expressions.
14061
13853
  */
14062
- function getSuperType(type) {
14063
- return Object.getPrototypeOf(type.prototype).constructor;
13854
+ function interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix) {
13855
+ const bindingIndex = getBindingIndex();
13856
+ const different = bindingUpdated3(lView, bindingIndex, v0, v1, v2);
13857
+ incrementBindingIndex(3);
13858
+ return different ?
13859
+ prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + suffix :
13860
+ NO_CHANGE;
14064
13861
  }
14065
13862
  /**
14066
- * Merges the definition from a super class to a sub class.
14067
- * @param definition The definition that is a SubClass of another directive of component
14068
- *
14069
- * @codeGenApi
13863
+ * Create an interpolation binding with 4 expressions.
14070
13864
  */
14071
- function ɵɵInheritDefinitionFeature(definition) {
14072
- let superType = getSuperType(definition.type);
14073
- let shouldInheritFields = true;
14074
- const inheritanceChain = [definition];
14075
- while (superType) {
14076
- let superDef = undefined;
14077
- if (isComponentDef(definition)) {
14078
- // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
14079
- superDef = superType.ɵcmp || superType.ɵdir;
14080
- }
14081
- else {
14082
- if (superType.ɵcmp) {
14083
- throw new RuntimeError(903 /* RuntimeErrorCode.INVALID_INHERITANCE */, ngDevMode &&
14084
- `Directives cannot inherit Components. Directive ${stringifyForError(definition.type)} is attempting to extend component ${stringifyForError(superType)}`);
14085
- }
14086
- // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
14087
- superDef = superType.ɵdir;
14088
- }
14089
- if (superDef) {
14090
- if (shouldInheritFields) {
14091
- inheritanceChain.push(superDef);
14092
- // Some fields in the definition may be empty, if there were no values to put in them that
14093
- // would've justified object creation. Unwrap them if necessary.
14094
- const writeableDef = definition;
14095
- writeableDef.inputs = maybeUnwrapEmpty(definition.inputs);
14096
- writeableDef.declaredInputs = maybeUnwrapEmpty(definition.declaredInputs);
14097
- writeableDef.outputs = maybeUnwrapEmpty(definition.outputs);
14098
- // Merge hostBindings
14099
- const superHostBindings = superDef.hostBindings;
14100
- superHostBindings && inheritHostBindings(definition, superHostBindings);
14101
- // Merge queries
14102
- const superViewQuery = superDef.viewQuery;
14103
- const superContentQueries = superDef.contentQueries;
14104
- superViewQuery && inheritViewQuery(definition, superViewQuery);
14105
- superContentQueries && inheritContentQueries(definition, superContentQueries);
14106
- // Merge inputs and outputs
14107
- fillProperties(definition.inputs, superDef.inputs);
14108
- fillProperties(definition.declaredInputs, superDef.declaredInputs);
14109
- fillProperties(definition.outputs, superDef.outputs);
14110
- // Merge animations metadata.
14111
- // If `superDef` is a Component, the `data` field is present (defaults to an empty object).
14112
- if (isComponentDef(superDef) && superDef.data.animation) {
14113
- // If super def is a Component, the `definition` is also a Component, since Directives can
14114
- // not inherit Components (we throw an error above and cannot reach this code).
14115
- const defData = definition.data;
14116
- defData.animation = (defData.animation || []).concat(superDef.data.animation);
14117
- }
14118
- }
14119
- // Run parent features
14120
- const features = superDef.features;
14121
- if (features) {
14122
- for (let i = 0; i < features.length; i++) {
14123
- const feature = features[i];
14124
- if (feature && feature.ngInherit) {
14125
- feature(definition);
14126
- }
14127
- // If `InheritDefinitionFeature` is a part of the current `superDef`, it means that this
14128
- // def already has all the necessary information inherited from its super class(es), so we
14129
- // can stop merging fields from super classes. However we need to iterate through the
14130
- // prototype chain to look for classes that might contain other "features" (like
14131
- // NgOnChanges), which we should invoke for the original `definition`. We set the
14132
- // `shouldInheritFields` flag to indicate that, essentially skipping fields inheritance
14133
- // logic and only invoking functions from the "features" list.
14134
- if (feature === ɵɵInheritDefinitionFeature) {
14135
- shouldInheritFields = false;
14136
- }
14137
- }
14138
- }
14139
- }
14140
- superType = Object.getPrototypeOf(superType);
14141
- }
14142
- mergeHostAttrsAcrossInheritance(inheritanceChain);
13865
+ function interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix) {
13866
+ const bindingIndex = getBindingIndex();
13867
+ const different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
13868
+ incrementBindingIndex(4);
13869
+ return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
13870
+ renderStringify(v2) + i2 + renderStringify(v3) + suffix :
13871
+ NO_CHANGE;
14143
13872
  }
14144
13873
  /**
14145
- * Merge the `hostAttrs` and `hostVars` from the inherited parent to the base class.
14146
- *
14147
- * @param inheritanceChain A list of `WritableDefs` starting at the top most type and listing
14148
- * sub-types in order. For each type take the `hostAttrs` and `hostVars` and merge it with the child
14149
- * type.
13874
+ * Creates an interpolation binding with 5 expressions.
14150
13875
  */
14151
- function mergeHostAttrsAcrossInheritance(inheritanceChain) {
14152
- let hostVars = 0;
14153
- let hostAttrs = null;
14154
- // We process the inheritance order from the base to the leaves here.
14155
- for (let i = inheritanceChain.length - 1; i >= 0; i--) {
14156
- const def = inheritanceChain[i];
14157
- // For each `hostVars`, we need to add the superclass amount.
14158
- def.hostVars = (hostVars += def.hostVars);
14159
- // for each `hostAttrs` we need to merge it with superclass.
14160
- def.hostAttrs =
14161
- mergeHostAttrs(def.hostAttrs, hostAttrs = mergeHostAttrs(hostAttrs, def.hostAttrs));
14162
- }
14163
- }
14164
- function maybeUnwrapEmpty(value) {
14165
- if (value === EMPTY_OBJ) {
14166
- return {};
14167
- }
14168
- else if (value === EMPTY_ARRAY) {
14169
- return [];
14170
- }
14171
- else {
14172
- return value;
14173
- }
14174
- }
14175
- function inheritViewQuery(definition, superViewQuery) {
14176
- const prevViewQuery = definition.viewQuery;
14177
- if (prevViewQuery) {
14178
- definition.viewQuery = (rf, ctx) => {
14179
- superViewQuery(rf, ctx);
14180
- prevViewQuery(rf, ctx);
14181
- };
14182
- }
14183
- else {
14184
- definition.viewQuery = superViewQuery;
14185
- }
14186
- }
14187
- function inheritContentQueries(definition, superContentQueries) {
14188
- const prevContentQueries = definition.contentQueries;
14189
- if (prevContentQueries) {
14190
- definition.contentQueries = (rf, ctx, directiveIndex) => {
14191
- superContentQueries(rf, ctx, directiveIndex);
14192
- prevContentQueries(rf, ctx, directiveIndex);
14193
- };
14194
- }
14195
- else {
14196
- definition.contentQueries = superContentQueries;
14197
- }
14198
- }
14199
- function inheritHostBindings(definition, superHostBindings) {
14200
- const prevHostBindings = definition.hostBindings;
14201
- if (prevHostBindings) {
14202
- definition.hostBindings = (rf, ctx) => {
14203
- superHostBindings(rf, ctx);
14204
- prevHostBindings(rf, ctx);
14205
- };
14206
- }
14207
- else {
14208
- definition.hostBindings = superHostBindings;
14209
- }
13876
+ function interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix) {
13877
+ const bindingIndex = getBindingIndex();
13878
+ let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
13879
+ different = bindingUpdated(lView, bindingIndex + 4, v4) || different;
13880
+ incrementBindingIndex(5);
13881
+ return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
13882
+ renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + suffix :
13883
+ NO_CHANGE;
14210
13884
  }
14211
-
14212
13885
  /**
14213
- * @license
14214
- * Copyright Google LLC All Rights Reserved.
14215
- *
14216
- * Use of this source code is governed by an MIT-style license that can be
14217
- * found in the LICENSE file at https://angular.io/license
13886
+ * Creates an interpolation binding with 6 expressions.
14218
13887
  */
13888
+ function interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix) {
13889
+ const bindingIndex = getBindingIndex();
13890
+ let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
13891
+ different = bindingUpdated2(lView, bindingIndex + 4, v4, v5) || different;
13892
+ incrementBindingIndex(6);
13893
+ return different ?
13894
+ prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + i2 +
13895
+ renderStringify(v3) + i3 + renderStringify(v4) + i4 + renderStringify(v5) + suffix :
13896
+ NO_CHANGE;
13897
+ }
14219
13898
  /**
14220
- * Fields which exist on either directive or component definitions, and need to be copied from
14221
- * parent to child classes by the `ɵɵCopyDefinitionFeature`.
13899
+ * Creates an interpolation binding with 7 expressions.
14222
13900
  */
14223
- const COPY_DIRECTIVE_FIELDS = [
14224
- // The child class should use the providers of its parent.
14225
- 'providersResolver',
14226
- // Not listed here are any fields which are handled by the `ɵɵInheritDefinitionFeature`, such
14227
- // as inputs, outputs, and host binding functions.
14228
- ];
13901
+ function interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix) {
13902
+ const bindingIndex = getBindingIndex();
13903
+ let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
13904
+ different = bindingUpdated3(lView, bindingIndex + 4, v4, v5, v6) || different;
13905
+ incrementBindingIndex(7);
13906
+ return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
13907
+ renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + i4 +
13908
+ renderStringify(v5) + i5 + renderStringify(v6) + suffix :
13909
+ NO_CHANGE;
13910
+ }
14229
13911
  /**
14230
- * Fields which exist only on component definitions, and need to be copied from parent to child
14231
- * classes by the `ɵɵCopyDefinitionFeature`.
14232
- *
14233
- * The type here allows any field of `ComponentDef` which is not also a property of `DirectiveDef`,
14234
- * since those should go in `COPY_DIRECTIVE_FIELDS` above.
13912
+ * Creates an interpolation binding with 8 expressions.
14235
13913
  */
14236
- const COPY_COMPONENT_FIELDS = [
14237
- // The child class should use the template function of its parent, including all template
14238
- // semantics.
14239
- 'template',
14240
- 'decls',
14241
- 'consts',
14242
- 'vars',
14243
- 'onPush',
14244
- 'ngContentSelectors',
14245
- // The child class should use the CSS styles of its parent, including all styling semantics.
14246
- 'styles',
14247
- 'encapsulation',
14248
- // The child class should be checked by the runtime in the same way as its parent.
14249
- 'schemas',
14250
- ];
13914
+ function interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix) {
13915
+ const bindingIndex = getBindingIndex();
13916
+ let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
13917
+ different = bindingUpdated4(lView, bindingIndex + 4, v4, v5, v6, v7) || different;
13918
+ incrementBindingIndex(8);
13919
+ return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
13920
+ renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + i4 +
13921
+ renderStringify(v5) + i5 + renderStringify(v6) + i6 + renderStringify(v7) + suffix :
13922
+ NO_CHANGE;
13923
+ }
13924
+
14251
13925
  /**
14252
- * Copies the fields not handled by the `ɵɵInheritDefinitionFeature` from the supertype of a
14253
- * definition.
14254
13926
  *
14255
- * This exists primarily to support ngcc migration of an existing View Engine pattern, where an
14256
- * entire decorator is inherited from a parent to a child class. When ngcc detects this case, it
14257
- * generates a skeleton definition on the child class, and applies this feature.
13927
+ * Update an interpolated attribute on an element with single bound value surrounded by text.
14258
13928
  *
14259
- * The `ɵɵCopyDefinitionFeature` then copies any needed fields from the parent class' definition,
14260
- * including things like the component template function.
13929
+ * Used when the value passed to a property has 1 interpolated value in it:
14261
13930
  *
14262
- * @param definition The definition of a child class which inherits from a parent class with its
14263
- * own definition.
13931
+ * ```html
13932
+ * <div attr.title="prefix{{v0}}suffix"></div>
13933
+ * ```
14264
13934
  *
14265
- * @codeGenApi
14266
- */
14267
- function ɵɵCopyDefinitionFeature(definition) {
14268
- let superType = getSuperType(definition.type);
14269
- let superDef = undefined;
14270
- if (isComponentDef(definition)) {
14271
- // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
14272
- superDef = superType.ɵcmp;
14273
- }
14274
- else {
14275
- // Don't use getComponentDef/getDirectiveDef. This logic relies on inheritance.
14276
- superDef = superType.ɵdir;
14277
- }
14278
- // Needed because `definition` fields are readonly.
14279
- const defAny = definition;
14280
- // Copy over any fields that apply to either directives or components.
14281
- for (const field of COPY_DIRECTIVE_FIELDS) {
14282
- defAny[field] = superDef[field];
14283
- }
14284
- if (isComponentDef(superDef)) {
14285
- // Copy over any component-specific fields.
14286
- for (const field of COPY_COMPONENT_FIELDS) {
14287
- defAny[field] = superDef[field];
14288
- }
14289
- }
14290
- }
14291
-
14292
- /**
14293
- * @license
14294
- * Copyright Google LLC All Rights Reserved.
13935
+ * Its compiled representation is::
14295
13936
  *
14296
- * Use of this source code is governed by an MIT-style license that can be
14297
- * found in the LICENSE file at https://angular.io/license
13937
+ * ```ts
13938
+ * ɵɵattributeInterpolate1('title', 'prefix', v0, 'suffix');
13939
+ * ```
13940
+ *
13941
+ * @param attrName The name of the attribute to update
13942
+ * @param prefix Static value used for concatenation only.
13943
+ * @param v0 Value checked for change.
13944
+ * @param suffix Static value used for concatenation only.
13945
+ * @param sanitizer An optional sanitizer function
13946
+ * @returns itself, so that it may be chained.
13947
+ * @codeGenApi
14298
13948
  */
14299
- let _symbolIterator = null;
14300
- function getSymbolIterator() {
14301
- if (!_symbolIterator) {
14302
- const Symbol = _global['Symbol'];
14303
- if (Symbol && Symbol.iterator) {
14304
- _symbolIterator = Symbol.iterator;
14305
- }
14306
- else {
14307
- // es6-shim specific logic
14308
- const keys = Object.getOwnPropertyNames(Map.prototype);
14309
- for (let i = 0; i < keys.length; ++i) {
14310
- const key = keys[i];
14311
- if (key !== 'entries' && key !== 'size' &&
14312
- Map.prototype[key] === Map.prototype['entries']) {
14313
- _symbolIterator = key;
14314
- }
14315
- }
14316
- }
13949
+ function ɵɵattributeInterpolate1(attrName, prefix, v0, suffix, sanitizer, namespace) {
13950
+ const lView = getLView();
13951
+ const interpolatedValue = interpolation1(lView, prefix, v0, suffix);
13952
+ if (interpolatedValue !== NO_CHANGE) {
13953
+ const tNode = getSelectedTNode();
13954
+ elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
13955
+ ngDevMode &&
13956
+ storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 1, prefix, suffix);
14317
13957
  }
14318
- return _symbolIterator;
13958
+ return ɵɵattributeInterpolate1;
14319
13959
  }
14320
-
14321
13960
  /**
14322
- * @license
14323
- * Copyright Google LLC All Rights Reserved.
14324
13961
  *
14325
- * Use of this source code is governed by an MIT-style license that can be
14326
- * found in the LICENSE file at https://angular.io/license
13962
+ * Update an interpolated attribute on an element with 2 bound values surrounded by text.
13963
+ *
13964
+ * Used when the value passed to a property has 2 interpolated values in it:
13965
+ *
13966
+ * ```html
13967
+ * <div attr.title="prefix{{v0}}-{{v1}}suffix"></div>
13968
+ * ```
13969
+ *
13970
+ * Its compiled representation is::
13971
+ *
13972
+ * ```ts
13973
+ * ɵɵattributeInterpolate2('title', 'prefix', v0, '-', v1, 'suffix');
13974
+ * ```
13975
+ *
13976
+ * @param attrName The name of the attribute to update
13977
+ * @param prefix Static value used for concatenation only.
13978
+ * @param v0 Value checked for change.
13979
+ * @param i0 Static value used for concatenation only.
13980
+ * @param v1 Value checked for change.
13981
+ * @param suffix Static value used for concatenation only.
13982
+ * @param sanitizer An optional sanitizer function
13983
+ * @returns itself, so that it may be chained.
13984
+ * @codeGenApi
14327
13985
  */
14328
- function isIterable(obj) {
14329
- return obj !== null && typeof obj === 'object' && obj[getSymbolIterator()] !== undefined;
14330
- }
14331
- function isListLikeIterable(obj) {
14332
- if (!isJsObject(obj))
14333
- return false;
14334
- return Array.isArray(obj) ||
14335
- (!(obj instanceof Map) && // JS Map are iterables but return entries as [k, v]
14336
- getSymbolIterator() in obj); // JS Iterable have a Symbol.iterator prop
14337
- }
14338
- function areIterablesEqual(a, b, comparator) {
14339
- const iterator1 = a[getSymbolIterator()]();
14340
- const iterator2 = b[getSymbolIterator()]();
14341
- while (true) {
14342
- const item1 = iterator1.next();
14343
- const item2 = iterator2.next();
14344
- if (item1.done && item2.done)
14345
- return true;
14346
- if (item1.done || item2.done)
14347
- return false;
14348
- if (!comparator(item1.value, item2.value))
14349
- return false;
14350
- }
14351
- }
14352
- function iterateListLike(obj, fn) {
14353
- if (Array.isArray(obj)) {
14354
- for (let i = 0; i < obj.length; i++) {
14355
- fn(obj[i]);
14356
- }
14357
- }
14358
- else {
14359
- const iterator = obj[getSymbolIterator()]();
14360
- let item;
14361
- while (!((item = iterator.next()).done)) {
14362
- fn(item.value);
14363
- }
13986
+ function ɵɵattributeInterpolate2(attrName, prefix, v0, i0, v1, suffix, sanitizer, namespace) {
13987
+ const lView = getLView();
13988
+ const interpolatedValue = interpolation2(lView, prefix, v0, i0, v1, suffix);
13989
+ if (interpolatedValue !== NO_CHANGE) {
13990
+ const tNode = getSelectedTNode();
13991
+ elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
13992
+ ngDevMode &&
13993
+ storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 2, prefix, i0, suffix);
14364
13994
  }
13995
+ return ɵɵattributeInterpolate2;
14365
13996
  }
14366
- function isJsObject(o) {
14367
- return o !== null && (typeof o === 'function' || typeof o === 'object');
14368
- }
14369
-
14370
13997
  /**
14371
- * @license
14372
- * Copyright Google LLC All Rights Reserved.
14373
13998
  *
14374
- * Use of this source code is governed by an MIT-style license that can be
14375
- * found in the LICENSE file at https://angular.io/license
13999
+ * Update an interpolated attribute on an element with 3 bound values surrounded by text.
14000
+ *
14001
+ * Used when the value passed to a property has 3 interpolated values in it:
14002
+ *
14003
+ * ```html
14004
+ * <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}suffix"></div>
14005
+ * ```
14006
+ *
14007
+ * Its compiled representation is::
14008
+ *
14009
+ * ```ts
14010
+ * ɵɵattributeInterpolate3(
14011
+ * 'title', 'prefix', v0, '-', v1, '-', v2, 'suffix');
14012
+ * ```
14013
+ *
14014
+ * @param attrName The name of the attribute to update
14015
+ * @param prefix Static value used for concatenation only.
14016
+ * @param v0 Value checked for change.
14017
+ * @param i0 Static value used for concatenation only.
14018
+ * @param v1 Value checked for change.
14019
+ * @param i1 Static value used for concatenation only.
14020
+ * @param v2 Value checked for change.
14021
+ * @param suffix Static value used for concatenation only.
14022
+ * @param sanitizer An optional sanitizer function
14023
+ * @returns itself, so that it may be chained.
14024
+ * @codeGenApi
14376
14025
  */
14377
- function devModeEqual(a, b) {
14378
- const isListLikeIterableA = isListLikeIterable(a);
14379
- const isListLikeIterableB = isListLikeIterable(b);
14380
- if (isListLikeIterableA && isListLikeIterableB) {
14381
- return areIterablesEqual(a, b, devModeEqual);
14382
- }
14383
- else {
14384
- const isAObject = a && (typeof a === 'object' || typeof a === 'function');
14385
- const isBObject = b && (typeof b === 'object' || typeof b === 'function');
14386
- if (!isListLikeIterableA && isAObject && !isListLikeIterableB && isBObject) {
14387
- return true;
14388
- }
14389
- else {
14390
- return Object.is(a, b);
14391
- }
14026
+ function ɵɵattributeInterpolate3(attrName, prefix, v0, i0, v1, i1, v2, suffix, sanitizer, namespace) {
14027
+ const lView = getLView();
14028
+ const interpolatedValue = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix);
14029
+ if (interpolatedValue !== NO_CHANGE) {
14030
+ const tNode = getSelectedTNode();
14031
+ elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
14032
+ ngDevMode &&
14033
+ storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 3, prefix, i0, i1, suffix);
14392
14034
  }
14035
+ return ɵɵattributeInterpolate3;
14393
14036
  }
14394
-
14395
14037
  /**
14396
- * @license
14397
- * Copyright Google LLC All Rights Reserved.
14398
14038
  *
14399
- * Use of this source code is governed by an MIT-style license that can be
14400
- * found in the LICENSE file at https://angular.io/license
14039
+ * Update an interpolated attribute on an element with 4 bound values surrounded by text.
14040
+ *
14041
+ * Used when the value passed to a property has 4 interpolated values in it:
14042
+ *
14043
+ * ```html
14044
+ * <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix"></div>
14045
+ * ```
14046
+ *
14047
+ * Its compiled representation is::
14048
+ *
14049
+ * ```ts
14050
+ * ɵɵattributeInterpolate4(
14051
+ * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');
14052
+ * ```
14053
+ *
14054
+ * @param attrName The name of the attribute to update
14055
+ * @param prefix Static value used for concatenation only.
14056
+ * @param v0 Value checked for change.
14057
+ * @param i0 Static value used for concatenation only.
14058
+ * @param v1 Value checked for change.
14059
+ * @param i1 Static value used for concatenation only.
14060
+ * @param v2 Value checked for change.
14061
+ * @param i2 Static value used for concatenation only.
14062
+ * @param v3 Value checked for change.
14063
+ * @param suffix Static value used for concatenation only.
14064
+ * @param sanitizer An optional sanitizer function
14065
+ * @returns itself, so that it may be chained.
14066
+ * @codeGenApi
14401
14067
  */
14402
- // TODO(misko): consider inlining
14403
- /** Updates binding and returns the value. */
14404
- function updateBinding(lView, bindingIndex, value) {
14405
- return lView[bindingIndex] = value;
14406
- }
14407
- /** Gets the current binding value. */
14408
- function getBinding(lView, bindingIndex) {
14409
- ngDevMode && assertIndexInRange(lView, bindingIndex);
14410
- ngDevMode &&
14411
- assertNotSame(lView[bindingIndex], NO_CHANGE, 'Stored value should never be NO_CHANGE.');
14412
- return lView[bindingIndex];
14068
+ function ɵɵattributeInterpolate4(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, suffix, sanitizer, namespace) {
14069
+ const lView = getLView();
14070
+ const interpolatedValue = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix);
14071
+ if (interpolatedValue !== NO_CHANGE) {
14072
+ const tNode = getSelectedTNode();
14073
+ elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
14074
+ ngDevMode &&
14075
+ storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 4, prefix, i0, i1, i2, suffix);
14076
+ }
14077
+ return ɵɵattributeInterpolate4;
14413
14078
  }
14414
14079
  /**
14415
- * Updates binding if changed, then returns whether it was updated.
14416
14080
  *
14417
- * This function also checks the `CheckNoChangesMode` and throws if changes are made.
14418
- * Some changes (Objects/iterables) during `CheckNoChangesMode` are exempt to comply with VE
14419
- * behavior.
14081
+ * Update an interpolated attribute on an element with 5 bound values surrounded by text.
14420
14082
  *
14421
- * @param lView current `LView`
14422
- * @param bindingIndex The binding in the `LView` to check
14423
- * @param value New value to check against `lView[bindingIndex]`
14424
- * @returns `true` if the bindings has changed. (Throws if binding has changed during
14425
- * `CheckNoChangesMode`)
14426
- */
14427
- function bindingUpdated(lView, bindingIndex, value) {
14428
- ngDevMode && assertNotSame(value, NO_CHANGE, 'Incoming value should never be NO_CHANGE.');
14429
- ngDevMode &&
14430
- assertLessThan(bindingIndex, lView.length, `Slot should have been initialized to NO_CHANGE`);
14431
- const oldValue = lView[bindingIndex];
14432
- if (Object.is(oldValue, value)) {
14433
- return false;
14434
- }
14435
- else {
14436
- if (ngDevMode && isInCheckNoChangesMode()) {
14437
- // View engine didn't report undefined values as changed on the first checkNoChanges pass
14438
- // (before the change detection was run).
14439
- const oldValueToCompare = oldValue !== NO_CHANGE ? oldValue : undefined;
14440
- if (!devModeEqual(oldValueToCompare, value)) {
14441
- const details = getExpressionChangedErrorDetails(lView, bindingIndex, oldValueToCompare, value);
14442
- throwErrorIfNoChangesMode(oldValue === NO_CHANGE, details.oldValue, details.newValue, details.propName);
14443
- }
14444
- // There was a change, but the `devModeEqual` decided that the change is exempt from an error.
14445
- // For this reason we exit as if no change. The early exit is needed to prevent the changed
14446
- // value to be written into `LView` (If we would write the new value that we would not see it
14447
- // as change on next CD.)
14448
- return false;
14449
- }
14450
- lView[bindingIndex] = value;
14451
- return true;
14452
- }
14453
- }
14454
- /** Updates 2 bindings if changed, then returns whether either was updated. */
14455
- function bindingUpdated2(lView, bindingIndex, exp1, exp2) {
14456
- const different = bindingUpdated(lView, bindingIndex, exp1);
14457
- return bindingUpdated(lView, bindingIndex + 1, exp2) || different;
14458
- }
14459
- /** Updates 3 bindings if changed, then returns whether any was updated. */
14460
- function bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) {
14461
- const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);
14462
- return bindingUpdated(lView, bindingIndex + 2, exp3) || different;
14463
- }
14464
- /** Updates 4 bindings if changed, then returns whether any was updated. */
14465
- function bindingUpdated4(lView, bindingIndex, exp1, exp2, exp3, exp4) {
14466
- const different = bindingUpdated2(lView, bindingIndex, exp1, exp2);
14467
- return bindingUpdated2(lView, bindingIndex + 2, exp3, exp4) || different;
14468
- }
14469
-
14470
- /**
14471
- * @license
14472
- * Copyright Google LLC All Rights Reserved.
14473
- *
14474
- * Use of this source code is governed by an MIT-style license that can be
14475
- * found in the LICENSE file at https://angular.io/license
14476
- */
14477
- /**
14478
- * Updates the value of or removes a bound attribute on an Element.
14479
- *
14480
- * Used in the case of `[attr.title]="value"`
14481
- *
14482
- * @param name name The name of the attribute.
14483
- * @param value value The attribute is removed when value is `null` or `undefined`.
14484
- * Otherwise the attribute value is set to the stringified value.
14485
- * @param sanitizer An optional function used to sanitize the value.
14486
- * @param namespace Optional namespace to use when setting the attribute.
14487
- *
14488
- * @codeGenApi
14489
- */
14490
- function ɵɵattribute(name, value, sanitizer, namespace) {
14491
- const lView = getLView();
14492
- const bindingIndex = nextBindingIndex();
14493
- if (bindingUpdated(lView, bindingIndex, value)) {
14494
- const tView = getTView();
14495
- const tNode = getSelectedTNode();
14496
- elementAttributeInternal(tNode, lView, name, value, sanitizer, namespace);
14497
- ngDevMode && storePropertyBindingMetadata(tView.data, tNode, 'attr.' + name, bindingIndex);
14498
- }
14499
- return ɵɵattribute;
14500
- }
14501
-
14502
- /**
14503
- * @license
14504
- * Copyright Google LLC All Rights Reserved.
14505
- *
14506
- * Use of this source code is governed by an MIT-style license that can be
14507
- * found in the LICENSE file at https://angular.io/license
14508
- */
14509
- /**
14510
- * Create interpolation bindings with a variable number of expressions.
14511
- *
14512
- * If there are 1 to 8 expressions `interpolation1()` to `interpolation8()` should be used instead.
14513
- * Those are faster because there is no need to create an array of expressions and iterate over it.
14514
- *
14515
- * `values`:
14516
- * - has static text at even indexes,
14517
- * - has evaluated expressions at odd indexes.
14518
- *
14519
- * Returns the concatenated string when any of the arguments changes, `NO_CHANGE` otherwise.
14520
- */
14521
- function interpolationV(lView, values) {
14522
- ngDevMode && assertLessThan(2, values.length, 'should have at least 3 values');
14523
- ngDevMode && assertEqual(values.length % 2, 1, 'should have an odd number of values');
14524
- let isBindingUpdated = false;
14525
- let bindingIndex = getBindingIndex();
14526
- for (let i = 1; i < values.length; i += 2) {
14527
- // Check if bindings (odd indexes) have changed
14528
- isBindingUpdated = bindingUpdated(lView, bindingIndex++, values[i]) || isBindingUpdated;
14529
- }
14530
- setBindingIndex(bindingIndex);
14531
- if (!isBindingUpdated) {
14532
- return NO_CHANGE;
14533
- }
14534
- // Build the updated content
14535
- let content = values[0];
14536
- for (let i = 1; i < values.length; i += 2) {
14537
- content += renderStringify(values[i]) + values[i + 1];
14538
- }
14539
- return content;
14540
- }
14541
- /**
14542
- * Creates an interpolation binding with 1 expression.
14543
- *
14544
- * @param prefix static value used for concatenation only.
14545
- * @param v0 value checked for change.
14546
- * @param suffix static value used for concatenation only.
14547
- */
14548
- function interpolation1(lView, prefix, v0, suffix) {
14549
- const different = bindingUpdated(lView, nextBindingIndex(), v0);
14550
- return different ? prefix + renderStringify(v0) + suffix : NO_CHANGE;
14551
- }
14552
- /**
14553
- * Creates an interpolation binding with 2 expressions.
14554
- */
14555
- function interpolation2(lView, prefix, v0, i0, v1, suffix) {
14556
- const bindingIndex = getBindingIndex();
14557
- const different = bindingUpdated2(lView, bindingIndex, v0, v1);
14558
- incrementBindingIndex(2);
14559
- return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + suffix : NO_CHANGE;
14560
- }
14561
- /**
14562
- * Creates an interpolation binding with 3 expressions.
14563
- */
14564
- function interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix) {
14565
- const bindingIndex = getBindingIndex();
14566
- const different = bindingUpdated3(lView, bindingIndex, v0, v1, v2);
14567
- incrementBindingIndex(3);
14568
- return different ?
14569
- prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + suffix :
14570
- NO_CHANGE;
14571
- }
14572
- /**
14573
- * Create an interpolation binding with 4 expressions.
14574
- */
14575
- function interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix) {
14576
- const bindingIndex = getBindingIndex();
14577
- const different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
14578
- incrementBindingIndex(4);
14579
- return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
14580
- renderStringify(v2) + i2 + renderStringify(v3) + suffix :
14581
- NO_CHANGE;
14582
- }
14583
- /**
14584
- * Creates an interpolation binding with 5 expressions.
14585
- */
14586
- function interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix) {
14587
- const bindingIndex = getBindingIndex();
14588
- let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
14589
- different = bindingUpdated(lView, bindingIndex + 4, v4) || different;
14590
- incrementBindingIndex(5);
14591
- return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
14592
- renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + suffix :
14593
- NO_CHANGE;
14594
- }
14595
- /**
14596
- * Creates an interpolation binding with 6 expressions.
14597
- */
14598
- function interpolation6(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, suffix) {
14599
- const bindingIndex = getBindingIndex();
14600
- let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
14601
- different = bindingUpdated2(lView, bindingIndex + 4, v4, v5) || different;
14602
- incrementBindingIndex(6);
14603
- return different ?
14604
- prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 + renderStringify(v2) + i2 +
14605
- renderStringify(v3) + i3 + renderStringify(v4) + i4 + renderStringify(v5) + suffix :
14606
- NO_CHANGE;
14607
- }
14608
- /**
14609
- * Creates an interpolation binding with 7 expressions.
14610
- */
14611
- function interpolation7(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, suffix) {
14612
- const bindingIndex = getBindingIndex();
14613
- let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
14614
- different = bindingUpdated3(lView, bindingIndex + 4, v4, v5, v6) || different;
14615
- incrementBindingIndex(7);
14616
- return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
14617
- renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + i4 +
14618
- renderStringify(v5) + i5 + renderStringify(v6) + suffix :
14619
- NO_CHANGE;
14620
- }
14621
- /**
14622
- * Creates an interpolation binding with 8 expressions.
14623
- */
14624
- function interpolation8(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, i4, v5, i5, v6, i6, v7, suffix) {
14625
- const bindingIndex = getBindingIndex();
14626
- let different = bindingUpdated4(lView, bindingIndex, v0, v1, v2, v3);
14627
- different = bindingUpdated4(lView, bindingIndex + 4, v4, v5, v6, v7) || different;
14628
- incrementBindingIndex(8);
14629
- return different ? prefix + renderStringify(v0) + i0 + renderStringify(v1) + i1 +
14630
- renderStringify(v2) + i2 + renderStringify(v3) + i3 + renderStringify(v4) + i4 +
14631
- renderStringify(v5) + i5 + renderStringify(v6) + i6 + renderStringify(v7) + suffix :
14632
- NO_CHANGE;
14633
- }
14634
-
14635
- /**
14636
- *
14637
- * Update an interpolated attribute on an element with single bound value surrounded by text.
14638
- *
14639
- * Used when the value passed to a property has 1 interpolated value in it:
14083
+ * Used when the value passed to a property has 5 interpolated values in it:
14640
14084
  *
14641
14085
  * ```html
14642
- * <div attr.title="prefix{{v0}}suffix"></div>
14086
+ * <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix"></div>
14643
14087
  * ```
14644
14088
  *
14645
14089
  * Its compiled representation is::
14646
14090
  *
14647
14091
  * ```ts
14648
- * ɵɵattributeInterpolate1('title', 'prefix', v0, 'suffix');
14092
+ * ɵɵattributeInterpolate5(
14093
+ * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');
14649
14094
  * ```
14650
14095
  *
14651
14096
  * @param attrName The name of the attribute to update
14652
14097
  * @param prefix Static value used for concatenation only.
14653
14098
  * @param v0 Value checked for change.
14099
+ * @param i0 Static value used for concatenation only.
14100
+ * @param v1 Value checked for change.
14101
+ * @param i1 Static value used for concatenation only.
14102
+ * @param v2 Value checked for change.
14103
+ * @param i2 Static value used for concatenation only.
14104
+ * @param v3 Value checked for change.
14105
+ * @param i3 Static value used for concatenation only.
14106
+ * @param v4 Value checked for change.
14654
14107
  * @param suffix Static value used for concatenation only.
14655
14108
  * @param sanitizer An optional sanitizer function
14656
14109
  * @returns itself, so that it may be chained.
14657
14110
  * @codeGenApi
14658
14111
  */
14659
- function ɵɵattributeInterpolate1(attrName, prefix, v0, suffix, sanitizer, namespace) {
14112
+ function ɵɵattributeInterpolate5(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix, sanitizer, namespace) {
14660
14113
  const lView = getLView();
14661
- const interpolatedValue = interpolation1(lView, prefix, v0, suffix);
14114
+ const interpolatedValue = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);
14662
14115
  if (interpolatedValue !== NO_CHANGE) {
14663
14116
  const tNode = getSelectedTNode();
14664
14117
  elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
14665
14118
  ngDevMode &&
14666
- storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 1, prefix, suffix);
14119
+ storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 5, prefix, i0, i1, i2, i3, suffix);
14667
14120
  }
14668
- return ɵɵattributeInterpolate1;
14121
+ return ɵɵattributeInterpolate5;
14669
14122
  }
14670
14123
  /**
14671
14124
  *
14672
- * Update an interpolated attribute on an element with 2 bound values surrounded by text.
14125
+ * Update an interpolated attribute on an element with 6 bound values surrounded by text.
14673
14126
  *
14674
- * Used when the value passed to a property has 2 interpolated values in it:
14127
+ * Used when the value passed to a property has 6 interpolated values in it:
14675
14128
  *
14676
14129
  * ```html
14677
- * <div attr.title="prefix{{v0}}-{{v1}}suffix"></div>
14130
+ * <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix"></div>
14678
14131
  * ```
14679
14132
  *
14680
14133
  * Its compiled representation is::
14681
14134
  *
14682
14135
  * ```ts
14683
- * ɵɵattributeInterpolate2('title', 'prefix', v0, '-', v1, 'suffix');
14684
- * ```
14685
- *
14686
- * @param attrName The name of the attribute to update
14687
- * @param prefix Static value used for concatenation only.
14688
- * @param v0 Value checked for change.
14689
- * @param i0 Static value used for concatenation only.
14690
- * @param v1 Value checked for change.
14691
- * @param suffix Static value used for concatenation only.
14692
- * @param sanitizer An optional sanitizer function
14693
- * @returns itself, so that it may be chained.
14694
- * @codeGenApi
14695
- */
14696
- function ɵɵattributeInterpolate2(attrName, prefix, v0, i0, v1, suffix, sanitizer, namespace) {
14697
- const lView = getLView();
14698
- const interpolatedValue = interpolation2(lView, prefix, v0, i0, v1, suffix);
14699
- if (interpolatedValue !== NO_CHANGE) {
14700
- const tNode = getSelectedTNode();
14701
- elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
14702
- ngDevMode &&
14703
- storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 2, prefix, i0, suffix);
14704
- }
14705
- return ɵɵattributeInterpolate2;
14706
- }
14707
- /**
14708
- *
14709
- * Update an interpolated attribute on an element with 3 bound values surrounded by text.
14710
- *
14711
- * Used when the value passed to a property has 3 interpolated values in it:
14712
- *
14713
- * ```html
14714
- * <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}suffix"></div>
14715
- * ```
14716
- *
14717
- * Its compiled representation is::
14718
- *
14719
- * ```ts
14720
- * ɵɵattributeInterpolate3(
14721
- * 'title', 'prefix', v0, '-', v1, '-', v2, 'suffix');
14722
- * ```
14723
- *
14724
- * @param attrName The name of the attribute to update
14725
- * @param prefix Static value used for concatenation only.
14726
- * @param v0 Value checked for change.
14727
- * @param i0 Static value used for concatenation only.
14728
- * @param v1 Value checked for change.
14729
- * @param i1 Static value used for concatenation only.
14730
- * @param v2 Value checked for change.
14731
- * @param suffix Static value used for concatenation only.
14732
- * @param sanitizer An optional sanitizer function
14733
- * @returns itself, so that it may be chained.
14734
- * @codeGenApi
14735
- */
14736
- function ɵɵattributeInterpolate3(attrName, prefix, v0, i0, v1, i1, v2, suffix, sanitizer, namespace) {
14737
- const lView = getLView();
14738
- const interpolatedValue = interpolation3(lView, prefix, v0, i0, v1, i1, v2, suffix);
14739
- if (interpolatedValue !== NO_CHANGE) {
14740
- const tNode = getSelectedTNode();
14741
- elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
14742
- ngDevMode &&
14743
- storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 3, prefix, i0, i1, suffix);
14744
- }
14745
- return ɵɵattributeInterpolate3;
14746
- }
14747
- /**
14748
- *
14749
- * Update an interpolated attribute on an element with 4 bound values surrounded by text.
14750
- *
14751
- * Used when the value passed to a property has 4 interpolated values in it:
14752
- *
14753
- * ```html
14754
- * <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}suffix"></div>
14755
- * ```
14756
- *
14757
- * Its compiled representation is::
14758
- *
14759
- * ```ts
14760
- * ɵɵattributeInterpolate4(
14761
- * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, 'suffix');
14762
- * ```
14763
- *
14764
- * @param attrName The name of the attribute to update
14765
- * @param prefix Static value used for concatenation only.
14766
- * @param v0 Value checked for change.
14767
- * @param i0 Static value used for concatenation only.
14768
- * @param v1 Value checked for change.
14769
- * @param i1 Static value used for concatenation only.
14770
- * @param v2 Value checked for change.
14771
- * @param i2 Static value used for concatenation only.
14772
- * @param v3 Value checked for change.
14773
- * @param suffix Static value used for concatenation only.
14774
- * @param sanitizer An optional sanitizer function
14775
- * @returns itself, so that it may be chained.
14776
- * @codeGenApi
14777
- */
14778
- function ɵɵattributeInterpolate4(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, suffix, sanitizer, namespace) {
14779
- const lView = getLView();
14780
- const interpolatedValue = interpolation4(lView, prefix, v0, i0, v1, i1, v2, i2, v3, suffix);
14781
- if (interpolatedValue !== NO_CHANGE) {
14782
- const tNode = getSelectedTNode();
14783
- elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
14784
- ngDevMode &&
14785
- storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 4, prefix, i0, i1, i2, suffix);
14786
- }
14787
- return ɵɵattributeInterpolate4;
14788
- }
14789
- /**
14790
- *
14791
- * Update an interpolated attribute on an element with 5 bound values surrounded by text.
14792
- *
14793
- * Used when the value passed to a property has 5 interpolated values in it:
14794
- *
14795
- * ```html
14796
- * <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}suffix"></div>
14797
- * ```
14798
- *
14799
- * Its compiled representation is::
14800
- *
14801
- * ```ts
14802
- * ɵɵattributeInterpolate5(
14803
- * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, 'suffix');
14804
- * ```
14805
- *
14806
- * @param attrName The name of the attribute to update
14807
- * @param prefix Static value used for concatenation only.
14808
- * @param v0 Value checked for change.
14809
- * @param i0 Static value used for concatenation only.
14810
- * @param v1 Value checked for change.
14811
- * @param i1 Static value used for concatenation only.
14812
- * @param v2 Value checked for change.
14813
- * @param i2 Static value used for concatenation only.
14814
- * @param v3 Value checked for change.
14815
- * @param i3 Static value used for concatenation only.
14816
- * @param v4 Value checked for change.
14817
- * @param suffix Static value used for concatenation only.
14818
- * @param sanitizer An optional sanitizer function
14819
- * @returns itself, so that it may be chained.
14820
- * @codeGenApi
14821
- */
14822
- function ɵɵattributeInterpolate5(attrName, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix, sanitizer, namespace) {
14823
- const lView = getLView();
14824
- const interpolatedValue = interpolation5(lView, prefix, v0, i0, v1, i1, v2, i2, v3, i3, v4, suffix);
14825
- if (interpolatedValue !== NO_CHANGE) {
14826
- const tNode = getSelectedTNode();
14827
- elementAttributeInternal(tNode, lView, attrName, interpolatedValue, sanitizer, namespace);
14828
- ngDevMode &&
14829
- storePropertyBindingMetadata(getTView().data, tNode, 'attr.' + attrName, getBindingIndex() - 5, prefix, i0, i1, i2, i3, suffix);
14830
- }
14831
- return ɵɵattributeInterpolate5;
14832
- }
14833
- /**
14834
- *
14835
- * Update an interpolated attribute on an element with 6 bound values surrounded by text.
14836
- *
14837
- * Used when the value passed to a property has 6 interpolated values in it:
14838
- *
14839
- * ```html
14840
- * <div attr.title="prefix{{v0}}-{{v1}}-{{v2}}-{{v3}}-{{v4}}-{{v5}}suffix"></div>
14841
- * ```
14842
- *
14843
- * Its compiled representation is::
14844
- *
14845
- * ```ts
14846
- * ɵɵattributeInterpolate6(
14847
- * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix');
14136
+ * ɵɵattributeInterpolate6(
14137
+ * 'title', 'prefix', v0, '-', v1, '-', v2, '-', v3, '-', v4, '-', v5, 'suffix');
14848
14138
  * ```
14849
14139
  *
14850
14140
  * @param attrName The name of the attribute to update
@@ -15017,6 +14307,57 @@ function ɵɵattributeInterpolateV(attrName, values, sanitizer, namespace) {
15017
14307
  return ɵɵattributeInterpolateV;
15018
14308
  }
15019
14309
 
14310
+ /**
14311
+ * @license
14312
+ * Copyright Google LLC All Rights Reserved.
14313
+ *
14314
+ * Use of this source code is governed by an MIT-style license that can be
14315
+ * found in the LICENSE file at https://angular.io/license
14316
+ */
14317
+ /**
14318
+ * Synchronously perform change detection on a component (and possibly its sub-components).
14319
+ *
14320
+ * This function triggers change detection in a synchronous way on a component.
14321
+ *
14322
+ * @param component The component which the change detection should be performed on.
14323
+ */
14324
+ function detectChanges(component) {
14325
+ const view = getComponentViewByInstance(component);
14326
+ detectChangesInternal(view[TVIEW], view, component);
14327
+ }
14328
+ /**
14329
+ * Marks the component as dirty (needing change detection). Marking a component dirty will
14330
+ * schedule a change detection on it at some point in the future.
14331
+ *
14332
+ * Marking an already dirty component as dirty won't do anything. Only one outstanding change
14333
+ * detection can be scheduled per component tree.
14334
+ *
14335
+ * @param component Component to mark as dirty.
14336
+ */
14337
+ function markDirty(component) {
14338
+ ngDevMode && assertDefined(component, 'component');
14339
+ const rootView = markViewDirty(getComponentViewByInstance(component));
14340
+ ngDevMode && assertDefined(rootView[CONTEXT], 'rootContext should be defined');
14341
+ scheduleTick(rootView[CONTEXT], 1 /* RootContextFlags.DetectChanges */);
14342
+ }
14343
+ /**
14344
+ * Used to perform change detection on the whole application.
14345
+ *
14346
+ * This is equivalent to `detectChanges`, but invoked on root component. Additionally, `tick`
14347
+ * executes lifecycle hooks and conditionally checks components based on their
14348
+ * `ChangeDetectionStrategy` and dirtiness.
14349
+ *
14350
+ * The preferred way to trigger change detection is to call `markDirty`. `markDirty` internally
14351
+ * schedules `tick` using a scheduler in order to coalesce multiple `markDirty` calls into a
14352
+ * single change detection run. By default, the scheduler is `requestAnimationFrame`, but can
14353
+ * be changed when calling `renderComponent` and providing the `scheduler` option.
14354
+ */
14355
+ function tick(component) {
14356
+ const rootView = getRootView(component);
14357
+ const rootContext = rootView[CONTEXT];
14358
+ tickRootContext(rootContext);
14359
+ }
14360
+
15020
14361
  /**
15021
14362
  * @license
15022
14363
  * Copyright Google LLC All Rights Reserved.
@@ -15561,51 +14902,42 @@ function listenerInternal(tView, lView, renderer, tNode, eventName, listenerFn,
15561
14902
  tNode.index;
15562
14903
  // In order to match current behavior, native DOM event listeners must be added for all
15563
14904
  // events (including outputs).
15564
- if (isProceduralRenderer(renderer)) {
15565
- // There might be cases where multiple directives on the same element try to register an event
15566
- // handler function for the same event. In this situation we want to avoid registration of
15567
- // several native listeners as each registration would be intercepted by NgZone and
15568
- // trigger change detection. This would mean that a single user action would result in several
15569
- // change detections being invoked. To avoid this situation we want to have only one call to
15570
- // native handler registration (for the same element and same type of event).
15571
- //
15572
- // In order to have just one native event handler in presence of multiple handler functions,
15573
- // we just register a first handler function as a native event listener and then chain
15574
- // (coalesce) other handler functions on top of the first native handler function.
15575
- let existingListener = null;
15576
- // Please note that the coalescing described here doesn't happen for events specifying an
15577
- // alternative target (ex. (document:click)) - this is to keep backward compatibility with the
15578
- // view engine.
15579
- // Also, we don't have to search for existing listeners is there are no directives
15580
- // matching on a given node as we can't register multiple event handlers for the same event in
15581
- // a template (this would mean having duplicate attributes).
15582
- if (!eventTargetResolver && isTNodeDirectiveHost) {
15583
- existingListener = findExistingListener(tView, lView, eventName, tNode.index);
15584
- }
15585
- if (existingListener !== null) {
15586
- // Attach a new listener to coalesced listeners list, maintaining the order in which
15587
- // listeners are registered. For performance reasons, we keep a reference to the last
15588
- // listener in that list (in `__ngLastListenerFn__` field), so we can avoid going through
15589
- // the entire set each time we need to add a new listener.
15590
- const lastListenerFn = existingListener.__ngLastListenerFn__ || existingListener;
15591
- lastListenerFn.__ngNextListenerFn__ = listenerFn;
15592
- existingListener.__ngLastListenerFn__ = listenerFn;
15593
- processOutputs = false;
15594
- }
15595
- else {
15596
- listenerFn = wrapListener(tNode, lView, context, listenerFn, false /** preventDefault */);
15597
- const cleanupFn = renderer.listen(target, eventName, listenerFn);
15598
- ngDevMode && ngDevMode.rendererAddEventListener++;
15599
- lCleanup.push(listenerFn, cleanupFn);
15600
- tCleanup && tCleanup.push(eventName, idxOrTargetGetter, lCleanupIndex, lCleanupIndex + 1);
15601
- }
14905
+ // There might be cases where multiple directives on the same element try to register an event
14906
+ // handler function for the same event. In this situation we want to avoid registration of
14907
+ // several native listeners as each registration would be intercepted by NgZone and
14908
+ // trigger change detection. This would mean that a single user action would result in several
14909
+ // change detections being invoked. To avoid this situation we want to have only one call to
14910
+ // native handler registration (for the same element and same type of event).
14911
+ //
14912
+ // In order to have just one native event handler in presence of multiple handler functions,
14913
+ // we just register a first handler function as a native event listener and then chain
14914
+ // (coalesce) other handler functions on top of the first native handler function.
14915
+ let existingListener = null;
14916
+ // Please note that the coalescing described here doesn't happen for events specifying an
14917
+ // alternative target (ex. (document:click)) - this is to keep backward compatibility with the
14918
+ // view engine.
14919
+ // Also, we don't have to search for existing listeners is there are no directives
14920
+ // matching on a given node as we can't register multiple event handlers for the same event in
14921
+ // a template (this would mean having duplicate attributes).
14922
+ if (!eventTargetResolver && isTNodeDirectiveHost) {
14923
+ existingListener = findExistingListener(tView, lView, eventName, tNode.index);
14924
+ }
14925
+ if (existingListener !== null) {
14926
+ // Attach a new listener to coalesced listeners list, maintaining the order in which
14927
+ // listeners are registered. For performance reasons, we keep a reference to the last
14928
+ // listener in that list (in `__ngLastListenerFn__` field), so we can avoid going through
14929
+ // the entire set each time we need to add a new listener.
14930
+ const lastListenerFn = existingListener.__ngLastListenerFn__ || existingListener;
14931
+ lastListenerFn.__ngNextListenerFn__ = listenerFn;
14932
+ existingListener.__ngLastListenerFn__ = listenerFn;
14933
+ processOutputs = false;
15602
14934
  }
15603
14935
  else {
15604
- listenerFn = wrapListener(tNode, lView, context, listenerFn, true /** preventDefault */);
15605
- target.addEventListener(eventName, listenerFn, useCapture);
14936
+ listenerFn = wrapListener(tNode, lView, context, listenerFn, false /** preventDefault */);
14937
+ const cleanupFn = renderer.listen(target, eventName, listenerFn);
15606
14938
  ngDevMode && ngDevMode.rendererAddEventListener++;
15607
- lCleanup.push(listenerFn);
15608
- tCleanup && tCleanup.push(eventName, idxOrTargetGetter, lCleanupIndex, useCapture);
14939
+ lCleanup.push(listenerFn, cleanupFn);
14940
+ tCleanup && tCleanup.push(eventName, idxOrTargetGetter, lCleanupIndex, lCleanupIndex + 1);
15609
14941
  }
15610
14942
  }
15611
14943
  else {
@@ -17679,7 +17011,7 @@ function findStylingValue(tData, tNode, lView, prop, index, isClassBased) {
17679
17011
  valueAtLViewIndex = isStylingMap ? EMPTY_ARRAY : undefined;
17680
17012
  }
17681
17013
  let currentValue = isStylingMap ? keyValueArrayGet(valueAtLViewIndex, prop) :
17682
- key === prop ? valueAtLViewIndex : undefined;
17014
+ (key === prop ? valueAtLViewIndex : undefined);
17683
17015
  if (containsStatics && !isStylingValuePresent(currentValue)) {
17684
17016
  currentValue = keyValueArrayGet(rawKey, prop);
17685
17017
  }
@@ -21532,7 +20864,7 @@ function noComponentFactoryError(component) {
21532
20864
  return error;
21533
20865
  }
21534
20866
  const ERROR_COMPONENT = 'ngComponent';
21535
- function getComponent(error) {
20867
+ function getComponent$1(error) {
21536
20868
  return error[ERROR_COMPONENT];
21537
20869
  }
21538
20870
  class _NullComponentFactoryResolver {
@@ -21716,14 +21048,6 @@ class Renderer2 {
21716
21048
  * @nocollapse
21717
21049
  */
21718
21050
  Renderer2.__NG_ELEMENT_ID__ = () => injectRenderer2();
21719
- /** Returns a Renderer2 (or throws when application was bootstrapped with Renderer3) */
21720
- function getOrCreateRenderer2(lView) {
21721
- const renderer = lView[RENDERER];
21722
- if (ngDevMode && !isProceduralRenderer(renderer)) {
21723
- throw new Error('Cannot inject Renderer2 when the application uses Renderer3!');
21724
- }
21725
- return renderer;
21726
- }
21727
21051
  /** Injects a Renderer2 for the current component. */
21728
21052
  function injectRenderer2() {
21729
21053
  // We need the Renderer to be based on the component that it's being injected into, however since
@@ -21731,7 +21055,7 @@ function injectRenderer2() {
21731
21055
  const lView = getLView();
21732
21056
  const tNode = getCurrentTNode();
21733
21057
  const nodeAtIndex = getComponentLViewByIndex(tNode.index, lView);
21734
- return getOrCreateRenderer2(isLView(nodeAtIndex) ? nodeAtIndex : lView);
21058
+ return (isLView(nodeAtIndex) ? nodeAtIndex : lView)[RENDERER];
21735
21059
  }
21736
21060
 
21737
21061
  /**
@@ -21778,7 +21102,7 @@ class Version {
21778
21102
  /**
21779
21103
  * @publicApi
21780
21104
  */
21781
- const VERSION = new Version('14.1.0-next.3');
21105
+ const VERSION = new Version('14.1.0-next.4');
21782
21106
 
21783
21107
  /**
21784
21108
  * @license
@@ -22157,375 +21481,811 @@ class RootViewRef extends ViewRef$1 {
22157
21481
  * Use of this source code is governed by an MIT-style license that can be
22158
21482
  * found in the LICENSE file at https://angular.io/license
22159
21483
  */
22160
- class ComponentFactoryResolver extends ComponentFactoryResolver$1 {
22161
- /**
22162
- * @param ngModule The NgModuleRef to which all resolved factories are bound.
22163
- */
22164
- constructor(ngModule) {
22165
- super();
22166
- this.ngModule = ngModule;
22167
- }
22168
- resolveComponentFactory(component) {
22169
- ngDevMode && assertComponentType(component);
22170
- const componentDef = getComponentDef(component);
22171
- return new ComponentFactory(componentDef, this.ngModule);
22172
- }
22173
- }
22174
- function toRefArray(map) {
22175
- const array = [];
22176
- for (let nonMinified in map) {
22177
- if (map.hasOwnProperty(nonMinified)) {
22178
- const minified = map[nonMinified];
22179
- array.push({ propName: minified, templateName: nonMinified });
21484
+ class ComponentFactoryResolver extends ComponentFactoryResolver$1 {
21485
+ /**
21486
+ * @param ngModule The NgModuleRef to which all resolved factories are bound.
21487
+ */
21488
+ constructor(ngModule) {
21489
+ super();
21490
+ this.ngModule = ngModule;
21491
+ }
21492
+ resolveComponentFactory(component) {
21493
+ ngDevMode && assertComponentType(component);
21494
+ const componentDef = getComponentDef(component);
21495
+ return new ComponentFactory(componentDef, this.ngModule);
21496
+ }
21497
+ }
21498
+ function toRefArray(map) {
21499
+ const array = [];
21500
+ for (let nonMinified in map) {
21501
+ if (map.hasOwnProperty(nonMinified)) {
21502
+ const minified = map[nonMinified];
21503
+ array.push({ propName: minified, templateName: nonMinified });
21504
+ }
21505
+ }
21506
+ return array;
21507
+ }
21508
+ function getNamespace(elementName) {
21509
+ const name = elementName.toLowerCase();
21510
+ return name === 'svg' ? SVG_NAMESPACE : (name === 'math' ? MATH_ML_NAMESPACE : null);
21511
+ }
21512
+ /**
21513
+ * Injector that looks up a value using a specific injector, before falling back to the module
21514
+ * injector. Used primarily when creating components or embedded views dynamically.
21515
+ */
21516
+ class ChainedInjector {
21517
+ constructor(injector, parentInjector) {
21518
+ this.injector = injector;
21519
+ this.parentInjector = parentInjector;
21520
+ }
21521
+ get(token, notFoundValue, flags) {
21522
+ const value = this.injector.get(token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, flags);
21523
+ if (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR ||
21524
+ notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) {
21525
+ // Return the value from the root element injector when
21526
+ // - it provides it
21527
+ // (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)
21528
+ // - the module injector should not be checked
21529
+ // (notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)
21530
+ return value;
21531
+ }
21532
+ return this.parentInjector.get(token, notFoundValue, flags);
21533
+ }
21534
+ }
21535
+ /**
21536
+ * Render3 implementation of {@link viewEngine_ComponentFactory}.
21537
+ */
21538
+ class ComponentFactory extends ComponentFactory$1 {
21539
+ /**
21540
+ * @param componentDef The component definition.
21541
+ * @param ngModule The NgModuleRef to which the factory is bound.
21542
+ */
21543
+ constructor(componentDef, ngModule) {
21544
+ super();
21545
+ this.componentDef = componentDef;
21546
+ this.ngModule = ngModule;
21547
+ this.componentType = componentDef.type;
21548
+ this.selector = stringifyCSSSelectorList(componentDef.selectors);
21549
+ this.ngContentSelectors =
21550
+ componentDef.ngContentSelectors ? componentDef.ngContentSelectors : [];
21551
+ this.isBoundToModule = !!ngModule;
21552
+ }
21553
+ get inputs() {
21554
+ return toRefArray(this.componentDef.inputs);
21555
+ }
21556
+ get outputs() {
21557
+ return toRefArray(this.componentDef.outputs);
21558
+ }
21559
+ create(injector, projectableNodes, rootSelectorOrNode, environmentInjector) {
21560
+ environmentInjector = environmentInjector || this.ngModule;
21561
+ let realEnvironmentInjector = environmentInjector instanceof EnvironmentInjector ?
21562
+ environmentInjector :
21563
+ environmentInjector?.injector;
21564
+ if (realEnvironmentInjector && this.componentDef.getStandaloneInjector !== null) {
21565
+ realEnvironmentInjector = this.componentDef.getStandaloneInjector(realEnvironmentInjector) ||
21566
+ realEnvironmentInjector;
21567
+ }
21568
+ const rootViewInjector = realEnvironmentInjector ? new ChainedInjector(injector, realEnvironmentInjector) : injector;
21569
+ const rendererFactory = rootViewInjector.get(RendererFactory2, null);
21570
+ if (rendererFactory === null) {
21571
+ throw new RuntimeError(407 /* RuntimeErrorCode.RENDERER_NOT_FOUND */, ngDevMode &&
21572
+ 'Angular was not able to inject a renderer (RendererFactory2). ' +
21573
+ 'Likely this is due to a broken DI hierarchy. ' +
21574
+ 'Make sure that any injector used to create this component has a correct parent.');
21575
+ }
21576
+ const sanitizer = rootViewInjector.get(Sanitizer, null);
21577
+ const hostRenderer = rendererFactory.createRenderer(null, this.componentDef);
21578
+ // Determine a tag name used for creating host elements when this component is created
21579
+ // dynamically. Default to 'div' if this component did not specify any tag name in its selector.
21580
+ const elementName = this.componentDef.selectors[0][0] || 'div';
21581
+ const hostRNode = rootSelectorOrNode ?
21582
+ locateHostElement(hostRenderer, rootSelectorOrNode, this.componentDef.encapsulation) :
21583
+ createElementNode(rendererFactory.createRenderer(null, this.componentDef), elementName, getNamespace(elementName));
21584
+ const rootFlags = this.componentDef.onPush ? 32 /* LViewFlags.Dirty */ | 256 /* LViewFlags.IsRoot */ :
21585
+ 16 /* LViewFlags.CheckAlways */ | 256 /* LViewFlags.IsRoot */;
21586
+ const rootContext = createRootContext();
21587
+ // Create the root view. Uses empty TView and ContentTemplate.
21588
+ const rootTView = createTView(0 /* TViewType.Root */, null, null, 1, 0, null, null, null, null, null);
21589
+ const rootLView = createLView(null, rootTView, rootContext, rootFlags, null, null, rendererFactory, hostRenderer, sanitizer, rootViewInjector, null);
21590
+ // rootView is the parent when bootstrapping
21591
+ // TODO(misko): it looks like we are entering view here but we don't really need to as
21592
+ // `renderView` does that. However as the code is written it is needed because
21593
+ // `createRootComponentView` and `createRootComponent` both read global state. Fixing those
21594
+ // issues would allow us to drop this.
21595
+ enterView(rootLView);
21596
+ let component;
21597
+ let tElementNode;
21598
+ try {
21599
+ const componentView = createRootComponentView(hostRNode, this.componentDef, rootLView, rendererFactory, hostRenderer);
21600
+ if (hostRNode) {
21601
+ if (rootSelectorOrNode) {
21602
+ setUpAttributes(hostRenderer, hostRNode, ['ng-version', VERSION.full]);
21603
+ }
21604
+ else {
21605
+ // If host element is created as a part of this function call (i.e. `rootSelectorOrNode`
21606
+ // is not defined), also apply attributes and classes extracted from component selector.
21607
+ // Extract attributes and classes from the first selector only to match VE behavior.
21608
+ const { attrs, classes } = extractAttrsAndClassesFromSelector(this.componentDef.selectors[0]);
21609
+ if (attrs) {
21610
+ setUpAttributes(hostRenderer, hostRNode, attrs);
21611
+ }
21612
+ if (classes && classes.length > 0) {
21613
+ writeDirectClass(hostRenderer, hostRNode, classes.join(' '));
21614
+ }
21615
+ }
21616
+ }
21617
+ tElementNode = getTNode(rootTView, HEADER_OFFSET);
21618
+ if (projectableNodes !== undefined) {
21619
+ const projection = tElementNode.projection = [];
21620
+ for (let i = 0; i < this.ngContentSelectors.length; i++) {
21621
+ const nodesforSlot = projectableNodes[i];
21622
+ // Projectable nodes can be passed as array of arrays or an array of iterables (ngUpgrade
21623
+ // case). Here we do normalize passed data structure to be an array of arrays to avoid
21624
+ // complex checks down the line.
21625
+ // We also normalize the length of the passed in projectable nodes (to match the number of
21626
+ // <ng-container> slots defined by a component).
21627
+ projection.push(nodesforSlot != null ? Array.from(nodesforSlot) : null);
21628
+ }
21629
+ }
21630
+ // TODO: should LifecycleHooksFeature and other host features be generated by the compiler and
21631
+ // executed here?
21632
+ // Angular 5 reference: https://stackblitz.com/edit/lifecycle-hooks-vcref
21633
+ component = createRootComponent(componentView, this.componentDef, rootLView, rootContext, [LifecycleHooksFeature]);
21634
+ renderView(rootTView, rootLView, null);
21635
+ }
21636
+ finally {
21637
+ leaveView();
21638
+ }
21639
+ return new ComponentRef(this.componentType, component, createElementRef(tElementNode, rootLView), rootLView, tElementNode);
21640
+ }
21641
+ }
21642
+ const componentFactoryResolver = new ComponentFactoryResolver();
21643
+ /**
21644
+ * Creates a ComponentFactoryResolver and stores it on the injector. Or, if the
21645
+ * ComponentFactoryResolver
21646
+ * already exists, retrieves the existing ComponentFactoryResolver.
21647
+ *
21648
+ * @returns The ComponentFactoryResolver instance to use
21649
+ */
21650
+ function injectComponentFactoryResolver() {
21651
+ return componentFactoryResolver;
21652
+ }
21653
+ /**
21654
+ * Represents an instance of a Component created via a {@link ComponentFactory}.
21655
+ *
21656
+ * `ComponentRef` provides access to the Component Instance as well other objects related to this
21657
+ * Component Instance and allows you to destroy the Component Instance via the {@link #destroy}
21658
+ * method.
21659
+ *
21660
+ */
21661
+ class ComponentRef extends ComponentRef$1 {
21662
+ constructor(componentType, instance, location, _rootLView, _tNode) {
21663
+ super();
21664
+ this.location = location;
21665
+ this._rootLView = _rootLView;
21666
+ this._tNode = _tNode;
21667
+ this.instance = instance;
21668
+ this.hostView = this.changeDetectorRef = new RootViewRef(_rootLView);
21669
+ this.componentType = componentType;
21670
+ }
21671
+ setInput(name, value) {
21672
+ const inputData = this._tNode.inputs;
21673
+ let dataValue;
21674
+ if (inputData !== null && (dataValue = inputData[name])) {
21675
+ const lView = this._rootLView;
21676
+ setInputsForProperty(lView[TVIEW], lView, dataValue, name, value);
21677
+ markDirtyIfOnPush(lView, this._tNode.index);
21678
+ }
21679
+ else {
21680
+ if (ngDevMode) {
21681
+ const cmpNameForError = stringifyForError(this.componentType);
21682
+ let message = `Can't set value of the '${name}' input on the '${cmpNameForError}' component. `;
21683
+ message += `Make sure that the '${name}' property is annotated with @Input() or a mapped @Input('${name}') exists.`;
21684
+ reportUnknownPropertyError(message);
21685
+ }
21686
+ }
21687
+ }
21688
+ get injector() {
21689
+ return new NodeInjector(this._tNode, this._rootLView);
21690
+ }
21691
+ destroy() {
21692
+ this.hostView.destroy();
21693
+ }
21694
+ onDestroy(callback) {
21695
+ this.hostView.onDestroy(callback);
21696
+ }
21697
+ }
21698
+
21699
+ /**
21700
+ * @license
21701
+ * Copyright Google LLC All Rights Reserved.
21702
+ *
21703
+ * Use of this source code is governed by an MIT-style license that can be
21704
+ * found in the LICENSE file at https://angular.io/license
21705
+ */
21706
+ /**
21707
+ * Returns a new NgModuleRef instance based on the NgModule class and parent injector provided.
21708
+ * @param ngModule NgModule class.
21709
+ * @param parentInjector Optional injector instance to use as a parent for the module injector. If
21710
+ * not provided, `NullInjector` will be used instead.
21711
+ * @publicApi
21712
+ */
21713
+ function createNgModuleRef(ngModule, parentInjector) {
21714
+ return new NgModuleRef(ngModule, parentInjector ?? null);
21715
+ }
21716
+ class NgModuleRef extends NgModuleRef$1 {
21717
+ constructor(ngModuleType, _parent) {
21718
+ super();
21719
+ this._parent = _parent;
21720
+ // tslint:disable-next-line:require-internal-with-underscore
21721
+ this._bootstrapComponents = [];
21722
+ this.injector = this;
21723
+ this.destroyCbs = [];
21724
+ // When bootstrapping a module we have a dependency graph that looks like this:
21725
+ // ApplicationRef -> ComponentFactoryResolver -> NgModuleRef. The problem is that if the
21726
+ // module being resolved tries to inject the ComponentFactoryResolver, it'll create a
21727
+ // circular dependency which will result in a runtime error, because the injector doesn't
21728
+ // exist yet. We work around the issue by creating the ComponentFactoryResolver ourselves
21729
+ // and providing it, rather than letting the injector resolve it.
21730
+ this.componentFactoryResolver = new ComponentFactoryResolver(this);
21731
+ const ngModuleDef = getNgModuleDef(ngModuleType);
21732
+ ngDevMode &&
21733
+ assertDefined(ngModuleDef, `NgModule '${stringify(ngModuleType)}' is not a subtype of 'NgModuleType'.`);
21734
+ this._bootstrapComponents = maybeUnwrapFn(ngModuleDef.bootstrap);
21735
+ this._r3Injector = createInjectorWithoutInjectorInstances(ngModuleType, _parent, [
21736
+ { provide: NgModuleRef$1, useValue: this }, {
21737
+ provide: ComponentFactoryResolver$1,
21738
+ useValue: this.componentFactoryResolver
21739
+ }
21740
+ ], stringify(ngModuleType), new Set(['environment']));
21741
+ // We need to resolve the injector types separately from the injector creation, because
21742
+ // the module might be trying to use this ref in its constructor for DI which will cause a
21743
+ // circular error that will eventually error out, because the injector isn't created yet.
21744
+ this._r3Injector.resolveInjectorInitializers();
21745
+ this.instance = this.get(ngModuleType);
21746
+ }
21747
+ get(token, notFoundValue = Injector.THROW_IF_NOT_FOUND, injectFlags = InjectFlags.Default) {
21748
+ if (token === Injector || token === NgModuleRef$1 || token === INJECTOR) {
21749
+ return this;
21750
+ }
21751
+ return this._r3Injector.get(token, notFoundValue, injectFlags);
21752
+ }
21753
+ runInContext(fn) {
21754
+ return this.injector.runInContext(fn);
21755
+ }
21756
+ destroy() {
21757
+ ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');
21758
+ const injector = this._r3Injector;
21759
+ !injector.destroyed && injector.destroy();
21760
+ this.destroyCbs.forEach(fn => fn());
21761
+ this.destroyCbs = null;
21762
+ }
21763
+ onDestroy(callback) {
21764
+ ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');
21765
+ this.destroyCbs.push(callback);
21766
+ }
21767
+ }
21768
+ class NgModuleFactory extends NgModuleFactory$1 {
21769
+ constructor(moduleType) {
21770
+ super();
21771
+ this.moduleType = moduleType;
21772
+ }
21773
+ create(parentInjector) {
21774
+ return new NgModuleRef(this.moduleType, parentInjector);
21775
+ }
21776
+ }
21777
+ class EnvironmentNgModuleRefAdapter extends NgModuleRef$1 {
21778
+ constructor(providers, parent, source) {
21779
+ super();
21780
+ this.componentFactoryResolver = new ComponentFactoryResolver(this);
21781
+ this.instance = null;
21782
+ const injector = new R3Injector([
21783
+ ...providers,
21784
+ { provide: NgModuleRef$1, useValue: this },
21785
+ { provide: ComponentFactoryResolver$1, useValue: this.componentFactoryResolver },
21786
+ ], parent || getNullInjector(), source, new Set(['environment']));
21787
+ this.injector = injector;
21788
+ injector.resolveInjectorInitializers();
21789
+ }
21790
+ destroy() {
21791
+ this.injector.destroy();
21792
+ }
21793
+ onDestroy(callback) {
21794
+ this.injector.onDestroy(callback);
21795
+ }
21796
+ }
21797
+ /**
21798
+ * Create a new environment injector.
21799
+ *
21800
+ * Learn more about environment injectors in
21801
+ * [this guide](guide/standalone-components#environment-injectors).
21802
+ *
21803
+ * @param providers An array of providers.
21804
+ * @param parent A parent environment injector.
21805
+ * @param debugName An optional name for this injector instance, which will be used in error
21806
+ * messages.
21807
+ *
21808
+ * @publicApi
21809
+ * @developerPreview
21810
+ */
21811
+ function createEnvironmentInjector(providers, parent, debugName = null) {
21812
+ const adapter = new EnvironmentNgModuleRefAdapter(providers, parent, debugName);
21813
+ return adapter.injector;
21814
+ }
21815
+
21816
+ /**
21817
+ * @license
21818
+ * Copyright Google LLC All Rights Reserved.
21819
+ *
21820
+ * Use of this source code is governed by an MIT-style license that can be
21821
+ * found in the LICENSE file at https://angular.io/license
21822
+ */
21823
+ /**
21824
+ * A service used by the framework to create instances of standalone injectors. Those injectors are
21825
+ * created on demand in case of dynamic component instantiation and contain ambient providers
21826
+ * collected from the imports graph rooted at a given standalone component.
21827
+ */
21828
+ class StandaloneService {
21829
+ constructor(_injector) {
21830
+ this._injector = _injector;
21831
+ this.cachedInjectors = new Map();
21832
+ }
21833
+ getOrCreateStandaloneInjector(componentDef) {
21834
+ if (!componentDef.standalone) {
21835
+ return null;
21836
+ }
21837
+ if (!this.cachedInjectors.has(componentDef.id)) {
21838
+ const providers = internalImportProvidersFrom(false, componentDef.type);
21839
+ const standaloneInjector = providers.length > 0 ?
21840
+ createEnvironmentInjector([providers], this._injector, `Standalone[${componentDef.type.name}]`) :
21841
+ null;
21842
+ this.cachedInjectors.set(componentDef.id, standaloneInjector);
21843
+ }
21844
+ return this.cachedInjectors.get(componentDef.id);
21845
+ }
21846
+ ngOnDestroy() {
21847
+ try {
21848
+ for (const injector of this.cachedInjectors.values()) {
21849
+ if (injector !== null) {
21850
+ injector.destroy();
21851
+ }
21852
+ }
21853
+ }
21854
+ finally {
21855
+ this.cachedInjectors.clear();
21856
+ }
21857
+ }
21858
+ }
21859
+ /** @nocollapse */
21860
+ StandaloneService.ɵprov = ɵɵdefineInjectable({
21861
+ token: StandaloneService,
21862
+ providedIn: 'environment',
21863
+ factory: () => new StandaloneService(ɵɵinject(EnvironmentInjector)),
21864
+ });
21865
+ /**
21866
+ * A feature that acts as a setup code for the {@link StandaloneService}.
21867
+ *
21868
+ * The most important responsaibility of this feature is to expose the "getStandaloneInjector"
21869
+ * function (an entry points to a standalone injector creation) on a component definition object. We
21870
+ * go through the features infrastructure to make sure that the standalone injector creation logic
21871
+ * is tree-shakable and not included in applications that don't use standalone components.
21872
+ *
21873
+ * @codeGenApi
21874
+ */
21875
+ function ɵɵStandaloneFeature(definition) {
21876
+ definition.getStandaloneInjector = (parentInjector) => {
21877
+ return parentInjector.get(StandaloneService).getOrCreateStandaloneInjector(definition);
21878
+ };
21879
+ }
21880
+
21881
+ /**
21882
+ * @license
21883
+ * Copyright Google LLC All Rights Reserved.
21884
+ *
21885
+ * Use of this source code is governed by an MIT-style license that can be
21886
+ * found in the LICENSE file at https://angular.io/license
21887
+ */
21888
+ /**
21889
+ * Retrieves the component instance associated with a given DOM element.
21890
+ *
21891
+ * @usageNotes
21892
+ * Given the following DOM structure:
21893
+ *
21894
+ * ```html
21895
+ * <app-root>
21896
+ * <div>
21897
+ * <child-comp></child-comp>
21898
+ * </div>
21899
+ * </app-root>
21900
+ * ```
21901
+ *
21902
+ * Calling `getComponent` on `<child-comp>` will return the instance of `ChildComponent`
21903
+ * associated with this DOM element.
21904
+ *
21905
+ * Calling the function on `<app-root>` will return the `MyApp` instance.
21906
+ *
21907
+ *
21908
+ * @param element DOM element from which the component should be retrieved.
21909
+ * @returns Component instance associated with the element or `null` if there
21910
+ * is no component associated with it.
21911
+ *
21912
+ * @publicApi
21913
+ * @globalApi ng
21914
+ */
21915
+ function getComponent(element) {
21916
+ ngDevMode && assertDomElement(element);
21917
+ const context = getLContext(element);
21918
+ if (context === null)
21919
+ return null;
21920
+ if (context.component === undefined) {
21921
+ const lView = context.lView;
21922
+ if (lView === null) {
21923
+ return null;
22180
21924
  }
21925
+ context.component = getComponentAtNodeIndex(context.nodeIndex, lView);
22181
21926
  }
22182
- return array;
21927
+ return context.component;
22183
21928
  }
22184
- function getNamespace(elementName) {
22185
- const name = elementName.toLowerCase();
22186
- return name === 'svg' ? SVG_NAMESPACE : (name === 'math' ? MATH_ML_NAMESPACE : null);
21929
+ /**
21930
+ * If inside an embedded view (e.g. `*ngIf` or `*ngFor`), retrieves the context of the embedded
21931
+ * view that the element is part of. Otherwise retrieves the instance of the component whose view
21932
+ * owns the element (in this case, the result is the same as calling `getOwningComponent`).
21933
+ *
21934
+ * @param element Element for which to get the surrounding component instance.
21935
+ * @returns Instance of the component that is around the element or null if the element isn't
21936
+ * inside any component.
21937
+ *
21938
+ * @publicApi
21939
+ * @globalApi ng
21940
+ */
21941
+ function getContext(element) {
21942
+ assertDomElement(element);
21943
+ const context = getLContext(element);
21944
+ const lView = context ? context.lView : null;
21945
+ return lView === null ? null : lView[CONTEXT];
22187
21946
  }
22188
21947
  /**
22189
- * Injector that looks up a value using a specific injector, before falling back to the module
22190
- * injector. Used primarily when creating components or embedded views dynamically.
21948
+ * Retrieves the component instance whose view contains the DOM element.
21949
+ *
21950
+ * For example, if `<child-comp>` is used in the template of `<app-comp>`
21951
+ * (i.e. a `ViewChild` of `<app-comp>`), calling `getOwningComponent` on `<child-comp>`
21952
+ * would return `<app-comp>`.
21953
+ *
21954
+ * @param elementOrDir DOM element, component or directive instance
21955
+ * for which to retrieve the root components.
21956
+ * @returns Component instance whose view owns the DOM element or null if the element is not
21957
+ * part of a component view.
21958
+ *
21959
+ * @publicApi
21960
+ * @globalApi ng
22191
21961
  */
22192
- class ChainedInjector {
22193
- constructor(injector, parentInjector) {
22194
- this.injector = injector;
22195
- this.parentInjector = parentInjector;
22196
- }
22197
- get(token, notFoundValue, flags) {
22198
- const value = this.injector.get(token, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, flags);
22199
- if (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR ||
22200
- notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR) {
22201
- // Return the value from the root element injector when
22202
- // - it provides it
22203
- // (value !== NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)
22204
- // - the module injector should not be checked
22205
- // (notFoundValue === NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR)
22206
- return value;
22207
- }
22208
- return this.parentInjector.get(token, notFoundValue, flags);
21962
+ function getOwningComponent(elementOrDir) {
21963
+ const context = getLContext(elementOrDir);
21964
+ let lView = context ? context.lView : null;
21965
+ if (lView === null)
21966
+ return null;
21967
+ let parent;
21968
+ while (lView[TVIEW].type === 2 /* TViewType.Embedded */ && (parent = getLViewParent(lView))) {
21969
+ lView = parent;
22209
21970
  }
21971
+ return lView[FLAGS] & 256 /* LViewFlags.IsRoot */ ? null : lView[CONTEXT];
22210
21972
  }
22211
21973
  /**
22212
- * Render3 implementation of {@link viewEngine_ComponentFactory}.
21974
+ * Retrieves all root components associated with a DOM element, directive or component instance.
21975
+ * Root components are those which have been bootstrapped by Angular.
21976
+ *
21977
+ * @param elementOrDir DOM element, component or directive instance
21978
+ * for which to retrieve the root components.
21979
+ * @returns Root components associated with the target object.
21980
+ *
21981
+ * @publicApi
21982
+ * @globalApi ng
22213
21983
  */
22214
- class ComponentFactory extends ComponentFactory$1 {
22215
- /**
22216
- * @param componentDef The component definition.
22217
- * @param ngModule The NgModuleRef to which the factory is bound.
22218
- */
22219
- constructor(componentDef, ngModule) {
22220
- super();
22221
- this.componentDef = componentDef;
22222
- this.ngModule = ngModule;
22223
- this.componentType = componentDef.type;
22224
- this.selector = stringifyCSSSelectorList(componentDef.selectors);
22225
- this.ngContentSelectors =
22226
- componentDef.ngContentSelectors ? componentDef.ngContentSelectors : [];
22227
- this.isBoundToModule = !!ngModule;
22228
- }
22229
- get inputs() {
22230
- return toRefArray(this.componentDef.inputs);
22231
- }
22232
- get outputs() {
22233
- return toRefArray(this.componentDef.outputs);
22234
- }
22235
- create(injector, projectableNodes, rootSelectorOrNode, environmentInjector) {
22236
- environmentInjector = environmentInjector || this.ngModule;
22237
- let realEnvironmentInjector = environmentInjector instanceof EnvironmentInjector ?
22238
- environmentInjector :
22239
- environmentInjector?.injector;
22240
- if (realEnvironmentInjector && this.componentDef.getStandaloneInjector !== null) {
22241
- realEnvironmentInjector = this.componentDef.getStandaloneInjector(realEnvironmentInjector) ||
22242
- realEnvironmentInjector;
22243
- }
22244
- const rootViewInjector = realEnvironmentInjector ? new ChainedInjector(injector, realEnvironmentInjector) : injector;
22245
- const rendererFactory = rootViewInjector.get(RendererFactory2, domRendererFactory3);
22246
- const sanitizer = rootViewInjector.get(Sanitizer, null);
22247
- const hostRenderer = rendererFactory.createRenderer(null, this.componentDef);
22248
- // Determine a tag name used for creating host elements when this component is created
22249
- // dynamically. Default to 'div' if this component did not specify any tag name in its selector.
22250
- const elementName = this.componentDef.selectors[0][0] || 'div';
22251
- const hostRNode = rootSelectorOrNode ?
22252
- locateHostElement(hostRenderer, rootSelectorOrNode, this.componentDef.encapsulation) :
22253
- createElementNode(rendererFactory.createRenderer(null, this.componentDef), elementName, getNamespace(elementName));
22254
- const rootFlags = this.componentDef.onPush ? 32 /* LViewFlags.Dirty */ | 256 /* LViewFlags.IsRoot */ :
22255
- 16 /* LViewFlags.CheckAlways */ | 256 /* LViewFlags.IsRoot */;
22256
- const rootContext = createRootContext();
22257
- // Create the root view. Uses empty TView and ContentTemplate.
22258
- const rootTView = createTView(0 /* TViewType.Root */, null, null, 1, 0, null, null, null, null, null);
22259
- const rootLView = createLView(null, rootTView, rootContext, rootFlags, null, null, rendererFactory, hostRenderer, sanitizer, rootViewInjector, null);
22260
- // rootView is the parent when bootstrapping
22261
- // TODO(misko): it looks like we are entering view here but we don't really need to as
22262
- // `renderView` does that. However as the code is written it is needed because
22263
- // `createRootComponentView` and `createRootComponent` both read global state. Fixing those
22264
- // issues would allow us to drop this.
22265
- enterView(rootLView);
22266
- let component;
22267
- let tElementNode;
22268
- try {
22269
- const componentView = createRootComponentView(hostRNode, this.componentDef, rootLView, rendererFactory, hostRenderer);
22270
- if (hostRNode) {
22271
- if (rootSelectorOrNode) {
22272
- setUpAttributes(hostRenderer, hostRNode, ['ng-version', VERSION.full]);
22273
- }
22274
- else {
22275
- // If host element is created as a part of this function call (i.e. `rootSelectorOrNode`
22276
- // is not defined), also apply attributes and classes extracted from component selector.
22277
- // Extract attributes and classes from the first selector only to match VE behavior.
22278
- const { attrs, classes } = extractAttrsAndClassesFromSelector(this.componentDef.selectors[0]);
22279
- if (attrs) {
22280
- setUpAttributes(hostRenderer, hostRNode, attrs);
22281
- }
22282
- if (classes && classes.length > 0) {
22283
- writeDirectClass(hostRenderer, hostRNode, classes.join(' '));
22284
- }
22285
- }
22286
- }
22287
- tElementNode = getTNode(rootTView, HEADER_OFFSET);
22288
- if (projectableNodes !== undefined) {
22289
- const projection = tElementNode.projection = [];
22290
- for (let i = 0; i < this.ngContentSelectors.length; i++) {
22291
- const nodesforSlot = projectableNodes[i];
22292
- // Projectable nodes can be passed as array of arrays or an array of iterables (ngUpgrade
22293
- // case). Here we do normalize passed data structure to be an array of arrays to avoid
22294
- // complex checks down the line.
22295
- // We also normalize the length of the passed in projectable nodes (to match the number of
22296
- // <ng-container> slots defined by a component).
22297
- projection.push(nodesforSlot != null ? Array.from(nodesforSlot) : null);
22298
- }
22299
- }
22300
- // TODO: should LifecycleHooksFeature and other host features be generated by the compiler and
22301
- // executed here?
22302
- // Angular 5 reference: https://stackblitz.com/edit/lifecycle-hooks-vcref
22303
- component = createRootComponent(componentView, this.componentDef, rootLView, rootContext, [LifecycleHooksFeature]);
22304
- renderView(rootTView, rootLView, null);
22305
- }
22306
- finally {
22307
- leaveView();
21984
+ function getRootComponents(elementOrDir) {
21985
+ const lView = readPatchedLView(elementOrDir);
21986
+ return lView !== null ? [...getRootContext(lView).components] : [];
21987
+ }
21988
+ /**
21989
+ * Retrieves an `Injector` associated with an element, component or directive instance.
21990
+ *
21991
+ * @param elementOrDir DOM element, component or directive instance for which to
21992
+ * retrieve the injector.
21993
+ * @returns Injector associated with the element, component or directive instance.
21994
+ *
21995
+ * @publicApi
21996
+ * @globalApi ng
21997
+ */
21998
+ function getInjector(elementOrDir) {
21999
+ const context = getLContext(elementOrDir);
22000
+ const lView = context ? context.lView : null;
22001
+ if (lView === null)
22002
+ return Injector.NULL;
22003
+ const tNode = lView[TVIEW].data[context.nodeIndex];
22004
+ return new NodeInjector(tNode, lView);
22005
+ }
22006
+ /**
22007
+ * Retrieve a set of injection tokens at a given DOM node.
22008
+ *
22009
+ * @param element Element for which the injection tokens should be retrieved.
22010
+ */
22011
+ function getInjectionTokens(element) {
22012
+ const context = getLContext(element);
22013
+ const lView = context ? context.lView : null;
22014
+ if (lView === null)
22015
+ return [];
22016
+ const tView = lView[TVIEW];
22017
+ const tNode = tView.data[context.nodeIndex];
22018
+ const providerTokens = [];
22019
+ const startIndex = tNode.providerIndexes & 1048575 /* TNodeProviderIndexes.ProvidersStartIndexMask */;
22020
+ const endIndex = tNode.directiveEnd;
22021
+ for (let i = startIndex; i < endIndex; i++) {
22022
+ let value = tView.data[i];
22023
+ if (isDirectiveDefHack(value)) {
22024
+ // The fact that we sometimes store Type and sometimes DirectiveDef in this location is a
22025
+ // design flaw. We should always store same type so that we can be monomorphic. The issue
22026
+ // is that for Components/Directives we store the def instead the type. The correct behavior
22027
+ // is that we should always be storing injectable type in this location.
22028
+ value = value.type;
22308
22029
  }
22309
- return new ComponentRef(this.componentType, component, createElementRef(tElementNode, rootLView), rootLView, tElementNode);
22030
+ providerTokens.push(value);
22310
22031
  }
22032
+ return providerTokens;
22311
22033
  }
22312
- const componentFactoryResolver = new ComponentFactoryResolver();
22313
22034
  /**
22314
- * Creates a ComponentFactoryResolver and stores it on the injector. Or, if the
22315
- * ComponentFactoryResolver
22316
- * already exists, retrieves the existing ComponentFactoryResolver.
22035
+ * Retrieves directive instances associated with a given DOM node. Does not include
22036
+ * component instances.
22317
22037
  *
22318
- * @returns The ComponentFactoryResolver instance to use
22038
+ * @usageNotes
22039
+ * Given the following DOM structure:
22040
+ *
22041
+ * ```html
22042
+ * <app-root>
22043
+ * <button my-button></button>
22044
+ * <my-comp></my-comp>
22045
+ * </app-root>
22046
+ * ```
22047
+ *
22048
+ * Calling `getDirectives` on `<button>` will return an array with an instance of the `MyButton`
22049
+ * directive that is associated with the DOM node.
22050
+ *
22051
+ * Calling `getDirectives` on `<my-comp>` will return an empty array.
22052
+ *
22053
+ * @param node DOM node for which to get the directives.
22054
+ * @returns Array of directives associated with the node.
22055
+ *
22056
+ * @publicApi
22057
+ * @globalApi ng
22319
22058
  */
22320
- function injectComponentFactoryResolver() {
22321
- return componentFactoryResolver;
22059
+ function getDirectives(node) {
22060
+ // Skip text nodes because we can't have directives associated with them.
22061
+ if (node instanceof Text) {
22062
+ return [];
22063
+ }
22064
+ const context = getLContext(node);
22065
+ const lView = context ? context.lView : null;
22066
+ if (lView === null) {
22067
+ return [];
22068
+ }
22069
+ const tView = lView[TVIEW];
22070
+ const nodeIndex = context.nodeIndex;
22071
+ if (!tView?.data[nodeIndex]) {
22072
+ return [];
22073
+ }
22074
+ if (context.directives === undefined) {
22075
+ context.directives = getDirectivesAtNodeIndex(nodeIndex, lView, false);
22076
+ }
22077
+ // The `directives` in this case are a named array called `LComponentView`. Clone the
22078
+ // result so we don't expose an internal data structure in the user's console.
22079
+ return context.directives === null ? [] : [...context.directives];
22322
22080
  }
22323
22081
  /**
22324
- * Represents an instance of a Component created via a {@link ComponentFactory}.
22082
+ * Returns the debug (partial) metadata for a particular directive or component instance.
22083
+ * The function accepts an instance of a directive or component and returns the corresponding
22084
+ * metadata.
22325
22085
  *
22326
- * `ComponentRef` provides access to the Component Instance as well other objects related to this
22327
- * Component Instance and allows you to destroy the Component Instance via the {@link #destroy}
22328
- * method.
22086
+ * @param directiveOrComponentInstance Instance of a directive or component
22087
+ * @returns metadata of the passed directive or component
22329
22088
  *
22089
+ * @publicApi
22090
+ * @globalApi ng
22330
22091
  */
22331
- class ComponentRef extends ComponentRef$1 {
22332
- constructor(componentType, instance, location, _rootLView, _tNode) {
22333
- super();
22334
- this.location = location;
22335
- this._rootLView = _rootLView;
22336
- this._tNode = _tNode;
22337
- this.instance = instance;
22338
- this.hostView = this.changeDetectorRef = new RootViewRef(_rootLView);
22339
- this.componentType = componentType;
22340
- }
22341
- get injector() {
22342
- return new NodeInjector(this._tNode, this._rootLView);
22092
+ function getDirectiveMetadata$1(directiveOrComponentInstance) {
22093
+ const { constructor } = directiveOrComponentInstance;
22094
+ if (!constructor) {
22095
+ throw new Error('Unable to find the instance constructor');
22343
22096
  }
22344
- destroy() {
22345
- this.hostView.destroy();
22097
+ // In case a component inherits from a directive, we may have component and directive metadata
22098
+ // To ensure we don't get the metadata of the directive, we want to call `getComponentDef` first.
22099
+ const componentDef = getComponentDef(constructor);
22100
+ if (componentDef) {
22101
+ return {
22102
+ inputs: componentDef.inputs,
22103
+ outputs: componentDef.outputs,
22104
+ encapsulation: componentDef.encapsulation,
22105
+ changeDetection: componentDef.onPush ? ChangeDetectionStrategy.OnPush :
22106
+ ChangeDetectionStrategy.Default
22107
+ };
22346
22108
  }
22347
- onDestroy(callback) {
22348
- this.hostView.onDestroy(callback);
22109
+ const directiveDef = getDirectiveDef(constructor);
22110
+ if (directiveDef) {
22111
+ return { inputs: directiveDef.inputs, outputs: directiveDef.outputs };
22349
22112
  }
22113
+ return null;
22350
22114
  }
22351
-
22352
22115
  /**
22353
- * @license
22354
- * Copyright Google LLC All Rights Reserved.
22116
+ * Retrieve map of local references.
22355
22117
  *
22356
- * Use of this source code is governed by an MIT-style license that can be
22357
- * found in the LICENSE file at https://angular.io/license
22118
+ * The references are retrieved as a map of local reference name to element or directive instance.
22119
+ *
22120
+ * @param target DOM element, component or directive instance for which to retrieve
22121
+ * the local references.
22358
22122
  */
22123
+ function getLocalRefs(target) {
22124
+ const context = getLContext(target);
22125
+ if (context === null)
22126
+ return {};
22127
+ if (context.localRefs === undefined) {
22128
+ const lView = context.lView;
22129
+ if (lView === null) {
22130
+ return {};
22131
+ }
22132
+ context.localRefs = discoverLocalRefs(lView, context.nodeIndex);
22133
+ }
22134
+ return context.localRefs || {};
22135
+ }
22359
22136
  /**
22360
- * Returns a new NgModuleRef instance based on the NgModule class and parent injector provided.
22361
- * @param ngModule NgModule class.
22362
- * @param parentInjector Optional injector instance to use as a parent for the module injector. If
22363
- * not provided, `NullInjector` will be used instead.
22137
+ * Retrieves the host element of a component or directive instance.
22138
+ * The host element is the DOM element that matched the selector of the directive.
22139
+ *
22140
+ * @param componentOrDirective Component or directive instance for which the host
22141
+ * element should be retrieved.
22142
+ * @returns Host element of the target.
22143
+ *
22364
22144
  * @publicApi
22145
+ * @globalApi ng
22365
22146
  */
22366
- function createNgModuleRef(ngModule, parentInjector) {
22367
- return new NgModuleRef(ngModule, parentInjector ?? null);
22147
+ function getHostElement(componentOrDirective) {
22148
+ return getLContext(componentOrDirective).native;
22368
22149
  }
22369
- class NgModuleRef extends NgModuleRef$1 {
22370
- constructor(ngModuleType, _parent) {
22371
- super();
22372
- this._parent = _parent;
22373
- // tslint:disable-next-line:require-internal-with-underscore
22374
- this._bootstrapComponents = [];
22375
- this.injector = this;
22376
- this.destroyCbs = [];
22377
- // When bootstrapping a module we have a dependency graph that looks like this:
22378
- // ApplicationRef -> ComponentFactoryResolver -> NgModuleRef. The problem is that if the
22379
- // module being resolved tries to inject the ComponentFactoryResolver, it'll create a
22380
- // circular dependency which will result in a runtime error, because the injector doesn't
22381
- // exist yet. We work around the issue by creating the ComponentFactoryResolver ourselves
22382
- // and providing it, rather than letting the injector resolve it.
22383
- this.componentFactoryResolver = new ComponentFactoryResolver(this);
22384
- const ngModuleDef = getNgModuleDef(ngModuleType);
22385
- ngDevMode &&
22386
- assertDefined(ngModuleDef, `NgModule '${stringify(ngModuleType)}' is not a subtype of 'NgModuleType'.`);
22387
- this._bootstrapComponents = maybeUnwrapFn(ngModuleDef.bootstrap);
22388
- this._r3Injector = createInjectorWithoutInjectorInstances(ngModuleType, _parent, [
22389
- { provide: NgModuleRef$1, useValue: this }, {
22390
- provide: ComponentFactoryResolver$1,
22391
- useValue: this.componentFactoryResolver
22150
+ /**
22151
+ * Retrieves the rendered text for a given component.
22152
+ *
22153
+ * This function retrieves the host element of a component and
22154
+ * and then returns the `textContent` for that element. This implies
22155
+ * that the text returned will include re-projected content of
22156
+ * the component as well.
22157
+ *
22158
+ * @param component The component to return the content text for.
22159
+ */
22160
+ function getRenderedText(component) {
22161
+ const hostElement = getHostElement(component);
22162
+ return hostElement.textContent || '';
22163
+ }
22164
+ /**
22165
+ * Retrieves a list of event listeners associated with a DOM element. The list does include host
22166
+ * listeners, but it does not include event listeners defined outside of the Angular context
22167
+ * (e.g. through `addEventListener`).
22168
+ *
22169
+ * @usageNotes
22170
+ * Given the following DOM structure:
22171
+ *
22172
+ * ```html
22173
+ * <app-root>
22174
+ * <div (click)="doSomething()"></div>
22175
+ * </app-root>
22176
+ * ```
22177
+ *
22178
+ * Calling `getListeners` on `<div>` will return an object that looks as follows:
22179
+ *
22180
+ * ```ts
22181
+ * {
22182
+ * name: 'click',
22183
+ * element: <div>,
22184
+ * callback: () => doSomething(),
22185
+ * useCapture: false
22186
+ * }
22187
+ * ```
22188
+ *
22189
+ * @param element Element for which the DOM listeners should be retrieved.
22190
+ * @returns Array of event listeners on the DOM element.
22191
+ *
22192
+ * @publicApi
22193
+ * @globalApi ng
22194
+ */
22195
+ function getListeners(element) {
22196
+ ngDevMode && assertDomElement(element);
22197
+ const lContext = getLContext(element);
22198
+ const lView = lContext === null ? null : lContext.lView;
22199
+ if (lView === null)
22200
+ return [];
22201
+ const tView = lView[TVIEW];
22202
+ const lCleanup = lView[CLEANUP];
22203
+ const tCleanup = tView.cleanup;
22204
+ const listeners = [];
22205
+ if (tCleanup && lCleanup) {
22206
+ for (let i = 0; i < tCleanup.length;) {
22207
+ const firstParam = tCleanup[i++];
22208
+ const secondParam = tCleanup[i++];
22209
+ if (typeof firstParam === 'string') {
22210
+ const name = firstParam;
22211
+ const listenerElement = unwrapRNode(lView[secondParam]);
22212
+ const callback = lCleanup[tCleanup[i++]];
22213
+ const useCaptureOrIndx = tCleanup[i++];
22214
+ // if useCaptureOrIndx is boolean then report it as is.
22215
+ // if useCaptureOrIndx is positive number then it in unsubscribe method
22216
+ // if useCaptureOrIndx is negative number then it is a Subscription
22217
+ const type = (typeof useCaptureOrIndx === 'boolean' || useCaptureOrIndx >= 0) ? 'dom' : 'output';
22218
+ const useCapture = typeof useCaptureOrIndx === 'boolean' ? useCaptureOrIndx : false;
22219
+ if (element == listenerElement) {
22220
+ listeners.push({ element, name, callback, useCapture, type });
22221
+ }
22392
22222
  }
22393
- ], stringify(ngModuleType), new Set(['environment']));
22394
- // We need to resolve the injector types separately from the injector creation, because
22395
- // the module might be trying to use this ref in its constructor for DI which will cause a
22396
- // circular error that will eventually error out, because the injector isn't created yet.
22397
- this._r3Injector.resolveInjectorInitializers();
22398
- this.instance = this.get(ngModuleType);
22399
- }
22400
- get(token, notFoundValue = Injector.THROW_IF_NOT_FOUND, injectFlags = InjectFlags.Default) {
22401
- if (token === Injector || token === NgModuleRef$1 || token === INJECTOR) {
22402
- return this;
22403
22223
  }
22404
- return this._r3Injector.get(token, notFoundValue, injectFlags);
22405
- }
22406
- destroy() {
22407
- ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');
22408
- const injector = this._r3Injector;
22409
- !injector.destroyed && injector.destroy();
22410
- this.destroyCbs.forEach(fn => fn());
22411
- this.destroyCbs = null;
22412
- }
22413
- onDestroy(callback) {
22414
- ngDevMode && assertDefined(this.destroyCbs, 'NgModule already destroyed');
22415
- this.destroyCbs.push(callback);
22416
- }
22417
- }
22418
- class NgModuleFactory extends NgModuleFactory$1 {
22419
- constructor(moduleType) {
22420
- super();
22421
- this.moduleType = moduleType;
22422
- }
22423
- create(parentInjector) {
22424
- return new NgModuleRef(this.moduleType, parentInjector);
22425
22224
  }
22225
+ listeners.sort(sortListeners);
22226
+ return listeners;
22426
22227
  }
22427
- class EnvironmentNgModuleRefAdapter extends NgModuleRef$1 {
22428
- constructor(providers, parent, source) {
22429
- super();
22430
- this.componentFactoryResolver = new ComponentFactoryResolver(this);
22431
- this.instance = null;
22432
- const injector = new R3Injector([
22433
- ...providers,
22434
- { provide: NgModuleRef$1, useValue: this },
22435
- { provide: ComponentFactoryResolver$1, useValue: this.componentFactoryResolver },
22436
- ], parent || getNullInjector(), source, new Set(['environment']));
22437
- this.injector = injector;
22438
- injector.resolveInjectorInitializers();
22439
- }
22440
- destroy() {
22441
- this.injector.destroy();
22442
- }
22443
- onDestroy(callback) {
22444
- this.injector.onDestroy(callback);
22445
- }
22228
+ function sortListeners(a, b) {
22229
+ if (a.name == b.name)
22230
+ return 0;
22231
+ return a.name < b.name ? -1 : 1;
22446
22232
  }
22447
22233
  /**
22448
- * Create a new environment injector.
22449
- *
22450
- * Learn more about environment injectors in
22451
- * [this guide](guide/standalone-components#environment-injectors).
22452
- *
22453
- * @param providers An array of providers.
22454
- * @param parent A parent environment injector.
22455
- * @param debugName An optional name for this injector instance, which will be used in error
22456
- * messages.
22234
+ * This function should not exist because it is megamorphic and only mostly correct.
22457
22235
  *
22458
- * @publicApi
22459
- * @developerPreview
22236
+ * See call site for more info.
22460
22237
  */
22461
- function createEnvironmentInjector(providers, parent, debugName = null) {
22462
- const adapter = new EnvironmentNgModuleRefAdapter(providers, parent, debugName);
22463
- return adapter.injector;
22238
+ function isDirectiveDefHack(obj) {
22239
+ return obj.type !== undefined && obj.template !== undefined && obj.declaredInputs !== undefined;
22464
22240
  }
22465
-
22466
22241
  /**
22467
- * @license
22468
- * Copyright Google LLC All Rights Reserved.
22242
+ * Returns the attached `DebugNode` instance for an element in the DOM.
22469
22243
  *
22470
- * Use of this source code is governed by an MIT-style license that can be
22471
- * found in the LICENSE file at https://angular.io/license
22472
- */
22473
- /**
22474
- * A service used by the framework to create instances of standalone injectors. Those injectors are
22475
- * created on demand in case of dynamic component instantiation and contain ambient providers
22476
- * collected from the imports graph rooted at a given standalone component.
22244
+ * @param element DOM element which is owned by an existing component's view.
22477
22245
  */
22478
- class StandaloneService {
22479
- constructor(_injector) {
22480
- this._injector = _injector;
22481
- this.cachedInjectors = new Map();
22246
+ function getDebugNode$1(element) {
22247
+ if (ngDevMode && !(element instanceof Node)) {
22248
+ throw new Error('Expecting instance of DOM Element');
22482
22249
  }
22483
- getOrCreateStandaloneInjector(componentDef) {
22484
- if (!componentDef.standalone) {
22485
- return null;
22486
- }
22487
- if (!this.cachedInjectors.has(componentDef.id)) {
22488
- const providers = internalImportProvidersFrom(false, componentDef.type);
22489
- const standaloneInjector = providers.length > 0 ?
22490
- createEnvironmentInjector([providers], this._injector, `Standalone[${componentDef.type.name}]`) :
22491
- null;
22492
- this.cachedInjectors.set(componentDef.id, standaloneInjector);
22493
- }
22494
- return this.cachedInjectors.get(componentDef.id);
22250
+ const lContext = getLContext(element);
22251
+ const lView = lContext ? lContext.lView : null;
22252
+ if (lView === null) {
22253
+ return null;
22495
22254
  }
22496
- ngOnDestroy() {
22497
- try {
22498
- for (const injector of this.cachedInjectors.values()) {
22499
- if (injector !== null) {
22500
- injector.destroy();
22501
- }
22502
- }
22503
- }
22504
- finally {
22505
- this.cachedInjectors.clear();
22506
- }
22255
+ const nodeIndex = lContext.nodeIndex;
22256
+ if (nodeIndex !== -1) {
22257
+ const valueInLView = lView[nodeIndex];
22258
+ // this means that value in the lView is a component with its own
22259
+ // data. In this situation the TNode is not accessed at the same spot.
22260
+ const tNode = isLView(valueInLView) ? valueInLView[T_HOST] : getTNode(lView[TVIEW], nodeIndex);
22261
+ ngDevMode &&
22262
+ assertEqual(tNode.index, nodeIndex, 'Expecting that TNode at index is same as index');
22263
+ return buildDebugNode(tNode, lView);
22507
22264
  }
22265
+ return null;
22508
22266
  }
22509
- /** @nocollapse */
22510
- StandaloneService.ɵprov = ɵɵdefineInjectable({
22511
- token: StandaloneService,
22512
- providedIn: 'environment',
22513
- factory: () => new StandaloneService(ɵɵinject(EnvironmentInjector)),
22514
- });
22515
22267
  /**
22516
- * A feature that acts as a setup code for the {@link StandaloneService}.
22268
+ * Retrieve the component `LView` from component/element.
22517
22269
  *
22518
- * The most important responsaibility of this feature is to expose the "getStandaloneInjector"
22519
- * function (an entry points to a standalone injector creation) on a component definition object. We
22520
- * go through the features infrastructure to make sure that the standalone injector creation logic
22521
- * is tree-shakable and not included in applications that don't use standalone components.
22270
+ * NOTE: `LView` is a private and should not be leaked outside.
22271
+ * Don't export this method to `ng.*` on window.
22522
22272
  *
22523
- * @codeGenApi
22273
+ * @param target DOM element or component instance for which to retrieve the LView.
22524
22274
  */
22525
- function ɵɵStandaloneFeature(definition) {
22526
- definition.getStandaloneInjector = (parentInjector) => {
22527
- return parentInjector.get(StandaloneService).getOrCreateStandaloneInjector(definition);
22528
- };
22275
+ function getComponentLView(target) {
22276
+ const lContext = getLContext(target);
22277
+ const nodeIndx = lContext.nodeIndex;
22278
+ const lView = lContext.lView;
22279
+ ngDevMode && assertLView(lView);
22280
+ const componentLView = lView[nodeIndx];
22281
+ ngDevMode && assertLView(componentLView);
22282
+ return componentLView;
22283
+ }
22284
+ /** Asserts that a value is a DOM Element. */
22285
+ function assertDomElement(value) {
22286
+ if (typeof Element !== 'undefined' && !(value instanceof Element)) {
22287
+ throw new Error('Expecting instance of DOM Element');
22288
+ }
22529
22289
  }
22530
22290
 
22531
22291
  /**
@@ -23745,7 +23505,7 @@ const unusedValueExportToPlacateAjd = 1;
23745
23505
  * Use of this source code is governed by an MIT-style license that can be
23746
23506
  * found in the LICENSE file at https://angular.io/license
23747
23507
  */
23748
- const unusedValueToPlacateAjd = unusedValueExportToPlacateAjd$1 + unusedValueExportToPlacateAjd$5 + unusedValueExportToPlacateAjd$4 + unusedValueExportToPlacateAjd;
23508
+ const unusedValueToPlacateAjd = unusedValueExportToPlacateAjd$1 + unusedValueExportToPlacateAjd$6 + unusedValueExportToPlacateAjd$5 + unusedValueExportToPlacateAjd;
23749
23509
  class LQuery_ {
23750
23510
  constructor(queryList) {
23751
23511
  this.queryList = queryList;
@@ -26179,6 +25939,99 @@ const COMPILER_OPTIONS = new InjectionToken('compilerOptions');
26179
25939
  class CompilerFactory {
26180
25940
  }
26181
25941
 
25942
+ /**
25943
+ * @license
25944
+ * Copyright Google LLC All Rights Reserved.
25945
+ *
25946
+ * Use of this source code is governed by an MIT-style license that can be
25947
+ * found in the LICENSE file at https://angular.io/license
25948
+ */
25949
+ /**
25950
+ * Marks a component for check (in case of OnPush components) and synchronously
25951
+ * performs change detection on the application this component belongs to.
25952
+ *
25953
+ * @param component Component to {@link ChangeDetectorRef#markForCheck mark for check}.
25954
+ *
25955
+ * @publicApi
25956
+ * @globalApi ng
25957
+ */
25958
+ function applyChanges(component) {
25959
+ markDirty(component);
25960
+ getRootComponents(component).forEach(rootComponent => detectChanges(rootComponent));
25961
+ }
25962
+
25963
+ /**
25964
+ * @license
25965
+ * Copyright Google LLC All Rights Reserved.
25966
+ *
25967
+ * Use of this source code is governed by an MIT-style license that can be
25968
+ * found in the LICENSE file at https://angular.io/license
25969
+ */
25970
+ /**
25971
+ * This file introduces series of globally accessible debug tools
25972
+ * to allow for the Angular debugging story to function.
25973
+ *
25974
+ * To see this in action run the following command:
25975
+ *
25976
+ * bazel run //packages/core/test/bundling/todo:devserver
25977
+ *
25978
+ * Then load `localhost:5432` and start using the console tools.
25979
+ */
25980
+ /**
25981
+ * This value reflects the property on the window where the dev
25982
+ * tools are patched (window.ng).
25983
+ * */
25984
+ const GLOBAL_PUBLISH_EXPANDO_KEY = 'ng';
25985
+ let _published = false;
25986
+ /**
25987
+ * Publishes a collection of default debug tools onto`window.ng`.
25988
+ *
25989
+ * These functions are available globally when Angular is in development
25990
+ * mode and are automatically stripped away from prod mode is on.
25991
+ */
25992
+ function publishDefaultGlobalUtils$1() {
25993
+ if (!_published) {
25994
+ _published = true;
25995
+ /**
25996
+ * Warning: this function is *INTERNAL* and should not be relied upon in application's code.
25997
+ * The contract of the function might be changed in any release and/or the function can be
25998
+ * removed completely.
25999
+ */
26000
+ publishGlobalUtil('ɵsetProfiler', setProfiler);
26001
+ publishGlobalUtil('getDirectiveMetadata', getDirectiveMetadata$1);
26002
+ publishGlobalUtil('getComponent', getComponent);
26003
+ publishGlobalUtil('getContext', getContext);
26004
+ publishGlobalUtil('getListeners', getListeners);
26005
+ publishGlobalUtil('getOwningComponent', getOwningComponent);
26006
+ publishGlobalUtil('getHostElement', getHostElement);
26007
+ publishGlobalUtil('getInjector', getInjector);
26008
+ publishGlobalUtil('getRootComponents', getRootComponents);
26009
+ publishGlobalUtil('getDirectives', getDirectives);
26010
+ publishGlobalUtil('applyChanges', applyChanges);
26011
+ }
26012
+ }
26013
+ /**
26014
+ * Publishes the given function to `window.ng` so that it can be
26015
+ * used from the browser console when an application is not in production.
26016
+ */
26017
+ function publishGlobalUtil(name, fn) {
26018
+ if (typeof COMPILED === 'undefined' || !COMPILED) {
26019
+ // Note: we can't export `ng` when using closure enhanced optimization as:
26020
+ // - closure declares globals itself for minified names, which sometimes clobber our `ng` global
26021
+ // - we can't declare a closure extern as the namespace `ng` is already used within Google
26022
+ // for typings for AngularJS (via `goog.provide('ng....')`).
26023
+ const w = _global;
26024
+ ngDevMode && assertDefined(fn, 'function not defined');
26025
+ if (w) {
26026
+ let container = w[GLOBAL_PUBLISH_EXPANDO_KEY];
26027
+ if (!container) {
26028
+ container = w[GLOBAL_PUBLISH_EXPANDO_KEY] = {};
26029
+ }
26030
+ container[name] = fn;
26031
+ }
26032
+ }
26033
+ }
26034
+
26182
26035
  /**
26183
26036
  * @license
26184
26037
  * Copyright Google LLC All Rights Reserved.
@@ -28082,7 +27935,7 @@ class DebugNode {
28082
27935
  get componentInstance() {
28083
27936
  const nativeElement = this.nativeNode;
28084
27937
  return nativeElement &&
28085
- (getComponent$1(nativeElement) || getOwningComponent(nativeElement));
27938
+ (getComponent(nativeElement) || getOwningComponent(nativeElement));
28086
27939
  }
28087
27940
  /**
28088
27941
  * An object that provides parent context for this element. Often an ancestor component instance
@@ -28093,7 +27946,7 @@ class DebugNode {
28093
27946
  * of heroes"`.
28094
27947
  */
28095
27948
  get context() {
28096
- return getComponent$1(this.nativeNode) || getContext(this.nativeNode);
27949
+ return getComponent(this.nativeNode) || getContext(this.nativeNode);
28097
27950
  }
28098
27951
  /**
28099
27952
  * The callbacks attached to the component's @Output properties and/or the element's event
@@ -28433,8 +28286,7 @@ function _queryNodeChildren(tNode, lView, predicate, matches, elementsOnly, root
28433
28286
  // Renderer2, however that's not the case in Ivy. This approach is being used because:
28434
28287
  // 1. Matching the ViewEngine behavior would mean potentially introducing a depedency
28435
28288
  // from `Renderer2` to Ivy which could bring Ivy code into ViewEngine.
28436
- // 2. We would have to make `Renderer3` "know" about debug nodes.
28437
- // 3. It allows us to capture nodes that were inserted directly via the DOM.
28289
+ // 2. It allows us to capture nodes that were inserted directly via the DOM.
28438
28290
  nativeNode && _queryNativeNodeDescendants(nativeNode, predicate, matches, elementsOnly);
28439
28291
  }
28440
28292
  // In all cases, if a dynamic container exists for this node, each view inside it has to be
@@ -29910,5 +29762,5 @@ if (typeof ngDevMode !== 'undefined' && ngDevMode) {
29910
29762
  * Generated bundle index. Do not edit.
29911
29763
  */
29912
29764
 
29913
- export { ANALYZE_FOR_ENTRY_COMPONENTS, ANIMATION_MODULE_TYPE, APP_BOOTSTRAP_LISTENER, APP_ID, APP_INITIALIZER, ApplicationInitStatus, ApplicationModule, ApplicationRef, Attribute, COMPILER_OPTIONS, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, ChangeDetectorRef, Compiler, CompilerFactory, Component, ComponentFactory$1 as ComponentFactory, ComponentFactoryResolver$1 as ComponentFactoryResolver, ComponentRef$1 as ComponentRef, ContentChild, ContentChildren, DEFAULT_CURRENCY_CODE, DebugElement, DebugEventListener, DebugNode, DefaultIterableDiffer, Directive, ENVIRONMENT_INITIALIZER, ElementRef, EmbeddedViewRef, EnvironmentInjector, ErrorHandler, EventEmitter, Host, HostBinding, HostListener, INJECTOR, Inject, InjectFlags, Injectable, InjectionToken, Injector, Input, IterableDiffers, KeyValueDiffers, LOCALE_ID, MissingTranslationStrategy, ModuleWithComponentFactories, NO_ERRORS_SCHEMA, NgModule, NgModuleFactory$1 as NgModuleFactory, NgModuleRef$1 as NgModuleRef, NgProbeToken, NgZone, Optional, Output, PACKAGE_ROOT_URL, PLATFORM_ID, PLATFORM_INITIALIZER, Pipe, PlatformRef, Query, QueryList, ReflectiveInjector, ReflectiveKey, Renderer2, RendererFactory2, RendererStyleFlags2, ResolvedReflectiveFactory, Sanitizer, SecurityContext, Self, SimpleChange, SkipSelf, TRANSLATIONS, TRANSLATIONS_FORMAT, TemplateRef, Testability, TestabilityRegistry, Type, VERSION, Version, ViewChild, ViewChildren, ViewContainerRef, ViewEncapsulation$1 as ViewEncapsulation, ViewRef, asNativeElements, assertPlatform, createEnvironmentInjector, createNgModuleRef, createPlatform, createPlatformFactory, defineInjectable, destroyPlatform, enableProdMode, forwardRef, getDebugNode, getModuleFactory, getNgModuleById, getPlatform, importProvidersFrom, inject, isDevMode, platformCore, resolveForwardRef, setTestabilityGetter, ALLOW_MULTIPLE_PLATFORMS as ɵALLOW_MULTIPLE_PLATFORMS, APP_ID_RANDOM_PROVIDER as ɵAPP_ID_RANDOM_PROVIDER, ChangeDetectorStatus as ɵChangeDetectorStatus, ComponentFactory$1 as ɵComponentFactory, Console as ɵConsole, DEFAULT_LOCALE_ID as ɵDEFAULT_LOCALE_ID, INJECTOR_SCOPE as ɵINJECTOR_SCOPE, LContext as ɵLContext, LifecycleHooksFeature as ɵLifecycleHooksFeature, LocaleDataIndex as ɵLocaleDataIndex, NG_COMP_DEF as ɵNG_COMP_DEF, NG_DIR_DEF as ɵNG_DIR_DEF, NG_ELEMENT_ID as ɵNG_ELEMENT_ID, NG_INJ_DEF as ɵNG_INJ_DEF, NG_MOD_DEF as ɵNG_MOD_DEF, NG_PIPE_DEF as ɵNG_PIPE_DEF, NG_PROV_DEF as ɵNG_PROV_DEF, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR as ɵNOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, NO_CHANGE as ɵNO_CHANGE, NgModuleFactory as ɵNgModuleFactory, NoopNgZone as ɵNoopNgZone, ReflectionCapabilities as ɵReflectionCapabilities, ComponentFactory as ɵRender3ComponentFactory, ComponentRef as ɵRender3ComponentRef, NgModuleRef as ɵRender3NgModuleRef, RuntimeError as ɵRuntimeError, TESTABILITY as ɵTESTABILITY, TESTABILITY_GETTER as ɵTESTABILITY_GETTER, ViewRef$1 as ɵViewRef, _sanitizeHtml as ɵ_sanitizeHtml, _sanitizeUrl as ɵ_sanitizeUrl, allowSanitizationBypassAndThrow as ɵallowSanitizationBypassAndThrow, bypassSanitizationTrustHtml as ɵbypassSanitizationTrustHtml, bypassSanitizationTrustResourceUrl as ɵbypassSanitizationTrustResourceUrl, bypassSanitizationTrustScript as ɵbypassSanitizationTrustScript, bypassSanitizationTrustStyle as ɵbypassSanitizationTrustStyle, bypassSanitizationTrustUrl as ɵbypassSanitizationTrustUrl, clearResolutionOfComponentResourcesQueue as ɵclearResolutionOfComponentResourcesQueue, coerceToBoolean as ɵcoerceToBoolean, compileComponent as ɵcompileComponent, compileDirective as ɵcompileDirective, compileNgModule as ɵcompileNgModule, compileNgModuleDefs as ɵcompileNgModuleDefs, compileNgModuleFactory as ɵcompileNgModuleFactory, compilePipe as ɵcompilePipe, createInjector as ɵcreateInjector, defaultIterableDiffers as ɵdefaultIterableDiffers, defaultKeyValueDiffers as ɵdefaultKeyValueDiffers, detectChanges as ɵdetectChanges, devModeEqual as ɵdevModeEqual, findLocaleData as ɵfindLocaleData, flushModuleScopingQueueAsMuchAsPossible as ɵflushModuleScopingQueueAsMuchAsPossible, getDebugNode as ɵgetDebugNode, getDebugNodeR2 as ɵgetDebugNodeR2, getDirectives as ɵgetDirectives, getHostElement as ɵgetHostElement, getInjectableDef as ɵgetInjectableDef, getLContext as ɵgetLContext, getLocaleCurrencyCode as ɵgetLocaleCurrencyCode, getLocalePluralCase as ɵgetLocalePluralCase, getSanitizationBypassType as ɵgetSanitizationBypassType, ɵgetUnknownElementStrictMode, ɵgetUnknownPropertyStrictMode, _global as ɵglobal, injectChangeDetectorRef as ɵinjectChangeDetectorRef, internalBootstrapApplication as ɵinternalBootstrapApplication, isBoundToModule as ɵisBoundToModule, isDefaultChangeDetectionStrategy as ɵisDefaultChangeDetectionStrategy, isListLikeIterable as ɵisListLikeIterable, isObservable as ɵisObservable, isPromise as ɵisPromise, isStandalone as ɵisStandalone, isSubscribable as ɵisSubscribable, ɵivyEnabled, makeDecorator as ɵmakeDecorator, markDirty as ɵmarkDirty, noSideEffects as ɵnoSideEffects, patchComponentDefWithScope as ɵpatchComponentDefWithScope, publishDefaultGlobalUtils$1 as ɵpublishDefaultGlobalUtils, publishGlobalUtil as ɵpublishGlobalUtil, registerLocaleData as ɵregisterLocaleData, renderComponent as ɵrenderComponent, resetCompiledComponents as ɵresetCompiledComponents, resetJitOptions as ɵresetJitOptions, resolveComponentResources as ɵresolveComponentResources, setAllowDuplicateNgModuleIdsForTest as ɵsetAllowDuplicateNgModuleIdsForTest, setClassMetadata as ɵsetClassMetadata, setCurrentInjector as ɵsetCurrentInjector, setDocument as ɵsetDocument, setLocaleId as ɵsetLocaleId, ɵsetUnknownElementStrictMode, ɵsetUnknownPropertyStrictMode, store as ɵstore, stringify as ɵstringify, transitiveScopesFor as ɵtransitiveScopesFor, unregisterAllLocaleData as ɵunregisterLocaleData, unwrapSafeValue as ɵunwrapSafeValue, whenRendered as ɵwhenRendered, ɵɵCopyDefinitionFeature, FactoryTarget as ɵɵFactoryTarget, ɵɵInheritDefinitionFeature, ɵɵNgOnChangesFeature, ɵɵProvidersFeature, ɵɵStandaloneFeature, ɵɵadvance, ɵɵattribute, ɵɵattributeInterpolate1, ɵɵattributeInterpolate2, ɵɵattributeInterpolate3, ɵɵattributeInterpolate4, ɵɵattributeInterpolate5, ɵɵattributeInterpolate6, ɵɵattributeInterpolate7, ɵɵattributeInterpolate8, ɵɵattributeInterpolateV, ɵɵclassMap, ɵɵclassMapInterpolate1, ɵɵclassMapInterpolate2, ɵɵclassMapInterpolate3, ɵɵclassMapInterpolate4, ɵɵclassMapInterpolate5, ɵɵclassMapInterpolate6, ɵɵclassMapInterpolate7, ɵɵclassMapInterpolate8, ɵɵclassMapInterpolateV, ɵɵclassProp, ɵɵcontentQuery, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵdefineInjectable, ɵɵdefineInjector, ɵɵdefineNgModule, ɵɵdefinePipe, ɵɵdirectiveInject, ɵɵdisableBindings, ɵɵelement, ɵɵelementContainer, ɵɵelementContainerEnd, ɵɵelementContainerStart, ɵɵelementEnd, ɵɵelementStart, ɵɵenableBindings, ɵɵgetCurrentView, ɵɵgetInheritedFactory, ɵɵhostProperty, ɵɵi18n, ɵɵi18nApply, ɵɵi18nAttributes, ɵɵi18nEnd, ɵɵi18nExp, ɵɵi18nPostprocess, ɵɵi18nStart, ɵɵinject, ɵɵinjectAttribute, ɵɵinvalidFactory, ɵɵinvalidFactoryDep, ɵɵlistener, ɵɵloadQuery, ɵɵnamespaceHTML, ɵɵnamespaceMathML, ɵɵnamespaceSVG, ɵɵnextContext, ɵɵngDeclareClassMetadata, ɵɵngDeclareComponent, ɵɵngDeclareDirective, ɵɵngDeclareFactory, ɵɵngDeclareInjectable, ɵɵngDeclareInjector, ɵɵngDeclareNgModule, ɵɵngDeclarePipe, ɵɵpipe, ɵɵpipeBind1, ɵɵpipeBind2, ɵɵpipeBind3, ɵɵpipeBind4, ɵɵpipeBindV, ɵɵprojection, ɵɵprojectionDef, ɵɵproperty, ɵɵpropertyInterpolate, ɵɵpropertyInterpolate1, ɵɵpropertyInterpolate2, ɵɵpropertyInterpolate3, ɵɵpropertyInterpolate4, ɵɵpropertyInterpolate5, ɵɵpropertyInterpolate6, ɵɵpropertyInterpolate7, ɵɵpropertyInterpolate8, ɵɵpropertyInterpolateV, ɵɵpureFunction0, ɵɵpureFunction1, ɵɵpureFunction2, ɵɵpureFunction3, ɵɵpureFunction4, ɵɵpureFunction5, ɵɵpureFunction6, ɵɵpureFunction7, ɵɵpureFunction8, ɵɵpureFunctionV, ɵɵqueryRefresh, ɵɵreference, registerNgModuleType as ɵɵregisterNgModuleType, ɵɵresetView, ɵɵresolveBody, ɵɵresolveDocument, ɵɵresolveWindow, ɵɵrestoreView, ɵɵsanitizeHtml, ɵɵsanitizeResourceUrl, ɵɵsanitizeScript, ɵɵsanitizeStyle, ɵɵsanitizeUrl, ɵɵsanitizeUrlOrResourceUrl, ɵɵsetComponentScope, ɵɵsetNgModuleScope, ɵɵstyleMap, ɵɵstyleMapInterpolate1, ɵɵstyleMapInterpolate2, ɵɵstyleMapInterpolate3, ɵɵstyleMapInterpolate4, ɵɵstyleMapInterpolate5, ɵɵstyleMapInterpolate6, ɵɵstyleMapInterpolate7, ɵɵstyleMapInterpolate8, ɵɵstyleMapInterpolateV, ɵɵstyleProp, ɵɵstylePropInterpolate1, ɵɵstylePropInterpolate2, ɵɵstylePropInterpolate3, ɵɵstylePropInterpolate4, ɵɵstylePropInterpolate5, ɵɵstylePropInterpolate6, ɵɵstylePropInterpolate7, ɵɵstylePropInterpolate8, ɵɵstylePropInterpolateV, ɵɵsyntheticHostListener, ɵɵsyntheticHostProperty, ɵɵtemplate, ɵɵtemplateRefExtractor, ɵɵtext, ɵɵtextInterpolate, ɵɵtextInterpolate1, ɵɵtextInterpolate2, ɵɵtextInterpolate3, ɵɵtextInterpolate4, ɵɵtextInterpolate5, ɵɵtextInterpolate6, ɵɵtextInterpolate7, ɵɵtextInterpolate8, ɵɵtextInterpolateV, ɵɵtrustConstantHtml, ɵɵtrustConstantResourceUrl, ɵɵviewQuery };
29765
+ export { ANALYZE_FOR_ENTRY_COMPONENTS, ANIMATION_MODULE_TYPE, APP_BOOTSTRAP_LISTENER, APP_ID, APP_INITIALIZER, ApplicationInitStatus, ApplicationModule, ApplicationRef, Attribute, COMPILER_OPTIONS, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, ChangeDetectorRef, Compiler, CompilerFactory, Component, ComponentFactory$1 as ComponentFactory, ComponentFactoryResolver$1 as ComponentFactoryResolver, ComponentRef$1 as ComponentRef, ContentChild, ContentChildren, DEFAULT_CURRENCY_CODE, DebugElement, DebugEventListener, DebugNode, DefaultIterableDiffer, Directive, ENVIRONMENT_INITIALIZER, ElementRef, EmbeddedViewRef, EnvironmentInjector, ErrorHandler, EventEmitter, Host, HostBinding, HostListener, INJECTOR, Inject, InjectFlags, Injectable, InjectionToken, Injector, Input, IterableDiffers, KeyValueDiffers, LOCALE_ID, MissingTranslationStrategy, ModuleWithComponentFactories, NO_ERRORS_SCHEMA, NgModule, NgModuleFactory$1 as NgModuleFactory, NgModuleRef$1 as NgModuleRef, NgProbeToken, NgZone, Optional, Output, PACKAGE_ROOT_URL, PLATFORM_ID, PLATFORM_INITIALIZER, Pipe, PlatformRef, Query, QueryList, ReflectiveInjector, ReflectiveKey, Renderer2, RendererFactory2, RendererStyleFlags2, ResolvedReflectiveFactory, Sanitizer, SecurityContext, Self, SimpleChange, SkipSelf, TRANSLATIONS, TRANSLATIONS_FORMAT, TemplateRef, Testability, TestabilityRegistry, Type, VERSION, Version, ViewChild, ViewChildren, ViewContainerRef, ViewEncapsulation$1 as ViewEncapsulation, ViewRef, asNativeElements, assertPlatform, createEnvironmentInjector, createNgModuleRef, createPlatform, createPlatformFactory, defineInjectable, destroyPlatform, enableProdMode, forwardRef, getDebugNode, getModuleFactory, getNgModuleById, getPlatform, importProvidersFrom, inject, isDevMode, platformCore, resolveForwardRef, setTestabilityGetter, ALLOW_MULTIPLE_PLATFORMS as ɵALLOW_MULTIPLE_PLATFORMS, APP_ID_RANDOM_PROVIDER as ɵAPP_ID_RANDOM_PROVIDER, ChangeDetectorStatus as ɵChangeDetectorStatus, ComponentFactory$1 as ɵComponentFactory, Console as ɵConsole, DEFAULT_LOCALE_ID as ɵDEFAULT_LOCALE_ID, INJECTOR_SCOPE as ɵINJECTOR_SCOPE, LContext as ɵLContext, LifecycleHooksFeature as ɵLifecycleHooksFeature, LocaleDataIndex as ɵLocaleDataIndex, NG_COMP_DEF as ɵNG_COMP_DEF, NG_DIR_DEF as ɵNG_DIR_DEF, NG_ELEMENT_ID as ɵNG_ELEMENT_ID, NG_INJ_DEF as ɵNG_INJ_DEF, NG_MOD_DEF as ɵNG_MOD_DEF, NG_PIPE_DEF as ɵNG_PIPE_DEF, NG_PROV_DEF as ɵNG_PROV_DEF, NOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR as ɵNOT_FOUND_CHECK_ONLY_ELEMENT_INJECTOR, NO_CHANGE as ɵNO_CHANGE, NgModuleFactory as ɵNgModuleFactory, NoopNgZone as ɵNoopNgZone, ReflectionCapabilities as ɵReflectionCapabilities, ComponentFactory as ɵRender3ComponentFactory, ComponentRef as ɵRender3ComponentRef, NgModuleRef as ɵRender3NgModuleRef, RuntimeError as ɵRuntimeError, TESTABILITY as ɵTESTABILITY, TESTABILITY_GETTER as ɵTESTABILITY_GETTER, ViewRef$1 as ɵViewRef, _sanitizeHtml as ɵ_sanitizeHtml, _sanitizeUrl as ɵ_sanitizeUrl, allowSanitizationBypassAndThrow as ɵallowSanitizationBypassAndThrow, bypassSanitizationTrustHtml as ɵbypassSanitizationTrustHtml, bypassSanitizationTrustResourceUrl as ɵbypassSanitizationTrustResourceUrl, bypassSanitizationTrustScript as ɵbypassSanitizationTrustScript, bypassSanitizationTrustStyle as ɵbypassSanitizationTrustStyle, bypassSanitizationTrustUrl as ɵbypassSanitizationTrustUrl, clearResolutionOfComponentResourcesQueue as ɵclearResolutionOfComponentResourcesQueue, coerceToBoolean as ɵcoerceToBoolean, compileComponent as ɵcompileComponent, compileDirective as ɵcompileDirective, compileNgModule as ɵcompileNgModule, compileNgModuleDefs as ɵcompileNgModuleDefs, compileNgModuleFactory as ɵcompileNgModuleFactory, compilePipe as ɵcompilePipe, createInjector as ɵcreateInjector, defaultIterableDiffers as ɵdefaultIterableDiffers, defaultKeyValueDiffers as ɵdefaultKeyValueDiffers, detectChanges as ɵdetectChanges, devModeEqual as ɵdevModeEqual, findLocaleData as ɵfindLocaleData, flushModuleScopingQueueAsMuchAsPossible as ɵflushModuleScopingQueueAsMuchAsPossible, getDebugNode as ɵgetDebugNode, getDebugNodeR2 as ɵgetDebugNodeR2, getDirectives as ɵgetDirectives, getHostElement as ɵgetHostElement, getInjectableDef as ɵgetInjectableDef, getLContext as ɵgetLContext, getLocaleCurrencyCode as ɵgetLocaleCurrencyCode, getLocalePluralCase as ɵgetLocalePluralCase, getSanitizationBypassType as ɵgetSanitizationBypassType, ɵgetUnknownElementStrictMode, ɵgetUnknownPropertyStrictMode, _global as ɵglobal, injectChangeDetectorRef as ɵinjectChangeDetectorRef, internalBootstrapApplication as ɵinternalBootstrapApplication, isBoundToModule as ɵisBoundToModule, isDefaultChangeDetectionStrategy as ɵisDefaultChangeDetectionStrategy, isListLikeIterable as ɵisListLikeIterable, isObservable as ɵisObservable, isPromise as ɵisPromise, isStandalone as ɵisStandalone, isSubscribable as ɵisSubscribable, ɵivyEnabled, makeDecorator as ɵmakeDecorator, markDirty as ɵmarkDirty, noSideEffects as ɵnoSideEffects, patchComponentDefWithScope as ɵpatchComponentDefWithScope, publishDefaultGlobalUtils$1 as ɵpublishDefaultGlobalUtils, publishGlobalUtil as ɵpublishGlobalUtil, registerLocaleData as ɵregisterLocaleData, resetCompiledComponents as ɵresetCompiledComponents, resetJitOptions as ɵresetJitOptions, resolveComponentResources as ɵresolveComponentResources, setAllowDuplicateNgModuleIdsForTest as ɵsetAllowDuplicateNgModuleIdsForTest, setClassMetadata as ɵsetClassMetadata, setCurrentInjector as ɵsetCurrentInjector, setDocument as ɵsetDocument, setLocaleId as ɵsetLocaleId, ɵsetUnknownElementStrictMode, ɵsetUnknownPropertyStrictMode, store as ɵstore, stringify as ɵstringify, transitiveScopesFor as ɵtransitiveScopesFor, unregisterAllLocaleData as ɵunregisterLocaleData, unwrapSafeValue as ɵunwrapSafeValue, whenRendered as ɵwhenRendered, ɵɵCopyDefinitionFeature, FactoryTarget as ɵɵFactoryTarget, ɵɵInheritDefinitionFeature, ɵɵNgOnChangesFeature, ɵɵProvidersFeature, ɵɵStandaloneFeature, ɵɵadvance, ɵɵattribute, ɵɵattributeInterpolate1, ɵɵattributeInterpolate2, ɵɵattributeInterpolate3, ɵɵattributeInterpolate4, ɵɵattributeInterpolate5, ɵɵattributeInterpolate6, ɵɵattributeInterpolate7, ɵɵattributeInterpolate8, ɵɵattributeInterpolateV, ɵɵclassMap, ɵɵclassMapInterpolate1, ɵɵclassMapInterpolate2, ɵɵclassMapInterpolate3, ɵɵclassMapInterpolate4, ɵɵclassMapInterpolate5, ɵɵclassMapInterpolate6, ɵɵclassMapInterpolate7, ɵɵclassMapInterpolate8, ɵɵclassMapInterpolateV, ɵɵclassProp, ɵɵcontentQuery, ɵɵdefineComponent, ɵɵdefineDirective, ɵɵdefineInjectable, ɵɵdefineInjector, ɵɵdefineNgModule, ɵɵdefinePipe, ɵɵdirectiveInject, ɵɵdisableBindings, ɵɵelement, ɵɵelementContainer, ɵɵelementContainerEnd, ɵɵelementContainerStart, ɵɵelementEnd, ɵɵelementStart, ɵɵenableBindings, ɵɵgetCurrentView, ɵɵgetInheritedFactory, ɵɵhostProperty, ɵɵi18n, ɵɵi18nApply, ɵɵi18nAttributes, ɵɵi18nEnd, ɵɵi18nExp, ɵɵi18nPostprocess, ɵɵi18nStart, ɵɵinject, ɵɵinjectAttribute, ɵɵinvalidFactory, ɵɵinvalidFactoryDep, ɵɵlistener, ɵɵloadQuery, ɵɵnamespaceHTML, ɵɵnamespaceMathML, ɵɵnamespaceSVG, ɵɵnextContext, ɵɵngDeclareClassMetadata, ɵɵngDeclareComponent, ɵɵngDeclareDirective, ɵɵngDeclareFactory, ɵɵngDeclareInjectable, ɵɵngDeclareInjector, ɵɵngDeclareNgModule, ɵɵngDeclarePipe, ɵɵpipe, ɵɵpipeBind1, ɵɵpipeBind2, ɵɵpipeBind3, ɵɵpipeBind4, ɵɵpipeBindV, ɵɵprojection, ɵɵprojectionDef, ɵɵproperty, ɵɵpropertyInterpolate, ɵɵpropertyInterpolate1, ɵɵpropertyInterpolate2, ɵɵpropertyInterpolate3, ɵɵpropertyInterpolate4, ɵɵpropertyInterpolate5, ɵɵpropertyInterpolate6, ɵɵpropertyInterpolate7, ɵɵpropertyInterpolate8, ɵɵpropertyInterpolateV, ɵɵpureFunction0, ɵɵpureFunction1, ɵɵpureFunction2, ɵɵpureFunction3, ɵɵpureFunction4, ɵɵpureFunction5, ɵɵpureFunction6, ɵɵpureFunction7, ɵɵpureFunction8, ɵɵpureFunctionV, ɵɵqueryRefresh, ɵɵreference, registerNgModuleType as ɵɵregisterNgModuleType, ɵɵresetView, ɵɵresolveBody, ɵɵresolveDocument, ɵɵresolveWindow, ɵɵrestoreView, ɵɵsanitizeHtml, ɵɵsanitizeResourceUrl, ɵɵsanitizeScript, ɵɵsanitizeStyle, ɵɵsanitizeUrl, ɵɵsanitizeUrlOrResourceUrl, ɵɵsetComponentScope, ɵɵsetNgModuleScope, ɵɵstyleMap, ɵɵstyleMapInterpolate1, ɵɵstyleMapInterpolate2, ɵɵstyleMapInterpolate3, ɵɵstyleMapInterpolate4, ɵɵstyleMapInterpolate5, ɵɵstyleMapInterpolate6, ɵɵstyleMapInterpolate7, ɵɵstyleMapInterpolate8, ɵɵstyleMapInterpolateV, ɵɵstyleProp, ɵɵstylePropInterpolate1, ɵɵstylePropInterpolate2, ɵɵstylePropInterpolate3, ɵɵstylePropInterpolate4, ɵɵstylePropInterpolate5, ɵɵstylePropInterpolate6, ɵɵstylePropInterpolate7, ɵɵstylePropInterpolate8, ɵɵstylePropInterpolateV, ɵɵsyntheticHostListener, ɵɵsyntheticHostProperty, ɵɵtemplate, ɵɵtemplateRefExtractor, ɵɵtext, ɵɵtextInterpolate, ɵɵtextInterpolate1, ɵɵtextInterpolate2, ɵɵtextInterpolate3, ɵɵtextInterpolate4, ɵɵtextInterpolate5, ɵɵtextInterpolate6, ɵɵtextInterpolate7, ɵɵtextInterpolate8, ɵɵtextInterpolateV, ɵɵtrustConstantHtml, ɵɵtrustConstantResourceUrl, ɵɵviewQuery };
29914
29766
  //# sourceMappingURL=core.mjs.map